/* ============================================================
   币安合约助手 · 预测交易终端
   ------------------------------------------------------------
   设计语言：
   - 深空底色 + 三层表面（面板 / 抬升 / 分隔），靠 1px 细线与
     极轻的内高光区分层级，而不是靠大色块
   - 强调色沿用币安黄（#f0b90b），只给「可操作 / 关键数字」用
   - 数字一律等宽 + tabular-nums，右对齐，便于纵向扫读
   - 圆角 8~14px，动效 120~200ms，全部可被 prefers-reduced-motion 关掉
   ============================================================ */

:root {
  --bg: #060910;
  --bg-soft: #0a0f18;
  --panel: #0d131f;
  --panel2: #111927;
  --panel3: #172131;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .13);
  --text: #e8eef8;
  --text2: #a9b4c7;
  --muted: #6f7c92;
  --up: #16c784;
  --down: #ef4b5b;
  --accent: #f0b90b;
  --accent2: #ffd451;
  --cyan: #38bdf8;
  --purple: #a78bfa;
  --blue: #4f8cff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --radius: var(--r-sm);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -18px rgba(0, 0, 0, .9);
  --shadow-2: 0 18px 48px -20px rgba(0, 0, 0, .9);
  --ring: 0 0 0 3px rgba(240, 185, 11, .18);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo,
          Consolas, "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(240, 185, 11, .07), transparent 62%),
    radial-gradient(900px 480px at 100% -4%, rgba(56, 189, 248, .06), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(240, 185, 11, .28); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: content-box; }

:focus-visible { outline: 2px solid rgba(240, 185, 11, .6); outline-offset: 2px; }

/* ---------------- 骨架 ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: 0 0 236px;
  background: linear-gradient(180deg, #0c1220 0%, #080c14 100%);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 16px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.side-brand .logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent2), #f7931a 78%);
  color: #1b1300; font-size: 18px; font-weight: 800;
  box-shadow: 0 6px 18px -8px rgba(240, 185, 11, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
  flex: 0 0 auto;
}
.side-brand h1 {
  font-size: 13.5px; font-weight: 650; letter-spacing: .2px;
  line-height: 1.35; white-space: nowrap;
}
.side-brand .sub {
  display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 158px;
}

.side-nav {
  padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; overflow-y: auto;
}
.side-nav .tab {
  position: relative;
  background: none; border: none; color: var(--text2); cursor: pointer;
  padding: 8px 11px; border-radius: var(--r-sm); text-align: left;
  font-size: 12.5px; font-family: inherit; display: flex; align-items: center; gap: 10px;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}
.side-nav .tab:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.side-nav .tab.active {
  background: linear-gradient(90deg, rgba(240, 185, 11, .16), rgba(240, 185, 11, .04));
  color: var(--accent); font-weight: 600;
}
.side-nav .tab.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 10px rgba(240, 185, 11, .8);
}
.side-nav .tab[hidden] { display: none !important; }
.side-nav .sep[hidden] { display: none !important; }
.side-nav .tab .ic {
  width: 16px; text-align: center; opacity: .9; font-size: 12.5px; flex: 0 0 auto;
}
.side-nav .tab .cnt {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  color: var(--text2); background: rgba(255, 255, 255, .07);
  padding: 1px 7px; border-radius: 999px; min-width: 22px; text-align: center;
}
.side-nav .tab.active .cnt { color: var(--accent); background: rgba(240, 185, 11, .16); }
.side-nav .sep {
  font-size: 9.5px; color: #5b6779; text-transform: uppercase; letter-spacing: .12em;
  padding: 14px 11px 6px; user-select: none;
}

.side-foot {
  border-top: 1px solid var(--line); padding: 12px 12px 10px; flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 7px;
}
.side-foot .btn { width: 100%; justify-content: center; }

.side-status { padding: 12px 14px 14px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.side-status .row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; padding: 3px 0; color: var(--muted);
}
.side-status .row b {
  color: var(--text2); font-weight: 500; font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .045);
  color: var(--text2);
  border: 1px solid var(--line2);
  padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 12px; font-weight: 500; font-family: inherit;
  transition: background .14s ease, color .14s ease, border-color .14s ease,
              transform .14s ease, box-shadow .14s ease;
  white-space: nowrap;
}
.btn:hover {
  background: rgba(255, 255, 255, .085);
  color: var(--text); border-color: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #241a00; border-color: rgba(240, 185, 11, .55); font-weight: 650;
  box-shadow: 0 3px 14px -6px rgba(240, 185, 11, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #ffe07a, var(--accent2));
  color: #1c1400; border-color: rgba(240, 185, 11, .75);
}

.btn.warn {
  border-color: rgba(240, 185, 11, .3); color: #f3c75a;
  background: rgba(240, 185, 11, .07);
}
.btn.warn:hover { background: rgba(240, 185, 11, .14); color: var(--accent2); }

.btn.danger {
  border-color: rgba(239, 75, 91, .34); color: #ff929e;
  background: rgba(239, 75, 91, .08);
}
.btn.danger:hover { background: rgba(239, 75, 91, .16); color: #ffb3bb; }

.btn.on {
  border-color: rgba(22, 199, 132, .4); color: #4ade9b;
  background: rgba(22, 199, 132, .1);
}

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px rgba(22, 199, 132, .16), 0 0 10px rgba(22, 199, 132, .7); }
.dot.off { background: var(--down); box-shadow: 0 0 0 3px rgba(239, 75, 91, .16), 0 0 10px rgba(239, 75, 91, .6); }
.dot.warn { background: var(--accent); box-shadow: 0 0 0 3px rgba(240, 185, 11, .16), 0 0 10px rgba(240, 185, 11, .6); }
.dot.idle { background: var(--muted); box-shadow: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
  font-family: var(--mono); letter-spacing: .02em; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.pill.live { background: rgba(239, 75, 91, .14); color: #ff8b9a; border-color: rgba(239, 75, 91, .28); }
.pill.ok { background: rgba(22, 199, 132, .13); color: #4ade9b; border-color: rgba(22, 199, 132, .26); }
.pill.bad { background: rgba(239, 75, 91, .13); color: #ff8b9a; border-color: rgba(239, 75, 91, .26); }
.pill.mute { background: rgba(255, 255, 255, .05); color: var(--muted); border-color: var(--line); }
.pill.info { background: rgba(56, 189, 248, .12); color: var(--cyan); border-color: rgba(56, 189, 248, .26); }
.pill.warn { background: rgba(240, 185, 11, .13); color: #f3c75a; border-color: rgba(240, 185, 11, .28); }

/* ---------------- 内容区 ---------------- */

.content {
  padding: 18px 20px 34px; flex: 1 1 auto; min-width: 0;
  width: 100%; max-width: 1720px; margin: 0 auto;
}
.panel { display: none; }
.panel.active { display: block; animation: panelIn .18s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 140px),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: border-color .18s ease;
}
.panel > .box + .box { margin-top: 14px; }   /* 只给面板内相邻卡片加间距，避免把 grid 里的第二列顶下去 */
.box:hover { border-color: rgba(255, 255, 255, .1); }
.box > header {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent);
}
.box > header h3 {
  font-size: 11.5px; color: var(--text2); font-weight: 650;
  text-transform: uppercase; letter-spacing: .09em;
}
.box > header .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.box > .body { padding: 14px; }
.box > .body.flush { padding: 0; }

