/* ═══════════════════════════════════════════════════════════════════
   股票魔法师 · A股 SEPA 多因子分析
   ───────────────────────────────────────────────────────────────────
   Design language: "Market Observatory"
   骨白纸面 / 石墨底 · 钴蓝信号 · 等宽数字 · 细线网格 · 角标参考系统
   数字是主体，装饰是刻度。
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────── 令牌 ─────────────────────────── */
:root {
  color-scheme: light;

  /* 纸张与墨 */
  --bg: #f4f1ea;
  --bg-grad:
    radial-gradient(1200px 640px at 8% -16%, #e8ecf8 0%, transparent 58%),
    radial-gradient(1000px 560px at 98% -10%, #eef1e6 0%, transparent 54%);
  --panel: #fffdf9;
  --panel-2: #f7f4ee;
  --panel-3: #ece7de;
  --panel-4: #ded7cb;
  --border: rgba(24, 19, 11, .115);
  --border-strong: rgba(24, 19, 11, .24);
  --hairline: rgba(24, 19, 11, .07);
  --glass: rgba(255, 253, 249, .78);
  --glass-edge: rgba(255, 255, 255, .85);

  --text: #141109;
  --text-2: #5a5348;
  --text-3: #8d8578;

  /* 涨跌（A股：红涨绿跌）——墨色，非糖果色 */
  --up: #c9232f;
  --up-2: #e8545c;
  --up-soft: #fbeceb;
  --up-glow: rgba(201, 35, 47, .18);
  --down: #0a7f57;
  --down-2: #35ab80;
  --down-soft: #e8f4ee;
  --down-glow: rgba(6, 117, 76, .16);
  --flat: #857c6e;

  /* 信号钴蓝 */
  --accent: #2340cc;
  --accent-2: #4a63e8;
  --accent-soft: #ebedfb;
  --accent-line: #c3cbef;
  --accent-glow: rgba(35, 64, 204, .24);

  /* 等级金 */
  --gold: #8f6a10;
  --gold-2: #c99a24;
  --gold-soft: #faf2dc;
  --silver: #6b6459;
  --bronze: #8a5f33;

  --shadow-xs: 0 1px 1px rgba(24, 19, 11, .04);
  --shadow-sm: 0 1px 1px rgba(24, 19, 11, .04), 0 2px 6px -3px rgba(24, 19, 11, .09);
  --shadow-md: 0 1px 2px rgba(24, 19, 11, .05), 0 10px 24px -12px rgba(24, 19, 11, .2);
  --shadow-lg: 0 2px 6px -2px rgba(24, 19, 11, .08), 0 28px 56px -24px rgba(24, 19, 11, .3);
  --inner-top: inset 0 1px 0 rgba(255, 255, 255, .9);

  --r-lg: 10px;
  --r-md: 8px;
  --r-sm: 6px;
  --r-xs: 4px;

  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono",
          Consolas, "Liberation Mono", monospace;

  --dur: .17s;
  --ease: cubic-bezier(.2, .8, .28, 1);
  --grain-opacity: .032;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #08080a;
  --bg-grad:
    radial-gradient(1200px 660px at 6% -18%, #12172c 0%, transparent 58%),
    radial-gradient(1000px 580px at 100% -12%, #0d1a15 0%, transparent 54%);
  --panel: #0e0e11;
  --panel-2: #14151a;
  --panel-3: #1a1b21;
  --panel-4: #24252c;
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .2);
  --hairline: rgba(255, 255, 255, .055);
  --glass: rgba(14, 14, 17, .74);
  --glass-edge: rgba(255, 255, 255, .07);

  --text: #eeeae2;
  --text-2: #9a968c;
  --text-3: #7d7972;

  --up: #ff5960;
  --up-2: #ff8478;
  --up-soft: #2a1214;
  --up-glow: rgba(255, 89, 96, .26);
  --down: #24d191;
  --down-2: #5fe8b4;
  --down-soft: #0a2419;
  --down-glow: rgba(36, 209, 145, .22);
  --flat: #6d6a63;

  --accent: #7a8cff;
  --accent-2: #a3b0ff;
  --accent-soft: #151832;
  --accent-line: #2a3157;
  --accent-glow: rgba(122, 140, 255, .3);

  --gold: #e0b64f;
  --gold-2: #f3d27f;
  --gold-soft: #201a09;
  --silver: #a5a198;
  --bronze: #c9905b;

  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 10px -4px rgba(0, 0, 0, .7);
  --shadow-lg: 0 6px 20px -6px rgba(0, 0, 0, .75), 0 30px 64px -24px rgba(0, 0, 0, .9);
  --inner-top: inset 0 1px 0 rgba(255, 255, 255, .04);

  --grain-opacity: .022;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -.004em;
}

/* 纸面颗粒 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 400;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::after { mix-blend-mode: screen; }

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 38%, transparent);
  border-radius: 6px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-3) 68%, transparent); background-clip: padding-box; }

h1, h2, h3, h4 { font-weight: 640; letter-spacing: -.022em; line-height: 1.26; }
h1 { font-size: 14.5px; }
h2 { font-size: 21px; }
h3 { font-size: 13px; }

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.num,
.ic-price, .ic-chg, .mr-price, .mr-chg, .score-val, .rs-badge,
.kv-val, .pi-val, .sh-price, .sh-chg, .pc-price-val, .pc-price-chg,
.temp-num, .bl-val, .icn-val, .pp-val, .vcp-bar-label, .rl-val,
.view-meta, .ci-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 0;
  letter-spacing: -.028em;
}

.c-up { color: var(--up); }
.c-down { color: var(--down); }
.c-flat { color: var(--flat); }
.c-2 { color: var(--text-2); }
.c-3 { color: var(--text-3); }

/* 等宽微标签 */
.mono-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  padding: 9px 18px 5px;
  background: linear-gradient(to bottom, var(--bg) 40%, color-mix(in srgb, var(--bg) 62%, transparent) 72%, transparent);
}
.topbar-inner {
  max-width: 1500px; margin: 0 auto;
  height: 54px; padding: 0 12px 0 14px;
  display: flex; align-items: center; gap: 16px;
  background: var(--glass);
  backdrop-filter: saturate(170%) blur(18px);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md), var(--inner-top);
  position: relative;
}
[data-theme="dark"] .topbar-inner { border-color: var(--border); }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-right: 15px; position: relative; }
.brand::after {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 22px; background: var(--border);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 2px 8px -2px var(--accent-glow);
  position: relative;
}
.brand-mark svg { width: 17px; height: 17px; position: relative; z-index: 1; }
.brand-text h1 { font-size: 13.5px; letter-spacing: -.022em; line-height: 1.2; }
.brand-text span {
  font-size: 8.5px; color: var(--text-3); font-family: var(--mono);
  letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}

