/* 全球流动性监控看板 — 样式（暖色极简风） */

@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 纸面与墨色 */
  --bg: #faf9f5;
  --panel: #ffffff;
  --panel-2: #f5f4ee;
  --panel-3: #eeece3;
  --line: #e8e6dc;
  --line-2: #d8d5c9;
  --text: #141413;
  --text-2: #3d3d3a;
  --muted: #6f6e69;
  --faint: #9c9a92;
  /* 强调：墨黑用于操作，陶土色仅作点缀 */
  --ink: #141413;
  --on-ink: #faf9f5;
  --brand: #d97757;
  --brand-strong: #b85c3e;
  --brand-bg: rgba(217, 119, 87, .10);
  --accent: #3d3d3a;          /* 图表默认走势线（墨灰） */
  --accent-2: #b85c3e;        /* 链接 */
  --accent-bg: rgba(20, 20, 19, .06);
  --gold: #b85c3e;
  --gold-bg: rgba(217, 119, 87, .10);
  /* 状态色（已通过色觉障碍区分度验证；配合文字标签使用） */
  --ok: #2f7d6d;
  --warn: #c48a1f;
  --danger: #c0452f;
  --neutral: #8a877e;
  --ok-ink: #2f7d6d;
  --warn-ink: #8e6211;
  --danger-ink: #a93c29;
  --ok-bg: rgba(47, 125, 109, .09);
  --warn-bg: rgba(196, 138, 31, .12);
  --danger-bg: rgba(192, 69, 47, .09);
  --neutral-bg: rgba(20, 20, 19, .05);
  --chart-grid: #ecebe4;
  --shadow: none;
  --shadow-pop: 0 1px 2px rgba(20, 20, 19, .04), 0 12px 32px rgba(20, 20, 19, .10);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: "Source Serif 4", "Songti SC", "STSongti-SC-Regular", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1c1b19;
  --panel: #252422;
  --panel-2: #2c2b28;
  --panel-3: #34332f;
  --line: #34332f;
  --line-2: #45433e;
  --text: #f0eee6;
  --text-2: #cdcabf;
  --muted: #9a978d;
  --faint: #6f6c64;
  --ink: #f0eee6;
  --on-ink: #1c1b19;
  --brand: #d97757;
  --brand-strong: #e08a6d;
  --brand-bg: rgba(217, 119, 87, .14);
  --accent: #d6d3c8;
  --accent-2: #e08a6d;
  --accent-bg: rgba(240, 238, 230, .08);
  --gold: #e08a6d;
  --gold-bg: rgba(217, 119, 87, .14);
  --ok: #5fae98;
  --warn: #e0ae4a;
  --danger: #e4573d;
  --neutral: #8f8c83;
  --ok-ink: #7cc2ad;
  --warn-ink: #e8bd62;
  --danger-ink: #ee7b64;
  --ok-bg: rgba(95, 174, 152, .13);
  --warn-bg: rgba(224, 174, 74, .13);
  --danger-bg: rgba(228, 87, 61, .14);
  --neutral-bg: rgba(240, 238, 230, .07);
  --chart-grid: #302f2c;
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; color: var(--text); }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { height: 18px; }

/* ------------------------------------------------------------ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 2px; margin-left: 16px; }
.nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--accent-bg); }
.nav a.active { color: var(--text); font-weight: 500; background: var(--accent-bg); }
.nav .badge-dot {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px;
  border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 1px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--text-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); color: var(--text); font-size: 12px; font-weight: 600; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-bg); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-toggle { display: none; }

/* 中文 / EN 切换 */
.lang-switch { display: inline-flex; flex: none; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.lang-switch button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; line-height: 1;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); cursor: default; }
/* 英文模式：静态文字翻译完成前先隐藏，避免闪现中文 */
html.i18n-pending [data-i18n] { visibility: hidden; }

