/* 闪读 Flash Reader — Apple-minimal, self-contained (shares the site's
   token values from app-style.css; tools with their own style.css do not
   get the shared sheet, so the tokens are duplicated here). */
:root {
  color-scheme: light;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  --canvas: #f5f5f7;
  --surface: #fff;
  --recessed: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #65656b;
  --line: rgb(0 0 0 / .06);
  --control-line: rgb(0 0 0 / .14);
  --selected: rgb(0 0 0 / .075);
  --accent: #0071e3;
  --accent-hover: #0065cc;
  --accent-ink: #fff;
  --good: #1eaa50;
  --bad: #e02028;
  --orange: #d97a06;
  --purple: #8e44ad;
  --motion: .2s cubic-bezier(.16, 1, .3, 1);
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #161618;
  --surface: #1e1e20;
  --recessed: #242426;
  --ink: #f5f5f7;
  --muted: #ababaf;
  --line: rgb(255 255 255 / .08);
  --control-line: rgb(255 255 255 / .19);
  --selected: rgb(255 255 255 / .10);
  --accent: #5aaaf9;
  --accent-hover: #7bbaff;
  --accent-ink: #101820;
  --good: #4cc38a;
  --bad: #ff6b6b;
  --orange: #ff9f0a;
  --purple: #c678f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; transition: background-color var(--motion), color var(--motion); }
main { width: min(896px, calc(100% - 32px)); margin: clamp(32px, 7vw, 80px) auto; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 600; line-height: 1.12; letter-spacing: -.045em; margin: 16px 0 8px; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; }
p { color: var(--muted); margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
#back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.subtitle { font-size: 1.05rem; color: var(--muted); }
.lede { margin-top: 12px; font-size: 1.05rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.panel { display: grid; gap: 16px; margin-block-start: 32px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 4vw, 32px); background: var(--surface); }
.of-url-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.fineprint { font-size: 13px; line-height: 1.6; }
button { display: inline-flex; justify-content: center; align-items: center; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 8px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 16px; cursor: pointer; transition: background-color var(--motion), transform var(--motion); }
button:not(:disabled):hover { background: var(--accent-hover); }
button:not(:disabled):active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { color: var(--ink); background: var(--recessed); }
.secondary:not(:disabled):hover { background: var(--selected); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
textarea { width: 100%; min-height: 168px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--recessed); border: 1px solid var(--control-line); border-radius: 12px; padding: 12px 14px; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#status:empty { display: none; }
#status { font-size: 14px; color: var(--bad); }
#preview:empty { display: none; }
.brand-line { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; padding: 20px 0 28px; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Speed + chunk-size controls */
.fr-speed-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink); }
.fr-speed-row label { white-space: nowrap; }
.fr-speed-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 120px; }
#speed-val { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; min-width: 110px; }
.fr-chunk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--ink); }
.fr-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.fr-radio input { accent-color: var(--accent); }
.fr-radio:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* Discomfort warning */
.fr-warn { border: 1px solid var(--control-line); border-radius: 16px; padding: 16px 20px; background: var(--recessed); display: grid; gap: 8px; }
.fr-warn p { font-size: 14px; line-height: 1.6; }
.fr-warn strong { color: var(--ink); }
.fr-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.fr-check input { margin-top: 3px; accent-color: var(--accent); }

/* RSVP stage: the flashing word sits between two hairlines, with a
   small centre tick above and below — the focus point. English words
   render with a red ORP letter pinned to the exact centre (the two
   side spans flex to fill); Chinese chunks render whole, centred,
   with no red letter. */
.fr-stage { position: relative; padding: 64px 16px; text-align: center; }
.fr-stage::before, .fr-stage::after { content: ''; position: absolute; left: 6%; right: 6%; height: 1px; background: var(--line); }
.fr-stage::before { top: 24px; }
.fr-stage::after { bottom: 24px; }
.fr-tick { position: absolute; left: 50%; width: 2px; height: 12px; margin-left: -1px; background: var(--bad); opacity: .55; }
.fr-tick-top { top: 36px; }
.fr-tick-bottom { bottom: 36px; }
.fr-word { display: flex; justify-content: center; align-items: baseline; min-height: 1.35em; font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; color: var(--ink); overflow-wrap: break-word; }
.fr-word .orp-left { flex: 1; text-align: right; }
.fr-word .orp-right { flex: 1; text-align: left; }
.fr-word .orp-mid { color: var(--bad); }
.fr-word .fr-zh { text-align: center; }

/* Progress + stats */
.fr-progress { height: 6px; border-radius: 999px; background: var(--recessed); overflow: hidden; }
.fr-progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .12s linear; }
.fr-stats, .fr-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.fr-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.fr-stat .num { font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fr-stat .lbl { font-size: 12px; color: var(--muted); }

/* End summary */
.fr-summary { border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; background: var(--recessed); display: grid; gap: 12px; }
.fr-summary h3 { margin: 0; }

/* Reduced motion: no transitions on the progress fill or buttons. */
@media (prefers-reduced-motion: reduce) {
  .fr-progress-fill, button, body { transition: none; }
}
