/* ============================================================
   拼音小课堂 - 卡通可爱风样式表
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #FF8C42;
  --primary-light: #FFB380;
  --secondary: #5BC0EB;
  --secondary-light: #A3D9F5;
  --green: #9BC53D;
  --green-light: #C5E07A;
  --pink: #FF6B6B;
  --pink-light: #FFA3A3;
  --purple: #A78BFA;
  --purple-light: #C4B5FD;
  --bg: #FFF8F0;
  --card-bg: #FFFFFF;
  --text: #4A3728;
  --text-light: #8B7355;
  --text-muted: #B8A898;
  --border: #F0E6D8;
  --shadow: 0 4px 16px rgba(74, 55, 40, 0.08);
  --shadow-lg: 0 8px 32px rgba(74, 55, 40, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font-main: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Global ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 应用容器 ---------- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶部导航 ---------- */
.app-header {
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 16px;
}

.app-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
}

.app-logo .logo-icon {
  font-size: 1.5rem;
}

.app-nav {
  display: flex;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
}

.nav-item:hover {
  background: #FFF5ED;
  color: var(--primary);
}

.nav-item.active {
  background: #FFF0E6;
  color: var(--primary);
  font-weight: 700;
}

.nav-item .nav-icon {
  font-size: 1.1rem;
}

/* ---------- 内容区 ---------- */
.app-content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ---------- 页脚 ---------- */
.app-footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ==================== 首页 ==================== */
.hero-section {
  text-align: center;
  padding: 32px 0 24px;
}

.mascot {
  font-size: 80px;
  animation: float 3s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
}

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

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 8px 0 4px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-badge {
  background: white;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  font-size: 1.1rem;
}

/* 导航卡片 */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.nav-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-color, var(--primary));
}

.nav-card-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.nav-card h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: var(--text);
}

.nav-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ==================== 通用页面元素 ==================== */
.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* ---------- 按钮 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.btn-primary:hover {
  background: #E67A35;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
}

.btn-primary:disabled {
  background: #CCC;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 50px;
  border: 2px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  background: white;
  color: var(--text-light);
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- 扬声器按钮 ---------- */
.btn-speaker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--secondary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  background: var(--secondary-light);
  color: #1a7a9b;
  transition: var(--transition);
}

.btn-speaker:hover {
  background: var(--secondary);
  color: white;
}

.btn-speaker-lg {
  padding: 16px 36px;
  font-size: 1.15rem;
}

.btn-speaker-lg .speaker-icon {
  font-size: 1.5rem;
}

