/* ========================================================
   CVC 课堂练习 — 卡通活泼风格
   丰富配色、强动画效果
   ======================================================== */

:root {
  --cartoon-pink: #ff6b9d;
  --cartoon-orange: #ff9f43;
  --cartoon-yellow: #feca57;
  --cartoon-green: #1dd1a1;
  --cartoon-blue: #54a0ff;
  --cartoon-purple: #a55eea;
  --cartoon-red: #ff6b6b;
  --cartoon-cyan: #00d2d3;
  --cartoon-sky: #e8f6ff;
  --cartoon-soft: #fff9f0;
}

/* 课堂练习页 - 活泼动效 */
.practice-cartoon body,
body.practice-cartoon {
  background: linear-gradient(135deg, #ffeaa7 0%, #dfe6e9 25%, #74b9ff 50%, #a29bfe 75%, #fd79a8 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.practice-teacher-card {
  background: rgba(255,255,255,0.95);
  border-radius: 28px;
  padding: 36px 44px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 4px rgba(255,255,255,0.5);
  animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.vowel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  margin: 8px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 0 rgba(0,0,0,0.1);
}

.vowel-chip:hover { transform: translateY(-4px) scale(1.05); }
.vowel-chip.selected {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.vowel-chip[data-v="a"] { background: linear-gradient(145deg, #74b9ff, #0984e3); color: #fff; }
.vowel-chip[data-v="a"]:hover { border-color: #fff; }
.vowel-chip[data-v="a"].selected { border-color: #fff; box-shadow: 0 8px 0 #0984e3; }

.vowel-chip[data-v="e"] { background: linear-gradient(145deg, #55efc4, #00b894); color: #fff; }
.vowel-chip[data-v="e"].selected { border-color: #fff; box-shadow: 0 8px 0 #00b894; }

.vowel-chip[data-v="i"] { background: linear-gradient(145deg, #fd79a8, #e84393); color: #fff; }
.vowel-chip[data-v="i"].selected { border-color: #fff; box-shadow: 0 8px 0 #e84393; }

.vowel-chip[data-v="o"] { background: linear-gradient(145deg, #fdcb6e, #e17055); color: #fff; }
.vowel-chip[data-v="o"].selected { border-color: #fff; box-shadow: 0 8px 0 #e17055; }

.vowel-chip[data-v="u"] { background: linear-gradient(145deg, #a29bfe, #6c5ce7); color: #fff; }
.vowel-chip[data-v="u"].selected { border-color: #fff; box-shadow: 0 8px 0 #6c5ce7; }

.type-chip {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  margin: 6px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  border: 3px solid #dfe6e9;
  background: #fff;
  transition: all 0.25s ease;
}

.type-chip:hover { border-color: var(--cartoon-blue); background: #e8f4ff; }
.type-chip.selected { border-color: var(--cartoon-blue); background: linear-gradient(145deg, #74b9ff, #0984e3); color: #fff; }

.practice-btn-big {
  padding: 20px 48px;
  font-size: 24px;
  font-weight: 800;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 0 rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.practice-btn-big:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 0 rgba(0,0,0,0.2);
}

.practice-btn-big:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

/* 练习执行页 - 每词一页 */
.practice-do-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.practice-word-card {
  width: 100%;
  max-width: 600px;
  background: rgba(255,255,255,0.96);
  border-radius: 32px;
  padding: 48px 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15), 0 0 0 6px rgba(255,255,255,0.6);
  text-align: center;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.practice-tts-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(145deg, #74b9ff, #0984e3);
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(9,132,227,0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.practice-tts-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 14px 40px rgba(9,132,227,0.5);
}

.practice-tts-btn:active { transform: scale(0.98); }

.practice-image-wrap {
  width: 280px;
  height: 220px;
  margin: 0 auto 24px;
  border-radius: 24px;
  overflow: hidden;
  border: 4px solid #dfe6e9;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  animation: bounce 1s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.practice-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.practice-slots-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.practice-slot {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  border: 4px dashed #b2bec3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: #636e72;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.practice-slot.filled {
  border-style: solid;
  border-color: #0984e3;
  background: linear-gradient(145deg, #74b9ff, #0984e3);
  color: #fff;
}

.practice-letter-opt {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  border: 3px solid #dfe6e9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-size: 36px;
  font-weight: 800;
  cursor: grab;
  margin: 8px;
  background: #fff;
  box-shadow: 0 6px 0 #b2bec3;
  transition: all 0.2s ease;
}

.practice-letter-opt:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #b2bec3;
}

.practice-nav-btn {
  padding: 16px 36px;
  font-size: 20px;
  font-weight: 800;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  margin: 8px;
  transition: all 0.2s ease;
}

.practice-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
  max-width: 400px;
}

.practice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #74b9ff, #a29bfe);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* 测试模式 - 3组图片选题 */
.test-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 24px 0;
}

/* 每组独立选项：纵向排列，便于看清「每组都要选」 */
.test-group-row-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.test-group-with-options {
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.test-group-prompt {
  margin-top: 14px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 17px;
  color: #2d3436;
  text-align: center;
}

.test-options-per-group {
  justify-content: center;
  margin-top: 0;
}

.test-group-card {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  border: 4px solid #dfe6e9;
  min-width: 200px;
}

.test-group-card h4 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 18px;
  color: #636e72;
}

.test-group-images {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.test-group-images .mini-img {
  width: 130px;
  height: 130px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #dfe6e9;
  cursor: pointer;
  transition: transform 0.2s;
}

.test-group-images .mini-img:hover { transform: scale(1.08); }

.test-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 28px 0;
}

.test-option-btn {
  padding: 18px 32px;
  font-size: 22px;
  font-weight: 800;
  border-radius: 16px;
  border: 4px solid #dfe6e9;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: "Baloo 2", sans-serif;
}

.test-option-btn:hover {
  border-color: #74b9ff;
  background: #e8f4ff;
  transform: translateY(-4px);
}

.test-option-btn.correct {
  border-color: #00b894;
  background: #55efc4;
  color: #fff;
  animation: correctPop 0.5s ease;
}

.test-option-btn.wrong {
  border-color: #e17055;
  background: #ff7675;
  color: #fff;
  animation: shake 0.5s ease;
}

/* ── 答对庆祝（彩纸 + 欢呼）──────────────────── */
.celebrate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  overflow: visible;
}

.celebrate-particle {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5px;
  border-radius: 3px;
  background: hsl(var(--hue, 200), 88%, 58%);
  animation: celebratePop 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.celebrate-particle.celebrate-star {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
  margin: -11px 0 0 -11px;
  animation: celebrateStar 1.1s ease-out forwards;
}

@keyframes celebratePop {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(540deg) scale(0.15);
    opacity: 0;
  }
}

@keyframes celebrateStar {
  0% {
    transform: translate(0, 0) scale(0) rotate(0deg);
    opacity: 1;
  }
  40% {
    transform: translate(calc(var(--tx) * 0.35), calc(var(--ty) * 0.35)) scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0.4) rotate(360deg);
    opacity: 0;
  }
}

.celebrate-cheer {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 800;
  font-family: "Baloo 2", "Nunito", sans-serif;
  color: #e84393;
  animation: celebrateCheerPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  text-shadow:
    0 0 0 #fff,
    0 2px 0 #fff,
    0 4px 18px rgba(255, 200, 80, 0.95),
    0 0 24px rgba(255, 105, 180, 0.6);
  white-space: nowrap;
}

.celebrate-cheer--big {
  font-size: clamp(28px, 6vw, 44px);
  color: #6c5ce7;
  animation-duration: 0.9s;
}

@keyframes celebrateCheerPop {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-8deg);
    opacity: 0;
  }
  55% {
    transform: translate(-50%, -58%) scale(1.12) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

/* 无图模式 - 完成后选图 */
.practice-pic-choices {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0;
}

.practice-pic-choice {
  width: 180px;
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
  border: 4px solid #dfe6e9;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.practice-pic-choice:hover {
  transform: scale(1.05);
  border-color: #74b9ff;
  box-shadow: 0 12px 36px rgba(9,132,227,0.3);
}

.practice-pic-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.practice-chinese-hint {
  font-size: 28px;
  font-weight: 800;
  color: #2d3436;
  margin: 16px 0;
  padding: 16px 24px;
  background: linear-gradient(145deg, #fff9f0, #fff);
  border-radius: 16px;
  border: 3px solid #fdcb6e;
}