/* 分段导航 + 滑动指示器 */
.nav {
  display: flex; gap: 1px; position: relative;
  padding: 3px; border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-ind {
  position: absolute; top: 3px; left: 3px; bottom: 3px;
  border-radius: 5px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(24, 19, 11, .08);
  transition: transform .28s var(--ease), width .28s var(--ease);
  pointer-events: none; z-index: 0; opacity: 0;
}
.nav-ind.ready { opacity: 1; }
[data-theme="dark"] .nav-ind { background: #23242b; border-color: #383a44; }

.nav-item {
  position: relative; z-index: 1;
  padding: 6px 14px; border-radius: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 650; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--text-3); pointer-events: none;
  transition: color var(--dur);
}
#globalSearch {
  width: 180px; height: 32px; padding: 0 11px 0 30px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: width .24s var(--ease), background var(--dur), border-color var(--dur), box-shadow var(--dur);
  outline: none; font-size: 12.5px;
}
#globalSearch::placeholder { color: var(--text-3); }
#globalSearch:focus {
  width: 232px; background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.search-wrap:focus-within .search-icon { color: var(--accent); }

.search-results {
  position: absolute; top: calc(100% + 7px); right: 0;
  width: 296px; max-height: 380px; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: none; z-index: 200; padding: 4px;
}
.search-results.show { display: block; animation: popIn .15s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.search-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--r-xs);
  cursor: pointer; transition: background .12s;
}
.search-item:hover { background: var(--panel-2); }
.search-item .si-code { font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 48px; letter-spacing: -.02em; }
.search-item .si-name { font-weight: 600; flex: 1; font-size: 12.5px; }
.search-item .si-price { font-family: var(--mono); font-size: 12px; letter-spacing: -.02em; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background var(--dur), color var(--dur), transform var(--dur);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 15.5px; height: 15.5px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
#refreshBtn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 实时状态 */
.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px; font-weight: 650; color: var(--text-2);
  font-family: var(--mono); white-space: nowrap;
  transition: all .2s; user-select: none; letter-spacing: .02em;
}
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.live-badge.on { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.live-badge.on .live-dot {
  background: var(--accent);
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: livePulse 1.9s ease-in-out infinite;
}
.live-badge.paused .live-dot { background: var(--gold-2); animation: none; }
.live-badge.paused { color: var(--gold); background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.live-time { opacity: .62; font-size: 9.5px; letter-spacing: -.02em; }
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .34; transform: scale(.76); }
}
.icon-play { display: none; }
#liveToggle.paused .icon-pause { display: none; }
#liveToggle.paused .icon-play { display: block; }

/* 价格闪烁 */
@keyframes flashUp { 0% { background: color-mix(in srgb, var(--up) 20%, transparent); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: color-mix(in srgb, var(--down) 20%, transparent); } 100% { background: transparent; } }
.flash-up { animation: flashUp .8s ease-out; border-radius: 3px; }
.flash-down { animation: flashDown .8s ease-out; border-radius: 3px; }

/* ═══════════ 主布局 ═══════════ */
.main { max-width: 1500px; margin: 0 auto; padding: 12px 18px 52px; }

