:root {
  --paper: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #eaf0f8;
  --ink: #14202e;
  --ink-2: #33445c;
  --muted: #55637a;
  --line: rgba(20, 32, 46, 0.12);
  --line-strong: rgba(20, 32, 46, 0.22);
  --primary: #1a63d8;
  --primary-strong: #124fae;
  --primary-soft: #e8f0ff;
  --success: #0f7a45;
  --success-soft: #e6f4ec;
  --warn: #a35a00;
  --warn-soft: #fff3dc;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(20, 32, 46, 0.08);
  --rail-w: clamp(240px, 16vw, 380px);
  --rail-gap: clamp(16px, 1.4vw, 32px);
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-en: var(--font-ui);
  --topbar-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.check-mark {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 60;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--surface-2);
}

.menu-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.menu-btn svg {
  width: 20px;
  height: 20px;
}

.crumb {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.015em;
  color: var(--muted);
}

.crumb strong {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: normal;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb-mode {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 10px;
  border-radius: 10px;
  color: var(--muted);
  max-width: 178px;
}

.step:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.step-no {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.step-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}

.step-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.step-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.step.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.step.active .step-no {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.step.done .step-no {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step.done .step-name {
  color: var(--success);
}

.top-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 17px;
  font-weight: 650;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.help-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 68px;
  width: 372px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 80;
}

.help-pop h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.help-pop .help-lead {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12.5px;
  line-height: 1.6;
}

.help-pop .help-lead b {
  font-weight: 700;
}

.help-pop dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.help-pop dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}

.help-pop dt {
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.help-pop dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.help-pop p {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.hint-pop {
  right: 116px;
}

.hint-pop p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------- 主舞台 ---------- */

.stage {
  overflow: auto;
  padding: clamp(24px, 2.2vw, 56px) clamp(20px, 2.6vw, 72px) clamp(180px, 18vh, 260px);
  outline: none;
}

.stage-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 1.4vw, 32px);
  width: 100%;
  min-height: 100%;
}

.stage-inner.enter {
  animation: stage-in 0.16s ease-out;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage-clock {
  display: flex;
  align-items: baseline;
  align-self: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  font-size: clamp(13px, 0.9vw, 18px);
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.now-line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
  padding-top: 4px;
}

.now-text {
  flex: 0 1 auto;
  min-width: 0;
  font-size: clamp(22px, 2.1vw, 56px);
  font-weight: 650;
  line-height: 1.35;
}

.action-cue {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 60;
  transform: translate(-50%, -50%);
  padding: clamp(9px, 0.9vw, 20px) clamp(20px, 1.8vw, 40px);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: clamp(20px, 2vw, 64px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow:
    0 18px 40px rgba(26, 99, 216, 0.14),
    0 6px 14px rgba(20, 32, 46, 0.05);
  pointer-events: none;
  animation: cue-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-cue.is-done {
  background: #12a150;
  color: #fff;
  box-shadow: none;
}

.action-cue.is-final {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
}

.action-cue .cue-check {
  width: 0.82em;
  height: 0.82em;
  flex-shrink: 0;
  stroke-width: 3.2;
}

.stage-words .action-cue,
.stage-shadow .action-cue {
  left: calc(50% + (var(--rail-w) + var(--rail-gap)) / 2);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 1.6vw, 32px);
  min-width: 0;
  padding: clamp(20px, 2vw, 48px);
  border-radius: clamp(20px, 1.6vw, 28px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, 0.06);
}

/* ---------- 熟悉声音 ---------- */

.familiar-focus {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  padding: 8px 0;
}

.familiar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 1.4vw, 26px);
  width: min(clamp(600px, 50vw, 1320px), 100%);
  padding: clamp(32px, 4.5vw, 88px) clamp(24px, 3.6vw, 72px);
  text-align: center;
  border-radius: clamp(24px, 2vw, 36px);
  box-shadow:
    0 30px 60px -24px rgba(20, 32, 46, 0.18),
    0 2px 6px rgba(20, 32, 46, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.familiar-glyph {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  width: clamp(200px, 18vw, 380px);
  height: clamp(72px, 6.5vw, 136px);
  color: var(--primary);
}

.familiar-glyph > svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.familiar-glyph > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.familiar-glyph > .glyph-question,
.familiar-glyph > .glyph-audio {
  width: clamp(72px, 6.5vw, 136px);
  height: clamp(72px, 6.5vw, 136px);
}

.glyph-wave {
  opacity: 0;
  transform: scale(0.55) rotate(10deg);
  transition:
    opacity 0.35s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.glyph-question {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    opacity 0.35s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.glyph-question circle {
  fill: currentColor;
  stroke: none;
}

.glyph-audio {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.55) rotate(-8deg);
  transition:
    opacity 0.35s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.familiar-glyph.is-listening .glyph-wave {
  opacity: 1;
  transform: none;
}

.familiar-glyph.is-listening .glyph-question {
  opacity: 0;
  transform: scale(0.5) rotate(-20deg);
}

.familiar-glyph.is-start .glyph-question {
  opacity: 0;
  transform: scale(0.5) rotate(16deg);
}

.familiar-glyph.is-start .glyph-audio {
  opacity: 1;
  transform: none;
}

.familiar-glyph.is-listening .glyph-audio {
  opacity: 0;
  transform: scale(0.5) rotate(8deg);
}

.familiar-glyph.just-finished .glyph-wave {
  animation: glyph-wave-out 0.34s ease;
}

.familiar-glyph.just-finished .glyph-question {
  animation: glyph-question-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s backwards;
}

@keyframes glyph-wave-out {
  from {
    opacity: 1;
    transform: none;
  }

  to {
    opacity: 0;
    transform: scale(0.55) rotate(10deg);
  }
}

@keyframes glyph-question-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(16deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.familiar-question {
  font-size: clamp(28px, 3.4vw, 96px);
  font-weight: 750;
  line-height: 1.3;
  color: var(--ink);
}

.familiar-version {
  position: absolute;
  top: clamp(18px, 1.6vw, 30px);
  left: clamp(18px, 1.6vw, 30px);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.5vw, 9px);
  padding: clamp(5px, 0.45vw, 8px) clamp(12px, 1vw, 18px);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: clamp(13px, 0.9vw, 17px);
  line-height: 1.2;
}

.fv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.fv-name {
  font-weight: 700;
}

.fv-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 声音词汇 ---------- */

.side-layout {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: var(--rail-gap);
  align-items: stretch;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 0.9vw, 16px);
  min-width: 0;
  padding: clamp(18px, 1.5vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: clamp(20px, 1.6vw, 28px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, 0.05);
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: clamp(13px, 0.9vw, 18px);
  font-weight: 650;
  color: var(--muted);
}

.rail-head strong {
  font-size: clamp(15px, 1vw, 21px);
  color: var(--ink);
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.5vw, 10px);
  max-height: calc(100vh - 360px);
  max-height: calc(100dvh - 360px);
  overflow: auto;
  padding-right: 4px;
}

.side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: clamp(48px, 3.4vw, 68px);
  padding: clamp(10px, 0.9vw, 18px) clamp(14px, 1vw, 22px);
  text-align: left;
  font-size: clamp(17px, 1.15vw, 28px);
  line-height: 1.25;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: clamp(10px, 0.8vw, 14px);
}

.side-item:hover {
  background: color-mix(in srgb, var(--ink) 7%, var(--surface));
}

.side-item[aria-current="true"] {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary-strong);
  font-weight: 650;
}

.side-item:focus-visible {
  outline-offset: -2px;
}

.word-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  align-content: start;
  align-self: start;
  column-gap: 24px;
  row-gap: clamp(16px, 1.4vw, 28px);
  min-width: 0;
  width: 100%;
  padding: clamp(24px, 2vw, 44px);
  border-radius: clamp(20px, 1.6vw, 28px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, 0.05);
}

.word-main {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.4vw, 28px);
  grid-column: 1;
  min-width: 0;
  align-self: start;
  text-align: center;
}


