:root {
  /* 底色不要用 miniapp 的 #0e1116：在手机/OLED 上几乎等于纯黑，大面积空白会发死。
     略提亮并带一点冷灰蓝，卡片仍用更深一档做出「底→面→抬升」。 */
  --bg: #151a22;
  --card: #1e2530;
  --sf2: #283140;
  --bd: #343e4d;
  --tx: #eef1f5;
  --mut: #8b95a3;
  --dim: #646d7a;
  --acc: #2dd4a0;
  --acc2: #14b88a;
  --gold: #f4c04e;
  --danger: #f6465d;
  --hlb: rgba(45, 212, 160, 0.14);
  --hlf: #2dd4a0;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --hero-bg: linear-gradient(145deg, #1c3a33 0%, #1a2530 55%, var(--card) 100%);
  --hero-mut: #9fb3ab;
  --appearance-bar-h: 48px;
  --r: 18px;
  --r-sm: 10px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --f-xs: 11px; --f-sm: 12px; --f-md: 14px; --f-lg: 16px; --f-xl: 20px; --f-num: 32px;
  --dur: 0.15s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* legacy aliases */
  --text: var(--tx);
  --muted: var(--mut);
  --line: var(--bd);
  --primary: var(--acc);
  --primary-press: var(--acc2);
  --ok: var(--acc);
  --warn: var(--gold);
  --radius: var(--r);
  --field-gap: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--tx);
  min-height: 100%;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  padding-bottom: env(safe-area-inset-bottom);
  /* 极淡径向光，避免整页一块死黑平板 */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(45, 212, 160, 0.07), transparent 55%),
    var(--bg);
}

/* 避免给所有 interactive 挂 transition：列表重绘时会触发大量样式计算 */
.btn, .menu-item, .bc-btn, .back-btn, .chip, .seg-item, .tabbar-item {
  transition: color .12s ease, background-color .12s ease, opacity .12s ease;
}
button, .menu-item, select { min-height: 44px; }
input, select { min-height: 48px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

#app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  background: transparent;
}

.view[hidden],
.view-auth[hidden],
#view-main[hidden],
#view-login[hidden],
.page[hidden],
.me-sub[hidden],
.sheet[hidden],
.seg[hidden] {
  display: none !important;
}

/* ----- Auth ----- */
.view-auth {
  min-height: calc(100vh - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-wrap { width: 100%; max-width: 360px; }
.hero { text-align: center; padding: 8px 8px 20px; }
.logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(145deg, var(--acc), var(--acc2));
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: #02160f;
  box-shadow: 0 8px 22px -8px rgba(45, 212, 160, 0.4);
}
.hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.muted { color: var(--mut); margin: 0; font-size: 13px; line-height: 1.4; }
.small { font-size: 12px; }

.card {
  background: var(--card);
  border: 0;
  border-radius: var(--r);
  padding: 18px 16px;
  box-shadow: none;
}
.auth-card {
  display: flex; flex-direction: column; gap: var(--field-gap);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.field { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 0 0 var(--s3); }
.field:last-child { margin-bottom: 0; }
.field label, label {
  display: block; font-size: var(--f-sm); font-weight: 600; color: var(--mut); margin: 0;
}
.field input, input, .field select, select, .inp {
  width: 100%; margin: 0; padding: 14px 16px; border-radius: 12px; border: 0;
  background: var(--sf2); color: var(--tx); font-size: 16px; line-height: 1.4;
  outline: none; -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  min-height: 48px;
}
.field input:focus, input:focus, select:focus, .inp:focus {
  box-shadow: 0 0 0 2px var(--acc);
}
.input-wrap { position: relative; width: 100%; display: flex; align-items: center; }
.input-wrap input { padding-right: 56px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--mut);
  font-size: 12px; font-weight: 600; padding: 6px 10px; cursor: pointer; min-height: auto;
}
.eye:active { color: var(--tx); transform: translateY(-50%); }

.auth-switch { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--mut); }
.auth-switch a { color: var(--acc); text-decoration: none; font-weight: 600; }