.view { display: none; }
.view.active { display: block; animation: viewIn .3s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding-bottom: 13px; margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.view-head h2 {
  font-size: 22px; letter-spacing: -.035em; font-weight: 660;
  display: flex; flex-direction: column; gap: 2px;
}
.view-head h2::before {
  content: attr(data-kicker);
  font-family: var(--mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--text-3);
  order: -1;
}
.view-sub { color: var(--text-2); font-size: 12px; margin-top: 6px; max-width: 760px; }
.view-meta {
  font-size: 10px; color: var(--text-3);
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
  letter-spacing: .02em; background: var(--panel-2);
}

/* ═══════════ 面板 ═══════════ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 13px;
  overflow: hidden;
  position: relative;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.panel-head-lg { padding: 13px 17px; flex-wrap: wrap; }
.panel-head h3 {
  font-size: 12.5px; letter-spacing: -.01em; font-weight: 660;
  display: flex; align-items: center; gap: 8px;
}
/* 印刷刻度标记 */
.panel-head h3::before {
  content: ''; width: 3px; height: 11px; border-radius: 1px;
  background: var(--text); opacity: .28; flex-shrink: 0;
}
.panel-hint {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); font-weight: 600;
  white-space: nowrap;
}

.two-col { display: grid; grid-template-columns: 1fr 1.48fr; gap: 13px; align-items: stretch; }
.two-col > .panel { display: flex; flex-direction: column; }
.two-col > .panel > .temp-body,
.two-col > .panel > .industry-grid { flex: 1; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }

/* ═══════════ 指数长条（单块板 + 分隔线） ═══════════ */
.index-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1px; margin-bottom: 13px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}
.index-card {
  padding: 11px 13px 10px;
  background: var(--panel);
  position: relative;
  transition: background var(--dur);
  min-width: 0;
}
.index-card:hover { background: var(--panel-2); }

.ic-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.ic-name {
  font-size: 11px; color: var(--text-2); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ic-idx {
  font-family: var(--mono); font-size: 8.5px; color: var(--text-3);
  letter-spacing: .06em; flex-shrink: 0; opacity: .8;
}
.ic-price {
  font-size: 19px; font-weight: 640; letter-spacing: -.042em;
  line-height: 1.15; display: block;
}
.ic-chg {
  font-size: 11px; margin-top: 1px; display: flex; gap: 6px;
  align-items: baseline; font-weight: 600; letter-spacing: -.025em;
}
.ic-chg span:last-child { opacity: .55; font-size: 9.5px; font-weight: 500; }

.ic-bar { margin-top: 8px; height: 2px; border-radius: 1px; background: var(--panel-3); overflow: hidden; }
.ic-bar > i { display: block; height: 100%; border-radius: 1px; transition: width .6s var(--ease), background .3s; }

/* ═══════════ 市场温度 ═══════════ */
.temp-body { padding: 14px 16px 16px; }
.temp-main { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }

.temp-dial { position: relative; width: 152px; flex-shrink: 0; }
.temp-dial svg { display: block; width: 100%; height: auto; overflow: visible; }
/* 表盘中心内容：viewBox 裁切后圆心位于 61% 处 */
.temp-dial-center {
  position: absolute; inset: 0; padding-top: 22%;
  display: grid; place-items: center; align-content: center;
  text-align: center; pointer-events: none;
}
.temp-num { font-size: 28px; font-weight: 680; line-height: 1; letter-spacing: -.055em; }
.temp-label {
  font-family: var(--mono); font-size: 9px; color: var(--text-3);
  margin-top: 3px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}

.temp-info { flex: 1; min-width: 0; }
.temp-title { font-size: 15px; font-weight: 660; margin-bottom: 4px; letter-spacing: -.028em; }
.temp-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.6; }

.breadth-bar {
  display: flex; height: 7px; border-radius: 3px; overflow: hidden;
  background: var(--panel-3); margin-bottom: 10px; gap: 1.5px;
}
.breadth-seg { height: 100%; transition: width .55s var(--ease); }
.breadth-seg.up { background: var(--up); }
.breadth-seg.flat { background: var(--flat); opacity: .4; }
.breadth-seg.down { background: var(--down); }

.breadth-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bl-item {
  padding: 7px 6px 6px; background: var(--panel-2);
  border-radius: var(--r-xs); border: 1px solid var(--border);
  text-align: center;
}
.bl-val { font-size: 15px; font-weight: 660; letter-spacing: -.038em; line-height: 1.2; }
.bl-key {
  font-family: var(--mono); font-size: 8.5px; color: var(--text-3);
  margin-top: 1px; letter-spacing: .06em; text-transform: uppercase;
}

/* ═══════════ 行业热力 ═══════════ */
.industry-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 4px; padding: 12px 14px 14px;
  align-content: start;
}
.industry-cell {
  padding: 7px 9px 8px; border-radius: var(--r-xs);
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background .3s, border-color .15s;
  position: relative; overflow: hidden; isolation: isolate;
}
.industry-cell::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--tint-col, transparent);
  opacity: var(--tint, 0);
  transition: opacity .5s var(--ease);
}
.industry-cell:hover { border-color: var(--border-strong); }
.icn-name {
  font-size: 10.5px; color: var(--text-2); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em;
}
.icn-val { font-size: 13px; font-weight: 660; margin-top: 1px; letter-spacing: -.038em; }
.icn-cnt { font-family: var(--mono); font-size: 8.5px; color: var(--text-3); margin-top: 1px; letter-spacing: .02em; }

