﻿:root {
  --bg-1: #fef6e4;
  --bg-2: #b3e5fc;
  --ink: #1f2937;
  --primary: #ff7a59;
  --primary-dark: #e35f3f;
  --good: #2e7d32;
  --bad: #c62828;
  --card: #ffffffcc;
}

@font-face {
  font-family: "TvPoppins";
  src: url("./assets/fonts/Poppins-800.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "TvPoppins";
  src: url("./assets/fonts/Poppins-900.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "TvMontserrat";
  src: url("./assets/fonts/Montserrat-800.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "TvMontserrat";
  src: url("./assets/fonts/Montserrat-900.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  --tv-bg-deep: #1b2430;
    --tv-bg-mid: #223040;
    --tv-bg-soft: #2c3c4f;
    --tv-panel-top: #edf0f2;
    --tv-panel-bottom: #dde4e9;
    --tv-panel-line: #c6d0da;
    --tv-panel-soft: rgba(235, 240, 244, 0.92);
    --tv-ink-strong: #223246;
    --tv-ink-main: #31465d;
    --tv-ink-soft: #61778f;
    --tv-gold: #d39a54;
    --tv-gold-deep: #b97d3d;
    --tv-key-top: #f4f6f7;
    --tv-key-mid: #e7ecef;
    --tv-key-bottom: #d9e1e7;
    --tv-key-border: #b8c5d0;
    --tv-key-base: #aab8c4;
    --tv-fn-top: #eee5d7;
    --tv-fn-mid: #e3d6c2;
    --tv-fn-bottom: #d6c5ab;
    --tv-fn-border: #bba88b;
    --tv-fn-base: #a69275;
    --tv-state-success: #7d9870;
    --tv-state-success-soft: rgba(125, 152, 112, 0.22);
    --tv-state-error: #b47b72;
    --tv-state-error-soft: rgba(180, 123, 114, 0.2);
    --tv-state-focus: #cda168;
    --tv-state-focus-soft: rgba(205, 161, 104, 0.2);
    --tv-blue: #7d98b7;
    --tv-blue-deep: #607fa5;
    --tv-danger: #c6746d;
    --tv-shadow: rgba(7, 14, 24, 0.24);
    background:
      radial-gradient(circle at 18% 12%, rgba(116, 145, 182, 0.1), transparent 20%),
      radial-gradient(circle at 84% 18%, rgba(211, 154, 84, 0.08), transparent 16%),
      linear-gradient(180deg, #243243 0%, #1c2735 58%, #16202b 100%);
    color: #dce3ea;
}

.app-shell {
  width: min(980px, 96vw);
  margin: 0 auto;
  padding: 20px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid #d1d5db; }

.quick-config { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.quick-config label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
select { border-radius: 10px; border: 1px solid #cbd5e1; padding: 8px; min-width: 140px; }

.tv-progress,
.celebration-burst {
  display: none;
}

.emoji { font-size: clamp(3rem, 8vw, 6rem); text-align: center; }
.hint { text-align: center; font-weight: 700; margin: 8px 0 14px; }
.feedback-badge {
  display: none;
  align-self: center;
  min-width: 160px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.feedback-badge.success,
.feedback-badge.error,
.feedback-badge.complete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feedback-badge.success {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.feedback-badge.error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
}

.feedback-badge.complete {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
}

.learn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.learn-word {
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: clamp(4rem, 14vw, 12rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #111;
  text-align: center;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.learn-meaning {
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  color: #475569;
  text-align: center;
}

.answer-slots,
.letter-bank {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.slot,
.letter,
.option {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
  user-select: none;
}

.slot { background: #fff; border: 2px dashed #94a3b8; }
.slot.filled { border-style: solid; border-color: #64748b; }
.slot.clickable { cursor: pointer; }
.letter-bank { margin-top: 16px; }
.letter { background: #fff; border: 2px solid #cbd5e1; cursor: pointer; }
.letter.used { opacity: 0.35; cursor: not-allowed; }

.option-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  max-width: 560px;
  margin: 0 auto;
}

.option {
  width: 100%;
  height: 64px;
  border: 2px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.option.active { border-color: var(--primary); background: #fff2ee; }
.mcq-prompt {
  width: min(760px, 100%);
  margin: 0 auto 14px;
  text-align: center;
}
.mcq-word {
  font-size: clamp(5vh, 11vw, 14vh);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 0.95;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.mcq-cn {
  margin-top: 0.6vh;
  font-size: clamp(4.2vh, 6vw, 8.5vh);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #0f172a;
  text-wrap: balance;
}
.mcq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 92vw;
}
.mcq-option {
  min-height: 14vh;
  height: auto;
  padding: 1.6vh 1.4vw;
  line-height: 1.15;
}
.fill-blank-sentence {
  margin: 8px auto 0;
  max-width: 760px;
  padding: 10px 12px;
  font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  font-weight: 800;
  color: #0f172a;
  text-wrap: balance;
}
.cloze-blank {
  display: inline-block;
  min-width: 5ch;
  padding: 0 4px;
  border-bottom: 3px solid #64748b;
  margin: 0 4px;
  color: #1d4ed8;
}

.intro-card {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 22px 18px 26px;
  text-align: center;
  color: #172033;
}

.intro-kicker {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #475569;
  font-weight: 900;
}

.intro-title {
  margin: 0;
  max-width: 920px;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-stats,
.intro-type-grid {
  width: 100%;
  display: grid;
  gap: 14px;
}

.intro-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 740px;
}

.intro-stat,
.intro-type-card {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.intro-stat {
  padding: 16px 12px;
}

.intro-stat span {
  display: block;
  color: #64748b;
  font-weight: 800;
}

.intro-stat strong {
  display: block;
  margin-top: 4px;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
}

.intro-type-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.intro-type-card {
  min-height: 150px;
  padding: 16px 14px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
}

.intro-type-icon {
  font-size: 2.4rem;
}

.intro-type-card strong {
  font-size: 1.25rem;
  color: #0f172a;
}

.intro-type-card em {
  font-style: normal;
  font-weight: 900;
  color: #b97d3d;
}

.intro-type-card p {
  margin: 0;
  color: #475569;
  font-weight: 700;
}

.intro-foot {
  color: #475569;
  font-size: 1.1rem;
  font-weight: 800;
}

.completion-card {
  margin: 0 auto;
  width: min(760px, 100%);
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  padding: 24px 20px;
}

.completion-burst {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 3rem;
  background: radial-gradient(circle at 30% 30%, #fff7ed, #fdba74);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.28);
}

.completion-title {
  margin: 0;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0.03em;
  color: #0f172a;
}

.completion-subtitle {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: #475569;
}

.completion-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.completion-stat {
  padding: 16px 14px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.completion-stat span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-weight: 700;
}

.completion-stat strong {
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #0f172a;
}

.completion-review {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 24px rgba(15, 23, 42, 0.06);
}

.completion-review strong {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: #1e293b;
}

.completion-review-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.completion-chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.completion-chip small {
  margin-left: 8px;
  color: #64748b;
  font-size: 0.72em;
}

.completion-chip.perfect {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
}

.completion-insight {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-weight: 800;
}

.completion-insight strong {
  color: #0f172a;
}

.completion-actions {
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  padding: 2.5vh 2vw 2vh;
  display: flex;
  flex-direction: column;
  gap: 1.4vh;
  overflow: hidden;
}

.quick-config { display: none; }

.word-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(181, 196, 214, 0.22), transparent 34%),
    linear-gradient(180deg, var(--tv-panel-top) 0%, var(--tv-panel-bottom) 100%);
  border-radius: 34px;
  padding: 0.8vh 2.4vw 0.55vh;
  gap: 0.3vh;
  box-shadow:
    0 22px 48px var(--tv-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 0 0 1px rgba(198, 208, 218, 0.78);
  overflow: hidden;
  position: relative;
}

.tv-top-left-actions {
  position: absolute;
  left: 1.6vw;
  top: 1vh;
  z-index: 6;
  display: flex;
  gap: 0.6vw;
}

.tv-top-left-actions .btn {
  min-width: 8.8vw;
  font-size: 1.85vh;
  padding: 0.7vh 1vw;
  border: 0;
  border-radius: 999px;
  background: rgba(230, 236, 241, 0.96);
  color: var(--tv-ink-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
}

.tv-top-right-actions {
  position: absolute;
  right: 1.6vw;
  top: 1vh;
  z-index: 6;
  display: flex;
  gap: 0.6vw;
}

.cn-toggle-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15vh;
  min-width: 6.8vw;
  padding: 0.55vh 1vw 0.65vh;
  border-radius: 16px;
  border: 1.5px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #1f2937;
  font-family: inherit;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.cn-toggle-chip:hover { transform: translateY(-1px); box-shadow: 0 9px 18px rgba(15, 23, 42, 0.14); }

.cn-toggle-chip:focus-visible {
  outline: 3px solid #fcd34d;
  outline-offset: 3px;
}

.cn-toggle-chip.is-cn {
  background: linear-gradient(180deg, #fff6d9, #fbd877);
  border-color: rgba(180, 120, 20, 0.45);
  color: #4a2f06;
}

.cn-toggle-top {
  display: inline-flex;
  align-items: center;
  gap: 0.3vw;
  font-size: 1.95vh;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cn-toggle-flag { font-size: 2.15vh; line-height: 1; }

.cn-toggle-bottom {
  font-size: 1.45vh;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.04em;
}

.cn-toggle-chip.is-cn .cn-toggle-bottom { color: #6b4a08; }

.word-stage.learn-layout .tv-progress,
.word-stage.spell-layout .tv-progress,
.word-stage.listen-layout .tv-progress {
  opacity: 0.7;
}

.tv-progress {
  width: min(34vw, 460px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.42vw;
  margin-bottom: 0.1vh;
  padding: 0.45vh 0.8vw;
  border-radius: 999px;
  background: rgba(211, 220, 229, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.52);
}

.progress-star {
  font-size: 2.1vh;
  line-height: 1;
  color: #aebccc;
  transform: scale(0.92);
  transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
}

.progress-star.done {
  color: var(--tv-gold);
  transform: scale(1.08);
  text-shadow: 0 0 10px rgba(211, 154, 84, 0.18);
}

.progress-star.current {
  color: var(--tv-blue);
  transform: scale(1.18);
  animation: progress-pulse 1.2s ease-in-out infinite;
}

.word-stage.stage-success {
  box-shadow: 0 20px 40px rgba(125, 152, 112, 0.14), inset 0 0 0 4px var(--tv-state-success-soft);
}

.word-stage.stage-error {
  box-shadow: 0 20px 40px rgba(180, 123, 114, 0.14), inset 0 0 0 4px var(--tv-state-error-soft);
}

.word-stage.stage-complete {
  box-shadow: 0 22px 42px rgba(205, 161, 104, 0.14), inset 0 0 0 4px var(--tv-state-focus-soft);
}

.emoji {
  width: 13.6vh;
  height: 13.6vh;
  display: grid;
  place-items: center;
  font-size: 7.6vh;
  line-height: 1;
  color: #1a2738;
  opacity: 1;
  background: linear-gradient(180deg, #f8f0c5, #e8d891);
  border-radius: 50%;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.13), inset 0 0 0 5px rgba(39, 53, 72, 0.78);
}

.hint {
  margin: 0;
  padding: 0.5vh 1.6vw;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #1a2738;
  font-size: 5.6vh;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.hint:empty {
  padding: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}

.feedback-badge {
  min-width: 16vw;
  margin: 0;
  padding: 1vh 1.9vw;
  font-size: 2.55vh;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.11);
  animation: badge-pop 220ms ease-out;
  position: relative;
  z-index: 3;
}

.celebration-burst {
  position: absolute;
  inset: 18% 12% auto;
  height: 20vh;
  display: block;
  pointer-events: none;
  z-index: 2;
}

.burst-dot {
  position: absolute;
  left: 50%;
  top: 48%;
  font-size: 3.8vh;
  line-height: 1;
  color: var(--tv-gold);
  text-shadow: 0 0 10px rgba(211, 154, 84, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.celebration-burst.success .burst-dot {
  animation: burst-fly 900ms ease-out forwards;
  animation-delay: var(--burst-delay, 0s);
}

.celebration-burst.error .burst-dot {
  color: #cf8a83;
  font-size: 2.6vh;
  animation: burst-drop 520ms ease-out forwards;
  animation-delay: var(--burst-delay, 0s);
}

#stageArea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.learn-card {
  width: min(100%, 1320px);
  gap: 2.6vh;
  padding: 0;
  max-height: 100%;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.learn-word {
  font-size: min(24vh, 19vw);
  letter-spacing: 0.035em;
  color: var(--tv-ink-strong);
  text-shadow: 0 2px 0 rgba(255,255,255,0.28);
  max-width: 86vw;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 0.9;
}
.learn-meaning {
  font-size: 3.1vh;
  color: var(--tv-ink-soft);
}

.answer-slots,
.letter-bank {
  column-gap: 1.9vw;
  row-gap: 1.4vw;
}

.spell-help {
  margin: 0;
  min-height: 2.7vh;
  padding: 0.5vh 1vw;
  border-radius: 999px;
  font-size: 1.72vh;
  font-weight: 800;
  color: var(--tv-ink-main);
  background: rgba(228, 234, 239, 0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 14px rgba(71, 85, 105, 0.08);
}

.spell-help.info {
  color: var(--tv-ink-main);
}

.spell-help.hint {
  color: #815329;
  background: linear-gradient(180deg, #f4ebd8, #ebddc0);
}

.spell-help.success {
  color: #5a7451;
  background: linear-gradient(180deg, #e7ede2, #dbe4d4);
}

.spell-help.answer {
  color: #7c6545;
  background: linear-gradient(180deg, #eee7db, #e5dac7);
}

.slot,
.letter {
  width: var(--slot-size, 7.2vw);
  height: var(--slot-height, 8.7vw);
  max-width: 17vh;
  max-height: 20vh;
  font-size: var(--slot-font, 7.2vw);
  border-radius: 24px;
  border-width: 0;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: scaleY(1.06);
  transform-origin: center;
  position: relative;
}

.slot {
  background: linear-gradient(180deg, #5d6774, #495361);
  color: #f8fafc;
  border: 0;
  box-shadow: inset 0 6px 12px rgba(255,255,255,0.05), inset 0 -10px 14px rgba(15,23,42,0.24);
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.4);
}

.slot.active {
  background: linear-gradient(180deg, #647080, #4e596a);
  box-shadow:
    inset 0 0 0 6px var(--tv-state-focus),
    0 0 0 5px var(--tv-state-focus-soft),
    0 0 14px rgba(185, 125, 61, 0.2);
  animation: slot-pulse 1.2s ease-in-out infinite;
}

.slot.filled {
  background: linear-gradient(180deg, #f0f3f5, #dfe6eb);
  box-shadow: inset 0 0 0 3px rgba(183, 196, 209, 0.92), 0 8px 14px rgba(15, 23, 42, 0.06);
  color: var(--tv-ink-strong);
}

.slot[data-token-type="vowel"] {
  box-shadow: inset 0 0 0 4px rgba(211, 154, 84, 0.82), inset 0 -4px 10px rgba(211, 154, 84, 0.12);
}

.slot[data-token-type="chunk"] {
  box-shadow: inset 0 0 0 4px rgba(125, 152, 183, 0.84), inset 0 -4px 10px rgba(125, 152, 183, 0.12);
}

.slot[data-token-type="letter"] {
  box-shadow: inset 0 0 0 4px rgba(191, 203, 214, 0.94), inset 0 -4px 10px rgba(100, 116, 139, 0.14);
}

.slot.active[data-token-type] {
  box-shadow:
    inset 0 0 0 6px var(--tv-state-focus),
    0 0 0 5px var(--tv-state-focus-soft),
    0 0 14px rgba(185, 125, 61, 0.2);
}

.slot.wrong[data-token-type],
.slot.wrong {
  box-shadow:
    inset 0 0 0 5px var(--tv-state-error),
    0 0 0 4px var(--tv-state-error-soft),
    0 0 12px rgba(180, 123, 114, 0.16);
}

.slot.slot-locked {
  background: linear-gradient(180deg, #fff4d1, #f6e29b);
  box-shadow: inset 0 0 0 3px rgba(212, 165, 71, 0.55), 0 4px 10px rgba(15, 23, 42, 0.05);
  color: #6b4f12;
  text-shadow: none;
}
.slot.slot-locked.clickable {
  cursor: default;
}
.slot.slot-locked.filled::after {
  display: none;
}

.slot[data-chunk-start="true"] { margin-left: 10px; }
.slot[data-chunk-start="true"]:first-child { margin-left: 0; }
.slot[data-chunk-end="false"] { margin-right: 0; }
.slot[data-chunk-start="false"] {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
.slot[data-chunk-end="false"] {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.slot[data-silent="true"] {
  opacity: 0.45;
  background: linear-gradient(180deg, #e5e7eb, #d1d5db);
  color: #6b7280;
  font-style: italic;
}
.slot[data-silent="true"]::before {
  content: "🔇";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.55em;
  opacity: 0.7;
  pointer-events: none;
}
.slot[data-long-vowel="true"] {
  box-shadow: inset 0 0 0 3px rgba(220, 38, 38, 0.6), 0 6px 12px rgba(220, 38, 38, 0.15);
}
.slot[data-long-vowel="true"]::after {
  content: "ˉ";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  color: #b91c1c;
  font-weight: 900;
  font-size: 1.4em;
  pointer-events: none;
}

.letter {
  color: var(--tv-ink-strong);
  border-radius: 24px;
  border-bottom: 12px solid #b9c7d3;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

.letter[data-token-type="vowel"] {
  background: linear-gradient(180deg, #fff4df, #ffe5bf);
  border-bottom-color: #f7b464;
}

.letter[data-token-type="chunk"] {
  background: linear-gradient(180deg, #eef6ff, #d9eaff);
  border-bottom-color: #7eb6f6;
}

.letter[data-token-type="letter"] {
  background: linear-gradient(180deg, #eefbf3, #d7f7e3);
  border-bottom-color: #7ed7a0;
}

.letter.used {
  opacity: 0.24;
  filter: saturate(0.42);
  box-shadow:
    0 3px 0 #c3cedb,
    0 8px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transform: scale(0.96) scaleY(1.06);
}

.token-speaker {
  position: absolute;
  right: 0.5vw;
  bottom: 0.5vw;
  width: 2.8vh;
  height: 2.8vh;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.45vh;
  line-height: 1;
  background: rgba(231, 236, 241, 0.94);
  color: var(--tv-blue-deep);
  box-shadow: 0 4px 10px rgba(96, 127, 165, 0.12);
  transform: none;
}

.slot .token-speaker {
  background: rgba(255, 255, 255, 0.95);
}

.letter .token-speaker {
  background: rgba(255, 255, 255, 0.98);
}

.token-speaker:hover {
  background: #eef2f5;
  color: #536d90;
}

.spell-layout #stageArea {
  align-items: flex-start;
}

.word-stage.spell-layout {
  overflow: visible;
}

.spell-board {
  width: min(86vw, 1360px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  justify-items: center;
  gap: 0.8vh;
  min-height: 100%;
  padding: 0.4vh 0 24vh;
}

.spell-layout .answer-slots {
  width: min(82vw, 1240px);
  display: flex;
  flex-wrap: wrap;
  gap: 1.1vh 0.9vw;
  align-content: center;
  justify-content: center;
  justify-items: initial;
  padding: 0;
}

.spell-layout .letter-bank {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.68vh;
  align-content: center;
  justify-items: center;
  padding: 0;
  justify-content: center;
}

.spell-layout .keyboard-floating {
  position: absolute;
  width: min(72vw, 980px);
  display: grid;
  gap: 0.72vh;
  padding: 0.9vh 0.9vw 1.1vh;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(227, 233, 238, 0.97), rgba(214, 223, 231, 0.97));
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(182, 195, 208, 0.94);
  z-index: 7;
}

.spell-layout .keyboard-floating.dragging {
  box-shadow:
    0 22px 42px rgba(96, 127, 165, 0.18),
    0 0 0 3px rgba(125, 152, 183, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.spell-layout .keyboard-drag-handle {
  width: fit-content;
  min-width: 14vw;
  margin: 0 auto;
  padding: 0.55vh 0.9vw;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55vw;
  background: rgba(208, 218, 228, 0.92);
  color: #5e7388;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: 1.55vh;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.spell-layout .keyboard-floating.dragging .keyboard-drag-handle {
  cursor: grabbing;
}

.spell-layout .keyboard-drag-grip {
  width: 2.6vw;
  min-width: 36px;
  height: 0.45vh;
  border-radius: 999px;
  display: block;
  background: linear-gradient(90deg, #8ba0b7, #b4c2cf);
  box-shadow: 0 0.55vh 0 0 #8ba0b7;
}

.keyboard-row {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 0.58vw;
  padding: 0 0.25vw;
}

.keyboard-row.row-2 {
  padding: 0 1.55vw;
}

.keyboard-row.row-3 {
  padding: 0 3.35vw;
}

.spell-layout #stageArea {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "board";
  row-gap: 0;
  align-items: start;
  justify-items: center;
  padding-top: 0;
  align-content: start;
}

.spell-layout .spell-board {
  grid-area: board;
  justify-self: center;
}

.spell-layout #spellHelp {
  justify-self: center;
  width: min(40vw, 560px);
  text-align: center;
}

.spell-layout #letterBank {
  justify-self: stretch;
}

.spell-layout .slot {
  width: min(var(--slot-size, 7.8vw), 10.8vw);
  height: min(var(--slot-height, 8.4vw), 11.4vh);
}

.spell-layout .answer-slots[data-rows="2"] {
  width: min(72vw, 1080px);
}

.spell-layout .letter {
  width: min(5.1vw, 94px);
  height: min(6.3vh, 82px);
  min-width: 0;
  font-size: min(4.1vh, 3.05vw);
  line-height: 1;
  border-radius: 18px;
  border: 2px solid var(--tv-key-border);
  border-bottom-width: 5px;
  box-shadow:
    0 4px 0 var(--tv-key-base),
    0 10px 16px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  padding: 0;
  color: var(--tv-ink-strong);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.spell-layout .letter[data-token-type="vowel"],
.spell-layout .letter[data-token-type="chunk"],
.spell-layout .letter[data-token-type="letter"] {
  background: linear-gradient(180deg, var(--tv-key-top) 0%, var(--tv-key-mid) 56%, var(--tv-key-bottom) 100%);
  border-color: var(--tv-key-border);
  border-bottom-color: var(--tv-key-base);
}

.spell-layout .special-key {
  width: min(6.9vw, 126px);
  min-width: min(6.9vw, 126px);
  padding: 0 0.45vw;
  font-size: min(2.25vh, 1.7vw);
  letter-spacing: 0.015em;
  color: #6f5d45;
  background: linear-gradient(180deg, var(--tv-fn-top) 0%, var(--tv-fn-mid) 56%, var(--tv-fn-bottom) 100%);
  border-color: var(--tv-fn-border);
  border-bottom-color: var(--tv-fn-base);
  box-shadow:
    0 4px 0 var(--tv-fn-base),
    0 10px 16px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.spell-layout .special-key.enter-key {
  width: min(6.9vw, 126px);
  min-width: min(6.9vw, 126px);
  color: #7c6545;
  background: linear-gradient(180deg, #f1e8da 0%, #e5d8c2 56%, #d9c6a6 100%);
  border-color: #bca88b;
  border-bottom-color: #a28f74;
}

.slot.slot-pop {
  animation: slot-fill-pop 220ms ease-out;
}

.answer-slots.spell-error {
  animation: spell-shake 280ms ease-in-out;
}

.spell-reveal-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 30, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: spell-reveal-in 260ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.spell-reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vh;
  padding: 3vh 5vw 3.5vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.spell-reveal-badge {
  font-size: max(1vw, 12px);
  font-weight: 700;
  color: #f87171;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spell-reveal-emoji { font-size: max(3.8vw, 44px); line-height: 1; }

.spell-reveal-word {
  font-size: max(6.8vw, 58px);
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 36px rgba(96, 165, 250, 0.28);
}

.spell-reveal-chunks {
  font-size: max(1.8vw, 17px);
  color: #93c5fd;
  letter-spacing: 0.16em;
  font-weight: 500;
}

.spell-reveal-hint {
  font-size: max(2vw, 17px);
  color: #e2e8f0;
}

.spell-reveal-ipa {
  font-size: max(1.5vw, 14px);
  color: #94a3b8;
  font-style: italic;
}

.spell-reveal-btn {
  margin-top: 1vh;
  padding: 1.4vh 4vw;
  font-size: max(1.7vw, 17px);
  font-weight: 700;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
  transition: background 120ms, transform 80ms, box-shadow 120ms;
}

.spell-reveal-btn:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.48);
}

.spell-reveal-btn:active { transform: scale(0.97); }

@keyframes spell-reveal-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.listen-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 30, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: spell-reveal-in 260ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.listen-reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.6vh;
  padding: 5vh 6vw;
  width: min(96vw, 1600px);
  max-height: 96vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 32px;
  border: 2px solid rgba(74, 222, 128, 0.32);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(74, 222, 128, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.listen-reveal-badge {
  font-size: max(1.6vw, 22px);
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.listen-reveal-emoji {
  font-size: max(7vw, 90px);
  line-height: 1;
}

.listen-reveal-word-row {
  display: flex;
  align-items: center;
  gap: 2vw;
  flex-wrap: wrap;
  justify-content: center;
}

.listen-reveal-word {
  font-size: max(10vw, 110px);
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 36px rgba(96, 165, 250, 0.32);
}

.listen-reveal-pos {
  font-size: max(2.6vw, 32px);
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border: 2px solid rgba(251, 191, 36, 0.36);
  padding: 0.6vh 1.8vw;
  border-radius: 999px;
  letter-spacing: 0.04em;
  font-style: italic;
}

.listen-reveal-ipa {
  font-size: max(3.2vw, 40px);
  color: #cbd5e1;
  font-style: italic;
  letter-spacing: 0.02em;
}

.listen-reveal-hint {
  font-size: max(4vw, 48px);
  color: #f1f5f9;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}

.listen-reveal-example {
  display: flex;
  align-items: center;
  gap: 2.4vw;
  margin-top: 1.2vh;
  padding: 2.6vh 3vw;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  width: 100%;
  box-sizing: border-box;
}

.listen-reveal-speak {
  flex-shrink: 0;
  width: max(7vw, 78px);
  height: max(7vw, 78px);
  font-size: max(3.4vw, 38px);
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.42);
  transition: transform 80ms, box-shadow 120ms;
}

.listen-reveal-speak--sm {
  width: max(5vw, 56px);
  height: max(5vw, 56px);
  font-size: max(2.4vw, 28px);
}

.listen-reveal-speak:hover {
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.52);
}

.listen-reveal-speak:focus-visible {
  outline: 4px solid #fde047;
  outline-offset: 4px;
}

.listen-reveal-speak:active { transform: scale(0.92); }

.listen-reveal-example-text {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.listen-reveal-example-en {
  font-size: max(3.2vw, 38px);
  color: #f1f5f9;
  line-height: 1.35;
  font-weight: 500;
}

.listen-reveal-example-cn {
  font-size: max(2.6vw, 30px);
  color: #cbd5e1;
  line-height: 1.35;
}

.listen-reveal-blank {
  color: #4ade80;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.4);
}

.listen-reveal-btn {
  margin-top: 1.6vh;
  padding: 2.4vh 6vw;
  font-size: max(3vw, 34px);
  font-weight: 800;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.42);
  transition: background 120ms, transform 80ms, box-shadow 120ms;
}

.listen-reveal-btn:hover {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.52);
}

.listen-reveal-btn:focus-visible {
  outline: 5px solid #fde047;
  outline-offset: 4px;
}

.listen-reveal-btn:active { transform: scale(0.97); }

/* 答错版（红色） */
.listen-reveal-card.is-wrong {
  border-color: rgba(248, 113, 113, 0.36);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(248, 113, 113, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.listen-reveal-card.is-wrong .listen-reveal-badge {
  color: #f87171;
}

.listen-reveal-card.is-wrong .listen-reveal-blank {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.4);
}

.listen-reveal-card.is-wrong .listen-reveal-btn {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.42);
}

.listen-reveal-card.is-wrong .listen-reveal-btn:hover {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.52);
}

.slot.clickable.filled::after {
  content: "点此修改";
  position: absolute;
  left: 50%;
  bottom: -2.4vh;
  transform: translateX(-50%) scaleY(0.94);
  padding: 0.15vh 0.55vw;
  border-radius: 999px;
  font-size: 1.25vh;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  color: #4e6888;
  background: rgba(231, 236, 240, 0.96);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.slot.wrong.clickable.filled::after {
  content: "这里要改";
  color: #8c514c;
  background: rgba(239, 230, 229, 0.98);
}

.option-grid {
  max-width: 96vw;
  gap: 2vw;
  grid-template-columns: repeat(auto-fit, minmax(min(26vw, 360px), 1fr));
}
.option {
  min-height: 17vh;
  height: auto;
  padding: 2.2vh 1.6vw;
  font-size: clamp(2.6vh, 3.4vw, 5vh);
  font-weight: 900;
  border-width: 5px;
  border-radius: 28px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: keep-all;
  hyphens: none;
  box-shadow: 0 14px 22px rgba(15, 23, 42, 0.16), inset 0 -6px 0 rgba(15, 23, 42, 0.05);
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.option.active {
  transform: translateY(-4px);
  box-shadow: 0 22px 32px rgba(15, 23, 42, 0.24), inset 0 -6px 0 rgba(15, 23, 42, 0.05);
}

.option.is-answer-hint {
  border-color: #16a34a;
  background: #ecfdf3;
  box-shadow: 0 24px 34px rgba(22, 163, 74, 0.24), inset 0 -6px 0 rgba(22, 101, 52, 0.08);
}

/* MCQ 4 选项：固定 2 列 2 行，按钮自适应长度 */
.option-grid.mcq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 92vw;
}
.mcq-option {
  min-height: 16vh;
  padding: 2vh 1.6vw;
  font-size: clamp(2.5vh, 3.2vw, 4.6vh);
}

.cn-to-en-layout {
  width: min(90vw, 1460px);
  min-height: 58vh;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  column-gap: 4vw;
  margin: 0 auto;
  padding: 1vh 1vw 3vh;
}

.cn-to-en-prompt {
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 42vh;
}

.cn-to-en-prompt .mcq-cn {
  margin: 0;
  width: 100%;
  max-width: 34vw;
  font-size: clamp(5.8vh, 6.8vw, 12vh);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--tv-ink-strong);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.34);
  overflow-wrap: anywhere;
}

.option-grid.mcq-grid.cn-to-en-options {
  width: 100%;
  max-width: min(38vw, 720px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3.4vh 2.2vw;
  margin: 0;
}

.cn-to-en-options .mcq-option {
  min-height: 15.2vh;
  padding: 1.5vh 1.2vw;
  border-radius: 30px;
  font-size: clamp(3vh, 2.7vw, 5.6vh);
  line-height: 1;
}

@media (max-aspect-ratio: 4 / 3) {
  .cn-to-en-layout {
    width: min(92vw, 980px);
    grid-template-columns: 1fr;
    row-gap: 2vh;
    min-height: 64vh;
  }

  .cn-to-en-prompt {
    min-height: 16vh;
  }

  .cn-to-en-prompt .mcq-cn {
    max-width: 90vw;
    font-size: clamp(4.8vh, 10vw, 9vh);
  }

  .option-grid.mcq-grid.cn-to-en-options {
    max-width: 88vw;
  }
}

.controls {
  flex: 0 0 auto;
  min-height: 7.2vh;
  margin-top: 0.25vh;
  gap: 0.2vh;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-rows: auto auto;
}

.controls-main-row,
.controls-extra-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7vw;
  flex-wrap: wrap;
}

.controls-extra-row {
  display: none;
}

.controls-inline-status {
  display: none;
}
.btn {
  font-size: 3vh;
  padding: 1.45vh 2.8vw;
  border-radius: 999px;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}

button {
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:focus-visible {
  outline: none;
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 0 0 3px rgba(245, 243, 236, 0.92),
    0 0 0 7px rgba(205, 161, 104, 0.56),
    0 10px 20px rgba(15, 23, 42, 0.18);
  z-index: 2;
  position: relative;
}

.letter:focus-visible,
.option:focus-visible,
.option.is-focused {
  box-shadow:
    0 0 0 3px rgba(245, 243, 236, 0.92),
    0 0 0 6px rgba(205, 161, 104, 0.5),
    0 10px 18px rgba(107, 86, 58, 0.14);
}

.option.is-focused {
  outline: none;
  transform: translateY(-4px);
}

/* Plan 2026-05-21 · S1 listen mode：3 张超大词卡（强制 3 列 1 行布局，TV 远距离辨识） */
.option-grid.listen-mcq {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 92vw;
  gap: 2vw;
}
.option-grid.listen-mcq .option.listen-card {
  min-height: 22vh;
  padding: 2.4vh 1.4vw;
  font-size: clamp(2.6vh, 3vw, 5vh);
  line-height: 1.02;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

@media (max-width: 640px) {
  .option-grid.listen-mcq {
    grid-template-columns: 1fr;
    max-width: min(86vw, 340px);
    gap: 1vh;
  }

  .option-grid.listen-mcq .option.listen-card {
    min-height: 9.7vh;
    padding: 1vh 3vw;
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }
}

/* Plan 2026-05-21 · S2 reorder_chunk：词卡排序 */
.reorder-board {
  width: min(92vw, 1320px);
  margin: 0 auto;
  display: grid;
  gap: 2.4vh;
  justify-items: center;
}
.reorder-prompt {
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", sans-serif;
  font-size: clamp(3.6vh, 5.4vw, 7.2vh);
  font-weight: 900;
  color: var(--tv-ink-strong);
  text-align: center;
  letter-spacing: 0.02em;
  max-width: 92vw;
  line-height: 1.05;
}
.chunk-card-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(min(22vw, 280px), 1fr);
  gap: 1.8vw;
  width: 92vw;
  max-width: 1240px;
  justify-content: center;
}
.chunk-card {
  min-height: 20vh;
  padding: 2.4vh 1.6vw;
  border: 5px solid var(--tv-key-border);
  border-radius: 26px;
  background: linear-gradient(180deg, #fff7e0, #ffe5b5);
  color: #5b3f1d;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: clamp(3.2vh, 4.4vw, 6.8vh);
  letter-spacing: 0.02em;
  line-height: 1.05;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.16);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.chunk-card:hover {
  background: linear-gradient(180deg, #fff2c5, #ffd99a);
}
.chunk-card.is-focused {
  outline: none;
  border-color: var(--tv-state-focus);
  transform: translateY(-6px);
  box-shadow: 0 0 0 6px rgba(205, 161, 104, 0.4), 0 18px 32px rgba(15, 23, 42, 0.18);
}
.chunk-card.is-selected {
  background: linear-gradient(180deg, #d1ecff, #a8d5ff);
  color: #1b4170;
  border-color: var(--tv-blue-deep);
  transform: scale(1.04);
  box-shadow: 0 0 0 6px rgba(125, 152, 183, 0.36), 0 18px 32px rgba(15, 23, 42, 0.18);
}
.reorder-hints {
  font-size: clamp(1.6vh, 2vw, 2.6vh);
  color: var(--tv-ink-soft);
  text-align: center;
  letter-spacing: 0.02em;
  background: rgba(228, 234, 239, 0.65);
  padding: 0.7vh 1.4vw;
  border-radius: 999px;
}

.word-stage.chunk-match-layout-stage {
  gap: 0.15vh;
}

.word-stage.chunk-match-layout-stage .emoji {
  width: 8.8vh;
  height: 8.8vh;
  font-size: 4.9vh;
}

.word-stage.chunk-match-layout-stage .hint {
  max-width: 76vw;
  padding: 0.35vh 1.2vw;
  font-size: clamp(1.18rem, 2.8vh, 1.9rem);
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
}

.chunk-match-board {
  width: min(92vw, 1220px);
  gap: 1.5vh;
}

.chunk-match-prompt {
  max-width: min(92vw, 1220px);
  padding: 1.5vh 2.2vw;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff7e8, #f6e6c9);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), inset 0 0 0 2px rgba(205, 161, 104, 0.22);
  font-size: clamp(2.25rem, 4.1vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.chunk-match-grid.option-grid.mcq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(88vw, 1080px);
  max-width: min(88vw, 1080px);
  gap: 1.5vh 2vw;
}

.chunk-match-option.mcq-option {
  min-height: 10.2vh;
  padding: 1.15vh 1.5vw;
  border-width: 4px;
  border-color: #c8d3df;
  background: #fff;
  color: #030712;
  font-size: clamp(1.55rem, 2.65vw, 3rem);
  line-height: 1.08;
  box-shadow: 0 11px 0 #cbd5e1, 0 16px 30px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.chunk-match-option.mcq-option:hover,
.chunk-match-option.mcq-option:focus-visible,
.chunk-match-option.mcq-option.is-focused {
  border-color: #f59e0b;
  background: #fff7d6;
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 14px 0 #d97706, 0 22px 38px rgba(146, 64, 14, 0.24);
}

.chunk-match-option.mcq-option.active {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 7px 0 #1d4ed8, 0 15px 30px rgba(37, 99, 235, 0.24);
}

@media (max-width: 640px) {
  .chunk-match-board {
    width: min(92vw, 360px);
    gap: 1.1vh;
  }

  .chunk-match-prompt {
    padding: 1.2vh 3vw;
    border-radius: 18px;
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    line-height: 1.12;
  }

  .chunk-match-grid.option-grid.mcq-grid {
    width: min(86vw, 340px);
    max-width: min(86vw, 340px);
    gap: 8px;
  }

  .chunk-match-option.mcq-option {
    min-height: 6.8vh;
    padding: 0.65vh 2vw;
    font-size: clamp(1.02rem, 4.8vw, 1.28rem);
  }
}

/* Plan 2026-05-21 · S4 syllable_spell：音节折行 + 锁辅音/锁元音 */
.syllable-board {
  width: min(92vw, 1320px);
  margin: 0 auto;
  display: grid;
  gap: 1.6vh;
  justify-items: center;
  padding: 0.6vh 0 24vh;
}
.syllable-rows {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4vh 2.4vw;
  width: 100%;
}
.syllable-row {
  display: flex;
  gap: 0.7vw;
}
.syllable-cell {
  width: min(5.4vw, 96px);
  height: min(7.4vh, 96px);
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 3px dashed #94a3b8;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: clamp(3.4vh, 4.2vw, 6.4vh);
  color: var(--tv-ink-strong);
  letter-spacing: 0.02em;
}
.syllable-cell.filled {
  border-style: solid;
  border-color: #64748b;
}
.syllable-cell.active {
  border-color: var(--tv-state-focus);
  box-shadow: 0 0 0 4px rgba(205, 161, 104, 0.32);
  animation: slot-pulse 1.2s ease-in-out infinite;
}
.syllable-cell.syllable-cell--locked {
  background: linear-gradient(180deg, #e7e3d7, #d2cab8);
  border-style: solid;
  border-color: rgba(146, 124, 80, 0.55);
  color: rgba(60, 48, 24, 0.62);
  cursor: default;
}
.syllable-cell[data-token-type="vowel"]:not(.syllable-cell--locked) {
  border-color: rgba(211, 154, 84, 0.6);
}
.syllable-hint {
  margin-top: 0.4vh;
  padding: 0.6vh 1.4vw;
  border-radius: 999px;
  background: rgba(228, 234, 239, 0.75);
  font-size: clamp(1.8vh, 2vw, 2.4vh);
  font-weight: 800;
  color: var(--tv-ink-main);
}
.syllable-keyboard {
  width: min(80vw, 1080px);
  display: flex;
  flex-direction: column;
  gap: 0.7vh;
  align-items: center;
  margin-top: 1.4vh;
}
.syllable-keyboard .letter {
  width: min(5.1vw, 94px);
  height: min(6.3vh, 82px);
  font-size: min(4.1vh, 3.05vw);
}
.syllable-keyboard .letter.letter-disabled {
  opacity: 0.25;
  pointer-events: none;
  filter: grayscale(1);
}

.letter:focus-visible {
  transform: scale(1.15) translateY(-5px) scaleY(1.06);
  border-bottom-color: var(--tv-gold-deep);
  background-color: #f1ede6;
  box-shadow:
    0 0 0 3px rgba(245, 243, 236, 0.92),
    0 0 0 6px rgba(205, 161, 104, 0.48),
    0 0 0 9px rgba(125, 152, 183, 0.24),
    0 0 14px rgba(185, 125, 61, 0.16);
  color: #70593d;
  text-shadow: 0 0 3px rgba(205, 161, 104, 0.22);
}

.controls .btn {
  min-width: 10vw;
}

.spell-side-btn {
  min-width: 10.6vw;
  min-height: 5.5vh;
  font-size: 1.85vh;
  border-radius: 22px;
  border: 0;
  background: linear-gradient(180deg, #e3e9ee, #d3dce4);
  color: #5f7287;
  box-shadow: 0 6px 12px rgba(71, 85, 105, 0.08);
  order: 1;
}

.spell-side-btn.active {
  color: #17304c;
}

.controls.spell-has-selection #spellUndoBtn {
  background: linear-gradient(180deg, #efe3c4, #e5d2a4);
  color: #7b5a32;
  box-shadow: 0 8px 14px rgba(185, 125, 61, 0.12);
}

.controls.spell-error-state #spellRetryBtn {
  background: linear-gradient(180deg, #d4a094, #c38477);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(153, 86, 79, 0.18);
}

.spell-side-btn:disabled {
  opacity: 0.42;
  box-shadow: none;
}

#nextBtn {
  min-width: 16vw;
  min-height: 5.9vh;
  font-size: 2.45vh;
  background: linear-gradient(180deg, #d89f75, #c9875b);
  box-shadow: 0 10px 18px rgba(146, 94, 57, 0.18);
  order: 2;
}

#spellRetryBtn {
  order: 3;
}

#nextBtn:hover {
  background: linear-gradient(180deg, #dca57d, #cb8c63);
}

#checkBtn,
#resetBtn {
  background: rgba(208, 218, 228, 0.2);
  color: #eef2f6;
  border: 2px solid rgba(208, 218, 228, 0.18);
  box-shadow: none;
}

#resetBtn {
  color: #ccd6e1;
}

.intro-card {
  width: min(92vw, 1180px);
  gap: 2vh;
  padding: 1vh 0 2vh;
}

.intro-kicker {
  padding: 0.8vh 1.5vw;
  font-size: 2vh;
}

.intro-title {
  font-size: min(6.4vh, 5vw);
}

.intro-stats {
  max-width: min(72vw, 900px);
  gap: 1.2vw;
}

.intro-stat {
  padding: 1.6vh 1vw;
  border-radius: 24px;
}

.intro-stat span {
  font-size: 2vh;
}

.intro-stat strong {
  font-size: 5.2vh;
}

.intro-type-grid {
  gap: 1.2vw;
}

.intro-type-card {
  min-height: 17vh;
  padding: 1.4vh 1vw;
  border-radius: 24px;
}

.intro-type-icon {
  font-size: 4vh;
}

.intro-type-card strong {
  font-size: 2.6vh;
}

.intro-type-card em,
.intro-type-card p,
.intro-foot {
  font-size: 2vh;
}

.completion-card {
  width: min(94vw, 1120px);
  gap: 2.2vh;
  padding: 1.2vh 0 3vh;
}

.completion-burst {
  width: 12vh;
  height: 12vh;
  font-size: 5vh;
}

.completion-title {
  font-size: min(7vh, 5vw);
  letter-spacing: 0.02em;
}

.completion-subtitle {
  font-size: 2.55vh;
}

.completion-stats {
  gap: 1.4vw;
}

.completion-stat {
  padding: 2vh 1vw;
  border-radius: 24px;
}

.completion-stat span {
  margin-bottom: 1vh;
  font-size: 2.1vh;
}

.completion-stat strong {
  font-size: 5.4vh;
}

.completion-review {
  gap: 1.4vh;
  padding: 2.2vh 2vw;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(233, 238, 242, 0.96), rgba(221, 228, 234, 0.94));
}

.completion-review strong {
  font-size: 3vh;
}

.completion-chip {
  padding: 1vh 1.4vw;
  font-size: 2.4vh;
}

.completion-insight {
  padding: 1.6vh 2vw;
  border-radius: 24px;
  font-size: 2.3vh;
}

.completion-btn {
  font-size: 2.8vh;
  padding: 1.2vh 3vw;
  min-width: 18vw;
}

button:active {
  transform: scale(0.98) scaleY(1.06);
}

@media (max-width: 640px) {
  .slot, .letter { width: 48px; height: 48px; }
}

@keyframes slot-pulse {
  0%, 100% { box-shadow: inset 0 0 0 4px var(--tv-state-focus), 0 0 0 4px rgba(205, 161, 104, 0.08), 0 0 8px rgba(205, 161, 104, 0.12); }
  50% { box-shadow: inset 0 0 0 4px var(--tv-state-focus), 0 0 0 4px rgba(205, 161, 104, 0.14), 0 0 12px rgba(205, 161, 104, 0.2); }
}

@keyframes slot-fill-pop {
  0% { transform: scale(0.84); }
  100% { transform: scale(1); }
}

@keyframes spell-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-6px); }
}

@keyframes badge-pop {
  0% { transform: scale(0.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes progress-pulse {
  0%, 100% { transform: scale(1.08); }
  50% { transform: scale(1.22); }
}

@keyframes burst-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--burst-x, 0%)), calc(-50% + var(--burst-y, -10%))) scale(1.22);
  }
}

@keyframes burst-drop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.75);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--burst-x, 0%)), calc(-50% + 24%)) scale(0.5);
  }
}

.task-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
  padding: 10px 16px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  color: #166534;
}
.task-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-banner-text strong { font-size: 15px; }
.task-banner-text span { font-size: 13px; opacity: 0.85; }
.task-banner-actions { display: flex; gap: 8px; }
.task-banner-actions .btn.small { padding: 4px 10px; font-size: 12px; }

.task-banner.task-banner-error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}
.task-banner.task-banner-error .task-banner-actions { display: none; }

.task-banner.task-banner-review {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.task-banner.task-banner-mixed {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

/* Phase 6 step1 · 任务模式下 banner 在 TV 大屏放大可读 */
.task-banner {
  margin: 0;
  padding: 1.1vh 2.4vw;
  border-radius: 18px;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  background: rgba(236, 253, 245, 0.92);
  border-color: rgba(187, 247, 208, 0.7);
  flex: 0 0 auto;
}
.task-banner-text strong { font-size: clamp(1rem, 1.5vw, 1.25rem); }
.task-banner-text span { font-size: clamp(0.85rem, 1.2vw, 1rem); }
.task-banner-actions .btn.small {
  padding: 8px 16px;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
}

/* Phase 6 step1 · 自由模式 setup 卡 */
body.setup-mode .word-stage,
body.setup-mode .controls,
body.setup-mode .tv-top-left-actions,
body.setup-mode .tv-top-right-actions { display: none; }

body.setup-mode .app-shell {
  justify-content: flex-start;
  padding-top: clamp(20px, 5vh, 60px);
  overflow: visible;
}

body.setup-mode .quick-config {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(720px, 92vw);
  margin: clamp(20px, 4vh, 60px) auto 0;
  padding: clamp(24px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(7, 14, 24, 0.4);
  color: #1f2937;
  align-items: stretch;
}

body.setup-mode .setup-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  color: #1f2937;
}
body.setup-mode .setup-head p {
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: #6b7280;
}

body.setup-mode .setup-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
body.setup-mode .setup-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  color: #374151;
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}
body.setup-mode .setup-fields select {
  padding: 12px 14px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  border-radius: 14px;
  border: 2px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  min-width: 0;
  width: 100%;
}
body.setup-mode .setup-fields select:focus {
  outline: 3px solid #ff7a59;
  outline-offset: 2px;
}

body.setup-mode .setup-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
body.setup-mode .setup-actions .btn {
  padding: 14px 28px;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  border-radius: 999px;
}
body.setup-mode .setup-actions .btn.primary {
  background: #ff7a59;
  color: #fff;
  border: 0;
}
body.setup-mode .setup-actions .btn.primary:hover {
  background: #e35f3f;
}

/* ============================================================
 * 完型填空 · 翻转卡片版（2026-05-23）
 * 设计目标：英文题面做 hero（TV 远距离可读），中文藏到背面，
 * 选项 4 张单行紧贴题面正下方
 * ============================================================ */

.fill-blank-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vh;
}

.word-stage.fill-blank-layout-stage .emoji {
  width: 9.4vh;
  height: 9.4vh;
  font-size: 5.2vh;
}

.word-stage.fill-blank-layout-stage .hint {
  max-width: 78vw;
  padding: 0.45vh 1.4vw;
  font-size: clamp(1.25rem, 3.1vh, 2.1rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-align: center;
}

.fill-blank-flip {
  position: relative;
  width: min(1560px, 96vw);
  margin: 0 auto;
  min-height: 32vh;
  perspective: 1800px;
}

.fill-blank-flip-inner {
  position: relative;
  width: 100%;
  min-height: 32vh;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.55, 0.05, 0.25, 1);
}

.fill-blank-flip.is-flipped .fill-blank-flip-inner {
  transform: rotateY(180deg);
}

.fill-blank-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 3vw;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff9ec, #fbe9c3);
  box-shadow:
    0 20px 42px rgba(31, 41, 55, 0.18),
    inset 0 0 0 2px rgba(205, 161, 104, 0.28);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fill-blank-face.fill-blank-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #eef4ff, #d8e4f6);
  box-shadow:
    0 18px 36px rgba(56, 80, 130, 0.16),
    inset 0 0 0 1px rgba(99, 121, 165, 0.22);
}

.flip-btn {
  position: absolute;
  top: -1.2vh;
  right: -0.6vw;
  padding: 0.9vh 1.6vw;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  font-weight: 800;
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
  z-index: 5;
}

.flip-btn:hover { background: #fff; transform: translateY(-1px); }
.flip-btn-toggle { background: rgba(255, 255, 255, 0.96); }

/* 英文题面字号：放大到 TV 沙发距离可读（~80–100px on 1080p） */
.fill-blank-layout .fill-blank-sentence {
  margin: 0 auto;
  max-width: 100%;
  padding: 0;
  font-family: "TvPoppins", "TvMontserrat", "Segoe UI Black", "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(2.55rem, 4.7vw, 4.8rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.015em;
  color: #111827;
  text-align: center;
  /* 不用 balance：用户要求第一行先占满再换行（greedy wrap） */
  text-wrap: wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 中文背面：撑满 face，比正面字号略小一档（仍然可读） */
.fill-blank-layout .fill-blank-back .mcq-cn {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  font-weight: 800;
  color: #1f2937;
  text-align: center;
  text-wrap: balance;
  line-height: 1.18;
}

/* 空格做成一条加粗下划线，干净、一眼能锁定 */
.fill-blank-layout .cloze-blank {
  display: inline-block;
  min-width: 5.5ch;
  padding: 0 0.25em;
  margin: 0 0.18em;
  border: none;
  border-bottom: 0.11em solid #b8651a;
  border-radius: 0;
  background: transparent;
  color: #b8651a;
  font-weight: 900;
  letter-spacing: 0.04em;
  vertical-align: baseline;
  line-height: inherit;
}

.fill-blank-layout .cloze-nowrap {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

/* 答对后空格被填入答案，文本本身已经够显眼，无需额外动效 */

/* 4 选项单行，紧贴题面正下方 */
.fill-blank-layout .option-grid.mcq-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: min(1280px, 94vw);
  margin: 0 auto;
  gap: 1.35vw;
}

.fill-blank-layout .mcq-option {
  min-height: 13vh;
  padding: 1.5vh 1.2vw;
  border-width: 4px;
  border-color: #c8d3df;
  background: #fff;
  color: #030712;
  font-size: clamp(1.9rem, 3vw, 3.3rem);
  box-shadow: 0 13px 0 #cbd5e1, 0 18px 34px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.fill-blank-layout .mcq-option:hover,
.fill-blank-layout .mcq-option:focus-visible {
  border-color: #f59e0b;
  background: #fff7d6;
  transform: translateY(-5px) scale(1.035);
  box-shadow: 0 16px 0 #d97706, 0 24px 42px rgba(146, 64, 14, 0.26);
}

.fill-blank-layout .mcq-option.active {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 8px 0 #1d4ed8, 0 16px 32px rgba(37, 99, 235, 0.25);
}

/* 投影到 4:3 或竖屏时回退 2x2，避免 4 个卡被压扁 */
@media (max-aspect-ratio: 4 / 3) {
  .fill-blank-layout .option-grid.mcq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fill-blank-layout .mcq-option {
    min-height: 13vh;
  }
}

@media (max-width: 640px) {
  .fill-blank-card {
    gap: 1.1vh;
  }

  .fill-blank-flip,
  .fill-blank-flip-inner {
    width: min(100%, 94vw);
    min-height: min(17vh, 150px);
  }

  .fill-blank-face {
    padding: 2vh 3vw;
    border-radius: 18px;
  }

  .fill-blank-layout .fill-blank-sentence {
    font-size: clamp(1.45rem, 6.4vw, 1.85rem);
    line-height: 1.14;
  }

  .fill-blank-layout .fill-blank-back .mcq-cn {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    line-height: 1.2;
  }

  .fill-blank-layout .option-grid.mcq-grid {
    max-width: min(100%, 86vw);
    gap: 8px;
  }

  .fill-blank-layout .mcq-option {
    min-height: 5.2vh;
    padding: 0.65vh 2vw;
    font-size: clamp(1.05rem, 5.3vw, 1.35rem);
  }
}