/* ----- Buttons ----- */
.btn {
  position: relative; overflow: hidden;
  border: 0; border-radius: 14px; padding: 12px 16px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--sf2); color: var(--tx); line-height: 1.3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn.primary, .btn.btn-block {
  background: linear-gradient(180deg, #26b98c, #0f9770);
  color: #02160f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 22px -8px rgba(45, 212, 160, 0.28);
}
.btn.primary::before, .btn.btn-block::before {
  content: ""; position: absolute; inset: 0 0 58% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent);
}
.btn.primary:active:not(:disabled), .btn.btn-block:active:not(:disabled) {
  transform: scale(0.985) translateY(1px); filter: brightness(0.93);
}
.btn.ghost {
  background: var(--card); color: var(--tx);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn.ghost::before { display: none; }
.btn.sm { padding: 8px 12px; font-size: 13px; min-height: 36px; border-radius: 10px; }
.btn.grow { flex: 1; }
.btn.btn-block { width: 100%; margin-top: 4px; padding: 15px 16px; font-size: 16px; letter-spacing: 0.08em; border-radius: 18px; }
.btn.danger {
  background: rgba(246, 70, 93, 0.15); color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(246, 70, 93, 0.3);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.35); box-shadow: none; }
.btn:disabled::before { display: none; }

.err {
  color: var(--danger); font-size: 13px; margin: 0; line-height: 1.4; text-align: center;
  background: rgba(246, 70, 93, 0.12); border-radius: var(--r-sm); padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(246, 70, 93, 0.3);
}
.warn {
  color: var(--gold); font-size: 12px; margin: 0 0 12px; line-height: 1.45;
  background: rgba(244, 192, 78, 0.1); border-radius: 10px; padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(244, 192, 78, 0.25);
}

/* ----- Main shell ----- */
.view-main {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 32px);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  position: relative;
}
.page { flex: 1; min-height: 0; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 14px;
}
.page-title { font-size: 22px; font-weight: 700; line-height: 1.25; }
.page-sub { font-size: 12px; color: var(--mut); margin-top: 4px; line-height: 1.35; }
.page-body { padding-bottom: 8px; }

.panel-head, .panel-head.inline {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 0 10px; color: var(--mut); font-size: 13px; gap: 8px; flex-wrap: wrap;
}
.linkish {
  border: 0; background: transparent; color: var(--acc);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; min-height: auto;
}

/* ----- Switch card (接单顶) ----- */
.switch-card {
  background: var(--card); border-radius: var(--r); padding: 4px 14px 8px;
  margin-bottom: 12px;
}
.me-online-row, .switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0;
}
.switch-row + .switch-row { border-top: 1px solid rgba(255, 255, 255, 0.055); }
.me-online-title { font-size: 14px; font-weight: 600; }

