/* ==================== 学习乐园小黄鸭 v2.0 - 全局样式 ==================== */

:root {
  /* 配色方案 */
  --bg: #FFF9F0;
  --primary: #FF8C94;
  --primary-dark: #FF6B81;
  --primary-shadow: #E85D75;
  --secondary: #A8E6CF;
  --secondary-dark: #7FDBB6;
  --accent: #FFD93D;
  --neutral: #6C5CE7;
  --neutral-dark: #5B4BC4;
  --text: #2D3436;
  --text-light: #636E72;
  --white: #FFFFFF;
  --danger: #FF6B6B;
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-hover: 0 16px 48px rgba(0,0,0,0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --font: 'Nunito', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ==================== 页面容器 ==================== */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

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

/* ==================== 头部 ==================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 2px 2px 4px rgba(255,140,148,0.2);
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
}

.btn-main {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  box-shadow: 0 6px 0 var(--primary-shadow), 0 10px 20px rgba(255,140,148,0.3);
}

.btn-main:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--primary-shadow), 0 4px 10px rgba(255,140,148,0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--neutral) 0%, var(--neutral-dark) 100%);
  color: var(--white);
  box-shadow: 0 6px 0 #4A3FB5, 0 10px 20px rgba(108,92,231,0.3);
}

.btn-secondary:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #4A3FB5, 0 4px 10px rgba(108,92,231,0.2);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--text);
  box-shadow: 0 6px 0 #6BCFA8, 0 10px 20px rgba(168,230,207,0.3);
}

.btn-success:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #6BCFA8, 0 4px 10px rgba(168,230,207,0.2);
}

/* 返回按钮 */
.back-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-shadow);
  transition: all 0.1s;
}

.back-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--primary-shadow);
}

/* ==================== 卡片 ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--accent);
  transform: scale(1.01);
  box-shadow: var(--shadow-hover);
}

/* ==================== 功能网格 ==================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.feature-card {
  background: linear-gradient(135deg, var(--white) 0%, #FFF5F5 100%);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
  border: 3px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.feature-card:active {
  transform: translateY(-2px) scale(0.98);
}

.feature-card .icon {
  font-size: 2.5em;
  margin-bottom: 8px;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

.feature-card .title {
  font-size: 1em;
  font-weight: 700;
  color: var(--text);
}

/* ==================== 汉字显示 ==================== */
.char-display {
  font-size: 4em;
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--white) 0%, #FFF5F5 100%);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 3px solid var(--primary);
  color: var(--primary);
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(255,140,148,0.2);
}

/* ==================== 选项按钮 ==================== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option-btn {
  padding: 16px;
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font);
  font-size: 1.2em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.option-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,140,148,0.3);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.option-btn.correct {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  border-color: var(--secondary-dark);
  color: var(--text);
  animation: correctPop 0.5s ease;
}

.option-btn.wrong {
  background: linear-gradient(135deg, var(--danger) 0%, #FF8E8E 100%);
  border-color: var(--danger);
  color: var(--white);
  animation: shake 0.5s ease;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ==================== 进度条 ==================== */
.progress-bar {
  width: 100%;
  height: 12px;
  background: #E8E8E8;
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 2px 8px rgba(255,140,148,0.3);
}

/* ==================== 反馈弹窗 ==================== */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.feedback-overlay.show {
  display: block;
}

.feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, var(--white) 0%, #FFF5F5 100%);
  padding: 32px 40px;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 3px solid var(--accent);
  min-width: 200px;
}

.feedback.show {
  transform: translate(-50%, -50%) scale(1);
}

.feedback .feedback-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.feedback .feedback-text {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text);
}

/* ==================== 关卡卡片 ==================== */
.level-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.level-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.level-card h3 {
  color: var(--primary);
  font-size: 1.2em;
  margin-bottom: 8px;
}

.level-card p {
  color: var(--text-light);
  font-size: 0.9em;
  margin-bottom: 8px;
}

.level-card .badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #FFC93D 100%);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
}

/* ==================== 宠物页面 ==================== */
.pet-avatar {
  font-size: 5em;
  margin-bottom: 16px;
  filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.1));
  animation: float 3s ease-in-out infinite;
}

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

.pet-name {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.pet-level {
  color: var(--text-light);
  font-size: 1em;
  margin-bottom: 16px;
}

/* ==================== 输入框 ==================== */
input[type="text"] {
  width: 100%;
  padding: 16px;
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.1em;
  text-align: center;
  outline: none;
  transition: all 0.3s;
  background: var(--white);
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,217,61,0.2);
}

/* ==================== 隐藏类 ==================== */
.hidden {
  display: none !important;
}

/* ==================== 星星动画 ==================== */
.star-particle {
  position: fixed;
  pointer-events: none;
  font-size: 1.5em;
  z-index: 1001;
  animation: star-pop 0.6s ease forwards;
}

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

/* ==================== 彩带动画 ==================== */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 1001;
  animation: confetti-fall 2s linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==================== 连一连游戏样式 ==================== */
.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 700;
  font-size: 0.95em;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.match-game-area {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 16px;
}

.match-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  max-width: 160px;
}