/* ═══════════ 迷你榜单 ═══════════ */
.mini-list { padding: 4px; }
.mini-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: var(--r-xs);
  cursor: pointer; transition: background .12s;
  position: relative;
}
.mini-row:hover { background: var(--panel-2); }
.mr-rank {
  width: 16px; flex-shrink: 0;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--text-3); letter-spacing: -.02em; text-align: right;
}
.mr-rank.top { color: var(--text); font-weight: 700; }
.mr-name {
  font-weight: 620; font-size: 12px; flex-shrink: 0;
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.01em;
}
.mr-code { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); flex-shrink: 0; letter-spacing: -.01em; }
.mr-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.mr-price { font-size: 11.5px; line-height: 1.35; letter-spacing: -.028em; }
.mr-chg { font-size: 10.5px; font-weight: 650; line-height: 1.35; letter-spacing: -.028em; }

/* ═══════════ 筛选面板 ═══════════ */
.filter-panel { padding: 15px 17px; }
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 15px; margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-family: var(--mono); font-size: 9px; color: var(--text-3);
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.field select, .field input[type="text"] {
  height: 34px; padding: 0 28px 0 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none; cursor: pointer; width: 100%;
  appearance: none; font-size: 12.5px;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d8578' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}
.field select:hover, .field input[type="text"]:hover { border-color: var(--border-strong); background-color: var(--panel); }
.field select:focus, .field input:focus {
  border-color: var(--accent); background-color: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.field-checks { grid-column: span 2; }
.check-row { display: flex; flex-wrap: wrap; gap: 5px; }
.check-row label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-xs);
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 11.5px; cursor: pointer; font-weight: 600;
  transition: all .14s var(--ease); user-select: none;
}
.check-row label:hover { border-color: var(--border-strong); background: var(--panel); }
.check-row input { display: none; }
.check-row i {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; flex-shrink: 0;
  transition: all .14s var(--ease);
}
.check-row input:checked + i { background: var(--accent); border-color: var(--accent); }
.check-row input:checked + i::after {
  content: ''; width: 3.5px; height: 6.5px;
  border: solid #fff; border-width: 0 1.7px 1.7px 0;
  transform: rotate(43deg) translate(-.5px, -1px);
}
.check-row label:has(input:checked) {
  border-color: var(--accent-line); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.filter-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.filter-note { font-size: 10.5px; color: var(--text-3); flex: 1; min-width: 220px; line-height: 1.6; }

.btn {
  height: 36px; padding: 0 16px;
  border-radius: var(--r-sm);
  font-weight: 640; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur) var(--ease);
  white-space: nowrap; letter-spacing: -.01em;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 2px 8px -3px var(--accent-glow);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); box-shadow: 0 1px 0 rgba(255, 255, 255, .24) inset, 0 4px 12px -3px var(--accent-glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--panel); }

/* ═══════════ 进度 ═══════════ */
#scanProgressPanel { padding: 15px 17px; }
.progress-info {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--text-2); margin-bottom: 9px;
}
#progressMsg { font-weight: 550; }
#progressPct {
  font-family: var(--mono); font-weight: 700; color: var(--accent);
  font-size: 12px; letter-spacing: -.03em;
}
.progress-bar { height: 4px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; background: var(--accent);
  border-radius: 2px; transition: width .4s var(--ease);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.result-stats {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 10.5px; color: var(--text-3); align-items: center;
  font-family: var(--mono); letter-spacing: .02em;
}
.result-stats b { color: var(--text); font-weight: 700; font-size: 11.5px; letter-spacing: -.02em; }

/* ═══════════ 数据表格 ═══════════ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.data-table thead th {
  text-align: left; padding: 8px 11px;
  font-family: var(--mono); font-size: 8.5px; font-weight: 650;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .11em;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.data-table tbody td {
  padding: 9px 11px; border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.data-table tbody td.num { text-align: right; }
.data-table tbody tr {
  transition: background .12s; cursor: pointer;
  animation: rowIn .28s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 20) * 12ms);
}
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.data-table tbody tr:last-child td { border-bottom: none; }

.rank-cell {
  font-family: var(--mono); color: var(--text-3);
  font-size: 10px; letter-spacing: -.02em;
}
.rank-cell.top { color: var(--text); font-weight: 700; }

.stock-cell { display: flex; flex-direction: column; gap: 1px; }
.sc-name {
  font-weight: 640; font-size: 12.5px; display: flex;
  align-items: center; gap: 6px; letter-spacing: -.015em;
  transition: color .12s;
}
.sc-code { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); letter-spacing: .01em; }

.tag {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 8.5px; font-weight: 650; letter-spacing: .04em;
  background: var(--panel-3); color: var(--text-2);
  white-space: nowrap; font-family: var(--mono);
  vertical-align: middle;
}

.score-cell { display: flex; align-items: center; gap: 7px; }
.score-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--panel-3); overflow: hidden; min-width: 40px;
}
.score-bar > i { display: block; height: 100%; border-radius: 2px; transition: width .55s var(--ease); }
.score-val { font-size: 12px; font-weight: 680; width: 33px; text-align: right; letter-spacing: -.032em; }

.grade {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 4px;
  font-size: 10.5px; font-weight: 780; font-family: var(--mono);
  letter-spacing: 0; vertical-align: middle;
}
.grade-S {
  background: linear-gradient(150deg, var(--gold-2), var(--gold));
  color: #fff;
  box-shadow: 0 1px 4px -1px color-mix(in srgb, var(--gold) 55%, transparent);
}
.grade-A { background: var(--up-soft); color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 24%, transparent); }
.grade-B { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.grade-C { background: var(--panel-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.grade-D { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); }

.trend-dots { display: flex; gap: 2px; align-items: center; }
.trend-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--panel-4); }
.trend-dot.on { background: var(--up); }
.trend-dot.on.full { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--up) 16%, transparent); }

.rs-badge {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 11px; font-weight: 680; letter-spacing: -.03em;
}
.rs-high { background: var(--up-soft); color: var(--up); }
.rs-mid { background: var(--panel-3); color: var(--text-2); }
.rs-low { background: var(--down-soft); color: var(--down); }

.stage-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 620; white-space: nowrap; letter-spacing: -.01em;
}
.stage-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.stage-2 .stage-dot { background: var(--up); box-shadow: 0 0 0 2px color-mix(in srgb, var(--up) 16%, transparent); }
.stage-2 { color: var(--up); }
.stage-1 .stage-dot { background: var(--flat); }
.stage-1 { color: var(--text-2); }
.stage-3 .stage-dot { background: #b8862c; }
.stage-3 { color: #b8862c; }
.stage-4 .stage-dot { background: var(--down); }
.stage-4 { color: var(--down); }

.plan-pill {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 650; white-space: nowrap;
  letter-spacing: .01em; font-family: var(--mono);
}
.plan-buy { background: var(--up-soft); color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 20%, transparent); }
.plan-watch { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.plan-wait { background: var(--panel-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }

/* ═══════════ 推荐榜 ═══════════ */
.picks-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }

