:root {
  --max-canvas: 1240px;
  --safe-padding: clamp(14px, 2vw, 24px);
  --font-title: clamp(1.08rem, 0.98rem + 0.5vw, 1.45rem);
  --font-sub: clamp(0.78rem, 0.74rem + 0.15vw, 0.92rem);
  --font-body: clamp(0.9rem, 0.84rem + 0.2vw, 1.05rem);
  --radius-card: clamp(16px, 1.8vw, 24px);

  --clr-wizard: #7c3aed;
  --clr-wizard-light: #a78bfa;
  --clr-wizard-dark: #5b21b6;
  --clr-wizard-bg: #f5f3ff;
  --clr-wizard-grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --clr-cat: #fbbf24;
  --clr-cat-dark: #f59e0b;
  --clr-magic: #06b6d4;
  --clr-review: #0284c7;
  --clr-review-bg: #f0f9ff;
  --clr-review-grad: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --clr-text-main: #1e1b4b;
  --clr-text-sub: #64748b;
  --clr-border: #e2e8f0;
  --clr-card-bg: #ffffff;
  --clr-body-bg: #f5f7fd;
  --clr-success: #10b981;
  --clr-success-bg: #ecfdf5;
  --clr-danger: #f43f5e;
  --clr-danger-bg: #fff1f2;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img, video, audio {
  -webkit-user-drag: none;
  user-drag: none;
}

/* 全局防截图动态水印层 (轻量非侵入式) */
.page-watermark-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
  opacity: 0.04;
  background-repeat: repeat;
  background-size: 340px 200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Quicksand", "Nunito", sans-serif;
  background: var(--clr-body-bg) radial-gradient(#e0e7ff 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  color: var(--clr-text-main);
  line-height: 1.55;
  padding-bottom: 50px;
  font-size: var(--font-body);
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  font-size: clamp(0.72rem, 0.68rem + 0.1vw, 0.82rem);
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  touch-action: manipulation;
}
.nav-back-btn:hover {
  background: var(--clr-wizard);
  color: #ffffff;
  border-color: var(--clr-wizard);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

/* 1. APP HEADER - Sticky & Fluid Cute Frosted Glass Container */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid #e0e7ff;
  padding: clamp(6px, 0.8vw, 10px) var(--safe-padding);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-inner {
  max-width: var(--max-canvas);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.2vw, 14px);
}

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

.badge-level {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: clamp(0.64rem, 0.6rem + 0.1vw, 0.74rem);
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.lesson-title-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.lesson-name {
  font-weight: 800;
  font-size: clamp(0.7rem, 0.64rem + 0.25vw, 0.9rem);
  color: #1e1b4b;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 10px);
  flex-shrink: 0;
}

.primary-mode-nav {
  display: inline-flex;
  background: #eef2ff;
  padding: 3px;
  border-radius: 14px;
  gap: 3px;
  flex-shrink: 0;
  border: 1.5px solid #e0e7ff;
}

.main-mode-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 10px;
  font-size: clamp(0.76rem, 0.72rem + 0.12vw, 0.86rem);
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 32px;
  touch-action: manipulation;
  white-space: nowrap;
}

.main-mode-btn.active.mode-preview {
  background: var(--clr-wizard-grad);
  color: #ffffff;
  box-shadow: 0 3px 0 #4f46e5, 0 6px 16px rgba(99, 102, 241, 0.35);
}

.main-mode-btn.active.mode-class {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 3px 0 #b45309, 0 6px 16px rgba(245, 158, 11, 0.35);
}

.main-mode-btn.active.mode-review {
  background: var(--clr-review-grad);
  color: #ffffff;
  box-shadow: 0 3px 0 #0369a1, 0 6px 16px rgba(2, 132, 199, 0.35);
}

.main-mode-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

@media (max-width: 480px) {
  .header-inner {
    gap: 6px;
  }
  .header-actions {
    gap: 4px;
  }
  .badge-level {
    padding: 2px 6px;
    font-size: 0.62rem;
  }
  .main-mode-btn {
    padding: 4px 10px;
    font-size: 0.74rem;
  }
}