.match-card {
  background: var(--white);
  border: 3px solid var(--secondary);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  font-weight: 800;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.match-card.match-char {
  font-size: 2em;
  color: var(--primary);
  border-color: var(--primary);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-card.match-pinyin {
  font-size: 1.1em;
  color: var(--neutral);
  border-color: var(--neutral);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.match-card.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

.match-card.matched {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
  opacity: 0.5;
  pointer-events: none;
  transform: scale(0.95);
}

.match-card.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

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

/* ==================== 偏旁组字游戏样式 ==================== */
.radical-game-area {
  padding: 16px;
  text-align: center;
}

.radical-prompt {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 20px;
}

.radical-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 2.5em;
  font-weight: 900;
}

.radical-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.2em;
}

.radical-plus,
.radical-equals {
  color: var(--text-light);
  font-size: 0.7em;
}

.radical-root {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1.2em;
}

.radical-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.2em;
  transition: all 0.3s ease;
}

.radical-result.show-result {
  background: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

.radical-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 320px;
  margin: 0 auto;
}

.radical-option-btn {
  background: var(--white);
  border: 3px solid var(--neutral);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 1.8em;
  font-weight: 900;
  color: var(--neutral);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.radical-option-btn:hover {
  background: var(--neutral);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

.radical-option-btn.correct {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
}

.radical-option-btn.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

.radical-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.radical-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* ==================== 组词挑战样式 ==================== */
.wordbuild-game-area {
  padding: 16px;
  text-align: center;
}

.wordbuild-prompt {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 20px;
}

.wordbuild-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 2.5em;
  font-weight: 900;
}

.wordbuild-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1.2em;
}

.wordbuild-plus,
.wordbuild-equals {
  color: var(--text-light);
  font-size: 0.7em;
}

.wordbuild-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.2em;
}

.wordbuild-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.2em;
  transition: all 0.3s ease;
}

.wordbuild-result.show-result {
  background: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

.wordbuild-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 320px;
  margin: 0 auto;
}

.wordbuild-option-btn {
  background: var(--white);
  border: 3px solid var(--neutral);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 1.8em;
  font-weight: 900;
  color: var(--neutral);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.wordbuild-option-btn:hover {
  background: var(--neutral);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

.wordbuild-option-btn.correct {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
}

.wordbuild-option-btn.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

.wordbuild-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* ==================== 组词挑战 · 找朋友主题 ==================== */
.friend-theme .wordbuild-prompt {
  color: #B388C8;
  font-size: 1.15em;
  line-height: 1.5;
}
.friend-prompt-sub {
  font-size: 0.78em;
  font-weight: 600;
  color: #C9A8DC;
}
/* 舞台：两个字卡 + 中间爱心 */
.friend-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 2.2em;
  font-weight: 900;
}
.friend-stage .wordbuild-char,
.friend-stage .wordbuild-slot {
  width: 76px; height: 76px;
  border-radius: 22px; /* 圆角卡片，比默认更柔和 */
  font-size: 1.15em;
  transition: transform 0.35s ease;
}
.friend-stage .wordbuild-char {
  background: linear-gradient(135deg, #FF9EBB, #FF6B9D);
  box-shadow: 0 6px 18px rgba(255,107,157,0.35);
}
.friend-stage .wordbuild-slot {
  background: #FFF3D6;
  border: 3px dashed #E8C86A;
  color: #B89B4A;
}
/* 爱心：默认隐藏，答对弹出 */
.friend-heart {
  font-size: 0.85em;
  opacity: 0;
  transform: scale(0.3);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* 答对：两个字卡向中间靠拢，爱心弹出 */
.friend-stage.united .wordbuild-char { transform: translateX(16px) rotate(-4deg); }
.friend-stage.united .wordbuild-slot { transform: translateX(-16px) rotate(4deg); background: var(--accent); border-style: solid; color: var(--text); }
.friend-stage.united .friend-heart { opacity: 1; transform: scale(1.25); }
/* 组成的词语：舞台下方的胶囊 */
.friend-word-line {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  min-height: 44px;
}
.friend-theme .wordbuild-result {
  width: auto;
  min-width: 90px;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: #F3EAFB;
  color: #B39DDB;
  font-size: 1.3em;
}
.friend-theme .wordbuild-result.show-result {
  background: linear-gradient(135deg, #FFE066, #FFC93C);
  color: #7A5C00;
  transform: scale(1.12);
  box-shadow: 0 0 22px rgba(255, 201, 60, 0.55);
}
/* 选项：朋友卡片（圆角加大、粉紫描边） */
.friend-theme .wordbuild-option-btn {
  border-radius: 20px;
  border-color: #DCC8EE;
  color: #9B7EC8;
  background: #FDF9FF;
}
.friend-theme .wordbuild-option-btn:hover {
  background: #9B7EC8;
  border-color: #9B7EC8;
  color: white;
}
.friend-theme .wordbuild-option-btn.correct {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
}
.friend-theme .wordbuild-option-btn.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* ==================== 拼音工坊 - 虚拟键盘样式 ==================== */
.pinyin-keyboard-layout {
  display: flex;
  gap: 20px;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

/* 左列：汉字显示 */
.pinyin-left-panel {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pinyin-char-display {
  font-size: 5em;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.pinyin-instruction {
  font-size: 1em;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
}

.pinyin-preview-area {
  width: 100%;
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.pinyin-preview-label {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.pinyin-preview {
  font-size: 1.6em;
  font-weight: 800;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.pinyin-placeholder {
  color: var(--text-light);
  font-size: 0.7em;
  font-weight: 600;
}

.pinyin-composed {
  color: var(--neutral);
}

.pinyin-wrong {
  color: var(--danger);
  text-decoration: line-through;
}

.pinyin-correct {
  color: var(--secondary-dark);
}

.pinyin-preview-parts {
  font-size: 0.8em;
  color: var(--text-light);
  text-align: center;
  min-height: 20px;
}

/* 右列：虚拟键盘 */
.pinyin-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.keyboard-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyboard-label {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--text-light);
  padding-left: 4px;
}

.keyboard-label::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.keyboard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kb-key {
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9em;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  min-width: 32px;
  text-align: center;
}

.kb-key:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.kb-key.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(255, 140, 148, 0.4);
}

.kb-initial {
  background: #FFF0F3;
  color: var(--primary);
}

.kb-final {
  background: #F0FFF7;
  color: #27AE60;
}

.kb-tone {
  background: #FFF9E6;
  color: #E67E22;
  font-size: 1.1em;
  padding: 8px 16px;
}

.keyboard-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px dashed var(--bg);
}

.kb-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  border: none;
}

.kb-clear {
  background: var(--bg);
  color: var(--text-light);
}

.kb-clear:hover {
  background: #FFE5E5;
  color: var(--danger);
}

.kb-submit {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(168, 230, 207, 0.4);
}

.kb-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 230, 207, 0.5);
}

.kb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 手机端：上下排列 */
@media (max-width: 768px) {
  .pinyin-keyboard-layout {
    flex-direction: column;
    gap: 16px;
    padding: 12px;
  }

  .pinyin-left-panel {
    flex: none;
    padding: 16px;
  }

  .pinyin-char-display {
    font-size: 3.5em;
  }

  .pinyin-right-panel {
    padding: 16px;
  }

  .kb-key {
    padding: 6px 8px;
    font-size: 0.8em;
    min-width: 28px;
  }
}

/* ==================== 听音选字游戏样式 ==================== */
.listen-game-area {
  padding: 16px;
  text-align: center;
}

.listen-prompt {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 20px;
}

.listen-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: var(--font);
  font-size: 1.3em;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 0 var(--primary-shadow), 0 10px 20px rgba(255,140,148,0.3);
  margin-bottom: 32px;
}

.listen-play-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255,140,148,0.4);
}

.listen-play-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--primary-shadow);
}