.ios-switch {
  position: relative; display: inline-block; width: 51px; height: 31px; flex-shrink: 0;
}
.ios-switch input { opacity: 0; width: 0; height: 0; position: absolute; min-height: 0; }
.ios-slider {
  position: absolute; cursor: pointer; inset: 0; background: #3a4559;
  border-radius: 31px; transition: background 0.2s ease;
}
.ios-slider::before {
  content: ""; position: absolute; height: 27px; width: 27px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.ios-switch input:checked + .ios-slider { background: var(--acc); }
.ios-switch input:checked + .ios-slider::before { transform: translateX(20px); }
.ios-switch-sm { width: 38px; height: 22px; }
.ios-switch-sm .ios-slider::before { height: 18px; width: 18px; }
.ios-switch-sm input:checked + .ios-slider::before { transform: translateX(16px); }

/* ----- Orders page top bar: switch + balance, top-right, out of the tabs ----- */
.orders-topbar {
  display: flex; align-items: center; gap: 8px; padding: 2px 2px 10px;
}
.orders-topbar-title { font-size: 15px; font-weight: 600; color: var(--tx); }
.orders-topbar-spacer { flex: 1 1 auto; }
.orders-topbar-bal { font-size: 13px; color: var(--mut); }
.orders-topbar-bal strong { color: var(--tx); font-weight: 600; margin-left: 2px; }

/* ----- Tool bar / seg / chips ----- */
.tool-bar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  padding: 12px 14px; margin-bottom: 12px; background: var(--card); border-radius: var(--r-sm);
}
.tool-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); margin: 0; }
.tool-label { white-space: nowrap; }
.tool-switch input { width: auto; min-height: auto; box-shadow: none; }
.tool-hint { width: 100%; font-size: 11px; color: var(--dim); }
.select, .select-sm {
  background: var(--sf2); color: var(--tx); border: 0; border-radius: 8px;
  padding: 6px 10px; font-size: 13px; min-height: 36px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.seg {
  display: flex; gap: 4px; background: var(--card); border-radius: 12px;
  padding: 4px; margin-bottom: 12px;
}
.seg-item {
  flex: 1; border: 0; background: transparent; color: var(--mut);
  border-radius: 8px; padding: 10px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.seg-item.active { background: var(--sf2); color: var(--tx); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

.status-chips, .dfilter-quick {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.chip {
  padding: 8px 13px; border-radius: 999px; border: 0; min-height: 36px;
  background: linear-gradient(180deg, #242b36, #1d232d); color: var(--mut);
  font-size: 12px; cursor: pointer; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.22);
}
.chip.active, .chip.on {
  color: #41e3b0;
  background: linear-gradient(180deg, rgba(45, 212, 160, 0.24), rgba(45, 212, 160, 0.09));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(45, 212, 160, 0.5);
}
.chip:active { transform: none; }

.count-pill, .tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  margin-left: 6px; vertical-align: middle;
}
.tab-badge {
  position: absolute; top: 2px; right: calc(50% - 28px);
  margin: 0;
}

/* ----- Lists / order cards ----- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item, .order-card {
  background: var(--card); border: 0; border-radius: var(--r);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.item .amt, .order-card .amt {
  font-size: 22px; font-weight: 700; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.item .meta, .meta {
  font-size: 12px; color: var(--mut); word-break: break-all; line-height: 1.4;
}
.item .row, .row {
  display: flex; gap: 8px; align-items: center;
}
.amt-struct { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.order-card.tap { cursor: pointer; }
.order-card.tap:active { background: var(--sf2); }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.order-actions .btn { width: auto; flex: 1; min-width: 100px; }
.count {
  font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; font-size: 13px;
}
.count.warn { color: var(--danger); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--sf2); color: var(--mut);
}
.badge.pending, .badge.b-wait, .b-wait { background: rgba(244, 192, 78, 0.15); color: var(--gold); }
.badge.grabbed { background: rgba(244, 192, 78, 0.15); color: var(--gold); }
.badge.success, .badge.b-ok, .b-ok { background: var(--hlb); color: var(--hlf); }
.badge.danger, .badge.b-bad, .b-bad { background: rgba(246, 70, 93, 0.15); color: var(--danger); }
.badge.warn { background: rgba(244, 192, 78, 0.15); color: var(--gold); }

.paycode-box {
  border: 1px dashed var(--bd); border-radius: 12px; padding: 12px; background: var(--sf2);
  font-size: 13px; line-height: 1.5;
}
.paycode-box img { max-width: 160px; margin-top: 8px; border-radius: 8px; background: #fff; }

.empty { text-align: center; color: var(--mut); padding: 28px 8px; font-size: 14px; }
.empty-tip { font-size: 12px; opacity: 0.85; }

/* ----- Ledger rows ----- */
.ledger {
  background: var(--card); border-radius: var(--r); overflow: hidden;
}
.led-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; background: transparent; position: relative;
}
.led-row + .led-row::before {
  content: ""; position: absolute; top: 0; left: 15px; right: 15px; height: 1px;
  background: rgba(255, 255, 255, 0.055);
}
.led-row.tap { cursor: pointer; }
.led-row.tap:active { background: var(--sf2); }
.led-l { min-width: 0; flex: 1; }
.led-reason { font-size: 14px; font-weight: 600; }
.led-time {
  font-size: 11px; color: var(--mut); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.led-amt {
  font-size: 14px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--mut);
}
.led-amt.in { color: var(--hlf); }
.led-amt.out { color: var(--danger); }
.led-amt.gold { color: var(--gold); }

.rpt {
  margin-top: 14px; background: var(--card); border-radius: var(--r); overflow: hidden;
}
.rpt-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 15px; background: var(--sf2); font-size: 13px;
}
.rpt-body { padding: 13px 15px; }
.rpt-r {
  display: flex; align-items: center; justify-content: space-between; font-size: 13px;
}
.rpt-r + .rpt-r {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.055);
}
.rpt-r span { color: var(--mut); }
.rpt-r b { font-variant-numeric: tabular-nums; font-weight: 700; }
.rpt-r b.t-in { color: var(--acc); }
.rpt-r b.t-out { color: var(--danger); }
.rpt-r b.t-gold { color: var(--gold); }

.dfilter { margin-bottom: 12px; }
.dfilter-quick .chip { flex: 1; text-align: center; }
.pager { display: flex; justify-content: center; margin-top: 12px; }
.pager .btn { width: auto; min-width: 140px; }