.headword {
  margin: 0;
  font-family: var(--font-en);
  font-size: clamp(40px, 4.4vw, 128px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 1.2vw, 24px);
  font-size: clamp(19px, 1.5vw, 34px);
  color: var(--muted);
}

.meta-line .ipa {
  font-family: var(--font-en);
  color: var(--primary-strong);
}

.gloss {
  font-size: clamp(22px, 1.9vw, 56px);
  line-height: 1.4;
}

.note {
  padding-left: 14px;
  border-left: 3px solid var(--line-strong);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.word-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}

.audio-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
}

.audio-btn:hover:not(.selected):not(:disabled) {
  background: var(--surface);
  color: var(--ink);
}

.audio-btn:disabled {
  opacity: 0.36;
  cursor: default;
}

.audio-btn.selected {
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: 0 1px 3px rgba(20, 32, 46, 0.1);
}

.audio-btn.playing {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.audio-btn.playing:hover {
  background: var(--primary-strong);
}

.audio-btn svg {
  width: 18px;
  height: 18px;
}

.audio-btn .icon-play path,
.audio-btn .icon-pause path {
  fill: currentColor;
  stroke: none;
}

.audio-btn .icon-pause {
  display: none;
}

.audio-btn.playing .icon-play {
  display: none;
}

.audio-btn.playing .icon-pause {
  display: block;
}

.word-context {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.6vw, 12px);
  grid-column: 1 / -1;
  padding-top: clamp(16px, 1.4vw, 28px);
  border-top: 1px solid var(--line);
}

