/* 下班英文 practice page. Brand red #C81018 on white (memory uef-brand-red-white). The one bold idea: the five steps run down a
   red line like stations on Taipei's red MRT line, filled in as you finish each one. Everything else stays quiet. */
:root {
  --red: #C81018;
  --red-ink: #9E0C13;
  --wash: #FCEDED;
  --ink: #241A1B;
  --muted: #6B6163;
  --rule: #ECDDDD;
  --ok: #1D7447;
  --ok-wash: #E8F4ED;
  --paper: #FFFFFF;
  --zh: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --en: "Atkinson Hyperlegible", -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--zh); }
.en, .tile, .typed, .heard, .say, .card-en, .card-ex, .tline .p { font-family: var(--en); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--rule); }
.brand { font-weight: 700; color: var(--red); letter-spacing: .02em; }
.count { font-size: 15px; color: var(--muted); white-space: nowrap; }
.count b { color: var(--red); font-size: 20px; }
.count.bump b { animation: bump .45s ease-out; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* hero */
.hero { padding: 28px 0 8px; }
.ep { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
h1 { margin: 0; font-size: 34px; line-height: 1.25; font-weight: 800; }
.hook { margin: 6px 0 14px; font-size: 20px; color: var(--red-ink); }
.lead { margin: 0; color: var(--ink); }

/* the red line */
.route { list-style: none; margin: 28px 0 0; padding: 0; }
.station { position: relative; padding: 0 0 40px 52px; }
.station::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: -6px; width: 4px; background: var(--red); }
.station-end::before { bottom: auto; height: 6px; }
.stop { position: absolute; left: 1px; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--paper);
  border: 4px solid var(--red); color: var(--red); display: grid; place-items: center; font: 700 15px/1 var(--en); z-index: 1; }
