:root {
  color-scheme: dark;
  --bg: #10140f;
  --panel: #181e16;
  --ink: #e7ecdf;
  --muted: #9aa392;
  --line: #2c3628;
  --long: #7dcea0;
  --short: #e07a68;
  --mark: #e2c16b;
  --blue: #8eb6c9;
  --font: "Avenir Next", "PingFang TC", "Noto Sans TC", sans-serif;
  --mono: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3 { font-weight: 600; letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 16px; }
h3 { margin: 18px 0 8px; font-size: 14px; }
a { color: var(--blue); }
button, select, input {
  font: inherit;
  color: var(--ink);
  background: #222a1e;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
}
button { cursor: pointer; }
button:hover { border-color: var(--mark); }
.muted { color: var(--muted); font-size: 13px; }
.top, .questions, .desk, .panel, .split, footer {
  margin: 16px;
  min-width: 0;
}
.top {
  display: grid;
  grid-template-columns: 1.2fr auto 1fr auto;
  gap: 18px;
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; color: var(--mark); font-size: 12px; letter-spacing: 0.08em; }
.quote strong { font-family: var(--mono); font-size: 34px; font-weight: 560; }
.quote span { display: block; font-family: var(--mono); }
.up { color: var(--long); }
.down { color: var(--short); }
.badge {
  min-width: 120px;
  text-align: center;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 650;
  border: 1px solid var(--line);
}
.badge.long { background: #173224; color: var(--long); }
.badge.short { background: #3a201c; color: var(--short); }
.badge.flat { background: #22281e; color: var(--muted); }
.questions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.questions article, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.questions h2 { margin-bottom: 8px; }
.desk { display: grid; grid-template-columns: 1.6fr 0.8fr; gap: 12px; }
.panel-head, .row-actions, .profile, .form.inline { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel-head { margin-bottom: 10px; }
canvas { width: 100%; height: 320px; background: #121710; border-radius: 8px; }
.tv { height: 460px; }
.checks-panel { max-height: 860px; overflow: auto; }
.check-list { display: grid; gap: 6px; }
.check {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #243024;
  font-size: 13px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--short); }
.dot.on { background: var(--long); }
.heat { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.heat i { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.heat b, .heat s { display: block; width: 100%; }
.heat b { background: var(--short); opacity: 0.85; }
.heat s { background: var(--blue); opacity: 0.8; }
.room, .matrix { display: grid; gap: 6px; }
.room { grid-template-columns: repeat(7, 1fr); }
.cell, .room div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  background: #141a12;
}
.cell { cursor: pointer; min-height: 78px; }
.cell.on { outline: 1px solid var(--mark); }
.cell.good { background: #173224; }
.cell.bad { background: #2a1c18; }
.matrix { grid-template-columns: 70px repeat(7, 1fr); }
.matrix .head { color: var(--muted); padding: 4px; }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
th, td { text-align: right; padding: 5px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
.form { display: grid; gap: 8px; }
.form label, .profile label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.profile label.check { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--ink); }
.tab.on { border-color: var(--mark); color: var(--mark); }
footer { color: var(--muted); font-size: 12px; }
.scroll-x, #trades, #live-positions, #okx-orders, #tv-alerts {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 980px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .top, .questions, .desk, .panel, .split, footer { margin: 12px; }
  .top, .questions, .desk, .split { grid-template-columns: 1fr; }
  .top { gap: 10px; align-items: start; }
  h1 { font-size: 22px; }
  .quote strong { font-size: 32px; }
  .badge { width: 100%; min-width: 0; }
  .room { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix { grid-template-columns: 52px repeat(7, 84px); width: max-content; }
  .cell { min-width: 84px; min-height: 72px; }
  canvas { height: 220px; }
  .tv { height: 420px; }
  .checks-panel { max-height: none; }
  button, select, input { min-height: 44px; font-size: 16px; }
  .row-actions { align-items: stretch; }
  .row-actions button { flex: 1 1 150px; }
  .tv, .tv iframe { max-width: 100%; }
}
