/* KAPOK 卡台 · 曜黑 + 香槟金
   只用系统字体栈：CSP 的 font-src/style-src 都锁在 'self'，不引外部字体。 */

.auth-shell { max-width: 520px; margin: 32px auto; padding: 32px; }
.auth-heading h2 { margin: 12px 0; font-size: 28px; }
.eyebrow { color: var(--gold, #c9a961); font-size: 11px; letter-spacing: .12em; }
.auth-tabs { display: flex; gap: 8px; margin: 24px 0; }
.auth-form { display: grid; gap: 16px; }
.auth-form .field, .auth-form input { min-width: 0; width: 100%; box-sizing: border-box; }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-note { margin-top: 24px; line-height: 1.8; }
@media (max-width: 600px) { .auth-shell { margin: 16px 0; padding: 22px; } .auth-heading h2 { font-size: 24px; } .top-actions { flex-wrap: wrap; } }

:root {
  color-scheme: dark;

  --bg: #0B0C0F;
  --bg-elev: #101216;
  --panel: #14161B;
  --panel-2: #191C22;
  --sunken: #0E1014;

  --line: rgba(201, 169, 97, 0.16);
  --line-strong: rgba(201, 169, 97, 0.34);
  --hairline: rgba(255, 255, 255, 0.06);

  --ink: #F2EDE4;
  --ink-2: #C8C2B6;
  --muted: #8B8579;

  --gold: #C9A961;
  --gold-bright: #E4C87E;
  --gold-deep: #8A6D2F;
  --gold-wash: rgba(201, 169, 97, 0.10);

  --ok: #4E9E7E;
  --ok-wash: rgba(78, 158, 126, 0.12);
  --bad: #C9564B;
  --bad-wash: rgba(201, 86, 75, 0.12);
  --warn: #C9973F;
  --warn-wash: rgba(201, 151, 63, 0.12);
  --info: #6C8FC7;
  --info-wash: rgba(108, 143, 199, 0.12);

  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --inner-lift: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --radius: 16px;
  --radius-lg: 18px;

  --display: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", Georgia, serif;
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(201, 169, 97, 0.07), transparent 62%),
    radial-gradient(760px 420px at 4% 102%, rgba(201, 169, 97, 0.04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: rgba(201, 169, 97, 0.28); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201, 169, 97, 0.18); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 169, 97, 0.3); border: 3px solid transparent; background-clip: content-box; }

/* ── 顶部进度条 ───────────────────────────────────────── */

.progress {
  position: fixed;
  z-index: 90;
  inset: 0 auto auto 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--gold));
  transition: transform 0.4s var(--ease), opacity 0.3s ease;
  opacity: 0;
}
body.is-busy .progress {
  opacity: 1;
  animation: crawl 2.4s var(--ease) forwards;
}
@keyframes crawl {
  0% { transform: scaleX(0); }
  55% { transform: scaleX(0.72); }
  100% { transform: scaleX(0.94); }
}

/* ── 骨架 ─────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 18px;
  background: linear-gradient(180deg, #0C0D11, #090A0D);
  border-right: 1px solid var(--line);
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 20px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.brand span {
  display: block;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  position: relative;
  text-align: left;
  background: transparent;
  color: var(--ink-2);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  letter-spacing: 0.02em;
  transition: color 0.18s ease, background 0.18s ease;
}
.nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.2s var(--ease);
}
.nav button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.nav button.active { color: var(--gold-bright); background: var(--gold-wash); }
.nav button.active::before { height: 18px; }

.side-foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.main { padding: 26px 32px 56px; min-width: 0; }

/* ── 顶栏 ─────────────────────────────────────────────── */

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
}
.topbar h1 {
  font-family: var(--display);
  font-size: 33px;
  line-height: 1.12;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex: none; }

/* ── 生产环境警示 ─────────────────────────────────────── */

body.is-production::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 95;
  background: linear-gradient(90deg, transparent, var(--bad) 20%, var(--bad) 80%, transparent);
}

.banner {
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 12px;
  padding: 11px 15px;
  margin-bottom: 18px;
  background: var(--gold-wash);
  color: var(--ink-2);
  font-size: 13.5px;
}
.banner.bad { border-color: rgba(201, 86, 75, 0.28); border-left-color: var(--bad); background: var(--bad-wash); color: #F0C6C1; }
.banner.ok { border-color: rgba(78, 158, 126, 0.28); border-left-color: var(--ok); background: var(--ok-wash); color: #BFE0D3; }
.banner strong { color: var(--ink); }

/* ── 面板 ─────────────────────────────────────────────── */

.stats, .split, .product-grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.split { grid-template-columns: 1.25fr 0.75fr; align-items: start; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }

.card, .stat, .product {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), var(--inner-lift);
}
.card, .stat { padding: 17px 19px; }
.card > h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px;
}