/* 指标块 */
.tile {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 90px), var(--panel);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px; box-shadow: var(--shadow-1);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(240, 185, 11, 0) 65%);
  opacity: .55;
}
.tile:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .12); box-shadow: var(--shadow-2); }
.tile .k {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 9.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .1em; display: flex; align-items: center; gap: 6px;
}
.tile .v {
  font-size: 21px; font-weight: 650; font-family: var(--mono);
  font-variant-numeric: tabular-nums; margin-top: 5px; line-height: 1.15;
  letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .d {
  font-size: 11px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 键值表：行分隔 + 悬停高亮 */
.kv {
  display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  column-gap: 20px; font-size: 12.5px;
  max-width: 880px;   /* 宽面板里不要把标签和数值拉成两端，扫读更省眼 */
}
.kv .k {
  color: var(--muted); padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: color .14s ease;
}
.kv .v {
  text-align: right; padding: 6px 0;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  overflow-wrap: anywhere;
}
.kv > :nth-last-child(-n + 2) { border-bottom: none; }
.kv > .k:hover { color: var(--text2); }

/* ---------------- 表格 ---------------- */

.tablewrap { overflow: auto; max-height: 660px; }
.tablewrap::-webkit-scrollbar-corner { background: transparent; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(13, 19, 31, .96);
  backdrop-filter: blur(8px);
  color: var(--muted); font-weight: 600;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em;
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line2);
  white-space: nowrap; user-select: none;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text2); }
