/* ==========================================================
   大肥鱼扫描 · UI v1.0
   深海蓝 × 瓷白 · 明暗双主题 · 唯一图片源 assets/mascot.jpg
   ========================================================== */

:root {
  --bg: #f2f7fe;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #dcecff 0%, transparent 60%),
             radial-gradient(900px 500px at 0% 100%, #e6f4ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7faff;
  --surface-3: #eef5ff;
  --border: #dce8f7;
  --border-strong: #c6dbf2;
  --text: #162c4b;
  --text-2: #4b668a;
  --muted: #8299b6;
  --brand: #2e6fd6;
  --brand-deep: #1b4c9c;
  --brand-soft: #e8f1ff;
  --brand-line: rgba(46, 111, 214, .32);
  --gold: #e0a83c;
  --up: #e0454f;
  --up-soft: #fdecee;
  --down: #12a46a;
  --down-soft: #e7f8f0;
  --box: #2e6fd6;
  --channel: #8b6fe8;
  --triangle: #12a46a;
  --dow: #e0a83c;
  --shadow: 0 8px 30px rgba(20, 55, 105, .08);
  --shadow-lg: 0 24px 70px rgba(16, 44, 84, .22);
  --r-card: 16px;
  --r-ctrl: 10px;
  --r-tag: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, "Roboto Mono", monospace;
  --chart-bg: #fbfdff;
  --chart-grid: #e9f0fa;
  --chart-text: #7a93b4;
  --chart-line: #dce8f7;
  --strat-grad: linear-gradient(135deg, #3b82f0, #1b4c9c);
}

[data-theme="dark"] {
  --bg: #0b1729;
  --bg-grad: radial-gradient(1100px 600px at 85% -10%, #12325c 0%, transparent 60%),
             radial-gradient(900px 500px at 0% 100%, #102a4a 0%, transparent 55%);
  --surface: #11233d;
  --surface-2: #162b48;
  --surface-3: #1b3455;
  --border: #234066;
  --border-strong: #31537e;
  --text: #e8f2ff;
  --text-2: #a9c1de;
  --muted: #7793b5;
  --brand: #5b9bf5;
  --brand-deep: #87b8ff;
  --brand-soft: #1a355a;
  --brand-line: rgba(91, 155, 245, .38);
  --up: #ff6b73;
  --up-soft: #402028;
  --down: #2ec98a;
  --down-soft: #173b30;
  --shadow: 0 8px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
  --chart-bg: #11233d;
  --chart-grid: rgba(255, 255, 255, .07);
  --chart-text: #8ea8c9;
  --chart-line: #27436a;
  --strat-grad: linear-gradient(135deg, #5b9bf5, #2e6fd6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
button, select, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── 顶栏 ───────── */
.topbar {
  height: 68px; padding: 0 20px; display: flex; align-items: center; gap: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 262px; }
/* 顶栏头像：只取原图 (540,80)–(900,440) 的头部区域，不显示身体 */
.brand-avatar {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; position: relative;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-line), var(--shadow);
  background: #fff; --s: 42px;
}
.brand-avatar img {
  position: absolute; max-width: none;
  width: calc(var(--s) * 4); height: calc(var(--s) * 4);
  left: calc(var(--s) * -1.5); top: calc(var(--s) * -0.2222);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand-title em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .9px; font-family: var(--mono); margin-top: 3px; }
.topbar-center { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex: 1; }
.topbar-center b { font-weight: 600; color: var(--text); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 4px color-mix(in srgb, var(--down) 18%, transparent); }
.topbar-sep { color: var(--border-strong); }
#clock { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; gap: 8px; }
.tbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: var(--r-ctrl); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 600; transition: .18s;
}
.tbtn:hover { border-color: var(--brand-line); color: var(--brand); transform: translateY(-1px); }
.tbtn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.tbtn-primary:hover { background: var(--brand-deep); color: #fff; }

/* ───────── 工作区 / 侧栏 ───────── */
.workspace { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 18px; padding: 18px; align-items: start; max-width: 2100px; margin: 0 auto; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow); position: sticky; top: 86px; max-height: calc(100vh - 104px); overflow: hidden;
}
.panel-scroll { max-height: calc(100vh - 104px); overflow-y: auto; padding: 16px; }
.mascot-card {
  position: relative; height: 116px; border-radius: 14px; overflow: hidden; margin-bottom: 18px;
  background: linear-gradient(110deg, #dbeaff 0%, #eff6ff 62%, #ffffff 100%);
  border: 1px solid var(--border);
}
/* 夜间：形象卡保留浅色"立牌"质感，与白底原图自然融合，文字同步改深色 */
[data-theme="dark"] .mascot-card { background: linear-gradient(110deg, #dbeaff 0%, #eff6ff 62%, #ffffff 100%); border-color: #4a6a95; }
.mascot-card img { position: absolute; right: -22px; top: -10px; width: 268px; height: 268px; max-width: none; object-fit: cover; object-position: 50% 0%; opacity: .96; mask-image: linear-gradient(90deg, transparent 4%, #000 42%); }
.mascot-card-text { position: relative; z-index: 2; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; max-width: 62%; }
.mascot-card-text b { font-size: 15px; color: var(--brand-deep); }
[data-theme="dark"] .mascot-card-text b { color: #1b4c9c; }
[data-theme="dark"] .mascot-card-text span { color: #4b668a; }
.mascot-card-text span { font-size: 11px; color: var(--text-2); }
.ctrl-sec { margin-bottom: 18px; }
.sec-label { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }
.sec-label > span { font-family: var(--mono); color: var(--brand); background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; font-size: 10px; }
.sec-label .hint-inline { margin-left: 2px; }
.sec-label .mini-btn { margin-left: auto; }
.hint-inline { font-style: normal; font-size: 10.5px; color: var(--brand); font-weight: 600; }
.seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-ctrl); background: var(--surface-3); border: 1px solid var(--border); }
.seg-btn { flex: 1; padding: 7px 4px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: .16s; }
.seg-btn:hover { color: var(--brand); }
.seg-btn.active { background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(20, 55, 105, .12); }
[data-theme="dark"] .seg-btn.active { background: var(--brand); color: #fff; }
.seg-stack { margin-bottom: 2px; }
.seg-tri { margin-top: 8px; }
.seg-tri .seg-btn { font-size: 11px; background: var(--surface); border: 1px solid var(--border); }
.seg-tri .seg-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: none; }
.field { margin-bottom: 13px; }
.field > label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field select, .field textarea, .sort-select {
  width: 100%; padding: 9px 11px; border-radius: var(--r-ctrl); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12.5px; outline: none; transition: .16s;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.field select:focus, .field textarea:focus, .sort-select:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.field textarea { background-image: none; resize: vertical; min-height: 52px; }
.field-hint { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.info-note { font-size: 11px; color: var(--text-2); background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 9px 11px; margin-bottom: 8px; line-height: 1.55; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-2); cursor: pointer; padding: 5px 0; }
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); flex: none; position: relative; transition: .16s; }
.check-row input:checked + .checkbox { background: var(--brand); border-color: var(--brand); }
.check-row input:checked + .checkbox::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); }
.check-row input:focus-visible + .checkbox { box-shadow: 0 0 0 3px var(--brand-soft); }
.ghost-btn { border: 1px dashed var(--border-strong); color: var(--brand); border-radius: var(--r-ctrl); padding: 8px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); }
.ghost-btn:hover { background: var(--brand-soft); border-style: solid; }
.full { width: 100%; margin: 2px 0 12px; }
.btn-row { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1;
  height: 42px; border-radius: var(--r-ctrl); color: #fff; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #3b82f0, #1b4c9c); box-shadow: 0 6px 18px rgba(30, 90, 180, .25);
  transition: .18s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(30, 90, 180, .34); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }
.btn-ico { font-size: 12px; }
.btn-stop { width: 76px; border-radius: var(--r-ctrl); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; }
.btn-stop:not(:disabled):hover { border-color: var(--up); color: var(--up); }
.btn-stop:disabled { opacity: .45; cursor: default; }
.btn-compact { height: 34px; padding: 0 14px; flex: none; font-size: 12px; }
.status-box { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctrl); padding: 8px 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status-dot.ready { background: var(--down); }
.status-dot.running { background: var(--gold); animation: pulse 1.1s infinite; }
.status-dot.done { background: var(--brand); }
.status-dot.error { background: var(--up); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.progress-track { height: 4px; border-radius: 4px; background: var(--surface-3); margin: 8px 0 18px; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #7ab8f5, #2e6fd6); transition: width .25s; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.mini-btn { font-size: 10.5px; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 3px 8px; font-weight: 600; }
.mini-btn:hover { filter: brightness(.94); }
.watch-list { display: flex; flex-direction: column; gap: 5px; }
.watch-empty { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.watch-item { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; }
.watch-item b { font-family: var(--mono); font-size: 11px; flex: 1; }
.watch-item .w-dir { font-size: 10px; }
.watch-item button { color: var(--muted); font-size: 13px; }
.watch-item button:hover { color: var(--up); }
.panel-footer { border-top: 1px solid var(--border); padding-top: 12px; font-size: 10px; color: var(--muted); line-height: 1.7; }
.drawer-mask { display: none; }

/* ───────── 结果区 ───────── */
.results { min-width: 0; }
.results-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--r-card); padding: 13px 16px;
  box-shadow: var(--shadow); position: sticky; top: 86px; z-index: 20;
}
.results-title-row { display: flex; align-items: center; gap: 10px; }
.results-header h1 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.result-count { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 20px; padding: 2px 9px; }
.results-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.menu-btn { display: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.filter-chips { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-ctrl); background: var(--surface-3); border: 1px solid var(--border); }
.chip { padding: 5px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.chip.active { background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(20, 55, 105, .1); }
[data-theme="dark"] .chip.active { background: var(--brand); color: #fff; }
.sort-select { width: auto; min-width: 118px; padding: 7px 26px 7px 10px; font-size: 11.5px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.3; }
.stat-foot { font-size: 10px; color: var(--muted); }
.result-list { display: grid; grid-template-columns: 1fr; gap: 12px; align-content: start; }
@media (min-width: 1180px) { .result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .empty-state, .scanning-state { grid-column: 1 / -1; } }
@media (min-width: 1780px) { .result-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 结果卡片 */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 14px 16px 13px 18px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: .2s;
  min-height: 148px;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); opacity: .85; }
.card.dir-up::before { background: var(--up); }
.card.dir-down::before { background: var(--down); }
.card:hover { transform: translateY(-3px); border-color: var(--brand-line); box-shadow: 0 16px 38px rgba(20, 55, 105, .16); }
.card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.star { font-size: 15px; color: var(--muted); line-height: 1; padding: 0 2px; }
.star.on { color: var(--gold); }
.card-symbol { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.market-chip { font-size: 10px; font-weight: 600; color: var(--text-2); background: var(--surface-3); border-radius: var(--r-tag); padding: 2px 6px; }
.vol-tag { font-family: var(--mono); font-size: 10px; color: var(--brand); background: var(--brand-soft); border-radius: var(--r-tag); padding: 2px 6px; }
.vol-tag.weak { color: var(--muted); background: var(--surface-3); }
.card-badge { font-size: 10.5px; font-weight: 700; border-radius: var(--r-tag); padding: 2px 7px; color: #fff; background: var(--box); }
.badge { font-size: 10.5px; font-weight: 700; border-radius: var(--r-tag); padding: 2px 7px; color: #fff; background: var(--box); }
.badge.channel { background: var(--channel); } .badge.triangle { background: var(--triangle); } .badge.dow { background: var(--dow); }
.badge.res-long { background: var(--up); } .badge.res-short { background: var(--down); } .badge.harmonic { background: var(--channel); }
.dir-pill { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.dir-up .dir-pill { color: var(--up); background: var(--up-soft); }
.dir-down .dir-pill { color: var(--down); background: var(--down-soft); }
.card-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 12px 0 10px; }
.card-price { font-family: var(--mono); font-size: 21px; font-weight: 700; line-height: 1.15; }
.card-change { font-family: var(--mono); font-size: 12px; font-weight: 600; margin-top: 3px; }
.conf-wrap { min-width: 132px; flex: none; }
.conf-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.conf-head b { font-family: var(--mono); font-size: 12px; color: var(--text); }
.conf-track { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.conf-track i { display: block; height: 100%; border-radius: 5px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; padding-top: 9px; border-top: 1px dashed var(--border); font-size: 10.5px; color: var(--muted); }
.card-meta span { font-family: var(--mono); }

/* 空状态 / 扫描中 */
.empty-state {
  display: flex; align-items: center; gap: 30px; padding: 26px 34px; min-height: 420px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow);
  overflow: hidden;
}
.empty-figure { width: 260px; height: 340px; flex: none; border-radius: 20px; overflow: hidden; background: #fff; position: relative; }
.empty-figure img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.empty-figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 72%, rgba(46, 111, 214, .12)); }
.empty-copy { max-width: 460px; }
.empty-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--brand); font-weight: 700; }
.empty-copy h2 { font-size: 25px; margin: 10px 0 12px; line-height: 1.35; }
.empty-copy p { color: var(--text-2); font-size: 13px; line-height: 1.9; margin-bottom: 20px; }
.empty-copy .btn-primary { width: 168px; }
.scanning-state { display: flex; align-items: center; gap: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); }
.scanning-state img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 2px solid var(--brand-line); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.scanning-state b { font-size: 14px; }
.scanning-state p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.skeleton-card { height: 148px; border-radius: var(--r-card); border: 1px solid var(--border); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ───────── 弹窗通用 ───────── */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 24, 46, .55); backdrop-filter: blur(5px); }
.modal-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-x { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; }
.modal-x:hover { color: var(--up); border-color: var(--up); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; }
.modal-head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* 图表弹窗 */
.chart-modal { width: min(1180px, 96vw); height: min(90vh, 860px); display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chart-avatar { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex: none; background: #fff; border: 1px solid var(--border); }
.chart-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.5); }
.chart-id { flex: 1; min-width: 0; }
.chart-symbol-row { display: flex; align-items: center; gap: 8px; }
.chart-symbol-row b { font-family: var(--mono); font-size: 17px; }
.chart-price-row { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 12px; }
.chart-price-row > span:first-child { font-size: 14px; font-weight: 700; }
.chart-price-row .muted { font-size: 10.5px; }
.chart-head-actions { display: flex; align-items: center; gap: 8px; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tf-pills { display: flex; gap: 4px; overflow-x: auto; }
.tf-pills button { flex: none; padding: 5px 11px; border-radius: 7px; font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid transparent; }
.tf-pills button:hover { color: var(--brand); }
.tf-pills button.active { background: var(--brand); color: #fff; }
.ohlc-row { padding: 7px 16px; font-size: 10.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.reso-bar { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.rb-track { flex: 1; height: 7px; border-radius: 7px; background: linear-gradient(90deg, var(--up-soft), var(--surface-3) 50%, var(--down-soft)); position: relative; border: 1px solid var(--border); }
.rb-track i { position: absolute; top: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); box-shadow: var(--shadow); left: 50%; transform: translateX(-50%); transition: left .4s; }
.rb-votes { font-size: 11px; color: var(--text-2); }
.rb-state { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--surface-3); padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.chart-body { position: relative; flex: 1; min-height: 220px; background: var(--chart-bg); }
.chart-canvas { position: absolute; inset: 0; }
.chart-watermark { position: absolute; right: 18px; bottom: 10px; width: 130px; height: 170px; object-fit: cover; object-position: 50% 15%; opacity: .1; pointer-events: none; mix-blend-mode: screen; }
.chart-foot { display: flex; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; }
.signal-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; flex: 1; }
.signal-kv div { display: flex; flex-direction: column; gap: 2px; }
.signal-kv span { font-size: 10px; color: var(--muted); }
.signal-kv b { font-family: var(--mono); font-size: 12px; }
.chart-note { display: flex; align-items: center; gap: 9px; max-width: 290px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.chart-note img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; flex: none; }
.chart-note p { font-size: 10.5px; color: var(--text-2); line-height: 1.5; }
.chart-note b { color: var(--brand); }

/* 共振设置 */
.reso-modal { width: min(560px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.reso-scroll { overflow-y: auto; padding: 16px 20px; }
.reso-scroll .field { margin-bottom: 14px; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.opt-rows { border: 1px solid var(--border); border-radius: var(--r-ctrl); padding: 6px 12px; margin-bottom: 16px; background: var(--surface-2); }
.ind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.ind-actions { display: flex; gap: 5px; }
.ind-group { margin-bottom: 12px; }
.ind-group-title { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ind-group-title i { width: 7px; height: 7px; border-radius: 50%; }
.ind-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.ind-item { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11px; cursor: pointer; }
.ind-item.off { opacity: .48; }
.ind-item .checkbox { width: 14px; height: 14px; }
.ind-item input:checked + .checkbox::after { left: 3.5px; top: 0px; width: 4px; height: 8px; }
.ind-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 设计规范抽屉 */
.spec-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(600px, 96vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .24s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: .5; } }
.spec-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.spec-head h2 { font-size: 19px; margin-top: 6px; }
.spec-scroll { overflow-y: auto; padding: 20px 24px 40px; }
.spec-sec { margin-bottom: 26px; }
.spec-sec h3 { font-size: 12px; color: var(--brand); letter-spacing: .5px; margin-bottom: 9px; }
.spec-sec > p { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.spec-sec code { font-family: var(--mono); font-size: 11px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--brand); }
.spec-note { font-size: 10.5px !important; color: var(--muted) !important; margin-top: 8px; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.spec-grid > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.spec-grid span { font-size: 10px; color: var(--muted); }
.spec-grid b { font-size: 11px; font-weight: 600; }

/* ───────── 响应式 ───────── */
@media (max-width: 1100px) {
  .topbar-center { display: none; }
  .brand { flex: 1; }
  .workspace { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .panel { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(336px, 88vw); max-height: none; border-radius: 0 18px 18px 0; transform: translateX(-102%); transition: transform .24s; box-shadow: var(--shadow-lg); }
  .panel.open { transform: none; }
  .panel-scroll { max-height: 100vh; height: 100%; }
  .drawer-mask.show { display: block; position: fixed; inset: 0; background: rgba(8, 24, 46, .5); z-index: 45; }
  .menu-btn { display: block; }
  .results-header { top: 68px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .signal-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; height: 60px; gap: 8px; }
  .brand-title { font-size: 15px; } .brand-sub, .tbtn span { display: none; }
  .tbtn { padding: 0 9px; }
  .results-header { top: 60px; padding: 10px; }
  .results-header h1 { font-size: 15px; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .filter-chips { flex: 1; min-width: 0; overflow-x: auto; }
  .chip { padding: 5px 9px; flex: none; white-space: nowrap; }
  .sort-select { min-width: 96px; }
  .empty-state { flex-direction: column; padding: 18px; min-height: 0; gap: 12px; }
  .empty-figure { width: 100%; height: 220px; }
  .empty-figure img { object-position: 50% 10%; }
  .empty-copy h2 { font-size: 20px; }
  .chart-modal { height: 96vh; width: 100vw; border-radius: 0; }
  .chart-foot { flex-direction: column; align-items: stretch; }
  .chart-note { max-width: none; }
  .tf-pills button { padding: 5px 8px; }
  .spec-grid, .ind-items { grid-template-columns: 1fr; }
  .modal { padding: 0; }
}

/* ==========================================================
   v1.1.0 · 策略交互样式重做
   统一语言：蓝渐变选中态 / 浅色图表台 / 精简数据芯片
   ========================================================== */

/* 顶栏版本号 */
.ver-pill {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 2px 7px; border-radius: 5px; margin-left: 4px; vertical-align: 2px; transition: .16s;
}
.ver-pill:hover { background: var(--brand); color: #fff; }

/* 市场 / 策略分段控件 */
.ctrl-sec .seg { background: var(--surface-2); border: 1px solid var(--border); padding: 4px; gap: 4px; border-radius: 12px; }
.ctrl-sec .seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 3px; border-radius: 9px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; color: var(--text-2);
}
.ctrl-sec .seg-btn i { font-style: normal; font-family: var(--mono); font-size: 11px; opacity: .7; }
.ctrl-sec .seg-btn:hover { background: var(--brand-soft); color: var(--brand); }
.ctrl-sec .seg-btn.active {
  background: var(--strat-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(30, 90, 180, .26);
}
.ctrl-sec .seg-btn.active i { opacity: 1; }
[data-theme="dark"] .ctrl-sec .seg-btn.active { background: var(--strat-grad); color: #fff; }
.strategy-desc { font-size: 10.5px; color: var(--muted); margin: 8px 0 0 2px; line-height: 1.5; }
.seg-tri .seg-btn { padding: 7px 3px; font-size: 11px; }
.seg-tri .seg-btn.active { background: var(--strat-grad); color: #fff; border-color: transparent; box-shadow: none; }

/* 筛选 / 排序 */
.filter-chips { background: var(--surface-2); border-color: var(--border); }
.chip.active { background: var(--strat-grad); color: #fff; box-shadow: 0 3px 10px rgba(30, 90, 180, .22); }
[data-theme="dark"] .chip.active { background: var(--strat-grad); color: #fff; }
.sort-select { font-weight: 600; }

/* 图表弹窗：整体浅色台面 */
.chart-modal { background: var(--surface); }
.chart-head { background: var(--surface); }
.chart-toolbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tf-group { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tool-label { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: var(--muted); }
.tf-pills { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); }
.tf-pills button { padding: 5px 10px; border-radius: 7px; font-size: 11px; font-weight: 600; color: var(--text-2); border: 1px solid transparent; }
.tf-pills button:hover { color: var(--brand); }
.tf-pills button.active { background: var(--strat-grad); color: #fff; box-shadow: 0 3px 10px rgba(30, 90, 180, .24); }
.reso-verdict {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 6px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-2);
}
.reso-verdict .rv-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.reso-verdict.long { color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, var(--border)); background: var(--up-soft); }
.reso-verdict.long .rv-dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.reso-verdict.short { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, var(--border)); background: var(--down-soft); }
.reso-verdict.short .rv-dot { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }

/* OHLC 数据芯片 */
.ohlc-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ohlc-item { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.ohlc-item span { font-size: 10px; color: var(--muted); }
.ohlc-item b { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.ohlc-item.hl b { color: var(--brand); }

/* 多空力量条 */
.reso-bar { padding: 10px 16px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.rb-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rb-title { font-size: 11px; font-weight: 700; }
.rb-title em { font-style: normal; font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.rb-votes { margin-left: auto; font-size: 11px; color: var(--text-2); }
.rb-state { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--surface-3); color: var(--muted); }
.rb-track {
  position: relative; height: 9px; border-radius: 9px; border: 1px solid var(--border);
  background: linear-gradient(90deg, color-mix(in srgb, var(--up) 60%, var(--surface-3)) 0%, var(--surface-3) 46%, var(--surface-3) 54%, color-mix(in srgb, var(--down) 60%, var(--surface-3)) 100%);
}
.rb-track i { position: absolute; top: -4px; width: 4px; height: 15px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); left: 50%; transform: translateX(-50%); transition: left .4s; }
.rb-scale { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9.5px; color: var(--muted); }

/* 图表区：浅色底 + 自定义图例 */
.chart-body { background: var(--chart-bg); }
.chart-legend { position: absolute; left: 14px; top: 12px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.chart-legend span {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border);
  font-size: 10px; color: var(--text-2); box-shadow: var(--shadow);
}
.chart-legend b { color: var(--text); font-size: 10px; }
.lg-dash { width: 12px; border-top: 2px dashed var(--up); }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.chart-watermark { opacity: .07; mix-blend-mode: normal; }

/* 底部信号档案 */
.chart-foot { align-items: stretch; }
.signal-panel { flex: 1; min-width: 0; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; margin-bottom: 8px; }
.panel-title span { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--muted); font-weight: 500; }
.signal-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.signal-kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.signal-kv b { font-size: 11px; }
.chart-note { border-radius: 12px; background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); border-color: var(--brand-line); }

/* 共振设置：滑杆 / 指标开关 */
input[type="range"] { height: 6px; border-radius: 6px; background: var(--surface-3); appearance: none; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--strat-grad); border: 2px solid var(--surface); box-shadow: 0 2px 8px rgba(30, 90, 180, .35); }
.ind-item { border-radius: 9px; }
.ind-item:not(.off) { border-color: var(--brand-line); background: var(--brand-soft); }
.ind-item.off { background: var(--surface); }
.opt-rows { border-radius: 12px; }

/* 版本历史面板 */
.version-current { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); border: 1px solid var(--brand-line); }
.version-current b { font-family: var(--mono); font-size: 22px; color: var(--brand-deep); }
.version-current div { display: flex; flex-direction: column; gap: 2px; }
.version-current span { font-size: 11px; color: var(--text-2); }
.version-current small { font-size: 10px; color: var(--muted); }
.version-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--surface-2); }
.version-card.is-current { border-color: var(--brand-line); background: var(--brand-soft); }
.version-card-head { display: flex; align-items: center; gap: 8px; }
.version-card-head b { font-family: var(--mono); font-size: 13px; }
.version-card-head span { font-size: 11px; color: var(--text-2); }
.version-card-head time { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.vtag { font-size: 9px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 4px; padding: 1px 6px; }
.version-card ul { margin: 8px 0 0 16px; }
.version-card li { font-size: 10.5px; color: var(--text-2); line-height: 1.75; }
.snapshot-links { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.snapshot-links a { font-family: var(--mono); font-size: 9.5px; color: var(--brand); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; text-decoration: none; }
.snapshot-links a:hover { border-color: var(--brand-line); }

@media (max-width: 640px) {
  .chart-toolbar { flex-wrap: wrap; gap: 8px; }
  .reso-verdict { margin-left: 0; }
  .tf-pills button { padding: 5px 8px; }
  .signal-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-legend { gap: 4px; }
  .chart-legend span { padding: 3px 6px; font-size: 9px; }
}

/* v1.4.0 · 无真实 K 线时的空图表提示（不再生成模拟数据） */
.chart-no-data {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.chart-no-data span { font-size: 11px; font-weight: 400; color: var(--muted); }

/* ==========================================================
   v1.6.0 · 策略图层与图表交互升级
   ========================================================== */
.chart-modal::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #7ab8f5, #2e6fd6, #8b6fe8); z-index: 3; }
.chart-toolbar { flex-wrap: wrap; gap: 8px 10px; padding: 9px 16px; }
.tf-group { flex: 1 1 auto; }
.layer-chips { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); overflow-x: auto; }
.layer-chip { flex: none; padding: 5px 9px; border-radius: 7px; font-size: 10.5px; font-weight: 600; color: var(--text-2); border: 1px solid transparent; white-space: nowrap; transition: .16s; }
.layer-chip:hover { color: var(--brand); background: var(--surface); }
.layer-chip.active { background: var(--strat-grad); color: #fff; box-shadow: 0 2px 8px rgba(30, 90, 180, .2); }
.tool-btn { flex: none; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 10.5px; font-weight: 600; transition: .16s; }
.tool-btn:hover { border-color: var(--brand-line); color: var(--brand); transform: translateY(-1px); }
.strategy-chip { font-size: 10px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 2px 8px; border-radius: 5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-title em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 5px; }
.chart-legend .lg-zone { width: 13px; height: 9px; border-radius: 2px; background: rgba(139, 111, 232, .18); border: 1px solid rgba(139, 111, 232, .7); }
.chart-legend .lg-band { width: 13px; height: 6px; border-radius: 2px; background: linear-gradient(90deg, var(--up) 0 33%, #c9d7e8 33% 66%, var(--down) 66%); }
.chart-legend span { backdrop-filter: blur(6px); transition: .16s; }
.chart-legend span:hover { border-color: var(--brand-line); }
.ohlc-item { transition: .16s; }
.ohlc-item:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.signal-kv div { transition: .16s; }
.signal-kv div:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.chart-note { border-left: 3px solid var(--brand); }
.rb-track i { transition: left .45s cubic-bezier(.22, 1, .36, 1); }

@media (max-width: 640px) {
  .chart-toolbar { gap: 6px; }
  .layer-chip { padding: 4px 7px; font-size: 10px; }
  .tool-btn { padding: 0 7px; }
  .strategy-chip { max-width: 150px; }
}
