/* 拼多多利润计算工具箱 · 样式 */
:root {
  --red: #e02e24;
  --red-dark: #b71f17;
  --orange: #ff6a00;
  --ink: #1f2329;
  --ink-2: #5a6169;
  --ink-3: #8a9199;
  --line: #e6e8eb;
  --bg: #f4f5f7;
  --card: #ffffff;
  --green: #0f9d58;
  --amber: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-logo {
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .5px;
  padding: 4px 7px;
  border-radius: 6px;
}
.brand-name { font-weight: 600; font-size: 15px; }

.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-link {
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-link:hover { background: #f2f3f5; text-decoration: none; }
.nav-link.on { color: var(--red); background: #fff1f0; font-weight: 600; }
.nav-link .lock { font-style: normal; font-size: 11px; opacity: .8; }

.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge.vip { background: #fff1f0; color: var(--red); border: 1px solid #ffd7d4; }
.badge.free { background: #f2f3f5; color: var(--ink-3); }
.nick { color: var(--ink-2); }
.coin { color: var(--green); font-weight: 600; }
.mini { color: var(--ink-3); }

.main { padding: 22px 16px 60px; }

/* 页头 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* 卡片 / 面板 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card h3 .tip { font-weight: 400; color: var(--ink-3); font-size: 12.5px; margin-left: 8px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* 指标 */
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .k { color: var(--ink-3); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v.green { color: var(--green); }
.stat .v.red { color: var(--red); }
.stat .f { color: var(--ink-3); font-size: 12px; margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 15px;
  font-size: 13.5px;
  cursor: pointer;
  background: #f2f3f5;
  color: var(--ink);
  line-height: 1.2;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-link { background: none; border: none; color: var(--red); padding: 0; cursor: pointer; font-size: 13px; }
.btn-danger { background: #fff; border-color: #f5c2c0; color: var(--red); }

/* 表单 */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #ffe2e0; border-color: var(--red); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .form-row { margin-bottom: 0; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.hint { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #fafbfc; color: var(--ink-2); font-weight: 600; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fcfcfd; }
.tag-bad { color: var(--red); }
.tag-warn { color: var(--amber); }
.tag-ok { color: var(--green); }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* 提示条 */
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.alert.ok { background: #eaf7ef; color: #14713f; border: 1px solid #c8e9d3; }
.alert.warn { background: #fff8e6; color: #8a5a00; border: 1px solid #f3e0b3; }
.alert.error { background: #fdeceb; color: #a5180f; border: 1px solid #f7c9c5; }

/* 会员拦截卡 */
.gate { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 42px 28px; text-align: center; }
.gate-icon { font-size: 34px; }
.gate h2 { font-size: 18px; margin: 10px 0 8px; }
.gate p { color: var(--ink-2); margin: 6px 0; }
.gate-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 底栏 */
.foot { border-top: 1px solid var(--line); background: #fff; padding: 16px 0; color: var(--ink-3); font-size: 12.5px; }
.foot .wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.foot .dot { color: #ccc; }



/* ---------- 扫码付款（v1.1.0） ---------- */
.pay-grid { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 4px; }
.pay-qr {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px;
  text-align: center; background: #fff; width: 232px; max-width: 100%; box-sizing: border-box;
}
.pay-qr-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--ink); }
.pay-qr img {
  max-width: 100%; max-height: 300px; width: auto; height: auto; object-fit: contain; background: #fff;
  border-radius: 8px; display: block; margin: 0 auto;
}
.pay-qr-hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.pay-form { border-top: 1px dashed var(--line); padding-top: 16px; }
.pay-kind { display: flex; gap: 18px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.radio input { width: auto; margin: 0; }
.btn-lg { padding: 12px 26px; font-size: 15px; font-weight: 700; }
.tip2 { color: var(--ink-3); font-size: 12px; margin-top: 4px; }

/* 短信匹配到账的行高亮（v1.2.0） */
.row-hit td { background: #f2fbf4; }
.row-hit td:first-child { border-left: 3px solid var(--green); }

/* 免费天卡卡片（v1.3.0） */
.card-free { border-color: #b7e3c4; background: linear-gradient(180deg, #f6fcf8 0%, #ffffff 100%); }
.btn-free { background: var(--green) !important; border-color: var(--green) !important; }


/* 余额不足弹框（v1.3.2） */
.modal-mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(17, 24, 39, .55); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 16px; padding: 26px 26px 22px;
  width: 100%; max-width: 420px; box-shadow: 0 18px 50px rgba(0,0,0,.25);
  text-align: center; animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-ico {
  width: 52px; height: 52px; line-height: 52px; border-radius: 50%;
  background: #fff2f0; color: var(--red); font-size: 28px; font-weight: 700;
  margin: 0 auto 12px;
}
.modal-box h3 { margin: 0 0 10px; font-size: 19px; color: var(--ink); }
.modal-txt { font-size: 14px; line-height: 1.9; color: var(--ink-2); margin-bottom: 18px; }
.modal-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.modal-btns .btn { min-width: 130px; }
