/* =====================================================================
   DyslexiaSim · 样式
   ===================================================================== */
:root {
  --bg: #F6F4EF; --bg-2: #EFECE4; --surface: #FFFFFF; --surface-2: #FAF9F6;
  --ink: #141821; --ink-2: #3A404D; --muted: #6A7080; --line: #E4E0D6; --line-2: #D4CFC2;
  --brand: #1F3A6E; --brand-2: #2C4F91; --brand-ink: #FFFFFF; --brand-soft: rgba(31, 58, 110, .07);
  --accent: #C2453D; --accent-soft: rgba(194, 69, 61, .1); --gold: #B8914A; --gold-soft: rgba(184, 145, 74, .14);
  --ok: #2F8A57; --ok-soft: rgba(47, 138, 87, .1); --warn: #B7791F;
  --shadow: 0 1px 2px rgba(20, 24, 33, .04), 0 10px 30px -14px rgba(20, 24, 33, .14);
  --shadow-lg: 0 2px 4px rgba(20, 24, 33, .05), 0 30px 60px -20px rgba(20, 24, 33, .28);
  --overlay: rgba(14, 17, 22, .55); --cal-bg: #EEECE6;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --serif-en: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 18px; --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1015; --bg-2: #12161D; --surface: #161B23; --surface-2: #1B212B;
    --ink: #ECE8DF; --ink-2: #C9C5BC; --muted: #8E95A3; --line: #262D39; --line-2: #343C4A;
    --brand: #8EAEF2; --brand-2: #A9C1F5; --brand-ink: #0D1015; --brand-soft: rgba(142, 174, 242, .1);
    --accent: #F07167; --accent-soft: rgba(240, 113, 103, .12); --gold: #D8B46A; --gold-soft: rgba(216, 180, 106, .12);
    --ok: #5CC08A; --ok-soft: rgba(92, 192, 138, .12); --warn: #E0A040;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    --overlay: rgba(5, 7, 10, .7); --cal-bg: #111419;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1015; --bg-2: #12161D; --surface: #161B23; --surface-2: #1B212B;
  --ink: #ECE8DF; --ink-2: #C9C5BC; --muted: #8E95A3; --line: #262D39; --line-2: #343C4A;
  --brand: #8EAEF2; --brand-2: #A9C1F5; --brand-ink: #0D1015; --brand-soft: rgba(142, 174, 242, .1);
  --accent: #F07167; --accent-soft: rgba(240, 113, 103, .12); --gold: #D8B46A; --gold-soft: rgba(216, 180, 106, .12);
  --ok: #5CC08A; --ok-soft: rgba(92, 192, 138, .12); --warn: #E0A040;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  --overlay: rgba(5, 7, 10, .7); --cal-bg: #111419;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.65; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .01em;
  padding: 12px 20px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px -8px var(--brand); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { font-size: 15px; padding: 15px 24px; border-radius: 13px; }
.btn-sm { font-size: 13px; padding: 8px 13px; border-radius: 9px; }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* 分段选择 */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button {
  border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 7px 13px; border-radius: 8px; transition: background .15s, color .15s; white-space: nowrap;
}
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg button:disabled { cursor: default; opacity: .6; }
.seg button:disabled.on { opacity: 1; }
.seg-sm button { font-size: 12px; padding: 5px 10px; }
.seg-full { display: flex; } .seg-full button { flex: 1; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo { width: 32px; height: 32px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.brand-t b { font-size: 15px; letter-spacing: -.01em; }
.brand-t i { font-style: normal; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--brand-soft); color: var(--ink); }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
}
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.pill[data-state="eye"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.pill[data-state="eye"] .pdot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: pulse 1.6s infinite; }
.pill[data-state="mouse"] { color: var(--brand); }
.pill[data-state="mouse"] .pdot { background: var(--brand); }
.pill[data-state="setup"] .pdot { background: var(--gold); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
html:not([data-theme="dark"]) .i-moon { display: block; } html:not([data-theme="dark"]) .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: none; } html[data-theme="dark"] .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .i-moon { display: none; } html:not([data-theme]) .i-sun { display: block; }
}