.listen-play-btn.playing {
  animation: pulse 1s ease infinite;
}

.listen-play-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.listen-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 320px;
  margin: 0 auto;
}

.listen-option-btn {
  background: var(--white);
  border: 3px solid var(--neutral);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 2.2em;
  font-weight: 900;
  color: var(--neutral);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.listen-option-btn:hover {
  background: var(--neutral);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

.listen-option-btn.correct {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
  animation: correctPop 0.5s ease;
}

.listen-option-btn.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

.listen-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* ==================== 句子填空游戏样式 ==================== */
.sentence-game-area {
  padding: 16px;
  text-align: center;
}

.sentence-prompt {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 20px;
}

.sentence-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 32px;
  font-size: 1.4em;
  font-weight: 700;
  line-height: 2;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sentence-before,
.sentence-after {
  color: var(--text);
}

.sentence-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 50px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.2em;
  font-weight: 900;
  padding: 0 12px;
  transition: all 0.3s ease;
}

.sentence-slot.filled-correct {
  background: var(--secondary);
  color: var(--text);
  animation: correctPop 0.5s ease;
}

.sentence-slot.filled-wrong {
  background: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

.sentence-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 320px;
  margin: 0 auto;
}

.sentence-option-btn {
  background: var(--white);
  border: 3px solid var(--neutral);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 1.8em;
  font-weight: 900;
  color: var(--neutral);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.sentence-option-btn:hover {
  background: var(--neutral);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

.sentence-option-btn.correct {
  background: var(--secondary);
  border-color: var(--secondary-dark);
  color: var(--text);
}

.sentence-option-btn.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: shake 0.4s ease;
}

.sentence-option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

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

/* 宠物图片悬停效果 */
#petImage:hover {
  transform: scale(3);
  animation: duckWiggle 0.5s ease infinite;
}

@keyframes duckWiggle {
  0%, 100% { transform: scale(3) rotate(-5deg); }
  50% { transform: scale(3) rotate(5deg); }
}
@keyframes levelUpFlash {
  0% { box-shadow: 0 0 0 rgba(255, 217, 61, 0); }
  25% { box-shadow: 0 0 40px rgba(255, 217, 61, 0.8); }
  50% { box-shadow: 0 0 60px rgba(255, 217, 61, 1); }
  75% { box-shadow: 0 0 40px rgba(255, 217, 61, 0.8); }
  100% { box-shadow: 0 0 0 rgba(255, 217, 61, 0); }
}

/* ==================== 汉字学习卡片样式 ==================== */
.word-learn-card {
  background: linear-gradient(135deg, var(--white) 0%, #FFF8F5 100%);
  border-left: 5px solid var(--primary) !important;
  transition: all 0.3s ease;
}

.word-learn-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.word-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

/* ==================== 冒险地图首页 ==================== */
#home {
  background: linear-gradient(160deg, #FFF0F5 0%, #FDE8F5 25%, #F3E5FF 50%, #E8F0FF 75%, #FFF5F0 100%);
  padding: 12px 16px;
  overflow-y: auto;
}

.adventure-top-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(200,150,220,0.2);
  margin-bottom: 10px;
}
.adventure-duck-avatar { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; overflow: hidden; box-shadow: 0 2px 8px rgba(200,150,220,0.3); }
.adventure-companion-detail { flex: 1; min-width: 0; }
.adventure-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adventure-name { font-size: 1.1em; font-weight: 800; color: #5D4E6D; }
.adventure-lv-badge {
  background: linear-gradient(135deg, #4ECDC4, #44B09E);
  color: white; font-size: 0.65em; font-weight: 800;
  padding: 2px 8px; border-radius: 10px;
}
.adventure-mood-tag {
  background: #FFF3CD; color: #856404;
  font-size: 0.7em; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}
.adventure-stats-row { display: flex; gap: 12px; margin-top: 2px; font-size: 0.8em; color: #8E7FB5; font-weight: 600; }
.adventure-speech {
  background: linear-gradient(135deg, #FFF0F5, #F8E8FF);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 14px; font-size: 0.82em; font-weight: 600;
  color: #9B59B6; white-space: nowrap; flex-shrink: 0;
}

.adventure-weak-banner {
  background: linear-gradient(135deg, #EDE7F6, #D1C4E9);
  border-radius: 12px; padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82em; font-weight: 600; color: #9B59B6;
  margin-bottom: 10px;
}

/* 教材选择 */
.adventure-textbook-select {
  background: rgba(255,255,255,0.85);
  border-radius: 16px; padding: 16px; margin-bottom: 10px;
}
.adventure-textbook-select h3 {
  text-align: center; color: #5D4E6D; font-size: 1em; margin-bottom: 10px;
}
.adventure-textbook-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.adventure-textbook-card {
  background: white; border-radius: 12px; padding: 14px; text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06); cursor: pointer;
  font-weight: 700; color: #5D4E6D; font-size: 0.9em;
  transition: all 0.2s ease;
}
.adventure-textbook-card:active { transform: scale(0.95); }
.adventure-textbook-card.active { border: 3px solid #FF6B6B; }

/* 地图容器 */
.adventure-map {
  flex: 3;
  background:
    linear-gradient(135deg, rgba(255,220,235,0.25) 0%, rgba(240,210,255,0.25) 50%, rgba(210,225,255,0.25) 100%),
    url('images/adventure/bg-sky-clouds.png');
  background-size: cover; background-position: center;
  border-radius: 20px;
  overflow-x: auto; overflow-y: hidden;
  position: relative;
  margin-bottom: 10px;
  min-height: 340px;
  display: flex; align-items: center;
}
.adventure-map-header {
  position: absolute; top: 12px; left: 16px;
  display: flex; align-items: center;
  z-index: 5; pointer-events: none;
}
.adventure-map-header h2 { font-size: 1em; font-weight: 800; color: #5D4E6D; margin: 0; }
.adventure-map-progress {
  font-size: 0.75em; font-weight: 700; color: #9B59B6;
  background: rgba(255,255,255,0.7); padding: 3px 10px; border-radius: 10px;
  margin-left: 12px;
}

.adventure-map-scroll {
  display: flex; align-items: flex-end; gap: 0;
  min-width: max-content;
  padding: 48px 20px 16px;
  flex-shrink: 0;
  position: relative; /* 鸭鸭跳格子标记的定位基准 */
}

/* 鸭鸭跳格子标记 */
.adv-duck-marker {
  position: absolute;
  top: 2px;
  width: 44px; height: 44px;
  z-index: 10;
  pointer-events: none;
}
.adv-duck-marker img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(150,120,180,0.35);
}
.adv-duck-marker.hopping img {
  animation: advDuckHop 0.3s ease-in-out 3;
}
@keyframes advDuckHop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
/* 落点站点的庆祝脉冲 */
.adv-node.adv-landed .adv-circle {
  animation: advLandPulse 0.6s ease-out 2;
}
@keyframes advLandPulse {
  0% { box-shadow: 0 0 0 6px rgba(255,200,100,0.95), 0 0 44px rgba(255,180,80,0.9); transform: scale(1.18); }
  100% { box-shadow: 0 0 0 4px rgba(255,200,100,0.7), 0 0 28px rgba(255,180,80,0.4); transform: scale(1.1); }
}

/* 站点节点 */
.adv-node {
  display: flex; flex-direction: column; align-items: center;
  position: relative; flex-shrink: 0; width: 96px;
}
.adv-node .adv-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; overflow: hidden;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 4px 14px rgba(150,120,180,0.15);
}
.adv-node .adv-circle img { width: 100%; height: 100%; object-fit: cover; }
.adv-node .adv-label {
  font-size: 0.72em; font-weight: 700; margin-top: 8px;
  text-align: center; color: #5D4E6D; line-height: 1.3;
}
.adv-node .adv-status {
  font-size: 0.65em; font-weight: 600; margin-top: 3px;
  display: flex; align-items: center; gap: 2px;
}
.adv-node .adv-status img { width: 14px; height: 14px; }

/* 状态样式 */
.adv-node.done .adv-circle {
  box-shadow: 0 0 0 3px rgba(111,207,151,0.5), 0 4px 14px rgba(0,0,0,0.1);
}
.adv-node.done .adv-status { color: #6FCF97; }

.adv-node.current .adv-circle {
  box-shadow: 0 0 0 4px rgba(255,200,100,0.7), 0 0 28px rgba(255,180,80,0.4);
  animation: advNodeGlow 2s ease-in-out infinite;
  transform: scale(1.1);
}
@keyframes advNodeGlow {
  0%,100% { box-shadow: 0 0 0 4px rgba(255,200,100,0.7), 0 0 28px rgba(255,180,80,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255,200,100,0.3), 0 0 40px rgba(255,180,80,0.6); }
}
.adv-node.current .adv-status { color: #E8A840; }

.adv-node.obstacle .adv-circle {
  box-shadow: 0 0 0 3px dashed rgba(179,157,219,0.7), 0 4px 14px rgba(155,89,182,0.2);
}
.adv-node.obstacle .adv-status { color: #B39DDB; }

.adv-node.special .adv-circle {
  box-shadow: 0 0 0 3px rgba(255,141,169,0.5), 0 4px 14px rgba(255,141,169,0.2);
}
.adv-node.special .adv-status { color: #FFB6C1; }

.adv-node.locked .adv-circle {
  opacity: 0.5; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  filter: grayscale(0.4);
}
.adv-node.locked .adv-label { color: rgba(120,100,140,0.45); }
.adv-node.locked .adv-status { color: rgba(150,130,170,0.4); }

.adv-node.final .adv-circle {
  box-shadow: 0 0 20px rgba(255,200,60,0.5), 0 0 0 3px rgba(255,200,60,0.3);
}
.adv-node.final .adv-status { color: #E8B840; }

/* 路线（内嵌课级小圆点，2026-07-24 阶段5） */
.adv-path {
  width: 68px; height: 22px; flex-shrink: 0;
  margin: 0 -3px; align-self: center;
  margin-bottom: 44px; position: relative;
}
.adv-path::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 5px; transform: translateY(-50%); border-radius: 2px;
  background: rgba(200,180,220,0.2);
}
.adv-path.done::before { background: rgba(111,207,151,0.7); }
.adv-path.active::before {
  background: repeating-linear-gradient(90deg, #FFD580 0, #FFD580 5px, transparent 5px, transparent 11px);
  opacity: 0.8; animation: advPathDash 0.5s linear infinite;
}
@keyframes advPathDash { to { background-position: 11px 0; } }
.adv-path.locked::before { background: rgba(200,180,220,0.2); }

/* S 形布局：站点上下错落 */
.adv-node.adv-up { transform: translateY(-16px); }
.adv-node.adv-down { transform: translateY(14px); }

/* 课级进度小圆点：一颗=一课，学完点亮 */
.adv-dots {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-evenly;
  pointer-events: none;
}
.adv-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(200,180,220,0.35);
  border: 1.5px solid rgba(255,255,255,0.7);
  box-sizing: border-box;
}
.adv-dot.lit {
  background: #FFD580; border-color: #fff;
  box-shadow: 0 0 6px rgba(255,200,100,0.8);
}
/* 部分完成：金色扇形按 --p 百分比渐进填充（2026-07-25 方向A） */
.adv-dot.partial {
  background: conic-gradient(#FFB830 calc(var(--p, 0) * 1%), rgba(200,180,220,0.45) 0);
  border-color: #fff;
  box-shadow: 0 0 6px rgba(255,190,80,0.7);
}
.adv-path.locked .adv-dot { opacity: 0.5; }
/* 末站圆点挂在节点下方 */
.adv-dots-final {
  position: static; margin-top: 5px;
  display: flex; gap: 4px; justify-content: center;
}
.adv-dots-final .adv-dot { width: 12px; height: 12px; }

/* ==================== 进站字卡（预习册·阶段3） ==================== */
#stationCards.active { display: flex; flex-direction: column; }
.sc-sub { text-align: center; color: #B39DDB; font-size: 0.85em; font-weight: 700; margin-top: 4px; }
.sc-progress { text-align: center; font-weight: 800; color: #9B59B6; margin: 6px 0 2px; }
.sc-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; padding: 12px 16px;
  flex: 1; overflow-y: auto; align-content: start;
}
.sc-card { aspect-ratio: 5/5.6; perspective: 600px; cursor: pointer; }
.sc-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.45s; transform-style: preserve-3d;
}
.sc-card.flipped .sc-inner { transform: rotateY(180deg); }
.sc-front, .sc-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 18px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 8px;
}
.sc-front {
  background: linear-gradient(135deg, #FFE9F6, #F3E5FF);
  border: 2.5px solid #D9B8F0;
  box-shadow: 0 4px 14px rgba(155,89,182,0.15);
}
.sc-card.viewed .sc-front { border-color: #6FCF97; }
.sc-char {
  font-size: 7em; font-weight: 800; color: #7B4B9E;
  font-family: 'ZCOOLKuaiLe', sans-serif;
}
.sc-hint { font-size: 0.85em; color: #9B59B6; margin-top: 10px; font-weight: 700; }
.sc-back {
  background: linear-gradient(135deg, #FFF6E0, #FFE9F6);
  border: 2.5px solid #FFD580;
  transform: rotateY(180deg);
  text-align: center; gap: 8px; overflow: hidden;
  padding: 12px 10px;
  justify-content: flex-start;
}
/* 背面顶部：生字 + 喇叭重听按钮 */
.sc-back-head {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%;
}
.sc-back-char {
  font-size: 2.6em; font-weight: 800; color: #7B4B9E;
  font-family: 'ZCOOLKuaiLe', sans-serif; line-height: 1;
}
.sc-replay {
  font-size: 1.3em; line-height: 1;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid rgba(255, 179, 71, 0.5);
  background: rgba(255, 209, 102, 0.25);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.sc-replay:active { transform: scale(0.9); background: rgba(255, 209, 102, 0.5); }
/* 拼音：金色胶囊徽章 */
.sc-pinyin {
  font-size: 1.5em; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #FFB830, #E8A840);
  border-radius: 999px; padding: 4px 20px;
  box-shadow: 0 2px 6px rgba(232,168,64,0.35);
}
/* 组词：白色色块承托，字号加大，均分拉伸 */
.sc-words {
  color: #7B4B9E; font-weight: 700; font-size: 1.2em;
  background: rgba(255,255,255,0.88);
  border-radius: 12px; padding: 6px 10px; width: 100%;
  box-sizing: border-box; line-height: 1.5;
  box-shadow: 0 1px 4px rgba(155,89,182,0.12);
  flex: 1; display: flex; align-items: center; justify-content: center;
}
/* 例句：淡紫引用块+左侧竖线，颜色加深加大，均分拉伸 */
.sc-sentence {
  color: #5D4E6D; font-size: 1.08em; line-height: 1.6; font-weight: 600;
  background: rgba(217,184,240,0.3);
  border-left: 4px solid #B58ADE;
  border-radius: 10px; padding: 10px 12px; width: 100%;
  box-sizing: border-box; text-align: left;
  overflow: hidden;
  flex: 1;
  display: flex; align-items: center;
}
.sc-start-btn { margin: 8px 16px 14px; width: auto; }
.sc-start-btn:disabled { opacity: 0.55; animation: none; }
@media (max-width: 480px) {
  .sc-char { font-size: 3.4em; }
  .sc-pinyin { font-size: 1.2em; }
  .sc-words { font-size: 1.0em; }
  .sc-sentence { font-size: 0.82em; }
}

/* 底部按钮 */
.adventure-actions {
  display: flex; gap: 10px; flex-shrink: 0; padding-bottom: 6px;
}
.adv-btn {
  flex: 1; padding: 12px; border: none; border-radius: 14px;
  font-size: 0.9em; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s ease;
}
.adv-btn-go {
  background: linear-gradient(135deg, #FF6B6B, #EE5A5A);
  color: white;
  box-shadow: 0 4px 18px rgba(255,107,107,0.4);
}
.adv-btn-camp {
  background: rgba(255,255,255,0.85);
  color: #9B59B6;
  border: 2px solid rgba(201,165,224,0.4);
}
/* 主行动按钮：出发探险独占一排、放大呼吸 */
.adv-btn-hero {
  flex: none; width: 100%;
  padding: 18px; font-size: 1.25em; border-radius: 20px;
  box-shadow: 0 6px 24px rgba(255,107,107,0.5);
  animation: heroPulse 2.4s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 24px rgba(255,107,107,0.5); }
  50% { transform: scale(1.03); box-shadow: 0 8px 30px rgba(255,107,107,0.65); }
}
/* 次要入口：一排三个小按钮 */
.adventure-actions-secondary { gap: 8px; margin-top: 10px; }
.adv-btn-small {
  padding: 8px 4px; font-size: 0.78em; border-radius: 10px; font-weight: 700;
}
.adv-btn:active { transform: scale(0.95); }

@media (max-width: 480px) {
  .adventure-top-bar { padding: 8px 12px; gap: 8px; }
  .adventure-duck-avatar { width: 44px; height: 44px; }
  .adventure-speech { font-size: 0.72em; white-space: normal; max-width: 140px; }
  .adventure-map { min-height: 260px; flex: 2; }
  .adv-node { width: 72px; }
  .adv-node .adv-circle { width: 52px; height: 52px; }
  .adv-path { width: 50px; margin-bottom: 32px; }
  .adv-node .adv-label { font-size: 0.62em; }
  .adventure-map-progress { font-size: 0.65em; margin-left: 6px; }
}

/* ==================== 过河踩石头游戏 ==================== */
/* 冒险模式的游戏页 */
#game.adventure-river {
  background: linear-gradient(180deg, #FFF0F5 0%, #FDE2EC 30%, #E8C8E0 70%, #C8A8D8 100%);
  background-image: url('/images/adventure/water-surface.png?v=2');
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  padding: 0;
}

/* 河面场景 */
.river-scene {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: url('/images/adventure/water-surface.png?v=2') center/cover no-repeat;
  background-color: #FDE2EC;
}

/* ===== 进度角标 ===== */
.river-progress-badge {
  position: absolute; top: 10px; right: 14px;
  background: rgba(255,255,255,0.9);
  padding: 4px 12px; border-radius: 10px;
  font-weight: 800; font-size: 0.8em; color: #5D4E6D;
  z-index: 15;
}

.river-exit-btn {
  position: absolute; top: 10px; left: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,0.9);
  color: #5D4E6D; font-size: 16px; font-weight: 800;
  line-height: 1; padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 15;
  touch-action: manipulation;
}

/* ===== 大字显示区（上部） ===== */
.river-char-display {
  position: absolute;
  top: 30px;
  left: 0; right: 0;
  text-align: center;
  font-size: 56px;
  font-weight: 900;
  color: #3D2E5C;
  text-shadow: 0 2px 12px rgba(255,255,255,0.6), 0 0 30px rgba(255,200,240,0.4);
  animation: charFloat 3s ease-in-out infinite;
  z-index: 5;
}
@keyframes charFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 文字区域半透明蒙版，减少背景干扰 */
.river-text-mask {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 280px;
  background: rgba(255,240,245,0.75);
  z-index: 3;
  pointer-events: none;
}

/* ===== 石板路（中下部，水面位置） ===== */
.river-stone-path {
  position: absolute;
  top: 55%;
  left: 32px;
  right: 32px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  background: rgba(255,255,255,0.06);
  border-radius: 35px;
  padding: 0 8px;
}
.path-stone {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: url('/images/adventure/stone-magic.png?v=2') center/cover;
  border: 2px solid rgba(255,220,255,0.35);
  transition: all 0.3s ease;
  position: relative;
  z-index: 11;
  opacity: 0.55;
}
.path-stone.done {
  background: url('/images/adventure/stone-magic.png?v=2') center/cover;
  border-color: #FFD700;
  box-shadow: 0 0 18px rgba(255,215,0,0.9);
  opacity: 1;
  filter: brightness(1.3) saturate(1.2);
}
.path-stone.active {
  background: url('/images/adventure/stone-magic.png?v=2') center/cover;
  border-color: #FFB0D0;
  box-shadow: 0 0 22px rgba(255,150,200,0.9);
  transform: scale(1.2);
  opacity: 1;
  filter: brightness(1.15) saturate(1.15);
}

/* 鸭子骑在石头上 */
.river-duck-rider {
  position: absolute;
  top: calc(55% - 100px);
  pointer-events: none;
  z-index: 20;
  transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 12px rgba(180,120,200,0.5));
}
.river-duck-rider img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
}

/* 鸭子过河跳跃 */
.river-duck-hop {
  animation: duckHopForward 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes duckHopForward {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-36px) scale(1.15); }
  60% { transform: translateY(-20px) scale(1.08); }
  100% { transform: translateY(0) scale(1); }
}

/* 答案石头区域（上部，大字下方） */
.river-stones {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 24px;
  width: 100%;
  max-width: 400px;
  z-index: 5;
}

/* 石头按钮 */
.stone-btn {
  width: 100%;
  padding: 20px 16px;
  border: none;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #C8B8E8 0%, #A898D0 40%, #8B78B8 100%);
  color: white;
  font-size: 1.15em;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  box-shadow: 
    0 6px 0 #6B58A0,
    0 8px 18px rgba(100,60,160,0.3),
    inset 0 2px 8px rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  letter-spacing: 2px;
}
.stone-btn:nth-child(odd) {
  background: linear-gradient(180deg, #FFC8D8 0%, #F0A8BC 40%, #E890A8 100%);
  box-shadow: 
    0 6px 0 #C06080,
    0 8px 18px rgba(200,80,120,0.3),
    inset 0 2px 8px rgba(255,255,255,0.35);
}

.stone-btn:active {
  transform: translateY(3px);
  box-shadow: 
    0 3px 0 #5B4890,
    0 4px 10px rgba(80,40,140,0.25);
}

/* 正确：金光 */
.stone-btn.correct {
  background: linear-gradient(180deg, #FFE66D 0%, #FFD93D 40%, #F0C000 100%) !important;
  box-shadow: 0 0 30px rgba(255,215,0,0.8), 0 8px 0 #B8960F !important;
  animation: stoneGlow 0.6s ease;
}
@keyframes stoneGlow {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 错误：碎裂 */
.stone-btn.wrong {
  animation: stoneCrack 0.6s ease forwards;
}
@keyframes stoneCrack {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.1); }
  60% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(0.5) translateY(20px); opacity: 0; background: #999 !important; box-shadow: none !important; }
}

/* 鸭子跳动画 */
.river-duck-jump {
  animation: duckJump 0.5s ease;
}
@keyframes duckJump {
  0% { transform: translateY(0); }
  40% { transform: translateY(-40px) scale(1.2); }
  60% { transform: translateY(-30px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

/* 水波 */
.river-waves {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(180deg, 
    rgba(140,120,200,0.25) 0%, 
    rgba(120,100,180,0.5) 40%,
    rgba(80,50,140,0.75) 100%);
  animation: waveMove 3s ease-in-out infinite;
}
@keyframes waveMove {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 提示文字 */
.river-prompt {
  position: absolute; top: 160px;
  text-align: center; width: 100%;
  color: rgba(255,255,255,0.9);
  font-weight: 700; font-size: 1em;
  z-index: 5;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
  .river-char-display { font-size: 40px; top: 20px; }
  .river-stones { top: 90px; max-width: 340px; }
  .river-stone-path { top: 55%; left: 16px; right: 16px; height: 55px; }
  .path-stone { width: 28px; height: 28px; }
  .river-duck-rider { font-size: 30px; top: -36px; }
  .stone-btn { padding: 16px 10px; font-size: 0.95em; }
}

/* ==================== 星光皮肤（游戏统一皮肤 · 第一层，2026-07-24） ==================== */
/* 萌可魔法少女风：粉紫金、圆润、星光。作用于 #game/#result 屏；过河场景自带水面背景会盖住它，互不打架 */

/* 1. 梦境渐变底 */
.story-skin {
  position: relative;
  background: linear-gradient(160deg, #FFF0F6 0%, #F6E9FF 45%, #EAF1FF 100%);
}

/* 2. 星星光斑（纯 CSS，无图片，呼吸闪烁） */
.story-skin::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image:
    radial-gradient(3px 3px at 12% 18%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 28% 62%, rgba(255,215,240,0.9), transparent),
    radial-gradient(2.5px 2.5px at 52% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 68% 45%, rgba(230,210,255,0.9), transparent),
    radial-gradient(3px 3px at 85% 25%, rgba(255,244,200,0.95), transparent),
    radial-gradient(2px 2px at 90% 78%, rgba(255,255,255,0.85), transparent),
    radial-gradient(2.5px 2.5px at 40% 88%, rgba(255,228,245,0.9), transparent),
    radial-gradient(2px 2px at 8% 82%, rgba(230,210,255,0.85), transparent);
  animation: skinTwinkle 3.2s ease-in-out infinite;
}
@keyframes skinTwinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* 3. 统一选项按钮：魔法石圆润风（对齐过河 stone-btn 的气质） */
.story-skin .option-btn {
  border-radius: 22px;
  border: 2.5px solid #D9B8F0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FDF3FF 100%);
  box-shadow: 0 4px 14px rgba(180,140,220,0.18);
}
.story-skin .option-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFB7C5, #FF9EB0);
  border-color: transparent;
  color: var(--white);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(255,158,176,0.35);
}

/* 连一连卡片 / 找朋友按钮 / 拼音键盘键：统一圆润 */
.story-skin .match-card,
.story-skin .wordbuild-option-btn {
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(180,140,220,0.15);
}
.story-skin .kb-key { border-radius: 14px; }

/* 4. 大字卡片更柔和 */
.story-skin .char-display {
  border-radius: 26px;
  border: 3px solid #E8C9F5;
  box-shadow: 0 8px 24px rgba(200,160,230,0.22);
}

/* 5. 鸭鸭陪伴（答对跳、答错摇头，由 playSound 统一触发） */
.game-duck-buddy {
  position: fixed;
  left: 14px;
  bottom: 14px;
  width: 72px;
  height: 72px;
  pointer-events: none;
  z-index: 50;
  filter: drop-shadow(0 4px 8px rgba(150,110,190,0.35));
}
.game-duck-buddy img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.game-duck-buddy.duck-hop { animation: duckBuddyHop 0.6s ease; }
.game-duck-buddy.duck-shake { animation: duckBuddyShake 0.5s ease; }
@keyframes duckBuddyHop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-26px) rotate(-6deg); }
  70% { transform: translateY(0) scale(1.05); }
}
@keyframes duckBuddyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* ==================== 小福袋（预习册专属·局末随机掉落） ==================== */
.lucky-bag {
  position: fixed;
  right: 18px;
  bottom: 110px;
  z-index: 1200;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  animation: luckyBagFloat 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(220, 60, 60, 0.4));
}
.lucky-bag-icon {
  font-size: 52px; line-height: 1;
  animation: luckyBagGlow 1.2s ease-in-out infinite;
}
.lucky-bag-tip {
  margin-top: 4px;
  font-size: 0.72em; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #FF5B5B, #E8383F);
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(232, 56, 63, 0.4);
}
@keyframes luckyBagFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes luckyBagGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* 福袋庆祝弹层 */
.lucky-bag-toast {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60, 30, 80, 0.35);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.lucky-bag-toast.show { opacity: 1; }
.lucky-bag-toast-inner {
  background: linear-gradient(135deg, #FFF3D6, #FFE1E6);
  border: 3px solid #FFB830;
  border-radius: 24px;
  padding: 28px 40px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(200, 80, 80, 0.35);
  transform: scale(0.7); transition: transform 0.3s;
}
.lucky-bag-toast.show .lucky-bag-toast-inner { transform: scale(1); }
.lucky-bag-toast-icon { font-size: 56px; line-height: 1; }
.lucky-bag-toast-title {
  font-size: 1.3em; font-weight: 800; color: #D2364A; margin-top: 8px;
}
.lucky-bag-toast-amount {
  font-size: 1.8em; font-weight: 800; color: #E8A010; margin-top: 6px;
}
