/* Stock Violet · 全站样式
 * 设计语言：骨白、石墨黑、酒红强调；行情红涨绿跌。
 * 不依赖任何外部 CDN / 构建工具。
 */

/* ===== 设计令牌 ===== */
:root {
  --bg: #F6F5F2;
  --surface: #FEFEFC;
  --surface-muted: #F1EFEB;
  --border: #D8D5CE;
  --border-strong: #B9B5AE;
  --text-primary: #171717;
  --text-secondary: #5F5B55;
  --text-muted: #928D85;
  --up: #B6362F;
  --up-bg: #F8E9E7;
  --down: #2F6F55;
  --down-bg: #E7F0EB;
  --accent: #8F2433;
  --accent-hover: #721B28;
  --accent-soft: #F3E8EA;
  --focus-ring: rgb(143 36 51 / .16);
  --shadow-lg: 0 18px 45px rgb(23 23 23 / .08);
  --radius-xl: 6px;
  --radius-md: 5px;
  --chart-up: #B6362F;
  --chart-down: #2F6F55;
  --chart-grid: #E8E5DF;
  --chart-text: #736F68;
  --font-sans: "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC Variable", "Songti SC", SimSun, serif;
  --font-mono: "JetBrains Mono Variable", "Noto Sans SC Variable", monospace;
  --font-data-display: var(--font-mono);
}

/* ===== 重置 / 基础 ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-feature-settings: "tnum" on, "lnum" on;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.875rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover { background: var(--surface-muted); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button.primary:hover { background: var(--accent-hover); }

input[type="text"], input[type="search"], input[type="password"], select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus,
select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ===== 排版层级 ===== */
.h-title { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.h-section { font-size: 1.05rem; font-weight: 500; margin: 0; }
.h-meta { font-size: 0.8125rem; color: var(--text-secondary); }
.h-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-secondary); font-weight: 500;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ===== 涨跌色 ===== */
.up { color: var(--up); }
.down { color: var(--down); }
.up-bg { background: var(--up-bg); color: var(--up); padding: 0 0.25rem; border-radius: 4px; }
.down-bg { background: var(--down-bg); color: var(--down); padding: 0 0.25rem; border-radius: 4px; }

/* ===== 顶部导航 ===== */
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: white; font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

/* 顶栏三段容器：搜索 / 导航 / 动作 */
.topbar-group { display: flex; align-items: center; gap: 0.5rem; }
.topbar-divider {
  width: 1px; height: 20px; background: var(--border); margin: 0 0.25rem;
}

/* 导航 pill：身份/位置（区别于动作按钮） */
.nav-pill {
  display: inline-flex; align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-pill:hover {
  background: var(--bg);
  color: var(--text-primary);
}
.nav-pill.active {
  background: var(--accent);
  color: #fff;
}
.nav-pill.active:hover {
  background: var(--accent);
  color: #fff;
}
.nav-pill.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.nav-pill.disabled:hover { background: transparent; color: var(--text-muted); }

/* ===== 搜索 ===== */
.search-wrap { position: relative; }
.search-input { width: 240px; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 320px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  z-index: 30; max-height: 320px; overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.75rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #FAFAF9; }
.search-item-code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); min-width: 70px; }
.search-item-name { font-weight: 500; flex: 1; }
.search-item-industry { font-size: 0.75rem; color: var(--text-muted); }
.search-empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* ===== 容器 ===== */
.container {
  max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem;
}

/* ===== 元信息条 ===== */
.meta-strip {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center;
  font-size: 0.8125rem; color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.meta-strip-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.meta-strip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ===== 指数卡 ===== */
.indices-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .indices-grid { grid-template-columns: 1fr; }
}
.index-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.125rem;
}
.index-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.index-card-collapse {
  background: transparent; border: none; padding: 0.125rem 0.25rem;
  color: var(--text-muted); font-size: 0.75rem;
}
.index-card-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.875rem; font-weight: 500; margin-bottom: 0.375rem;
}
.index-card-change {
  display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.875rem;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}
.index-card-body { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.index-card-vol {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-secondary);
}
.index-card-vol-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sparkline { width: 100%; height: 28px; display: block; }
.sparkline polyline { fill: none; stroke: var(--text-secondary); stroke-width: 1.25; }
.sparkline-fill { fill: var(--text-secondary); fill-opacity: 0.06; stroke: none; }

/* 首页指数卡片迷你 K 线（lightweight-charts） */
.index-kline {
  width: 100%;
  height: 96px;
  display: block;
  margin-top: 0.25rem;
}
.index-kline-empty {
  width: 100%;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

/* ===== 区块 ===== */
.section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.25rem; margin-bottom: 1.5rem;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title { display: flex; align-items: baseline; gap: 0.625rem; }
.section-title-tag { font-size: 0.75rem; color: var(--text-muted); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
table.data thead th {
  text-align: left; font-weight: 500; font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-secondary); padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody td {
  padding: 0.625rem 0.75rem; border-bottom: 1px solid #F5F5F4;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #FAFAF9; cursor: pointer; }
table.data .cell-num { text-align: right; }
table.data .cell-code { color: var(--text-secondary); }
table.data .cell-name { font-family: inherit; font-variant-numeric: normal; font-weight: 500; }
.signal-pill {
  display: inline-block; padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; font-family: inherit;
}
.signal-符合 { background: #FEE2E2; color: #991B1B; }
.signal-接近 { background: #FEF3C7; color: #92400E; }
.signal-未符合 { background: #F5F5F4; color: #57534E; }

/* 排序表头 */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.1s ease;
}
th.sortable:hover {
  background-color: rgba(0, 0, 0, 0.04);
}
th.sortable[data-active="true"] {
  color: #0F766E;
  font-weight: 700;
  background-color: rgba(15, 118, 110, 0.06);
}
/* 次排序（rank > 1）：略浅 */
th.sortable[data-active="true"][data-sort-rank="2"],
th.sortable[data-active="true"][data-sort-rank="3"] {
  background-color: rgba(15, 118, 110, 0.03);
  color: #14B8A6;
  font-weight: 600;
}
th.sortable::after {
  content: "⇅";
  opacity: 0;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: opacity 0.1s ease;
}
th.sortable:hover::after {
  opacity: 0.5;
}
th.sortable[data-active="true"]::after {
  content: "";
  opacity: 0;
}

/* ===== 个股页头部 ===== */
.stock-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.stock-header-back {
  background: transparent; border: 1px solid var(--border); padding: 0.375rem 0.625rem;
  border-radius: var(--radius-md); font-size: 0.8125rem;
}
.stock-header-info { display: flex; align-items: baseline; gap: 0.875rem; flex: 1; }
.stock-header-name { font-size: 1.5rem; font-weight: 500; }
.stock-header-code { color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.875rem; }
.stock-header-price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.125rem; font-weight: 500; }
.stock-header-industry { color: var(--text-muted); font-size: 0.8125rem; }

/* ===== 图表容器 ===== */
.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1rem; margin-bottom: 1.5rem;
}
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.chart-navigation { display: none; }
.chart-canvas { width: 100%; height: 420px; }
.chart-canvas-sm { width: 100%; height: 220px; }
.chart-wrap .chart-canvas { height: 320px; }
.volume-chart-wrap {
  position: relative;
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr);
  height: 120px;
  margin-top: .5rem;
  border-top: 1px solid var(--border);
}
.volume-chart-label {
  padding: .15rem .5rem 0;
  color: var(--text-muted);
  font-size: .68rem;
}
#volume-chart { width: 100%; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }

/* ===== 指标面板 ===== */
.metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 768px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.875rem 1rem;
}
.metric-label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.metric-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.125rem; font-weight: 500; }
.metric-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== 折叠动画 ===== */
.collapsible {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}
.collapsible.open { grid-template-rows: 1fr; }
.collapsible > div { overflow: hidden; }
.collapsible-body { padding-top: 0.75rem; }