.context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1vw, 20px);
  margin-bottom: 2px;
}

.context-head strong {
  font-size: clamp(15px, 1.1vw, 22px);
  color: var(--ink);
}

.context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 0.7vw, 14px);
}

.context-actions .audio-btn {
  width: auto;
  min-height: clamp(36px, 2.5vw, 48px);
  padding: 0 clamp(12px, 1vw, 20px);
  border: 1px solid var(--line);
  border-radius: clamp(8px, 0.7vw, 12px);
  background: var(--surface);
  font-size: clamp(14px, 1vw, 20px);
}

.context-actions .audio-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: none;
}

.context-actions .audio-btn.playing {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.context-line {
  margin: 0;
  padding: clamp(18px, 2vw, 44px) clamp(20px, 2.2vw, 52px);
  border-radius: clamp(14px, 1.2vw, 20px);
  background: var(--paper);
  font-family: var(--font-en);
  font-size: clamp(22px, 1.8vw, 44px);
  line-height: 1.5;
  color: var(--ink);
  text-align: center;
  overflow-wrap: anywhere;
}

.nav-btn {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.nav-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.nav-btn.primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---------- 短时跟读 ---------- */

.shadow-card {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.4vw, 28px);
  min-width: 0;
  width: 100%;
  padding: clamp(24px, 2vw, 44px);
  border-radius: clamp(20px, 1.6vw, 28px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, 0.06);
}

/* 主卡片：中性细边 + 左上极淡冷灰高光 */
.familiar-card,
.word-card,
.shadow-card,
.panel {
  border: 1px solid rgba(20, 32, 46, 0.1);
  background:
    radial-gradient(150px 130px at 0% 0%, rgba(20, 32, 46, 0.035), transparent 72%),
    linear-gradient(180deg, #ffffff, #fbfcfe);
  background-clip: padding-box;
}

@keyframes cue-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 1100px) {
  .action-cue {
    position: static;
    transform: none;
    animation: none;
  }
}

.sentence-panel {
  position: relative;
  display: grid;
  place-items: center;
  gap: clamp(12px, 1vw, 20px);
  flex: 1;
  min-height: clamp(220px, 30vh, 420px);
  padding: clamp(24px, 3.4vw, 72px);
  border-radius: clamp(16px, 1.4vw, 24px);
  background: var(--paper);
  text-align: center;
}

.sentence-text {
  max-width: 22em;
  font-family: var(--font-en);
  font-size: clamp(30px, 3.2vw, 92px);
  line-height: 1.55;
}

.chunk + .chunk::before {
  content: " / ";
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--primary);
}

.sentence-panel.has-mask .sentence-text {
  filter: blur(6px);
  opacity: 0.5;
  user-select: none;
}

.text-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  border-radius: inherit;
  background: rgba(243, 246, 251, 0.62);
  -webkit-backdrop-filter: blur(10px) saturate(0.85);
  backdrop-filter: blur(10px) saturate(0.85);
}