.pick-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 15px 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  animation: cardIn .36s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 5) * 45ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.pick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.pick-card.s-tier { border-color: color-mix(in srgb, var(--gold) 38%, var(--border)); }
.pick-card.s-tier::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2) 45%, var(--gold));
}

.pc-top { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 11px; }
.pc-ring { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.pc-ring svg { display: block; width: 100%; height: 100%; }
.pc-ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 720; letter-spacing: -.05em;
}
.pc-id { flex: 1; min-width: 0; }
.pc-name {
  font-size: 14px; font-weight: 660; display: flex;
  align-items: center; gap: 6px; letter-spacing: -.025em;
}
.pc-sub {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-3);
  margin-top: 2px; display: flex; gap: 5px; align-items: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .01em;
}
.pc-price { text-align: right; flex-shrink: 0; }
.pc-price-val { font-size: 14.5px; font-weight: 650; letter-spacing: -.038em; }
.pc-price-chg { font-size: 11px; font-weight: 650; letter-spacing: -.03em; margin-top: 1px; }

.pc-factors { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; flex: 1; }
.pf-row { display: flex; align-items: center; gap: 7px; font-size: 10.5px; }
.pf-label { width: 42px; color: var(--text-3); flex-shrink: 0; font-weight: 600; letter-spacing: .02em; }
.pf-track { flex: 1; height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.pf-fill { height: 100%; border-radius: 2px; transition: width .6s var(--ease); }
.pf-val {
  width: 52px; text-align: right; font-family: var(--mono);
  color: var(--text-2); font-size: 10px; letter-spacing: -.03em;
  white-space: nowrap;
}
/* 满分随权重变化（25/20/40/10/5），不标出来会被误读成同一刻度 */
.pf-val i {
  font-style: normal; color: var(--text-3); font-size: 9px; opacity: .75;
}

.pc-plan {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border-radius: var(--r-xs); overflow: hidden;
}
.pp-cell { background: var(--panel-2); padding: 6px 8px 7px; }
.pp-key {
  font-family: var(--mono); font-size: 8px; color: var(--text-3);
  margin-bottom: 1px; letter-spacing: .07em; text-transform: uppercase;
}
.pp-val { font-size: 12px; font-weight: 660; letter-spacing: -.035em; }

.picks-list { padding: 4px; }
.picks-list-head {
  display: grid; grid-template-columns: 22px minmax(140px, .9fr) 100px 58px minmax(110px, 1.5fr) 42px 46px 74px 72px;
  gap: 11px; padding: 6px 11px 5px;
  font-family: var(--mono); font-size: 8.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .11em; font-weight: 650;
  border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.pick-row {
  display: grid; grid-template-columns: 22px minmax(140px, .9fr) 100px 58px minmax(110px, 1.5fr) 42px 46px 74px 72px;
  align-items: center; gap: 11px;
  padding: 7px 11px; border-radius: var(--r-xs);
  cursor: pointer; transition: background .12s;
  animation: rowIn .28s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 20) * 12ms);
}
.pick-row:hover { background: var(--panel-2); }
.pick-row:hover .sc-name { color: var(--accent); }
.pr-rank { font-family: var(--mono); font-size: 10px; color: var(--text-3); letter-spacing: -.02em; }
.pr-ind {
  font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ═══════════ 个股分析 ═══════════ */
.stock-search { display: flex; gap: 7px; }
#stockInput {
  width: 164px; height: 36px; padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none; font-family: var(--mono);
  letter-spacing: .05em; font-size: 13px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
#stockInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }

.stock-hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 13px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  position: relative;
}
/* 角标参考系统 */
.stock-hero::before,
.stock-hero::after {
  content: ''; position: absolute; width: 7px; height: 7px;
  border-color: var(--border-strong); border-style: solid;
  pointer-events: none;
}
.stock-hero::before { left: 5px; top: 5px; border-width: 1px 0 0 1px; }
.stock-hero::after { right: 5px; bottom: 5px; border-width: 0 1px 1px 0; }