/* ----- Me: user / bal / menu ----- */
.user-card { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #04150e; font-size: 19px; font-weight: 700;
}
.user-meta { min-width: 0; }
.user-name { font-size: 15px; font-weight: 600; }
.user-uid { font-size: 12px; color: var(--mut); margin-top: 2px; }

.bal-card {
  position: relative; overflow: hidden; border: 0; border-radius: 22px;
  padding: 22px 20px; margin-bottom: 14px;
  background: var(--hero-bg);
}
.bal-card::after {
  content: ""; position: absolute; top: -45px; right: -45px;
  width: 150px; height: 150px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(45, 212, 160, 0.28), transparent 68%);
}
.bal-card > * { position: relative; }
.bal-card-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.bal-card-label { font-size: 12px; color: var(--hero-mut); }
.bal-card-cny {
  font-size: 11px; color: var(--hero-mut); background: rgba(255, 255, 255, 0.09);
  border-radius: 999px; padding: 3px 9px;
}
.bal-card-num {
  font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline;
}
.bal-card-num .cur {
  font-size: 18px; font-weight: 600; color: var(--hero-mut); margin-right: 4px;
}
.bal-card-num .dec { font-size: 18px; font-weight: 600; color: var(--hero-mut); }
.bal-card-sub {
  font-size: 12px; color: var(--hero-mut); margin-top: 10px;
  font-variant-numeric: tabular-nums; line-height: 1.5;
}
.bal-card-frozen { font-size: 12px; color: var(--gold); margin-top: 6px; }
.bal-card-acts { display: flex; gap: 9px; margin-top: 18px; }
.bc-btn {
  flex: 1; border: 0; color: var(--tx);
  background: var(--sf2);
  border-radius: var(--r-sm); padding: 10px 0; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--divider, rgba(255,255,255,.08));
  min-height: 44px;
}
.bc-btn:active {
  transform: none;
  background: var(--hover, var(--sf2));
}

.stats, .stats-6, .stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.stat, .stat-card {
  background: var(--card); border-radius: 12px; padding: 12px 10px; text-align: center;
}
.stat-n, .stat-card .v {
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat-l, .stat-card .l {
  font-size: 11px; color: var(--mut); margin-top: 4px;
}
.stat-card.sm .meta { font-size: 11px; color: var(--dim); margin-top: 2px; }
.cards-4 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0 12px;
}

.pending-bar {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(45, 212, 160, 0.07); border: 1px solid rgba(45, 212, 160, 0.2);
}
.pending-bar-title {
  font-size: 11px; color: var(--acc); font-weight: 600; display: block; margin-bottom: 8px;
}
.pending-bar-items { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-chip {
  border: 1px solid rgba(45, 212, 160, 0.35); background: rgba(45, 212, 160, 0.1);
  color: var(--acc); border-radius: 999px; padding: 5px 12px; font-size: 12px;
  font-weight: 600; cursor: pointer; white-space: nowrap; min-height: auto;
}
.pending-chip-review {
  border-color: rgba(246, 70, 93, 0.35); background: rgba(246, 70, 93, 0.1); color: var(--danger);
}

.menu-list {
  margin-top: 4px; background: var(--card); border-radius: var(--r); overflow: hidden;
}
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: transparent; position: relative;
  color: var(--tx); padding: 14px 16px; font-size: 14px; cursor: pointer;
  text-align: left; text-decoration: none;
}
.menu-item + .menu-item::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: var(--divider);
}
.menu-item:active { background: var(--sf2); }
.mi-ico {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--hlb); color: var(--acc); font-size: 16px;
}
.mi-ico.warn { background: rgba(244, 192, 78, 0.14); color: var(--gold); }
.mi-ico.danger { background: rgba(246, 70, 93, 0.14); color: var(--danger); }
.mi-txt { flex: 1; font-weight: 600; }
.mi-arrow { color: var(--dim); font-size: 16px; }

/* ----- Sub pages ----- */
.me-sub { padding-bottom: 8px; }
.sub-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.sub-head h2 { margin: 0; font-size: 18px; flex: 1; }
.back-btn {
  border: 0; background: var(--card); color: var(--tx); min-width: 44px;
  border-radius: var(--r-sm); padding: 8px 14px; font-size: 13px; cursor: pointer;
  font-weight: 600;
}
.back-btn:active { background: var(--sf2); }