.mask-state {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.mask-state > svg {
  grid-area: 1 / 1;
}

.mask-icon {
  width: 42px;
  height: 42px;
  color: var(--muted);
  opacity: 0.8;
  stroke-width: 1.7;
}

.mask-check {
  color: var(--success);
  opacity: 0;
  stroke-width: 2.4;
}

.text-mask.is-done .mask-eye {
  animation: mask-eye-out 0.28s ease forwards;
}

.text-mask.is-done .mask-check {
  animation: mask-check-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes mask-eye-out {
  to {
    opacity: 0;
    transform: scale(0.55) rotate(-16deg);
  }
}

@keyframes mask-check-in {
  0% {
    opacity: 0;
    transform: scale(0.45) rotate(-18deg);
  }

  60% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .action-cue {
    animation: none;
  }

  .text-mask.is-done .mask-eye,
  .text-mask.is-done .mask-check {
    animation: none;
  }

  .text-mask.is-done .mask-eye {
    opacity: 0;
  }

  .text-mask.is-done .mask-check {
    opacity: 1;
  }
}

/* ---------- 信息框架 ---------- */

.frame-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.7vw, 14px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.frame-item {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 1vw, 20px);
  padding: clamp(12px, 0.9vw, 18px) clamp(18px, 1.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: clamp(12px, 0.9vw, 18px);
  font-size: clamp(17px, 1.4vw, 34px);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
}

.frame-item .dot {
  width: clamp(7px, 0.5vw, 11px);
  height: clamp(7px, 0.5vw, 11px);
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ---------- 即将上线 / 加载 / 错误 ---------- */

.upcoming {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}

.upcoming h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.2;
}

.upcoming .up-eyebrow {
  font-size: 13px;
  font-weight: 650;
  color: var(--primary);
}

.upcoming p {
  margin: 0;
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
}

.ready-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.ready-btn {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
}

.ready-btn:hover {
  background: var(--primary-strong);
}

.boot-text {
  margin: 24px 0;
  text-align: center;
  font-size: 18px;
  color: var(--muted);
}

.boot-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 0;
}

.sk {
  display: block;
  background: var(--surface-2);
  border-radius: 6px;
  animation: sk-pulse 1.4s ease-in-out infinite;
}

.sk-line {
  height: 18px;
}

.sk-short {
  width: 28%;
}

.sk-long {
  width: 52%;
}

.sk-block {
  height: 320px;
  margin-top: 12px;
  border-radius: 20px;
}

@keyframes sk-pulse {
  50% {
    opacity: 0.55;
  }
}

.error-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 720px;
  padding: 28px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--danger);
  border-radius: 14px;
  background: var(--surface);
}

.error-box h1 {
  margin: 0;
  font-size: 24px;
}

.error-box p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 浮动播放面板 ---------- */

.transport {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(clamp(520px, 33vw, 720px), calc(100vw - 20px));
  padding: clamp(10px, 0.8vw, 16px) clamp(14px, 1vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: clamp(18px, 1.4vw, 26px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.36));
  color: rgba(20, 32, 46, 0.92);
  box-shadow:
    0 28px 56px -20px rgba(23, 43, 77, 0.16),
    0 2px 8px rgba(23, 43, 77, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(42px) saturate(1.9);
  -webkit-backdrop-filter: blur(42px) saturate(1.9);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  animation: panel-in 0.18s ease-out;
}

.transport::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 90% at 50% -30%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.14));
  pointer-events: none;
}

.transport > * {
  position: relative;
  z-index: 1;
}

@keyframes panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.transport.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 34px 64px -20px rgba(23, 43, 77, 0.2),
    0 3px 10px rgba(23, 43, 77, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.transport.is-gliding {
  transition: left 0.2s ease, top 0.2s ease;
}

.transport-head {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.6vw, 12px);
  min-height: clamp(26px, 1.6vw, 34px);
}

.drag-grip {
  display: grid;
  place-items: center;
  width: 18px;
  height: 26px;
  color: rgba(20, 32, 46, 0.32);
  flex-shrink: 0;
}

.drag-grip svg {
  width: 16px;
  height: 16px;
  stroke-width: 3.4;
}

.audio-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(13px, 0.85vw, 18px);
  font-weight: 650;
  color: rgba(20, 32, 46, 0.92);
}

.transport-times {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  font-size: clamp(12px, 0.8vw, 16px);
  color: rgba(20, 32, 46, 0.66);
  font-variant-numeric: tabular-nums;
}

.time-sep {
  opacity: 0.5;
}

.head-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: clamp(30px, 1.8vw, 38px);
  padding: 0 clamp(7px, 0.6vw, 10px);
  border-radius: clamp(8px, 0.6vw, 12px);
  color: rgba(20, 32, 46, 0.5);
  flex-shrink: 0;
}

