/* ============================================================
   吞金巨兽 · 铸金账房（Mint & Ledger）第二版 v1.0
   世界观：浅色羊皮纸账本 —— 铜版刻字、墨线表格、朱红印章、金条证书
   与深黑金版（prototype/）完全不同的设计语言
   ============================================================ */

:root {
  /* 纸 */
  --desk: #E2DAC6;            /* 桌面（纸背后的衬底） */
  --sheet: #F7F3E8;           /* 账页 */
  --panel: #FBF7ED;           /* 卡片纸 */
  --panel2: #EFE9DA;          /* 压深纸 */
  --rule: rgba(35, 29, 16, .16);
  --rule2: rgba(35, 29, 16, .36);

  /* 墨 */
  --ink: #231D10;
  --ink2: #4E4632;
  --ink3: #857B60;

  /* 金箔 */
  --gold: #B08A2A;
  --gold-b: #D4AF37;
  --gold-d: #8A6A1A;
  --gold-metal: linear-gradient(105deg, #8F6F1A 0%, #C9A227 20%, #F0D874 45%, #B08A2A 65%, #8F6F1A 85%, #C9A227 100%);
  --gold-text: linear-gradient(100deg, #7A5B14 0%, #A5811F 45%, #C9A227 100%);

  /* 朱墨语义（中式账本：红涨绿跌） */
  --up: #B5432E;
  --down: #2E7D5B;
  --warn: #9A6A1C;
  --info: #3B5A8C;

  /* 印章色 */
  --seal-red: #A63A2B;
  --seal-blue: #3B5A8C;
  --seal-green: #2E7D5B;
  --seal-black: #231D10;

  /* 字体 */
  --sans: "Noto Sans SC", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --latin: "Marcellus", "Noto Serif SC", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Courier New", monospace;

  --gap: 10px;
  --gap2: 14px;
  --r: 4px;                   /* 账本不用大圆角 */
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 4px 14px rgba(70, 58, 28, .12);
  --shadow-lg: 0 18px 48px rgba(70, 58, 28, .22);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23231D10' stroke-opacity='.07' stroke-width='.7'%3E%3Cpath d='M-10 25 Q15 15 40 25 T90 25 T140 25'/%3E%3Cpath d='M-10 45 Q15 35 40 45 T90 45 T140 45'/%3E%3Cpath d='M-10 65 Q15 55 40 65 T90 65 T140 65'/%3E%3Cpath d='M-10 85 Q15 75 40 85 T90 85 T140 85'/%3E%3Cpath d='M25 -10 Q15 15 25 40 T25 90 T25 140'/%3E%3Cpath d='M65 -10 Q55 15 65 40 T65 90 T65 140'/%3E%3Cpath d='M105 -10 Q95 15 105 40 T105 90 T105 140'/%3E%3C/g%3E%3C/svg%3E");
  --holes: radial-gradient(circle at center, var(--desk) 2px, transparent 2.4px);
}

/* ---------- Reset / Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 252, 242, .5), transparent 60%),
    var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
}

body::after { /* 纸纤维颗粒 */
  content: ""; position: fixed; inset: 0; z-index: 999;
  background-image: var(--grain);
  opacity: .05; mix-blend-mode: multiply; pointer-events: none;
}

a { color: var(--seal-red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
img { display: block; }

::selection { background: rgba(176, 138, 42, .22); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #B7AD93; border-radius: 6px; border: 2px solid var(--desk); }
::-webkit-scrollbar-thumb:hover { background: #9A8F6F; }
::-webkit-scrollbar-track { background: transparent; }

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

/* ---------- 工具类 ---------- */
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.up   { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold-d); }
.dim  { color: var(--ink2); }
.faint{ color: var(--ink3); }
.tac { text-align: center; }
.tar { text-align: right; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt24 { margin-top: 24px; }
.hidden { display: none !important; }

.lbl {
  font-size: 10px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink3);
}

/* 金箔文字（钱） */
.gold-foil {
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* 幽灵水印 */
.ghost {
  position: absolute; top: 4px; right: 24px; z-index: 0;
  font-family: var(--latin); font-size: clamp(36px, 6vw, 80px); letter-spacing: .18em;
  text-transform: uppercase; color: transparent;
  -webkit-text-stroke: 1px rgba(35, 29, 16, .06);
  pointer-events: none; user-select: none; white-space: nowrap;
}

/* ============================================================
   桌面与账页
   ============================================================ */
.desk { max-width: 1460px; margin: 0 auto; padding: 22px 26px 56px; position: relative; }

.sheet {
  position: relative;
  background:
    linear-gradient(180deg, #FBF7ED 0%, #F5EFDF 100%);
  border: 1px solid var(--rule2);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .6);
  border-radius: var(--r);
  overflow: hidden;
}

/* ---------- 报头（masthead） ---------- */
.masthead {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  padding: 20px 28px;
  background:
    var(--guilloche),
    linear-gradient(180deg, #FBF7ED, #F1EADA);
  border-bottom: 3px double var(--rule2);
}
.masthead::after { /* 顶缘金线 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold-metal);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--gold-d);
  background: var(--sheet);
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px rgba(176, 138, 42, .18);
}
.brand .logo img { width: 76%; height: 76%; object-fit: contain; }
.brand .name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .12em; line-height: 1.2; }
.brand .sub { font-family: var(--latin); font-size: 9.5px; letter-spacing: .3em; color: var(--gold-d); text-transform: uppercase; margin-top: 3px; }

.masthead .meta {
  margin-left: auto; text-align: right;
  font-family: var(--mono); font-size: 11px; color: var(--ink2); line-height: 1.9;
}
.masthead .meta b { color: var(--seal-red); font-weight: 600; }
.countdown { display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; }
.countdown .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--seal-red); animation: pulse 2s infinite; }

.iconbtn {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--rule2); background: transparent;
  display: grid; place-items: center; color: var(--ink2); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.iconbtn:hover { border-color: var(--ink); color: var(--ink); background: rgba(35, 29, 16, .05); }
.iconbtn .ic { width: 15px; height: 15px; }
.iconbtn .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--seal-red);
  color: #FFF8E8; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

/* ---------- 导航（账册目录） ---------- */
.tabs-nav {
  display: flex; gap: 2px; padding: 0 28px;
  background: rgba(239, 233, 218, .55);
  border-bottom: 1px solid var(--rule2);
  overflow-x: auto;
}
.tabs-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 16px 10px;
  color: var(--ink2); font-size: 13.5px; font-weight: 500;
  border-bottom: 3px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tabs-nav a .no { font-family: var(--serif); font-size: 12px; color: var(--ink3); }
.tabs-nav a:hover { color: var(--ink); text-decoration: none; }
.tabs-nav a.on { color: var(--ink); border-bottom-color: var(--seal-red); background: linear-gradient(180deg, transparent, rgba(166, 58, 43, .06)); }
.tabs-nav a.on .no { color: var(--seal-red); }

/* ---------- 内容 ---------- */
.content { padding: 22px 28px 30px; position: relative; }

.notice {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 9px 14px;
  background: rgba(176, 138, 42, .07);
  border-left: 3px solid var(--gold-d);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
  font-size: 12.5px; color: var(--ink2);
}
.notice b { color: var(--gold-d); font-weight: 600; }
.notice .ic { width: 14px; height: 14px; color: var(--gold-d); flex: none; }
.notice .x { margin-left: auto; cursor: pointer; color: var(--ink3); width: 14px; height: 14px; flex: none; }
.notice .x:hover { color: var(--ink); }

/* 视图切换 */
.view { display: none; }
.view.on { display: block; animation: viewIn .38s ease both; }
.tabpane { display: none; }
.tabpane.on { display: block; animation: viewIn .3s ease both; }

/* ============================================================
   纸带行情（老式纸带报价机）
   ============================================================ */
.tape {
  position: relative; overflow: hidden;
  margin-bottom: 16px; padding: 9px 0;
  background: linear-gradient(180deg, #F3EDDE, #EBE3CF);
  border-top: 1px dashed var(--rule2); border-bottom: 1px dashed var(--rule2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.tape::before, .tape::after { /* 打孔纸带孔 */
  content: ""; position: absolute; left: 0; right: 0; height: 8px;
  background: var(--holes); background-size: 12px 8px; pointer-events: none;
}
.tape::before { top: 0; } .tape::after { bottom: 0; }
.tape-track { display: flex; gap: 36px; width: max-content; animation: marquee 36s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.tape-item .tp { color: var(--ink2); font-weight: 600; letter-spacing: .05em; }
.tape-item .px { color: var(--ink); font-variant-numeric: tabular-nums; transition: color .2s; }
.tape-item .pc { font-size: 11px; font-variant-numeric: tabular-nums; }
.tape-item.tick-up .px { color: var(--up); }
.tape-item.tick-down .px { color: var(--down); }
.tape-item.tick-up .px::after { content: "▲"; font-size: 9px; margin-left: 5px; }
.tape-item.tick-down .px::after { content: "▼"; font-size: 9px; margin-left: 5px; }

/* ============================================================
   网格与账页卡片
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.gap14 { gap: var(--gap2); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; }
.s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; }
.s9 { grid-column: span 9; } .s12 { grid-column: span 12; }

.p {
  position: relative;
  background: linear-gradient(180deg, #FBF7ED, #F6F0E1);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .55);
  padding: 15px;
}
.ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph h2 {
  font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .04em;
  display: flex; align-items: center; gap: 9px;
}
.ph h2::before {
  content: ""; width: 3px; height: 14px;
  background: var(--seal-red); box-shadow: 0 0 0 1px rgba(166, 58, 43, .2);
}
.ph .lbl { margin-top: 2px; }
.ph .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap2); }

.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #FBF7ED, #F6F0E1);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  transition: transform .2s ease, box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 8px 20px rgba(70, 58, 28, .14); }
.kpi .lbl { display: block; }
.kpi .v {
  font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.16;
  margin-top: 6px; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.kpi .v small { font-size: 13px; color: var(--ink3); font-family: var(--sans); font-weight: 500; margin-left: 4px; }
.kpi .d { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink2); }
.kpi .d .tag { margin-left: auto; }
.kpi .spark { position: absolute; right: 12px; bottom: 12px; opacity: .95; }
.kpi.money .v { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.kpi.money { border-color: rgba(138, 106, 26, .45); }
.kpi.money::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(110% 70% at 88% 0%, rgba(176, 138, 42, .10), transparent 55%);
  pointer-events: none;
}

/* ---------- 金条证书（签名元素 1） ---------- */
.cert {
  position: relative; z-index: 1;
  background:
    var(--guilloche),
    linear-gradient(180deg, #FCF8EE 0%, #F4EDDA 100%);
  border: 1.5px solid var(--gold-d);
  border-radius: var(--r);
  box-shadow: var(--shadow), 0 10px 28px rgba(70, 58, 28, .16), inset 0 0 0 1px rgba(255, 255, 255, .65);
  padding: 20px 26px 18px;
  overflow: hidden;
}
.cert::after { /* 金箔扫光 */
  content: ""; position: absolute; top: 0; bottom: 0; width: 130px;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .4), transparent);
  animation: shimmer 5.5s ease-in-out infinite; pointer-events: none;
}
.cert .cert-no {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink3); letter-spacing: .08em;
}
.cert .cert-no b { color: var(--ink2); font-weight: 600; }
.cert .cert-body { display: flex; align-items: center; gap: 26px; margin-top: 12px; }
.cert .title { font-size: 13px; color: var(--ink2); letter-spacing: .12em; }
.cert .title .tag {
  display: inline-block; margin-left: 8px;
  font-size: 10px; letter-spacing: .14em; color: var(--gold-d);
  border: 1px solid var(--gold-d); padding: 1px 7px; vertical-align: 2px;
}
.cert .big {
  font-family: var(--serif); font-size: 42px; font-weight: 700; line-height: 1.05;
  font-variant-numeric: tabular-nums; margin-top: 4px;
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.cert .bar-gold { /* 金条 */
  position: relative; width: 150px; height: 40px; flex: none;
  background: var(--gold-metal);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 248, 220, .7),
    inset 0 -4px 8px rgba(90, 64, 10, .5),
    0 6px 16px rgba(70, 58, 28, .3);
  display: grid; place-items: center;
  font-family: var(--latin); font-size: 10px; letter-spacing: .3em;
  color: rgba(35, 26, 8, .65); text-shadow: 0 1px 0 rgba(255, 244, 200, .5);
}
.cert .cols { display: flex; gap: 30px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--rule2); }
.cert .cols .t { font-size: 11.5px; color: var(--ink2); }
.cert .cols .v { font-family: var(--mono); font-size: 17px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--ink); }
.cert .sign { margin-top: 14px; display: flex; align-items: center; gap: 16px; }
.cert .sign .line { flex: 1; border-bottom: 1px solid var(--rule2); height: 20px; }
.cert .sign .who { font-size: 11.5px; color: var(--ink3); white-space: nowrap; }

/* ---------- 印章 ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid currentColor; border-radius: 3px;
  padding: 2px 8px; font-family: var(--serif); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; line-height: 1.3; white-space: nowrap;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px currentColor, inset 0 0 0 3px rgba(255, 255, 255, .4);
  mix-blend-mode: multiply;
  transform: rotate(-4deg);
}
.seal.stamp-play { animation: stampIn .26s cubic-bezier(.2, 1.6, .4, 1) both; }
.seal.red { color: var(--seal-red); }
.seal.blue { color: var(--seal-blue); }
.seal.green { color: var(--seal-green); }
.seal.black { color: var(--seal-black); }

/* 纸标签（等级/类型） */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; line-height: 1;
  padding: 3px 9px; border: 1px solid var(--rule2); color: var(--ink2);
  background: rgba(255, 255, 255, .3); white-space: nowrap;
}
.tag.gold { color: var(--gold-d); border-color: var(--gold); background: rgba(176, 138, 42, .08); }
.tag.info { color: var(--info); border-color: var(--info); background: rgba(59, 90, 140, .06); }

/* ---------- 图表（蘸水笔墨线图） ---------- */
.chartbox { position: relative; flex: 1; min-height: 210px; }
.chartbox .sk { width: 100%; height: 100%; min-height: 210px; }
.chartpanel { display: flex; flex-direction: column; }
.chart { display: block; }
.chart .grid-line { stroke: rgba(35, 29, 16, .09); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .grid-line.zero { stroke: rgba(35, 29, 16, .3); }
.chart .axis { fill: var(--ink3); font-family: var(--mono); font-size: 10px; }
.chart .avg { stroke: var(--ink); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 1.5s ease .35s forwards; }
.chart .bar { transition: filter .12s; }
.chart .bar.hot { filter: brightness(1.12); }
.chart .bar.today { stroke: var(--ink); stroke-width: 1.2; }
.chart .cross { stroke: rgba(166, 58, 43, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--ink); }
.chart .dot-halo { fill: none; stroke: var(--seal-red); stroke-width: 1.5; opacity: .55; animation: pulse 2s infinite; }
.chart .today-glow { fill: rgba(176, 138, 42, .16); animation: pulse 2.4s infinite; }

/* 纸上价签（今日徽章 / 悬浮提示） */
.today-badge .badge-bg { fill: #FBF7ED; stroke: var(--ink); stroke-width: 1; }
.today-badge .badge-txt { font-family: var(--mono); font-size: 10.5px; font-weight: 600; fill: var(--ink); }
.today-badge .badge-txt.up { fill: var(--up); }
.today-badge .badge-txt.down { fill: var(--down); }

.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: #FBF7ED; border: 1px solid var(--ink);
  border-radius: 3px; padding: 6px 11px;
  font-size: 11.5px; color: var(--ink2); white-space: nowrap;
  box-shadow: 0 6px 16px rgba(70, 58, 28, .18);
  opacity: 0; transform: translate(-50%, -112%);
  transition: opacity .15s;
}
.chart-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--ink); }
.chart-tip.on { opacity: 1; }
.chart-tip b { display: block; font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: 13px; }
.chart-tip .up, .chart-tip .down { font-family: var(--mono); font-weight: 600; }

.chart-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--rule2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
}
.chart-stats > div { padding: 0 14px; border-left: 1px solid var(--rule); }
.chart-stats > div:first-child { border-left: none; padding-left: 2px; }
.chart-stats .lbl { display: block; margin-bottom: 5px; }
.chart-stats .v { font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.legend .l1 i { background: var(--up); }
.legend .l2 i { background: var(--down); }
.legend .l3 i { background: var(--ink); }

/* ---------- 表格（墨线账格） ---------- */
.tblwrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.tbl th {
  text-align: left; font-weight: 600; padding: 9px 10px;
  color: var(--ink3); border-bottom: 1px solid var(--rule2);
  box-shadow: 0 1px 0 var(--rule); white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; white-space: nowrap; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(176, 138, 42, .06); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.tbl .user { display: flex; align-items: center; gap: 9px; }
.tbl .user .av {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--panel2); border: 1px solid var(--rule2);
  display: grid; place-items: center; font-family: var(--serif); font-size: 12px; color: var(--ink2); font-weight: 700;
}
.tbl .user b { font-weight: 600; display: block; line-height: 1.3; }
.tbl .user span { font-size: 11px; color: var(--ink3); }
.tbl .pair { font-family: var(--mono); font-size: 12.5px; }
.tbl .dir { font-family: var(--mono); font-weight: 600; font-size: 12px; }
.tbl .dir.l { color: var(--up); } .tbl .dir.s { color: var(--down); }
.tbl .rowerr td { background: rgba(166, 58, 43, .07); }
.tbl .live {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--seal-red); margin-right: 6px; animation: pulse 1.6s infinite; vertical-align: 1px;
}
.tbl td.wrap { white-space: normal; max-width: 240px; font-size: 11.5px; line-height: 1.55; }

.tfoot { display: flex; align-items: center; gap: 12px; padding-top: 12px; font-size: 12px; color: var(--ink3); }
.pager { margin-left: auto; display: flex; gap: 4px; }
.pager button {
  min-width: 28px; height: 28px; padding: 0 8px;
  border: 1px solid var(--rule2); border-radius: 3px; background: transparent;
  color: var(--ink2); font-size: 12px; cursor: pointer; font-family: var(--mono);
}
.pager button:hover { border-color: var(--ink); color: var(--ink); }
.pager button.on { background: var(--ink); border-color: var(--ink); color: #FBF7ED; }

/* ---------- 按钮 / 开关 ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 16px;
  border-radius: 3px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter .15s, border-color .15s, color .15s, background .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 14px; height: 14px; }

.btn.gold {
  background: var(--gold-metal); color: #201705;
  text-shadow: 0 1px 0 rgba(255, 248, 220, .5);
  box-shadow:
    0 2px 10px rgba(138, 106, 26, .35),
    0 1px 0 rgba(255, 255, 255, .5) inset,
    inset 0 -2px 3px rgba(90, 64, 10, .45);
}
.btn.gold::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-20deg); transition: left .45s ease;
}
.btn.gold:hover { filter: brightness(1.06); }
.btn.gold:hover::after { left: 130%; }
.btn.ink { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.ink:hover { background: rgba(35, 29, 16, .06); }
.btn.danger { background: transparent; border-color: var(--seal-red); color: var(--seal-red); }
.btn.danger:hover { background: rgba(166, 58, 43, .06); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.link { background: none; border: none; color: var(--seal-red); padding: 0; height: auto; font-size: 12.5px; font-weight: 500; }
.btn.link:hover { text-decoration: underline; }

/* 小开关（表格内） */
.sw {
  position: relative; width: 34px; height: 19px; border-radius: 999px;
  background: var(--panel2); border: 1.5px solid var(--rule2);
  cursor: pointer; transition: background .18s, border-color .18s;
  flex: none;
}
.sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink3); transition: left .18s, background .18s;
}
.sw.on { background: rgba(176, 138, 42, .35); border-color: var(--gold-d); }
.sw.on::after { left: 17px; background: var(--gold-metal); box-shadow: 0 1px 2px rgba(90, 64, 10, .5); }

/* 跟单总闸（签名元素 2） */
.master {
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(180deg, #FBF7ED, #F6F0E1);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.master .info .lbl { display: block; margin-bottom: 8px; }
.master .info h2 { font-family: var(--serif); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.master .info .st { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.master .info .st b { font-family: var(--mono); font-weight: 600; color: var(--gold-d); }
.master .info .risk { font-size: 11.5px; color: var(--ink3); margin-top: 10px; max-width: 420px; line-height: 1.6; }

.msw {
  position: relative; width: 118px; height: 54px; border-radius: 999px;
  background: var(--panel2); border: 1.5px solid var(--rule2);
  cursor: pointer; flex: none;
  transition: background .28s, border-color .28s, box-shadow .28s;
}
.msw::after {
  content: ""; position: absolute; top: 5px; left: 5px;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(180deg, #8B8168, #6B6249);
  box-shadow: 0 3px 8px rgba(70, 58, 28, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: left .3s cubic-bezier(.4, 0, .2, 1), background .3s, box-shadow .3s;
}
.msw.on { background: var(--gold-metal); border-color: var(--gold-d); box-shadow: 0 2px 14px rgba(138, 106, 26, .4), inset 0 2px 3px rgba(255, 248, 220, .6), inset 0 -3px 6px rgba(90, 64, 10, .4); }
.msw.on::after { left: 69px; background: linear-gradient(180deg, #4A3D1E, #241C0A); box-shadow: 0 3px 10px rgba(70, 58, 28, .4), inset 0 1px 0 rgba(255, 248, 220, .35); }
.msw.on .msw-txt { left: 20px; }
.msw-txt {
  position: absolute; top: 50%; left: 58px; transform: translateY(-50%);
  font-family: var(--latin); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  color: var(--ink3); pointer-events: none; transition: left .3s, color .3s;
}
.msw.on .msw-txt { color: #201705; text-shadow: 0 1px 0 rgba(255, 248, 220, .5); }

/* ---------- 标签页 / 筛选 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule2); margin-bottom: 14px; }
.tabs button {
  background: none; border: none; cursor: pointer;
  padding: 9px 14px; font-size: 13px; font-weight: 500; color: var(--ink2);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  transition: color .15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--seal-red); }

.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip {
  height: 30px; padding: 0 13px; border-radius: 3px;
  border: 1px solid var(--rule2); background: transparent;
  color: var(--ink2); font-size: 12.5px; cursor: pointer; font-weight: 500;
  transition: color .15s, border-color .15s, background .15s;
}
.fchip:hover { color: var(--ink); border-color: var(--ink); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #FBF7ED; }

/* ---------- 表单（账本填空线） ---------- */
.in, select.in {
  height: 34px; padding: 0 6px; width: 100%;
  background: transparent;
  border: none; border-bottom: 1.5px solid var(--rule2);
  border-radius: 0; color: var(--ink); font: inherit; font-size: 13px;
  outline: none; transition: border-color .15s, background .15s;
}
.in:focus { border-bottom: 2px solid var(--gold-d); background: rgba(176, 138, 42, .05); }
.in::placeholder { color: var(--ink3); }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink3) 50%), linear-gradient(135deg, var(--ink3) 50%, transparent 50%); background-position: calc(100% - 12px) 15px, calc(100% - 7px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }

.fl { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.fl label { font-size: 12.5px; color: var(--ink2); }
.fl .hint { grid-column: 2; font-size: 11.5px; color: var(--ink3); margin-top: -6px; }

/* ---------- toast / 模态 / 骨架 / 空态 ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #FBF7ED; border: 1px solid var(--rule2); border-left: 4px solid var(--seal-red);
  color: var(--ink); font-size: 13px; padding: 10px 18px;
  box-shadow: 0 12px 32px rgba(70, 58, 28, .25);
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .28s, transform .28s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(60, 50, 24, .4); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s ease both;
}
.modal {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, #FBF7ED, #F5EFDF);
  border: 1.5px solid var(--rule2);
  border-top: 4px double var(--seal-red);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: modalIn .3s cubic-bezier(.22, .8, .3, 1) both;
}
.modal h3 { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.modal p { font-size: 13px; color: var(--ink2); margin-top: 8px; line-height: 1.7; }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.sk { position: relative; overflow: hidden; background: var(--panel2); }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  animation: shimmer 1.4s linear infinite;
}

.empty { text-align: center; padding: 40px 20px; color: var(--ink2); }
.empty .ic { width: 34px; height: 34px; color: var(--ink3); margin: 0 auto 12px; }
.empty b { display: block; font-family: var(--serif); font-size: 15px; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 320px; margin: 0 auto; line-height: 1.7; }
.empty .btn { margin-top: 16px; }

/* ---------- 列表流 ---------- */
.feed { display: flex; flex-direction: column; }
.feed .row {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--rule); font-size: 12.5px;
}
.feed .row:last-child { border-bottom: none; }
.feed .row.feed-in { animation: feedIn .5s cubic-bezier(.22, .8, .3, 1) both; }
.feed .grow { min-width: 0; }
.feed .grow b { font-weight: 600; display: block; line-height: 1.4; }
.feed .grow span { font-size: 11px; color: var(--ink3); }
.feed .amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }

/* ---------- 等级分布 ---------- */
.lv { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.lv .nm { width: 64px; font-family: var(--serif); font-size: 12.5px; font-weight: 700; flex: none; }
.lv .nm span { color: var(--gold-d); }
.lv .bar { flex: 1; height: 8px; background: var(--panel2); border: 1px solid var(--rule); overflow: hidden; }
.lv .bar i { display: block; height: 100%; background: var(--gold-metal); animation: barGrow 1s ease both; }
.lv .cnt { width: 52px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink2); flex: none; }

/* ---------- 待办 ---------- */
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.todo:last-child { border-bottom: none; }
.todo .ic { width: 16px; height: 16px; color: var(--warn); flex: none; }
.todo .grow { font-size: 13px; }
.todo .grow span { color: var(--ink3); font-size: 11.5px; display: block; }
.todo .seal { flex: none; }

/* ---------- 制度页 ---------- */
.scheme-tier { display: grid; grid-template-columns: 70px 1fr 1fr 100px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.scheme-tier.head { color: var(--ink3); font-size: 11px; padding-top: 0; }
.scheme-tier .lvl { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--gold-d); }
.calc-box { background: var(--panel2); border: 1px solid var(--rule); padding: 14px; }
.calc-box .r { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; }
.calc-box .r .v { font-family: var(--mono); font-weight: 600; }
.calc-box .r.total { border-top: 1px solid var(--rule2); margin-top: 6px; padding-top: 9px; }
.calc-box .r.total .v { color: var(--gold-d); font-size: 14px; }

/* ---------- 成员端 ---------- */
.greet { display: flex; align-items: baseline; gap: 10px; }
.greet h1 { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: .04em; }
.greet span { color: var(--ink3); font-size: 12.5px; }

/* 分润预告票据（带撕票孔） */
.ticket {
  position: relative;
  background: linear-gradient(180deg, #FCF8EE, #F4EDDA);
  border: 1px solid var(--gold-d);
  border-radius: var(--r);
  padding: 16px 18px 16px 34px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.ticket::before { /* 撕票孔 */
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 12px;
  background: var(--holes); background-size: 12px 12px;
}
.ticket:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 8px 20px rgba(70, 58, 28, .14); }
.ticket .t { font-size: 12px; color: var(--ink2); }
.ticket .v { font-family: var(--serif); font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; background: var(--gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.ticket .d { font-size: 11.5px; color: var(--ink3); margin-top: 6px; }

/* ---------- 页脚 ---------- */
.sheetfoot {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px;
  border-top: 3px double var(--rule2);
  background: rgba(239, 233, 218, .55);
  font-size: 11px; color: var(--ink3);
  font-family: var(--mono); letter-spacing: .04em;
}
.sheetfoot .r { margin-left: auto; }

/* ---------- 登录页（账房门牌） ---------- */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255, 252, 242, .55), transparent 60%),
    var(--desk);
  padding: 24px; position: relative; overflow: hidden;
}
.login-card {
  position: relative; width: 100%; max-width: 420px;
  background:
    var(--guilloche),
    linear-gradient(180deg, #FCF8EE 0%, #F4EDDA 100%);
  border: 1.5px solid var(--gold-d);
  border-radius: 4px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .6);
  padding: 38px 34px 30px;
}
.login-card::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid var(--rule); pointer-events: none;
}
.login-logo {
  width: 76px; height: 76px; margin: 0 auto 16px;
  border-radius: 50%; border: 1.5px solid var(--gold-d);
  background: var(--sheet);
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px rgba(176, 138, 42, .14);
}
.login-logo img { width: 78%; height: 78%; object-fit: contain; }
.login-card h1 { font-family: var(--serif); font-size: 28px; font-weight: 700; text-align: center; letter-spacing: .18em; }
.login-card .sub { font-family: var(--latin); text-align: center; font-size: 10px; letter-spacing: .34em; color: var(--gold-d); text-transform: uppercase; margin-top: 6px; }
.orn { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; color: var(--gold-d); }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rule2)); }
.orn::after { background: linear-gradient(90deg, var(--rule2), transparent); }
.orn i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-metal); box-shadow: 0 0 8px rgba(138, 106, 26, .4); }
.login-card .role { text-align: center; font-size: 12.5px; color: var(--ink2); margin-top: 12px; }
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.login-form .lab { font-size: 12px; color: var(--ink2); display: block; margin-bottom: 2px; }
.login-form .row2 { display: flex; justify-content: space-between; font-size: 12px; margin-top: 2px; }
.login-form .btn { width: 100%; height: 42px; margin-top: 4px; font-size: 14px; letter-spacing: .3em; }
.login-foot { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--rule2); text-align: center; font-size: 11px; color: var(--ink3); line-height: 1.9; }
.login-foot b { color: var(--gold-d); font-weight: 600; }
.login-card > * { animation: rise .55s cubic-bezier(.22, .8, .3, 1) both; }
.login-card > *:nth-child(1) { animation-delay: .05s; }
.login-card > *:nth-child(2) { animation-delay: .12s; }
.login-card > *:nth-child(3) { animation-delay: .18s; }
.login-card > *:nth-child(4) { animation-delay: .24s; }
.login-card > *:nth-child(5) { animation-delay: .3s; }
.login-card > *:nth-child(6) { animation-delay: .38s; }
.login-card > *:nth-child(7) { animation-delay: .46s; }

/* ---------- 动画 ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { 0% { transform: translateX(-140px); } 100% { transform: translateX(calc(100% + 250px)); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes barRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes barGrow { from { width: 0; } }
@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.7) rotate(-10deg); }
  55% { opacity: 1; transform: scale(.92) rotate(-4deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}

.rise { animation: rise .4s ease both; }
.chart rect.bar { transform-box: fill-box; transform-origin: center bottom; animation: barRise .7s cubic-bezier(.22, .8, .3, 1) both; animation-delay: calc(var(--i) * 34ms); }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .desk { padding: 12px 12px 40px; }
  .content { padding: 16px 16px 24px; }
  .masthead { flex-wrap: wrap; padding: 16px 18px; }
  .masthead .meta { margin-left: 0; width: 100%; text-align: left; }
  .tabs-nav { padding: 0 18px; }
  .s3, .s4, .s5, .s6, .s7, .s8, .s9 { grid-column: span 12; }
  .cert .cert-body { flex-wrap: wrap; gap: 16px; }
  .cert .cols { gap: 18px; flex-wrap: wrap; }
  .ghost { display: none; }
}

@media (max-width: 767px) {
  .kpis { grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
  .kpi .v { font-size: 24px; }
  .master { flex-direction: column; align-items: flex-start; gap: 16px; }
  .msw { align-self: center; }
  .tabs button { padding: 9px 10px; font-size: 12.5px; }
  .tape-item { font-size: 11px; }
  .chart-stats { grid-template-columns: repeat(2, 1fr); }
  .chart-stats > div { padding: 6px 10px; border-left: none; border-top: 1px solid var(--rule); }
  .chart-stats > div:nth-child(-n+2) { border-top: none; }
  .chartbox { min-height: 190px; }
  .cert .big { font-size: 32px; }
  .sheetfoot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== 硬性手机适配（任意设备不横向溢出） ===== */
html, body { overflow-x: clip; }
img, svg.chart { max-width: 100%; }
@media (max-width: 420px) {
  .content { padding-left: 12px !important; padding-right: 12px !important; }
  .kpi .v { font-size: clamp(17px, 6.4vw, 24px) !important; }
  .kpi .v small { font-size: 12px; }
  .goldstrip .lead .v { font-size: clamp(20px, 7.4vw, 30px) !important; }
  .cert .big { font-size: clamp(22px, 8.2vw, 32px) !important; }
  .tbl { min-width: 560px; }
  .masthead { padding: 14px 12px !important; }
  .topbar { padding: 10px 12px !important; }
  .tape-item { font-size: 10.5px; }
  .goldstrip { padding: 14px 14px 12px !important; }
  .cert { padding: 16px 14px !important; }
}
@media (max-width: 359px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 6px; }
  .kpi { padding: 10px; }
}