/* ----- Codes ----- */
.code-kind { font-size: 12px; color: var(--mut); }
.code-limits { font-size: 12px; color: var(--mut); line-height: 1.4; }
.code-limits.lim-bad { color: var(--danger); }
.code-limits.lim-warn { color: var(--gold); }
.code-remain {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 12px 0 6px; padding: 12px 10px; border-radius: 12px;
  background: var(--sf2);
}
.code-remain > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.code-remain strong { font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.2; }
.code-remain span { font-size: 11px; color: var(--mut); }
.code-remain.is-limited strong { color: var(--danger); }
.code-remain-sub { margin: 0 0 8px; font-size: 12px; color: var(--mut); line-height: 1.45; }
.code-limit-note { margin: 0 0 8px; font-size: 12px; color: var(--danger); line-height: 1.45; }
.code-item .code-limit-note + .btn { margin-bottom: 8px; }
.code-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px;
}
.code-flags { display: flex; gap: 6px; margin-right: auto; }
.flag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  background: var(--sf2); color: var(--mut);
}
.flag.on { background: var(--hlb); color: var(--hlf); }
.flag.off { background: rgba(246, 70, 93, 0.12); color: var(--danger); }
.qr-preview {
  max-width: 120px; border-radius: 8px; background: #fff; margin-top: 6px;
}



/* 收款账户：极简列表 + 详情抽屉 */
.code-filter-slim {
  margin: 0 0 8px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  background: var(--card);
  border-radius: 14px;
}
.code-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.code-search-row input {
  min-height: 40px;
  margin: 0;
}
.code-filter-more {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}
.code-list-meta {
  margin: 0 0 8px;
  min-height: 28px;
}
.code-list .code-item-slim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
.code-row-hit {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.code-row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.code-row-title {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-row-sub {
  font-size: 12px;
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.code-item-slim.is-limited .code-row-sub { color: var(--danger); }
.code-item-slim .code-kind-chip {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.3;
  white-space: nowrap;
}
.code-item-slim .badge {
  font-size: 11px;
  padding: 2px 7px;
}
.code-item-slim .code-chevron {
  color: var(--mut);
  font-size: 16px;
  width: 14px;
  text-align: center;
}
.code-item-slim .code-item-switch {
  margin: 0;
  font-size: 0;
}
.code-view-body {
  max-height: min(88vh, 720px);
  overflow: auto;
}
.code-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.code-view-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.3;
}
.code-view-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.code-view-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}
.code-view-qr {
  width: 168px;
  height: 168px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.08);
}
.code-qr-empty {
  width: 168px;
  height: 168px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--mut);
  background: rgba(255,255,255,.02);
}
.code-view-facts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.code-fact {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.45;
}
.code-fact span { color: var(--mut); }
.code-fact b { font-weight: 600; word-break: break-all; }
.code-view-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.code-view-stats-head strong { font-size: 13px; }
.code-view-stats-head .select {
  width: auto;
  min-width: 88px;
  min-height: 34px;
  padding: 6px 26px 6px 10px;
  font-size: 12px;
}
.code-view-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  margin-bottom: 14px;
}
.code-view-stats-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.code-view-stats-grid b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.code-view-stats-grid span {
  font-size: 10px;
  color: var(--mut);
}
.code-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 380px) {
  .code-view-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .code-row-hit { grid-template-columns: auto 1fr auto; }
  .code-item-slim .badge { display: none; }
}

.field-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-row {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--tx);
  margin: 4px 0 10px;
}
.check-row input { width: auto; min-height: auto; box-shadow: none; }

.panel {
  background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 12px;
}