/* ------------------------------------------------------------ 甲骨文标志「天泉」 */
:root { --oracle: #5b4332; }
:root[data-theme="dark"] { --oracle: #d9b58c; }
.oracle-mark { display: block; height: 40px; width: auto; flex: none; color: var(--oracle); }
.brand-divider { width: 1px; height: 30px; background: var(--line-2); flex: none; margin: 0 4px; }
/* 登录 / 注册页：标志与站名铺满左栏整行（站名字号由 auth.js 的 fitBrandName 按可用宽度计算） */
.hero-brand { container-type: inline-size; }
.auth-hero .brand { width: 100%; gap: 2.4cqi; }
.auth-hero .oracle-mark { height: 17cqi; }
.auth-hero .brand-divider { height: 12cqi; margin: 0; }
.auth-hero .brand-text { flex: 1; }
.auth-hero .brand-name { font-size: 20px; letter-spacing: .01em; text-overflow: clip; }

/* ------------------------------------------------------------ 看板顶部星图 */
.starfield { position: relative; height: 230px; overflow: hidden; }
.starfield canvas {
  position: absolute; inset: 0; display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}
.starfield + .container { padding-top: 4px; }
.sf-quote {
  position: absolute; top: 20px; left: max(32px, calc((100% - 1320px) / 2 + 32px));
  font-family: var(--serif); color: var(--text-2); opacity: 0; transition: opacity .9s ease; pointer-events: none;
}
.sf-quote.on { opacity: 1; }
.sf-quote .q { font-size: 18px; letter-spacing: .12em; }
.sf-quote:lang(en) { max-width: calc(100% - 420px); }
.sf-quote:lang(en) .q { font-size: 17px; letter-spacing: 0; font-style: italic; }
.sf-quote .src { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 12px; letter-spacing: .02em; }
.sf-legend {
  position: absolute; top: 24px; right: max(32px, calc((100% - 1320px) / 2 + 32px));
  display: flex; gap: 16px; font-size: 12px; color: var(--muted); pointer-events: none;
}
.sf-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.sf-legend i.c { background: var(--brand); }
.sf-legend i.m { background: var(--text); }
.sf-tip {
  position: absolute; z-index: 5; max-width: 300px; padding: 10px 13px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  font-size: 12.5px; line-height: 1.65; color: var(--text-2);
}
.sf-tip b { display: block; color: var(--text); font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 2px; }

/* ------------------------------------------------------------ 布局 */
.container { max-width: 1320px; margin: 0 auto; padding: 40px 32px 80px; }
.container.narrow { max-width: 920px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.card-title .muted { font-size: 12.5px; }

/* ------------------------------------------------------------ 按钮与表单 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { opacity: .88; background: var(--ink); }
.btn.gold { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn.gold:hover { opacity: .9; background: var(--brand-strong); }
.btn.danger { color: var(--danger-ink); }
.btn.danger:hover { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 40%, var(--line-2)); }
.btn.ok { color: var(--ok-ink); }
.btn.ok:hover { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, var(--line-2)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--accent-bg); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }

label.field, .field { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; }
.field > input, .field > select, .field > textarea { display: block; margin-top: 7px; }
.field > .upload-box, .field > .qr-edit, .field > .row { margin-top: 7px; }
.field .hint { font-size: 12px; color: var(--faint); margin-left: 4px; font-weight: 400; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"],
input:not([type]), select, textarea {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 400;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 11px 13px; line-height: 1.65; resize: vertical; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 15px; height: 15px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px;
  padding: 5px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--panel); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }

/* ------------------------------------------------------------ 徽标与状态点 */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; text-decoration: none;
  background: var(--neutral-bg); color: var(--muted);
}
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger-ink); }
.badge.accent { background: var(--accent-bg); color: var(--text-2); }
.badge.gold { background: var(--brand-bg); color: var(--brand-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dot.neutral { background: var(--neutral); opacity: .7; }
.dot.nodata { background: transparent; border: 1.5px dashed var(--faint); }

/* ------------------------------------------------------------ 试用横幅 */
.trial-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 32px; font-size: 13.5px; color: var(--text-2);
  background: var(--brand-bg); border-bottom: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
}
.trial-banner b { color: var(--brand-strong); font-variant-numeric: tabular-nums; font-weight: 600; }
.trial-banner .btn { margin-left: auto; }

/* ------------------------------------------------------------ 看板：总览 */
.overview {
  display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; gap: 18px;
  grid-template-areas: "score history signal" "water weekly weekly";
}
.overview .score-card { grid-area: score; }
.overview .history-card { grid-area: history; display: flex; flex-direction: column; }
.overview .signal-card { grid-area: signal; }
.overview .water-card { grid-area: water; }
.overview .weekly-card { grid-area: weekly; }

/* 大类资产流动性承接水位 */
.water-list { display: flex; flex-direction: column; gap: 14px; }
.water-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.water-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.water-name b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.water-name span { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.water-val { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.water-spark { height: 44px; margin-top: 5px; }
.water-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.water-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; color: var(--muted); }

/* 本周大类资产分析 */
.weekly-card .card-title { flex-wrap: wrap; }
table.weekly-table { font-size: 13px; }
table.weekly-table th, table.weekly-table td { padding: 8px 12px; }
table.weekly-table td.num { font-variant-numeric: tabular-nums; }
.weekly-foot { margin: 6px 0 0; }
.weekly-text { margin: 14px 0 10px; }
.weekly-text p { margin: 0 0 10px; font-size: 14px; line-height: 1.85; color: var(--text-2); }
.weekly-text b { color: var(--text); font-weight: 600; }
.score-card { display: flex; flex-direction: column; }
.score-gauge { height: 190px; margin: -4px -6px 0; }
.score-level { text-align: center; font-family: var(--serif); font-size: 20px; font-weight: 500; margin-top: 2px; }
.score-deltas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.delta-box { border-top: 1px solid var(--line); padding: 10px 2px 0; }
.delta-box .k { font-size: 12px; color: var(--muted); }
.delta-box .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-chart { flex: 1; min-height: 260px; }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.signal-box { padding: 12px 6px 10px; text-align: center; border-right: 1px solid var(--line); }
.signal-box:last-child { border-right: 0; }
.signal-box .n { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.signal-box .k { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.signal-box .k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.signal-box.ok .k::before { background: var(--ok); }
.signal-box.warn .k::before { background: var(--warn); }
.signal-box.danger .k::before { background: var(--danger); }
.risk-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.risk-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 32px; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.risk-list li:hover .rname { color: var(--text); }
.risk-list .rname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.risk-list .rval { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.meter { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 2px; background: var(--accent); opacity: .55; }
.meter.warn > i { background: var(--warn); opacity: 1; }
.meter.danger > i { background: var(--danger); opacity: 1; }
.meter.neutral > i { background: var(--neutral); opacity: .5; }
.freshness { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }

/* ------------------------------------------------------------ 看板：点评 */
.posts { margin-top: 18px; display: grid; gap: 14px; }
.post { padding: 20px 24px; }
.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-head h3 { font-size: 19px; }
.post-body { margin-top: 10px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.85; }
.post.collapsed .post-body { max-height: 5.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.post-toggle { margin-top: 6px; font-size: 13px; background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ 看板：工具条与板块 */
.toolbar {
  position: sticky; top: 64px; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 36px -32px 8px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; padding: 5px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.section { margin-top: 44px; scroll-margin-top: 140px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--muted); font-size: 13.5px; }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px 14px; }

/* 指标解读：卡片上方，默认 3 行（同一行卡片保持对齐），可展开全文 */
.ind-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ind-cell > .ind-card { flex: 1; }
.ind-note { padding: 0 4px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.ind-note-text {
  margin: 0; min-height: calc(1.65em * 3); overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.ind-note-text b { color: var(--text-2); font-weight: 600; }
.ind-note.open .ind-note-text { display: block; -webkit-line-clamp: unset; }
.ind-note-more[hidden] { display: inline-block; visibility: hidden; }  /* 不需要“展开”时也占位，保证同一行卡片对齐 */
.ind-note-more { margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.ind-card { position: relative; padding: 18px 18px 10px; cursor: pointer; transition: border-color .15s; }
.ind-card:hover { border-color: var(--line-2); }
.ind-card.s-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.ind-card.s-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.ind-head { display: flex; align-items: flex-start; gap: 8px; min-height: 40px; }
.ind-head .dot { margin-top: 7px; }
.ind-name { font-size: 13.5px; color: var(--text-2); font-weight: 500; line-height: 1.45; }
.ind-head .badge { margin-left: auto; flex: none; }
.ind-value { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.ind-value .v { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ind-value .u { font-size: 12.5px; color: var(--muted); }
.ind-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.chg.bad { color: var(--danger-ink); }
.chg.good { color: var(--ok-ink); }
.chg.flat { color: var(--muted); }
.ind-pct { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ind-pct .num { font-variant-numeric: tabular-nums; }
.spark { height: 64px; margin: 8px -6px 0; }
.ind-empty { padding: 16px 0 10px; font-size: 13px; color: var(--faint); }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--panel); white-space: nowrap; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--panel-2); }
table.data td.r, table.data th.r { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data .group-row td { background: var(--panel-2); font-family: var(--serif); font-weight: 500; font-size: 15px; color: var(--text); }

.site-footer { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.site-footer a { color: var(--text-2); }

/* ------------------------------------------------------------ 弹窗与提示 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 20, 19, .32);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; overflow-y: auto;
  animation: fade .15s ease-out;
}
.modal { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); animation: rise .18s ease-out; }
.modal.wide { max-width: 1000px; }
.modal.mid { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 20px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 22px 24px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.toast-wrap { position: fixed; top: 76px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 220px; max-width: 380px; padding: 11px 16px; border-radius: 12px; font-size: 14px;
  background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-pop);
  animation: rise .2s ease-out; pointer-events: auto;
}
.toast.ok::before { content: "✓  "; font-weight: 700; }
.toast.error { background: var(--danger); color: #fff; }
.toast.error::before { content: "!  "; font-weight: 700; }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); }
.alert.warn { background: var(--warn-bg); border-color: transparent; }
.alert.danger { background: var(--danger-bg); border-color: transparent; }
.alert.ok { background: var(--ok-bg); border-color: transparent; }
.alert.info { background: var(--panel-2); }

/* 指标详情弹窗 */
.detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 0; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { padding: 11px 14px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 19px; font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v .chg { font-family: var(--font); font-size: 15px; }
.detail-chart { height: 380px; }
.detail-desc { margin-top: 16px; color: var(--text-2); font-size: 14px; line-height: 1.85; }
.detail-src { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ 水印 */
.watermark { position: fixed; inset: 0; z-index: 40; pointer-events: none; background-repeat: repeat; opacity: .55; }

/* ------------------------------------------------------------ 登录注册 */
.auth-page { display: flex; min-height: 100vh; }
.auth-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); width: 100%; min-height: 100vh; }
.auth-tools { position: absolute; top: 20px; right: 20px; z-index: 5; display: flex; align-items: center; gap: 8px; }
.auth-hero { padding: 56px 72px; display: flex; flex-direction: column; justify-content: center; gap: 30px; border-right: 1px solid var(--line); }
.auth-hero .brand { margin-bottom: 12px; }
.auth-hero h1 { font-size: 50px; line-height: 1.15; font-weight: 500; letter-spacing: -.02em; }
.auth-hero h1 em { font-style: normal; color: var(--brand); }
.auth-hero .lead { color: var(--text-2); font-size: 16px; max-width: 560px; line-height: 1.85; }
/* 登录页：综合流动性水位 */
.pulse { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: center; max-width: 600px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pulse-gauge { position: relative; }
.pulse-gauge svg { display: block; width: 100%; height: auto; }
.pulse-gauge .band { fill: none; stroke-width: 8; }
.pulse-gauge .gap line { stroke: var(--bg); stroke-width: 2.5; }
.pulse-gauge .needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.pulse-gauge .anchor { fill: var(--bg); stroke: var(--text); stroke-width: 2; }
.pulse-value { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-family: var(--serif); font-size: 36px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.pulse-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pulse-head b { color: var(--text); font-weight: 500; font-family: var(--serif); font-size: 18px; }
.pulse-head span { font-size: 12.5px; color: var(--muted); }
.pulse-level { font-family: var(--serif); font-size: 24px; font-weight: 500; margin: 6px 0 10px; }
.pulse-deltas { display: flex; gap: 22px; font-size: 15px; }
.pulse-deltas i { font-style: normal; font-size: 12.5px; color: var(--muted); margin-right: 8px; }
.pulse-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 登录页：背景银河系（galaxy.js）。画布在两栏背景之上、内容之下 */
.galaxy { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.auth-hero > *, .auth-side > * { position: relative; z-index: 2; }
.auth-card h2.welcome { margin-bottom: 28px; }

/* 登录页：右侧星图（沿用看板顶部星图，窄版） */
.auth-starfield { width: 100%; max-width: 600px; height: 220px; margin-bottom: 20px; flex: none; }
.auth-starfield .sf-quote, .auth-starfield .sf-quote:lang(en) { left: 18px; top: 14px; max-width: calc(100% - 36px); }
.auth-starfield .sf-quote .q { font-size: 15px; }
.auth-starfield .sf-legend { display: none; }
.pricing-note { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14.5px; color: var(--text-2); }
.pricing-note .pill { padding: 5px 12px; border-radius: 999px; background: var(--brand-bg); color: var(--brand-strong); font-weight: 500; }
.pricing-note b { color: var(--text); font-family: var(--serif); font-size: 18px; font-weight: 600; }
.auth-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 28px; position: relative; background: var(--panel-2); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 32px; }
.auth-card .sub { color: var(--muted); margin: 8px 0 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 18px; }
.auth-card .foot { margin-top: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.form-error { color: var(--danger-ink); font-size: 13.5px; min-height: 18px; }

/* ------------------------------------------------------------ 付款页 */
.pay-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 30px 32px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.pay-hero h1 { font-size: 30px; }
.pay-hero p { color: var(--text-2); margin-top: 8px; }
.price-tag { text-align: right; }
.price-tag .amt { font-family: var(--serif); font-size: 46px; font-weight: 500; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.price-tag .per { font-size: 13px; color: var(--muted); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pay-method h4 { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.pay-method .qr { display: block; width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: contain; margin: 16px auto 6px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; margin-top: 14px; font-size: 14px; }
.kv .k { color: var(--muted); white-space: nowrap; }
.kv .v { font-variant-numeric: tabular-nums; word-break: break-all; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.step { padding: 18px 18px 18px 58px; position: relative; font-size: 13.5px; color: var(--muted); border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 16px; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--brand); }
.step b { display: block; color: var(--text); font-size: 14.5px; font-weight: 500; margin-bottom: 3px; }
.upload-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--panel-2); cursor: pointer; font-weight: 400; }
.upload-box:hover { border-color: var(--text-2); }
.upload-box img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--panel-3); }
.upload-box .ph { width: 64px; height: 64px; border-radius: 8px; background: var(--panel-3); display: grid; place-items: center; color: var(--faint); font-size: 24px; }

/* ------------------------------------------------------------ 管理后台 */
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.side-tabs { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; padding: 0; background: transparent; border: 0; }
.side-tabs button {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 9px; cursor: pointer; text-align: left;
}
.side-tabs button:hover { background: var(--accent-bg); color: var(--text); }
.side-tabs button.active { background: var(--accent-bg); color: var(--text); font-weight: 500; }
.side-tabs .cnt { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; }
.tile .k { font-size: 12.5px; color: var(--muted); }
.tile .v { font-family: var(--serif); font-size: 30px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile.gold .v { color: var(--brand-strong); }
.tile.ok .v { color: var(--ok-ink); }
.tile.danger .v { color: var(--danger-ink); }
.log-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log-list li { display: grid; grid-template-columns: 130px 90px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: 0; }
.pay-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.pay-item .proof { width: 110px; height: 110px; border-radius: 12px; object-fit: cover; background: var(--panel-3); cursor: zoom-in; border: 1px solid var(--line); }
.pay-item .noproof { width: 110px; height: 110px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--faint); font-size: 12px; text-align: center; }
.pay-item .kv { grid-template-columns: auto minmax(0, 1fr); margin-top: 8px; font-size: 13.5px; }
.pay-actions { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
.sec-block { margin-bottom: 20px; }
.sec-block .sec-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sec-block .sec-bar h3 { font-size: 18px; }
.sec-block.card { padding: 0; overflow: hidden; }
.formula { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.preview-box { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.preview-box table { width: 100%; font-variant-numeric: tabular-nums; font-size: 12.5px; border-collapse: collapse; margin-top: 6px; }
.preview-box td { padding: 2px 0; }
.qr-edit { display: flex; gap: 14px; align-items: center; }
.qr-edit img, .qr-edit .ph { width: 96px; height: 96px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.qr-edit .ph { background: var(--panel-2); display: grid; place-items: center; color: var(--faint); font-size: 12px; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 22px; margin: 0 0 18px; background: var(--panel); }
fieldset.group legend { padding: 0 8px; font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--text); }
.empty { padding: 40px 16px; text-align: center; color: var(--faint); }
details summary { color: var(--text-2); }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 90px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .overview { grid-template-columns: 1fr 1fr; grid-template-areas: "score signal" "history history" "water weekly"; }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-tools { top: 14px; right: 16px; }
  .auth-hero { padding: 72px 24px 36px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-hero h1 { font-size: 34px; }
  .pulse { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
  .pulse-value { font-size: 28px; }
  .pulse-level { font-size: 20px; }
  .pulse-deltas { flex-direction: column; gap: 2px; }
  .auth-starfield { height: 180px; }
  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .side-tabs { position: static; flex-direction: row; overflow-x: auto; }
  .side-tabs button { white-space: nowrap; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 10px; height: 58px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .topbar .brand-text, .topbar .brand-divider { display: none; }
  .topbar .oracle-mark { height: 34px; }
  .starfield { height: 180px; }
  .sf-legend { display: none; }
  .sf-quote, .sf-quote:lang(en) { left: 16px; top: 12px; max-width: calc(100% - 32px); }
  .sf-quote .q { font-size: 15px; }
  .sf-quote .src { display: block; margin: 2px 0 0; }
  .menu-toggle { display: grid; }
  .nav {
    display: none; position: absolute; top: 58px; left: 0; right: 0; margin: 0; flex-direction: column;
    padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .user-chip .uname, .user-chip .badge { display: none; }
  .user-chip { padding: 3px; border: 0; }
  .container { padding: 24px 16px 56px; }
  .page-head h1 { font-size: 27px; }
  .toolbar { top: 58px; margin: 28px -16px 6px; padding: 10px 16px; }
  .trial-banner { padding: 10px 16px; }
  .overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: "score" "history" "water" "weekly" "signal"; }
  .form-grid { grid-template-columns: 1fr; }
  .pay-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .price-tag { text-align: left; }
  .pay-item { grid-template-columns: 80px minmax(0, 1fr); }
  .pay-item .proof, .pay-item .noproof { width: 80px; height: 80px; }
  .pay-actions { grid-column: 1 / -1; flex-direction: row; }
  .log-list li { grid-template-columns: 1fr; gap: 2px; }
  .detail-chart { height: 300px; }
  .ind-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .section-head h2 { font-size: 21px; }
}