.sh-left { flex: 1; min-width: 240px; }
.sh-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sh-name { font-size: 23px; font-weight: 680; letter-spacing: -.04em; }
.sh-code { font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: .02em; }
.sh-tags { display: flex; gap: 4px; margin-top: 9px; flex-wrap: wrap; align-items: center; }
.sh-price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sh-price { font-size: 36px; font-weight: 680; letter-spacing: -.055em; line-height: 1; }
.sh-chg {
  font-size: 13px; font-weight: 650;
  padding: 2px 8px; border-radius: 5px;
  letter-spacing: -.03em; background: var(--panel-3); color: var(--text-2);
}
.sh-chg.c-up { background: var(--up-soft); color: var(--up); }
.sh-chg.c-down { background: var(--down-soft); color: var(--down); }

.sh-right { display: flex; align-items: center; gap: 20px; }
.big-ring { position: relative; width: 96px; height: 96px; }
.big-ring svg { display: block; width: 100%; height: 100%; }
.big-ring-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; align-content: center;
}
.big-ring-num {
  font-size: 26px; font-weight: 720; line-height: 1;
  letter-spacing: -.055em;
}
.big-ring-sub {
  font-family: var(--mono); font-size: 7.5px; color: var(--text-3);
  margin-top: 3px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
}

.grade-block { text-align: center; }
.grade-big {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center; margin: 0 auto 6px;
  font-family: var(--mono); font-size: 20px; font-weight: 780;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset;
}
.grade-desc { font-size: 9.5px; color: var(--text-3); max-width: 120px; line-height: 1.5; }

.critical-hint {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 10px; padding: 7px 10px;
  background: var(--gold-soft);
  border-radius: var(--r-sm);
  font-size: 10.5px; line-height: 1.6; color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  max-width: 540px;
}
.ch-icon {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--gold); color: var(--gold-soft);
  display: grid; place-items: center;
  font-size: 8.5px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
}

.stock-layout { display: grid; grid-template-columns: 1.58fr 1fr; gap: 13px; margin-bottom: 13px; }

.chart-panel { padding: 0; }
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 15px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px; min-height: 44px;
}
.chart-head h3 { font-size: 12.5px; }
.chart-legend {
  display: flex; gap: 12px; font-size: 10px; color: var(--text-2);
  flex-wrap: wrap; font-family: var(--mono); letter-spacing: .02em;
}
.cl-item { display: flex; align-items: center; gap: 5px; }
.cl-dot { width: 10px; height: 2px; border-radius: 1px; }
#klineCanvas { display: block; width: 100%; height: 380px; }

.radar-wrap { padding: 13px 15px 15px; }
#radarCanvas { display: block; width: 100%; height: 228px; }
.radar-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 11px; margin-top: 12px; }
.rl-item { display: flex; align-items: center; gap: 6px; font-size: 11px; min-width: 0; }
.rl-label { width: 48px; flex-shrink: 0; font-size: 10px; color: var(--text-2); white-space: nowrap; }
.rl-bar { flex: 1; min-width: 14px; height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.rl-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .5s var(--ease); }
.rl-val { font-size: 9.5px; color: var(--text-3); width: 44px; flex-shrink: 0; text-align: right; letter-spacing: -.02em; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(316px, 1fr)); gap: 13px; align-items: start; }

.check-list { padding: 7px 12px 12px; }
.check-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 3px; border-bottom: 1px solid var(--hairline);
}
.check-item:last-child { border-bottom: none; }
.ci-mark {
  width: 15px; height: 15px; border-radius: 3px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 8.5px; font-weight: 800; margin-top: 1.5px;
  font-family: var(--mono);
}
.ci-pass { background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); }
.ci-fail { background: var(--panel-3); color: var(--text-2); }
.ci-body { flex: 1; min-width: 0; }
.ci-label { font-size: 11.5px; line-height: 1.5; font-weight: 550; }
.ci-value {
  font-size: 9.5px; color: var(--text-2);
  margin-top: 2px; line-height: 1.5; word-break: break-word;
  opacity: .8; letter-spacing: -.01em;
}

/* 规格表式键值：左标签右数值，逐行细线，读数最快 */
.kv-grid {
  padding: 6px 16px 13px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px; align-content: start;
}
.kv-item {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 5.5px 0;
  border-bottom: 1px solid var(--hairline);
  min-width: 0;
}
.kv-key {
  font-family: var(--mono); font-size: 9px; color: var(--text-3);
  letter-spacing: .04em; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.kv-val {
  font-size: 13px; font-weight: 630; letter-spacing: -.035em;
  text-align: right; white-space: nowrap; flex-shrink: 0;
}
.kv-val small { font-size: 9px; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }

.plan-box { padding: 13px 16px 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.plan-item {
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--border);
}
.plan-item.hl { background: var(--accent-soft); border-color: var(--accent-line); }
.plan-item.up { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 18%, transparent); }
.plan-item.down { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 18%, transparent); }
.pi-key {
  font-family: var(--mono); font-size: 8.5px; color: var(--text-3);
  margin-bottom: 2px; letter-spacing: .08em; text-transform: uppercase;
}
.pi-val { font-size: 16px; font-weight: 680; letter-spacing: -.042em; }
.pi-val small { font-size: 9.5px; font-weight: 500; opacity: .55; }
.pi-sub { font-family: var(--mono); font-size: 9px; color: var(--text-3); margin-top: 1px; letter-spacing: -.01em; }