/* ----- Tabbar ----- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  max-width: 440px; margin: 0 auto;
  background: var(--bg);
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 var(--divider);
}
.tabbar-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: transparent; color: var(--dim); cursor: pointer;
  padding: 7px 2px 5px; font-size: 11px; min-height: auto;
}
.tabbar-item.active { color: var(--acc); font-weight: 600; }
.tabbar-ico { font-size: 18px; line-height: 1; }

/* ----- Toast ----- */
.toast {
  position: fixed; left: 50%; top: calc(var(--appearance-bar-h, 48px) + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 80; max-width: min(90vw, 360px);
  padding: 10px 16px; border-radius: 999px;
  background: var(--sf2); color: var(--tx); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); text-align: center;
  animation: toast-in 0.15s ease-out;
}
.toast.ok { background: rgba(45, 212, 160, 0.18); color: var(--hlf); box-shadow: 0 0 0 1px rgba(45, 212, 160, 0.35); }
.toast.err { background: rgba(246, 70, 93, 0.18); color: var(--danger); box-shadow: 0 0 0 1px rgba(246, 70, 93, 0.35); }
.toast[hidden] { display: none !important; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ----- Sheets ----- */
.sheet {
  position: fixed; inset: 0; z-index: 60; display: grid; align-items: end;
}
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.sheet-body {
  position: relative;
  margin: 0;
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  animation: up 0.2s var(--ease);
  display: flex; flex-direction: column; gap: 12px;
  max-height: 88vh; overflow-y: auto;
  background: var(--card);
  max-width: 440px; width: 100%; justify-self: center;
}
.sheet-body h2 { margin: 0; font-size: 18px; }
.order-meta { color: var(--mut); font-size: 13px; margin: 0; word-break: break-all; line-height: 1.4; }
.dd-sec {
  background: var(--sf2); border-radius: 14px; padding: 4px 14px;
}
.dd-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; font-size: 13px;
}
.dd-row + .dd-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.dd-row > span { color: var(--mut); flex: 0 0 auto; }
.dd-row > b { font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }
.dd-row.big > b { font-size: 17px; }
.dd-row.big > b.in { color: var(--hlf); }
.dd-row.big > b.gold { color: var(--gold); }