.stat { overflow: hidden; }
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.stat > span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant: small-caps;
}
.stat strong {
  display: block;
  margin: 9px 0 6px;
  font-family: var(--display);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
/* 整数大、角分小且暗 —— 私人银行报表的读法 */
.stat strong .frac { font-size: 0.62em; color: var(--muted); letter-spacing: 0; }
.stat em { font-style: normal; display: block; color: var(--muted); font-size: 12px; }

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 10px 0 12px;
}
.section-title h2 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}
.card > .section-title:first-child { margin-top: 0; }

.hint { color: var(--muted); font-size: 12.5px; }

/* ── 表单 ─────────────────────────────────────────────── */

.filters, .row-actions, .form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 144px; }
.field.grow { flex: 1; }
.field > span {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

input, select, textarea {
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input::placeholder, textarea::placeholder { color: #5E5A52; }
input[readonly] { color: var(--muted); }
select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--gold-wash);
}

/* ── 按钮 ─────────────────────────────────────────────── */

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  background: var(--panel-2);
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.btn:hover { background: #22262E; }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #17130A;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px -8px rgba(201, 169, 97, 0.6);
}
.btn.primary:hover { background: linear-gradient(180deg, #EFD694, var(--gold-bright)); }

.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--gold-wash); color: var(--gold-bright); border-color: var(--line-strong); }

.btn.danger { background: rgba(201, 86, 75, 0.14); color: #E8A29A; border-color: rgba(201, 86, 75, 0.36); }
.btn.danger:hover { background: rgba(201, 86, 75, 0.24); color: #F3C0BA; }

.btn.small { padding: 6px 13px; font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* ── 表格 ─────────────────────────────────────────────── */

.table-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  box-shadow: var(--shadow-soft), var(--inner-lift);
}
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 15px; text-align: left; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #12141A;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
tbody td { border-top: 1px solid var(--hairline); color: var(--ink-2); }
tbody tr:first-child td { border-top: 0; }
tbody tr { cursor: pointer; transition: background 0.14s ease, box-shadow 0.14s ease; }
tbody tr:hover { background: var(--gold-wash); box-shadow: inset 2px 0 0 var(--gold); }
td.num, th.num { text-align: right; }
td .id {
  display: inline-block;
  max-width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
td.empty { cursor: default; padding: 0; }
tbody tr:has(td.empty):hover { background: transparent; box-shadow: none; }
.empty-state { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty-state::before {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  margin: 0 auto 12px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ── 徽章 ─────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-wash); border-color: rgba(78, 158, 126, 0.28); color: #7FC4A8; }
.badge.bad { background: var(--bad-wash); border-color: rgba(201, 86, 75, 0.28); color: #DE8C83; }
.badge.warn { background: var(--warn-wash); border-color: rgba(201, 151, 63, 0.28); color: #DDB268; }
.badge.wait { background: var(--info-wash); border-color: rgba(108, 143, 199, 0.28); color: #9AB3DA; }
.badge.muted { background: rgba(255, 255, 255, 0.04); border-color: var(--hairline); color: var(--muted); }

.pill {
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--gold-wash);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pill.live { background: var(--ok-wash); border-color: rgba(78, 158, 126, 0.3); color: #7FC4A8; }
.pill.prod { background: var(--bad-wash); border-color: rgba(201, 86, 75, 0.36); color: #E08C83; }

/* ── 账户列表 ─────────────────────────────────────────── */

.account-list { display: grid; }
.account {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
}
.account:last-child { border-bottom: 0; }
.account:first-child { padding-top: 4px; }
.account b { display: block; font-weight: 600; }
.money { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; color: var(--ink); }
.money .frac { font-size: 0.66em; color: var(--muted); }

/* ── 卡产品 ───────────────────────────────────────────── */

.product {
  padding: 15px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s var(--ease);
}
.product:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.product.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash), var(--inner-lift);
}
.product .bin {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.product .hint { margin: 9px 0 0; }

/* ── 欢迎页 ───────────────────────────────────────────── */

.welcome { max-width: 780px; padding-top: 18px; }
.welcome h2 {
  font-family: var(--display);
  font-size: 50px;
  line-height: 1.06;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.welcome .rule {
  width: 64px;
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.welcome .lead { font-size: 17px; color: var(--ink-2); max-width: 48ch; line-height: 1.7; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.feature {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--inner-lift);
}
.feature .num {
  display: block;
  font-family: var(--display);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.feature strong { display: block; margin-bottom: 5px; font-family: var(--display); font-size: 17px; }

/* ── 虚拟卡 ───────────────────────────────────────────── */

.vcard {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #F6F1E6;
  min-height: 186px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 16px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, transparent 34%),
    linear-gradient(196deg, #26221A 0%, #15130F 48%, #0D0C0A 100%);
}
/* 斜向金箔光泽 */
.vcard::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 62%;
  height: 190%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.14), transparent);
  pointer-events: none;
}
/* 同心暗纹 */
.vcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(72deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    radial-gradient(120% 90% at 110% 10%, rgba(201, 169, 97, 0.12), transparent 58%);
}
.vcard.visa { background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, transparent 34%), linear-gradient(196deg, #1B2942 0%, #111A2A 50%, #0A0E16 100%); }
.vcard.mastercard { background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, transparent 34%), linear-gradient(196deg, #2B2621 0%, #1A1613 50%, #0C0B0A 100%); }
.vcard.discover { background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, transparent 34%), linear-gradient(196deg, #2E2415 0%, #1C1710 50%, #0D0B08 100%); }

.vcard-top, .vcard-bot { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vcard-issuer { font-family: var(--display); font-size: 15px; letter-spacing: 0.26em; color: var(--gold-bright); }
.scheme { font-weight: 700; letter-spacing: 0.16em; font-size: 13px; color: rgba(246, 241, 230, 0.82); }

/* 纯 CSS 压印芯片 */
.chip {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(145deg, #E8D49A 0%, #B9944C 42%, #8A6D2F 72%, #D8C088 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.chip::before, .chip::after {
  content: "";
  position: absolute;
  background: rgba(0, 0, 0, 0.26);
}
.chip::before { inset: 7px 0 auto 0; height: 1px; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.26), 0 16px 0 rgba(0, 0, 0, 0.26); }
.chip::after { inset: 0 auto 0 12px; width: 1px; box-shadow: 15px 0 0 rgba(0, 0, 0, 0.26); }

.pan {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.vcard-meta { display: flex; gap: 22px; align-items: baseline; }
.vcard-meta span { display: block; font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(246, 241, 230, 0.5); }
.vcard-meta b { font-family: var(--mono); font-weight: 500; font-size: 15px; letter-spacing: 0.08em; }

/* 60 秒自动隐藏倒计时环 */
.reveal-timer { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.reveal-timer svg { width: 17px; height: 17px; transform: rotate(-90deg); flex: none; }
.reveal-timer circle { fill: none; stroke-width: 2.4; }
.reveal-timer .track { stroke: rgba(201, 169, 97, 0.2); }
.reveal-timer .sweep {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 56.55;
  animation: sweep 60s linear forwards;
}
@keyframes sweep { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 56.55; } }

/* ── 键值表 ───────────────────────────────────────────── */

.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px 14px; font-size: 14px; align-items: baseline; }
.kv > span {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 2px;
}
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
pre.key {
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  max-height: 180px;
  overflow: auto;
  margin: 0 0 10px;
}

.pay-box {
  background: rgba(201, 169, 97, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}
.pay-box strong { display: block; font-family: var(--display); font-size: 16px; margin-bottom: 6px; }

/* ── 抽屉与弹窗 ───────────────────────────────────────── */

.drawer-back, .modal-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 7, 9, 0.62);
  backdrop-filter: blur(6px);
  display: flex;
  animation: fade 0.18s ease;
}
.drawer-back { justify-content: flex-end; }
.modal-back { justify-content: center; align-items: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer, .modal {
  background: linear-gradient(180deg, var(--panel), var(--bg-elev));
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.drawer {
  width: min(480px, 100%);
  height: 100%;
  overflow: auto;
  padding: 24px;
  border-width: 0 0 0 1px;
  animation: slide-in 0.24s var(--ease);
}
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius-lg);
  padding: 20px;
  animation: rise 0.2s var(--ease);
}
@keyframes rise { from { transform: translateY(10px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }

.modal h3, .drawer h3 {
  font-family: var(--display);
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}
.drawer h3 { font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

/* ── Toast ────────────────────────────────────────────── */

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 80;
}
.toast {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 2px solid var(--ok);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 380px;
  font-size: 13.5px;
  white-space: pre-line;
  box-shadow: var(--shadow);
  animation: rise 0.2s var(--ease);
}
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }

/* ── 工具类（替掉全部内联 style，严格 CSP 不允许 style 属性）── */

.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 22px; }
.mb-md { margin-bottom: 14px; }
.between { justify-content: space-between; }
.right { text-align: right; }
.stack { display: grid; gap: 10px; }

/* ── 响应式 ───────────────────────────────────────────── */

@media (max-width: 980px) {
  .app { display: block; }
  aside {
    position: sticky;
    top: 0;
    height: auto;
    padding: 12px;
    z-index: 55;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #0A0B0E;
  }
  .brand { padding: 0 6px 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav button { white-space: nowrap; border-radius: 999px; padding: 8px 14px; }
  .nav button::before { display: none; }
  .nav button.active { border: 1px solid var(--line); }
  .side-foot { display: none; }
  .main { padding: 18px 16px 40px; }
  .stats, .split, .feature-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar h1 { font-size: 28px; }
  .welcome h2 { font-size: 34px; }
  .drawer { width: 100%; border-left: 0; }
  .table-wrap { max-height: none; }
}

/* ── 降低动效 ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body.is-busy .progress { opacity: 1; transform: scaleX(0.9); }
  /* 倒计时环是信息而不是装饰，保留它 */
  .reveal-timer .sweep { animation-duration: 60s !important; }
}