.plan-note {
  font-size: 10.5px; color: var(--text-2); line-height: 1.7;
  padding: 9px 11px; background: var(--panel-2);
  border-radius: var(--r-xs);
  border-left: 2px solid var(--accent);
}

.penalty-list { padding: 4px 16px 14px; }
.penalty-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 0; font-size: 11px; color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}
.penalty-item:last-child { border-bottom: none; }
.penalty-item::before { content: '!'; color: var(--gold); font-weight: 800; flex-shrink: 0; }

.vcp-visual { padding: 12px 16px 15px; display: flex; align-items: flex-end; gap: 8px; height: 136px; }
.vcp-bar-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 5px; height: 100%; justify-content: flex-end;
}
.vcp-bar {
  width: 100%; max-width: 42px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--down) 70%, transparent), var(--down));
  transition: height .55s var(--ease); min-height: 3px;
}
.vcp-bar.converge { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); }
.vcp-bar-label { font-size: 9.5px; color: var(--text-3); letter-spacing: -.02em; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px; text-align: center; gap: 11px; color: var(--text-3);
}
.empty-icon { font-size: 34px; opacity: .24; line-height: 1; }
.empty-state p { font-size: 12.5px; }

.skeleton {
  background: linear-gradient(90deg, var(--panel-3) 25%, var(--panel-2) 50%, var(--panel-3) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.3s infinite;
  border-radius: 4px;
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ═══════════ Toast ═══════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 7px;
  font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all .26s var(--ease);
  z-index: 999; max-width: 88vw;
  letter-spacing: -.01em;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--up); color: #fff; }

/* ═══════════ Footer ═══════════ */
.footer {
  max-width: 1500px; margin: 0 auto;
  padding: 18px 18px 34px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 9.5px; color: var(--text-3);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  letter-spacing: .02em; line-height: 1.7;
}
.footer-warn { opacity: .8; }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 1320px) {
  .index-grid { grid-template-columns: repeat(3, 1fr); }
  .picks-list-head, .pick-row { grid-template-columns: 22px minmax(134px, 1fr) 56px minmax(96px, 1.2fr) 42px 46px 72px; }
  .picks-list-head > :nth-child(3), .pick-row > :nth-child(3),
  .picks-list-head > :last-child, .pick-row > :last-child { display: none; }
}

