:root {
  --bg: #0b0d10; --panel: #12151a; --panel2: #171b21; --line: #242a33; --text: #d7dce3; --muted: #7d8794;
  --up: #26c281; --down: #f0556a; --gold: #e8b64c;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 12px/1.35 var(--font); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.pos { color: var(--up); } .neg { color: var(--down); }

.top { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--panel); border-bottom: 1px solid var(--line); height: 38px; }
.brand { font-weight: 700; font-size: 14px; white-space: nowrap; }
.sel, .add input { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.add { display: flex; gap: 2px; } .add input { width: 64px; }
.add button, .seg button { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; color: var(--muted); }
.seg button.on { background: #2b3440; color: var(--text); font-weight: 600; }
.chk { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.spacer { flex: 1; }
.conn { color: var(--muted); } .conn.ok { color: var(--up); } .conn.bad { color: var(--down); }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.nav a.on { color: var(--text); background: #222833; }

/* 动态异动币切换条（eqn.news） */
.movers { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: #0e1116; border-bottom: 1px solid var(--line); height: 32px; overflow: hidden; }
.movers-head { font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
.movers-list { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.movers-list::-webkit-scrollbar { display: none; }
.mover-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 11px; white-space: nowrap; cursor: pointer; flex: none; }
.mover-chip:hover { border-color: #3a4352; background: #1a1f28; }
.mover-chip.on { background: #243348; border-color: #4f6d94; font-weight: 600; }
.mover-chip .mv-pct { font-family: var(--mono); font-size: 10px; }
.mover-chip .mv-age { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.movers-detail { display: flex; align-items: center; gap: 6px; flex: none; max-width: 42%; font-size: 11px; overflow: hidden; }
.movers-detail a { color: var(--gold); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movers-detail a:hover { text-decoration: underline; }
.mover-act { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 10px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.mover-act:hover { color: var(--text); border-color: #3a4352; }
.mover-act.on { color: var(--gold); border-color: #6b5420; }

/* 顶栏 13 所盘口 */
.strip { display: flex; gap: 4px; padding: 5px 8px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); height: 90px; }
.mk { flex: 1 0 118px; max-width: 160px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-family: var(--mono); font-size: 11px; line-height: 1.3; }
.mk.off { opacity: .4; }
.mk.sel { background: #1a1f28; border-color: #3a4352; }
.mk .h { display: flex; align-items: center; gap: 4px; font-family: var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; }
.mk .h .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.mk .h b { color: var(--text); font-weight: 600; }
.mk .m { display: flex; justify-content: space-between; color: var(--muted); }
.mk .l { display: flex; justify-content: space-between; gap: 4px; }
.mk .a { color: var(--down); } .mk .b { color: var(--up); }
.mk .best { text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }

.desk { display: grid; grid-template-columns: 1fr 350px; height: calc(100vh - 38px - 32px - 90px); min-height: 0; }
.charts { display: grid; grid-template-rows: minmax(180px, 1fr) clamp(240px, 28vh, 300px) 16px; min-width: 0; min-height: 0; }
.plotwrap { position: relative; min-height: 0; }
.plotwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lower { border-top: 1px solid var(--line); }
.legend { font-size: 10px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 跨交易所排行：独立滚动，保留全部有效组合。 */
.ranking-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); padding: 9px; }
.ranking-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ranking-heading span, .ranking-caption { font-size: 10px; }
.ranking-caption { margin: 6px 0; }
.ranking-scroll { max-height: 270px; overflow: auto; scrollbar-width: thin; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }
.ranking-table th { position: sticky; top: 0; background: var(--panel2); color: var(--muted); font-weight: 400; }
.ranking-table th, .ranking-table td { padding: 6px 3px; text-align: right; border-bottom: 1px solid var(--line); }
.ranking-table th:first-child, .ranking-table td:first-child { text-align: left; }
.ranking-table td:not(:first-child) { font-family: var(--mono); }
.ranking-table tr.selected td { background: #243348; }
.ranking-select { display: block; width: 100%; padding: 3px 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ranking-select:hover { background: #2a3544; }
.ranking-select:focus-visible { outline: 1px solid #81a6d5; outline-offset: 2px; }
.ranking-index { display: inline-block; min-width: 20px; color: var(--muted); font-family: var(--mono); }
.ranking-note { margin-top: 7px; font-size: 10px; line-height: 1.6; }

.comparison { border-left: 1px solid var(--line); background: var(--panel); padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-width: 0; }
.spread-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.spread-title span { font-size: 11px; font-weight: 400; }
.comparison-venues { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; font-size: 13px; }
.comparison-venues b { display: inline-block; border-radius: 4px; padding: 1px 6px; margin-right: 4px; background: var(--panel2); }
.aster { color: #ff8a3d; } .bn { color: #f0b90b; }
.readonly-note { font-size: 11px; margin-top: 6px; }
.comparison input[type=number], .comparison select { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 6px; min-width: 0; font-family: var(--mono); }
.spread-card { padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); }
.direction-title { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.direction-title b { font: 700 14px var(--mono); color: #bdcde5; }
.spread-value { display: block; font: 700 19px/1.8 var(--mono); white-space: nowrap; }
.spread-prices { font: 10px/1.6 var(--mono); white-space: pre-line; overflow-wrap: anywhere; }
.target-row { display: flex; align-items: center; gap: 6px; padding: 9px 0; border-top: 1px solid var(--line); margin-top: 7px; }
.target-row label { color: var(--muted); }
.target-row input { width: 90px; }
.target-state { margin-left: auto; font-size: 10px; }
.spread-note { font-size: 10px; margin-top: 6px; line-height: 1.6; }
@media (max-width: 900px) {
  html, body { overflow: auto; }
  .desk { grid-template-columns: 1fr; height: auto; }
  .charts { grid-template-rows: 60vh 240px 16px; }
  .comparison { border-left: 0; border-top: 1px solid var(--line); }
  .top { flex-wrap: wrap; height: auto; }
}

/* 待核实标记 */
.tag-warn { display: inline-block; padding: 0 4px; margin-left: 4px; border-radius: 3px; background: #4a3a12; color: var(--gold); font-size: 9px; font-weight: 600; vertical-align: 1px; }
.mk.mm { border-color: #6b5420; }

/* 大价差体检 */
.checkup-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); padding: 9px; }
.checkup-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 8px 0; }
.checkup-params label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 10px; }
.checkup-params input { width: 100%; }
.checkup-actions { display: flex; align-items: center; gap: 10px; }
.checkup-actions button { background: #2b3440; border: 1px solid #3a4352; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-weight: 600; }
.checkup-actions button:disabled { opacity: .5; cursor: wait; }
.checkup-result { margin-top: 9px; font-size: 11px; line-height: 1.6; }
.ck-head { display: flex; gap: 6px; align-items: flex-start; padding: 7px; border-radius: 6px; background: var(--panel); color: var(--text); margin-bottom: 8px; }
.ck-sec { margin-bottom: 8px; }
.ck-sec h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 3px; font-size: 12px; color: var(--text); }
.ck-sec ul { margin: 0; padding: 0; list-style: none; }
.ck-sec li { display: flex; gap: 6px; align-items: flex-start; padding: 2px 0; color: var(--text); }
.ck-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.ck-dot.ok { background: var(--up); } .ck-dot.warn { background: var(--gold); } .ck-dot.bad { background: var(--down); } .ck-dot.info { background: #4b5563; }
.ck-ladder { width: 100%; border-collapse: collapse; font: 10px var(--mono); margin: 4px 0 2px; }
.ck-ladder th, .ck-ladder td { padding: 2px 3px; text-align: right; border-bottom: 1px solid var(--line); }
.ck-ladder th { color: var(--muted); font-weight: 400; }
.ck-meta { font-size: 10px; color: var(--muted); }

/* 大价差案例页 */
body.page { overflow: auto; }
.cases { padding: 10px; display: flex; flex-direction: column; gap: 12px; }
.case-list { border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); padding: 6px; max-height: 40vh; overflow: auto; }
.case-list tr { cursor: pointer; }
.case-list tr:hover td { background: #1d2430; }
.case-detail { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: 10px; }
.case-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.case-title span { font-size: 11px; }
.case-note { margin: 6px 0; color: var(--gold); font-size: 11px; }
.case-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.case-hover { font: 11px/1.4 var(--mono); flex: 1; min-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-plot { position: relative; height: 280px; border-top: 1px solid var(--line); }
.case-plot.case-plot-sm { height: 210px; }
.case-plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.case-settle-wrap { margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); padding: 8px; overflow-x: auto; }
.case-settle-wrap h4 { margin: 0 0 6px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.case-settle-table { width: 100%; border-collapse: collapse; font: 11px var(--mono); white-space: nowrap; }
.case-settle-table th, .case-settle-table td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.case-settle-table th { color: var(--muted); font-weight: 400; font-family: var(--font); }
.case-settle-table th:first-child, .case-settle-table td:first-child, .case-settle-table th:nth-child(2), .case-settle-table td:nth-child(2) { text-align: left; }
.case-upcoming { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.export-btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--text); text-decoration: none; font-size: 11px; white-space: nowrap; }
.export-btn:hover { border-color: #4f6d94; background: #1d2430; }
.case-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; font-size: 11px; line-height: 1.6; }
.case-facts > div { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel2); }
.case-facts h4 { margin: 0 0 4px; font-size: 12px; }
@media (max-width: 900px) { .cases { padding: 8px 16px; } .case-plot { height: 200px; } }