.head-tool svg {
  width: clamp(17px, 1.1vw, 24px);
  height: clamp(17px, 1.1vw, 24px);
}

.head-tool:hover {
  background: rgba(20, 32, 46, 0.06);
  color: rgba(20, 32, 46, 0.9);
}

.reset-btn {
  gap: 0;
  padding: 0 clamp(9px, 0.75vw, 13px);
  border: 1px solid rgba(20, 32, 46, 0.14);
  background: rgba(255, 255, 255, 0.4);
  font-size: clamp(12px, 0.78vw, 15px);
  font-weight: 650;
  letter-spacing: 0.04em;
  color: rgba(20, 32, 46, 0.64);
}

.reset-label,
.reset-hint {
  white-space: nowrap;
}

.reset-hint {
  font-size: inherit;
  font-weight: 700;
  color: inherit;
}

.reset-btn[data-armed="true"] {
  background: rgba(20, 32, 46, 0.88);
  border-color: rgba(20, 32, 46, 0.88);
  color: #fff;
}

.seek {
  position: relative;
  display: flex;
  align-items: center;
  height: clamp(22px, 1.4vw, 30px);
  cursor: pointer;
  touch-action: none;
}

.seek-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(5px, 0.35vw, 7px);
  border-radius: 99px;
  background: rgba(20, 32, 46, 0.18);
  overflow: hidden;
  transition: transform 0.16s ease;
}

.seek:hover .seek-rail,
.seek.is-scrubbing .seek-rail {
  transform: scaleY(1.25);
}

.seek-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: #1c1c1e;
}

.seek-knob {
  position: absolute;
  left: 0;
  width: clamp(13px, 0.85vw, 18px);
  height: clamp(13px, 0.85vw, 18px);
  margin-left: calc(clamp(13px, 0.85vw, 18px) / -2);
  border: 1px solid rgba(20, 32, 46, 0.16);
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.seek.is-scrubbing .seek-knob {
  transform: scale(1.15);
}

.seek:hover .seek-knob,
.seek:focus-visible .seek-knob,
.seek.is-scrubbing .seek-knob {
  opacity: 1;
}

.seek:focus-visible {
  outline: 2px solid rgba(20, 32, 46, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.5vw, 14px);
}

.transport-side {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.35vw, 8px);
  flex: 1;
  min-width: 0;
}

.transport-side.start {
  justify-content: flex-end;
}

.transport-side.end {
  justify-content: flex-start;
}

.fb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(40px, 2.4vw, 52px);
  padding: 0 clamp(8px, 0.6vw, 12px);
  border-radius: clamp(10px, 0.8vw, 14px);
  color: rgba(20, 32, 46, 0.72);
  font-size: clamp(13px, 0.85vw, 18px);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.fb-btn svg {
  width: clamp(18px, 1.1vw, 24px);
  height: clamp(18px, 1.1vw, 24px);
}

.fb-btn:hover:not(:disabled) {
  background: rgba(20, 32, 46, 0.06);
  color: rgba(20, 32, 46, 0.92);
}

.fb-btn:active:not(:disabled) {
  background: rgba(20, 32, 46, 0.1);
}

.fb-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.fb-btn.icon-only {
  width: clamp(40px, 2.4vw, 52px);
  padding: 0;
}

.seek-btn .seek-glyph {
  width: clamp(21px, 1.25vw, 27px);
  height: clamp(21px, 1.25vw, 27px);
}

.seek-glyph text {
  fill: currentColor;
  stroke: none;
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.seek-glyph .seek-arrow {
  fill: currentColor;
  stroke: none;
}

.play-disc {
  display: grid;
  place-items: center;
  width: clamp(56px, 3vw, 76px);
  height: clamp(56px, 3vw, 76px);
  border-radius: 50%;
  background: linear-gradient(180deg, #303032, #111113);
  color: #fff;
  flex-shrink: 0;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.play-disc:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d3d3f, #1d1d1f);
}

.play-disc:active:not(:disabled) {
  transform: scale(0.96);
}

.play-disc:disabled {
  background: rgba(20, 32, 46, 0.1);
  color: rgba(20, 32, 46, 0.35);
  cursor: default;
}

.play-disc svg {
  width: clamp(26px, 1.5vw, 36px);
  height: clamp(26px, 1.5vw, 36px);
}

.play-disc .icon-play path,
.play-disc .icon-pause path {
  fill: currentColor;
  stroke: none;
}

.play-disc .icon-pause {
  display: none;
}

.play-disc.is-playing .icon-play {
  display: none;
}

.play-disc.is-playing .icon-pause {
  display: block;
}

.next-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: clamp(42px, 2.5vw, 56px);
  padding: 0 clamp(10px, 0.7vw, 16px);
  border: 1px solid rgba(20, 32, 46, 0.16);
  border-radius: clamp(11px, 0.9vw, 15px);
  background: rgba(255, 255, 255, 0.55);
  color: rgba(20, 32, 46, 0.9);
  font-size: clamp(14px, 0.9vw, 20px);
  font-weight: 650;
  white-space: nowrap;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.16s ease;
}

.next-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(20, 32, 46, 0.28);
}

