:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #fff;
  --surface-soft: #eef2fa;
  --ink: #18203d;
  --muted: #68718d;
  --line: #dce1ef;
  --brand: #425bc7;
  --brand-strong: #263b9e;
  --violet: #7750bd;
  --gold: #c88728;
  --success: #17835c;
  --danger: #b74b59;
  --shadow: 0 18px 48px rgba(38, 52, 112, .09);
  --radius: 20px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1427;
  --surface: rgba(25, 33, 63, .92);
  --surface-solid: #19213f;
  --surface-soft: #222c50;
  --ink: #f4f6ff;
  --muted: #aab2cf;
  --line: #344064;
  --brand: #91a5ff;
  --brand-strong: #b4c1ff;
  --violet: #c0a0f3;
  --gold: #f0bb69;
  --success: #74d8b0;
  --danger: #ff9aa7;
  --shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  min-height: 76px; padding: 12px max(20px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; }
.brand img { flex: 0 0 auto; }
.brand span { display: grid; }
.brand strong { font-size: 18px; letter-spacing: .04em; }
.brand small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.site-nav { justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.site-nav a { padding: 9px 13px; color: var(--muted); text-decoration: none; border-radius: 999px; font-size: 14px; font-weight: 700; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--brand-strong); background: var(--surface-solid); box-shadow: 0 3px 14px rgba(50, 66, 135, .08); }
.theme-toggle { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); cursor: pointer; font-size: 20px; }