@media (max-width: 1180px) {
  .two-col { grid-template-columns: 1fr; }
  .stock-layout { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .three-col > .panel:last-child { grid-column: span 2; }
  .picks-hero { grid-template-columns: repeat(2, 1fr); }
  .brand::after { display: none; }
}

@media (max-width: 980px) {
  .topbar { padding: 7px 11px 3px; }
  .topbar-inner { height: auto; padding: 8px 11px; flex-wrap: wrap; gap: 8px; row-gap: 8px; border-radius: 9px; }
  .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 6px 12px; font-size: 12px; }
  .brand { padding-right: 0; }
  .main { padding: 10px 11px 40px; }
  .search-wrap { display: none; }
  .view-head h2 { font-size: 19px; }
  .three-col { grid-template-columns: 1fr; }
  .three-col > .panel:last-child { grid-column: auto; }
  .field-checks { grid-column: span 1; }
  .stock-hero { flex-direction: column; align-items: stretch; gap: 16px; padding: 15px; }
  .sh-left { min-width: 0; }
  .sh-right { width: 100%; justify-content: flex-start; gap: 16px; }
  .sh-price { font-size: 30px; }
  .grade-desc { max-width: 170px; text-align: left; }
  .grade-block { text-align: left; }
  .grade-big { margin: 0 0 5px; }
  .chart-legend { gap: 8px; font-size: 9.5px; }
  #klineCanvas { height: 296px; }
  .picks-hero { grid-template-columns: 1fr; }
  .picks-list-head, .pick-row { grid-template-columns: 22px 1fr minmax(84px, 1fr) 40px; }
  .picks-list-head > :nth-child(3), .pick-row > :nth-child(3),
  .picks-list-head > :nth-child(4), .pick-row > :nth-child(4),
  .picks-list-head > :nth-child(7), .pick-row > :nth-child(7),
  .picks-list-head > :nth-child(8), .pick-row > :nth-child(8),
  .picks-list-head > :nth-child(9), .pick-row > :nth-child(9) { display: none; }
  .index-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .ic-price { font-size: 17px; }
  .breadth-legend { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; gap: 0; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 9px; }
  .view-head h2 { font-size: 18px; }
  .stock-search { width: 100%; }
  #stockInput { flex: 1; width: auto; }
  .big-ring { width: 72px; height: 72px; }
  .big-ring-num { font-size: 20px; }
  .big-ring-sub { display: none; }
  .sh-price { font-size: 27px; }
  .sh-right { align-items: center; gap: 14px; }
  .grade-desc { max-width: 140px; font-size: 9px; }
  .chart-head { padding: 10px 13px; flex-direction: column; align-items: flex-start; gap: 7px; }
  .chart-legend { font-size: 9px; gap: 7px; width: 100%; }
  .chart-legend .cl-item:nth-child(n+4) { display: none; }
  .radar-legend { grid-template-columns: 1fr; }
  .temp-main { flex-direction: row; align-items: center; gap: 13px; }
  .temp-dial { width: 126px; flex-shrink: 0; }
  .temp-num { font-size: 23px; }
  .temp-label { font-size: 8px; }
  .temp-title { font-size: 13.5px; }
  .live-time { display: none; }
  .panel-head { padding: 10px 13px; }
  .filter-panel { padding: 13px; }
  .pick-card { padding: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════
   实时决策面板：把回测的入场闸门搬到盘中
   四种状态用左侧色条 + 徽章区分，不使用大面积底色
   ═══════════════════════════════════════════════════════════════════ */
.live-panel {
  margin-bottom: 13px;
  padding: 0;
  overflow: hidden;
  border-left: 3px solid var(--border-strong);
}
.live-panel.sig-ready   { border-left-color: var(--up); }
.live-panel.sig-armed   { border-left-color: var(--gold-2); }
.live-panel.sig-suspect { border-left-color: var(--gold); }
.live-panel.sig-blocked { border-left-color: var(--panel-4); }

.ld-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 14px 16px 10px;
}
.ld-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ld-title h3 {
  font-size: 14px; font-weight: 700; letter-spacing: -.02em;
}
.ld-sub {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-3);
  letter-spacing: .02em;
}
.ld-state { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ld-state-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: -.01em;
  border: 1px solid transparent; white-space: nowrap;
}
.ld-state-badge.sig-ready   { background: var(--up-soft); color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.ld-state-badge.sig-armed   { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold-2) 45%, transparent); }
.ld-state-badge.sig-suspect { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.ld-state-badge.sig-blocked { background: var(--panel-3); color: var(--text-2); border-color: var(--border); }
.ld-state-count {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
}

.ld-progress {
  height: 2px; background: var(--hairline); margin: 0 16px;
  border-radius: 2px; overflow: hidden;
}
.ld-progress i {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .45s cubic-bezier(.2,.8,.28,1);
}
.live-panel.sig-ready .ld-progress i { background: linear-gradient(90deg, color-mix(in srgb, var(--up) 55%, transparent), var(--up)); }
.live-panel.sig-armed .ld-progress i,
.live-panel.sig-suspect .ld-progress i { background: linear-gradient(90deg, color-mix(in srgb, var(--gold-2) 55%, transparent), var(--gold-2)); }

.ld-gates {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; margin: 12px 16px 0;
  background: var(--hairline); border: 1px solid var(--hairline);
  border-radius: var(--radius-xs); overflow: hidden;
}
.ld-gate { background: var(--panel); padding: 9px 11px 10px; min-width: 0; }
.ldg-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ldg-mark {
  width: 15px; height: 15px; border-radius: 4px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 800;
}
.ld-gate.pass .ldg-mark { background: var(--up-soft); color: var(--up); }
.ld-gate.fail .ldg-mark { background: var(--panel-3); color: var(--text-3); }
.ldg-label {
  flex: 1; font-size: 11.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ldg-val {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--text); flex-shrink: 0;
}
.ld-gate.fail .ldg-val { color: var(--text-3); }
.ldg-hint {
  font-size: 9.5px; color: var(--text-3); line-height: 1.35;
  margin-top: 3px; padding-left: 21px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
/* 暗色下 9.5px 的三级文字过暗，抬一档保证读得清 */
[data-theme="dark"] .ldg-hint { color: var(--text-2); opacity: .82; }
[data-theme="dark"] .ld-f span,
[data-theme="dark"] .ld-sub,
[data-theme="dark"] .ld-state-count { color: var(--text-2); opacity: .78; }

.ld-note {
  margin: 11px 16px 0; padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px; line-height: 1.55; color: var(--text-2);
  background: var(--panel-2);
  border-left: 2px solid var(--border-strong);
}
.ld-note.sig-ready   { background: var(--up-soft); color: var(--up); border-left-color: var(--up); }
.ld-note.sig-armed   { background: var(--gold-soft); color: var(--gold); border-left-color: var(--gold-2); }
.ld-note.sig-suspect { background: var(--gold-soft); color: var(--gold); border-left-color: var(--gold); }

.ld-foot {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 12px 16px 14px;
}
.ld-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-f span {
  font-family: var(--mono); font-size: 9px; color: var(--text-3);
  letter-spacing: .04em; text-transform: uppercase;
}
.ld-f b { font-size: 12.5px; font-weight: 650; letter-spacing: -.03em; }

/* 头部信号徽章 */
.sig-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: -.01em;
  border: 1px solid transparent;
}
.sig-badge i { font-style: normal; font-size: 8px; }
.sig-badge.sig-ready   { background: var(--up-soft); color: var(--up); border-color: color-mix(in srgb, var(--up) 26%, transparent); }
.sig-badge.sig-armed   { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold-2) 40%, transparent); }
.sig-badge.sig-suspect { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 26%, transparent); }
.sig-badge.sig-blocked { background: var(--panel-3); color: var(--text-3); border-color: var(--border); }

@media (max-width: 900px) {
  .ld-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-foot { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 620px) {
  .ld-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ld-gates { grid-template-columns: 1fr; }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
