/* Brain Benchmark — Palette 3 DARK（near-black + amber），E1 纪律全量落地 */
:root {
  --bg: oklch(12% 0.005 260);
  --bg-elevated: oklch(18% 0.01 260);
  --text: oklch(96% 0.005 90);
  --text-muted: oklch(65% 0.01 90);
  --border: oklch(25% 0.01 260);
  --accent: oklch(70% 0.16 60);
  --accent-fg: oklch(12% 0.005 260);
  --accent-soft: oklch(70% 0.16 60 / 0.14);
  --ok: oklch(70% 0.14 150);
  --danger: oklch(60% 0.18 25);
  --shadow-card-stacked: 0 1px 2px 0 oklch(0.06 0.02 260 / 0.5), 0 20px 40px -12px oklch(0.06 0.02 260 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.08);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Songti SC', 'SimSun', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.7; }
body.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' /></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
  mix-blend-mode: overlay;
}
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }
.wrap.narrow { max-width: 760px; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: 0; }
:lang(en) h1, :lang(en) h2 { letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.4rem); font-weight: 800; margin: 0.2em 0; }
h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--accent); }
h2 { font-size: 1.4rem; font-weight: 700; margin: 1.3em 0 0.5em; }
.sec-title { color: var(--text); }
p { margin: 0.5em 0; }
.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }
.mono-line { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: tabular-nums; }

.site-header { position: sticky; top: 0; z-index: 50; background: oklch(12% 0.005 260 / 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-in { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.brand { font-weight: 800; text-decoration: none; color: var(--text); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.visits { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lang-switch { text-decoration: none; font-size: 0.85rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-full); padding: 4px 12px; }
.lang-switch:hover { background: var(--accent-soft); }

.hero { padding: 64px 0 28px; }
.kicker { font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 62ch; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 700; border: 0; border-radius: var(--radius-full); padding: 12px 24px; font-size: 0.95rem; cursor: pointer; transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

/* 测试卡片 */
.test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.test-card { display: block; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-decoration: none; box-shadow: var(--shadow-card-stacked); transition: transform 0.15s ease, border-color 0.15s ease; }
.test-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.test-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.test-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 10px; }
.avg-line { font-size: 0.78rem; color: var(--accent); letter-spacing: 0.08em; }

/* 记录行 */
.records { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); overflow: hidden; }
.record-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.record-row:last-child { border-bottom: 0; }
.record-row b { color: var(--accent); }

/* 测试舞台 */
.test-area { display: flex; flex-direction: column; gap: 16px; }
.stage { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card-stacked); padding: 24px; min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.stage-hint { color: var(--text-muted); font-size: 0.9rem; margin: 12px 0 0; }
.test-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.score-strip { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--text-muted); }
.score-strip b { color: var(--text); }

/* reaction */
.rt-stage { padding: 0; cursor: pointer; }
.rt-box { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-elevated); transition: background-color 0.08s ease; }
.rt-box.wait { background: var(--danger); }
.rt-box.ready { background: var(--ok); }
.rt-box.false { background: var(--danger); }
.rt-box p { font-size: 1.5rem; font-weight: 800; color: var(--accent-fg); margin: 0; }
.rt-box.wait p, .rt-box.false p { color: #fff; }
.rt-count { font-size: 0.95rem !important; font-weight: 500 !important; opacity: 0.85; margin-top: 8px !important; }

/* sequence */
.seq-grid { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.seq-tile { width: 84px; height: 84px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: background-color 0.1s ease; }
.seq-tile.lit { background: var(--accent); }
.seq-tile.wrong { background: var(--danger); }
.seq-tile:hover { border-color: var(--accent); }

/* aim */
.aim-stage { cursor: crosshair; }
.aim-target { position: absolute; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: 0; cursor: pointer; transform: translate(-50%, -50%); transition: transform 0.08s ease; }
.aim-target:active { transform: translate(-50%, -50%) scale(0.92); }

/* number */
.num-show { font-size: clamp(2.4rem, 8vw, 4.2rem); font-weight: 800; letter-spacing: 0.12em; color: var(--text); }
.num-form { display: flex; gap: 10px; margin-top: 14px; }
.num-input { background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-md); color: var(--text); font: inherit; font-size: 1.2rem; padding: 10px 14px; width: 240px; text-align: center; letter-spacing: 0.1em; }
.num-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* chimp */
.chimp-grid { display: grid; grid-template-columns: repeat(4, 76px); gap: 8px; margin-top: 8px; }
.chimp-tile { height: 76px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 1.5rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chimp-tile.hit { background: var(--accent); color: var(--accent-fg); }
.chimp-tile.hidden-tile { color: transparent; background: var(--bg-elevated); }
.chimp-tile:hover { border-color: var(--accent); }
.chimp-tile.empty { visibility: hidden; }

/* verbal */
.verbal-word { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 800; color: var(--text); min-height: 1.3em; }
.verbal-btns { display: flex; gap: 12px; margin-top: 18px; }

/* 内容区 */
.crumbs { font-size: 0.85rem; color: var(--text-muted); margin-top: 24px; }
.crumbs a { text-decoration: none; }
.page-head { padding: 40px 0 8px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tips { padding-left: 1.2em; color: var(--text-muted); }
.tips li { margin: 8px 0; }
.tips li::marker { color: var(--accent); }

.faq { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.faq[open] summary::after { content: "−"; }
.faq p { color: var(--text-muted); margin: 0 0 12px; }

.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0; }
.footer-in { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer-note { font-size: 0.82rem; color: var(--text-muted); max-width: 62ch; margin: 0; }

html.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) { .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .test-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .seq-grid { grid-template-columns: repeat(3, 64px); }
  .seq-tile { width: 64px; height: 64px; }
  .chimp-grid { grid-template-columns: repeat(4, 56px); }
  .chimp-tile { height: 56px; font-size: 1.2rem; }
}
@media (max-width: 520px) {
  .header-in { flex-direction: column; align-items: flex-start; gap: 4px; }
  .header-right { margin-left: 0; }
}
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