/* 2. SUB STEPPER BAR (第二行：步骤居左/中，磨耳朵居最右) */
.sub-stepper-bar {
  max-width: var(--max-canvas);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1vw, 12px);
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.step-tabs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.step-tab {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(5px, 0.8vw, 8px) 6px;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 36px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-tab.active {
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}

.step-tab.r-step-tab.active {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.step-tab.active .step-circle {
  background: var(--clr-wizard-grad);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}

.step-tab.r-step-tab.active .step-circle {
  background: var(--clr-review-grad);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.step-tab.done .step-circle {
  background: #10b981;
  color: #ffffff;
}

.step-label {
  font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.9rem);
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}

.step-tab.active .step-label {
  color: var(--clr-wizard);
}

.step-tab.r-step-tab.active .step-label {
  color: var(--clr-review);
}

.header-audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 100px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #fcd34d;
  cursor: pointer;
  font-size: clamp(0.74rem, 0.7rem + 0.12vw, 0.84rem);
  font-weight: 900;
  color: #b45309;
  touch-action: manipulation;
  min-height: 34px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 0 #f59e0b, 0 3px 8px rgba(245, 158, 11, 0.2);
}

.header-audio-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #f59e0b, 0 6px 12px rgba(245, 158, 11, 0.3);
}

.header-audio-pill:active {
  transform: translateY(2px);
  box-shadow: none;
}

.header-audio-pill.playing {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #047857, 0 4px 12px rgba(16, 185, 129, 0.35) !important;
  animation: cuteWiggle 1.4s infinite ease-in-out;
}

@keyframes cuteWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg) scale(1.02); }
  75% { transform: rotate(3deg) scale(1.02); }
}

/* 3. MAIN CONTENT WORKSPACE */
.main-content {
  width: 100%;
  max-width: var(--max-canvas);
  margin: clamp(12px, 1.8vw, 24px) auto 0;
  padding: 0 var(--safe-padding);
}

.app-workspace-module {
  display: none;
}

.app-workspace-module.active {
  display: block;
}

/* Card Box Container */
.card-box {
  background: var(--clr-card-bg);
  border-radius: var(--radius-card);
  border: 2px solid #eef2ff;
  padding: clamp(16px, 2.2vw, 28px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
  margin-bottom: clamp(14px, 1.8vw, 24px);
}

.box-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 1.5vw, 18px);
  gap: 10px;
  flex-wrap: wrap;
}

.box-title {
  font-size: var(--font-title);
  font-weight: 900;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.box-sub {
  font-size: var(--font-sub);
  color: #64748b;
  margin-top: 3px;
  line-height: 1.4;
}

/* Vocab Cards - Responsive Grid 4/3/2/1 cols */
.vocab-resource-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(8px, 1vw, 12px);
}

.v-card {
  border: 2px solid #f1f5f9;
  border-radius: 18px;
  padding: clamp(12px, 1.4vw, 16px);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.v-card:hover {
  border-color: #c7d2fe;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.12);
}

/* 听音磨耳计数与金星徽章 (1次 / 2次 / 3次熟练) */
.v-listen-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 900;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  white-space: nowrap;
  user-select: none;
}

.v-listen-badge.level-1 {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}

.v-listen-badge.level-2 {
  background: #ede9fe;
  color: #7c3aed;
  border-color: #c4b5fd;
}

