/* QuantTrader Web · 极客终端风格（默认暗色，可切换亮色）
   性能约定：动画只用 transform / opacity / clip-path（不触发重排）；长列表 content-visibility；尊重 prefers-reduced-motion */
:root, [data-theme="dark"] {
  --bg: #07090d; --bg2: #0a0d13; --card: #0e1219; --card2: #131922; --inner: #111620; --line: #1d2430; --line2: #161c25;
  --text: #e6edf3; --text2: #c2cbd7; --sub: #8995a6; --weak: #5b6677; --grid: #18202a;
  --brand: #4c8dff; --brand2: #9b7bff; --brand-weak: rgba(76,141,255,.13); --brand-line: rgba(76,141,255,.38);
  --up: #ff4d5e; --down: #1fc27a; --up-weak: rgba(255,77,94,.13); --down-weak: rgba(31,194,122,.13);
  --warn: #f5a524; --warn-weak: rgba(245,165,36,.12); --purple: #b58cff; --purple-weak: rgba(181,140,255,.13);
  --cyan: #22d3ee; --bench: #6b7686; --row-on: rgba(76,141,255,.08); --tip: rgba(10,13,19,.92); --mask: rgba(3,5,8,.62);
  --shadow: 0 10px 40px rgba(0,0,0,.55); --glow: 0 0 0 1px var(--brand-line), 0 0 26px rgba(76,141,255,.14);
  --skel: #151b24; --skel2: #1d2531; --scroll: #242c38;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f6f8; --bg2: #fff; --card: #fff; --card2: #f7f8fa; --inner: #fafbfc; --line: #e4e7ec; --line2: #eff1f4;
  --text: #111827; --text2: #374151; --sub: #6b7280; --weak: #9ca3af; --grid: #eef0f3;
  --brand: #2f6bff; --brand2: #7c5cff; --brand-weak: #eef3ff; --brand-line: rgba(47,107,255,.35);
  --up: #e5484d; --down: #16a05a; --up-weak: #fdecec; --down-weak: #e7f6ee;
  --warn: #d97706; --warn-weak: #fff7ed; --purple: #8e4ec6; --purple-weak: #f3ebfb;
  --cyan: #0891b2; --bench: #9ca3af; --row-on: #f2f6ff; --tip: rgba(17,24,39,.92); --mask: rgba(17,24,39,.35);
  --shadow: 0 12px 40px rgba(0,0,0,.14); --glow: 0 0 0 1px var(--brand-line), 0 6px 22px rgba(47,107,255,.10);
  --skel: #eef0f3; --skel2: #f7f8fa; --scroll: #d5d9e0;
  color-scheme: light;
}
:root {
  --radius: 12px; --side: 220px;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: var(--scroll) transparent; }
html, body { margin: 0; color: var(--text); font: 13.5px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
[data-theme="dark"] body { background: radial-gradient(1200px 600px at 85% -10%, rgba(76,141,255,.07), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(155,123,255,.05), transparent 60%), var(--bg); background-attachment: fixed; }
::selection { background: var(--brand-weak); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-track { background: transparent; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand2); }
button { font: inherit; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--sub); } .weak { color: var(--weak); }
.small { font-size: 12px; } .xs { font-size: 11px; }
.text2 { color: var(--text2); }