.next-btn.is-ready {
  background: #1c1c1e;
  border-color: #1c1c1e;
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(20, 32, 46, 0.45);
}

.next-btn.is-ready:hover:not(:disabled) {
  background: #323234;
  border-color: #323234;
}

.next-btn:disabled {
  background: rgba(20, 32, 46, 0.06);
  border-color: transparent;
  color: rgba(20, 32, 46, 0.38);
  cursor: default;
}

.next-btn.is-done:disabled {
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: none;
  color: rgba(20, 32, 46, 0.55);
  font-weight: 700;
}

.next-icon {
  display: grid;
  place-items: center;
  width: clamp(16px, 1vw, 20px);
  height: clamp(16px, 1vw, 20px);
  flex-shrink: 0;
}

.next-icon > svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.next-btn.is-done .next-icon {
  display: none;
}

.transport.is-static .seek,
.transport.is-static .transport-times,
.transport.is-static .seek-btn,
.transport.is-static .play-disc {
  visibility: hidden;
}

.transport.is-static .audio-label {
  color: rgba(20, 32, 46, 0.92);
}

/* ---------- 音频版权提示 ---------- */

.audio-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  margin: 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  font-size: clamp(12px, 0.75vw, 14px);
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 教材抽屉 ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 35, 0.36);
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(360px, 92vw);
  background: var(--surface);
  box-shadow: 12px 0 40px rgba(20, 32, 46, 0.18);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.drawer-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.drawer-nav {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 28px;
}

.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.series-label {
  padding: 16px 10px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.book-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 15px;
  font-weight: 650;
  transition: background 0.15s ease;
}

.book-btn:hover {
  background: var(--surface-2);
}

.book-btn[aria-expanded="true"] {
  background: var(--surface-2);
}

