:root {
  --bg: #07111e;
  --bg2: #0c1a2d;
  --card: #0d1c30;
  --line: rgba(80, 230, 160, 0.38);
  --green: #3ef2a0;
  --green-dim: rgba(62, 242, 160, 0.14);
  --red: #ff5d73;
  --gold: #f0c36a;
  --blue: #8eb7ff;
  --amber: #ffc14d;
  --text: #e8f1fb;
  --muted: #8ea3bb;
  --mono: "Sarasa Mono SC", "Noto Sans Mono", ui-monospace, monospace;
  --sans: "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f3f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --line: rgba(16, 140, 90, 0.35);
  --text: #142033;
  --muted: #5d7088;
  --green-dim: rgba(16, 150, 90, 0.1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { min-height: 100vh; background-image: radial-gradient(1200px 500px at 10% -10%, rgba(62,242,160,.08), transparent 50%), radial-gradient(900px 400px at 100% 0%, rgba(126,182,255,.06), transparent 40%); }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
.app { width: min(1680px, calc(100% - 28px)); margin: 0 auto; padding: 14px 0 40px; }
.card { background: linear-gradient(180deg, rgba(16,34,56,.96), rgba(8,18,32,.94)); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 0 0 1px rgba(62,242,160,.05), 0 10px 40px rgba(0,0,0,.25); }
html[data-theme="light"] .card { background: #fff; box-shadow: 0 8px 28px rgba(20,40,70,.06); }
.top { display: flex; gap: 16px; align-items: center; padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 240px; }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; background: #102238; border: 1px solid var(--line); }
.logo i { display: block; border-radius: 2px; background: var(--green); }
.logo i:nth-child(2) { opacity: .55; } .logo i:nth-child(3) { opacity: .75; } .logo i:nth-child(4) { opacity: .35; }
h1 { font-size: 20px; margin: 0; letter-spacing: .04em; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tickers { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.ticker { min-width: 148px; padding: 6px 10px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.04); }
.ticker .sym { color: var(--gold); font-size: 11px; letter-spacing: .08em; }
.ticker .row { display: flex; align-items: baseline; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: var(--green-dim); color: var(--green); border: 1px solid rgba(62,242,160,.3); }
.chip.red { color: var(--red); background: rgba(255,93,115,.12); border-color: rgba(255,93,115,.3); }
.chip.amber { color: var(--amber); background: rgba(255,193,77,.12); border-color: rgba(255,193,77,.35); }
.chip.blue { color: var(--blue); background: rgba(126,182,255,.12); border-color: rgba(126,182,255,.3); }
.chip.gold { color: var(--gold); background: rgba(240,195,106,.12); border-color: rgba(240,195,106,.3); }
.modes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.modes button, .iconbtn { background: #0e2036; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 7px 10px; }
.modes button.on, .iconbtn.on { border-color: var(--green); color: var(--green); box-shadow: 0 0 12px rgba(62,242,160,.25); }
.live { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--green); color: var(--green); }
.live.stale { border-color: var(--amber); color: var(--amber); }
.kpi4, .deck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi { padding: 12px 14px; }
.kpi .k { color: var(--muted); font-size: 12px; }
.kpi .v { font-family: var(--mono); font-size: 26px; margin: 4px 0; }
.kpi .s { color: var(--muted); font-size: 12px; }
.kpi.g .v { color: var(--green); } .kpi.b .v { color: var(--blue); } .kpi.a .v { color: var(--amber); }
.chcard { padding: 12px; cursor: pointer; }
.chcard.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 24px rgba(62,242,160,.18); }
.chcard .hd { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tag { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.spark { width: 100%; height: 36px; display: block; margin-top: 6px; }
.foot { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.side { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; padding: 12px; }
.section { padding: 14px; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { background: transparent; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 6px 10px; }
.tabs button.on { border-color: var(--green); color: var(--green); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
td { padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: top; }
.mono, .od, .v, td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--green); } .dn { color: var(--red); }
.pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.pill.long { background: rgba(62,242,160,.15); color: var(--green); }
.pill.short { background: rgba(255,93,115,.15); color: var(--red); }
.star { color: var(--gold); }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--red), var(--amber), var(--green)); }
.tools { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
input[type="search"], input[type="text"], input[type="password"], input[type="number"], select {
  background: #091525; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 7px 8px;
}
html[data-theme="light"] input, html[data-theme="light"] select { background: #fff; }
.cap { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rcard { padding: 10px; min-height: 112px; }
.rcard .sym { color: var(--gold); font-weight: 700; }
.attr { display: flex; flex-direction: column; gap: 6px; }
.attr .row { display: grid; grid-template-columns: 160px 1fr 120px; gap: 8px; align-items: center; font-size: 13px; }
.attr .track { height: 10px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.attr .track i { display: block; height: 100%; }
.hl { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bul li { margin: 4px 0; }
.curve-wrap { height: 280px; position: relative; }
.curve-wrap canvas, .kwrap canvas { width: 100%; height: 100%; display: block; }
.kwrap { height: 520px; position: relative; }
.kstatus { color: var(--muted); font-size: 12px; min-height: 1.4em; margin: 4px 0 6px; line-height: 1.45; }
.tip { position: absolute; background: rgba(8,16,28,.92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; font-family: var(--mono); pointer-events: none; }
.wall { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) 320px; gap: 10px; align-items: start; }
.wall .mini { max-height: calc(100vh - 250px); overflow: auto; }
.mini { padding: 10px; min-width: 0; }
.mini canvas.spark { height: 72px; }
.closed-card { border-left: 3px solid var(--green); padding: 8px; margin: 8px 0; border-radius: 10px; background: rgba(0,0,0,.15); }
.closed-card.loss { border-left-color: var(--red); }
.big { font-family: var(--mono); font-size: 22px; }
.kline { display: grid; grid-template-columns: 260px minmax(0,1fr) 280px; gap: 10px; }
.slist { max-height: calc(100vh - 180px); overflow: auto; }
.srow { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; font-size: 13px; }
.srow.on { background: rgba(62,242,160,.08); }
.drawer, .float { position: fixed; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.drawer { top: 0; right: 0; height: 100vh; width: min(420px, 100%); padding: 16px; overflow: auto; transform: translateX(105%); transition: transform .2s; }
.drawer.show { transform: none; }
.float { width: 360px; height: 280px; right: 24px; bottom: 24px; display: flex; flex-direction: column; }
.float header, .drawer h3 { cursor: move; }
.float pre { margin: 0; padding: 8px; overflow: auto; flex: 1; font-family: var(--mono); font-size: 12px; }
.od { display: inline-block; height: 1em; overflow: hidden; vertical-align: bottom; }
.odc { display: block; line-height: 1; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.ods { display: inline-block; }
.warn { color: var(--amber); font-size: 13px; line-height: 1.5; }
.stamp { display: inline-block; border: 2px solid var(--red); color: var(--red); font-weight: 800; padding: 4px 8px; transform: rotate(-12deg); letter-spacing: .08em; }
.term { background: #010806; color: #c8ffe0; }
.term .card { background: #04110c; border-color: rgba(80,255,150,.35); border-radius: 6px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; }
.node { padding: 10px; min-height: 90px; }
.linksvg { width: 100%; height: 46px; }
.agents { display: flex; flex-direction: column; gap: 8px; }
.agent { padding: 8px; border-radius: 8px; border: 1px solid rgba(80,255,150,.2); }
.agent.on { border-color: #39ff88; box-shadow: 0 0 12px rgba(57,255,136,.25); }
.logbox { font-family: var(--mono); font-size: 12px; height: 220px; overflow: auto; background: #000; padding: 8px; white-space: pre-wrap; }
.cursor { display: inline-block; width: 8px; height: 12px; background: #39ff88; animation: blink 1s steps(1) infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }
.starhub { position: relative; width: min(820px, 100%); height: 640px; margin: 8px auto; }
.sat { position: absolute; width: 132px; padding: 6px; font-size: 12px; }
.pop { display: none; position: absolute; z-index: 5; width: 220px; padding: 8px; }
.sat:hover .pop { display: block; }
.xray { padding: 8px 10px 12px; background: rgba(62,242,160,.05); }
@media (max-width: 1200px) {
  .kpi4, .deck, .wall { grid-template-columns: 1fr 1fr; }
  .split, .kline { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .app { width: calc(100% - 12px); }
  .kpi4, .deck, .grid3, .wall, .flow { grid-template-columns: 1fr; }
  .kpi .v { font-size: 22px; }
  .top { padding: 8px; }
  .brand { min-width: 0; }
  h1 { font-size: 18px; }
  .modes { width: 100%; }
  .modes button { padding: 8px 10px; }
  .ticker { min-width: calc(50% - 8px); flex: 1 1 140px; }
  table { display: block; overflow-x: auto; }
  .slist { max-height: 220px; }
  .kwrap { height: 320px; }
  .starhub { height: 360px; }
  .float { position: static; left: auto; right: auto; bottom: auto; width: auto; height: 160px; margin-top: 10px; }
  .srow { font-size: 12px; }
  input, select { max-width: 100%; }
}