.v-listen-badge.level-3 {
  background: linear-gradient(135deg, #fef08a, #facc15);
  color: #713f12;
  border-color: #eab308;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
  animation: popBadge 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBadge {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.v-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.v-word-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.v-card .v-word,
.v-word {
  font-size: clamp(1.22rem, 2.5vw, 1.40rem);
  font-weight: 900 !important;
  color: #1e40af !important;
  letter-spacing: -0.015em;
  line-height: 1.15;
  white-space: nowrap;
}

.v-word.v-word-long {
  font-size: clamp(1.00rem, 2.0vw, 1.12rem) !important;
  letter-spacing: -0.025em;
}

.v-word.v-word-xlong {
  font-size: clamp(0.86rem, 1.6vw, 0.99rem) !important;
  letter-spacing: -0.035em;
}

.v-icon {
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  background: #fef3c7;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  user-select: none;
}

.v-def {
  font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.88rem);
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 800;
}

.v-ex {
  font-size: clamp(0.82rem, 0.78rem + 0.18vw, 0.94rem);
  color: #334155;
  line-height: 1.45;
  margin: 4px 0;
  background: #faf5ff;
  padding: 6px 10px;
  border-radius: 10px;
  border-left: 3px solid #c084fc;
}

.v-ex mark {
  background: #fef08a;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 800;
}

.v-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  border-top: 1.5px dashed #e2e8f0;
  padding-top: 8px;
  gap: clamp(3px, 0.6vw, 6px);
  flex-wrap: nowrap;
  width: 100%;
}

.v-audio-btn,
.v-sent-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px clamp(4px, 0.6vw, 8px);
  border-radius: 10px;
  font-size: clamp(0.66rem, 0.62rem + 0.1vw, 0.74rem);
  min-height: 32px;
  touch-action: manipulation;
  min-width: 0;
  flex: 1 1 0;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.v-audio-btn {
  background: #ede9fe;
  color: #6d28d9;
  border: 1.5px solid #ddd6fe;
  font-weight: 800;
  cursor: pointer;
  gap: 2px;
  box-shadow: 0 2px 0 #c4b5fd;
}

.v-audio-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.v-audio-btn.playing {
  background: var(--clr-wizard-grad);
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 2px 0 #4f46e5;
}

.v-sent-btn {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #bae6fd;
  font-weight: 800;
  cursor: pointer;
  flex: 1.15 1 0;
  box-shadow: 0 2px 0 #7dd3fc;
}

.v-sent-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.v-sent-btn.playing {
  background: var(--clr-review-grad);
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 0 #0369a1;
}

/* Video Frame Box - Fluid 16:9 Max Layout */
.video-frame-box {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 18px;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: clamp(14px, 1.8vw, 22px);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border: 3px solid #1e293b;
}

.video-frame-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-top-control-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 20;
}

.video-cc-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  touch-action: manipulation;
  transition: all 0.2s;
}

.video-cc-btn.active {
  background: var(--clr-wizard-grad);
  border-color: #8b5cf6;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* 视频下方独立字幕卡片 (非浮层覆盖，清晰易读) */
.video-subtitle-strip {
  max-width: 960px;
  margin: 10px auto 16px;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-subtitle-strip.visible {
  display: flex;
}

.subtitle-text-pill {
  background: #ffffff;
  border: 2px solid #e0e7ff;
  color: #1e1b4b;
  border-radius: 16px;
  font-weight: 800;
  text-align: center;
  padding: clamp(8px, 1.2vw, 14px) clamp(16px, 2vw, 24px);
  font-size: clamp(0.95rem, 0.88rem + 0.35vw, 1.18rem);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08), 0 2px 0 #c7d2fe;
  line-height: 1.45;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
}

/* Point and Read - 2-Column Grid on Wide Screen */
.story-read-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr));
  gap: 14px;
}

.story-card {
  background: #ffffff;
  border: 2px solid #eef2ff;
  border-radius: 18px;
  padding: clamp(12px, 1.4vw, 18px);
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02);
}

.scene-pill {
  display: inline-block;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 100px;
  margin-bottom: 10px;
  border: 1px solid #c4b5fd;
}

.read-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 4px;
  background: #f8fafc;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1.5px solid transparent;
}

.read-row:hover {
  background: #f5f3ff;
  border-color: #ddd6fe;
  transform: translateX(2px);
}

.read-row.playing {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.read-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: var(--clr-wizard);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.read-row.playing .read-icon-btn {
  background: var(--clr-wizard-grad);
  color: #ffffff;
  border-color: #6366f1;
}

.read-en {
  font-size: clamp(0.92rem, 0.85rem + 0.3vw, 1.08rem);
  font-weight: 700;
  color: #1e1b4b;
}

.read-zh {
  font-size: 0.82rem;
  color: #64748b;
  margin-left: 48px;
  margin-bottom: 8px;
}

/* Quiz Item Box */
.quiz-item-box {
  background: #fafbff;
  border: 2px solid #e0e7ff;
  border-radius: 18px;
  padding: clamp(14px, 1.8vw, 20px);
  margin-bottom: 14px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.03);
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.choice-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  padding: clamp(10px, 1.2vw, 14px) clamp(12px, 1.5vw, 18px);
  border-radius: 14px;
  font-size: clamp(0.88rem, 0.82rem + 0.25vw, 1.02rem);
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 0 #e2e8f0;
}