.book-state {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.book-state.is-ready {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.book-btn .chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.12s ease;
}

.book-btn[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.book-meta > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.units {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 2px 0 10px;
  padding: 2px 0 2px 4px;
}

.unit-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 10px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.unit-btn:hover {
  background: var(--surface-2);
}

.unit-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.unit-code {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.unit-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-btn[aria-current="true"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 650;
}

.unit-btn[aria-current="true"] .unit-code {
  background: var(--primary);
  color: #fff;
}

.unit-btn.soon {
  color: var(--muted);
}

.unit-btn.soon .unit-code {
  opacity: 0.75;
}

.badge-soon {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.7;
}

.section-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 10px 26px;
  padding: 2px 0 2px 12px;
  border-left: 1px solid var(--line);
}

.section-btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
  transition: background 0.15s ease;
}

.section-btn:hover {
  background: var(--surface-2);
}

.section-btn[aria-current="true"] {
  background: var(--primary);
  color: #fff;
  font-weight: 650;
}

.section-btn.disabled {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.55;
}

/* ---------- 提示与播报 ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--topbar-h) + 14px);
  z-index: 120;
  max-width: min(520px, 90vw);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast.is-warn {
  background: var(--warn);
}

/* ---------- 响应式 ---------- */

@media (max-width: 1599px) {
  .step-time {
    display: none;
  }
}

@media (max-width: 1399px) {
  .step {
    max-width: none;
  }

  .step:not(.active) .step-name {
    display: none;
  }

  .step {
    padding: 5px 8px;
  }
}

@media (max-width: 1199px) {
  .stage {
    padding: 22px 24px 150px;
  }
}

@media (max-width: 900px) {
  .help-pop {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 700px) {
  .crumb {
    display: flex;
  }

  .crumb > span {
    display: none;
  }

  .crumb strong {
    font-size: 14px;
  }

  .topbar {
    gap: 8px;
  }

  .transport {
    padding: 8px 12px 10px;
    border-radius: 16px;
  }

  .fb-btn {
    width: 40px;
    padding: 0;
  }

  .fb-label {
    display: none;
  }

  .play-disc {
    width: 50px;
    height: 50px;
  }

  .play-disc svg {
    width: 23px;
    height: 23px;
  }

  .next-btn {
    padding: 0 12px;
  }
}

@media (max-width: 1023px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .menu-btn {
    padding: 0 8px;
  }

  .stage {
    padding: 18px 16px 150px;
  }

  .side-layout {
    grid-template-columns: 1fr;
  }

  .familiar-card {
    padding-top: 56px;
  }

  .word-card {
    justify-self: center;
  }

  .side-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .word-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .word-main {
    grid-column: 1;
    grid-row: auto;
    align-self: auto;
  }

}

@media (max-height: 820px) {
  .stage {
    padding-top: 18px;
    padding-bottom: 180px;
  }

  .stage-inner {
    gap: 12px;
  }

  .now-text {
    font-size: clamp(20px, 1.8vw, 26px);
  }

  .panel {
    gap: 12px;
    padding: 16px 20px;
  }

  .word-card {
    gap: 12px;
  }

  .headword {
    font-size: clamp(34px, 3.4vw, 42px);
  }

  .sentence-text {
    font-size: clamp(26px, 3vw, 38px);
  }

  .sentence-panel {
    min-height: 180px;
  }

  .gloss {
    font-size: 22px;
  }

  .note {
    font-size: 14px;
    line-height: 1.45;
  }

  .audio-btn {
    min-height: 50px;
    padding: 0 14px;
    font-size: 16px;
  }

  .word-context {
    padding-top: 12px;
  }

  .context-line {
    padding: 10px 16px;
    font-size: 20px;
  }

  .side-list {
    max-height: calc(100vh - 430px);
    max-height: calc(100dvh - 430px);
  }

  .frame-list {
    gap: 10px;
  }

  .frame-item {
    padding: 10px 14px;
    font-size: 18px;
  }

  .now-line {
    padding-top: 0;
  }

}

@media (max-height: 700px) {
  .stage {
    padding-top: 12px;
    padding-bottom: 170px;
  }

  .stage-inner {
    gap: 10px;
  }

  .now-line {
    padding-top: 0;
  }

  .now-text {
    font-size: 20px;
  }

  .panel {
    gap: 10px;
    padding: 10px 14px;
  }

  .word-card {
    gap: 8px;
  }

  .familiar-glyph {
    width: 170px;
    height: 62px;
  }

  .familiar-glyph > .glyph-question,
  .familiar-glyph > .glyph-audio {
    width: 60px;
    height: 60px;
  }

  .headword {
    font-size: 34px;
  }

  .meta-line {
    font-size: 16px;
  }

  .gloss {
    font-size: 20px;
  }

  .note {
    display: none;
  }

  .audio-btn {
    min-height: 44px;
    padding: 0 12px;
    font-size: 15px;
    gap: 6px;
  }

  .word-context {
    padding-top: 10px;
  }

  .context-line {
    padding: 8px 12px;
    font-size: 18px;
  }

  .side-list {
    max-height: calc(100vh - 380px);
    max-height: calc(100dvh - 380px);
  }

  .sentence-panel {
    min-height: 140px;
    padding: 18px;
  }


  .mask-icon {
    width: 34px;
    height: 34px;
  }

  .frame-list {
    gap: 8px;
  }

  .frame-item {
    padding: 8px 12px;
    font-size: 16px;
  }


}

@media (max-width: 560px) {
  .menu-btn {
    padding: 0 6px;
  }

  .menu-btn span {
    display: none;
  }

  .topbar {
    gap: 6px;
    padding: 0 8px;
  }

  .top-actions .icon-btn {
    width: 38px;
    height: 38px;
  }

  .step {
    gap: 4px;
    padding: 4px 5px;
  }

  .step-no {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .step.active .step-name {
    font-size: 12px;
  }

  .stage {
    padding: 14px 12px 140px;
  }

  .now-text {
    font-size: 20px;
  }

  .panel {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .next-btn {
    width: 40px;
    padding: 0;
  }

  .next-label {
    display: none;
  }

  .transport-times {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
