* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: linear-gradient(135deg, #0b0d2e 0%, #1a1040 30%, #2d1b69 60%, #1a0a3e 100%);
  color: #fff;
}

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ========== 星空背景 ========== */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  opacity: 0.8;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.planet {
  position: absolute;
  border-radius: 50%;
}

.planet-1 {
  width: 120px; height: 120px;
  top: 8%; right: -30px;
  background: radial-gradient(circle at 35% 35%, #ff6b9d, #c94b84, #6b2d5c);
  box-shadow: 0 0 60px rgba(255, 107, 157, 0.4);
  animation: float 12s ease-in-out infinite;
}

.planet-2 {
  width: 80px; height: 80px;
  bottom: 15%; left: -20px;
  background: radial-gradient(circle at 35% 35%, #4ecdc4, #2a9d8f, #1a6b65);
  box-shadow: 0 0 40px rgba(78, 205, 196, 0.4);
  animation: float 15s ease-in-out infinite reverse;
}

.planet-3 {
  width: 60px; height: 60px;
  top: 40%; right: 10%;
  background: radial-gradient(circle at 35% 35%, #ffd93d, #ff9500, #cc6600);
  box-shadow: 0 0 30px rgba(255, 217, 61, 0.4);
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ========== 屏幕通用 ========== */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  animation: fadeIn 0.4s ease;
}

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

/* ========== 主菜单 ========== */
.menu-screen {
  justify-content: flex-start;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-content {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin: auto 0;
}

.title-area {
  text-align: center;
}

.game-title {
  font-size: 2.2em;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.5));
  margin-bottom: 8px;
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.5)); }
  50% { filter: drop-shadow(0 4px 20px rgba(240, 147, 251, 0.8)); }
}

.subtitle {
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.7);
}

.menu-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.menu-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
  font-size: 1.5em;
}

.stat-label {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.6);
}

.stat-value {
  font-size: 1.2em;
  font-weight: 700;
  color: #ffd93d;
}

/* ========== 按钮 ========== */
.btn {
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  min-height: 48px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.96);
}

.btn-large {
  width: 100%;
  max-width: 300px;
  padding: 18px 24px;
  font-size: 1.15em;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(102, 126, 234, 0.7);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-icon {
  font-size: 1.2em;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 16px;
  min-width: 44px;
  min-height: 44px;
  color: #fff;
  font-size: 0.95em;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-back:active {
  transform: scale(0.95);
}

/* ========== 关卡地图 ========== */
.levels-screen {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.levels-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.levels-header h2 {
  font-size: 1.5em;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.levels-grid {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 20px;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.level-card {
  position: relative;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(5px);
}

.level-card:hover:not(.level-locked) {
  transform: translateY(-4px);
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.level-card:active:not(.level-locked) {
  transform: scale(0.96);
}

.level-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-number {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.9em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.level-phase {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.62em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 1px;
  background: rgba(102, 126, 234, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e8ecff;
}
.level-phase.phase-下册 { background: rgba(76, 209, 55, 0.35); }
.level-phase.phase-衔接 { background: rgba(255, 179, 71, 0.35); }
.level-phase.phase-拔高 { background: rgba(255, 99, 132, 0.35); }
.level-phase.phase-启蒙 { background: rgba(244, 164, 96, 0.35); }
.level-phase.phase-兴趣 { background: rgba(240, 147, 251, 0.35); }
.level-phase.phase-科普 { background: rgba(167, 139, 250, 0.35); }

.level-emoji {
  font-size: 2.5em;
  margin: 10px 0 4px;
}

.level-name {
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 6px;
}

.level-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.star-icon {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.2);
}

.star-icon.star-filled {
  color: #ffd93d;
  text-shadow: 0 0 8px rgba(255, 217, 61, 0.6);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 18px;
}

/* ========== 游戏界面 ========== */
.game-screen {
  padding: 0;
  justify-content: flex-start;
}

.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-center {
  flex: 1;
  text-align: center;
}

.level-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95em;
}

.hearts {
  display: flex;
  gap: 4px;
}

.heart {
  font-size: 1.3em;
  filter: drop-shadow(0 2px 4px rgba(255, 100, 100, 0.4));
  transition: all 0.3s;
}

.heart-lost {
  filter: grayscale(1) opacity(0.3);
  animation: heartBreak 0.4s ease;
}

@keyframes heartBreak {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); filter: grayscale(0.5); }
  100% { transform: scale(1); filter: grayscale(1) opacity(0.3); }
}

.game-stats-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85em;
  font-weight: 600;
}

/* ========== 战斗区 ========== */
.battle-area {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  position: relative;
  min-height: 160px;
}

.cannon-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 5;
}

.cannon-svg {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.15s;
}

.cannon-fire .cannon-svg {
  animation: cannonFire 0.35s ease;
}

@keyframes cannonFire {
  0% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-8px) scale(1) rotate(-3deg); }
  50% { transform: translateX(4px) scale(1.02); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0) scale(1); }
}