/* ==================== 拼音字母表 ==================== */
.alphabet-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.alpha-tab {
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  background: white;
  color: var(--text-light);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alpha-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.alpha-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.alpha-tab small {
  font-weight: 400;
  opacity: 0.8;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.pinyin-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px 8px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  user-select: none;
  position: relative;
}

.pinyin-card:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.pinyin-card.learned {
  border-color: var(--green);
  background: #F7FDF3;
}

.pinyin-char {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.pinyin-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pinyin-check {
  margin-top: 4px;
  font-size: 1.2rem;
}

.pinyin-card.bouncing {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
}

/* ==================== 声调练习 ==================== */
.tone-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.tone-accuracy, .tone-streak {
  font-size: 0.9rem;
  color: var(--text-light);
}

.tone-accuracy strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.tone-question-area {
  text-align: center;
  padding: 28px 0 20px;
}

.tone-hint {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.tone-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.btn-tone-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  font-family: var(--font-main);
  cursor: pointer;
  background: white;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.btn-tone-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-tone-option .tone-char {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

.btn-tone-option .tone-name {
  font-size: 0.85rem;
  color: var(--text-light);
}

.btn-tone-option .tone-mark {
  font-size: 1.2rem;
  color: var(--primary);
}

.btn-tone-option.correct {
  border-color: var(--green);
  background: #F0F9E0;
  animation: correctPulse 0.6s ease;
}

.btn-tone-option.wrong {
  border-color: var(--pink);
  background: #FFF0F0;
  animation: shake 0.5s ease;
}

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

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

/* ==================== 拼读练习 ==================== */
.spell-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.spell-column h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-light);
  text-align: center;
}

.spell-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn-spell-item {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  border: 2px solid var(--border);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  background: white;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-spell-item:hover {
  border-color: var(--primary);
  background: #FFF5ED;
}

.btn-spell-item.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.spell-result-area {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.spell-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 2.5rem;
  font-weight: 800;
}

.spell-selected {
  color: var(--text-muted);
  min-width: 48px;
  transition: var(--transition);
}

.spell-selected.filled {
  color: var(--primary);
}

.spell-plus, .spell-equals {
  color: var(--text-muted);
  font-size: 1.5rem;
}

.spell-output {
  min-width: 80px;
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 2.5rem;
}

.spell-output.ready {
  color: var(--secondary);
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.spell-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.spell-history {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.spell-history h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-light);
}

.spell-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  background: #FFF5ED;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.history-item:hover {
  background: var(--primary-light);
  color: white;
}

.hi-initial { color: var(--primary); }
.hi-final { color: var(--secondary); }
.hi-result { color: var(--text); font-weight: 700; }
.hi-speak { font-size: 0.8rem; }

/* ==================== 游戏页面 ==================== */

/* 游戏菜单 */
.games-menu {
  text-align: center;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.game-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  text-align: center;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.game-card-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.game-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.game-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.game-card-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  background: #FFF5ED;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}

/* 游戏公用 */
.game-container {
  max-width: 600px;
  margin: 0 auto;
}

.game-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.game-level {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.game-score {
  font-weight: 700;
  font-size: 0.95rem;
}

.game-lives {
  font-size: 0.9rem;
}

.game-progress-bar {
  width: 100%;
  height: 6px;
  background: #F0E6D8;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.game-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.game-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 听音区 */
.listen-area {
  text-align: center;
  padding: 24px 0;
}

.listen-hint {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* 拼读题目 */
.spell-question {
  text-align: center;
  padding: 24px 0;
}

.spell-parts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 2.5rem;
  font-weight: 800;
}

.spell-initial { color: var(--primary); }
.spell-final { color: var(--secondary); }
.spell-plus, .spell-equals { color: var(--text-muted); font-size: 1.5rem; }

/* 选项网格 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.btn-option {
  padding: 18px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: var(--text);
  transition: var(--transition);
  box-shadow: var(--shadow);
  text-align: center;
}

.btn-option:hover {
  border-color: var(--primary);
  background: #FFF5ED;
  transform: translateY(-2px);
}

.btn-option.correct {
  border-color: var(--green);
  background: #F0F9E0;
  color: #3D6B00;
}

.btn-option.wrong {
  border-color: var(--pink);
  background: #FFF0F0;
  color: #C0392B;
}

.option-char {
  display: block;
}

/* 连连看 */
.match-hint {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.match-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn-match-item {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: var(--text);
  transition: var(--transition);
  text-align: center;
}

.btn-match-item:hover {
  border-color: var(--primary);
  background: #FFF5ED;
}

.btn-match-item.selected {
  border-color: var(--primary);
  background: #FFF0E6;
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.2);
}

.btn-match-item.matched {
  border-color: var(--green);
  background: #F0F9E0;
  opacity: 0.7;
  cursor: default;
}

.btn-match-item.correct {
  animation: correctPulse 0.5s ease;
}

.btn-match-item.wrong {
  animation: shake 0.4s ease;
  border-color: var(--pink);
  background: #FFF0F0;
}

/* 游戏结果 */
.game-result {
  text-align: center;
  padding: 32px 20px;
}

.result-stars {
  font-size: 2.5rem;
  margin-bottom: 12px;
  animation: popIn 0.6s ease;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-score {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 12px;
}

.result-stats p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.btn-restart {
  margin-top: 20px;
  font-size: 1.1rem;
}

/* ==================== 学习进度 ==================== */
.progress-overview {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  justify-content: center;
}

.progress-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) calc(var(--percent, 0) * 3.6deg),
    #F0E6D8 calc(var(--percent, 0) * 3.6deg)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: white;
  border-radius: 50%;
}

.progress-number {
  position: relative;
  z-index: 1;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.progress-label {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-light);
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: #FFF8F0;
  border-radius: var(--radius-sm);
}

.ps-icon { font-size: 1.5rem; margin-bottom: 4px; }
.ps-value { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.ps-label { font-size: 0.75rem; color: var(--text-light); }

/* 进度条 */
.progress-bars {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.progress-bars h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.progress-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pbi-label {
  width: 100px;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.pbi-track {
  flex: 1;
  height: 10px;
  background: #F0E6D8;
  border-radius: 5px;
  overflow: hidden;
}

.pbi-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}

.pbi-value {
  font-size: 0.85rem;
  font-weight: 700;
  width: 45px;
  text-align: right;
}

/* 成就 */
.achievements-section {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.achievements-section h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  text-align: center;
  transition: var(--transition);
}

.achievement-badge.unlocked {
  border-color: #FFD700;
  background: #FFFDE7;
}

.achievement-badge.locked {
  opacity: 0.5;
}

.ach-icon { font-size: 1.8rem; }
.ach-name { font-size: 0.85rem; font-weight: 700; }
.ach-desc { font-size: 0.7rem; color: var(--text-light); }
.ach-status { font-size: 1rem; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .mascot { font-size: 60px; }

  .nav-cards {
    grid-template-columns: 1fr 1fr;
  }

  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .pinyin-char { font-size: 1.5rem; }

  .spell-selector {
    grid-template-columns: 1fr;
  }

  .tone-options {
    grid-template-columns: 1fr 1fr;
  }

  .options-grid {
    grid-template-columns: 1fr 1fr;
  }

  .progress-overview {
    flex-direction: column;
  }

  .game-cards {
    grid-template-columns: 1fr;
  }

  .nav-item {
    padding: 4px 8px;
    font-size: 0.8rem;
  }

  .nav-item .nav-label {
    display: none;
  }

  .btn-spell-item {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-cards {
    grid-template-columns: 1fr;
  }

  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
  }

  .pinyin-card {
    padding: 12px 4px 8px;
  }

  .spell-display {
    font-size: 2rem;
  }
}

/* ==================== 辅助动画 ==================== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