/* ---------- 首屏 ---------- */
.hero { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; padding-top: 76px; padding-bottom: 40px; }
.eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 5vw, 56px); line-height: 1.16;
  letter-spacing: -.015em; color: var(--ink); margin-bottom: 22px;
}
html[lang="en"] .hero h1 { font-family: var(--serif-en); letter-spacing: -.02em; }
.lead { font-size: 17px; line-height: 1.8; color: var(--ink-2); max-width: 560px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { list-style: none; display: flex; gap: 0; margin-top: 40px; border-top: 1px solid var(--line); }
.hero-facts li { flex: 1; padding: 18px 18px 0 0; display: flex; flex-direction: column; gap: 2px; }
.hero-facts li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.hero-facts b { font-family: var(--serif-en); font-size: 26px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.hero-facts span { font-size: 12.5px; color: var(--muted); }
.hero-demo { padding: 0; overflow: hidden; }
.hero-demo figcaption {
  display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); letter-spacing: .02em;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.4s infinite; }
.hero-stage { position: relative; padding: 34px 36px 38px; overflow: hidden; min-height: 290px; }
.hero-field { font-family: var(--serif); font-size: 25px; line-height: 2.15; color: var(--ink); }
html[lang="en"] .hero-field { font-family: var(--serif-en); font-size: 24px; line-height: 1.95; }

/* ---------- 区块 ---------- */
.section { padding-top: 104px; }
.section-head { display: grid; grid-template-columns: 56px 1fr; gap: 8px 20px; margin-bottom: 30px; align-items: start; }
.kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 99px; height: 30px; display: grid; place-items: center; margin-top: 6px;
}
.section-head h2 { font-family: var(--serif); font-size: clamp(26px, 3.2vw, 36px); line-height: 1.25; letter-spacing: -.01em; margin-bottom: 8px; }
html[lang="en"] .section-head h2 { font-family: var(--serif-en); }
.section-head p { color: var(--ink-2); max-width: 720px; font-size: 15.5px; }