main { width: min(var(--max), calc(100% - 32px)); margin: 26px auto 72px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.top-grid { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(0, .83fr); gap: 18px; }
.top-grid > *, .cursor-grid > *, .analysis-grid > * { min-width: 0; }
.live-panel, .recent-panel { min-width: 0; min-height: 260px; padding: 22px; }
.panel-kicker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.panel-kicker b { color: var(--ink); letter-spacing: .05em; }
.panel-kicker span:last-child { margin-left: auto; }
.pulse { width: 8px; height: 8px; margin-left: 0 !important; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 14%, transparent); }
.live-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 22px; }
.issue-label { color: var(--muted); font-size: 14px; }
.issue-label strong { color: var(--brand-strong); font-size: 18px; }
.equation { display: flex; align-items: center; gap: 9px; margin-top: 11px; white-space: nowrap; }
.equation b, .equation em { display: grid; place-items: center; width: 54px; height: 58px; border-radius: 18px; background: linear-gradient(150deg, var(--brand), var(--violet)); color: white; font-size: 28px; font-style: normal; box-shadow: 0 12px 24px color-mix(in srgb, var(--brand) 24%, transparent); }
.equation em { width: 66px; background: linear-gradient(145deg, #d69b40, #b56a1f); }
.equation i { color: var(--muted); font-style: normal; font-weight: 800; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; min-height: 29px; }
.tag-row span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.countdown-box { flex: 0 0 154px; display: grid; padding: 18px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.countdown-box small, .countdown-box span { color: var(--muted); font-size: 11px; }
.countdown-box strong { margin: 2px 0; color: var(--brand-strong); font-variant-numeric: tabular-nums; font-size: 34px; letter-spacing: -.04em; }
.live-meta { margin: 17px 0 0; color: var(--muted); font-size: 12px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-title span, .eyebrow { display: block; color: var(--brand); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.section-title h2 { margin: 2px 0 0; font-size: 20px; }
.section-title small { color: var(--muted); }
.recent-list { display: grid; gap: 7px; margin-top: 14px; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface-soft); }
.recent-row > div:first-child { min-width: 0; }
.recent-row time { display: block; color: var(--muted); font-size: 10px; }
.recent-row .mini-equation { display: flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 800; }
.recent-row .mini-equation b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; background: var(--surface-solid); color: var(--brand-strong); }
.recent-row strong { color: var(--gold); font-size: 19px; }
.empty { color: var(--muted); text-align: center; }

.replay-shell { margin-top: 44px; }
.replay-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 3px 18px; }
.replay-heading h1 { margin: 4px 0 4px; font-size: clamp(28px, 4vw, 46px); line-height: 1.12; letter-spacing: -.04em; }
.replay-heading p { margin: 0; color: var(--muted); }
.history-badge { flex: 0 0 auto; padding: 8px 13px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 999px; color: var(--gold); font-size: 13px; font-weight: 800; }
.replay-controls { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr auto auto; gap: 12px; padding: 16px; box-shadow: none; }
.replay-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-solid); padding: 10px 12px; }
input, select { min-height: 43px; }
button, .primary-button, .ghost-button { min-height: 43px; border-radius: 12px; cursor: pointer; font-weight: 800; }
.primary-button { display: inline-grid; place-items: center; padding: 10px 17px; border: 1px solid transparent; background: linear-gradient(135deg, var(--brand), var(--violet)); color: white; text-decoration: none; box-shadow: 0 9px 20px color-mix(in srgb, var(--brand) 22%, transparent); }
.ghost-button { padding: 10px 14px; border: 1px solid var(--line); background: var(--surface-solid); }
button:disabled { opacity: .46; cursor: not-allowed; }
.control-status { min-height: 24px; margin: 9px 8px; color: var(--muted); font-size: 12px; }
.timeline-panel { padding: 16px; overflow: hidden; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.transport button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 88px; padding: 8px 13px; border: 1px solid var(--line); background: var(--surface-solid); }
.transport .play-button { color: white; border-color: transparent; background: var(--brand); }
.transport .copy-link { min-width: 136px; margin-left: auto; color: var(--brand-strong); }
.film-track { display: flex; align-items: stretch; gap: 7px; margin: 18px -16px 0; padding: 8px 16px 14px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--brand) transparent; }
.film-frame { position: relative; flex: 0 0 92px; min-height: 66px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); text-align: left; cursor: pointer; }
.film-frame::before, .film-frame::after { content: ""; position: absolute; left: 7px; right: 7px; height: 3px; background: repeating-linear-gradient(90deg, var(--line) 0 7px, transparent 7px 13px); }
.film-frame::before { top: 4px; } .film-frame::after { bottom: 4px; }
.film-frame b { display: block; margin-top: 5px; font-size: 12px; }
.film-frame small { color: var(--muted); font-size: 10px; }
.film-frame[aria-current="true"] { color: white; border-color: transparent; background: linear-gradient(140deg, var(--brand), var(--violet)); transform: translateY(-3px); box-shadow: 0 9px 18px color-mix(in srgb, var(--brand) 27%, transparent); }
.film-frame[aria-current="true"] small { color: rgba(255,255,255,.8); }
.gap-marker { flex: 0 0 82px; display: grid; place-items: center; border: 1px dashed var(--danger); border-radius: 10px; color: var(--danger); font-size: 11px; text-align: center; white-space: pre-line; }
.timeline-note { margin: 7px 2px 0; color: var(--muted); font-size: 12px; }
.cursor-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 18px; margin-top: 18px; }
.cursor-result, .trend-panel, .omission-panel, .streak-panel { padding: 20px; }
.cursor-time { margin: 18px 0 2px; color: var(--muted); font-size: 12px; }
.cursor-result h2 { margin: 0; font-size: 20px; }
.replay-equation b, .replay-equation em { width: 48px; height: 52px; font-size: 24px; }
.sample-boundary { display: grid; gap: 2px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sample-boundary span, .sample-boundary small { color: var(--muted); font-size: 11px; }
.mini-trend { display: flex; align-items: flex-end; gap: 6px; min-height: 184px; margin-top: 18px; padding: 16px 5px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.trend-point { flex: 1 0 28px; display: grid; align-content: end; justify-items: center; height: 154px; gap: 5px; }
.trend-point i { width: 72%; min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(var(--violet), var(--brand)); }
.trend-point i.trend-sum-0, .trend-point i.trend-sum-1 { height: 4px; }
.trend-point i.trend-sum-2 { height: 9px; }
.trend-point i.trend-sum-3 { height: 13px; }
.trend-point i.trend-sum-4 { height: 17px; }
.trend-point i.trend-sum-5 { height: 22px; }
.trend-point i.trend-sum-6 { height: 26px; }
.trend-point i.trend-sum-7 { height: 31px; }
.trend-point i.trend-sum-8 { height: 35px; }
.trend-point i.trend-sum-9 { height: 39px; }
.trend-point i.trend-sum-10 { height: 44px; }
.trend-point i.trend-sum-11 { height: 48px; }
.trend-point i.trend-sum-12 { height: 52px; }
.trend-point i.trend-sum-13 { height: 57px; }
.trend-point i.trend-sum-14 { height: 61px; }
.trend-point i.trend-sum-15 { height: 66px; }
.trend-point i.trend-sum-16 { height: 70px; }
.trend-point i.trend-sum-17 { height: 74px; }
.trend-point i.trend-sum-18 { height: 79px; }
.trend-point i.trend-sum-19 { height: 83px; }
.trend-point i.trend-sum-20 { height: 87px; }
.trend-point i.trend-sum-21 { height: 92px; }
.trend-point i.trend-sum-22 { height: 96px; }
.trend-point i.trend-sum-23 { height: 101px; }
.trend-point i.trend-sum-24 { height: 105px; }
.trend-point i.trend-sum-25 { height: 109px; }
.trend-point i.trend-sum-26 { height: 114px; }
.trend-point i.trend-sum-27 { height: 118px; }
.trend-point b { font-size: 11px; }.trend-point small { color: var(--muted); font-size: 8px; transform: rotate(-35deg); transform-origin: center; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 18px; margin-top: 18px; }
.omission-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 15px; }
.omission-cell { display: grid; place-items: center; min-height: 58px; border-radius: 11px; background: var(--surface-soft); }
.omission-cell b { color: var(--brand-strong); font-size: 12px; }.omission-cell strong { font-size: 16px; }.omission-cell[data-hit="true"] { color: white; background: var(--brand); }.omission-cell[data-hit="true"] b { color: white; }
.boundary-copy { margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.streak-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 15px; }
.streak-card { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.streak-card span { display: block; color: var(--muted); font-size: 10px; }.streak-card strong { color: var(--brand-strong); font-size: 20px; }.streak-card small { color: var(--muted); }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.summary-strip div { padding: 9px; border-radius: 10px; background: var(--surface-soft); text-align: center; }.summary-strip b { display: block; font-size: 17px; }.summary-strip small { color: var(--muted); font-size: 9px; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px max(20px, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer p { margin: 0; }.site-footer nav { display: flex; gap: 16px; }.site-footer nav a { text-decoration: none; }.footer-brand strong { color: var(--ink); font-size: 14px; }

.narrow-main { width: min(860px, calc(100% - 32px)); }
.page-intro { margin: 42px 0 20px; }.page-intro h1 { margin: 3px 0; font-size: clamp(30px, 6vw, 48px); }.page-intro p { color: var(--muted); }
.scratch-card { padding: 22px; }
.scratch-board { position: relative; min-height: 330px; margin-top: 18px; overflow: hidden; border: 1px solid #d4deec; border-radius: 22px; background: #f7fafc url('/assets/scratch-orbits.png') center / cover no-repeat; touch-action: none; }
.scratch-result { position: absolute; inset: 0; z-index: 0; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; }
.scratch-result > span { color: #4e5b78; font-size: 14px; }.scratch-result > span b { color: #263b9e; }
.scratch-equation b, .scratch-equation em { width: 62px; height: 68px; font-size: 32px; }
.scratch-board canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; cursor: crosshair; }
.scratch-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.scratch-card[data-state="locked"] .scratch-board { filter: grayscale(.75); }

.chat-main { width: min(980px, calc(100% - 24px)); margin: 18px auto; }
.chat-shell { min-height: calc(100vh - 36px); overflow: hidden; }
.chat-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.return-button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--brand-strong); text-decoration: none; font-size: 13px; font-weight: 800; }
.chat-brand { justify-self: center; }.connection-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }.connection-pill > span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }.connection-pill[data-state="connected"] > span { background: var(--success); }.connection-pill[data-state="offline"] > span { background: var(--danger); }.connection-pill button { min-height: 30px; border: 0; background: transparent; color: var(--brand); }
.chat-body { display: grid; grid-template-columns: 190px 1fr; min-height: calc(100vh - 246px); }
.chat-profile { display: grid; align-content: start; justify-items: center; gap: 12px; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.profile-avatar { display: grid; place-items: center; width: 84px; height: 84px; overflow: hidden; border: 4px solid var(--surface-solid); border-radius: 28px; box-shadow: var(--shadow); }.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }.chat-profile label { width: 100%; color: var(--muted); font-size: 11px; }.chat-profile small { color: var(--muted); text-align: center; }
.chat-messages { max-height: calc(100vh - 246px); padding: 18px; overflow-y: auto; }
.chat-message { display: grid; grid-template-columns: 40px 1fr; gap: 10px; margin-bottom: 15px; }.chat-avatar { width: 40px; height: 40px; overflow: hidden; border-radius: 14px; background: var(--surface-soft); }.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }.chat-message header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.chat-message header b { font-size: 12px; }.chat-message header time { color: var(--muted); font-size: 9px; }.chat-message p { display: inline-block; max-width: min(620px, 100%); margin: 4px 0 0; padding: 9px 12px; border-radius: 4px 14px 14px; background: var(--surface-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }.chat-compose textarea { resize: none; }.chat-error { min-height: 20px; margin: 0; padding: 0 18px 10px; color: var(--danger); font-size: 11px; }

.not-found { width: min(600px, calc(100% - 32px)); margin: 12vh auto; padding: 54px 28px; text-align: center; }.not-found h1 { margin: 8px 0; font-size: clamp(30px, 6vw, 48px); }.not-found p { color: var(--muted); }.not-found .primary-button { display: inline-grid; margin-top: 16px; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; gap: 10px; }.site-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 1px; }.site-nav a { flex: 0 0 auto; }
  .top-grid, .cursor-grid, .analysis-grid { grid-template-columns: 1fr; }
  .replay-controls { grid-template-columns: repeat(2, 1fr); }.replay-controls button { align-self: end; }
  .site-footer { flex-wrap: wrap; }.chat-header { grid-template-columns: auto 1fr; }.connection-pill { grid-column: 1 / -1; }.chat-body { grid-template-columns: 150px 1fr; }
}

