/* ==========================================================================
   股库 StockLibs · 设计系统
   方向：墨底纸白（Ink & Paper）· 编辑级排版 · 克制的金色强调
        A 股语义色独占红/绿，不与强调色争抢
   原则：1px 发丝线分层（不用重阴影）· 大留白 · 数字等宽对齐 · 动效克制
   ========================================================================== */

/* ---------- 字体（自托管，不外链） ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/inter-400-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/inter-400-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url('../fonts/space-grotesk-500-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url('../fonts/space-grotesk-500-700-latin-ext.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/jetbrains-mono-400-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('../fonts/jetbrains-mono-400-600-latin-ext.woff2') format('woff2'); }

/* ---------- 令牌 ---------- */
:root {
  --ink-0: #08090d;
  --ink-1: #0d0f15;
  --ink-2: #14171f;
  --ink-3: #1b1f29;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --paper: #f2f3f5;
  --muted: #8a90a0;
  --faint: #575d6d;
  --accent: #c8a96a;
  --accent-soft: rgba(200, 169, 106, .14);
  --up: #ff5a5f;
  --down: #2fd87a;
  --flat: #8a90a0;
  --ma5: #e8c07d;
  --ma10: #7fb4ff;
  --ma20: #c79bff;
  --ma60: #6b7280;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, 'SF Mono', monospace;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --gut: 24px;
  --maxw: 1320px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

html[data-theme='light'] {
  --ink-0: #efece7;
  --ink-1: #f7f5f2;
  --ink-2: #ffffff;
  --ink-3: #f1efeb;
  --line: rgba(20, 22, 30, .09);
  --line-2: rgba(20, 22, 30, .18);
  --paper: #14161e;
  --muted: #6b7280;
  --faint: #9aa0ab;
  --accent: #9a7b34;
  --accent-soft: rgba(154, 123, 52, .12);
  --up: #d93025;
  --down: #12864a;
  --flat: #6b7280;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .28s var(--ease), color .28s var(--ease);
}
.topbar, .card, .stat, .table-wrap { transition: background-color .28s var(--ease), border-color .28s var(--ease); }

html[dir='rtl'] body { direction: rtl; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--ink-0); }

/* 数字：等宽 + 表格数字（对齐的关键） */
.num, .kpi, td.num, th.num, .ticker-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -.01em;
}

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* 可访问性：键盘焦点始终可见 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 骨架 ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink-1) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--ink-0)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 7px 12px; border-radius: 9px; color: var(--muted);
  font-size: 13.5px; font-weight: 500; transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover { color: var(--paper); background: var(--ink-3); }
.nav a.on { color: var(--paper); background: var(--ink-3); }
.nav a.on::after {
  content: ''; display: block; height: 2px; margin: 5px auto -9px; width: 16px;
  background: var(--accent); border-radius: 2px;
}
.topbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

/* 搜索（带下拉建议） */
.search-wrap { position: relative; }
.search-input {
  width: 240px; height: 36px; padding: 0 12px 0 34px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--paper); font-size: 13px; transition: border-color .18s var(--ease), width .22s var(--ease);
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--accent); outline: none; width: 288px; }
.search-ico { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.suggest {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; width: 340px; max-height: 380px; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 6px; z-index: 70;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .16s var(--ease-out), transform .16s var(--ease-out);
}
.suggest.on { opacity: 1; transform: none; pointer-events: auto; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sg-item:hover, .sg-item.active { background: var(--ink-3); }
.sg-code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 62px; }
.sg-name { font-size: 13px; }
.sg-board { margin-inline-start: auto; font-size: 11px; color: var(--faint); }

/* 语言 / 主题 / 账号 */
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.icon-btn:hover { border-color: var(--line-2); background: var(--ink-3); }
.lang-select {
  height: 36px; padding: 0 8px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--paper); font-size: 12.5px; cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--paper);
  font-size: 13.5px; font-weight: 500;
  transition: transform .16s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.btn:hover { border-color: var(--line-2); background: var(--ink-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--ink-0); font-weight: 600;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; min-width: 0;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card-hover:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.card-sub { font-size: 12px; color: var(--faint); }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 320px; }