/* ---------- 模拟器 ---------- */
.sim-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.select { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.select select {
  appearance: none; -webkit-appearance: none; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E") right 12px center / 11px no-repeat;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 36px 9px 13px; min-width: 200px; max-width: 100%;
}
.stage { position: relative; overflow: hidden; padding: 46px 54px 52px; min-height: 430px; }
.field { position: relative; }
#passage, #testPassage, .scan-text { font-family: var(--serif); font-size: 25px; line-height: 2.3; letter-spacing: .02em; color: var(--ink); }
#testPassage, .scan-text { font-size: 24px; }
.field.is-en { font-family: var(--serif-en) !important; font-size: 23px !important; line-height: 2.05 !important; letter-spacing: 0 !important; }
.ch { display: inline-block; position: relative; will-change: transform; transform-origin: 50% 55%; }
.halo {
  position: absolute; left: 0; top: 0; display: none; border-radius: 50%; pointer-events: none; z-index: 0;
  border: 1.5px dashed color-mix(in srgb, var(--brand) 40%, transparent);
  background: radial-gradient(circle, var(--brand-soft) 0%, transparent 70%);
}
.hud { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; pointer-events: none; }
.hud span {
  font-size: 11.5px; font-weight: 600; font-family: var(--mono); color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 7px;
}
.hud .hud-warn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); font-family: var(--sans); }
.stage-start {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.ss-card { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; box-shadow: var(--shadow-lg); max-width: 440px; }
.ss-t { font-weight: 700; font-size: 16px; margin-bottom: 16px; }
.ss-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ss-n { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.custom { margin-top: 14px; padding: 18px 20px; }
.custom-l { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.custom textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); resize: vertical;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; min-height: 96px;
}
.custom-r { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

.sim-side { position: sticky; top: 82px; padding: 6px 20px; max-height: calc(100vh - 100px); overflow: auto; }
.side-sec { padding: 16px 0 18px; }
.side-sec + .side-sec { border-top: 1px solid var(--line); }
.side-sec h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.src-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.src-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 6px 9px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.src-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.src-btn:hover { border-color: var(--line-2); color: var(--ink); }
.src-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.status { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.status.on { color: var(--ok); font-weight: 600; }
.eye-extra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.eye-extra .switch-row { flex: 0 0 auto; padding: 0; gap: 10px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; cursor: pointer; position: relative; }
.switch-row > span { display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.35; }
.switch-row b { font-weight: 600; }
.switch-row small { font-size: 11.5px; color: var(--muted); }
.switch-row.compact > span { font-size: 13px; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { flex: 0 0 auto; width: 36px; height: 21px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .18s; }
.sw::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.switch-row input:checked + .sw { background: var(--brand); }
.switch-row input:checked + .sw::after { transform: translateX(15px); }
.switch-row input:focus-visible + .sw { outline: 2px solid var(--brand); outline-offset: 2px; }

.slider + .slider { margin-top: 14px; }
.slider-l { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.slider-l output { font-family: var(--mono); font-size: 12px; color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; accent-color: var(--brand); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); margin-top: -7px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.side-field { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.side-fl { font-size: 13px; color: var(--ink-2); }
.side-field small { font-size: 11.5px; line-height: 1.5; }

/* ---------- 测试 ---------- */
.test { padding: 30px 34px; }
.test-step { display: none; }
.test-step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.cond-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cond { border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px 14px; text-align: center; background: var(--surface-2); }
.cond-n { font-family: var(--serif-en); font-size: 30px; color: var(--brand); line-height: 1.1; }
.cond-n small { font-size: 13px; color: var(--muted); margin-left: 2px; font-family: var(--sans); }
.cond-l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.test-notes { margin: 22px 0 4px 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.test-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.need-src { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--accent); font-weight: 600; flex-wrap: wrap; }
.read-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-bottom: 16px; }
.read-bar .btn { justify-self: end; }
.read-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 99px; }
.timer { font-family: var(--serif-en); font-size: 40px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.timer small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.test-stage { box-shadow: none; background: var(--surface-2); min-height: 0; padding: 40px 48px; }
.step-h { font-family: var(--serif); font-size: 22px; margin-bottom: 16px; }
.q-block { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 12px; margin-bottom: 14px; }
.q-block legend { font-weight: 700; font-size: 15px; padding: 0 6px; margin-left: -6px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; border: 1px solid transparent; margin-top: 6px; }
.opt:hover { background: var(--surface-2); }
.opt input { accent-color: var(--brand); width: 16px; height: 16px; flex: 0 0 auto; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.rep-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 22px; }
.kpi { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.kpi-l { font-size: 12px; color: var(--muted); }
.kpi b { font-family: var(--serif-en); font-size: 28px; font-weight: 600; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--muted); }
.rep-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.rep-block { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.rep-block h4 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.bar-l { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; }
.bar-l small { font-weight: 400; color: var(--muted); font-size: 11px; }
.bar-t { height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar-t i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar-row:last-child .bar-t i { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--gold))); }
.bar-v { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.result { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.result th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 10px 10px 0; border-bottom: 1px solid var(--line-2); }
table.result td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
table.result tr:last-child td { border-bottom: none; }
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.scan-head h4 { margin-bottom: 0; }
.scan-wrap { position: relative; margin-top: 14px; overflow: hidden; }
.scan-inner { position: relative; transform-origin: 0 0; }
.scan-text { color: var(--muted); opacity: .75; }
.scan-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: auto; }
.sc-sac { stroke: var(--brand); stroke-width: 1.4; opacity: .55; }
.sc-reg { stroke: var(--accent); stroke-width: 2; opacity: .85; }
.sc-fix { fill: color-mix(in srgb, var(--gold) 35%, transparent); stroke: var(--gold); stroke-width: 1.2; }
.sc-start { fill: var(--ok); }
.scan-empty { margin: -6px 0 10px; color: var(--accent); }
.verdict { border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 14px 14px 0; padding: 16px 20px; font-size: 14.5px; line-height: 1.8; }
.verdict p { margin-top: 4px; color: var(--ink-2); }

/* ---------- 原理 ---------- */
.fx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fx-card { padding: 22px 20px 20px; }
.fx-demo {
  font-family: var(--serif); font-size: 22px; height: 66px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; color: var(--ink); overflow: hidden; white-space: nowrap;
}
html[lang="en"] .fx-demo { font-family: var(--serif-en); font-size: 19px; }
.fx-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.fx-card p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.pipeline { margin-top: 18px; padding: 26px 28px; }
.pipeline > h3 { font-size: 15.5px; margin-bottom: 18px; }
.pipe { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: p; }
.pipe li { display: flex; gap: 12px; }
.pipe li > b {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.pipe h4 { font-size: 14px; margin-bottom: 4px; }
.pipe p { font-size: 12.8px; color: var(--muted); line-height: 1.65; }
.note { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 14px; }
.about-card { padding: 22px 22px 20px; }
.about-card h3 { font-size: 15px; margin-bottom: 12px; }
.about-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.about-card p + p { margin-top: 10px; }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 24px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.refs { padding-left: 18px; display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.refs i { color: var(--muted); }

.foot { margin-top: 110px; border-top: 1px solid var(--line); padding: 26px 0 40px; font-size: 12.5px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 浮层元素 ---------- */
#gazeDot {
  position: fixed; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; z-index: 60; display: none;
  background: color-mix(in srgb, var(--accent) 45%, transparent); border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 120; transform: translate(-50%, 16px); opacity: 0;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  transition: transform .25s, opacity .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .link-btn { color: var(--gold); }
.cam-float {
  position: fixed; left: 18px; bottom: 18px; z-index: 70; width: 200px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: #000;
}

/* ---------- 眼动设置 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto; }
.panel-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.setup-panel { width: min(940px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .22s ease; }
.setup-panel.narrow { width: min(620px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(6px); } }
.sp-head { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sp-head h2 { font-size: 17px; }
.steps { list-style: none; display: flex; gap: 6px; margin-left: auto; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.steps li::before {
  content: counter(s); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  border: 1px solid var(--line-2); font-family: var(--mono);
}
.steps li + li::after { content: none; }
.steps li + li { padding-left: 10px; border-left: 1px solid var(--line); }
.steps li.on { color: var(--ink); } .steps li.on::before { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.sp-head .icon-btn { margin-left: 4px; }
.sp-body { padding: 22px; }
.sp-body.prep { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.preview { position: relative; aspect-ratio: 4 / 3; background: #0b0d11; border-radius: 16px; overflow: hidden; }
.preview-canvas { display: block; width: 100%; height: auto; }
.preview-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #c9cdd6; font-size: 13px; text-align: center; padding: 20px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checks { list-style: none; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.checks li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: 0 0 auto; position: relative; }
.checks li.ok { color: var(--ink); }
.checks li.ok i { background: var(--ok); border-color: var(--ok); }
.checks li.ok i::after { content: ""; position: absolute; left: 5px; top: 3px; width: 5px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checks li.bad { color: var(--warn); }
.checks li.bad i { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, transparent); }
.tips { margin-top: 16px; }
.tips h4 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tips ul { padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.engine-pick { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sp-actions { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
#errText { font-size: 14.5px; line-height: 1.7; margin-bottom: 8px; }

/* WebGazer 自带的视频容器：放进我们的预览框 */
#webgazerVideoContainer.wg-in-slot { position: relative !important; top: auto !important; left: auto !important; margin: 0 auto; }
#webgazerVideoContainer.wg-hidden { display: none !important; }
.cam-float #webgazerVideoContainer { transform-origin: 0 0; }

/* 校准层 */
.calib-layer { position: fixed; inset: 0; background: var(--cal-bg); cursor: default; }
.cal-dot {
  position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; transform: translate(-50%, -50%);
  transition: left .5s cubic-bezier(.3, .7, .2, 1), top .5s cubic-bezier(.3, .7, .2, 1); cursor: pointer;
}
.cal-dot i { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--surface); }
.cal-dot svg { width: 60px; height: 60px; transform: rotate(-90deg); }
.cal-dot .ring { fill: color-mix(in srgb, var(--gold) 16%, transparent); stroke: var(--gold); stroke-width: 3; stroke-dasharray: 164; stroke-dashoffset: 0; transition: stroke-dashoffset 0s; }
.cal-dot:hover .ring { fill: color-mix(in srgb, var(--gold) 28%, transparent); }
.cal-dot.collect { cursor: default; }
.cal-dot.collect .ring { stroke-dashoffset: 164; transition: stroke-dashoffset 1.35s linear; }
.cal-dot.collect i { animation: shrink 1.35s ease-in forwards; }
@keyframes shrink { to { transform: scale(.55); } }
.cal-dot.ok .ring { stroke: var(--ok); fill: var(--ok-soft); }
.cal-dot.val { cursor: default; }
.cal-dot.val .ring { stroke: var(--brand); fill: var(--brand-soft); stroke-dasharray: 6 6; animation: spin 6s linear infinite; transform-origin: 50% 50%; }
.cal-hint {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 2; max-width: calc(100vw - 40px); text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 9px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
}
.cal-hint.low { top: auto; bottom: 34px; }
.cal-bar { position: fixed; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.cal-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s; }
.cal-esc { position: fixed; right: 20px; top: 26px; z-index: 2; color: var(--muted); }

/* 结果 */
.res-top { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.grade { font-family: var(--serif); font-size: 26px; font-weight: 700; padding: 10px 20px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); }
.grade[data-g="1"] { background: var(--brand-soft); color: var(--brand); }
.grade[data-g="2"] { background: var(--gold-soft); color: var(--warn); }
.grade[data-g="3"] { background: var(--accent-soft); color: var(--accent); }
.res-nums { display: flex; gap: 26px; }
.res-nums div { display: flex; flex-direction: column; }
.res-nums b { font-family: var(--serif-en); font-size: 24px; font-variant-numeric: tabular-nums; }
.res-nums span { font-size: 12px; color: var(--muted); }
.res-map { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.res-map svg { width: 100%; height: auto; max-height: 260px; }
.rm-s { fill: none; stroke: var(--line-2); stroke-width: 3; }
.rm-t { fill: none; stroke: var(--ink-2); stroke-width: 4; }
.rm-d { fill: var(--accent); }
.rm-p { fill: var(--accent-soft); stroke: none; }
.rm-l { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 8 6; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-top: 12px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 52px; }
  .sim-grid { grid-template-columns: 1fr; }
  .sim-side { position: static; max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; padding: 6px 22px; }
  .side-sec + .side-sec { border-top: none; }
  .side-sec { border-bottom: 1px solid var(--line); }
  .fx-grid { grid-template-columns: repeat(2, 1fr); }
  .pipe { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-grid > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .rep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .sp-body.prep { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { font-size: 14.5px; }
  .nav-in { gap: 12px; }
  .brand-t i { display: none; }
  .pill { display: none; }
  .hero { padding-top: 36px; }
  .lead { font-size: 15.5px; }
  .cta .btn { flex: 1 1 100%; }
  .hero-facts b { font-size: 21px; }
  .hero-facts li { padding-right: 10px; }
  .hero-facts li + li { padding-left: 12px; }
  .hero-stage { padding: 24px 20px 28px; min-height: 0; }
  .hero-field { font-size: 21px; }
  .section { padding-top: 72px; }
  .section-head { grid-template-columns: 1fr; }
  .kicker { width: 44px; margin-top: 0; }
  .stage { padding: 28px 20px 34px; min-height: 340px; }
  #passage { font-size: 21px; line-height: 2.2; }
  #testPassage, .scan-text { font-size: 20px; }
  .field.is-en { font-size: 19px !important; }
  .stage-bar { flex-direction: column; align-items: stretch; }
  .select select { flex: 1; min-width: 0; }
  .select { width: 100%; }
  #presetSeg { display: flex; } #presetSeg button { flex: 1; }
  .sim-side { grid-template-columns: 1fr; padding: 4px 18px; }
  .test { padding: 22px 18px; }
  .cond-list { grid-template-columns: repeat(2, 1fr); }
  .read-bar { grid-template-columns: 1fr auto; }
  .read-bar .timer { grid-row: 1; grid-column: 2; font-size: 30px; }
  .read-bar .btn { grid-column: 1 / -1; justify-self: stretch; }
  .test-stage { padding: 26px 20px; }
  .fx-grid, .pipe, .about-grid { grid-template-columns: 1fr; }
  .about-grid > :nth-child(2) { grid-column: auto; grid-row: auto; }
  .bar-row { grid-template-columns: 76px 1fr 38px; }
  .sp-head { flex-wrap: wrap; }
  .steps { order: 3; margin-left: 0; width: 100%; }
  .res-top { flex-direction: column; align-items: flex-start; }
  .cam-float { width: 140px; }
  .foot { margin-top: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cal-dot.collect .ring { transition-duration: 1.35s !important; }
}