.cannon-label {
  font-size: 0.75em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.missile {
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%);
  animation: missileFly 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  z-index: 10;
}

.missile-body {
  font-size: 2em;
  display: block;
  filter: drop-shadow(0 0 15px rgba(255, 150, 50, 0.9));
}

.missile-trail {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 8px;
  background: linear-gradient(90deg, transparent, #ffd93d, #ff6b35);
  border-radius: 4px;
  filter: blur(2px);
  animation: trailFlicker 0.1s ease-in-out infinite alternate;
}

@keyframes trailFlicker {
  0% { opacity: 0.7; width: 50px; }
  100% { opacity: 1; width: 70px; }
}

@keyframes missileFly {
  0% {
    left: 80px;
    transform: translateY(-50%) rotate(0deg);
  }
  50% {
    transform: translateY(calc(-50% - 30px)) rotate(-10deg);
  }
  100% {
    left: calc(100% - 140px);
    transform: translateY(-50%) rotate(0deg);
  }
}

.monster-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s;
}

.monster-hit {
  animation: monsterHit 0.4s ease;
}

@keyframes monsterHit {
  0% { transform: translateX(0) scale(1); }
  25% { transform: translateX(10px) rotate(5deg) scale(1.1); filter: brightness(2) saturate(0) hue-rotate(180deg); }
  50% { transform: translateX(-10px) rotate(-5deg) scale(0.9); filter: brightness(2) saturate(0) hue-rotate(180deg); }
  75% { transform: translateX(5px); }
  100% { transform: translateX(0) scale(1); }
}

.monster-avatar {
  font-size: 4em;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  animation: monsterFloat 3s ease-in-out infinite;
}

@keyframes monsterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.monster-name {
  font-size: 0.85em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.monster-hp-bar {
  width: 100px;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.monster-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
  transition: width 0.4s ease;
  border-radius: 4px;
}

.monster-hp-text {
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.6);
}

/* ========== 题目区 ========== */
.question-area {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  gap: 8px;
}