.choice-btn:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
  transform: translateY(-1px);
}

.choice-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.choice-btn.is-correct {
  background: var(--clr-success-bg);
  border-color: var(--clr-success);
  color: #065f46;
  font-weight: 900;
  box-shadow: 0 2px 0 #10b981;
}

.choice-btn.is-wrong {
  background: var(--clr-danger-bg);
  border-color: var(--clr-danger);
  color: #991b1b;
  font-weight: 900;
  box-shadow: 0 2px 0 #f43f5e;
}

.q-explanation {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  display: none;
  line-height: 1.45;
  font-weight: 700;
}

.q-explanation.correct {
  display: block;
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
}

.q-explanation.wrong {
  display: block;
  background: #fff1f2;
  color: #9f1239;
  border: 1.5px solid #fecdd3;
}

/* ===================================================
   MODULE 2: REVIEW (课后复习三步流转 · 纯触控卡通化)
=================================================== */
.shadow-box-item {
  background: #ffffff;
  border: 2px solid #eef2ff;
  border-radius: 18px;
  padding: clamp(12px, 1.5vw, 18px);
  margin-bottom: 12px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02);
}

.shadow-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-act-record {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.88rem);
  font-weight: 900;
  border: 2px solid #fcd34d;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 0 #f59e0b;
}

.btn-act-record:hover {
  transform: translateY(-1px);
}

.btn-act-record:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-act-record.recording {
  background: #f43f5e;
  color: #ffffff;
  border-color: #e11d48;
  box-shadow: 0 2px 0 #be123c;
  animation: pulseRecord 0.8s infinite alternate;
}

.btn-act-record.playing {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 0 #047857 !important;
}

@keyframes pulseRecord {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* Touch Letter Bubbles Spelling View */
.spell-card-view {
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2.5px solid #bae6fd;
  border-radius: clamp(18px, 2.2vw, 26px);
  padding: clamp(18px, 2.5vw, 32px) clamp(14px, 2vw, 24px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.08);
}

.spell-tabs-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

.spell-tab-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.88rem);
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 40px;
  touch-action: manipulation;
  box-shadow: 0 2px 0 #cbd5e1;
}

.spell-tab-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.spell-tab-btn.active {
  background: var(--clr-review-grad);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 3px 0 #0369a1, 0 6px 16px rgba(2, 132, 199, 0.35);
}

.spell-tab-btn.done {
  border-color: #10b981;
  color: #047857;
  background: #ecfdf5;
  box-shadow: 0 2px 0 #10b981;
}

.letter-slots-row {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1vw, 12px);
  flex-wrap: wrap;
  margin: 10px 0;
  min-height: 60px;
  align-items: center;
}

.letter-slot {
  width: clamp(46px, 4.8vw, 64px);
  height: clamp(52px, 5.4vw, 72px);
  border-radius: clamp(12px, 1.4vw, 16px);
  border: 3px dashed #0284c7;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-weight: 900;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
  touch-action: manipulation;
}

.letter-slot.filled {
  border-style: solid;
  border-color: #0284c7;
  background: #e0f2fe;
  box-shadow: 0 3px 0 #0284c7;
}

.letter-slot.locked {
  border-style: solid;
  border-color: #0284c7;
  background: #bae6fd;
  color: #0369a1;
  cursor: default;
  box-shadow: 0 3px 0 #0369a1;
}

.letter-slot.correct-all {
  border-color: #10b981;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 3px 0 #10b981;
  animation: popBadge 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter-bubbles-pool {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 14px);
  flex-wrap: wrap;
  margin-top: 6px;
}