@keyframes up {
  from { transform: translateY(14px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.wallet-tip { display: none; } /* replaced by bal-card-sub */

@media (min-width: 480px) {
  #app { padding: 24px 16px 40px; }
}


/* Audit polish: hierarchy, copy affordances and quieter sheets */
.sheet-kicker { color: var(--acc); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sheet-amount { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--tx); font-variant-numeric: tabular-nums; }
.sheet-amount.danger { color: var(--danger); }
.sheet-amount.gold { color: var(--gold); }
.sheet-body .warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(244, 192, 78, .10); color: #f8d77e; font-size: 12px; line-height: 1.55; }
.totp-setup-grid { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: center; }
.totp-qr { width: 116px; height: 116px; display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 6px; overflow: hidden; }
.totp-qr canvas, .totp-qr img { width: 104px !important; height: 104px !important; max-width: 100%; }
.copy-btn { min-height: 32px !important; padding: 5px 9px !important; font-size: 11px !important; }
.copyable { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; max-width: 72%; }
.btn.danger { color: var(--danger); border-color: rgba(246,70,93,.42); background: rgba(246,70,93,.08); }
@media (max-width: 360px) { .totp-setup-grid { grid-template-columns: 1fr; } }


/* v24: one obvious receiving action + account-level operational stats */
.receiving-card { padding: 14px 16px 12px; }
.receiving-note { display:flex; align-items:center; gap:7px; margin-top:10px; color:var(--mut); font-size:11px; line-height:1.4; }
.status-dot { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:var(--dim); box-shadow:0 0 0 3px rgba(100,109,122,.12); }
.status-dot.on { background:var(--acc); box-shadow:0 0 0 3px rgba(45,212,160,.14); }
.seg-count { display:inline-flex; min-width:18px; height:18px; padding:0 5px; align-items:center; justify-content:center; border-radius:999px; background:rgba(255,255,255,.08); color:var(--mut); font-size:10px; vertical-align:1px; }
.code-overview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:2px 0 10px; padding:12px 14px; border-radius:14px; background:var(--card); }
.code-overview-toolbar > div { min-width:0; }
.code-overview-toolbar strong { display:block; font-size:14px; }
.code-overview-toolbar .page-sub { display:block; margin-top:3px; font-size:11px; }
.code-overview-toolbar .select { width:auto; min-width:84px; min-height:38px; padding:8px 26px 8px 10px; font-size:12px; }
.code-stats-label { margin-top:12px; color:var(--mut); font-size:11px; font-weight:600; }
.code-stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-top:7px; padding:9px 7px; border-radius:12px; background:rgba(255,255,255,.035); }
.code-stats-grid > div { display:flex; min-width:0; flex-direction:column; align-items:center; gap:3px; }
.code-stats-grid b { color:var(--tx); font-size:15px; font-variant-numeric:tabular-nums; }
.code-stats-grid span { color:var(--mut); font-size:10px; }
.code-stats-grid .ok b { color:var(--acc); }
.code-stats-grid .bad b { color:var(--danger); }
.code-stats-money { display:flex; flex-wrap:wrap; gap:5px 12px; margin-top:7px; color:var(--mut); font-size:11px; line-height:1.5; }
.code-stats-money b { color:var(--tx); font-variant-numeric:tabular-nums; }
.code-stats-money .ok-text { color:var(--acc); }
.code-stats-money .bad-text { color:var(--danger); }
@media (max-width:360px) {
  .code-stats-money { gap:3px 8px; }
  .code-overview-toolbar { padding-left:11px; padding-right:11px; }
}

.field-help { color:var(--dim); font-size:11px; line-height:1.35; margin-top:-3px; }

.tabbar.two-tabs { grid-template-columns: repeat(2, 1fr); }
.tabbar.two-tabs .tab-badge { right: calc(50% - 30px); }

/* Hidden must win over layout rules (.list/.status-chips/.row use flex). */
[hidden] { display: none !important; }
.order-filter { margin-bottom: 14px; }
.order-filter > label { font-size:14px; color:var(--tx); }
.order-filter-main { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin:10px 0; }
.order-filter input { min-width:0; }
.order-filter details summary { color:var(--mut); font-size:12px; cursor:pointer; padding:10px 0; }
.order-filter-range { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.order-filter-range label { margin:0 0 8px; }
.order-filter-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:6px; color:var(--mut); font-size:11px; }

#orders-result-hint { margin:12px 2px; }
button.order-card { width:100%; text-align:left; color:var(--tx); font:inherit; cursor:pointer; }
.order-card-line { display:flex; justify-content:space-between; align-items:center; gap:10px; width:100%; }
.order-card-identity { font-size:13px; line-height:1.6; color:var(--mut); overflow-wrap:anywhere; }
.order-card-hint { display:block; color:var(--acc); font-size:12px; }
.order-card:focus-visible, .tabbar-item:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
#order-sheet .sheet-body { gap:12px; }
#order-sheet-actions { position:sticky; bottom:0; background:var(--card); padding:12px 0 4px; z-index:1; }
#order-sheet-actions .btn { flex:1; }
.order-detail-amount { font-size:32px; font-weight:700; font-variant-numeric:tabular-nums; }
.order-detail-note { color:var(--mut); font-size:12px; line-height:1.6; margin:8px 0 12px; }
.order-detail-tech { margin-top:12px; }
.order-detail-tech summary { padding:10px 0; font-size:12px; color:var(--mut); cursor:pointer; }
.order-confirm-check { display:flex; align-items:flex-start; gap:10px; color:var(--tx); font-size:13px; line-height:1.6; margin:12px 0; }
.order-confirm-check input { width:20px; height:20px; min-height:20px; flex:0 0 20px; appearance:auto; padding:0; }
#order-confirm-form { margin-top:14px; padding-top:12px; border-top:1px solid var(--bd); }
#order-confirm-form .field { margin-top:12px; }
#order-sheet .dd-row b { max-width:70%; }

.collection-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
.collection-stats .t-in { color:var(--acc); }
.assets-lifetime { margin: 0 0 8px; }
.security-note { margin-top:10px; line-height:1.65; }

.accounts-refresh { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }


/* 三列同级：标签 / 金额 / 说明 各占一行，金额同一字号，避免拆字号难看。 */
.bal-card-top { margin-bottom: 12px; }
.bal-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.bal-card-metric {
  min-width: 0;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.bal-card-metric + .bal-card-metric {
  border-left: 1px solid rgba(255,255,255,.16);
}
.bal-card-metric > span {
  font-size: 12px;
  line-height: 18px;
  height: 18px;
  color: var(--hero-mut, var(--mut));
}
.bal-card-metric strong {
  display: block;
  margin-top: 6px;
  height: 22px;
  line-height: 22px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bal-card-metric small {
  display: block;
  margin-top: 4px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  color: var(--hero-mut, var(--mut));
}
.bal-card-metric small span { display: inline; }
:root[data-theme="light"] .bal-card-metric + .bal-card-metric { border-left-color: var(--divider); }
:root[data-theme="light"] .bal-card-metric > span,
:root[data-theme="light"] .bal-card-metric small,
:root[data-theme="light"] .bal-card-metric strong { color: var(--tx); }

.code-filter { display:grid; gap:8px; margin:0 0 12px; padding:12px; }
.code-filter-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:center; }
.code-filter input, .code-filter select { min-height:44px; }
.code-item-switch { display:flex; align-items:center; gap:8px; margin-right:auto; font-size:13px; font-weight:600; color:var(--tx); }

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.tabbar-ico { width:22px; height:22px; display:grid; place-items:center; }
.tabbar-ico svg { width:22px; height:22px; display:block; }
.tabbar-item { min-height:48px; }
.copy-btn, .payout-copy { min-height:44px; padding:8px 12px; }
.eye { min-height:44px; min-width:44px; }
.tool-bar-compact { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; padding:8px 12px; }
.tool-bar-compact .tool-hint { display:none; }
.tool-sep { color:var(--dim); }
.money { font-variant-numeric:tabular-nums; }
.money .cur { font-size:.62em; font-weight:600; margin-right:2px; opacity:.75; }
.money .int { font-weight:700; }
.money .dec { font-size:.72em; font-weight:600; opacity:.75; }
.order-detail-amount .money .int { font-size:32px; }
.order-card-line .amt .money .int { font-size:inherit; }
.sheet-extra { display:flex; flex-direction:column; gap:10px; }
.field-help { display:block; font-size:12px; color:var(--mut); margin:-4px 0 10px; line-height:1.45; }

:root[data-client="h5"] body.is-subpage .tabbar { display:none !important; }
:root[data-client="h5"] body.is-subpage .view-main { padding-bottom:0; }
:root[data-client="pc"] #orders-more-wrap,
:root[data-client="pc"] #payout-more-wrap { display:none !important; }
:root[data-client="pc"] .back-btn { display:none; }
:root[data-client="pc"] #payout-back { display:inline-flex; }

.proof-drop {
  position: relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; min-height:96px; border:1px dashed var(--bd); border-radius:12px;
  background:var(--sf2); color:var(--mut); font-size:13px; cursor:pointer; padding:16px; overflow:hidden;
}
.proof-drop input[type="file"] { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; min-height:0; }
.proof-drop strong { color:var(--tx); font-size:14px; }

.payout-active-chips { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.payout-active-chips .chip { min-height:36px; }

.team-day-panel { margin-top: 12px; display: grid; gap: 10px; }
.team-day-bar { display:flex; align-items:end; gap:8px; }
.team-day-label { flex:1; font-size:12px; color:var(--mut); display:grid; gap:6px; }
.team-day-label input[type="date"] { min-height:40px; width:100%; }
.team-day-total {
  width:100%; text-align:left; cursor:pointer; border:0;
  background: var(--card); color: inherit;
}
.team-day-total strong { font-size:20px; font-variant-numeric:tabular-nums; }
.team-day-member .meta { font-variant-numeric:tabular-nums; }

/* ----- Shared page bar: 上一页 1 2 3 … N 下一页 ----- */
.page-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 8px;
  flex-wrap: wrap;
}
.page-bar-nav,
.page-bar-num {
  min-height: 36px;
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line, var(--divider));
  background: var(--card);
  color: var(--tx);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.page-bar-nav:disabled,
.page-bar-num:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-bar-num.is-active {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
  font-weight: 700;
}
.page-bar-ellipsis {
  min-width: 20px;
  text-align: center;
  color: var(--mut);
  font-size: 13px;
  user-select: none;
}
.page-bar-nums {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.page-sum {
  margin: 10px 0 0; color: var(--mut); font-size: 12px; line-height: 1.5;
  font-variant-numeric: tabular-nums; white-space: pre-line;
}

/* Prevent login flash on refresh when session token exists (must beat [hidden]) */
html.authed-boot #view-login { display: none !important; }
html.authed-boot #view-main[hidden],
html.authed-boot #view-main { display: flex !important; flex-direction: column; }


/* 代充 bash 多行 */
textarea.textarea, #code-bash {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--divider, #e5e7eb);
  background: var(--card, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  box-sizing: border-box;
}
.code-kind-chip.plat-wg { background: #e0f2fe; color: #0369a1; }
.code-kind-chip.plat-bb { background: #fef3c7; color: #b45309; }
.code-item-slim .code-seq {
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  font-variant-numeric: tabular-nums;
}

.badge.info { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge.warn { background: rgba(244,192,78,.18); color: #e6b450; }
.code-item.is-status-info { box-shadow: inset 3px 0 0 rgba(59,130,246,.55); }
