/* 主线罗盘：简洁、专业。颜色都用变量，深色模式单独取值。 */
:root {
  color-scheme: light;
  --page: #f6f6f4; --surface: #ffffff; --ink: #191919; --ink-2: #5f5f5f; --ink-3: #8a8a8a;
  --line: #e7e7e7; --axis: #c2c2c2; --accent: #1b64be; --accent-soft: #e8f1fc;
  --pos: #006c10; --neg: #c23030; --warn-bg: #fff4d6; --warn-ink: #7a5600;
  --big: rgba(37,125,224,0.13); --clear: rgba(120,120,120,0.16); --pull: rgba(37,125,224,0.07); --mid: #f47230;
  --future: rgba(37,125,224,0.10); --future-edge: #257de0;
  --s1:#257de0; --s2:#f47230; --s3:#00b894; --s4:#f2a600; --s5:#ee7fac; --s6:#008a17; --s7:#6a4ce2; --s8:#ec4647; --s9:#8a8a8a;
  --k-data:#e8f1fc; --k-computed:#e6f6ef; --k-backtest:#efeafc; --k-ai:#fff1e6; --k-scenario:#fdeef4; --k-hyp:#f1f1f1;
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0f0f0f; --surface: #191919; --ink: #efefef; --ink-2: #a8a8a8; --ink-3: #7c7c7c;
    --line: #303030; --axis: #474747; --accent: #6aabf1; --accent-soft: #1c2a3a;
    --pos: #53c556; --neg: #eb6263; --warn-bg: #3a2f10; --warn-ink: #f2c45a;
    --big: rgba(51,140,237,0.20); --clear: rgba(160,160,160,0.16); --pull: rgba(51,140,237,0.10); --mid: #e76624;
    --future: rgba(51,140,237,0.16); --future-edge: #338ced;
    --s1:#338ced; --s2:#e76624; --s3:#00a888; --s4:#d28e05; --s5:#e24d8b; --s6:#0aac23; --s7:#9887ef; --s8:#eb6263; --s9:#9c9c9c;
    --k-data:#1c2a3a; --k-computed:#16302a; --k-backtest:#2a2440; --k-ai:#3a2a1a; --k-scenario:#3a1f2c; --k-hyp:#2a2a2a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; letter-spacing: .01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; } h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
small { font-size: .82em; } code { font-size: .82em; word-break: break-all; }
.muted { color: var(--ink-3); } .neg { color: var(--neg); } .warn { background: var(--warn-bg); color: var(--warn-ink); padding: 0 .3em; border-radius: 3px; }
.strong { font-weight: 700; } .pre { white-space: pre-wrap; }

header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.4rem; padding: .7rem max(16px, calc((100vw - 1400px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); font-size: 1.05rem; white-space: nowrap; }
nav { display: flex; gap: 1.1rem; flex: 1; overflow-x: auto; }
nav a { color: var(--ink-2); padding: .2rem 0; white-space: nowrap; border-bottom: 2px solid transparent; }
nav a.on { color: var(--ink); border-color: var(--accent); } nav a.muted { margin-left: auto; }
.logout { margin: 0; }
main { max-width: 1400px; margin: 0 auto; padding: 1.2rem 16px 3rem; }
footer { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 1rem 16px 2rem; }

.intro { margin: .4rem 0 1rem; } .sub { color: var(--ink-2); margin: .2rem 0; max-width: 60rem; }
.crumb { color: var(--ink-3); font-size: .85rem; margin: 0 0 .4rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.card-h h2 { margin: 0; }
details.card > summary { cursor: pointer; list-style: none; } details.card > summary h2 { display: inline; }
details.card > summary::before { content: "▸ "; color: var(--ink-3); } details[open].card > summary::before { content: "▾ "; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 1rem; } .cols > .card { margin-bottom: 0; } .cols { margin-bottom: 1rem; }
.note { color: var(--ink-2); font-size: .84rem; margin: .6rem 0 0; }
.legend { color: var(--ink-2); font-size: .82rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: .5rem; vertical-align: middle; }
.sw.big { background: var(--big); outline: 1px solid var(--future-edge); } .sw.clear { background: var(--clear); }
.sw.pull { background: repeating-linear-gradient(45deg, var(--pull), var(--pull) 2px, transparent 2px, transparent 4px); outline: 1px solid var(--future-edge); }
.sw.mid { background: var(--mid); height: 4px; } .sw.future { background: var(--future); border: 1px dashed var(--future-edge); }
.sw.today { width: 2px; background: var(--ink-2); } .sw.line { background: var(--ink); height: 2px; } .sw.dash { border-top: 2px dashed var(--s1); height: 0; }

.chart { width: 100%; height: 380px; } .chart.tall { height: 520px; }
@media (max-width: 700px) { .chart { height: 320px; } .chart.tall { height: 440px; } h1 { font-size: 1.35rem; } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { color: var(--ink-2); font-weight: 600; font-size: .82rem; background: var(--surface); white-space: nowrap; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.voided td { color: var(--ink-3); text-decoration: line-through; }
table.score td.big { font-size: 1.2rem; font-weight: 700; width: 3rem; }
tr.layer-出清 td:first-child { color: var(--ink-3); } tr.layer-中周期 td:first-child { padding-left: 1.4rem; }
tr.layer-回调 td:first-child { color: var(--accent); } tr.layer-future td { color: var(--ink-2); font-style: italic; }

dl.facts { display: grid; grid-template-columns: 7.5rem 1fr; gap: .35rem .8rem; margin: .2rem 0; }
dl.facts dt { color: var(--ink-2); font-size: .85rem; } dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; } dl.facts dt { margin-top: .4rem; } }
.chip { display: inline-block; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: .05rem .55rem; margin: 0 .3rem .3rem 0; font-size: .82rem; }
.tag { display: inline-block; border-radius: 4px; padding: 0 .35rem; font-size: .76rem; color: var(--ink); white-space: nowrap; font-weight: 500; }
.tag.data { background: var(--k-data); } .tag.computed { background: var(--k-computed); } .tag.backtest { background: var(--k-backtest); }
.tag.ai_judgment { background: var(--k-ai); } .tag.scenario { background: var(--k-scenario); } .tag.hypothesis, .tag.user { background: var(--k-hyp); }
.status.succeeded { color: var(--pos); } .status.failed, .status.dead { color: var(--neg); } .status.running, .status.queued { color: var(--accent); }

.flash { border-radius: 8px; padding: .55rem .8rem; margin: 0 0 1rem; }
.flash.ok { background: var(--k-computed); } .flash.bad { background: var(--warn-bg); color: var(--warn-ink); }
.placeholder { border-style: dashed; background: transparent; }

form.form label { display: block; margin: 0 0 .6rem; font-size: .85rem; color: var(--ink-2); }
form.form label > input, form.form label > select, form.form label > textarea { display: block; width: 100%; margin-top: .2rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; } .row > label { flex: 1 1 9rem; } .row > .grow, .grow { flex: 3 1 16rem; }
form.row { margin: 0 0 .6rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; min-height: 2.3rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; min-height: 2.3rem; }
button.secondary { background: var(--accent-soft); color: var(--ink); } button.link { background: none; color: var(--ink-2); padding: 0; min-height: 0; }
.filters { display: flex; } .filters input { flex: 1; }

.run, .judg, .version { border-top: 1px solid var(--line); padding: .7rem 0; } .run:first-of-type { border-top: 0; }
.run-h, .judg-h { font-size: .85rem; color: var(--ink-2); } .judg p, .run p { margin: .3rem 0; }
.bars { display: grid; gap: .35rem; max-width: 40rem; } .bar-row { display: grid; grid-template-columns: 8rem 1fr 4rem; gap: .6rem; align-items: center; font-size: .88rem; }
.bar { background: var(--page); border-radius: 4px; height: 10px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }

body.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: min(92vw, 360px); } .login-card label { display: block; color: var(--ink-2); margin: 1rem 0; }
.login-card input { width: 100%; margin-top: .3rem; } .login-card button { width: 100%; }

/* ---------- 首页理解图 ---------- */
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: .7rem; margin: 0 0 1rem; }
.trait { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; }
.trait-n { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.trait-t { font-size: .86rem; color: var(--ink-2); } .trait-s { font-size: .74rem; color: var(--ink-3); margin-top: .2rem; }
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.mapwrap svg { width: 100%; height: auto; display: block; }
@media (max-width: 980px) { .mapwrap { grid-template-columns: 1fr; } }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin: 0 .15rem 0 .4rem; }
.dot.c-低 { background: var(--s3); } .dot.c-中 { background: var(--s4); } .dot.c-高 { background: var(--s8); }
.group-h { margin: 1.4rem 0 .6rem; font-size: 1.1rem; }
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.minis > .card { margin: 0; display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.mini-h { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; } .mini-h h3 { margin: 0; font-size: 1.05rem; }
.mini-h h3 a { color: var(--ink); }
.action { font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .05rem .6rem; background: var(--accent-soft); white-space: nowrap; }
.action.a-重仓守住, .action.a-持有 { background: var(--k-computed); } .action.a-减, .action.a-不碰 { background: var(--warn-bg); color: var(--warn-ink); }
.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; }
.four span { background: var(--page); border-radius: 6px; padding: .25rem .4rem; font-size: .88rem; font-weight: 600; text-align: center; }
.four em { display: block; font-style: normal; font-weight: 400; color: var(--ink-3); font-size: .72rem; }
.mini-p { margin: 0; font-size: .88rem; color: var(--ink-2); }
.minichart { position: relative; width: 100%; height: 230px; }
dl.hz { display: grid; grid-template-columns: 2.6rem 1fr; gap: .2rem .5rem; margin: 0; font-size: .84rem; }
dl.hz dt { color: var(--ink-3); } dl.hz dd { margin: 0; }
.mini-f { margin: auto 0 0; font-size: .84rem; display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.md { max-width: 62rem; } .md p, .md li { line-height: 1.7; } .md table { border-collapse: collapse; font-size: .88rem; margin: .6rem 0; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; text-align: left; vertical-align: top; } .md h2 { margin-top: 1.4rem; } .md h3 { margin-top: 1rem; }
.reasons li { margin: .25rem 0; } .reasons .src { color: var(--ink-3); font-size: .78rem; }

/* ---------- 进度条 ---------- */
.homemap { width: 100%; max-width: 760px; height: auto; display: block; margin: 0 auto; }
.progress { display: grid; gap: .9rem; }
.pb-axis { position: relative; height: 1.1rem; margin: 0 0 -.4rem; font-size: .72rem; color: var(--ink-3); }
.pb-axis span { position: absolute; transform: translateX(-50%); } .pb-axis span:nth-child(even) { visibility: hidden; }
@media (min-width: 900px) { .pb-axis span:nth-child(even) { visibility: visible; } }
.pr-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; font-size: .88rem; }
.pr-h a { font-weight: 700; color: var(--ink); font-size: .95rem; }
.st { font-size: .76rem; border-radius: 999px; padding: 0 .5rem; background: var(--page); color: var(--ink-2); white-space: nowrap; }
.st.s-进行中, .st.ml-进行中 { background: var(--k-computed); color: var(--ink); } .st.ml-已结束, .st.s-已结束 { background: var(--warn-bg); color: var(--warn-ink); }
.st.s-出清中 { background: var(--clear); color: var(--ink); }
.dots { display: inline-flex; gap: 3px; } .dots b { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--mid); display: inline-block; }
.dots b.on { background: var(--mid); } .dots b.cur { background: repeating-linear-gradient(45deg, var(--mid), var(--mid) 2px, transparent 2px, transparent 4px); }
.pb { position: relative; height: 16px; background: var(--page); border-radius: 4px; margin: .3rem 0 .2rem; overflow: hidden; }
.pb i { position: absolute; top: 0; bottom: 0; display: block; }
.pb-base { background: var(--line); } .pb-run { background: var(--s1); opacity: .85; top: 3px; bottom: 3px; border-radius: 3px; } .pb-run.done { background: var(--ink-3); }
.pb-peak { width: 3px; background: var(--neg); margin-left: -1px; } .pb-end { border: 2px solid var(--ink); border-radius: 3px; }
.pb-next { border: 2px dashed var(--s1); border-radius: 3px; } .pb-today { width: 2px; background: var(--ink); margin-left: -1px; }
.pr-t { font-size: .85rem; color: var(--ink-2); }
.sw.prog { background: var(--s1); } .sw.endwin { border: 2px solid var(--ink); background: transparent; } .sw.base { background: var(--line); }
.minichart.big { height: 380px; }
.bigcycle { margin: .2rem 0; font-size: .95rem; }
/* ---------- 首页：一句话 + 四层 + 卡片三块 ---------- */
.model-1 { font-size: 1.15rem; font-weight: 700; line-height: 1.6; margin: 0 0 .8rem; max-width: 62rem; }
.layers4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .6rem; }
.l4 { background: var(--page); border-radius: 8px; padding: .6rem .75rem; font-size: .86rem; display: grid; gap: .2rem; }
.l4-n { font-weight: 700; font-size: .95rem; } .l4-d { color: var(--ink); } .l4-w, .l4-e { color: var(--ink-2); font-size: .8rem; }
.blk { border-top: 1px solid var(--line); padding-top: .4rem; } .blk-h { font-size: .74rem; color: var(--ink-3); letter-spacing: .04em; margin-bottom: .2rem; }
.ex { margin: .15rem 0; font-size: .86rem; }