.letter-bubble-btn {
  width: clamp(50px, 5vw, 68px);
  height: clamp(50px, 5vw, 68px);
  border-radius: 50%;
  border: 2.5px solid #e0e7ff;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  color: #1e1b4b;
  font-size: clamp(1.3rem, 1.8vw, 2rem);
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #c7d2fe, 0 6px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
}

.letter-bubble-btn:active {
  transform: translateY(3px) scale(0.95);
  box-shadow: 0 1px 0 #c7d2fe;
}

.letter-bubble-btn.used {
  opacity: 0.25;
  pointer-events: none;
  transform: scale(0.85);
  box-shadow: none;
}

.spell-tools-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-spell-tool {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: clamp(0.78rem, 0.74rem + 0.15vw, 0.88rem);
  font-weight: 800;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  min-height: 42px;
  touch-action: manipulation;
  transition: all 0.2s;
  box-shadow: 0 2px 0 #cbd5e1;
}

.btn-spell-tool:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-spell-tool:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Sentence Scramble Game */
.scramble-box {
  background: #ffffff;
  border: 2px solid #eef2ff;
  border-radius: clamp(16px, 2vw, 22px);
  padding: clamp(14px, 1.8vw, 22px);
  margin-bottom: 14px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.scramble-title {
  font-weight: 900;
  font-size: clamp(0.9rem, 0.84rem + 0.25vw, 1.08rem);
  color: #1e1b4b;
  margin-bottom: 10px;
}

.scramble-target-slot {
  min-height: 54px;
  background: #f8fafc;
  border: 2.5px dashed #a5b4fc;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.scramble-target-slot.correct {
  border-color: #10b981;
  background: #ecfdf5;
  border-style: solid;
}

.scramble-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  background: #ffffff;
  border: 2px solid #e0e7ff;
  padding: clamp(8px, 1vw, 12px) clamp(14px, 1.5vw, 20px);
  border-radius: 12px;
  font-size: clamp(0.88rem, 0.84rem + 0.2vw, 1.02rem);
  font-weight: 800;
  color: #1e1b4b;
  cursor: pointer;
  box-shadow: 0 3px 0 #c7d2fe, 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 44px;
  touch-action: manipulation;
}

.word-chip:hover {
  border-color: var(--clr-wizard);
  background: #f5f3ff;
  transform: translateY(-1px);
}

.word-chip:active {
  transform: translateY(2px);
  box-shadow: none;
}

.word-chip.in-slot {
  background: var(--clr-wizard-bg);
  border-color: var(--clr-wizard-light);
  color: var(--clr-wizard);
  box-shadow: 0 2px 0 #ddd6fe;
}

/* Dubbing Scene Grid */





/* COMMON UTILS */
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: clamp(16px, 2vw, 24px);
  padding-top: 14px;
  border-top: 2px dashed #e2e8f0;
  flex-wrap: wrap;
}

.btn-nav {
  flex: 1;
  max-width: 220px;
  padding: 12px 20px;
  border-radius: 100px;
  font-weight: 900;
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 0.96rem);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-nav-prev {
  background: #e2e8f0;
  color: #475569;
  box-shadow: 0 3px 0 #cbd5e1;
}

.btn-nav-prev:hover {
  background: #cbd5e1;
}

.btn-nav-prev:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-nav-next {
  background: var(--clr-wizard-grad);
  color: #ffffff;
  margin-left: auto;
  box-shadow: 0 4px 0 #4f46e5, 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-nav-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #4f46e5, 0 10px 24px rgba(99, 102, 241, 0.45);
}

.btn-nav-next:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #4f46e5;
}

/* Confetti Canvas for Quiz & Mastery Celebration */
#celebrationCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999999;
}

/* ===== LAST-CLICKED POSITION MEMORY ===== */
@keyframes lastActivePulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); transform: scale(1); }
  50% { box-shadow: 0 0 18px 6px rgba(124, 58, 237, 0.45); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); transform: scale(1); }
}
.last-active-pulse {
  animation: lastActivePulse 1.6s ease-in-out 2 !important;
  border-color: #8b5cf6 !important;
}

.restore-pos-toast {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 99999;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.restore-pos-toast.show {
  transform: translateY(0);
  opacity: 1;
}