.question-category {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.math-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.equation {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 3em;
  font-weight: 900;
}

.equation span {
  min-width: 50px;
  text-align: center;
}

.equation span.operator {
  color: #ffd93d;
  font-size: 0.8em;
}

.equation span.question-mark {
  color: #667eea;
  animation: pulse 1s ease-in-out infinite;
}

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

.answer-display {
  min-height: 50px;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font-size: 2em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s;
  padding: 6px 20px;
}

.answer-display.answer-correct {
  background: rgba(78, 205, 196, 0.25);
  border-color: #4ecdc4;
  color: #4ecdc4;
  animation: correctFlash 0.5s ease;
}

.answer-display.answer-wrong {
  background: rgba(255, 107, 107, 0.25);
  border-color: #ff6b6b;
  color: #ff6b6b;
  animation: wrongShake 0.4s ease;
}

@keyframes correctFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

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

/* ========== 形状题 ========== */
.shape-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.shape-display {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-circle {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.shape-square {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(245, 87, 108, 0.5);
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 104px solid #4ecdc4;
  filter: drop-shadow(0 8px 16px rgba(78, 205, 196, 0.5));
}

.shape-star {
  font-size: 6em;
  color: #ffd93d;
  text-shadow: 0 8px 24px rgba(255, 217, 61, 0.5);
  animation: starSpin 4s linear infinite;
}

@keyframes starSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.shape-heart {
  font-size: 6em;
  color: #ff6b9d;
  text-shadow: 0 8px 24px rgba(255, 107, 157, 0.5);
  animation: heartBeat 1s ease-in-out infinite;
}

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

.shape-rectangle {
  width: 130px;
  height: 80px;
  background: linear-gradient(135deg, #4ecdc4, #2a9d8f);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(78, 205, 196, 0.5);
}

.question-text {
  font-size: 1.2em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* ========== 分类题 ========== */
.classify-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.classify-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.classify-option {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 12px 20px;
  min-height: 48px;
  color: #fff;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  min-width: 100px;
}

.classify-option:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.classify-option:active {
  transform: scale(0.96);
}

.classify-option.option-correct {
  background: rgba(78, 205, 196, 0.3);
  border-color: #4ecdc4;
  animation: correctFlash 0.5s ease;
}

.classify-option.option-wrong {
  background: rgba(255, 107, 107, 0.3);
  border-color: #ff6b6b;
  animation: wrongShake 0.4s ease;
}

.feedback-correct {
  font-size: 1.2em;
  font-weight: 700;
  color: #ffd93d;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 999px;
  margin-top: 4px;
}

.feedback-hint {
  font-size: 1.05em;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 999px;
  margin-top: 4px;
  max-width: 88vw;
  text-align: center;
}

/* ========== 数字键盘 ========== */
.numpad {
  width: 100%;
  max-width: 340px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}

.num-key {
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 16px 0;
  font-size: 1.4em;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  min-height: 55px;
}

.num-key:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.num-key:active:not(:disabled) {
  transform: scale(0.94);
}

.num-key.key-disabled {
  visibility: hidden;
}

.num-key:last-child {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: rgba(102, 126, 234, 0.6);
  font-size: 1.2em;
}

/* ========== 反馈弹窗 ========== */
.feedback-popup {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  animation: feedbackPop 0.6s ease;
}

.feedback-popup.correct .feedback-icon {
  color: #4ecdc4;
  font-size: 4em;
}

.feedback-popup.wrong .feedback-icon {
  color: #ff6b6b;
  font-size: 4em;
}

.feedback-icon {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.feedback-text {
  font-size: 1.5em;
  font-weight: 700;
}

.feedback-popup.correct .feedback-text {
  color: #4ecdc4;
}

.feedback-popup.wrong .feedback-text {
  color: #ff6b6b;
}

.feedback-score {
  font-size: 2em;
  font-weight: 900;
  color: #ffd93d;
  text-shadow: 0 2px 10px rgba(255, 217, 61, 0.6);
}

@keyframes feedbackPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  60% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* ========== 结果界面 ========== */
.result-screen {
  justify-content: center;
  padding: 20px;
}

.result-content {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}

.result-icon {
  font-size: 4em;
  animation: bounce 1s ease infinite;
}

.result-icon.fail {
  animation: shake 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

.result-content h2 {
  font-size: 1.8em;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-desc {
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.7);
}

.result-stars {
  display: flex;
  gap: 8px;
  margin: 4px 0;
}

.star-big {
  font-size: 3em;
  color: rgba(255, 255, 255, 0.15);
  transition: all 0.3s;
}

.star-big.star-filled {
  color: #ffd93d;
  text-shadow: 0 0 20px rgba(255, 217, 61, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: starAppear 0.5s ease forwards;
}

@keyframes starAppear {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.result-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.95em;
}

.result-value {
  font-weight: 700;
  color: #ffd93d;
}

.result-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal {
  background: linear-gradient(145deg, #2d1b69, #1a1040);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 30px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 3em;
}

.modal h3 {
  font-size: 1.4em;
}

.modal p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95em;
}

.modal-buttons {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.modal-buttons .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 1em;
}

/* ========== 响应式 ========== */
@media (max-height: 700px) {
  .battle-area {
    min-height: 100px;
    padding: 6px 20px;
  }

  .monster-avatar {
    font-size: 3em;
  }

  .ship-avatar {
    font-size: 2.8em;
  }

  .equation {
    font-size: 2.4em;
    gap: 8px;
  }

  .equation span {
    min-width: 38px;
  }

  .answer-display {
    min-height: 42px;
    font-size: 1.6em;
  }

  .num-key {
    padding: 12px 0;
    font-size: 1.2em;
    min-height: 45px;
  }
}

@media (min-width: 500px) {
  .game-title {
    font-size: 2.8em;
  }
}

/* ========== 滚动条 ========== */
.levels-grid::-webkit-scrollbar {
  width: 6px;
}

.levels-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.levels-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ========== 拼音题 ========== */
.pinyin-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pinyin-image {
  font-size: 5em;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
  animation: monsterFloat 3s ease-in-out infinite;
}

.pinyin-word {
  font-size: 1.8em;
  font-weight: 800;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.pinyin-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 10px 22px;
  min-height: 56px;
  transition: all 0.3s;
}

.pinyin-display.answer-correct {
  background: rgba(78, 205, 196, 0.25);
  border-color: #4ecdc4;
  animation: correctFlash 0.5s ease;
}

.pinyin-display.answer-wrong {
  background: rgba(255, 107, 107, 0.25);
  border-color: #ff6b6b;
  animation: wrongShake 0.4s ease;
}

.pinyin-syllable {
  font-size: 1.8em;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  padding: 0 6px;
}

.pinyin-initial {
  color: rgba(255, 255, 255, 0.92);
}

.pinyin-final {
  color: rgba(255, 255, 255, 0.92);
}

.pinyin-initial.pinyin-blank,
.pinyin-final.pinyin-blank {
  color: rgba(255, 217, 61, 0.95);
  letter-spacing: 2px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 217, 61, 0.7);
  animation: pulse 1s ease-in-out infinite;
  min-width: 1.2em;
  display: inline-block;
  text-align: center;
}

.pinyin-initial.pinyin-filled,
.pinyin-final.pinyin-filled {
  color: #ffd93d;
  text-shadow: 0 0 12px rgba(255, 217, 61, 0.6);
}

.pinyin-hint {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.pinyin-option {
  min-width: 80px;
  font-size: 1.15em;
  padding: 12px 18px;
}

@media (max-height: 700px) {
  .pinyin-image {
    font-size: 3.6em;
  }
  .pinyin-word {
    font-size: 1.4em;
  }
  .pinyin-syllable {
    font-size: 1.4em;
  }
  .pinyin-display {
    min-height: 46px;
    padding: 8px 18px;
  }
}

/* ========== 找正确拼音 ========== */
.findcorrect-levels {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.findcorrect-card {
  position: relative;
  width: 100%;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(5px);
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.findcorrect-card:hover:not(.fc-locked) {
  transform: translateY(-3px);
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.findcorrect-card:active:not(.fc-locked) {
  transform: scale(0.98);
}

.findcorrect-card.fc-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.fc-emoji {
  font-size: 2.4em;
}

.fc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-name {
  font-size: 1.05em;
  font-weight: 700;
  text-align: left;
}

.fc-stars {
  display: flex;
  gap: 3px;
}

.fc-lock {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: rgba(255, 217, 61, 0.8);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 8px;
}

.findcorrect-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* 词语卡片：图片+汉字 */
.fc-word-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(145deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.fc-word-image {
  font-size: 3.6em;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.fc-word-text {
  font-size: 2em;
  font-weight: 800;
  color: #fff;
  letter-spacing: 4px;
}

.findcorrect-hint {
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  text-align: center;
}

.findcorrect-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.findcorrect-option {
  width: 100%;
  padding: 14px 18px;
  min-height: 52px;
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, rgba(102, 126, 234, 0.35), rgba(118, 75, 162, 0.35));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 2px;
}

.findcorrect-option:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 217, 61, 0.6);
  box-shadow: 0 6px 18px rgba(255, 217, 61, 0.25);
}

.findcorrect-option:active {
  transform: scale(0.97);
}

/* 答对：标识正确选项 */
.findcorrect-option.fc-option-correct {
  background: linear-gradient(145deg, #4ecdc4, #2a9d8f);
  border-color: #4ecdc4;
  color: #fff;
}

/* 答错：标识选错的那一项 */
.findcorrect-option.fc-option-wrong {
  background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
  border-color: #ff6b6b;
  color: #fff;
}

.menu-settings {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-settings {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  min-height: 44px;
}

.btn-settings:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-settings.active {
  background: rgba(78, 205, 196, 0.25);
  border-color: #4ecdc4;
  color: #fff;
}

.timer-pill.timer-low {
  color: #ff6b6b;
  animation: wrongShake 0.5s infinite;
}

:focus-visible {
  outline: 3px solid #4ecdc4;
  outline-offset: 2px;
}

@keyframes revealPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(78, 205, 196, 0.6); }
}

@media (max-height: 700px) {
  .fc-word-image {
    font-size: 2.8em;
  }
  .fc-word-text {
    font-size: 1.6em;
  }
  .findcorrect-option {
    padding: 10px 14px;
    font-size: 1.25em;
  }
  .findcorrect-card {
    padding: 12px 16px;
  }
  .fc-emoji {
    font-size: 2em;
  }
}

/* ========== 炮台 CSS 合成层动画（替代原 SVG SMIL，主线程零负担） ========== */
.core-pulse { animation: corePulse 1.2s ease-in-out infinite; }
@keyframes corePulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.charge-pulse { animation: chargePulse 0.9s ease-in-out infinite; }
@keyframes chargePulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}

/* ========== 低功耗兜底：跟随系统"减少动态效果"设置，关闭装饰动画 ========== */
@media (prefers-reduced-motion: reduce) {
  .star, .planet, .pet-avatar img, .monster-avatar, .cat-img, .shape-star,
  .shape-heart, .equation span.question-mark, .result-icon, .laser-dot,
  .pet-accessory, .checkin-done .checkin-emoji, .core-pulse, .charge-pulse {
    animation: none !important;
  }
}
