/* ===== 号卡佣金结算系统 ===== */
:root {
  --bg: #f1f3f7;
  --card: #ffffff;
  --ink: #141a29;
  --ink2: #5b6478;
  --ink3: #98a1b3;
  --line: #e6e9f0;
  --navy: #16213d;
  --navy2: #23304f;
  --gold: #b8862c;
  --gold-l: #d9a441;
  --gold-soft: #fbf3e2;
  --green: #0f8a4d;
  --green-soft: #e8f7ef;
  --orange: #c2620a;
  --orange-soft: #fdf1e3;
  --red: #c0342b;
  --red-soft: #fdeceb;
  --blue: #2563a8;
  --blue-soft: #eaf1fa;
  --r: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 41, .05), 0 8px 24px -12px rgba(20, 26, 41, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 40px; }

a { color: var(--blue); text-decoration: none; }
.hide { display: none !important; }
.muted { color: var(--ink3); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- 布局 ---------- */
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px -10px rgba(0, 0, 0, .5);
}
.topbar .inner {
  max-width: 1180px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 14px;
}
.topbar .brand { font-size: 15px; font-weight: 700; letter-spacing: .3px; flex: 0 0 auto; }
.topbar .brand span { color: var(--gold-l); }
.topbar .sp { flex: 1; min-width: 8px; }
.topbar .who {
  font-size: 12.5px; color: #b9c2d6;
  min-width: 0; max-width: 46vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .who b { color: #fff; font-weight: 600; }
.topbar .btn { flex: 0 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.card-hd h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.card-hd .sub { font-size: 12px; color: var(--ink3); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cdd3e0; background: #fafbfd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy2); border-color: var(--navy2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #a8761f; border-color: #a8761f; }
.btn.danger { background: #fff; border-color: #f0c9c5; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: rgba(20, 26, 41, .05); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.input, select.input {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; color: var(--ink);
  font-size: 15px; font-family: inherit;
  outline: none; transition: .15s;
}
.input:focus { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(22, 33, 61, .07); }
.input::placeholder { color: #b6bdcb; }
.hint { font-size: 12px; color: var(--ink3); margin-top: 6px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1e2b4a 0%, #101728 45%, #0b1020 100%);
}
.login-box { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--gold-l), #a8761f);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 24px -8px rgba(217, 164, 65, .8);
}
.login-logo h1 { margin: 0; font-size: 19px; color: #fff; letter-spacing: 1px; font-weight: 700; }
.login-logo p { margin: 6px 0 0; font-size: 12.5px; color: #8e9ab3; letter-spacing: .5px; }

.login-card {
  background: #fff; border-radius: 18px; padding: 24px 22px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
}
.login-tabs { display: flex; gap: 6px; background: #f1f3f7; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.login-tabs button {
  flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink2); font-family: inherit; cursor: pointer;
}
.login-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.login-foot { text-align: center; margin-top: 18px; font-size: 11.5px; color: #6d7a92; }

/* ---------- 余额卡 ---------- */
.balance-card {
  background: linear-gradient(135deg, #1b2848 0%, #131b30 60%, #0f1628 100%);
  border-radius: 18px; padding: 22px;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 16px 40px -18px rgba(16, 22, 40, .8);
}
.balance-card::after {
  content: ""; position: absolute; right: -60px; top: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 164, 65, .22), transparent 65%);
}
.balance-card .lbl {
  font-size: 12.5px; color: #a8b3cc; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
}
.balance-card .lbl .tag-lock {
  font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
  background: rgba(217, 164, 65, .18); color: var(--gold-l); font-weight: 600;
  letter-spacing: 0;
}
.balance-card .amount {
  font-size: 42px; font-weight: 800; letter-spacing: -1px;
  margin: 8px 0 2px; line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.balance-card .amount small { font-size: 20px; font-weight: 600; margin-right: 2px; opacity: .85; }
.balance-card .amount .dec { font-size: 24px; opacity: .75; }
.balance-card .note {
  font-size: 11.5px; color: #8b96b0; margin-top: 10px;
  padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.balance-card .note span { display: inline-flex; align-items: center; gap: 4px; }
.balance-card .note i { font-style: normal; color: #6f7b96; }
.balance-card .sub-line {
  display: flex; gap: 22px; margin-top: 14px;
}
.balance-card .sub-line div { font-size: 11.5px; color: #8b96b0; }
.balance-card .sub-line b { display: block; font-size: 16px; color: #dfe5f2; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- 上传框 ---------- */
.upgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upbox {
  position: relative; border: 1.5px dashed #cfd6e4; border-radius: 12px;
  background: #fafbfd; min-height: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px; text-align: center; cursor: pointer; transition: .15s; overflow: hidden;
}
.upbox:hover { border-color: var(--navy); background: #f7f9fd; }
.upbox.filled { border-style: solid; border-color: var(--line); background: #fff; padding: 0; }
.upbox .ico { font-size: 22px; opacity: .5; margin-bottom: 6px; }
.upbox .t { font-size: 12.5px; font-weight: 600; color: var(--ink2); line-height: 1.45; }
.upbox .d { font-size: 10.5px; color: var(--ink3); margin-top: 4px; line-height: 1.4; }
.upbox img { width: 100%; height: 128px; object-fit: cover; display: block; }
.upbox .redo {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(20, 26, 41, .78); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
}
.upbox .okmark {
  position: absolute; left: 6px; top: 6px;
  background: var(--green); color: #fff; font-size: 10.5px;
  padding: 2px 7px; border-radius: 5px; font-weight: 600;
}

/* ---------- 佣金预估条 ---------- */
.calc-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gold-soft); border: 1px solid #f0e2c6;
  border-radius: 11px; padding: 11px 14px; margin-top: 12px;
}
.calc-bar .l { font-size: 12.5px; color: #8a6a24; }
.calc-bar .l b { font-family: inherit; }
.calc-bar .r { font-size: 20px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.calc-bar .r small { font-size: 12px; font-weight: 600; }

/* ---------- 收款码 ---------- */
.qr-row { display: flex; gap: 14px; align-items: center; }
.qr-box {
  width: 92px; height: 92px; flex: 0 0 auto;
  border-radius: 12px; border: 1.5px dashed #cfd6e4; background: #fafbfd;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
}
.qr-box.filled { border-style: solid; border-color: var(--line); }
.qr-box img { width: 100%; height: 100%; object-fit: cover; }
.qr-box .ph { font-size: 11px; color: var(--ink3); text-align: center; line-height: 1.4; padding: 0 6px; }
.qr-info { flex: 1; min-width: 0; }
.qr-info .t { font-size: 13.5px; font-weight: 600; }
.qr-info .s { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.qr-warn {
  margin-top: 10px; background: var(--red-soft); border: 1px solid #f6d5d2;
  color: #a02a22; font-size: 12px; padding: 9px 12px; border-radius: 9px;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 6px; line-height: 1.5; white-space: nowrap;
}
.tag.approved { background: var(--orange-soft); color: var(--orange); }
.tag.pending { background: var(--blue-soft); color: var(--blue); }
.tag.settled { background: var(--green-soft); color: var(--green); }
.tag.rejected { background: var(--red-soft); color: var(--red); }
.tag.gray { background: #eef0f5; color: var(--ink2); }

/* ---------- 记录列表 ---------- */
.rec-list { display: flex; flex-direction: column; }
.rec {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f2f4f8;
}
.rec:last-child { border-bottom: 0; }
.rec .avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  background: #eef1f7; color: var(--ink2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.rec .mid { flex: 1; min-width: 0; }
.rec .mid .t1 { font-size: 13.5px; font-weight: 600; }
.rec .mid .t2 { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.rec .right { text-align: right; flex: 0 0 auto; }
.rec .right .amt { font-size: 15px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.rec .right .amt.zero { color: var(--ink3); }

.empty {
  text-align: center; padding: 34px 10px; color: var(--ink3); font-size: 12.5px;
}
.empty .ico { font-size: 26px; opacity: .35; display: block; margin-bottom: 8px; }

/* ---------- 表格（管理端） ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink3);
  padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .3px;
}
table.grid td { padding: 12px 14px; border-bottom: 1px solid #f2f4f8; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fafbfd; }
table.grid .r { text-align: right; }
table.grid .c { text-align: center; }
table.grid .strong { font-weight: 700; }
table.grid .gold { color: var(--gold); font-weight: 700; }
table.grid .green { color: var(--green); font-weight: 600; }

.thumb {
  width: 42px; height: 42px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--line); cursor: zoom-in; background: #f6f8fb;
  display: block;
}
.thumb.big { width: 58px; height: 58px; }
.no-qr {
  font-size: 11px; color: var(--red); background: var(--red-soft);
  padding: 3px 8px; border-radius: 6px; display: inline-block; white-space: nowrap;
}

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 15px 16px; box-shadow: var(--shadow);
}
.stat .k { font-size: 11.5px; color: var(--ink3); letter-spacing: .3px; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 600; opacity: .55; margin-left: 2px; }
.stat .v.gold { color: var(--gold); }
.stat .v.green { color: var(--green); }
.stat .d { font-size: 11px; color: var(--ink3); margin-top: 3px; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: transparent; font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--ink2);
  padding: 10px 16px; cursor: pointer; position: relative;
}
.tabs button.on { color: var(--navy); }
.tabs button.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--gold); border-radius: 2px;
}

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(14, 19, 32, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5);
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-bd { padding: 18px 20px; }
.modal-ft {
  display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line);
  background: #fafbfd; border-radius: 0 0 16px 16px;
}
.modal-ft .btn { flex: 1; }
.x-btn {
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  color: var(--ink3); cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.x-btn:hover { background: #f1f3f7; color: var(--ink); }

.qr-full {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  display: block; background: #f6f8fb;
}
.qr-full-wrap { position: relative; }

/* ---------- toast ---------- */
#toastBox {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(20, 26, 41, .94); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 10px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  animation: tin .22s ease;
  max-width: 86vw; text-align: center;
}
.toast.err { background: #b8302a; }
.toast.ok { background: #147a4a; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 结算横幅 ---------- */
.banner {
  border-radius: 12px; padding: 13px 15px; font-size: 12.5px;
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
}
.banner.warn { background: var(--orange-soft); border: 1px solid #f5e2c8; color: #8a4f0b; }
.banner.info { background: var(--blue-soft); border: 1px solid #d7e4f6; color: #1d4d85; }
.banner b { font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar .inner { padding: 0 16px; }
  .wrap-wide { padding: 0 14px; }
}

@media (max-width: 420px) {
  .balance-card .amount { font-size: 36px; }
  .upgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .upbox { min-height: 112px; }
  .upbox img { height: 112px; }
  .stat .v { font-size: 21px; }
}
