/* =============================================================================
   FIB 终端 · 样式
   ========================================================================== */

:root {
  --bg: #07090c;
  --bg-soft: #0b0e13;
  --panel: #0e1218;
  --panel-2: #121821;
  --line: #1b222d;
  --line-soft: #151b24;
  --text: #e8eef5;
  --text-dim: #9aa7b8;
  --muted: #66748a;
  --up: #0ecb81;
  --up-soft: rgba(14, 203, 129, .12);
  --down: #f6465d;
  --down-soft: rgba(246, 70, 93, .12);
  --gold: #f0b90b;
  --gold-soft: rgba(240, 185, 11, .1);
  --blue: #4a9eff;
  --purple: #b07cff;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232c39; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2f3a4a; }

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr) 378px;
  grid-template-rows: 58px 48px minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "sent sent sent"
    "left center right";
  background:
    radial-gradient(1200px 600px at 50% -20%, rgba(74, 158, 255, .06), transparent 60%),
    var(--bg);
}

/* ───────────────────────── 顶栏 ───────────────────────── */
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  background: linear-gradient(180deg, #0d1117, #0a0d12);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #f7d060, #e0a800);
  color: #1a1200;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 0 18px rgba(240, 185, 11, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: 10.5px; letter-spacing: .5px; }

.symbols { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 10px; border: 1px solid var(--line-soft); }
.sym-tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
  letter-spacing: .2px;
}
.sym-tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.sym-tab.active { background: linear-gradient(180deg, #1c2532, #161d27); color: #fff; box-shadow: inset 0 0 0 1px #2a3646, 0 2px 8px rgba(0,0,0,.4); }
.sym-tab .px { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); font-weight: 500; }
.sym-tab.up .px { color: var(--up); }
.sym-tab.down .px { color: var(--down); }

.status { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.status-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.status-item b { color: var(--text-dim); font-family: var(--mono); font-weight: 500; font-size: 11.5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 8px var(--up); }
.dot.warn { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot.bad { background: var(--down); box-shadow: 0 0 8px var(--down); }
#connDot { animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ───────────────────────── 通用面板 ───────────────────────── */
.col-left, .col-right {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: 0;
}
.col-left { border-right: 1px solid var(--line); padding: 10px; gap: 10px; overflow-y: auto; }
.col-right { border-left: 1px solid var(--line); }

.panel {
  background: linear-gradient(180deg, var(--panel), #0c1016);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px;
  flex: none;
}
.panel.grow { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.panel-head h2 {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
}
.tag {
  font-size: 9.5px; padding: 2px 6px; border-radius: 4px;
  background: var(--gold-soft); color: var(--gold);
  font-weight: 700; letter-spacing: .8px;
  border: 1px solid rgba(240,185,11,.25);
}
.tag.ghost { background: rgba(255,255,255,.03); color: var(--muted); border-color: var(--line); }

.mini-btn {
  background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--muted); cursor: pointer;
  width: 24px; height: 22px; font-size: 11px; line-height: 1;
}
.mini-btn:hover { color: var(--text); border-color: #2c3644; }

/* ───────────────────────── 自选 ───────────────────────── */
.watch { display: flex; flex-direction: column; gap: 2px; }
.w-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.w-row:hover { background: rgba(255,255,255,.025); }
.w-row.active { background: rgba(74,158,255,.07); border-color: rgba(74,158,255,.22); }
.w-name { font-weight: 650; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.w-name span { color: var(--muted); font-size: 10px; font-weight: 500; }
.w-price { font-family: var(--mono); font-size: 13px; text-align: right; font-weight: 600; }
.w-chg { font-family: var(--mono); font-size: 11px; text-align: right; }
.w-chg.up, .w-price.up { color: var(--up); }
.w-chg.down, .w-price.down { color: var(--down); }
.w-spark { grid-column: 1 / -1; height: 22px; margin-top: 2px; }

/* ───────────────────────── 合约情绪 ───────────────────────── */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-radius: 8px; overflow: hidden; }
.metric { background: var(--panel); padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.metric label { font-size: 10px; color: var(--muted); letter-spacing: .4px; }
.metric b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.metric i { font-size: 9.5px; color: var(--muted); font-style: normal; font-family: var(--mono); }
.metric b.up { color: var(--up); } .metric b.down { color: var(--down); }

/* ───────────────────────── 日志 ───────────────────────── */
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 11px; min-height: 60px; }
.log-item {
  display: grid; grid-template-columns: 44px 1fr;
  gap: 6px; padding: 6px 7px; border-radius: 6px;
  background: rgba(255,255,255,.02);
  border-left: 2px solid var(--line);
  animation: slideIn .3s ease;
}
.log-item.long { border-left-color: var(--up); background: var(--up-soft); }
.log-item.short { border-left-color: var(--down); background: var(--down-soft); }
.log-item .t { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.log-item .m { color: var(--text-dim); line-height: 1.45; }
.log-item .m b { color: var(--text); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.src-list { display: flex; flex-direction: column; gap: 7px; }
.src-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); }
.src-row span { flex: 1; }
.src-row b { font-family: var(--mono); font-size: 10px; color: var(--muted); font-weight: 500; }

/* ───────────────────────── 中栏 ───────────────────────── */
.col-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.chart-toolbar {
  height: 42px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,13,18,.6);
}
.tf-group { display: flex; gap: 2px; }
.tf-btn {
  background: transparent; border: 0; color: var(--muted);
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 5px 9px; border-radius: 5px; cursor: pointer;
}
.tf-btn:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tf-btn.active { color: #0b0e13; background: var(--gold); }

.tool-sep { width: 1px; height: 18px; background: var(--line); }
.tools { display: flex; gap: 2px; }
.tool-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 500;
  padding: 4px 8px; border-radius: 5px; cursor: pointer;
}
.tool-btn:hover { color: var(--text); border-color: var(--line); }
.tool-btn.active { color: var(--blue); border-color: rgba(74,158,255,.3); background: rgba(74,158,255,.08); }
.tool-btn.on { color: var(--gold); border-color: rgba(240,185,11,.35); background: var(--gold-soft); }
.spacer { flex: 1; }
.chart-hint { font-size: 10px; color: #3d4859; font-family: var(--mono); }

.chart-wrap { position: relative; flex: 1; min-height: 0; }
#chartCanvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.chart-wrap.drawing #chartCanvas { cursor: cell; }

.chart-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 10px; background: rgba(7,9,12,.78); color: var(--text-dim); font-size: 12px;
  backdrop-filter: blur(2px); z-index: 5;
}
.chart-loading.hide { display: none; }
.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #26303d; border-top-color: var(--gold);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.draw-tip {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(240,185,11,.14); border: 1px solid rgba(240,185,11,.4);
  color: var(--gold); padding: 6px 14px; border-radius: 20px;
  font-size: 11.5px; display: none; z-index: 6; pointer-events: none;
}
.draw-tip.show { display: block; }

.ohlc-strip {
  height: 30px; flex: none;
  display: flex; align-items: center; gap: 18px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  overflow: hidden; white-space: nowrap;
}
.ohlc-strip b { color: var(--text-dim); font-weight: 500; }
.ohlc-strip .up { color: var(--up); } .ohlc-strip .down { color: var(--down); }

/* ───────────────────────── 右栏 · 信号 ───────────────────────── */
.sig-panel { border-color: #202a37; background: linear-gradient(180deg, #101722, #0b0f15); }

.sig-body .empty, .empty { color: var(--muted); font-size: 11.5px; text-align: center; padding: 22px 8px; line-height: 1.6; }
.empty.small { padding: 12px 6px; font-size: 11px; }

.sig-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ring { position: relative; width: 62px; height: 62px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring-val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 17px; font-weight: 700;
}
.ring-val small { font-size: 9px; color: var(--muted); margin-left: 1px; }

.sig-meta { flex: 1; min-width: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 12px;
  letter-spacing: .5px;
}
.badge.long { background: var(--up-soft); color: var(--up); border: 1px solid rgba(14,203,129,.3); }
.badge.short { background: var(--down-soft); color: var(--down); border: 1px solid rgba(246,70,93,.3); }
.badge.none { background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--line); }
.sig-sub { font-size: 10.5px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.badge-none {
  display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 4px;
  background: rgba(240,185,11,.12); color: var(--gold); font-size: 9.5px;
  vertical-align: middle; border: 1px solid rgba(240,185,11,.25);
}
.stale-note {
  font-size: 10px; line-height: 1.5; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(240,185,11,.2);
  border-radius: 6px; padding: 6px 8px; margin-bottom: 9px;
}

.ladder { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.ladder-item {
  background: rgba(255,255,255,.025); border: 1px solid var(--line-soft);
  border-radius: 7px; padding: 6px 9px;
}
.ladder-item label { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .5px; margin-bottom: 2px; }
.ladder-item b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ladder-item.entry b { color: var(--blue); }
.ladder-item.stop b { color: var(--down); }
.ladder-item.tp b { color: var(--up); }
.ladder-item span { font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-left: 4px; }

.reasons { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.reason { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.reason .ico { width: 13px; height: 13px; border-radius: 4px; display: grid; place-items: center; font-size: 9px; flex: none; }
.reason.on .ico { background: rgba(14,203,129,.16); color: var(--up); }
.reason.off .ico { background: rgba(255,255,255,.05); color: #4a5566; }
.reason.on { color: var(--text-dim); }
.reason .pts { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: #4d5a6d; }

.hitrate {
  border-top: 1px dashed var(--line); padding-top: 9px;
  display: flex; align-items: baseline; gap: 8px;
}
.hitrate label { font-size: 10px; color: var(--muted); }
.hitrate b { font-family: var(--mono); font-size: 15px; color: var(--gold); }
.hitrate span { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }

/* ───────────────────────── 斐波那契表 ───────────────────────── */
.fib-table { display: flex; flex-direction: column; font-size: 11px; }
.fib-row {
  display: grid; grid-template-columns: 52px 1fr 62px;
  align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 5px;
  font-family: var(--mono);
}
.fib-row:hover { background: rgba(255,255,255,.03); }
.fib-row .r { color: var(--muted); font-size: 10.5px; }
.fib-row .p { font-weight: 600; }
.fib-row .d { text-align: right; color: var(--muted); font-size: 10px; }
.fib-row.gold .r { color: var(--gold); }
.fib-row.gold .p { color: var(--gold); }
.fib-row.ext .p { color: var(--purple); }
.fib-row.near { background: rgba(240,185,11,.07); box-shadow: inset 0 0 0 1px rgba(240,185,11,.2); }
.fib-row.zone { background: rgba(240,185,11,.04); }

/* ───────────────────────── 回测 ───────────────────────── */
.bt-controls { display: grid; grid-template-columns: 44px 1fr 44px 1fr; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.bt-controls label { font-size: 10px; color: var(--muted); }
.bt-controls select {
  background: var(--bg-soft); color: var(--text-dim); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 11px; width: 100%;
}
.run-btn {
  grid-column: 1 / -1; margin-top: 2px;
  background: linear-gradient(180deg, #1d2836, #172029);
  border: 1px solid #2a3646; color: var(--text);
  border-radius: 7px; padding: 7px; font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.run-btn:hover { border-color: var(--gold); color: var(--gold); }

.bt-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--line-soft); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.bt-stat { background: var(--panel); padding: 7px 8px; }
.bt-stat label { display: block; font-size: 9px; color: var(--muted); letter-spacing: .4px; margin-bottom: 1px; }
.bt-stat b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.bt-stat b.up { color: var(--up); } .bt-stat b.down { color: var(--down); } .bt-stat b.gold { color: var(--gold); }

.eq-canvas { width: 100%; height: 54px; display: block; margin-bottom: 6px; }
.bt-note { font-size: 9.5px; color: var(--muted); line-height: 1.5; }

/* ───────────────────────── 真相 ───────────────────────── */
.truth-body p { font-size: 11px; color: var(--text-dim); line-height: 1.65; margin-bottom: 8px; }
.truth-body em { color: var(--gold); font-style: normal; }
.formula {
  font-family: var(--mono); font-size: 10.5px; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(240,185,11,.2);
  padding: 7px 9px; border-radius: 6px; margin-bottom: 9px; text-align: center;
}
.truth-table { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-bottom: 9px; font-family: var(--mono); }
.truth-table th { text-align: right; color: var(--muted); font-weight: 500; padding: 3px 4px; border-bottom: 1px solid var(--line); font-size: 9.5px; }
.truth-table th:first-child, .truth-table td:first-child { text-align: left; }
.truth-table td { padding: 3px 4px; text-align: right; color: var(--text-dim); }
.truth-table tr.hl td { color: var(--gold); }
.measured {
  font-size: 10px; line-height: 1.6; color: var(--text-dim);
  background: rgba(246,70,93,.06);
  border-left: 2px solid var(--down);
  padding: 6px 8px; border-radius: 0 5px 5px 0;
  margin-bottom: 8px; font-family: var(--mono);
}
.measured.ok { background: rgba(14,203,129,.06); border-left-color: var(--up); }
.fine { font-size: 9.5px !important; color: #4d5a6d !important; }

/* ───────────────────────── 响应式 ───────────────────────── */
@media (max-width: 1400px) {
  .app { grid-template-columns: 232px minmax(0, 1fr) 340px; }
}
@media (max-width: 1200px) {
  .app { grid-template-columns: 210px minmax(0, 1fr) 310px; font-size: 12px; }
  .chart-hint { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   v2 · 标签页 / 指标 / 共振 / 风控 / 扫描 / 设置
   ═══════════════════════════════════════════════════════════════════ */

.icon-btn {
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 14px; line-height: 1;
  display: grid; place-items: center;
}
.icon-btn:hover { color: var(--gold); border-color: rgba(240,185,11,.4); }

.tabs {
  display: flex; flex: none; height: 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,13,18,.7);
}
.tabs button {
  flex: 1; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px; min-height: 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ── 信号卡 ── */
.sig-body .sig-head { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.entry-plan {
  border-radius: 8px; padding: 9px 10px; margin-bottom: 9px;
  background: rgba(74,158,255,.06); border: 1px solid rgba(74,158,255,.22);
}
.entry-plan.market { background: var(--up-soft); border-color: rgba(14,203,129,.3); }
.entry-plan.limit { background: var(--gold-soft); border-color: rgba(240,185,11,.3); }
.entry-plan.breakout { background: rgba(176,124,255,.07); border-color: rgba(176,124,255,.28); }
.entry-plan .ep-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.entry-plan .ep-mode { font-size: 10px; font-weight: 700; letter-spacing: .8px; color: var(--blue); }
.entry-plan.market .ep-mode { color: var(--up); }
.entry-plan.limit .ep-mode { color: var(--gold); }
.entry-plan.breakout .ep-mode { color: var(--purple); }
.entry-plan .ep-price { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.entry-plan .ep-note { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

.grade-badge {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  border-radius: 5px; font-size: 10px; font-weight: 800; margin-left: 6px;
  background: rgba(240,185,11,.14); color: var(--gold); vertical-align: middle;
}

.factor-list { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.factor-row {
  display: grid; grid-template-columns: 16px 82px 1fr 42px;
  align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px;
  font-size: 10.5px; color: var(--muted);
}
.factor-row:hover { background: rgba(255,255,255,.03); }
.factor-row.on { color: var(--text-dim); }
.factor-row .fr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.factor-row .fr-bar { height: 4px; background: #1a2230; border-radius: 3px; overflow: hidden; }
.factor-row .fr-fill { height: 100%; border-radius: 3px; background: #33415a; }
.factor-row.on .fr-fill { background: linear-gradient(90deg, #0e8f60, var(--up)); }
.factor-row .fr-pts { font-family: var(--mono); text-align: right; font-size: 9.5px; color: #4d5a6d; }
.factor-row .fr-ico { font-size: 9px; text-align: center; }

/* ── 指标页 ── */
.ind-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ind-score { font-family: var(--mono); font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1; }
.ind-meta { font-size: 11px; color: var(--text-dim); }
.ind-list { display: flex; flex-direction: column; gap: 3px; }
.ind-row { padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.02); border-left: 2px solid #26303d; }
.ind-row.on { border-left-color: var(--up); background: rgba(14,203,129,.05); }
.ind-row .ir-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ind-row .ir-name { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.ind-row.on .ir-name { color: var(--text); }
.ind-row .ir-pts { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.ind-row .ir-detail { font-size: 10px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.ind-row .ir-track { height: 3px; background: #161d27; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.ind-row .ir-fill { height: 100%; background: #2b3a50; }
.ind-row.on .ir-fill { background: var(--up); }
.ind-note { margin-top: 10px; line-height: 1.6; }

/* ── 共振页 ── */
.conf-tfs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.conf-tf {
  background: rgba(255,255,255,.025); border: 1px solid var(--line-soft);
  border-radius: 7px; padding: 7px 9px;
}
.conf-tf .ct-tf { font-size: 9.5px; color: var(--muted); letter-spacing: .6px; }
.conf-tf .ct-dir { font-size: 12px; font-weight: 700; margin-top: 2px; }
.conf-tf .ct-dir.up { color: var(--up); } .conf-tf .ct-dir.down { color: var(--down); }
.conf-tf .ct-meta { font-size: 9.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.panel-sub { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin: 4px 0 6px; }
.conf-zone {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px;
  padding: 7px 9px; border-radius: 6px; margin-bottom: 4px;
  background: rgba(240,185,11,.05); border: 1px solid rgba(240,185,11,.16);
}
.conf-zone.strong { background: rgba(240,185,11,.1); border-color: rgba(240,185,11,.32); }
.conf-zone .cz-price { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gold); }
.conf-zone .cz-tfs { font-size: 9.5px; color: var(--gold); opacity: .8; text-align: right; }
.conf-zone .cz-ratios { grid-column: 1 / -1; font-size: 9px; color: var(--muted); font-family: var(--mono); }

/* ── 风控页 ── */
.risk-form { display: grid; grid-template-columns: 60px 1fr; gap: 6px 8px; align-items: center; margin-bottom: 9px; }
.risk-form label { font-size: 10.5px; color: var(--muted); }
.risk-form input, .risk-form select {
  background: #0b1017; border: 1px solid #2a3648; border-radius: 6px;
  color: var(--text); padding: 5px 7px; font: inherit; font-size: 11.5px; font-family: var(--mono); width: 100%;
}
.risk-form input:focus, .risk-form select:focus { outline: none; border-color: rgba(240,185,11,.5); }
.risk-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-radius: 8px; overflow: hidden; margin: 8px 0; }
.risk-cell { background: var(--panel); padding: 7px 9px; }
.risk-cell label { display: block; font-size: 9px; color: var(--muted); margin-bottom: 1px; }
.risk-cell b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.risk-cell b.up { color: var(--up); } .risk-cell b.down { color: var(--down); } .risk-cell b.gold { color: var(--gold); }
.risk-verdict { grid-column: 1 / -1; background: var(--panel); padding: 8px 9px; font-size: 10.5px; line-height: 1.55; color: var(--text-dim); }
.ghost-btn {
  width: 100%; margin-top: 7px; background: transparent; border: 1px solid var(--line);
  color: var(--text-dim); border-radius: 7px; padding: 6px; font: inherit; font-size: 11px; cursor: pointer;
}
.ghost-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── 资金费率曲线 ── */
.fund-canvas { width: 100%; height: 34px; display: block; margin-top: 8px; }
.fund-label { font-size: 9px; color: var(--muted); margin-top: 2px; }

/* ── 模态框 ── */
.modal {
  position: fixed; inset: 0; background: rgba(3,5,8,.72); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal.show { display: flex; }
.modal-box {
  width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - 60px);
  background: linear-gradient(180deg, #141a24, #0e131b);
  border: 1px solid #2c384a; border-radius: 12px; padding: 18px;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal-box.wide { width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.modal-head h3 .fine { font-weight: 400; margin-left: 8px; }
.set-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.set-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.set-section h4 { font-size: 11px; color: var(--gold); margin-bottom: 9px; letter-spacing: .5px; }
.set-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.set-row input[type=text], .set-row input:not([type]) {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 6px 8px; font: inherit; font-size: 11.5px;
}
.set-row .ghost-btn { width: auto; margin: 0; padding: 6px 12px; flex: none; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); flex: 1; }
.switch input { width: 14px; height: 14px; accent-color: var(--gold); }
code { background: #121821; padding: 1px 4px; border-radius: 3px; font-size: 10px; color: var(--gold); }

/* ── 扫描器 ── */
.scan-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.scan-controls label { font-size: 10px; color: var(--muted); }
.scan-controls select { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); padding: 4px 6px; font: inherit; font-size: 11px; }
.scan-controls .run-btn { width: auto; margin: 0; padding: 6px 14px; }
.scan-progress { flex: 1; min-width: 80px; height: 4px; background: #161d27; border-radius: 3px; overflow: hidden; }
.scan-progress > div { height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.scan-table-wrap { max-height: 62vh; overflow-y: auto; border-radius: 8px; border: 1px solid var(--line-soft); }
.scan-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.scan-table th {
  position: sticky; top: 0; background: #10151d; color: var(--muted);
  font-weight: 500; font-size: 9.5px; text-align: left; padding: 7px 8px;
  border-bottom: 1px solid var(--line); z-index: 2;
}
.scan-table td { padding: 6px 8px; border-bottom: 1px solid #121821; font-family: var(--mono); color: var(--text-dim); }
.scan-table tbody tr { cursor: pointer; }
.scan-table tbody tr:hover { background: rgba(240,185,11,.06); }
.scan-table .st-good { color: var(--up); } .scan-table .st-watch { color: var(--gold); } .scan-table .st-bad { color: var(--muted); }
.scan-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 11.5px; }

/* ── 响应式 ── */
@media (max-width: 1500px) {
  .app { grid-template-columns: 236px minmax(0,1fr) 348px; }
}
@media (max-width: 1280px) {
  .app { grid-template-columns: 214px minmax(0,1fr) 322px; font-size: 12px; }
  .chart-hint { display: none; }
  .tools .tool-btn { padding: 4px 6px; font-size: 10.5px; }
}
@media (max-width: 1024px) {
  body { overflow: auto; }
  .app {
    display: flex; flex-direction: column; height: auto; min-height: 100vh;
  }
  .col-center { order: 1; }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .topbar { position: sticky; top: 0; height: auto; flex-wrap: wrap; gap: 10px; padding: 8px 10px; }
  .status { margin-left: 0; width: 100%; justify-content: space-between; }
  .col-left, .col-center, .col-right { border: 0; width: 100%; }
  .col-left { padding: 8px; }
  .col-center { height: 430px; }
  .chart-wrap { height: 340px; flex: none; }
  .col-right { margin-top: 8px; }
  .tab-body { max-height: none; overflow: visible; }
  .watch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .w-spark { display: none; }
  .panel.grow { min-height: 0; }
  .log { max-height: 180px; }
}

.truth-mini { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.truth-mini summary {
  cursor: pointer; font-size: 10.5px; color: var(--gold); font-weight: 600;
  list-style: none; letter-spacing: .3px;
}
.truth-mini summary::-webkit-details-marker { display: none; }
.truth-mini summary::before { content: '▸ '; }
.truth-mini[open] summary::before { content: '▾ '; }

/* ── 自选列表限高 & 顶部标签横向滚动 ── */
.watch { max-height: 286px; overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.symbols { overflow-x: auto; overflow-y: hidden; max-width: 54vw; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.symbols::-webkit-scrollbar { display: none; }
.sym-tab { flex: none; }
@media (max-width: 1024px) { .symbols { max-width: 100%; } .watch { max-height: none; } }

/* ── 价格预警 / 样本外 ── */
.icon-btn { position: relative; }
.badge-count {
  position: absolute; top: -5px; right: -5px; min-width: 14px; height: 14px;
  padding: 0 3px; border-radius: 7px; background: var(--down); color: #fff;
  font-size: 9px; font-family: var(--mono); display: grid; place-items: center;
}
.badge-count.zero { display: none; }

.alert-list { margin-top: 10px; max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.alert-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 9px; border-radius: 6px; font-size: 11px;
  background: rgba(255,255,255,.02); border-left: 2px solid var(--line);
}
.alert-row.above { border-left-color: var(--up); }
.alert-row.below { border-left-color: var(--down); }
.alert-row.done { opacity: .45; }
.alert-row .a-sym { font-weight: 650; }
.alert-row .a-body { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.alert-row .a-note { color: var(--muted); font-size: 9.5px; }
.alert-row .a-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.alert-row .a-del:hover { color: var(--down); }
.alert-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 11px; }

.bt-split {
  display: grid; grid-template-columns: 46px 1fr 1fr 1fr; gap: 1px;
  background: var(--line-soft); border-radius: 6px; overflow: hidden; margin: 6px 0;
  font-size: 10px; font-family: var(--mono);
}
.bt-split > div { background: var(--panel); padding: 5px 6px; text-align: right; color: var(--text-dim); }
.bt-split > div:nth-child(4n+1) { text-align: left; }
.bt-split .h { color: var(--muted); }
.bt-split .up { color: var(--up); } .bt-split .down { color: var(--down); }

.cond-plan {
  border: 1px dashed rgba(240,185,11,.28); background: rgba(240,185,11,.045);
  border-radius: 8px; padding: 9px 10px; margin: 10px 0 0;
}
.cond-plan .cp-head { font-size: 9.5px; letter-spacing: .8px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.cond-plan .cp-line { font-family: var(--mono); font-size: 11px; color: var(--text-dim); line-height: 1.7; }
.cond-plan .cp-line b { color: var(--text); }
.cond-plan .cp-note { font-size: 9.5px; color: var(--muted); margin-top: 3px; }

/* ═══════════ 市场情绪条（常驻） ═══════════ */
.sent-bar {
  grid-area: sent;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(180deg, #0b0f15, #090c11);
  border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
}
.sent-title { font-size: 10px; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.sent-score { font-family: var(--mono); font-size: 19px; font-weight: 800; line-height: 1; }
.sent-score.up { color: var(--up); } .sent-score.down { color: var(--down); } .sent-score.neutral { color: var(--gold); }
.sent-label {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,.04); color: var(--text-dim); letter-spacing: .5px;
}
.sent-label.up { background: rgba(14,203,129,.14); color: var(--up); }
.sent-label.down { background: rgba(246,70,93,.14); color: var(--down); }
.sent-label.neutral { background: rgba(240,185,11,.12); color: var(--gold); }

.sent-track {
  position: relative; width: 210px; height: 6px; flex: none; border-radius: 3px;
  background: linear-gradient(90deg, #f6465d 0%, #b97a2b 35%, #f0b90b 50%, #4f9a6a 65%, #0ecb81 100%);
  opacity: .9;
}
.sent-marker {
  position: absolute; top: -4px; width: 3px; height: 14px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.8);
  transform: translateX(-50%); transition: left .4s ease;
}
.sent-parts { display: flex; gap: 14px; overflow: hidden; flex: 1; }
.sent-part { display: flex; align-items: baseline; gap: 5px; font-size: 10px; color: var(--muted); }
.sent-part b { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); font-weight: 500; }
.sent-part i { font-style: normal; font-size: 9px; color: #4d5a6d; }

/* ═══════════ 交易计划条（常驻） ═══════════ */
.plan-bar {
  flex: none; height: 38px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0f14, #090c11);
  overflow-x: auto; overflow-y: hidden; white-space: nowrap;
  scrollbar-width: none;
}
.plan-bar::-webkit-scrollbar { display: none; }
.pb-empty { font-size: 11px; color: var(--muted); }
.pb-dir {
  font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 3px 8px; border-radius: 5px;
}
.pb-dir.long { background: rgba(14,203,129,.14); color: var(--up); border: 1px solid rgba(14,203,129,.3); }
.pb-dir.short { background: rgba(246,70,93,.14); color: var(--down); border: 1px solid rgba(246,70,93,.3); }
.pb-dir.cond { background: rgba(240,185,11,.1); color: var(--gold); border: 1px solid rgba(240,185,11,.28); }
.pb-tf { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }
.pb-item { display: flex; align-items: baseline; gap: 5px; font-size: 10px; color: var(--muted); }
.pb-item b { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); }
.pb-item span { font-family: var(--mono); font-size: 9.5px; color: #4d5a6d; }
.pb-item.entry b { color: var(--blue); }
.pb-item.stop b { color: var(--down); }
.pb-item.tp b { color: var(--up); }
.pb-sep { width: 1px; height: 14px; background: var(--line); flex: none; }
.pb-stale { font-size: 9.5px; color: var(--gold); }
.pb-rr { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.pb-rr b { color: var(--gold); font-size: 11.5px; }

/* ═══════════ 超短线监控 ═══════════ */
.scalp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.scalp-title { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--text); }
.scalp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.scalp-card {
  background: rgba(255,255,255,.025); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 8px 9px; cursor: pointer;
  border-top: 2px solid #2a3648;
}
.scalp-card.long { border-top-color: var(--up); }
.scalp-card.short { border-top-color: var(--down); }
.scalp-card:hover { background: rgba(255,255,255,.045); }
.scalp-card .sc-tf { font-size: 10px; color: var(--muted); letter-spacing: .8px; display: flex; justify-content: space-between; }
.scalp-card .sc-tf b { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.scalp-card .sc-dir { font-size: 13px; font-weight: 700; margin: 3px 0; }
.scalp-card.long .sc-dir { color: var(--up); }
.scalp-card.short .sc-dir { color: var(--down); }
.scalp-card .sc-dir.none { color: var(--muted); }
.scalp-card .sc-row { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); font-family: var(--mono); line-height: 1.7; }
.scalp-card .sc-row b { color: var(--text-dim); font-weight: 500; }
.scalp-card .sc-tag {
  display: inline-block; margin-top: 4px; font-size: 9px; padding: 1px 5px;
  border-radius: 3px; background: rgba(240,185,11,.12); color: var(--gold);
}
.scalp-card .sc-tag.ok { background: rgba(14,203,129,.12); color: var(--up); }
.scalp-card .sc-tag.bad { background: rgba(246,70,93,.1); color: var(--down); }

.scalp-reso {
  padding: 8px 10px; border-radius: 7px; margin-bottom: 12px; font-size: 11px;
  background: rgba(255,255,255,.025); border: 1px solid var(--line-soft);
  color: var(--text-dim); line-height: 1.6;
}
.scalp-reso.ok { background: rgba(14,203,129,.06); border-color: rgba(14,203,129,.28); color: var(--up); }
.scalp-reso.warn { background: rgba(246,70,93,.05); border-color: rgba(246,70,93,.25); color: var(--down); }

.scalp-plan {
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 9px 10px;
  background: rgba(255,255,255,.02);
}
.scalp-plan .sp-line { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.9; }
.scalp-plan .sp-line b { color: var(--text); font-size: 12px; }
.scalp-plan .sp-line.entry b { color: var(--blue); }
.scalp-plan .sp-line.stop b { color: var(--down); }
.scalp-plan .sp-line.tp b { color: var(--up); }
.scalp-plan .sp-warn { font-size: 9.5px; color: var(--gold); margin-top: 5px; line-height: 1.5; }

/* ═══════════ 模拟交易 ═══════════ */
.tabs button { padding: 0 2px; font-size: 11px; }
@media (max-width: 1500px) { .tabs button { font-size: 10.5px; } }

.pp-acct { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.pp-acct > div { background: var(--panel); padding: 8px 10px; }
.pp-acct label { display: block; font-size: 9px; color: var(--muted); margin-bottom: 1px; }
.pp-acct b { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); }
.pp-acct b.up { color: var(--up); } .pp-acct b.down { color: var(--down); }

.pp-pos {
  border-radius: 8px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.02);
  padding: 10px; margin-bottom: 8px;
}
.pp-pos.long { border-color: rgba(14,203,129,.3); background: rgba(14,203,129,.04); }
.pp-pos.short { border-color: rgba(246,70,93,.3); background: rgba(246,70,93,.04); }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.pp-head .pp-side { font-size: 13px; font-weight: 700; }
.pp-pos.long .pp-side { color: var(--up); } .pp-pos.short .pp-side { color: var(--down); }
.pp-head .pp-pnl { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.pp-head .pp-pnl small { font-size: 10px; font-weight: 500; margin-left: 4px; }
.pp-head .pp-pnl.up { color: var(--up); } .pp-head .pp-pnl.down { color: var(--down); }

.pp-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); line-height: 1.85; font-family: var(--mono); }
.pp-row b { color: var(--text-dim); font-weight: 500; }
.pp-row b.up { color: var(--up); } .pp-row b.down { color: var(--down); } .pp-row b.gold { color: var(--gold); }
.pp-risk { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); }
.pp-risk .pp-warn { font-size: 9.5px; color: var(--gold); line-height: 1.55; margin-top: 3px; }
.pp-risk .pp-warn.bad { color: var(--down); }

.pp-preview {
  font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.8;
  background: rgba(255,255,255,.02); border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 7px 9px; margin-top: 6px; min-height: 30px;
}
.pp-preview b { color: var(--text-dim); }
.pp-preview .bad { color: var(--down); }

.ghost-btn.danger { border-color: rgba(246,70,93,.35); color: var(--down); }
.ghost-btn.danger:hover { background: rgba(246,70,93,.08); border-color: var(--down); }

.pp-hist { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; }
.pp-hist-row {
  display: grid; grid-template-columns: 46px 40px 1fr auto; gap: 6px; align-items: center;
  font-size: 9.5px; font-family: var(--mono); color: var(--muted);
  padding: 5px 7px; border-radius: 5px; background: rgba(255,255,255,.02);
}
.pp-hist-row .h-side.long { color: var(--up); } .pp-hist-row .h-side.short { color: var(--down); }
.pp-hist-row .h-pnl.up { color: var(--up); } .pp-hist-row .h-pnl.down { color: var(--down); }
.pp-hist-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 10.5px; }

/* ── 计划栏里的模拟持仓徽标 ── */
.pb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-family: var(--mono); padding: 3px 8px; border-radius: 5px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted);
  margin-left: auto; flex: none;
}
.pb-chip b { font-weight: 700; }
.pb-chip.up { border-color: rgba(14,203,129,.3); background: rgba(14,203,129,.08); }
.pb-chip.down { border-color: rgba(246,70,93,.3); background: rgba(246,70,93,.08); }
.pb-chip b.up { color: var(--up); }
.pb-chip b.down { color: var(--down); }

/* ═══════════ 订单流 ═══════════ */
.of-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.of-title { font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.of-depth { margin-bottom: 12px; }
.of-depth-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden;
  background: #161d27; border: 1px solid var(--line-soft);
}
.of-bid { background: linear-gradient(90deg, rgba(14,203,129,.35), rgba(14,203,129,.9)); width: 50%; transition: width .3s; }
.of-ask { background: linear-gradient(90deg, rgba(246,70,93,.9), rgba(246,70,93,.35)); width: 50%; transition: width .3s; }
.of-depth-meta {
  display: flex; justify-content: space-between; margin-top: 4px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.of-depth-meta .up { color: var(--up); }
.of-depth-meta .down { color: var(--down); }

.cvd-canvas { width: 100%; height: 64px; display: block; }
.of-cvd-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 4px; }

.of-tape { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.of-tape-row {
  display: grid; grid-template-columns: 46px 34px 1fr auto; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; color: var(--muted);
  padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.02);
  border-left: 2px solid transparent;
}
.of-tape-row.buy { border-left-color: var(--up); }
.of-tape-row.sell { border-left-color: var(--down); }
.of-tape-row .t-dir.buy { color: var(--up); }
.of-tape-row .t-dir.sell { color: var(--down); }
.of-tape-row .t-amt { color: var(--text-dim); text-align: right; }
.of-tape-row.big { background: rgba(240,185,11,.06); }
.of-tape-row.big .t-amt { color: var(--gold); font-weight: 700; }

.of-liq { display: flex; flex-direction: column; gap: 2px; max-height: 150px; overflow-y: auto; }
.of-liq-row {
  display: grid; grid-template-columns: 46px 40px 1fr auto; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; color: var(--muted);
  padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.02);
}
.of-liq-row.long { border-left: 2px solid var(--down); }
.of-liq-row.short { border-left: 2px solid var(--up); }
.of-liq-row .l-amt { color: var(--text-dim); text-align: right; }
.of-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 10px; }

.of-walls { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.of-walls .up { color: var(--up); }
.of-walls .down { color: var(--down); }

/* ═══════════════════════════════════════════════════════════════════
   手机版 (iPhone / Android) — 图表优先 + 底部业务区
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
  }
  .app {
    display: flex; flex-direction: column;
    height: auto; min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 顶栏压缩 */
  .topbar {
    position: sticky; top: 0; z-index: 60;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    gap: 8px; flex-wrap: nowrap; height: auto;
    overflow-x: auto; scrollbar-width: none;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
  .brand-text strong { font-size: 12.5px; }
  .brand-text small { display: none; }
  .symbols { max-width: none; flex: 1 1 auto; }
  .sym-tab { padding: 8px 9px; font-size: 12px; border-radius: 8px; }
  .sym-tab .px { font-size: 10px; }
  .status { flex: none; gap: 6px; width: auto; margin-left: 0; }
  .status-item label { display: none; }
  .status-item b { font-size: 10.5px; }
  .status-item:last-of-type { display: none; }   /* 隐藏北京时间 */
  .icon-btn { width: 32px; height: 32px; font-size: 15px; }

  /* 情绪条: 只留指针 */
  .sent-bar { height: 38px; padding: 0 10px; gap: 8px; }
  .sent-parts { display: none; }
  .sent-track { width: 84px; }
  .sent-score { font-size: 17px; }

  /* 图表优先 */
  .col-center { order: 1; height: auto; }
  .chart-toolbar {
    padding: 0 8px; gap: 6px; height: 40px;
    overflow-x: auto; scrollbar-width: none;
  }
  .chart-toolbar::-webkit-scrollbar { display: none; }
  .tf-btn { padding: 7px 9px; font-size: 12px; }
  .tool-btn { padding: 6px 8px; font-size: 11px; }
  .chart-hint { display: none; }
  .chart-wrap { height: 46vh; min-height: 290px; }
  .ohlc-strip { display: none; }

  .plan-bar { height: auto; min-height: 38px; padding: 6px 10px; overflow-x: auto; }
  .pb-item b { font-size: 11.5px; }

  /* 业务区 */
  .col-right { order: 2; margin-top: 0; }
  .tabs {
    position: sticky; top: 44px; z-index: 50;
    background: #0b0e13; height: 42px;
    overflow-x: auto; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { min-width: 56px; min-height: 42px; font-size: 12px; }
  .tab-body { padding: 10px; }

  .col-left { order: 3; padding: 10px; border-top: 1px solid var(--line); }
  .watch { grid-template-columns: 1fr 1fr; max-height: none; }
  .w-spark { display: none; }

  /* 触摸热区 */
  .ghost-btn, .run-btn { min-height: 38px; font-size: 12.5px; }
  .risk-form input, .risk-form select { min-height: 38px; font-size: 13px; }
  .bt-controls select, .scan-controls select { min-height: 34px; }

  .modal-box { width: calc(100vw - 20px); max-height: 84vh; padding: 14px; }
  .modal-box.wide { width: calc(100vw - 12px); }
  .scan-table { font-size: 10px; }
  .scan-table th, .scan-table td { padding: 5px 4px; }
}

/* 横屏手机: 图表更高 */
@media (max-width: 900px) and (orientation: landscape) {
  .chart-wrap { height: 62vh; }
}

/* 独立窗口(PWA)下隐藏滚动条痕迹 */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

@media (max-width: 760px) {
  .brand { flex: 0 0 auto; white-space: nowrap; }
  .brand-text strong { white-space: nowrap; font-size: 12px; }
  .brand-mark { margin-right: 2px; }
}
@media (max-width: 430px) {
  .brand-text { display: none; }
}

@media (max-width: 760px) {
  .chart-toolbar > * { flex: none; }
  .tf-group, .tools { flex: none; }
  .tf-group .tf-btn, .tools .tool-btn { white-space: nowrap; }
  .tools .tool-btn { padding: 6px 7px; }
  .chart-toolbar { height: 44px; }
  .tool-sep { display: none; }
}

/* 手机: 让文档本身滚动 (基础样式给 html/body 设了 height:100%, 会变成 body 内部滚动) */
@media (max-width: 1024px) {
  html { height: auto; overflow-y: auto; }
  body { height: auto; min-height: 100%; overflow: visible; }
}

@media (max-width: 1024px) {
  .col-right, .col-left, .col-center { overflow: visible; }
  .tabs { position: sticky; top: 0; z-index: 50; }
}

@media (max-width: 1024px) {
  .tabs { top: var(--header-h, 44px); }
  .tab-body { padding-top: 8px; }
}

/* ═══════════ 手机网站: 底部导航 ═══════════ */
.mnav { display: none; }
.ios-tip { display: none; }

@media (max-width: 760px) {
  .mnav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: calc(54px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 13, 18, .97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .mnav button {
    flex: 1; border: 0; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; color: var(--muted); font-size: 10px; font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .mnav button i { font-style: normal; font-size: 17px; line-height: 1.1; }
  .mnav button.active { color: var(--gold); }
  .mnav button:active { background: rgba(255,255,255,.04); }

  .app { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }

  .ios-tip {
    display: none;
    position: fixed; left: 8px; right: 8px;
    bottom: calc(60px + env(safe-area-inset-bottom));
    z-index: 95;
    background: rgba(240,185,11,.12);
    border: 1px solid rgba(240,185,11,.35);
    border-radius: 10px; padding: 9px 11px;
    font-size: 11px; line-height: 1.5; color: var(--gold);
    align-items: center; gap: 8px;
  }
  .ios-tip.show { display: flex; }
  .ios-tip button {
    flex: none; background: rgba(240,185,11,.2); border: 0; color: #1a1200;
    border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 11px;
  }
}

@media (max-width: 760px) {
  .mnav button i { font-size: 18px; filter: grayscale(.35); }
  .mnav button.active i { filter: none; }
}
