:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #edf2f9;
  --text: #152033;
  --muted: #637087;
  --line: #dce3ee;
  --accent: #4b5cf0;
  --accent-2: #dfe3ff;
  --good: #11845b;
  --warn: #a66a00;
  --danger: #bb3c4e;
  --shadow: 0 10px 30px rgba(30, 48, 90, .08);
  --radius: 18px;
  --max: 1160px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0c1220; --surface:#141d2d; --surface-2:#1c2940; --text:#edf3ff; --muted:#a8b5cb; --line:#293850; --accent:#9aa6ff; --accent-2:#2c355f; --shadow:0 12px 35px rgba(0,0,0,.25); }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); min-width:320px; }
button, input, textarea { font:inherit; }
button { cursor:pointer; }
#app-shell { min-height:100vh; padding-bottom:80px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:20px; max-width:var(--max); margin:0 auto; padding:28px 20px 16px; }
.eyebrow { margin:0 0 6px; color:var(--accent); font-size:11px; font-weight:800; letter-spacing:.14em; }
h1 { margin:0; font-size:clamp(25px,5vw,38px); letter-spacing:-.04em; }
h2 { margin:0; font-size:clamp(21px,4vw,29px); letter-spacing:-.03em; }
h3 { margin:0; font-size:17px; }
p { line-height:1.65; }
.status-pill, .tag, .state { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:7px 10px; font-size:12px; font-weight:750; white-space:nowrap; }
.status-neutral { background:var(--surface-2); color:var(--muted); }
.status-good, .state-supported { background:#dff5e9; color:var(--good); }
.status-warn, .state-deep { background:#fff0c9; color:var(--warn); }
.status-danger, .state-risk { background:#ffe1e5; color:var(--danger); }
.state-watch { background:#dfe8ff; color:#3854b2; }
.state-dislocation { background:#e9ddff; color:#6b32bd; }
.state-unknown { background:var(--surface-2); color:var(--muted); }
.stale-banner { max-width:var(--max); margin:0 auto 10px; padding:10px 20px; color:#875c00; background:#fff3c9; border-top:1px solid #f4d989; border-bottom:1px solid #f4d989; font-size:13px; }
.hidden { display:none !important; }
#view { max-width:var(--max); margin:0 auto; padding:12px 20px 28px; }
.section { margin:22px 0 0; }
.section-head { display:flex; align-items:end; justify-content:space-between; gap:15px; margin-bottom:12px; }
.section-head p { margin:0; color:var(--muted); font-size:13px; }
.grid { display:grid; gap:14px; }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:17px; }
.card.soft { background:var(--surface-2); box-shadow:none; }
.hero-card { padding:22px; background:linear-gradient(135deg,var(--surface),var(--accent-2)); }
.hero-card p { margin:8px 0 0; color:var(--muted); }
.story-card { display:grid; gap:12px; }
.story-card .story-top { display:flex; justify-content:space-between; gap:12px; align-items:start; }
.story-card .story-title { font-size:17px; font-weight:800; }
.meta { display:flex; flex-wrap:wrap; gap:8px; color:var(--muted); font-size:12px; }
.muted { color:var(--muted); }
.empty { text-align:center; padding:30px 16px; color:var(--muted); border:1px dashed var(--line); border-radius:var(--radius); }
.empty strong { color:var(--text); display:block; margin-bottom:6px; }
.asset-row { display:grid; grid-template-columns:1.25fr .8fr .8fr 1.1fr; align-items:center; gap:10px; padding:13px 0; border-bottom:1px solid var(--line); }
.asset-row:last-child { border-bottom:0; }
.asset-symbol { font-weight:800; }
.asset-name { color:var(--muted); font-size:12px; margin-top:3px; }
.metric { font-variant-numeric:tabular-nums; }
.metric strong { display:block; font-size:17px; }
.metric small { color:var(--muted); font-size:11px; }
.button { display:inline-flex; align-items:center; justify-content:center; min-height:42px; border:1px solid var(--line); border-radius:12px; padding:9px 14px; background:var(--surface); color:var(--text); font-weight:750; }
.button.primary { background:var(--accent); color:white; border-color:var(--accent); }
.button.ghost { background:transparent; }
.button:focus-visible, input:focus-visible, textarea:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 40%, transparent); outline-offset:2px; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:16px 0; }
.toolbar input, .toolbar select, textarea, input { width:100%; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:12px; padding:11px 12px; }
.toolbar input { max-width:320px; }
.timeline { position:relative; display:grid; gap:12px; padding-left:17px; }
.timeline::before { content:""; position:absolute; left:4px; top:5px; bottom:5px; width:2px; background:var(--line); }
.timeline-item { position:relative; }
.timeline-item::before { content:""; position:absolute; left:-17px; top:5px; width:8px; height:8px; background:var(--accent); border-radius:50%; box-shadow:0 0 0 4px var(--surface); }
.timeline-item time { display:block; font-size:11px; color:var(--muted); margin-bottom:3px; }
.timeline-item strong { display:block; }
.probability { display:grid; gap:8px; }
.prob-row { display:grid; grid-template-columns:58px 1fr 48px; gap:8px; align-items:center; font-size:12px; }
.bar { height:9px; background:var(--surface-2); border-radius:10px; overflow:hidden; }
.bar span { display:block; height:100%; background:var(--accent); border-radius:10px; }
.notice { padding:13px; border-left:4px solid var(--accent); background:var(--surface-2); color:var(--muted); border-radius:10px; font-size:13px; }
.notice strong { color:var(--text); }
.form-stack { display:grid; gap:12px; }
.form-stack label { display:grid; gap:6px; color:var(--muted); font-size:13px; font-weight:700; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.bottom-nav { position:fixed; z-index:10; left:0; right:0; bottom:0; display:flex; justify-content:center; gap:2px; padding:8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background:color-mix(in srgb,var(--surface) 92%, transparent); border-top:1px solid var(--line); backdrop-filter:blur(16px); }
.nav-item { display:grid; place-items:center; gap:2px; min-width:58px; border:0; background:transparent; color:var(--muted); padding:7px 9px; border-radius:12px; }
.nav-item span { font-size:20px; line-height:1; }
.nav-item small { font-size:10px; }
.nav-item.active { color:var(--accent); background:var(--accent-2); }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { text-align:left; padding:11px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-size:11px; font-weight:700; }
.footer-note { margin-top:24px; color:var(--muted); font-size:12px; }
@media (max-width:720px) {
  #view { padding-left:14px; padding-right:14px; }
  .topbar { padding-left:14px; padding-right:14px; }
  .grid-2, .grid-3 { grid-template-columns:1fr; }
  .asset-row { grid-template-columns:1.25fr .75fr; }
  .asset-row > :nth-child(3), .asset-row > :nth-child(4) { grid-column:auto; }
  .hero-card { padding:18px; }
  .card { border-radius:16px; }
}