@media (max-width: 560px) {
  .site-header { padding: 10px 14px; }.brand img { width: 40px; height: 40px; }.brand small { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  main { width: min(100% - 20px, var(--max)); margin-top: 12px; }.top-grid { gap: 10px; }.live-panel, .recent-panel { min-height: auto; padding: 15px; }
  .live-main { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: flex-start; gap: 10px; }.live-main > div:first-child { min-width: 0; }.equation { gap: 3px; }.equation b, .equation em { width: clamp(32px, 10vw, 38px); height: 46px; border-radius: 14px; font-size: 22px; }.equation em { width: clamp(40px, 12vw, 46px); }.countdown-box { width: 100%; min-width: 0; padding: 13px 6px; }.countdown-box strong { font-size: 25px; }
  .recent-list .recent-row:nth-child(n+4) { display: none; }.recent-row { gap: 7px; }.recent-row .mini-equation b { width: 21px; height: 21px; }
  .replay-shell { margin-top: 30px; }.replay-heading { align-items: flex-start; }.replay-heading h1 { font-size: 30px; }.replay-heading p { font-size: 13px; }.history-badge { display: none; }
  .replay-controls { grid-template-columns: 1fr 1fr; gap: 9px; padding: 11px; }.replay-controls label:first-child { grid-column: 1 / -1; }.replay-controls button { padding-inline: 8px; font-size: 12px; }
  .timeline-panel { padding: 11px; }.transport { display: grid; grid-template-columns: repeat(4, 1fr); }.transport button { min-width: 0; padding: 7px 4px; font-size: 12px; }.transport button span { display: none; }.transport .copy-link { grid-column: 1 / -1; width: 100%; margin: 0; }.film-track { margin-inline: -11px; padding-inline: 11px; }
  .cursor-result, .trend-panel, .omission-panel, .streak-panel { padding: 15px; }.omission-grid { grid-template-columns: repeat(4, 1fr); }.streak-list { grid-template-columns: 1fr 1fr; }
  .site-footer { padding: 18px 14px; }.site-footer p { order: 3; width: 100%; }.footer-brand small { display: none; }
  .scratch-card { padding: 12px; }.scratch-board { min-height: 300px; }.scratch-equation b, .scratch-equation em { width: 46px; height: 52px; font-size: 24px; }
  .chat-main { width: 100%; margin: 0; }.chat-shell { min-height: 100vh; border-radius: 0; border: 0; }.chat-header { grid-template-columns: 1fr auto; padding: 10px; }.chat-brand { justify-self: start; }.chat-brand small { display: none; }.return-button { grid-column: 1 / -1; grid-row: 1; justify-self: start; }.chat-brand { grid-row: 2; }.connection-pill { grid-column: 2; grid-row: 2; }.chat-body { display: block; }.chat-profile { display: grid; grid-template-columns: 58px 1fr; align-items: center; justify-items: stretch; gap: 10px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }.profile-avatar { grid-row: 1 / 3; width: 58px; height: 58px; border-radius: 18px; }.chat-profile small { text-align: left; }.chat-messages { max-height: calc(100vh - 300px); min-height: 320px; padding: 12px; }.chat-compose { padding: 10px; }.chat-compose .primary-button { padding-inline: 13px; }
}

@media (max-width: 340px) {
  .brand small { max-width: 140px; }.site-nav a { padding: 8px 10px; font-size: 12px; }
  .live-main { grid-template-columns: 1fr; }.countdown-box { width: 100%; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: left; }.countdown-box strong { text-align: center; }.countdown-box span { text-align: right; }
  .replay-controls { grid-template-columns: 1fr; }.replay-controls label:first-child { grid-column: auto; }
  .omission-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }.omission-cell { min-height: 53px; }.summary-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* 2026-10-21 color system: royal blue + teal + coral, with a light sky canvas. */
:root {
  --bg: #eaf4ff;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --surface-soft: #e6f1ff;
  --ink: #102650;
  --muted: #526886;
  --line: #bcd2ef;
  --brand: #1854c9;
  --brand-strong: #0e377f;
  --violet: #3978e8;
  --teal: #079b87;
  --teal-soft: #d8f7ee;
  --coral: #ee6b5d;
  --coral-soft: #ffe2dc;
  --sky: #d9ecff;
  --navy: #0f3474;
  --gold: #e07831;
  --success: #07836e;
  --danger: #c64050;
  --shadow: 0 18px 44px rgba(18, 64, 139, .13);
}

html[data-theme="dark"] {
  --bg: #102d5c;
  --surface: rgba(25, 65, 117, .96);
  --surface-solid: #194578;
  --surface-soft: #20568b;
  --ink: #f3f8ff;
  --muted: #c0d8f2;
  --line: #4b78ab;
  --brand: #75a5ff;
  --brand-strong: #d9e8ff;
  --violet: #9dbdff;
  --teal: #45ddc0;
  --teal-soft: #176b70;
  --coral: #ff897c;
  --coral-soft: #874c58;
  --sky: #194a83;
  --navy: #0b2858;
  --gold: #ffad65;
  --success: #62e1bf;
  --danger: #ff9ba4;
  --shadow: 0 20px 50px rgba(4, 23, 55, .28);
  background: #102d5c;
}

body {
  background:
    radial-gradient(circle at 7% 8%, color-mix(in srgb, var(--teal) 13%, transparent) 0 14%, transparent 34%),
    radial-gradient(circle at 93% 28%, color-mix(in srgb, var(--coral) 12%, transparent) 0 10%, transparent 30%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 80%, #ffffff));
  background-attachment: fixed;
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.site-header {
  min-height: 92px;
  gap: 18px;
  color: #fff;
  border-bottom: 0;
  background: linear-gradient(112deg, #0e3476 0%, #1854c9 56%, #078f83 100%);
  box-shadow: 0 12px 32px rgba(8, 48, 111, .22);
  backdrop-filter: blur(18px) saturate(1.1);
}
.site-header::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, #4ce1c1 0 34%, #ff8a74 34% 67%, #8ab7ff 67%); }
.site-header > .brand { color: #fff; }
.site-header > .brand img { padding: 5px; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(3, 28, 72, .24); }
.site-header > .brand strong { color: #fff; }
.site-header > .brand small { color: #dbeaff; }
.site-nav { display: grid; grid-template-columns: repeat(4, minmax(116px, 1fr)); gap: 8px; width: min(100%, 650px); }
.site-nav a {
  display: grid; gap: 0; min-width: 0; padding: 7px 10px;
  color: #eaf4ff; border: 1px solid rgba(255,255,255,.28); border-radius: 13px;
  background: rgba(255,255,255,.09); box-shadow: none; text-align: left;
}
.site-nav a span { color: #9dd5ff; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.site-nav a strong { overflow: hidden; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.site-nav a:nth-child(2) span { color: #75efd6; }
.site-nav a:nth-child(3) span { color: #ffc0b4; }
.site-nav a:nth-child(4) span { color: #a9ecff; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #0e3476; border-color: #fff; background: #fff; box-shadow: 0 7px 20px rgba(6, 32, 79, .2); }
.site-nav a[aria-current="page"] span, .site-nav a:hover span { color: #087c72; }
.theme-toggle { color: #113b7c; border: 2px solid rgba(255,255,255,.75); background: #fff; box-shadow: 0 8px 18px rgba(5, 31, 75, .2); }

.panel { border-color: color-mix(in srgb, var(--line) 86%, var(--brand)); }
.live-panel {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(135deg, #0f3474 0%, #1a59c7 60%, #078f83 125%);
  box-shadow: 0 22px 50px rgba(14, 59, 135, .24);
}
.live-panel::after { content: ""; position: absolute; right: -56px; bottom: -86px; width: 230px; height: 230px; border: 34px solid rgba(85, 224, 195, .14); border-radius: 50%; pointer-events: none; }
.live-panel .panel-kicker, .live-panel .panel-kicker b, .live-panel .issue-label, .live-panel .live-meta { color: #dceaff; }
.live-panel .issue-label strong { color: #fff; }
.live-panel .pulse { background: #60efc6; box-shadow: 0 0 0 6px rgba(96,239,198,.18); }
.equation b { background: linear-gradient(150deg, #2d72e4, #1748ad); }
.equation b:nth-of-type(2) { background: linear-gradient(150deg, #17b69e, #07806f); }
.equation b:nth-of-type(3) { background: linear-gradient(150deg, #fa806e, #d84d56); }
.equation em { background: linear-gradient(145deg, #ff9b58, #e85d45); }
.live-panel .equation i { color: #cfe1ff; }
.classification-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.classification-row > b { padding: 4px 9px; border-radius: 999px; color: #fff; background: var(--teal); font-size: 11px; }
.classification-row .tag-row { margin-top: 0; }
.live-panel .classification-row > b { color: #0f3474; background: #75efd6; }
.live-panel .tag-row span { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.12); }
.live-panel .tag-row span:nth-child(2), .live-panel .tag-row span:nth-child(5) { border-color: rgba(117,239,214,.52); background: rgba(8,142,127,.5); }
.live-panel .tag-row span:nth-child(3) { border-color: rgba(255,190,178,.55); background: rgba(226,87,75,.55); }
.countdown-box { position: relative; z-index: 1; color: #12356e; border: 2px solid #b8f4e7; background: linear-gradient(155deg, #ffffff, #d6f8f0); box-shadow: 0 14px 28px rgba(4,31,77,.2); }
.countdown-box small, .countdown-box span { color: #496685; }
.countdown-box strong { color: #087e71; }

.recent-panel { overflow: hidden; border-color: #9ecdea; background: linear-gradient(160deg, rgba(255,255,255,.97), color-mix(in srgb, var(--teal-soft) 55%, #fff)); }
.recent-panel > .section-title { align-items: center; margin: -22px -22px 14px; padding: 13px 20px; color: #fff; background: linear-gradient(105deg, #1753bc, #078f83); }
.recent-panel > .section-title span, .recent-panel > .section-title small { color: #cbeeff; }
.recent-panel > .section-title h2 { color: #fff; }
.recent-list { margin-top: 0; }
.recent-row { border: 1px solid color-mix(in srgb, var(--line) 80%, #fff); border-left: 5px solid #3978e8; background: rgba(255,255,255,.76); }
.recent-row:nth-child(2) { border-left-color: #11a88f; }
.recent-row:nth-child(3) { border-left-color: #ee6b5d; }
.recent-row:nth-child(4) { border-left-color: #64a3f0; }
.recent-row:nth-child(5) { border-left-color: #20a798; }
.recent-row .mini-equation b:nth-child(1) { color: #1755c2; background: #d9e9ff; }
.recent-row .mini-equation b:nth-child(2) { color: #087e71; background: #d8f7ee; }
.recent-row .mini-equation b:nth-child(3) { color: #c84d47; background: #ffe2dc; }
.recent-row strong { color: #df5f3d; }

.replay-shell { padding: 28px; border: 1px solid #a9cbed; border-radius: 28px; background: linear-gradient(160deg, rgba(255,255,255,.68), color-mix(in srgb, var(--sky) 74%, transparent)); box-shadow: 0 28px 60px rgba(24,84,201,.1); }
.replay-heading { padding: 0 4px; }
.replay-heading h1 { color: var(--brand-strong); }
.history-badge { color: #fff; border: 0; background: linear-gradient(135deg, var(--coral), #f08d4f); box-shadow: 0 9px 22px rgba(238,107,93,.26); }
.replay-controls { border-top: 5px solid var(--teal); background: color-mix(in srgb, var(--surface-solid) 93%, var(--sky)); }
.replay-controls label:nth-child(2), .replay-controls label:nth-child(4) { color: #087c72; }
.primary-button { background: linear-gradient(135deg, #1854c9, #078f83); }
.ghost-button { color: var(--brand-strong); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.timeline-panel { color: #f1f7ff; border: 0; background: linear-gradient(135deg, #0f3474, #1b559f); box-shadow: 0 18px 40px rgba(8, 45, 103, .25); }
.timeline-panel .transport button { color: #10346e; border-color: #cde0fb; background: #fff; }
.timeline-panel .transport .play-button { color: #083d3a; background: #67e6c8; }
.timeline-panel .transport .copy-link { color: #fff; border-color: rgba(255,255,255,.36); background: rgba(255,255,255,.1); }
.timeline-panel .film-frame { color: #e7f1ff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.1); }
.timeline-panel .film-frame small, .timeline-note { color: #c5dbf5; }
.timeline-panel .film-frame[aria-current="true"] { color: #0f3474; background: linear-gradient(145deg, #b9ffed, #63dabe); }
.timeline-panel .film-frame[aria-current="true"] small { color: #245f68; }
.timeline-panel .gap-marker { color: #ffd2cb; border-color: #ff9c8f; background: rgba(238,107,93,.16); }

.cursor-result { border-top: 6px solid var(--coral); background: linear-gradient(155deg, var(--surface-solid), color-mix(in srgb, var(--coral-soft) 55%, var(--surface-solid))); }
.trend-panel { border-top: 6px solid var(--teal); background: linear-gradient(155deg, var(--surface-solid), color-mix(in srgb, var(--teal-soft) 55%, var(--surface-solid))); }
.omission-panel { border-top: 6px solid var(--brand); }
.streak-panel { border-top: 6px solid var(--coral); }
.trend-point i { background: linear-gradient(var(--teal), var(--brand)); }
.omission-cell:nth-child(4n+1) { background: color-mix(in srgb, var(--sky) 78%, var(--surface-solid)); }
.omission-cell:nth-child(4n+2) { background: color-mix(in srgb, var(--teal-soft) 74%, var(--surface-solid)); }
.omission-cell:nth-child(4n+3) { background: color-mix(in srgb, var(--coral-soft) 66%, var(--surface-solid)); }
.omission-cell[data-hit="true"] { background: linear-gradient(135deg, var(--brand), var(--teal)); }
.streak-card:nth-child(2n) { border-color: color-mix(in srgb, var(--coral) 45%, var(--line)); background: color-mix(in srgb, var(--coral-soft) 60%, var(--surface-solid)); }
.streak-card:nth-child(2n+1) { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); background: color-mix(in srgb, var(--teal-soft) 60%, var(--surface-solid)); }
.summary-strip div:nth-child(1) { background: var(--sky); }.summary-strip div:nth-child(2) { background: var(--teal-soft); }.summary-strip div:nth-child(3) { background: var(--coral-soft); }

.site-footer { border-top: 5px solid var(--teal); background: color-mix(in srgb, var(--surface-solid) 92%, var(--sky)); }
.site-footer nav { flex-wrap: wrap; }
.site-footer nav a { color: var(--brand-strong); font-weight: 750; }
.footer-brand strong { color: var(--brand-strong); }

.page-intro { padding: 22px 24px; border-left: 7px solid var(--coral); border-radius: 20px; background: linear-gradient(110deg, var(--surface-solid), color-mix(in srgb, var(--sky) 75%, var(--surface-solid))); box-shadow: var(--shadow); }
.page-intro h1 { color: var(--brand-strong); }
.scratch-card { border-top: 7px solid var(--teal); background: linear-gradient(145deg, var(--surface-solid), color-mix(in srgb, var(--teal-soft) 45%, var(--surface-solid))); }
.scratch-board { border: 4px solid #9fc9eb; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 16px 34px rgba(15,52,116,.13); }

.chat-main { position: relative; }
.chat-main::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(135deg, #dcecff, #e6fbf6 56%, #ffe9e4); }
html[data-theme="dark"] .chat-main::before { background: linear-gradient(135deg, #102d5c, #164f73 56%, #553e60); }
.chat-shell { border: 2px solid color-mix(in srgb, var(--brand) 38%, var(--line)); background: var(--surface-solid); }
.chat-header { color: #fff; border: 0; background: linear-gradient(105deg, #103778, #1854c9 55%, #078f83); }
.chat-header .brand strong { color: #fff; }.chat-header .brand small { color: #dceaff; }
.chat-header .return-button { color: #0f3474; border-color: #fff; background: #fff; }
.chat-header .connection-pill { color: #e4f1ff; }
.chat-header .connection-pill button { color: #75efd6; }
.chat-profile { background: linear-gradient(180deg, var(--sky), var(--teal-soft)); }
.chat-message:nth-child(3n+2) p { background: color-mix(in srgb, var(--teal-soft) 70%, var(--surface-solid)); }
.chat-message:nth-child(3n+3) p { background: color-mix(in srgb, var(--coral-soft) 64%, var(--surface-solid)); }
.chat-message header b[data-admin="true"]::after { content: "大厅管理"; margin-left: 6px; padding: 2px 6px; border-radius: 999px; color: #fff; background: var(--coral); font-size: 8px; }
.chat-compose { background: color-mix(in srgb, var(--sky) 48%, var(--surface-solid)); }

.content-main { width: min(1020px, calc(100% - 32px)); }
.content-hero { position: relative; overflow: hidden; margin: 34px 0 18px; padding: clamp(26px, 5vw, 48px); color: #fff; border-radius: 28px; background: linear-gradient(125deg, #103778 0%, #1b62d7 58%, #089383 100%); box-shadow: 0 22px 50px rgba(15,52,116,.22); }
.content-hero::after { content: ""; position: absolute; right: -44px; top: -60px; width: 210px; height: 210px; border: 30px solid rgba(255,255,255,.12); border-radius: 50%; }
.content-hero .eyebrow, .content-hero p { color: #dceaff; }
.content-hero h1 { max-width: 760px; margin: 6px 0 10px; font-size: clamp(30px, 5vw, 50px); line-height: 1.1; }
.content-hero p { max-width: 720px; margin: 0; }
.prose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.info-card { padding: 24px; }
.info-card:nth-child(4n+1) { border-top: 6px solid var(--brand); }.info-card:nth-child(4n+2) { border-top: 6px solid var(--teal); }.info-card:nth-child(4n+3) { border-top: 6px solid var(--coral); }.info-card:nth-child(4n) { border-top: 6px solid #62a0e9; }
.info-card h2 { margin: 0 0 8px; color: var(--brand-strong); font-size: 21px; }.info-card h3 { color: var(--brand-strong); }
.info-card p, .info-card li { color: var(--muted); }.info-card a { color: var(--brand); font-weight: 750; }
.info-card ul, .info-card ol { padding-left: 20px; }
.notice-card { grid-column: 1 / -1; color: #fff; border: 0; background: linear-gradient(110deg, #0f3474, #17608f); }
.notice-card h2, .notice-card p, .notice-card li { color: #fff; }
.route-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }.route-links a { padding: 12px; border-radius: 13px; color: var(--brand-strong); background: var(--surface-soft); text-decoration: none; }
.method-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.method-section .info-card { background: color-mix(in srgb, var(--surface-solid) 90%, var(--sky)); }
.method-section .info-card:nth-child(2) { background: color-mix(in srgb, var(--surface-solid) 90%, var(--teal-soft)); }
.method-section p { margin: 9px 0 0; }.method-section a { color: var(--brand); font-weight: 800; }

html[data-theme="dark"] .recent-panel,
html[data-theme="dark"] .cursor-result,
html[data-theme="dark"] .trend-panel,
html[data-theme="dark"] .replay-shell,
html[data-theme="dark"] .page-intro,
html[data-theme="dark"] .scratch-card { background: linear-gradient(150deg, #194578, #1c537f); }
html[data-theme="dark"] .recent-row { background: #20568b; }
html[data-theme="dark"] .recent-row .mini-equation b { color: #eff6ff; background: #164273; }
html[data-theme="dark"] .countdown-box { color: #0e3476; background: linear-gradient(155deg, #f7ffff, #bdf2e5); }
html[data-theme="dark"] .countdown-box strong { color: #087568; }
html[data-theme="dark"] .classification-row > b { color: #0f3474; }
html[data-theme="dark"] .summary-strip div { color: #f3f8ff; background: #245d90; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 0; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; overflow: visible; padding: 0 0 3px; }
  .site-nav a { min-width: 0; }
  .replay-shell { padding: 20px; }
}

@media (max-width: 560px) {
  .site-header { gap: 8px; }
  .site-header::after { height: 3px; }
  .site-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .site-nav a { padding: 5px 9px; }
  .site-nav a span { font-size: 8px; }.site-nav a strong { font-size: 12px; }
  .recent-panel > .section-title { margin: -15px -15px 12px; padding: 11px 14px; }
  .classification-row { margin-top: 10px; }
  .classification-row > b { padding: 3px 7px; font-size: 9px; }
  .tag-row { min-height: 0; }.tag-row span { padding: 3px 7px; font-size: 10px; }
  .replay-shell { margin-inline: -2px; padding: 14px 10px 18px; border-radius: 22px; }
  .content-main { width: min(100% - 20px, 1020px); }
  .content-hero { margin-top: 14px; padding: 24px 19px; border-radius: 22px; }
  .prose-grid { grid-template-columns: 1fr; gap: 10px; }.info-card { padding: 18px; }.notice-card { grid-column: auto; }
  .method-section { grid-template-columns: 1fr; gap: 10px; }
  .route-links { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  .site-nav a { padding-inline: 7px; }
  .site-nav a strong { font-size: 11px; }
  .live-panel .panel-kicker span:last-child { font-size: 10px; }
  .classification-row { display: grid; }.classification-row > b { justify-self: start; }
}