thead th .arrow { color: var(--accent); margin-left: 4px; }
tbody td {
  padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text2);
}
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: rgba(255, 255, 255, .03); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody td.num { font-family: var(--mono); text-align: right; }
tbody td.sym { font-family: var(--mono); font-weight: 600; color: var(--text); }
tbody tr.inactive td.sym { color: var(--muted); font-weight: 400; }
tbody tr.hi td { background: rgba(56, 189, 248, .07); }
tbody td b { color: var(--text); font-weight: 600; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.mono { font-family: var(--mono); }
.tile .v.up { color: var(--up); }
.tile .v.down { color: var(--down); }
.tile .v.warn { color: var(--accent); }
.tile .v.flat { color: var(--text); }

/* 评分条 */
.bar {
  width: 58px; height: 4px; margin-top: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); overflow: hidden;
}
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 999px; }

/* 新闻情绪 */
.sent {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; letter-spacing: .02em;
}
.sent.pos { background: rgba(22, 199, 132, .13); color: #4ade9b; }
.sent.neg { background: rgba(239, 75, 91, .13); color: #ff8b9a; }
.sent.neu { background: rgba(255, 255, 255, .06); color: var(--muted); }

/* ---------------- 表单控件 ---------------- */

.field { display: block; margin-bottom: 11px; }
.field > span {
  display: block; font-size: 9.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px;
}
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline > span { margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; }
.field input[type="text"], .field input[type="password"], .field select,
.toolbar input[type="text"], .toolbar select {
  background: rgba(0, 0, 0, .32); color: var(--text);
  border: 1px solid var(--line2); border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; font-family: inherit; outline: none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.field input[type="text"], .field input[type="password"], .field select { width: 100%; }
.field input:focus, .field select:focus,
.toolbar input:focus, .toolbar select:focus {
  border-color: rgba(240, 185, 11, .65);
  box-shadow: var(--ring);
  background: rgba(0, 0, 0, .45);
}
.field input::placeholder, .toolbar input::placeholder { color: #4d586b; }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="text"] { min-width: 200px; }
.toolbar .sp { margin-left: auto; }

.seg {
  display: inline-flex; border: 1px solid var(--line2); border-radius: 10px;
  overflow: hidden; background: rgba(0, 0, 0, .28); padding: 2px; gap: 2px;
}
.seg button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 5px 12px; font-size: 11.5px; font-family: inherit; border-radius: 8px;
  transition: background .14s ease, color .14s ease;
}
.seg button:hover { color: var(--text2); background: rgba(255, 255, 255, .05); }
.seg button.active {
  background: linear-gradient(180deg, rgba(240, 185, 11, .22), rgba(240, 185, 11, .1));
  color: var(--accent2); font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(240, 185, 11, .28);
}

.hint { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.hint code, .notice code {
  background: rgba(0, 0, 0, .4); padding: 1px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 10.5px; color: var(--cyan);
  border: 1px solid var(--line);
}
.notice {
  margin-top: 12px; padding: 11px 13px; border-radius: 10px; font-size: 11.5px;
  line-height: 1.75; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--text2);
}
.notice.danger {
  border-color: rgba(239, 75, 91, .3);
  background: linear-gradient(180deg, rgba(239, 75, 91, .12), rgba(239, 75, 91, .05));
  color: #ffc2c8;
}

/* ---------------- 图表 ---------------- */

.chart { height: 200px; width: 100%; }
.chart svg { width: 100%; height: 100%; display: block; }

/* ---------------- 列表 / 日志 ---------------- */

.newslist, .eventlog { max-height: 620px; overflow-y: auto; }
.newsitem { padding: 10px 2px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.newsitem .t { font-size: 12.5px; margin-bottom: 3px; line-height: 1.55; }
.newsitem .t a { color: var(--text); text-decoration: none; transition: color .14s ease; }
.newsitem .t a:hover { color: var(--accent); }
.newsitem .m {
  font-size: 10.5px; color: var(--muted); display: flex; gap: 10px;
  flex-wrap: wrap; align-items: center;
}

.evrow {
  display: flex; gap: 9px; align-items: baseline; padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: 11.5px;
}
.evrow .evt { color: var(--muted); font-family: var(--mono); font-size: 10.5px; flex: 0 0 auto; }
.evrow .evk {
  color: #7f8ba3; font-size: 9px; text-transform: uppercase; flex: 0 0 92px;
  overflow: hidden; text-overflow: ellipsis; letter-spacing: .1em;
}
.evrow .evx { color: var(--text2); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.evrow.ev-bad .evx { color: #ff8b9a; }
.evrow.ev-good .evx { color: #4ade9b; }
.evrow.ev-llm .evx { color: #c9a7f5; }
.evrow.ev-info .evx { color: var(--text2); }

.llmlist { max-height: 420px; overflow-y: auto; }
.llmitem { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 11.5px; }
.llmhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 5px; }
.llmreason { color: #c2c9d6; line-height: 1.65; }
.llmrisks { margin: 6px 0 0 16px; color: var(--muted); font-size: 10.5px; }

.insights { list-style: none; }
.insights li {
  padding: 9px 0 9px 18px; position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 12px;
  color: var(--text2); line-height: 1.65;
}
.insights li:last-child { border-bottom: none; }
.insights li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

.empty {
  color: var(--muted); text-align: center; padding: 26px 18px; font-size: 12px;
  border: 1px dashed var(--line2); border-radius: 10px; margin: 10px;
  background: rgba(255, 255, 255, .012);
}

/* ---------------- 迷你走势 ---------------- */

.spark { display: block; width: 66px; height: 17px; vertical-align: middle; }

/* ---------------- 提示条 ---------------- */

.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: rgba(18, 26, 39, .96);
  border: 1px solid var(--line2); border-left: 3px solid var(--accent);
  padding: 11px 16px; border-radius: 10px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none; max-width: 420px; font-size: 12.5px; z-index: 100;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--down); }

/* 实时闪烁 */
.flash-up { animation: fu .9s ease-out; }
.flash-down { animation: fd .9s ease-out; }
@keyframes fu { from { background: rgba(22, 199, 132, .22); } to { background: transparent; } }
@keyframes fd { from { background: rgba(239, 75, 91, .22); } to { background: transparent; } }

/* ============================================================
   登录页
   ============================================================ */

body.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background:
    radial-gradient(760px 420px at 50% -12%, rgba(240, 185, 11, .12), transparent 65%),
    radial-gradient(620px 380px at 88% 108%, rgba(56, 189, 248, .1), transparent 62%),
    var(--bg);
}
body.login-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
}
.login-wrap { width: 100%; max-width: 392px; padding: 24px; position: relative; z-index: 1; }
.login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 160px), var(--panel);
  border: 1px solid var(--line2); border-radius: var(--r-lg);
  padding: 32px 28px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .95), var(--shadow-1);
  backdrop-filter: blur(12px);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-brand .logo {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent2), #f7931a 78%);
  color: #1b1300; font-size: 24px; font-weight: 800;
  box-shadow: 0 10px 26px -12px rgba(240, 185, 11, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.login-brand h1 { font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.login-brand .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.login-card .field { margin-bottom: 15px; }
.login-card .field label {
  display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .1em;
}
.login-card .field input {
  width: 100%; background: rgba(0, 0, 0, .34); border: 1px solid var(--line2); color: var(--text);
  padding: 11px 13px; border-radius: 10px; font-size: 14px; outline: none;
  transition: border-color .14s ease, box-shadow .14s ease; font-family: inherit;
}
.login-card .field input:focus {
  border-color: rgba(240, 185, 11, .65);
  box-shadow: var(--ring);
  background: rgba(0, 0, 0, .46);
}
.btn-login {
  width: 100%; background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #241a00; border: none; padding: 12px; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px;
  transition: filter .14s ease, transform .14s ease, box-shadow .14s ease;
  box-shadow: 0 10px 26px -14px rgba(240, 185, 11, .95), inset 0 1px 0 rgba(255, 255, 255, .4);
  font-family: inherit;
}
.btn-login:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-msg {
  margin-top: 14px; padding: 10px 12px; border-radius: 9px; font-size: 12.5px;
  display: none; text-align: center; line-height: 1.5;
}
.login-msg.err { display: block; background: rgba(239, 75, 91, .14); color: #ffa9b3; border: 1px solid rgba(239, 75, 91, .32); }
.login-msg.ok { display: block; background: rgba(22, 199, 132, .14); color: #62d8a8; border: 1px solid rgba(22, 199, 132, .32); }
.login-foot { margin-top: 22px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1500px) {
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 16px 16px 30px; }
}
@media (max-width: 980px) {
  .sidebar { width: 68px; flex: 0 0 68px; }
  .side-brand { justify-content: center; padding: 14px 8px; }
  .side-brand .logo { width: 32px; height: 32px; font-size: 17px; }
  .side-brand h1, .side-brand .sub { display: none; }
  .side-nav { padding: 8px 6px; }
  .side-nav .tab { justify-content: center; padding: 9px 6px; gap: 0; }
  .side-nav .tab span:not(.ic) { display: none; }
  .side-nav .tab .ic { width: auto; font-size: 14px; }
  .side-nav .sep { display: none; }
  .side-foot { padding: 10px 8px; }
  .side-foot .btn { padding: 6px 4px; font-size: 10.5px; }
  .side-status { display: none; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 14px 12px 26px; }
}
@media (max-width: 720px) {
  .g3, .g4, .g6 { grid-template-columns: minmax(0, 1fr); }
  .box > header { flex-wrap: wrap; gap: 8px; }
  .box > header .sp { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .toolbar { gap: 6px; }
  .toolbar input[type="text"] { min-width: 0; flex: 1 1 100%; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }

}

/* 尊重系统「减少动效」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
  background: rgba(2, 4, 8, .74); backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(520px, calc(100vw - 48px)); background: var(--panel);
  border: 1px solid var(--line2); border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: var(--shadow-2);
  max-height: calc(100vh - 48px); overflow: auto; margin: auto;
}
.modal-card h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: .02em; }

/* 账户卡片：拉高一点，信息分层 */
.acc-card {
  min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 14px 12px;
}
.acc-card .v { margin: 10px 0 6px; }

/* 可选择的卡片：右下角圆框，选中填绿并打勾 */
.pick { position: relative; padding-right: 34px; }
.pick .radio {
  position: absolute; right: 12px; bottom: 12px; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid var(--line2); background: transparent;
  transition: background .15s ease, border-color .15s ease;
}
.pick.on { border-color: #16c784 !important; }
.pick.on .radio { background: #16c784; border-color: #16c784; }
.pick.on .radio::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #04120a; font-size: 12px; font-weight: 700;
}

/* 下单台：账户卡片与币对卡片压扁一些 */
.acc-card { min-height: 96px !important; padding: 10px 12px 10px !important; }
.acc-card .v { margin: 6px 0 2px !important; font-size: 14px !important; }
.acc-card .d { font-size: 10.5px !important; }
.acc-card .radio { bottom: 10px !important; right: 10px !important; }

#deskPairs .tile { min-height: 78px !important; padding: 10px 12px !important; }
#deskPairs .tile .k { font-size: 10px !important; }
#deskPairs .tile .v { font-size: 14px !important; margin: 2px 0 0 !important; }
#deskPairs .tile .d { font-size: 10.5px !important; margin-top: 2px !important; }
#deskPairs .tile .radio { bottom: 10px; right: 10px; }

/* 影子盘表格：按列对齐，数字等宽 */
#paperTable table { table-layout: fixed; }
#paperTable th, #paperTable td {
  padding: 9px 10px; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#paperTable th:nth-child(1),  #paperTable td:nth-child(1)  { width: 172px; text-align: left; }
#paperTable th:nth-child(2),  #paperTable td:nth-child(2)  { width: 250px; text-align: left; }
#paperTable th:nth-child(3),  #paperTable td:nth-child(3)  { width: 72px;  text-align: center; }
#paperTable th:nth-child(4),  #paperTable td:nth-child(4)  { width: 88px;  text-align: right; }
#paperTable th:nth-child(5),  #paperTable td:nth-child(5)  { width: 92px;  text-align: right; }
#paperTable th:nth-child(6),  #paperTable td:nth-child(6)  { width: 92px;  text-align: right; }
#paperTable th:nth-child(7),  #paperTable td:nth-child(7)  { width: 80px;  text-align: right; }
#paperTable th:nth-child(8),  #paperTable td:nth-child(8)  { width: 168px; text-align: right; }
#paperTable th:nth-child(9),  #paperTable td:nth-child(9)  { width: 80px;  text-align: center; }

/* 折叠明细：.kv 的 display:grid 会盖掉 hidden，这里强制收起 */
#paperStats[hidden] { display: none !important; }

/* 下单台行情分析明细折叠：.kv 的 display:grid 会盖掉 hidden */
#liveStats[hidden] { display: none !important; }