/* ===== 板块 tab ===== */
.board-tabs {
  display: flex; gap: 0.375rem; margin: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.board-tab {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 0.5rem 0.875rem; font-size: 0.8125rem;
  color: var(--text-secondary); border-radius: 0;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.board-tab:hover { background: #F5F5F4; color: var(--text-primary); text-decoration: none; }
.board-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
  background: transparent;
  font-weight: 500;
}
.board-tab-badge {
  display: inline-block; min-width: 1.25rem; padding: 0 0.375rem;
  background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.6875rem; text-align: center;
}
.board-tab.active .board-tab-badge {
  background: var(--accent-soft); color: var(--accent); border-color: transparent;
}

/* ===== 量能倍数 tab ===== */
.vol-mult-tabs {
  display: flex; gap: 0.375rem; align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}
.vol-mult-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 0.5rem 0.875rem; font-size: 0.8125rem;
  color: var(--text-secondary); border-radius: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.vol-mult-tab:hover { background: #F5F5F4; color: var(--text-primary); }
.vol-mult-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
  background: transparent;
  font-weight: 500;
}

/* ===== 扫描中状态 ===== */
button.scanning {
  opacity: 0.65; cursor: not-allowed;
  position: relative;
}
button.scanning::after {
  content: '';
  display: inline-block;
  width: 0.75rem; height: 0.75rem; margin-left: 0.5rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ===== 二次确认对话框（轻量样式；浏览器原生 confirm 已基本够用） ===== */
[hidden], [x-cloak] { display: none !important; }

/* ===== K 线空状态 ===== */
.chart-empty {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; margin-top: 0.75rem;
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 0.875rem; text-align: center;
  background: #FCFCFB;
}
.chart-empty code {
  background: var(--bg); border: 1px solid var(--border);
  padding: 0 0.25rem; border-radius: 4px;
  font-size: 0.8125rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--text-primary); color: white;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.875rem; box-shadow: var(--shadow-lg);
  z-index: 50; opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--up); }
.toast.ok { background: var(--accent); }
.toast.loading { background: var(--text-primary); }
.toast.loading::after {
  content: '';
  display: inline-block;
  width: 0.75rem; height: 0.75rem; margin-left: 0.5rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: toast-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes toast-spin { to { transform: rotate(360deg); } }

/* ===== 账号与个人列表 ===== */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-trigger { height:40px;display:flex;align-items:center;gap:.55rem;color:var(--text-secondary);font-size:.82rem;cursor:pointer; }
.account-avatar { width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border:1px solid var(--border-strong);border-radius:50%;background:var(--surface-muted);color:var(--accent);font-family: var(--font-serif); }
.account-menu-panel { position:absolute;top:calc(100% + 10px);right:0;z-index:40;width:220px;padding:.55rem;background:var(--surface);border:1px solid var(--border);border-radius:5px;box-shadow:var(--shadow-lg); }
.account-menu-identity { display:grid;padding:.55rem .65rem .7rem;border-bottom:1px solid var(--border); }
.account-menu-identity span { color:var(--text-muted);font-size:.74rem; }
.account-menu-panel > a,.account-menu-panel form button { width:100%;min-height:38px;display:flex;align-items:center;padding:.45rem .65rem;border:0;background:transparent;border-radius:3px;text-align:left; }
.account-menu-panel > a:hover,.account-menu-panel form button:hover { background:var(--surface-muted);text-decoration:none; }
.mobile-account-row { display:flex;align-items:center;justify-content:space-between;margin-top:.8rem;color:var(--text-secondary); }

.auth-body { min-height:100vh;background:#eeece7; }
.auth-shell { min-height:100vh;display:grid;place-items:center;padding:2rem;background-image:linear-gradient(90deg,rgb(23 23 23 / .035) 1px,transparent 1px),linear-gradient(rgb(23 23 23 / .035) 1px,transparent 1px);background-size:48px 48px; }
.auth-card { width:min(100%,430px);padding:2.6rem;background:var(--surface);border:1px solid var(--border-strong);box-shadow:12px 12px 0 rgb(23 23 23 / .06); }
.auth-mark { width:42px;height:42px;display:grid;place-items:center;margin-bottom:1.5rem;background:var(--text-primary);color:#fff;font:1.4rem var(--font-serif); }
.auth-card h1 { margin:0;font:700 2.15rem/1.1 var(--font-serif); }
.auth-subtitle { margin:.7rem 0 1.5rem;color:var(--text-secondary); }
.auth-form,.settings-form { display:grid;gap:1rem; }
.auth-form label,.settings-form label,.admin-create-form label { display:grid;gap:.35rem;color:var(--text-secondary);font-size:.78rem; }
.auth-form input,.settings-form input { width:100%;min-height:44px; }
.auth-form button { min-height:44px;margin-top:.25rem; }
.auth-footnote { margin:1.35rem 0 0;color:var(--text-muted);font-size:.75rem;text-align:center; }
.auth-footnote a { color:var(--accent);font-weight:600;text-decoration:underline;text-underline-offset:3px; }
.auth-footnote a:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.auth-bootstrap { display:grid;gap:.35rem;padding:1rem;background:var(--surface-muted);border-left:3px solid var(--accent); }
.auth-bootstrap code { overflow-wrap:anywhere;color:var(--accent); }
.form-error,.form-success { margin:1rem 0;padding:.75rem .85rem;border-left:3px solid var(--up);background:var(--up-bg);color:var(--up); }
.form-success { border-left-color:var(--down);background:var(--down-bg);color:var(--down); }
.settings-narrow { max-width:600px;margin:3rem auto; }
.settings-narrow .page-subtitle { margin-bottom:2rem; }
.field-help { margin:-.6rem 0 0;color:var(--text-muted);font-size:.75rem; }

.personal-count { min-width:108px;display:grid;justify-items:end; }
.personal-count strong { font:2.2rem var(--font-serif); }
.personal-count span { color:var(--text-muted);font-size:.75rem; }
.personal-tabs { display:flex;gap:2rem;margin:.5rem 0 1.2rem;border-bottom:1px solid var(--border); }
.personal-tabs a { padding:.75rem 0;color:var(--text-secondary);border-bottom:2px solid transparent; }
.personal-tabs a.active { color:var(--accent);border-bottom-color:var(--accent);text-decoration:none; }
.personal-list { border-top:1px solid var(--text-primary); }
.personal-row { display:grid;grid-template-columns:minmax(210px,1.25fr) 110px minmax(240px,1fr) auto;gap:1.25rem;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border); }
.personal-stock { display:grid;gap:.25rem; }
.personal-stock:hover { text-decoration:none; }
.personal-stock-main { display:flex;align-items:baseline;gap:.7rem; }
.personal-stock-main strong { font-size:1.05rem; }
.personal-stock-main .mono,.personal-industry { color:var(--text-muted);font-size:.75rem; }
.personal-quote { display:grid;justify-items:end;line-height:1.35; }
.personal-quote small { color:var(--text-muted);font-size:.68rem; }
.personal-note { position:relative; }
.personal-note textarea { width:100%;resize:vertical;min-height:54px;padding:.55rem .65rem; }
.personal-note small { position:absolute;right:.45rem;bottom:.15rem;color:var(--text-muted);font-size:.65rem; }
.personal-remove { color:var(--up);background:transparent; }
.personal-empty { padding:5rem 1rem;text-align:center;border-top:1px solid var(--text-primary); }
.personal-empty > span { color:var(--accent);font:3rem var(--font-serif); }
.personal-empty h2 { margin:.5rem 0 .25rem;font-family: var(--font-serif); }
.personal-empty p { color:var(--text-muted); }
.primary-link { display:inline-flex;margin-top:.7rem;padding:.6rem 1rem;background:var(--accent);color:#fff;border-radius:4px; }
.primary-link:hover { background:var(--accent-hover);text-decoration:none; }
.personal-toggle.active { color:var(--accent);border-color:var(--accent);background:var(--accent-soft); }
.table-personal-actions { white-space:nowrap; }
.mini-personal-toggle { padding:.2rem .38rem;font-size:.68rem; }
.mini-personal-toggle.active { color:var(--accent);border-color:var(--accent);background:var(--accent-soft); }
.stock-personal-actions { display:flex;gap:.45rem; }
.ipo-code-cell { white-space:nowrap; }
.ipo-favorite-button { padding:0 .2rem;border:0;background:transparent;color:var(--text-muted);font-size:1.05rem; }
.ipo-favorite-button.active { color:#a86d00; }

.admin-create-card { display:grid;grid-template-columns:.85fr 1.6fr;gap:2rem;padding:1.4rem;border:1px solid var(--border);background:var(--surface); }
.admin-create-card h2 { margin:0 0 .25rem;font:1.25rem var(--font-serif); }
.admin-create-card p { margin:0;color:var(--text-muted); }
.admin-create-form { display:grid;grid-template-columns:1fr 150px auto;gap:.7rem;align-items:end; }
.admin-create-form input,.admin-create-form select { min-height:40px; }
.temporary-password { display:flex;justify-content:space-between;align-items:center;margin:1rem 0;padding:1rem 1.2rem;color:#fff;background:var(--text-primary); }
.temporary-password div { display:grid; }
.temporary-password span,.temporary-password small { color:rgb(255 255 255 / .65);font-size:.72rem; }
.temporary-password strong { margin:.25rem 0;font-size:1.15rem;letter-spacing:.04em; }
.admin-user-list { margin-top:1.5rem;border-top:1px solid var(--text-primary); }
.admin-user-row { display:grid;grid-template-columns:minmax(200px,1fr) 180px 150px auto;gap:1rem;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border); }
.admin-user-identity { display:flex;align-items:center;gap:.8rem; }
.admin-user-identity div { display:grid; }
.admin-user-identity small { color:var(--text-muted); }
.admin-user-state { display:flex;align-items:center;gap:.4rem;color:var(--text-secondary); }
.status-dot { width:7px;height:7px;border-radius:50%;background:var(--text-muted); }
.status-dot.active { background:var(--down); }
.state-chip { padding:.1rem .35rem;background:var(--accent-soft);color:var(--accent);font-size:.68rem; }
.admin-role select { width:100%;min-height:38px; }
.admin-user-actions { display:flex;gap:.45rem;justify-content:flex-end; }

/* ===== 移动端 ===== */
@media (max-width: 640px) {
  .topbar { padding: 0 1rem; }
  .topbar-right { gap: 0.5rem; }
  .topbar-divider { margin: 0; }
  .nav-pill { padding: 0.3rem 0.55rem; font-size: 0.8125rem; }
  .container { padding: 1rem 1rem 3rem; }
  .search-input { width: 160px; }
  .stock-header { flex-wrap: wrap; }
  .stock-header-price { font-size: 1rem; }
  .chart-wrap .chart-canvas { height: 250px; }
  .volume-chart-wrap { height: 100px; }
  .chart-navigation { display: flex; gap: .5rem; margin: 0 0 .65rem; }
  .chart-navigation button { flex: 1; min-height: 40px; padding: .45rem .5rem; font-size: .75rem; }
}

/* ===== 扫描阻塞遮罩（防止长任务被误触取消）===== */
.scan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  /* 阻止 pointer events 透传到下层链接 / 按钮 */
  cursor: not-allowed;
}
.scan-modal {
  cursor: auto;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 2rem 2.25rem 1.75rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18),
              0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #E7E5E4;
}
.scan-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.875rem;
  color: #0F766E; /* 品牌 teal */
}
.scan-spin {
  animation: scan-spin-anim 1.2s linear infinite;
  width: 100%;
  height: 100%;
}
@keyframes scan-spin-anim {
  to { transform: rotate(360deg); }
}
.scan-modal-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1C1917;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.scan-modal-sub {
  font-size: 0.875rem;
  color: #57534E;
  margin: 0 0 1.25rem;
  min-height: 1.25rem;
}
.scan-modal-hint {
  font-size: 0.75rem;
  color: #78716C;
  margin: 1rem 0 1.25rem;
  line-height: 1.5;
}
.scan-progress {
  margin: 0 0 0.5rem;
}
.scan-progress-bar {
  width: 100%;
  height: 6px;
  background: #F5F5F4;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.scan-progress-fill {
  height: 100%;
  background: #0F766E;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.scan-progress-meta {
  font-size: 0.75rem;
  color: #57534E;
}
.scan-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.scan-modal-cancel {
  background: transparent;
  color: #44403C;
  border: 1px solid #D6D3D1;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.scan-modal-cancel:hover {
  background: #FAFAF9;
  border-color: #A8A29E;
}
.scan-modal-cancel:active {
  background: #F5F5F4;
}

@media (max-width: 480px) {
  .scan-modal {
    padding: 1.5rem 1.25rem 1.25rem;
  }
}

/* ===== 量能倍数「应用筛选」按钮 ===== */
.vol-mult-apply {
  margin-left: auto;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s;
}
.vol-mult-apply:hover { background: #0D655D; }
.vol-mult-apply:active { background: #0A5048; }

/* ===== 数据新鲜度徽章 ===== */
.freshness-pill {
  display: inline-block;
  font-size: 0.6875rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.3rem;
  font-weight: 500;
  border: 1px solid transparent;
  vertical-align: middle;
}
.freshness-fresh {
  color: #047857;
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.freshness-ok {
  color: #92400E;
  background: #FEF3C7;
  border-color: #FCD34D;
}
.freshness-stale {
  color: #9A3412;
  background: #FFEDD5;
  border-color: #FDBA74;
}
.freshness-outdated {
  color: #991B1B;
  background: #FEE2E2;
  border-color: #FCA5A5;
}
.freshness-empty {
  color: #6B7280;
  background: #F3F4F6;
  border-color: #D1D5DB;
}

/* ===== 工具栏按钮（更新数据 / 全市场回填 / 重跑扫描）===== */
.btn-tool {
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-tool:hover {
  background: #F5F5F4;
  border-color: #D6D3D1;
}
.btn-tool:disabled,
.btn-tool.scanning {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-tool-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-tool-primary:hover {
  background: #0D9488;
  border-color: #0D9488;
  color: white;
}
.btn-tool-primary:disabled,
.btn-tool-primary.scanning {
  background: var(--accent);
  opacity: 0.6;
}

/* ===== 量能倍数筛选提示 ===== */
/* ===== 多列排序状态 ===== */
.sort-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}
.sort-status-label {
  color: var(--text-muted);
  font-weight: 600;
}
.sort-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.625rem;
  background: rgba(15, 118, 110, 0.08);
  color: #0F766E;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}
.sort-status-chip-primary {
  background: #0F766E;
  color: #FFFFFF;
  border-color: #0F766E;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
}
/* 主排序 chip 内所有子元素都强制白字（防止子 span 的 color 覆盖父元素） */
.sort-status-chip-primary,
.sort-status-chip-primary * {
  color: #FFFFFF !important;
}
.sort-status-dir {
  font-weight: 700;
  /* 不设 color，继承父元素 */
}
.sort-status-dir {
  font-weight: 700;
  color: #0F766E;
}
.sort-status-priority {
  display: inline-grid;
  width: 1.05rem;
  height: 1.05rem;
  place-items: center;
  margin-left: -.3rem;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .58rem;
  line-height: 1;
}
.sort-clear {
  padding: 0.125rem 0.625rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.1s ease;
}
.sort-clear:hover:not(:disabled) {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #991B1B;
}
.sort-clear:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  color: var(--text-muted) !important;
  background: #F5F5F4 !important;
  border-color: #E7E5E4 !important;
  text-decoration: line-through;
  font-style: italic;
}
.sort-clear:disabled:hover {
  /* 覆盖 hover 样式，避免默认时 hover 变红 */
  background: #F5F5F4 !important;
  color: var(--text-muted) !important;
  border-color: #E7E5E4 !important;
}
.sort-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.vol-mult-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}


/* ===== K 线 MA 图例（覆盖在 chart 左上角的浮层） ===== */
.kline-ma-legend {
  position: absolute;
  top: 0.5rem;
  left: 0.625rem;
  z-index: 2;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: center;
  padding: 0.35rem 0.6rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  max-width: calc(100% - 1.25rem);
}
.kline-ma-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  color: var(--text-secondary);
}
.kline-ma-legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.kline-ma-legend-label {
  font-weight: 500;
}
.kline-ma-legend-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
@media (max-width: 640px) {
  .kline-ma-legend { font-size: 0.6875rem; gap: 0.4rem 0.55rem; padding: 0.25rem 0.45rem; }
}

/* ============ IPO 专区 ============
 * 旧 .nav-ipo-link 已被通用 .nav-pill 替代（顶栏导航统一）。
 * 内容区样式保留。 */
.ipo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1.2rem;
}
.ipo-stat {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.ipo-stat-num {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0F766E;
  font-variant-numeric: tabular-nums;
}
.ipo-stat-num-sm {
  font-size: 1rem;
  font-weight: 500;
}
.ipo-stat-wide {
  grid-column: span 2;
}
.ipo-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted, #78716C);
  margin-top: 0.2rem;
}

/* ===== IPO 策略定义 / 公式面板 ===== */
.ipo-info-card {
  background: #FAFAF9;
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 10px;
  padding: 0;
  margin: 0 0 1rem;
  overflow: hidden;
}
.ipo-info-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.1s ease;
}
.ipo-info-summary::-webkit-details-marker { display: none; }
.ipo-info-summary::before {
  content: '▸'; display: inline-block;
  margin-right: 0.5rem; color: var(--text-muted);
  transition: transform 0.15s ease;
}
.ipo-info-card[open] > .ipo-info-summary::before { transform: rotate(90deg); }
.ipo-info-summary:hover { background: #F5F5F4; }
.ipo-info-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.ipo-info-hint { font-size: 0.75rem; color: var(--text-muted); }
.ipo-info-body { padding: 0 1rem 1rem; }
.ipo-info-intro {
  font-size: 0.85rem; color: var(--text-secondary);
  margin: 0.4rem 0 0.8rem; line-height: 1.5;
}

/* A/B/C 策略卡片网格 */
.ipo-strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.7rem;
}
.ipo-strategy-card {
  background: #fff;
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  border-left-width: 4px;
}
.ipo-strategy-a { border-left-color: #F59E0B; }   /* Cat A 中签 - 琥珀 */
.ipo-strategy-b { border-left-color: #3B82F6; }   /* Cat B 集合竞价 - 蓝 */
.ipo-strategy-c { border-left-color: #10B981; }   /* Cat C 低吸 - 绿 */
.ipo-strategy-user { border-left-color: #EC4899; }/* 用户优先 - 粉 */
.ipo-strategy-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.ipo-strategy-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  font-size: 0.85rem; font-weight: 700; color: #fff;
}
.tag-a { background: #F59E0B; }
.tag-b { background: #3B82F6; }
.tag-c { background: #10B981; }
.tag-u { background: #EC4899; }
.ipo-strategy-title {
  font-size: 0.9rem; font-weight: 600; color: var(--text-primary);
}
.ipo-strategy-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.6rem;
  margin: 0;
  font-size: 0.82rem;
}
.ipo-strategy-dl dt {
  color: var(--text-muted); font-weight: 500;
}
.ipo-strategy-dl dd {
  margin: 0; color: var(--text-secondary);
  line-height: 1.45;
}

/* E5 公式展示 */
.ipo-formula {
  background: #1C1917; color: #F5F5F4;
  padding: 0.7rem 1rem; border-radius: 8px;
  font-size: 0.95rem;
  margin: 0.4rem 0 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.ipo-formula-list {
  list-style: none; padding: 0; margin: 0 0 0.8rem;
  display: grid; gap: 0.25rem;
  font-size: 0.82rem; color: var(--text-secondary);
}
.ipo-formula-list li {
  padding-left: 0.5rem; line-height: 1.5;
}
.ipo-formula-meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.5rem;
}
.ipo-meta-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #ECFEFF; color: #0E7490;
  border-radius: 999px;
  font-size: 0.72rem; font-weight: 500;
}

.ipo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  align-items: center;
}
.ipo-tab {
  background: transparent;
  border: 1px solid var(--border-subtle, #E7E5E4);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary, #57534E);
  transition: all 0.15s;
}
.ipo-tab:hover { background: #F5F5F4; }
.ipo-tab.active {
  background: #0F766E;
  color: #fff;
  border-color: #0F766E;
}
.ipo-tab-count {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.ipo-search {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 6px;
  font-size: 0.85rem;
  width: 220px;
  outline: none;
}
.ipo-search:focus { border-color: #0F766E; }

.ipo-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 8px;
  background: var(--bg-card, #fff);
}
.ipo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}
.ipo-table th, .ipo-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle, #E7E5E4);
  white-space: nowrap;
}
.ipo-table th {
  background: #FAFAF9;
  font-weight: 600;
  color: var(--text-secondary, #57534E);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky; top: 0; z-index: 1;
}
.ipo-table th.sortable { cursor: pointer; user-select: none; transition: background-color 0.1s ease; }
.ipo-table th.sortable:hover { background: #F5F5F4; color: var(--text-primary); }
.ipo-table th.sortable[data-active="true"] { color: var(--accent, #0F766E); }
.ipo-table td.num, .ipo-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ipo-table tbody tr:hover { background: #FAFAF9; }

.ipo-table a { color: #0F766E; text-decoration: none; }
.ipo-table a:hover { text-decoration: underline; }

.ipo-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: #F5F5F4;
  color: #44403C;
}
.ipo-badge.badge-a   { background: #FEF3C7; color: #92400E; }
.ipo-badge.badge-b   { background: #DBEAFE; color: #1E40AF; }
.ipo-badge.badge-c   { background: #D1FAE5; color: #065F46; }
.ipo-badge.badge-u   { background: #FCE7F3; color: #9D174D; }

.up        { color: #DC2626; }
.down      { color: #16A34A; }
.up-strong { color: #B91C1C; font-weight: 600; }
.down-strong { color: #15803D; font-weight: 600; }

.ipo-e5 {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
.e5-strong { background: #D1FAE5; color: #065F46; }
.e5-mid    { background: #FEF3C7; color: #92400E; }
.e5-weak   { background: #FEE2E2; color: #991B1B; }

.ipo-empty {
  text-align: center;
  color: var(--text-muted, #78716C);
  padding: 2rem !important;
}

/* ============ IPO 详情页 ============ */
.ipo-detail { max-width: 1100px; margin: 0 auto; }
.ipo-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.ipo-back {
  color: var(--text-muted, #78716C);
  text-decoration: none;
  font-size: 0.875rem;
  margin-right: 0.5rem;
}
.ipo-back:hover { color: #0F766E; }
.ipo-detail-tags {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-left: auto;
}
.ipo-tag {
  background: #F5F5F4;
  color: #44403C;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.ipo-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle, #E7E5E4);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.ipo-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0F766E;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-subtle, #E7E5E4);
  padding-bottom: 0.5rem;
}
.ipo-card-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #57534E);
  margin: 0.8rem 0 0.5rem;
}
.ipo-card-subtitle:first-of-type { margin-top: 0; }

.ipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem 1rem;
}
.ipo-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #F5F5F4;
  font-size: 0.85rem;
}
.ipo-kv span {
  color: var(--text-muted, #78716C);
  font-size: 0.78rem;
}
.ipo-kv b {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.ipo-kv.highlight {
  background: #FAFAF9;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border-bottom: none;
}
.ipo-kv.highlight span { font-weight: 500; color: #0F766E; }

@media (max-width: 640px) {
  .ipo-table { font-size: 0.75rem; }
  .ipo-table th, .ipo-table td { padding: 0.35rem 0.4rem; }
  .ipo-search { width: 100%; }
}

/* ========================================================================== */
/* 2026 editorial redesign: shared desktop and mobile system                  */
/* ========================================================================== */

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
}

.up { color: var(--up); }
.down { color: var(--down); }
.up-strong { color: var(--up); font-weight: 600; }
.down-strong { color: var(--down); font-weight: 600; }

/* ===== 复盘手记：日期索引与纸页阅读 ===== */
.journal-page { max-width: 1280px; margin: 0 auto; }
.journal-intro { padding-bottom: 1.75rem; }
.journal-private-mark {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .45rem .75rem; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: .78rem; letter-spacing: .02em;
  white-space: nowrap;
}
.journal-private-mark span { color: var(--accent); font-size: .6rem; }
.journal-workspace {
  display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  align-items: start; gap: 1.4rem;
}
.journal-calendar-panel {
  padding: 1.45rem 1.45rem 1.2rem;
  border: 1px solid var(--border); background: var(--surface);
}
.journal-panel-head { display: flex; align-items: flex-start; justify-content: space-between; }
.journal-eyebrow {
  color: var(--accent); font-size: .66rem; font-weight: 600;
  letter-spacing: .13em;
}
.journal-panel-head h2 {
  margin: .2rem 0 0; font-family: var(--font-serif);
  font-size: 1.65rem; line-height: 1.2; font-weight: 600;
}
.journal-panel-monogram {
  display: inline-flex; justify-content: center; align-items: center;
  width: 32px; height: 32px; border: 1px solid var(--accent);
  color: var(--accent); font-family: var(--font-serif);
  font-size: 1.12rem; line-height: 1;
}
.journal-month-bar {
  display: grid; grid-template-columns: 38px 1fr 38px; align-items: center;
  margin-top: 1.8rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border);
}
.journal-month-bar h3 {
  margin: 0; text-align: center; font-size: 1rem; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .03em;
}
.journal-month-arrow {
  width: 38px; height: 38px; padding: 0; border-color: transparent;
  background: transparent; color: var(--text-primary);
  font-family: var(--font-serif); font-size: 1.7rem; line-height: 1;
}
.journal-month-arrow:hover { background: var(--surface-muted); }
.journal-weekdays, .journal-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.journal-weekdays { margin: .75rem 0 .35rem; color: var(--text-muted); text-align: center; font-size: .72rem; }
.journal-calendar-grid { gap: .12rem; }
.journal-day-spacer { display: block; }
.journal-day {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; min-width: 0; aspect-ratio: 1; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent;
  color: var(--text-primary); font-size: .93rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.journal-day:hover { background: var(--accent-soft); }
.journal-day.is-today { border-color: var(--accent); }
.journal-day.is-selected, .journal-day.is-selected:hover {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.journal-day-dot {
  position: absolute; bottom: 4px; left: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}
.journal-day.is-selected .journal-day-dot { background: #fff; }
.journal-day:focus-visible, .journal-month-arrow:focus-visible,
.journal-today-link:focus-visible, .journal-action-button:focus-visible,
.journal-text-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.journal-calendar-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid var(--border); font-size: .75rem;
  color: var(--text-secondary);
}
.journal-calendar-footer > span { display: inline-flex; align-items: center; gap: .45rem; }
.journal-legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.journal-today-link {
  padding: .2rem 0; border: 0; background: transparent;
  color: var(--accent); font-size: .75rem; font-weight: 600;
}
.journal-today-link:hover { background: transparent; text-decoration: underline; }
.journal-calendar-tip { margin: .85rem 0 0; color: var(--text-muted); font-size: .75rem; }

.journal-paper {
  position: relative; min-height: 650px;
  padding: clamp(1.7rem, 4.5vw, 3.8rem);
  border: 1px solid var(--border); background: #fffdfa;
  box-shadow: 8px 8px 0 rgb(95 91 85 / .045);
}
.journal-paper::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--accent);
}
.journal-page [hidden] { display: none !important; }
.journal-paper-topline {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--text-muted); font-size: .65rem; font-weight: 600;
  letter-spacing: .13em;
}
.journal-topline-separator { padding: 0 .4rem; color: var(--border-strong); }
.journal-paper-topline > span:last-child { color: var(--accent); white-space: nowrap; }
.journal-paper-date { position: relative; margin: 3.25rem 0 2.2rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--border); }
.journal-paper-date p { margin: 0 0 .3rem; color: var(--accent); font-size: .78rem; letter-spacing: .1em; }
.journal-paper-date h2 {
  margin: 0; font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5vw, 4.4rem); line-height: 1.16;
  font-weight: 600; letter-spacing: -.075em;
}
.journal-paper-date > span { display: block; margin-top: .45rem; color: var(--text-secondary); font-size: .87rem; }
.journal-read-title {
  margin: 0 0 1.3rem; font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.3vw, 2rem); font-weight: 600; line-height: 1.35;
  overflow-wrap: anywhere;
}
.journal-read-body {
  max-width: 68ch; min-height: 14rem; color: #30302d;
  font-size: 1.04rem; line-height: 2.05; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.journal-read-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 2rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border); color: var(--text-muted); font-size: .76rem;
}
.journal-read-actions, .journal-editor-actions { display: flex; align-items: center; gap: .7rem; }
.journal-action-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  min-height: 42px; padding: .6rem 1rem; border-color: var(--accent);
  background: var(--accent); color: #fff; font-size: .84rem; font-weight: 600;
}
.journal-action-button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.journal-text-button {
  min-height: 42px; padding: .5rem .75rem; border-color: transparent;
  background: transparent; color: var(--text-secondary); font-size: .82rem;
}
.journal-text-button:hover { background: var(--surface-muted); }
.journal-empty-view { padding: 1rem 0 2rem; }
.journal-empty-symbol {
  display: block; height: 5.5rem; color: #d8c4c7;
  font-family: var(--font-serif); font-size: 7rem; line-height: 1;
}
.journal-empty-view p {
  margin: 0; font-family: var(--font-serif);
  font-size: 1.7rem; font-weight: 600;
}
.journal-empty-view > span:not(.journal-empty-symbol) {
  display: block; margin: .65rem 0 2rem;
  color: var(--text-secondary); font-size: .92rem;
}
.journal-editor { display: grid; gap: .7rem; }
.journal-editor label { font-size: .8rem; font-weight: 600; color: var(--text-primary); }
.journal-editor label span { margin-left: .35rem; font-weight: 400; color: var(--text-muted); }
.journal-editor input, .journal-editor textarea {
  width: 100%; background: #fff; border-radius: 2px;
}
.journal-editor input { min-height: 44px; margin-bottom: .8rem; font-size: .98rem; }
.journal-editor textarea { min-height: 310px; padding: .9rem; resize: vertical; line-height: 1.9; font-size: .96rem; }
.journal-editor-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: .5rem;
}
.journal-editor-bottom > span { color: var(--text-muted); font-size: .76rem; }
.journal-message { min-height: 1.4em; margin: 1rem 0 0; color: var(--text-secondary); font-size: .8rem; }
.journal-message.is-error { color: var(--up); }

@media (max-width: 1160px) and (min-width: 761px) {
  .topbar-search { display: none; }
  .topbar-shell { gap: 1.4rem; }
}
@media (max-width: 900px) {
  .journal-workspace { grid-template-columns: 1fr; }
  .journal-calendar-panel { max-width: none; }
  .journal-paper { min-height: 520px; }
}
@media (max-width: 640px) {
  .journal-intro { padding-bottom: 1rem; }
  .journal-private-mark { margin-top: 1rem; }
  .journal-workspace { gap: 1rem; }
  .journal-calendar-panel { padding: 1.15rem 1rem; }
  .journal-month-bar { margin-top: 1.15rem; }
  .journal-day { min-height: 42px; }
  .journal-paper { min-height: 470px; padding: 1.6rem 1.2rem 2rem; box-shadow: 5px 5px 0 rgb(95 91 85 / .045); }
  .journal-paper-date { margin: 2.35rem 0 1.65rem; }
  .journal-paper-date h2 { font-size: 3.2rem; }
  .journal-read-footer { align-items: flex-start; flex-direction: column; }
  .journal-read-actions { width: 100%; justify-content: space-between; }
  .journal-editor-bottom { align-items: flex-start; flex-direction: column; }
  .journal-editor-actions { width: 100%; justify-content: flex-end; }
}

/* ===== 市场情绪·连板梯队 ===== */
.sentiment-section {
  padding-top: 1.45rem;
}
.sentiment-head {
  margin-bottom: .85rem;
}
.sentiment-asof {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  color: var(--text-muted);
  font-size: .72rem;
}
.sentiment-asof strong {
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 500;
}
.sentiment-tape {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.sentiment-metric {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.1rem;
  border-left: 1px solid var(--border);
}
.sentiment-metric:first-child { border-left: 0; }
.sentiment-metric > span {
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .04em;
}
.sentiment-metric strong {
  color: var(--text-primary);
  font-family: var(--font-data-display);
  font-size: 1.55rem;
  font-weight: 550;
  line-height: 1;
}
.sentiment-metric strong small {
  margin-left: .12rem;
  font-size: .72rem;
  font-weight: 500;
}
.sentiment-metric-lead {
  color: #fff;
  background: var(--accent);
}
.sentiment-metric-lead > span,
.sentiment-metric-lead strong { color: #fff; }

.limit-ladder {
  position: relative;
  border-top: 1px solid var(--border);
}
.ladder-level {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}
.ladder-level::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 31px;
  width: 1px;
  background: var(--border-strong);
}
.ladder-level:first-child::before { top: 34px; }
.ladder-level:last-child::before { bottom: calc(100% - 34px); }
.ladder-rung {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: 1rem .5rem 1rem 0;
}
.ladder-level-number {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 62px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: var(--font-data-display);
  font-size: 1.45rem;
  line-height: 1;
}
.ladder-rung h3 {
  margin: .6rem 0 -.05rem;
  font-size: .84rem;
  font-weight: 650;
  white-space: nowrap;
}
.ladder-rung div > span {
  color: var(--text-muted);
  font-size: .68rem;
}
.ladder-level-highest .ladder-level-number {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.ladder-level-body {
  min-width: 0;
  padding: .85rem 0 1rem .7rem;
}
.ladder-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: .55rem;
}
.ladder-stock-card {
  min-width: 0;
  display: block;
  padding: .8rem .9rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.ladder-stock-card:hover {
  text-decoration: none;
  background: #fff;
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.ladder-stock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .62rem;
  border-bottom: 1px solid var(--border);
}
.ladder-stock-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.ladder-stock-head strong {
  overflow: hidden;
  font-size: .92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ladder-stock-head .mono {
  color: var(--text-muted);
  font-size: .64rem;
  white-space: nowrap;
}
.ladder-industry {
  max-width: 7.5em;
  overflow: hidden;
  color: var(--accent);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ladder-stock-times {
  display: flex;
  align-items: center;
  gap: .55rem 1rem;
  padding-top: .58rem;
}
.ladder-stock-times > span {
  display: grid;
  grid-template-columns: auto;
  gap: .02rem;
}
.ladder-stock-times small {
  color: var(--text-muted);
  font-size: .62rem;
}
.ladder-stock-times b {
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 550;
  white-space: nowrap;
}
.ladder-stock-times .ladder-break b { color: var(--up); }
.ladder-stock-times .ladder-sealed b { color: var(--down); }
.ladder-expand {
  width: 100%;
  min-height: 42px;
  margin-top: .65rem;
  color: var(--accent);
  background: transparent;
  border-style: dashed;
}
.ladder-expand:hover { background: var(--accent-soft); border-color: var(--accent); }
.sentiment-empty {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  background: rgb(254 254 252 / .45);
  text-align: center;
}
.sentiment-empty strong { color: var(--text-secondary); font-size: .9rem; }
.sentiment-empty span { font-size: .75rem; }

@media (max-width: 760px) {
  .sentiment-asof {
    justify-content: space-between;
    margin-top: .65rem;
  }
  .sentiment-tape {
    grid-template-columns: 1fr 1fr;
  }
  .sentiment-metric {
    min-height: 68px;
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--border);
  }
  .sentiment-metric:nth-child(odd) { border-left: 0; }
  .sentiment-metric:nth-last-child(-n+2) { border-bottom: 0; }
  .sentiment-metric strong { font-size: 1.35rem; }
  .ladder-level {
    display: block;
  }
  .ladder-level::before { display: none; }
  .ladder-rung {
    align-items: center;
    gap: .7rem;
    padding: .9rem 0 .25rem;
  }
  .ladder-level-number {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 1.1rem;
  }
  .ladder-rung h3 { margin: 0; }
  .ladder-level-body { padding: .55rem 0 1rem; }
  .ladder-stock-grid { grid-template-columns: 1fr; }
  .ladder-stock-card { padding: .82rem .85rem; }
  .ladder-stock-times { justify-content: space-between; }
}

button,
a,
summary,
input { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.55rem 0.75rem;
  color: #fff;
  background: var(--text-primary);
  border-radius: var(--radius-md);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.mobile-only { display: none; }

/* Header */
.topbar {
  height: 64px;
  padding: 0;
  background: rgb(254 254 252 / .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-shell {
  width: 100%;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.topbar-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
}
.h-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.topbar-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 1.75rem;
}
.nav-pill {
  position: relative;
  padding: 0;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-pill::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
.nav-pill:hover,
.nav-pill.active,
.nav-pill.active:hover {
  color: var(--text-primary);
  background: transparent;
  text-decoration: none;
}
.nav-pill.active { color: var(--accent); }
.nav-pill.active::after { transform: scaleX(1); }
.topbar-utilities {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.search-input {
  width: min(300px, 24vw);
  height: 40px;
  padding: 0.55rem 0.85rem;
  border-color: var(--border);
  background: transparent;
  border-radius: 4px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-dropdown {
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.search-item:hover { background: var(--surface-muted); }

.data-menu { position: relative; }
.data-menu > summary { list-style: none; }
.data-menu > summary::-webkit-details-marker { display: none; }
.data-menu-trigger {
  min-width: 98px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: #fff;
  background: var(--text-primary);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.data-menu-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: .65rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.data-menu[open] .data-menu-trigger::after { transform: rotate(225deg) translate(-1px, -1px); }
.data-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: 260px;
  padding: .7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow-lg);
}
.data-menu-title {
  margin: .1rem .35rem .45rem;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .08em;
}
.data-menu-action {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .7rem .75rem;
  border: 0;
  text-align: left;
  background: transparent;
}
.data-menu-action small { color: var(--text-muted); }

/* Main page framing */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 40px 5rem;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding: .75rem 0 1.25rem;
}
.page-kicker {
  margin: 0 0 .3rem;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 3.2vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.055em;
  transform: translateX(-.055em);
}
.page-subtitle {
  margin: .45rem 0 0;
  color: var(--text-secondary);
  font-size: .92rem;
}
.page-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  padding-bottom: .2rem;
}
.page-date span {
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .06em;
}
.page-date strong {
  color: var(--text-primary);
  font-size: .9rem;
  font-weight: 500;
}
.meta-strip {
  gap: .75rem 1.2rem;
  margin: 0 0 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .75rem;
}
.meta-strip-dot { background: var(--accent); }
.freshness-pill {
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-color: var(--border);
}
.freshness-fresh { color: var(--down); background: var(--down-bg); border-color: transparent; }
.freshness-outdated { color: var(--up); background: var(--up-bg); border-color: transparent; }

/* Market overview */
.indices-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  align-items: start;
  margin: 0 0 1.25rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.index-card {
  min-width: 0;
  padding: 1.25rem 1.5rem 1rem;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.index-card:last-child { border-right: 0; }
.index-card-head {
  min-height: 32px;
  margin-bottom: .3rem;
  align-items: center;
}
.index-card-head .h-label {
  color: var(--text-primary);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.index-card-collapse {
  min-height: 32px;
  color: var(--text-muted);
}
.index-card-collapse:hover { color: var(--accent); background: transparent; }
.index-card-value {
  margin: 0;
  font-family: var(--font-data-display);
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
  font-kerning: none;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.index-card-change {
  gap: .8rem;
  margin: .15rem 0 .65rem;
  font-family: var(--font-data-display);
  font-size: .83rem;
  font-kerning: none;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
@media (min-width: 761px) {
  .index-card.is-collapsed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head head"
      "value change";
    align-items: end;
    gap: .1rem 1rem;
    padding-top: .8rem;
    padding-bottom: .85rem;
  }
  .index-card.is-collapsed .index-card-head {
    grid-area: head;
    min-height: 28px;
    margin: 0 0 .15rem;
  }
  .index-card.is-collapsed .index-card-value {
    grid-area: value;
    font-size: clamp(1.8rem, 2.3vw, 2.35rem);
  }
  .index-card.is-collapsed .index-card-change {
    grid-area: change;
    justify-self: end;
    margin: 0 0 .18rem;
    white-space: nowrap;
  }
  .index-card.is-collapsed .index-card-body { display: none; }
}
.collapsible-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem .75rem;
  padding-top: 0;
}
.index-kline {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 150px;
  margin: 0 0 .4rem;
}
.index-card-vol {
  display: grid;
  gap: .05rem;
  align-items: start;
  justify-content: start;
  font-size: .7rem;
}
.index-card-vol-value {
  color: var(--text-primary);
  font-family: var(--font-data-display);
  font-kerning: none;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.indices-scroll-hint { display: none; }

/* Strategy section and expandable strategy switcher */
.section {
  margin: 0 0 1.5rem;
  padding: 1.25rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.section-head {
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.section-title { align-items: baseline; }
.h-section {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.045em;
}
.section-title-tag { color: var(--text-muted); }
.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}
.section-summary {
  margin-right: .35rem;
  color: var(--text-muted);
  font-size: .76rem;
}
.near { color: var(--accent); }
.btn-tool {
  min-height: 38px;
  padding: .45rem .75rem;
  border-radius: 4px;
  background: transparent;
}
.btn-tool:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-tool-primary,
.btn-tool-primary:disabled,
.btn-tool-primary.scanning {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn-tool-primary:hover {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.strategy-tabs {
  display: flex;
  gap: 0;
  min-height: 52px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.strategy-tabs::-webkit-scrollbar { display: none; }
.strategy-tab {
  position: relative;
  min-width: 190px;
  display: grid;
  gap: .1rem;
  align-content: center;
  padding: .55rem 1rem .5rem 0;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 0;
}
.strategy-tab::after {
  content: "";
  position: absolute;
  right: 1rem;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
}
.strategy-tab.active::after { background: var(--accent); }
.strategy-tab span { color: var(--text-secondary); font-weight: 600; }
.strategy-tab.active span { color: var(--accent); }
.strategy-tab:hover { text-decoration: none; background: var(--surface-muted); }
.strategy-tab small { color: var(--text-muted); font-size: .67rem; }
.strategy-mode-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: .85rem;
  border-bottom: 1px solid var(--border);
}
.strategy-mode-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .08em;
}
.strategy-mode-tabs {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.strategy-mode-tab {
  min-height: 30px;
  padding: .3rem .7rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary);
  font-size: .76rem;
}
.strategy-mode-tab:hover { background: var(--surface); }
.strategy-mode-tab.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600;
}
.strategy-mode-tab-new {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
}
.strategy-mode-tab-new small {
  padding: .08rem .28rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
}
.strategy-mode-tab-new.active small {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.strategy-mode-help {
  min-width: 0;
  color: var(--text-muted);
  font-size: .72rem;
}
.board-tabs {
  gap: 1.65rem;
  margin: 0;
  padding: .3rem 0 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.board-tabs::-webkit-scrollbar { display: none; }
.board-tab {
  min-height: 44px;
  flex: 0 0 auto;
  padding: .7rem 0 .55rem;
}
.board-tab:hover,
.board-tab.active { background: transparent; }
.board-tab-badge {
  min-width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
}
.board-tab.active .board-tab-badge { background: transparent; color: var(--accent); }
.vol-mult-tabs {
  gap: .35rem;
  min-height: 52px;
  margin: 0;
  padding: .45rem 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.vol-mult-tabs::-webkit-scrollbar { display: none; }
.vol-mult-tab {
  min-height: 38px;
  flex: 0 0 auto;
  padding: .45rem .75rem;
  border: 1px solid transparent;
  border-radius: 4px;
}
.vol-mult-tab:hover { background: var(--surface-muted); }
.vol-mult-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.sort-status {
  min-height: 46px;
  margin: 0;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.sort-status-chip,
.sort-status-chip-primary,
.sort-status-chip-primary * {
  padding: 0;
  color: var(--text-primary) !important;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: .76rem;
}
.sort-status-chip-primary,
.sort-status-chip-primary * { color: var(--accent) !important; }
.sort-status-dir { color: inherit; }
.sort-clear {
  padding: .2rem .45rem;
  border: 0;
  color: var(--accent);
  background: transparent;
  text-decoration: none;
}
.sort-clear:disabled {
  color: var(--text-muted) !important;
  background: transparent !important;
  border: 0 !important;
  text-decoration: none;
  font-style: normal;
}
.sort-hint { margin-left: auto; }
.sort-manager-trigger {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 36px;
  padding: .35rem .6rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .75rem;
  white-space: nowrap;
}
.sort-manager-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(22 24 27 / .38);
}
.sort-manager {
  width: min(100%, 520px);
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgb(0 0 0 / .2);
}
.sort-manager-head,
.sort-manager-footer,
.sort-manager-row,
.sort-manager-row-actions {
  display: flex;
  align-items: center;
}
.sort-manager-head { justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.sort-manager-head h3 { margin: 0; font-size: 1.2rem; }
.sort-manager-head p { margin: .25rem 0 0; color: var(--text-muted); font-size: .8rem; }
.sort-manager-close {
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1.5rem;
}
.sort-manager-fields { margin: 0; padding: .75rem; border: 1px solid var(--border); }
.sort-manager-fields legend,
.sort-manager-order h4 { padding: 0 .25rem; color: var(--text-muted); font-size: .75rem; font-weight: 600; }
.sort-manager-field-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem .5rem; }
.sort-manager-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem;
  color: var(--text-primary);
  font-size: .82rem;
}
.sort-manager-field input { width: 18px; height: 18px; accent-color: var(--accent); }
.sort-manager-order { margin-top: 1rem; }
.sort-manager-order h4 { margin: 0 0 .4rem; }
.sort-manager-row { min-height: 48px; gap: .6rem; border-top: 1px solid var(--border); }
.sort-manager-rank { width: 1.5rem; color: var(--accent); }
.sort-manager-row strong { flex: 1; font-size: .83rem; font-weight: 500; }
.sort-manager-row-actions { gap: .25rem; }
.sort-manager-row-actions button,
.sort-manager-row-actions select {
  min-width: 38px;
  min-height: 38px;
  padding: .25rem .4rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.sort-manager-row-actions button:disabled { opacity: .35; }
.sort-manager-row-actions select { min-width: 70px; }
.sort-manager-footer { justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.sort-manager-footer button { min-height: 44px; padding: .5rem .9rem; border-radius: 4px; }
.sort-manager-cancel { color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); }
.sort-manager-save { color: #fff; background: var(--accent); border: 1px solid var(--accent); }

/* Data tables */
.table-wrap,
.ipo-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.picks-table-region {
  position: relative;
  min-height: 96px;
  transition: opacity 160ms ease;
}
.picks-table-region.is-loading {
  opacity: .56;
  pointer-events: none;
}
.picks-table-region.is-loading::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 42% 100%;
  background-repeat: no-repeat;
  animation: picks-loading 900ms ease-in-out infinite;
}
@keyframes picks-loading {
  from { background-position: -72% 0; }
  to { background-position: 172% 0; }
}
.board-tabs.is-loading .board-tab.active { color: var(--accent); }
table.data tbody tr[hidden] { display: none; }
table.data tbody td.table-empty {
  height: 112px;
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
}
table.data { min-width: 940px; }
/* 选股表的列宽不能交给内容驱动的 table-auto 算法，否则切换板块时，
   不同名称/数值长度会让整张表横向跳动。所有板块共用同一列网格。 */
table.picks-data-table .cell-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 策略选股分页：沿用数据台账的细线与单色强调，避免做成通用组件库风格。 */
.picks-pagination {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  padding: .8rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.picks-page-summary {
  color: var(--text-muted);
  font-size: .75rem;
}
.picks-page-summary strong { color: var(--text-primary); }
.picks-page-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
}
.picks-page-controls button,
.picks-page-jump button {
  min-height: 32px;
  padding: .35rem .65rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .72rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.picks-page-controls button:hover:not(:disabled),
.picks-page-jump button:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}
.picks-page-controls button:disabled,
.picks-page-jump button:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.picks-page-number {
  width: 32px;
  padding-right: 0 !important;
  padding-left: 0 !important;
  font-family: var(--font-mono);
}
.picks-page-number.active {
  color: #fff !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.picks-page-number.ellipsis {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}
.picks-page-jump {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .38rem;
  color: var(--text-muted);
  font-size: .72rem;
}
.picks-page-jump input {
  width: 52px;
  height: 32px;
  padding: 0 .35rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: center;
}
.picks-page-jump input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
}
table.data thead th,
.ipo-table th {
  padding: .65rem .7rem;
  color: var(--text-secondary);
  background: var(--surface);
  border-bottom-color: var(--border);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .035em;
  text-transform: none;
}
table.data tbody td,
.ipo-table td {
  height: 46px;
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--border);
}
table.data tbody tr:hover,
.ipo-table tbody tr:hover { background: var(--surface-muted); }
table.data tbody tr:hover td,
.ipo-table tbody tr:hover td { background: transparent; }
th.sortable[data-active="true"],
.ipo-table th.sortable[data-active="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}
th.sortable[data-active="true"][data-sort-rank="2"],
th.sortable[data-active="true"][data-sort-rank="3"] {
  color: var(--accent);
  background: rgb(243 232 234 / .55);
}
.signal-pill {
  border-radius: 3px;
  font-size: .68rem;
}
.signal-符合 { color: var(--up); background: var(--up-bg); }
.signal-接近 { color: var(--accent); background: var(--accent-soft); }
.signal-未符合 { color: var(--text-secondary); background: var(--surface-muted); }

/* IPO results-first layout */
.ipo-page {
  padding-top: 0;
  border-top: 0;
}
.ipo-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: .5rem 0 1.5rem;
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ipo-stat {
  min-height: 84px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 1rem 2rem;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.ipo-stat:first-child { padding-left: 0; }
.ipo-stat:last-child { border-right: 0; }
.ipo-stat-num {
  color: var(--text-primary);
  font-family: var(--font-data-display);
  font-size: 2.3rem;
  line-height: 1.1;
  font-weight: 500;
  font-kerning: none;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.ipo-stat-label { color: var(--text-secondary); }
.ipo-disclosures {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: end;
  gap: .55rem;
  margin-bottom: .75rem;
}
.ipo-info-card {
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
}
.ipo-info-card[open] {
  grid-column: 1 / -1;
  width: min(100%, 980px);
  background: var(--surface);
}
.ipo-info-summary {
  min-height: 40px;
  gap: .5rem;
  justify-content: flex-start;
  padding: .5rem .75rem;
}
.ipo-info-summary::before {
  order: 2;
  margin: 0 0 0 .2rem;
  color: var(--text-secondary);
}
.ipo-info-summary:hover { background: var(--surface-muted); }
.ipo-info-title { font-size: .8rem; font-weight: 500; }
.ipo-info-hint { display: none; }
.ipo-info-body { padding: .75rem 1rem 1rem; border-top: 1px solid var(--border); }
.ipo-strategy-grid { gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.ipo-strategy-card {
  padding: .8rem 1rem;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.ipo-strategy-a,
.ipo-strategy-b,
.ipo-strategy-c,
.ipo-strategy-user { border-left: 0; }
.ipo-strategy-tag,
.tag-a,
.tag-b,
.tag-c,
.tag-u {
  color: var(--accent);
  background: var(--accent-soft);
}
.ipo-formula {
  color: #fff;
  background: var(--text-primary);
  border-radius: 4px;
}
.ipo-meta-pill {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
}
.ipo-tabs {
  flex-wrap: nowrap;
  gap: 1.8rem;
  min-height: 56px;
  margin: 0;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.ipo-tabs::-webkit-scrollbar { display: none; }
.ipo-tab {
  min-height: 54px;
  flex: 0 0 auto;
  padding: .6rem 0 .5rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
.ipo-tab:hover { background: transparent; color: var(--text-primary); }
.ipo-tab.active {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}
.ipo-search-wrap { margin-left: auto; }
.ipo-search {
  width: 270px;
  height: 40px;
  background: transparent;
  border-color: var(--border);
  border-radius: 4px;
}
.ipo-search:focus { border-color: var(--accent); }
.ipo-table { min-width: 1280px; font-size: .8rem; }
.ipo-table a { color: var(--text-primary); }
.ipo-table th { top: 0; }
.ipo-badge,
.ipo-badge.badge-a,
.ipo-badge.badge-b,
.ipo-badge.badge-c,
.ipo-badge.badge-u {
  color: var(--accent);
  background: var(--accent-soft);
}
.e5-strong { color: var(--down); background: var(--down-bg); }
.e5-mid { color: var(--accent); background: var(--accent-soft); }
.e5-weak { color: var(--up); background: var(--up-bg); }

/* Detail-page compatibility with the shared palette */
.chart-wrap,
.metric-card,
.ipo-card {
  border-color: var(--border);
  border-radius: 5px;
  box-shadow: none;
}
.ipo-card-title,
.ipo-back:hover,
.ipo-kv.highlight span { color: var(--accent); }
.scan-modal {
  border-color: var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.scan-modal-icon { color: var(--accent); }
.scan-progress-fill { background: var(--accent); }
.toast.ok { background: var(--text-primary); }

@media (max-width: 1024px) {
  .topbar-shell,
  .container { padding-right: 24px; padding-left: 24px; }
  .topbar-shell { gap: 1.5rem; }
  .topbar-nav { gap: 1.2rem; }
  .index-card { padding-right: 1rem; padding-left: 1rem; }
  .section-head { align-items: flex-start; }
  .section-actions { max-width: 56%; }
  .vol-mult-hint,
  .sort-hint { display: none; }
}

@media (max-width: 760px) {
  .desktop-only,
  .topbar-nav { display: none !important; }
  .mobile-only { display: block; }

  .topbar { height: 64px; }
  .topbar-shell { padding: 0 16px; }
  .brand { gap: .65rem; }
  .topbar-logo { width: 34px; height: 34px; }
  .h-title { font-size: 1.25rem; }
  .mobile-menu { position: relative; }
  .mobile-menu > summary { list-style: none; }
  .mobile-menu > summary::-webkit-details-marker { display: none; }
  .mobile-menu-trigger {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
  }
  .mobile-menu-trigger span { width: 18px; height: 1px; background: var(--text-primary); }
  .mobile-menu-panel {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    z-index: 35;
    padding: 1rem 16px 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 45px rgb(23 23 23 / .09);
  }
  .mobile-nav { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: .9rem; }
  .mobile-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
  }
  .mobile-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
  .mobile-search .search-input { width: 100%; }
  .mobile-search .search-dropdown { right: auto; left: 0; min-width: min(100%, 360px); }
  .mobile-data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
  .mobile-data-actions button { min-height: 44px; border-radius: 4px; }

  .container { padding: 1.15rem 16px 4rem; }
  .page-intro {
    display: block;
    padding: .55rem 0 .85rem;
  }
  .page-title { font-size: 2.35rem; }
  .page-subtitle { font-size: .86rem; }
  .page-date {
    align-items: flex-start;
    margin-top: .85rem;
    padding: 0;
  }
  .page-date span { display: none; }
  .page-date strong { color: var(--text-muted); font-size: .78rem; }
  .meta-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .meta-strip::-webkit-scrollbar { display: none; }

  .indices-scroll-shell { margin: 0 -16px; overflow: hidden; }
  .indices-grid {
    display: flex;
    gap: .75rem;
    margin: 0;
    padding: 0 16px .25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    background: transparent;
    border: 0;
    scrollbar-width: none;
  }
  .indices-grid::-webkit-scrollbar { display: none; }
  .index-card {
    flex: 0 0 calc(100vw - 48px);
    min-width: 0;
    padding: 1.1rem 1rem .9rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    scroll-snap-align: center;
  }
  .index-card:last-child { border-right: 1px solid var(--border); }
  .index-card-value { font-size: 2.5rem; }
  .index-kline { height: 190px; }
  .indices-scroll-hint {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
  }
  .indices-scroll-hint span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-strong);
  }
  .indices-scroll-hint span.active { background: var(--accent); }

  .section { padding-top: 1rem; }
  .section-head { display: block; margin-bottom: .9rem; }
  .section-title { display: block; }
  .h-section { font-size: 2rem; }
  .section-title-tag { display: block; margin-top: .25rem; }
  .section-actions {
    max-width: none;
    justify-content: flex-start;
    margin-top: .8rem;
  }
  .section-summary { flex: 1 0 100%; }
  .btn-tool { min-height: 44px; }
  .strategy-tabs { min-height: 58px; }
  .strategy-tab { min-width: 180px; }
  .strategy-mode-bar {
    align-items: flex-start;
    gap: .45rem .7rem;
    padding: .65rem 0;
    flex-wrap: wrap;
    min-width: 0;
  }
  .strategy-mode-tabs {
    max-width: 100%;
    overflow-x: auto;
    flex: 0 1 auto;
  }
  .strategy-mode-tab { flex: 0 0 auto; }
  .strategy-mode-label,
  .strategy-mode-help { min-width: 0; }
  .strategy-tabs,
  .board-tabs,
  .vol-mult-tabs {
    max-width: 100%;
  }
  .strategy-mode-help { flex: 1 0 100%; }
  .strategy-mode-tab { min-height: 38px; }
  .board-tabs { gap: 1.5rem; }
  .board-tab { min-height: 48px; }
  .vol-mult-tabs { min-height: 56px; }
  .vol-mult-tab { min-height: 44px; }
  .sort-status { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
  .sort-status-label { flex: 0 0 auto; }
  .sort-manager-trigger { min-height: 40px; }
  .sort-hint { display: none; }
  .sort-manager-backdrop { align-items: flex-end; padding: 0; }
  .sort-manager {
    width: 100%;
    max-height: 86vh;
    padding: 1rem 16px calc(1rem + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }
  .sort-manager-field-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picks-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: .7rem;
    padding: 1rem 0;
  }
  .picks-page-summary { order: 1; }
  .picks-page-controls { order: 2; width: 100%; }
  .picks-page-nav { flex: 1; }
  .picks-page-jump { order: 3; justify-content: center; }

  .table-wrap,
  .ipo-table-wrap {
    position: relative;
    margin-right: -16px;
    margin-left: -16px;
    padding-left: 16px;
  }
  table.data { min-width: 900px; font-size: .8rem; }
  table.data thead th,
  table.data tbody td { height: 50px; padding: .55rem .65rem; }
  /* 所有列都跟随表格一起横向滚动，排名、代码和名称均可见。 */
  table.picks-data-table { min-width: 1400px; }

  .ipo-stats { margin-bottom: 1rem; }
  .ipo-stat {
    min-height: 76px;
    justify-items: center;
    padding: .75rem .35rem;
    text-align: center;
  }
  .ipo-stat:first-child { padding-left: .35rem; }
  .ipo-stat-num { font-size: 1.8rem; }
  .ipo-stat-label { font-size: .7rem; }
  .ipo-disclosures {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: .5rem;
  }
  .ipo-info-card[open] { width: 100%; }
  .ipo-info-summary { min-height: 44px; justify-content: center; }
  .ipo-strategy-grid { grid-template-columns: 1fr; }
  .ipo-tabs {
    min-height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    padding-top: .15rem;
  }
  .ipo-tab { min-height: 48px; }
  .ipo-search-wrap {
    order: 2;
    flex: 1 0 100%;
    margin: .2rem 0 .75rem;
  }
  .ipo-search { width: 100%; height: 44px; }
  .ipo-table { min-width: 1180px; font-size: .78rem; }
  .ipo-table th,
  .ipo-table td { height: 52px; padding: .5rem .6rem; }
  .ipo-table th:first-child,
  .ipo-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 104px;
    background: var(--surface);
  }
  .ipo-table th:nth-child(2),
  .ipo-table td:nth-child(2) {
    position: sticky;
    left: 104px;
    z-index: 4;
    min-width: 86px;
    background: var(--surface);
    box-shadow: 8px 0 12px -12px rgb(23 23 23 / .4);
  }

  .stock-header-info { min-width: 0; flex-wrap: wrap; gap: .35rem .7rem; }
  .stock-personal-actions { width: 100%; }
  .stock-personal-actions button { flex: 1; min-height: 42px; }
  .personal-row { grid-template-columns: 1fr auto; gap: .75rem; }
  .personal-stock { grid-column: 1; }
  .personal-quote { grid-column: 2; grid-row: 1; }
  .personal-note { grid-column: 1 / -1; }
  .personal-remove { grid-column: 1 / -1; justify-self: end; }
  .admin-create-card { grid-template-columns: 1fr; gap: 1rem; }
  .admin-create-form { grid-template-columns: 1fr; }
  .admin-user-row { grid-template-columns: 1fr 1fr; }
  .admin-user-identity { grid-column: 1 / -1; }
  .admin-user-actions { grid-column: 1 / -1; justify-content: stretch; }
  .admin-user-actions button { flex: 1; }
  .temporary-password { align-items: flex-start; gap: 1rem; }
  .auth-shell { padding: 1rem; }
  .auth-card { padding: 2rem 1.4rem; box-shadow: 7px 7px 0 rgb(23 23 23 / .06); }
  .chart-wrap { min-width: 0; overflow: hidden; padding: .85rem; }
  .chart-head { align-items: flex-start; flex-wrap: wrap; gap: .65rem; }
  .chart-head > .section-title { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; gap: .2rem .55rem; }
  .chart-head .h-section { font-size: 1.55rem; line-height: 1.2; }
  .chart-head .section-title-tag { max-width: 100%; overflow-wrap: anywhere; }
  .chart-head > div:last-child { max-width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .toast { right: 16px; bottom: 16px; left: 16px; text-align: center; }
}

@media (max-width: 390px) {
  .page-title { font-size: 2.15rem; }
  .index-card { flex-basis: calc(100vw - 42px); }
  .index-kline { height: 175px; }
  .section-actions .btn-tool { flex: 1; justify-content: center; }
  .vol-mult-hint { display: none; }
  .ipo-info-body { padding-right: .75rem; padding-left: .75rem; }
}

/* 日线相对表现：与周线指标共享排版，只突出 20 日观察窗口。 */
.picks-performance-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .45rem 1rem;
  padding: .7rem 0;
  color: var(--text-secondary);
  font-size: .75rem;
}
.picks-performance-note > p {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .8rem;
  margin: 0;
}
.picks-performance-note > p > span { color: var(--text-muted); }
.performance-method { color: var(--text-secondary); font-size: .75rem; }
.performance-method summary {
  cursor: pointer;
  width: fit-content;
  padding: .15rem 0;
  text-underline-offset: .2rem;
}
.performance-method summary:hover { color: var(--accent); }
.performance-method summary:focus-visible,
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.performance-method p {
  max-width: 68ch;
  margin: .5rem 0;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.picks-performance-note .performance-method[open] { flex: 1 0 100%; }
.performance-value {
  font-family: var(--font-data-display);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  white-space: nowrap;
}
.performance-missing { color: var(--text-muted); }
table.picks-data-table .performance-column small {
  display: block;
  margin-top: .18rem;
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 400;
  line-height: 1.2;
}
table.picks-data-table td.performance-primary { background: var(--surface-muted); }
.recent-performance { padding-bottom: .9rem; }
.recent-performance .section-head {
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.performance-as-of { color: var(--text-muted); font-size: .76rem; }
.performance-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}
.performance-table th,
.performance-table td {
  width: 26%;
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}
.performance-table th:first-child { width: 22%; text-align: left; }
.performance-table thead th { color: var(--text-secondary); font-size: .8rem; font-weight: 500; }
.performance-table tbody th { font-size: 1rem; font-weight: 500; }
.performance-table small {
  display: block;
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 400;
}
.performance-table td { font-size: 1.3rem; }
.performance-focus { background: var(--surface-muted); }
.performance-excess .performance-value { font-weight: 600; }
.performance-footnote { color: var(--text-muted); font-size: .75rem; line-height: 1.8; }
.performance-table caption.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 760px) {
  .picks-performance-note { padding: .7rem 0; font-size: .7rem; }
  .recent-performance .section-head { display: flex; }
  .recent-performance .section-title { flex: 1 0 100%; }
  .performance-table th,
  .performance-table td { padding: .8rem .5rem; }
  .performance-table thead th { font-size: .74rem; }
  .performance-table tbody th { font-size: .9rem; }
  .performance-table td { font-size: 1.05rem; }
  .performance-table small { font-size: .65rem; }
}

.bottom-rules { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.bottom-rules p { max-width: 90ch; }
.bottom-stock strong { display: block; color: var(--text-primary); font-weight: 600; }
.bottom-stock small { display: block; color: var(--text-muted); font-size: .7rem; margin-top: .15rem; }
.bottom-industry { color: var(--text-secondary); }
.bottom-volume-table th small { display: block; color: var(--text-muted); font-size: .63rem; font-weight: 400; }
.bottom-volume-grade { font-weight: 500; }
.bottom-volume-triple { color: var(--accent); font-weight: 700; }
.bottom-state { color: var(--text-muted); font-size: .75rem; }
.bottom-state-active { color: var(--accent); font-weight: 600; }
.bottom-volume-retention { display: block; margin-top: .2rem; color: var(--text-secondary); font-size: .7rem; }
.ipo-update-controls { display: flex; align-items: center; justify-content: flex-end; gap: 1.25rem; }
.ipo-update-controls .page-date small { color: var(--text-muted); font-size: .72rem; }
.ipo-update-button { flex-shrink: 0; }
.ipo-update-status { margin: -.5rem 0 1.5rem; padding: .85rem 1rem; border: 1px solid var(--border); color: var(--text-secondary); font-size: .85rem; }
.ipo-update-status-line { display: flex; justify-content: space-between; gap: 1rem; }
.ipo-update-status small { display: block; margin-top: .5rem; color: var(--text-muted); font-size: .75rem; }
.ipo-update-progress { margin-top: .65rem; height: 3px; background: var(--border); }
.ipo-update-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.ipo-update-status.is-error { border-color: var(--accent); }
.ipo-research-note { display: block; margin-top: .25rem; color: var(--text-muted); font-size: .68rem; }
.ipo-scope-note { margin: .65rem 0; color: var(--text-secondary); font-size: .75rem; }
.upcoming-ipos { margin: .6rem 0 1.6rem; padding: 1.1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.upcoming-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.upcoming-head .h-section { font-size: 1.4rem; }
.upcoming-head p { margin: .35rem 0 0; color: var(--text-secondary); font-size: .76rem; }
.upcoming-head p .mono { margin-left: .5rem; }
.upcoming-actions { display: flex; align-items: center; gap: .8rem; }
.upcoming-updated { color: var(--text-muted); font-size: .72rem; }
.upcoming-message, .upcoming-age { margin: .65rem 0; font-size: .75rem; color: var(--text-secondary); }
.upcoming-message.is-error { color: var(--accent); }
.upcoming-age { color: var(--text-muted); }
.upcoming-units { margin: .7rem 0; font-size: .72rem; color: var(--text-muted); }
.upcoming-units > span { display: none; }
table.upcoming-table { min-width: 1100px; table-layout: fixed; }
.upcoming-table th:nth-child(1) { width: 19%; }
.upcoming-table th:nth-child(2) { width: 15%; }
.upcoming-table th:nth-child(3), .upcoming-table th:nth-child(4) { width: 10%; }
.upcoming-table th:nth-child(5), .upcoming-table th:nth-child(6), .upcoming-table th:nth-child(7) { width: 12%; }
.upcoming-table th:nth-child(8) { width: 10%; }
.upcoming-table td { vertical-align: top; }
.upcoming-table th small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.upcoming-industry { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; margin-top: .4rem; color: var(--text-secondary); font-size: .72rem; line-height: 1.5; }
.upcoming-table strong { font-weight: 600; }
.upcoming-table small { display: block; margin-top: .25rem; font-size: .69rem; color: var(--text-muted); }
.upcoming-table a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.upcoming-facts-toggle { padding: 0; border: 0; color: var(--accent); background: transparent; font: inherit; font-size: .75rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.upcoming-facts-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.upcoming-facts-row > td { background: var(--surface-muted); padding: 1rem 1.2rem; white-space: normal; }
.upcoming-facts-grid { display: grid; grid-template-columns: 1fr 1fr 1.5fr 1fr; gap: 1.3rem; margin: 0; }
.upcoming-facts-grid dt { font-size: .7rem; font-weight: 400; color: var(--text-muted); }
.upcoming-facts-grid dd { margin: .35rem 0 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.upcoming-facts-note { margin: .85rem 0 .5rem; font-size: .72rem; color: var(--text-secondary); }
.upcoming-fact-sources { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .72rem; }
.upcoming-table .upcoming-empty { height: 55px; text-align: left; color: var(--text-muted); font-size: .8rem; }
.upcoming-pending { margin-top: .8rem; }
.upcoming-pending > summary { padding: .65rem 0; cursor: pointer; font-size: .8rem; color: var(--text-secondary); }
.upcoming-pending > summary small { margin-left: .75rem; color: var(--text-muted); font-size: .7rem; }
.upcoming-method { padding-top: .5rem; }
@media (max-width: 760px) {
  .upcoming-head { align-items: flex-start; }
  .upcoming-head p .mono { display: block; margin: .3rem 0 0; font-size: .7rem; }
  .upcoming-actions { flex-direction: column-reverse; align-items: flex-end; gap: .4rem; flex-shrink: 0; }
  .upcoming-updated { font-size: .65rem; }
  .upcoming-units > span { display: block; margin-top: .3rem; }
  .upcoming-pending > summary small { display: block; margin: .3rem 0 0 1rem; }
  .ipo-update-controls { width: 100%; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .85rem; }
  .ipo-update-controls .page-date { text-align: left; align-items: flex-start; }
  .ipo-update-status { margin-top: .5rem; }
}
.bottom-volume-table td.performance-primary { background: var(--surface-muted); }
@media (max-width: 760px) {
  .bottom-rules summary { min-height: 34px; display: list-item; }
}

/* Semantic market colors always resolve from the shared palette tokens. */
.up { color: var(--up); }
.down { color: var(--down); }
.up-strong { color: var(--up); font-weight: 600; }
.down-strong { color: var(--down); font-weight: 600; }

/* Strategy tables: one grid across boards, with equal cell gutters and stable sort controls. */
table.picks-data-table,
table.bottom-volume-table { table-layout: fixed; }
table.picks-data-table { min-width: 1350px; }
table.bottom-volume-table { min-width: 1596px; }
:is(.picks-data-table, .bottom-volume-table) th:nth-child(n) { width: auto; }
table:is(.picks-data-table, .bottom-volume-table) thead th,
table:is(.picks-data-table, .bottom-volume-table) tbody td {
  padding: 12px 12px;
  vertical-align: middle;
  letter-spacing: 0;
}
table:is(.picks-data-table, .bottom-volume-table) thead th {
  height: 64px;
  font-size: 12px;
  line-height: 1.45;
}
table:is(.picks-data-table, .bottom-volume-table) tbody td {
  height: 52px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
}
table:is(.picks-data-table, .bottom-volume-table) .cell-num,
table.picks-data-table .cell-code,
table.picks-data-table [data-rank],
.bottom-stock .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table:is(.picks-data-table, .bottom-volume-table) thead .cell-num { font-family: var(--font-sans); }
table:is(.picks-data-table, .bottom-volume-table) .sortable { padding: 0; }
:is(.picks-data-table, .bottom-volume-table) th.sortable::after { content: none; }
.table-sort-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 64px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 22px 12px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-align: right;
}
.table-sort-button:hover { background: rgb(143 36 51 / .04); }
.table-sort-button:active { transform: none; }
.table-sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.table-header-label { white-space: nowrap; }
.table-sort-indicator {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  width: 18px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
}
.table-sort-indicator sup { align-self: flex-start; margin-left: 1px; font-size: 8px; }
th[data-active="true"] .table-sort-indicator { color: var(--accent); opacity: 1; }
th.sortable:hover .table-sort-indicator,
.table-sort-button:focus-visible .table-sort-indicator { opacity: 1; }
table:is(.picks-data-table, .bottom-volume-table) tbody .cell-num { padding-right: 22px; font-size: 12.5px; }
.table-sort-button small,
table:is(.picks-data-table, .bottom-volume-table) th small {
  margin-top: 3px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}
table.picks-data-table .signal-column .table-sort-button { align-items: flex-start; padding-left: 14px; }
.bottom-volume-table .bottom-stock,
.bottom-volume-table .bottom-industry { overflow: hidden; text-overflow: ellipsis; }
.bottom-stock a { display: block; overflow: hidden; text-overflow: ellipsis; }
.table-personal-actions .mini-personal-toggle { min-height: 28px; }
.table-personal-actions .mini-personal-toggle + .mini-personal-toggle { margin-left: 4px; }

table:is(.picks-data-table, .bottom-volume-table) thead th.cell-num:not(.sortable) { padding-right: 22px; }