/* ---------- layout ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(12px); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.logo { padding: 18px 20px 14px; font-weight: 800; font-size: 16px; letter-spacing: .3px; font-family: var(--mono); display: flex; flex-direction: column; }
.logo b { background: linear-gradient(92deg, var(--brand), var(--brand2) 60%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo b::after { content: "_"; color: var(--brand); -webkit-text-fill-color: var(--brand); animation: blink 1.1s steps(1) infinite; margin-left: 1px; }
.logo small { display: block; font-weight: 400; font-size: 10.5px; color: var(--weak); margin-top: 3px; font-family: var(--mono); letter-spacing: 0; }
@keyframes blink { 50% { opacity: 0; } }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px; position: relative; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--sub); margin: 1px 0; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--card2); }
.nav a.on { color: var(--text); font-weight: 600; background: transparent; }
.nav a .kbd { margin-left: auto; opacity: 0; transition: opacity .15s; }
.nav a:hover .kbd { opacity: 1; }
.nav .ink { position: absolute; left: 10px; right: 10px; top: 0; height: 36px; border-radius: 9px; background: var(--brand-weak); box-shadow: inset 0 0 0 1px var(--brand-line); transition: transform .32s var(--spring), height .2s var(--ease), opacity .2s; pointer-events: none; z-index: 0; opacity: 0; }
.nav .ink::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.nav .ico { width: 18px; text-align: center; opacity: .9; font-family: var(--mono); }
.nav a.on .ico { color: var(--brand); }
.nav .sep { height: 1px; background: var(--line2); margin: 8px 6px; }
.side-foot { padding: 10px 14px 12px; border-top: 1px solid var(--line2); font-size: 11px; color: var(--sub); }
.clocks { display: grid; gap: 6px; margin-bottom: 8px; font-family: var(--mono); }
.clock { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line2); }
.clock .nm { font-size: 10.5px; color: var(--weak); }
.clock .tm { font-size: 13px; color: var(--text); text-align: right; letter-spacing: .5px; }
.clock .st { grid-column: 1 / -1; font-size: 10.5px; display: flex; align-items: center; gap: 6px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--weak); display: inline-block; flex: none; }
.dot.on { background: var(--down); box-shadow: 0 0 0 0 rgba(31,194,122,.6); animation: pulse 1.8s infinite; }
.dot.pre { background: var(--warn); }
.dot.off { background: var(--weak); }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(31,194,122,0); } 100% { box-shadow: 0 0 0 0 rgba(31,194,122,0); } }
.conn { font-family: var(--mono); font-size: 10.5px; color: var(--weak); line-height: 1.7; }
.main { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 19px; margin: 0; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.top h1::before { content: "~/"; font-family: var(--mono); color: var(--weak); font-weight: 400; margin-right: 4px; font-size: 15px; }
.cmdk-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--weak); padding: 5px 8px 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12px; transition: border-color .15s, color .15s, box-shadow .15s; }
.cmdk-btn:hover { border-color: var(--brand-line); color: var(--text); box-shadow: var(--glow); }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--card2); color: var(--sub); line-height: 1.5; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--sub); cursor: pointer; display: inline-grid; place-items: center; transition: color .15s, border-color .15s, transform .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--brand-line); }
.icon-btn:active { transform: scale(.92); }
.page { padding: 24px 28px 72px; max-width: 1480px; }
#progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), var(--brand2), var(--cyan)); box-shadow: 0 0 10px var(--brand); opacity: 0; transition: transform .4s var(--ease), opacity .3s; }
#progress.run { opacity: 1; }

/* ---------- 入场动效 ---------- */
.page.enter > * { animation: rise .42s var(--ease) both; }
.page.enter > *:nth-child(2) { animation-delay: .04s; } .page.enter > *:nth-child(3) { animation-delay: .08s; } .page.enter > *:nth-child(4) { animation-delay: .12s; }
.page.enter > *:nth-child(5) { animation-delay: .16s; } .page.enter > *:nth-child(6) { animation-delay: .2s; } .page.enter > *:nth-child(n+7) { animation-delay: .24s; }
.page.enter .grid > .card { animation: rise .45s var(--ease) both; }
.page.enter .grid > .card:nth-child(2) { animation-delay: .05s; } .page.enter .grid > .card:nth-child(3) { animation-delay: .1s; } .page.enter .grid > .card:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- controls ---------- */
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; position: relative; }
.seg button { border: 0; background: transparent; padding: 4px 13px; border-radius: 999px; cursor: pointer; color: var(--sub); transition: color .15s, background .2s, box-shadow .2s; white-space: nowrap; font-size: 12.5px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(0,0,0,.2); }
[data-theme="dark"] .seg button.on { background: var(--brand-weak); color: #cfe0ff; box-shadow: inset 0 0 0 1px var(--brand-line); }
.btn { border: 1px solid var(--line); background: var(--card); padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; white-space: nowrap; }
.btn:hover { border-color: var(--brand-line); background: var(--card2); }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 0 transparent; }
.btn.primary:hover { box-shadow: 0 0 22px color-mix(in srgb, var(--brand) 45%, transparent); }
.btn.danger { color: var(--up); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
input, select, textarea { font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--inner); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }
label.f input, label.f select { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.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)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; position: relative; transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: color-mix(in srgb, var(--brand-line) 55%, var(--line)); }
.card h3 { font-size: 13.5px; margin: 0 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.card h3 .r { margin-left: auto; font-weight: 400; }
.section { margin-top: 28px; content-visibility: auto; contain-intrinsic-size: auto 320px; }
.section > h2 { font-size: 14px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.section > h2::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand2)); }
.section > h2 .r { margin-left: auto; font-weight: 400; font-size: 12px; }
.kpi { overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--brand-line), transparent); opacity: .7; }
.kpi .l { font-size: 11.5px; color: var(--sub); letter-spacing: .3px; }
.kpi .v { font-size: 23px; font-weight: 700; margin-top: 3px; font-family: var(--mono); letter-spacing: -.5px; }
.kpi .s { font-size: 12px; color: var(--sub); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: var(--card2); color: var(--sub); white-space: nowrap; border: 1px solid var(--line2); line-height: 1.6; }
.pill.blue { background: var(--brand-weak); color: var(--brand); border-color: transparent; }
.pill.red { background: var(--up-weak); color: var(--up); border-color: transparent; }
.pill.green { background: var(--down-weak); color: var(--down); border-color: transparent; }
.pill.purple { background: var(--purple-weak); color: var(--purple); border-color: transparent; }
.pill.amber { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.pill.cyan { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bar { height: 6px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 999px; transform-origin: left; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.note { background: var(--warn-weak); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text2); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; }
.info { background: var(--brand-weak); border: 1px solid var(--brand-line); color: var(--text2); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; }
.empty { text-align: center; color: var(--weak); padding: 36px 12px; font-size: 13px; }
.empty::before { content: "∅"; display: block; font-family: var(--mono); font-size: 22px; opacity: .5; margin-bottom: 4px; }
.err { color: var(--up); background: var(--up-weak); border: 1px solid color-mix(in srgb, var(--up) 30%, transparent); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; }
.loading { color: var(--sub); padding: 36px 12px; text-align: center; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 骨架屏 */
.skel-wrap { display: grid; gap: 16px; }
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--skel) 25%, var(--skel2) 37%, var(--skel) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border: 1px solid var(--line2); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--weak); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; letter-spacing: .3px; text-transform: uppercase; }
table.t th.sort { cursor: pointer; user-select: none; transition: color .15s; }
table.t th.sort:hover { color: var(--text); }
table.t th[data-dir="asc"]::after { content: " ↑"; color: var(--brand); } table.t th[data-dir="desc"]::after { content: " ↓"; color: var(--brand); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t td.r { font-family: var(--mono); font-size: 12.5px; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .12s; }
table.t tbody tr:hover td { background: var(--row-on); }
table.t tr.click { cursor: pointer; }
table.t .r, table.t th.r { text-align: right; white-space: nowrap; }
table.t td.wrap { max-width: 420px; }
.flash-up { animation: flashU 1s ease; } .flash-down { animation: flashD 1s ease; }
@keyframes flashU { 0% { background: var(--up-weak); box-shadow: inset 0 0 0 1px var(--up); } 100% { background: transparent; } }
@keyframes flashD { 0% { background: var(--down-weak); box-shadow: inset 0 0 0 1px var(--down); } 100% { background: transparent; } }

/* ---------- proposals ---------- */
.prop { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 14px 16px; transition: border-color .2s; }
.prop:hover { border-color: var(--brand-line); }
.prop .hd { display: flex; align-items: center; gap: 10px; }
.prop .sym { font-size: 15px; font-weight: 700; }
.prop .lv { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.prop .lv div { background: var(--inner); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; }
.prop .lv b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.prop .lv b.rng { font-size: 12.5px; }
.prop .lv span { font-size: 11px; color: var(--sub); }
.prop .thesis { font-size: 12.5px; color: var(--text2); }
.prop .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--grid); } .chart .ax { fill: var(--weak); font-family: var(--mono); font-size: 10.5px; }
.chart .ref { stroke: var(--line); stroke-dasharray: 4 4; }
.chart .vl { stroke: var(--sub); stroke-dasharray: 3 3; }
.chart .hl { stroke: var(--sub); stroke-dasharray: 3 3; }
.chart .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }
.chart .ar { opacity: 0; animation: fade .9s .35s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .reveal { animation: reveal .9s var(--ease) both; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.chart .pt { transition: opacity .1s; }
.chart .tip { position: absolute; pointer-events: none; background: var(--tip); color: #e6edf3; font-size: 11.5px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -115%); display: none; z-index: 2; border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); font-family: var(--mono); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.chart .ylab { position: absolute; right: 0; transform: translate(0, -50%); background: var(--brand); color: #fff; font: 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; pointer-events: none; display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- modal / toast / palette ---------- */
.mask { position: fixed; inset: 0; background: var(--mask); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; animation: fade .18s ease; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; width: 460px; max-width: 100%; max-height: 90vh; overflow-y: auto; padding: 18px 20px; box-shadow: var(--shadow); animation: pop .26s var(--spring); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .body { display: flex; flex-direction: column; gap: 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--tip); color: #e6edf3; padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 60; opacity: 0; pointer-events: none; max-width: 90vw; border: 1px solid rgba(255,255,255,.08); transition: opacity .2s, transform .28s var(--spring); backdrop-filter: blur(8px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.palette { position: fixed; inset: 0; z-index: 70; background: var(--mask); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade .15s ease; }
.palette .box { width: 620px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow), var(--glow); overflow: hidden; animation: pop .22s var(--spring); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 15px 18px; font-size: 15px; box-shadow: none !important; }
.palette .list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .it { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--text2); }
.palette .it .g { font-size: 10.5px; color: var(--weak); font-family: var(--mono); margin-left: auto; }
.palette .it .ic { width: 20px; text-align: center; color: var(--sub); font-family: var(--mono); }
.palette .it.on { background: var(--brand-weak); color: var(--text); box-shadow: inset 0 0 0 1px var(--brand-line); }
.palette .it mark { background: none; color: var(--brand); font-weight: 700; }
.palette .ft { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--weak); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; position: relative; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s, border-color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-color: var(--brand); font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kv > div { background: var(--inner); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; }
.kv .k { font-size: 11px; color: var(--sub); } .kv .v { font-size: 15px; font-weight: 700; margin-top: 2px; font-family: var(--mono); }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bottom-nav { display: none; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; align-items: center; }

/* ---------- 事件日历 ---------- */
.cal-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-top .ttl { font: 700 18px var(--mono); letter-spacing: .5px; min-width: 110px; }
.cd-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cd { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .2s, transform .2s var(--ease); }
.cd:hover { border-color: var(--brand-line); transform: translateY(-2px); }
.cd::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--brand)); box-shadow: 0 0 12px var(--c, var(--brand)); }
.cd .t { font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd .n { font: 700 18px var(--mono); margin-top: 2px; letter-spacing: -.3px; }
.cd .n small { font-size: 11px; color: var(--weak); font-weight: 400; margin-left: 4px; }
.cd .m { font-size: 10.5px; color: var(--weak); font-family: var(--mono); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--sub); font-size: 12px; cursor: pointer; user-select: none; transition: all .15s; }
.cat-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.cat-chip.off { opacity: .45; }
.cat-chip.off i { box-shadow: none; }
.cat-chip:hover { border-color: var(--c); color: var(--text); }
.cat-chip b { font: 600 10.5px var(--mono); color: var(--weak); }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line2); gap: 1px; }
.cal-grid .wd { background: var(--card); padding: 7px 8px; font: 600 10.5px var(--mono); color: var(--weak); text-align: left; letter-spacing: .5px; }
.cal-day { background: var(--card); min-height: 104px; padding: 6px 6px 5px; cursor: pointer; position: relative; transition: background .15s; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:hover { background: var(--card2); }
.cal-day .dn { font: 600 12px var(--mono); color: var(--sub); display: flex; align-items: center; gap: 4px; }
.cal-day .dn .lab { font: 10px -apple-system, sans-serif; color: var(--weak); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-day.out { background: var(--bg2); } .cal-day.out .dn { color: var(--weak); opacity: .6; }
.cal-day.we .dn { color: var(--weak); }
.cal-day.closed { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--weak) 9%, transparent) 6px 7px); }
.cal-day.today .dn > span:first-child { background: var(--brand); color: #fff; border-radius: 6px; padding: 0 5px; box-shadow: 0 0 12px var(--brand); }
.cal-day.sel { box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--row-on); }
.ev-chip { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.45; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--c); }
.ev-chip.imp3 { color: var(--text); font-weight: 600; }
.ev-chip.focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }
.cal-day .more { font: 10.5px var(--mono); color: var(--weak); padding-left: 4px; }
.heat { position: absolute; right: 6px; top: 7px; display: flex; gap: 2px; }
.heat i { width: 4px; height: 4px; border-radius: 50%; background: var(--up); }
.agenda .day { position: sticky; top: 58px; z-index: 2; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); padding: 8px 2px 6px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); margin-top: 14px; }
.agenda .day b { font: 700 14px var(--mono); }
.agenda .day .rel { font-size: 11.5px; color: var(--brand); font-family: var(--mono); }
.agenda .day.today b { color: var(--brand); }
.ev { display: grid; grid-template-columns: 66px 1fr auto; gap: 10px; align-items: center; padding: 8px 8px; border-radius: 9px; cursor: pointer; position: relative; transition: background .12s; border-left: 2px solid var(--c); margin: 4px 0; background: var(--card); }
.ev:hover { background: var(--card2); }
.ev .tm { font: 11.5px var(--mono); color: var(--sub); }
.ev .tt { min-width: 0; }
.ev .tt .a { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .tt .b { font-size: 11px; color: var(--weak); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.ev.past { opacity: .5; }
.stars { font-size: 10px; letter-spacing: -1px; color: var(--warn); font-family: var(--mono); white-space: nowrap; }
.stars .o { color: var(--line); }
.day-panel { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; }
.day-panel .ev { background: var(--inner); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; background: var(--card); border-left: 1px solid var(--line); z-index: 55; box-shadow: var(--shadow); transform: translateX(102%); transition: transform .34s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .hd { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.drawer .hd h3 { margin: 0; font-size: 16px; line-height: 1.4; }
.drawer .bd { padding: 14px 18px 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.drawer-mask { position: fixed; inset: 0; background: var(--mask); z-index: 54; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row > div { background: var(--inner); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; }
.stat-row .k { font-size: 10.5px; color: var(--weak); } .stat-row .v { font: 700 16px var(--mono); margin-top: 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding: 4px 0 0; border-bottom: 1px dashed var(--line); position: relative; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 28px; border-radius: 4px 4px 1px 1px; transform-origin: bottom; animation: growY .6s var(--ease) both; }
.bars .b span { font: 10px var(--mono); color: var(--sub); margin-bottom: 2px; }
.bars .b em { position: absolute; bottom: -18px; font: normal 9.5px var(--mono); color: var(--weak); white-space: nowrap; }
@keyframes growY { from { transform: scaleY(0); } }
.nx { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); color: var(--text2); white-space: nowrap; }
.nx b { font-family: var(--mono); color: var(--c, var(--brand)); font-weight: 600; }

/* ---------- mobile ---------- */
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } .day-panel { position: static; max-height: none; } }
@media (max-width: 860px) {
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: 64px; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 17px; }
  .top h1::before { display: none; }
  .cmdk-btn .t, .cmdk-btn .kbd { display: none; }
  .cmdk-btn { padding: 0; width: 32px; height: 32px; justify-content: center; }
  .page { padding: 14px 12px 40px; }
  .g2, .g3, .g4, .g-main { grid-template-columns: minmax(0,1fr); }
  .g4.kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .prop .lv { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hide-m { display: none !important; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 60px; background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; color: var(--weak); gap: 2px; position: relative; transition: color .15s; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a .ico { font-size: 17px; line-height: 1; transition: transform .25s var(--spring); }
  .bottom-nav a.on { color: var(--brand); font-weight: 600; }
  .bottom-nav a.on .ico { transform: translateY(-2px) scale(1.12); }
  .bottom-nav a.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 10px var(--brand); animation: fade .25s; }
  .kpi .v { font-size: 19px; }
  table.t { font-size: 12.5px; }
  table.t td, table.t th { padding: 7px 6px; }
  .card h3 { flex-wrap: wrap; row-gap: 6px; }
  .cal-day { min-height: 58px; padding: 4px 3px; }
  .cal-day .ev-chip { display: none; }
  .cal-day .more { display: none; }
  .cal-day .dots { display: flex; }
  .cal-grid .wd { padding: 5px 4px; text-align: center; }
  .cal-day .dn { justify-content: center; }
  .cal-day .dn .lab { display: none; }
  .drawer { width: 100vw; top: auto; height: 86vh; border-radius: 16px 16px 0 0; border-left: 0; border-top: 1px solid var(--line); transform: translateY(102%); }
  .drawer.open { transform: none; }
  .agenda .day { top: 52px; }
  .ev { grid-template-columns: 50px 1fr auto; gap: 8px; }
  .cd-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-strip .cd:nth-child(n+5) { display: none; }
}
.cal-day .dots { display: none; gap: 2px; justify-content: center; margin-top: 3px; flex-wrap: wrap; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
.blink { animation: blink 1s steps(1) infinite; color: var(--brand); }
.ev .tm b { font-weight: 600; }
@media (max-width: 860px) {
  .cal-top { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px 2px; }
  .cal-top::-webkit-scrollbar, .cat-chips::-webkit-scrollbar, .cd-strip::-webkit-scrollbar { display: none; }
  .cal-top > * { flex: none; }
  .cal-top .grow { display: none; }
  .cal-top .ttl { font-size: 16px; min-width: 0; }
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .cat-chip { flex: none; }
  .cd-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -12px 14px; padding: 0 12px; }
  .cd-strip .cd { flex: 0 0 64%; scroll-snap-align: start; }
  .cd-strip .cd:nth-child(n+5) { display: block; }
}
@media (max-width: 860px) { .cal-day .dots { display: flex; } .cal-day .heat { display: none; } }

/* ---------- 智能回测 / 策略库 ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .lab { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; min-height: 520px; }
.msgs { flex: 1; min-height: 300px; max-height: 460px; overflow-y: auto; padding: 6px 2px 10px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.msg .bubble { max-width: 86%; padding: 9px 12px; border-radius: 12px; line-height: 1.6; font-size: 13px; white-space: normal; word-break: break-word; }
.msg.bot .bubble { background: var(--inner); border: 1px solid var(--line); color: var(--text2); border-top-left-radius: 4px; }
.msg.me .bubble { background: var(--brand-weak); border: 1px solid var(--brand-line); color: var(--text); border-top-right-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { border: 1px solid var(--line); background: var(--card2); color: var(--sub); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s, border-color .15s; }
.chip:hover { color: var(--text); border-color: var(--brand-line); }
.chat textarea { flex: 1; resize: vertical; min-height: 44px; }
.dsum { margin-top: 10px; padding: 10px 12px; background: var(--inner); border: 1px solid var(--line2); border-radius: 10px; font-size: 12.5px; line-height: 1.75; color: var(--text2); }
.note.warn { border-color: rgba(245,165,36,.35); background: var(--warn-weak); }
.scard { transition: border-color .15s, transform .15s; }
.scard:hover { border-color: var(--brand-line); }
.note .r { float: right; }

/* ---------- 侧栏分组 ---------- */
.nav .grp { font-size: 10.5px; color: var(--weak); letter-spacing: 1px; padding: 12px 12px 4px; font-weight: 600; }
.nav .grp:first-of-type { padding-top: 4px; }
.nav a { padding: 7px 12px; }

/* ---------- 个股页 ---------- */
.sk-search { position: relative; }
.sk-search input { width: 100%; padding: 9px 14px; border-radius: 999px; }
.sk-sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.sk-sug:empty { display: none; }
.sk-sug .it { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 8px 12px; cursor: pointer; align-items: center; }
.sk-sug .it.on, .sk-sug .it:hover { background: var(--row-on); }
a.chip { color: var(--text2); text-decoration: none; display: inline-block; }
.sk-px { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.sk-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 18px; margin-top: 12px; }
.sk-kv > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line2); font-size: 12.5px; min-width: 0; }
.sk-kv .k { color: var(--sub); white-space: nowrap; }
.sk-kv .v { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sk-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sk-leg { font-size: 11.5px; color: var(--sub); line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-leg b { color: var(--text); margin-right: 4px; }
.sk-leg span { margin-right: 6px; }
.sk-leg.sub { color: var(--weak); }
.bk { position: relative; display: grid; grid-template-columns: 36px 1fr 1fr; gap: 6px; padding: 3px 4px; font-size: 12.5px; align-items: center; }
.bk span:nth-child(2), .bk span:nth-child(3) { text-align: right; }
.bk i { position: absolute; right: 0; top: 2px; bottom: 2px; border-radius: 3px; pointer-events: none; }
.bk-mid { height: 1px; background: var(--line); margin: 5px 0; }
.sk-ratio { display: flex; height: 6px; border-radius: 6px; background: var(--down); overflow: hidden; margin-top: 6px; }
.sk-ratio i { display: block; height: 100%; background: var(--up); }
.sk-ratio.tri { background: var(--line); }
.sk-ticks { max-height: 360px; overflow-y: auto; }
.sk-ticks .tk { display: grid; grid-template-columns: 64px 1fr 1fr 34px; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.sk-ticks .tk span:nth-child(2), .sk-ticks .tk span:nth-child(3) { text-align: right; }
.sk-ticks .tk.big { background: var(--warn-weak); }
.sk-hbar { position: relative; height: 16px; min-width: 90px; background: var(--inner); border-radius: 4px; overflow: hidden; }
.sk-hbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-weak); box-shadow: inset 0 0 0 1px var(--brand-line); }
.sk-hbar span { position: relative; font-size: 11px; padding-left: 6px; line-height: 16px; }
.sk-fin td:first-child, .sk-fin th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; white-space: nowrap; }
.sk-fin td { white-space: nowrap; }
.sk-opt th.c, .sk-opt td.c { text-align: center; background: var(--inner); }
.sk-opt tr.sub th { font-size: 11px; padding-top: 0; }
.sk-opt td.itm { background: var(--brand-weak); }
.sk-opt tr.atm td { border-top: 1px solid var(--warn); }
tr.sk-me td { background: var(--row-on); font-weight: 600; }
#skTabs { position: sticky; top: 0; z-index: 5; background: var(--bg); }
@media (max-width: 1100px) { .sk-main { grid-template-columns: minmax(0, 1fr); } .sk-side { display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .sk-side { grid-template-columns: 1fr; } .sk-px { font-size: 26px; } .sk-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .sk-top { flex-wrap: wrap; }
  .sk-top #skTopSearch { flex: 1 1 100% !important; max-width: none !important; }
  .sk-top .grow { display: none; }
  .sk-top .btn { flex: 1; white-space: nowrap; }
}