/* ---------- 行情条 ---------- */
.ticker { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.tk { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 12.5px; }
.tk-name { color: var(--muted); }
.tk-val { font-weight: 600; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 340px at 12% -10%, var(--accent-soft), transparent 62%),
    radial-gradient(520px 300px at 88% 0%, rgba(127, 180, 255, .10), transparent 60%);
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px;
}
.eyebrow::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
h1.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.6vw, 68px);
  line-height: 1.04; letter-spacing: -.035em; font-weight: 700;
  margin: 22px 0 0; max-width: 17ch;
  background: linear-gradient(180deg, var(--paper) 30%, color-mix(in srgb, var(--paper) 55%, var(--ink-1)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { margin: 18px 0 30px; max-width: 52ch; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 46px; flex-wrap: wrap; }
.hs-v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hs-k { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- 指数卡 ---------- */
.idx-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.idx-name { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.idx-code { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.idx-val { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.025em; }
.idx-chg { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
.spark { display: block; width: 100%; height: 30px; opacity: .9; }

/* ---------- 榜单 ---------- */
.list-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px; font-size: 12px; color: var(--faint); }
.rank-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px;
  padding: 9px 8px; border-radius: 9px; cursor: pointer;
  transition: background .16s var(--ease);
}
.rank-row:hover { background: var(--ink-3); }
.rank-i { font-family: var(--font-mono); font-size: 11px; color: var(--faint); text-align: end; }
.rank-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-c { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.rank-p { font-family: var(--font-mono); font-size: 13px; text-align: end; min-width: 68px; }

/* 涨跌分布 */
.breadth-bar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.breadth-seg { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11.5px; color: rgba(0,0,0,.72); font-weight: 600; min-width: 0; }
.breadth-legend { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.dt { width: 100%; border-collapse: collapse; }
table.dt th, table.dt td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
table.dt th { font-size: 11.5px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
table.dt td.r, table.dt th.r { text-align: end; }
table.dt tbody tr { transition: background .14s var(--ease); }
table.dt tbody tr:hover { background: var(--ink-3); }
table.dt tbody tr:last-child td { border-bottom: 0; }
.tcode { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- 个股页 ---------- */
.inst-head { padding: 30px 0 8px; }
.inst-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.inst-name { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.03em; margin: 0; }
.inst-code { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.inst-price { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.inst-px { font-family: var(--font-display); font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.inst-chg { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.inst-meta { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pill { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill-accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); background: var(--accent-soft); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 2px; margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); }
.stat { background: var(--ink-2); padding: 13px 15px; }
.stat-k { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.stat-v { font-family: var(--font-mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 周期切换 */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 11px; }
.tab {
  position: relative; border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; color: var(--muted);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab:hover { color: var(--paper); }
.tab[aria-selected='true'] { color: var(--ink-0); background: var(--accent); font-weight: 600; }

/* 图表 */
.chart-card { padding: 16px 16px 10px; }
.chart-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ''; width: 12px; height: 2px; border-radius: 2px; background: currentColor; }
.chart-box { position: relative; }
.chart-box canvas { display: block; width: 100%; cursor: crosshair; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: color-mix(in srgb, var(--ink-0) 92%, transparent);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65;
  opacity: 0; transform: translateY(3px); transition: opacity .12s var(--ease);
  backdrop-filter: blur(8px); white-space: nowrap;
}
.chart-tip.on { opacity: 1; transform: none; }
.chart-tip b { color: var(--muted); font-weight: 400; margin-inline-end: 6px; }
.chart-state {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 13px; gap: 8px;
}

/* 分时图 */
.minute-note { font-size: 11.5px; color: var(--faint); margin-top: 8px; }

/* ---------- 时光机条 + 全屏 ---------- */
.tm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tm-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tm-date { background: var(--ink-3); border: 1px solid var(--line); color: var(--paper);
  border-radius: 10px; padding: 6px 10px; font-family: var(--font-mono); font-size: 12.5px; }
.tm-date:focus { outline: none; border-color: var(--accent); }
.tm-viewing { font-size: 12.5px; color: var(--accent); }
.tm-hint { font-size: 12px; }

/* 全屏：容器铺满，图表自己按视口算高度 */
.chart-card:fullscreen { background: var(--ink-1); border: 0; border-radius: 0; padding: 10px 12px;
  display: flex; flex-direction: column; }
.chart-card:fullscreen .chart-box { flex: 1; }
body.is-full { overflow: hidden; }

/* 手机横屏：收紧头部与页脚，把高度让给图 */
@media (orientation: landscape) and (max-height: 560px) {
  .topbar, .mobilenav, .site-foot { display: none; }
  .inst-head { padding: 8px 0 4px; }
  .inst-name { font-size: 22px; }
  .sec { margin-top: 8px; }
  .chart-card { padding: 8px; border-radius: 10px; }
  .tm-bar { margin-bottom: 6px; padding-bottom: 6px; }
  .chart-head { margin-bottom: 6px; }
}

/* ---------- 选股器 ---------- */
.scr-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cond { display: flex; flex-direction: column; gap: 6px; }
.cond-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: transparent;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .16s var(--ease);
  text-align: start; width: 100%;
}
.cond-item:hover { border-color: var(--line-2); background: var(--ink-3); transform: translateY(-1px); }
.cond-item.on { border-color: var(--accent); background: var(--accent-soft); }
.cond-item .lk { margin-inline-start: auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cond-item.locked { color: var(--muted); }
.editor {
  width: 100%; min-height: 96px; padding: 12px; border-radius: 10px; resize: vertical;
  background: var(--ink-3); border: 1px solid var(--line); color: var(--paper);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
}
.editor:focus { outline: none; border-color: var(--accent); }
.scr-stats { display: flex; gap: 16px; font-size: 12px; color: var(--faint); flex-wrap: wrap; align-items: center; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--ink-3), var(--ink-2), var(--ink-3)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (max-width: 980px) { .scr-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 空状态 / 页脚 ---------- */
.admin-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px var(--gut) 60px; }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
/* ---------- 认证页（登录 / 注册）----------
   独立版式：不套主站外壳，居中卡片 + 大留白，输入框 48px / 16px 字号（避免 iOS 聚焦缩放）
*/
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.auth-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(700px 320px at 15% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(520px 300px at 88% 4%, rgba(127, 180, 255, .10), transparent 60%);
}
.auth-top, .auth-main, .auth-foot { position: relative; z-index: 1; }
.auth-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gut); max-width: var(--maxw); width: 100%; margin: 0 auto;
}
.auth-top-right { display: flex; align-items: center; gap: 10px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px var(--gut) 40px; }
.auth-card {
  width: 100%; max-width: 424px;
  background: color-mix(in srgb, var(--ink-2) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 34px 32px 28px;
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .75);
}
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: authIn .5s var(--ease-out) both; }
  @keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
}
.auth-title {
  font-family: var(--font-display); font-size: 27px; font-weight: 700;
  letter-spacing: -.03em; margin: 0 0 6px;
}
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; line-height: 1.65; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px;
  color: var(--paper); font-size: 16px; font-family: var(--font-sans);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.field input:hover { border-color: var(--line-2); }
.field input:focus {
  outline: none; border-color: var(--accent); background: var(--ink-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-btn { width: 100%; height: 48px; margin-top: 8px; font-size: 15px; border-radius: 12px; }
.auth-err {
  background: color-mix(in srgb, var(--up) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--up) 42%, transparent);
  color: var(--up); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 16px;
}
.auth-ok {
  background: color-mix(in srgb, var(--down) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--down) 36%, transparent);
  color: var(--down); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 16px;
  line-height: 1.6;
}
.auth-ok.is-err {
  background: color-mix(in srgb, var(--up) 14%, transparent);
  border-color: color-mix(in srgb, var(--up) 42%, transparent);
  color: var(--up);
}
.field-row { display: flex; gap: 8px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 20px; }
.auth-tab { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 13.5px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease); }
.auth-tab:hover { color: var(--paper); }
.auth-tab.on { color: var(--ink-0); background: var(--accent); font-weight: 600; }
.field-row input { flex: 1; min-width: 0; }
.field-row .btn { height: 48px; white-space: nowrap; border-radius: 12px; padding: 0 14px; }
@media (max-width: 420px) {
  .field-row { flex-direction: column; }
  .field-row .btn { width: 100%; }
}
.auth-alt { margin: 20px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-alt a { color: var(--accent); border-bottom: 1px solid transparent; }
.auth-alt a:hover { border-bottom-color: var(--accent); }
.auth-foot { padding: 22px var(--gut) 30px; text-align: center; font-size: 12px; }
@media (max-width: 520px) {
  .auth-top { padding: 14px var(--gut); }
  .auth-main { padding: 4px var(--gut) 28px; align-items: flex-start; }
  .auth-card { max-width: none; padding: 26px 20px 22px; border-radius: 16px; }
  .auth-title { font-size: 24px; }
  .brand span:last-child { display: inline; }
}

.feed-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-time { font-size: 11.5px; color: var(--faint); padding-top: 3px; }
.feed-title { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.feed-sum { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.mt-note { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.ann-row { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.ann-row:last-child { border-bottom: 0; }
.ann-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); flex: 0 0 84px; }
.ann-title { flex: 1; min-width: 0; font-size: 13.5px; }
.ann-title:hover { color: var(--accent); }
@media (max-width: 620px) { .feed-item { grid-template-columns: minmax(0, 1fr); gap: 6px; } .feed-time { padding-top: 0; } }

.chat { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 52vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); }
.msg.assistant { align-self: flex-start; background: var(--ink-3); border: 1px solid var(--line); }
.chat-input { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }

.empty { padding: 56px 20px; text-align: center; color: var(--faint); }
.empty-title { font-family: var(--font-display); font-size: 17px; color: var(--paper); margin-bottom: 6px; }

.site-foot { margin-top: 64px; border-top: 1px solid var(--line); padding: 26px 0 34px; color: var(--faint); font-size: 12.5px; }
.foot-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot-disclaimer { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* 区块标题 */
.sec { margin-top: 40px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.sec-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.sec-note { font-size: 12.5px; color: var(--faint); }

/* ---------- 动效（尊重 reduced-motion） ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* 滚动进入视口才揭示（比"一进页面全动"更克制） */
  .reveal { opacity: 0; transform: translateY(14px); }
  .reveal.in {
    opacity: 1; transform: none;
    transition: opacity .58s var(--ease-out), transform .58s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .sku { display: inline-block; animation: sku .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms + .1s); }
  @keyframes sku { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
.mobilenav { display: none; }
@media (max-width: 820px) {
  .mobilenav {
    display: block; position: sticky; top: 56px; z-index: 55;
    background: color-mix(in srgb, var(--ink-1) 92%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .mobilenav-inner { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
  .mobilenav-inner::-webkit-scrollbar { display: none; }
  .mobilenav a {
    white-space: nowrap; font-size: 13px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted);
  }
  .mobilenav a.on { color: var(--ink-0); background: var(--accent); border-color: var(--accent); font-weight: 600; }
}
@media (max-width: 1100px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --gut: 16px; }
  .topbar-inner { height: 56px; gap: 10px; flex-wrap: nowrap; }
  .nav { display: none; }
  .search-input, .search-input:focus { width: 150px; }
  .suggest { width: min(88vw, 340px); }
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 40px 0 30px; }
  .hero-stats { gap: 24px; margin-top: 30px; }
  .inst-head { padding: 20px 0 4px; }
  .sec { margin-top: 28px; }
  .rank-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .rank-c { display: none; }
}
@media (max-width: 520px) {
  .search-input, .search-input:focus { width: 116px; }
  .brand span:last-child { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
