/* ============================================
   GOUP 动画播放器 + 知识讲解动画样式
   移动端优先 (375px 基准)
   ============================================ */

/* ─── 动画播放器容器 ─── */
.anim-player {
  background: #1a1a2e;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.anim-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  color: #fff;
}

.anim-player-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.anim-player-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.anim-player-close:active {
  background: rgba(255,255,255,0.25);
}

/* ─── 动画画布 ─── */
.anim-canvas {
  position: relative;
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.anim-canvas svg {
  width: 100%;
  height: 100%;
  max-height: 280px;
}

/* ─── 分步指示器 ─── */
.anim-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
}

.anim-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}
.anim-step-dot.active {
  background: #FFD700;
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.anim-step-dot.done {
  background: #4CAF50;
}

/* ─── 控制器 ─── */
.anim-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
}

.anim-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}
.anim-btn:active {
  transform: scale(0.92);
}

.anim-btn-play {
  background: #FFD700;
  color: #1a1a2e;
}

.anim-btn-step {
  background: rgba(255,255,255,0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.anim-btn-step:disabled {
  opacity: 0.3;
  cursor: default;
}

.anim-progress {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
}
.anim-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFD700;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/* ─── 完成后操作区 ─── */
.anim-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 20px;
}

.anim-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s, opacity 0.2s;
}
.anim-actions .btn:active {
  transform: scale(0.96);
}

.anim-action-replay {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.anim-action-practice {
  background: linear-gradient(135deg, #FFD700, #FFA000);
  color: #1a1a2e;
}

/* ─── 数学竖式动画 ─── */
.math-vertical {
  font-family: 'Courier New', Courier, monospace;
  font-size: 28px;
  text-align: right;
  line-height: 1.6;
  color: #fff;
  letter-spacing: 4px;
  padding: 16px;
}
.math-vertical .digit-highlight {
  color: #FFD700;
  font-weight: 700;
  transition: color 0.3s;
}
.math-vertical .carry-dot {
  color: #FF5252;
  font-size: 16px;
  vertical-align: super;
}
.math-vertical .result-glow {
  color: #4CAF50;
  animation: resultPulse 0.8s ease-in-out 3;
}

@keyframes resultPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 8px rgba(76,175,80,0.3); }
  50% { transform: scale(1.15); text-shadow: 0 0 20px rgba(76,175,80,0.7); }
}

/* ─── 进位小球飞行 ─── */
.carry-ball {
  fill: #FF5252;
  animation: carryFly 1s ease-in-out;
}

@keyframes carryFly {
  0% { transform: translate(0, 0); opacity: 1; }
  50% { transform: translate(-30px, -50px); opacity: 1; }
  100% { transform: translate(-60px, -10px); opacity: 0; }
}

/* ─── 英语动画 ─── */
.english-stickman {
  transition: transform 0.4s ease;
}

.stickman-walk {
  animation: stickmanWalk 0.6s ease-in-out infinite alternate;
}

@keyframes stickmanWalk {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

.word-highlight {
  color: #4CAF50;
  font-weight: 700;
  animation: wordPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes wordPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.suffix-pop {
  color: #FFD700;
  font-weight: 700;
  animation: suffixBounce 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes suffixBounce {
  0% { transform: translateY(-20px) scale(0); opacity: 0; }
  60% { transform: translateY(4px) scale(1.2); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.rule-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  color: #FFD700;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ─── 提示与完成文字 ─── */
.anim-hint {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  padding: 12px 16px;
  animation: fadeInUp 0.4s ease;
}

.anim-complete-text {
  text-align: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  padding: 16px;
  animation: fadeInUp 0.5s ease;
}