.station.done > .stop { background: var(--red); color: #fff; }
.station.done > .stop::after { content: "✓"; font-size: 16px; }
.station.done > .stop { font-size: 0; }
.stop-cards::after { content: "卡"; font: 700 13px/1 var(--zh); }
.stop-end { width: 32px; height: 32px; border-width: 8px; }
.station h2 { margin: 0; font-size: 23px; line-height: 32px; font-weight: 800; }
.how { margin: 4px 0 14px; color: var(--muted); }
.warn { margin: 0 0 12px; padding: 10px 12px; background: var(--wash); color: var(--red-ink); border-radius: 10px; font-size: 15px; }

/* video and transcript */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video iframe, .video #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tools { margin: 10px 0; display: flex; gap: 16px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--red); }
.transcript { max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 14px; overscroll-behavior: contain; }
.tline { padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.tline:last-child { border-bottom: 0; }
.tline .who { display: block; font-size: 13px; color: var(--muted); }
.tline .p { cursor: pointer; border-radius: 4px; font-size: 18px; line-height: 1.5; }
.tline .p.zhonly { font-family: var(--zh); }
.tline .p.now { background: var(--wash); box-shadow: 0 0 0 3px var(--wash); color: var(--red-ink); }
.tline .zh { display: block; font-size: 15px; color: var(--muted); margin-top: 2px; }
.nozh .tline .zh { display: none; }

/* practice panels */
.panel { border: 1px solid var(--rule); border-radius: 14px; padding: 16px; }
.pos { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.play { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 0; background: var(--red); cursor: pointer;
  display: grid; place-items: center; }
.play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.play.small { width: 40px; height: 40px; }
.play.small svg { width: 16px; height: 16px; }
.play.ghost { background: var(--paper); border: 2px solid var(--red); }
.play.ghost svg { fill: var(--red); }
.hint { color: var(--muted); font-size: 15px; }

.btn { display: inline-block; border: 0; border-radius: 999px; padding: 11px 22px; background: var(--red); color: #fff;
  font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.line { background: var(--paper); color: var(--red); border: 2px solid var(--red); padding: 9px 20px; }
.btn.quiet { background: transparent; color: var(--muted); padding: 11px 10px; text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
.btn:disabled { opacity: .4; cursor: default; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* step 2: tiles */
.answer { min-height: 58px; margin: 16px 0 10px; padding: 8px 0; border-bottom: 2px solid var(--ink); display: flex; flex-wrap: wrap; gap: 8px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { border: 2px solid var(--rule); background: var(--paper); border-radius: 10px; padding: 7px 12px; font-size: 20px; cursor: pointer; }
.answer .tile { border-color: var(--ink); }
.tile.bad { border-color: var(--red); color: var(--red-ink); background: var(--wash); }
.tile.good { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }

/* feedback */
.fb { margin-top: 14px; padding: 12px 14px; border-radius: 10px; }
.fb.ok { background: var(--ok-wash); color: var(--ok); }
.fb.no { background: var(--wash); color: var(--red-ink); }
.fb .zh-line { display: block; color: var(--ink); margin-top: 4px; }
.fb .en { font-size: 19px; }

/* step 3: dictation */
.typed { width: 100%; margin-top: 16px; padding: 12px 14px; font-size: 20px; border: 2px solid var(--ink); border-radius: 10px; }
.diff { font-family: var(--en); font-size: 20px; line-height: 1.7; }
.diff .miss { color: var(--red-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.diff .extra { color: var(--muted); text-decoration: line-through; }
.diff .hit { color: var(--ok); }

/* step 4: speak */
.zh-big { font-size: 24px; font-weight: 700; margin: 0; }
.say { font-size: 21px; margin: 8px 0 0; color: var(--ink); }
.say .gap { display: inline-block; min-width: 4.5em; border-bottom: 2px solid var(--red); color: transparent; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--red); cursor: pointer; display: grid; place-items: center; }
.mic svg { width: 30px; height: 30px; fill: #fff; }
.mic.on { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px var(--wash); } }
.heard { font-size: 19px; }

/* step 5: quiz */
.q { font-size: 20px; font-weight: 700; margin: 14px 0 10px; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; border: 2px solid var(--rule); background: var(--paper); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.opt.right { border-color: var(--ok); background: var(--ok-wash); }
.opt.wrong { border-color: var(--red); background: var(--wash); }
.score { font-size: 28px; font-weight: 800; color: var(--red); margin: 0; }

/* step 6: cards */
.card { min-height: 190px; display: flex; flex-direction: column; justify-content: center; }
.card-zh { font-size: 26px; font-weight: 800; margin: 0; }
.card-note { display: block; font-size: 15px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.card-en { font-size: 26px; font-weight: 700; color: var(--red-ink); margin: 0; }
.card-ex { font-size: 18px; margin: 6px 0 0; }
.card-src { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.card-src .en { color: var(--ink); font-size: 17px; }

/* own cards from the transcript */
.addbtn { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; vertical-align: 2px; border-radius: 50%;
  border: 1.5px solid var(--red); background: var(--paper); color: var(--red); font: 700 15px/1 var(--zh); cursor: pointer; padding: 0; }
.addbtn.has { background: var(--red); color: #fff; }
.picker { margin: 4px 0 10px; padding: 14px; border: 2px solid var(--red); border-radius: 12px; background: var(--paper); }
.toks { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.tok { border: 1.5px solid var(--rule); background: var(--paper); border-radius: 8px; padding: 5px 9px; font: 18px/1.3 var(--en); cursor: pointer; }
.tok.sel { background: var(--red); border-color: var(--red); color: #fff; }
.mine-count { margin: -6px 0 12px; color: var(--red-ink); font-size: 15px; }
.mine-tag { margin: 0 0 4px; font-size: 13px; color: var(--red-ink); }
.gap-blank { color: var(--red); letter-spacing: 2px; }
mark { background: var(--wash); color: var(--red-ink); padding: 0 3px; border-radius: 4px; }

/* step 4: how much help */
.modes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.modes-label { font-size: 14px; color: var(--muted); margin-right: 2px; }
.modes label { cursor: pointer; }
.modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.modes label span { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--rule); border-radius: 999px; font-size: 15px; }
.modes label input:checked + span { border-color: var(--red); background: var(--red); color: #fff; }
.modes label input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

/* the offer */
.offer { margin: 12px 0; padding-left: 1.2em; }
.offer li { margin: 4px 0; }
.price { font-size: 19px; margin: 14px 0 4px; }
.price b { color: var(--red); font-size: 24px; }
.note { color: var(--muted); font-size: 15px; margin: 6px 0; }
.join { display: flex; gap: 16px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.join img { border: 1px solid var(--rule); border-radius: 10px; }
.join p { margin: 0 0 10px; }

.foot { padding-top: 8px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }

.notice { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10; max-width: 560px;
  margin: 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 16px; }
.notice[hidden] { display: none; }

.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) {
  .shake, .mic.on, .count.bump b { animation: none; }
}
@media (min-width: 720px) {
  h1 { font-size: 42px; }
}
