/* =========================================================
   音标奇趣岛 - 移动端优先儿童互动绘本风格样式表
   ========================================================= */
:root {
  --bg: #fffbf4;
  --surface: #ffffff;
  --surface-soft: #fff5e8;
  --text: #272343;
  --text-muted: #6b6885;
  --border: #efe6d8;

  --primary: #ff7a59;
  --primary-dark: #e65c3a;
  --secondary: #2cb67d;
  --secondary-dark: #1f9966;
  --accent: #6c63ff;
  --accent-soft: #f0eeff;
  --sky: #0096c7;
  --gold: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 12px rgba(39, 35, 67, 0.06);
  --shadow-md: 0 8px 24px rgba(39, 35, 67, 0.09);

  --nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #fff0dd 0%, var(--bg) 48%, #f2f9ff 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  min-height: 100%;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

button:active {
  transform: scale(0.96);
}

.hidden {
  display: none !important;
}

/* 主应用容器：手机端全宽，桌面端模拟精致平板竖屏 */
.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 顶部状态栏 */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 251, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff9966, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(255, 122, 89, 0.3);
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff3d6;
  color: #b45309;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 0 rgba(245, 158, 11, 0.25);
  min-height: 36px;
}

.pill-stat.pill-green {
  background: #e3f9ef;
  color: #166534;
  box-shadow: 0 2px 0 rgba(44, 182, 125, 0.22);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.speech-banner {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  border: 1px solid #fde68a;
}

/* 主视图内容区 */
.main-content {
  flex: 1;
  padding: 12px 14px calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

.view {
  display: none;
  animation: fadeSlideUp 0.24s ease;
}

.view.active {
  display: block;
}

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

/* 音标岛顶部引导条 */
.hero-tip {
  background: linear-gradient(135deg, #fff4eb 0%, #f4f1ff 100%);
  border: 1px solid #f5dfd1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.hero-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-tip p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

/* 横向滑动标签栏 */
.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.28);
}

.chip.chip-mistake.active {
  background: var(--danger);
  border-color: var(--danger);
}

.category-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 2px 10px;
}

/* 音标网格卡片 */
.ipa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 440px) {
  .ipa-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ipa-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 8px 10px;
  border: 2px solid var(--border);
  box-shadow: 0 4px 0 rgba(39, 35, 67, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.14s ease, border-color 0.18s ease;
  min-height: 112px;
}

.ipa-card:hover {
  transform: translateY(-2px);
}

.ipa-card.mastered {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.ipa-card.mistake-flag {
  border-color: #fca5a5;
}

.ipa-card-badge {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 13px;
}

.ipa-card-symbol {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  color: var(--card-accent, var(--primary));
}

.ipa-card-emoji {
  font-size: 20px;
  margin-bottom: 2px;
}

.ipa-card-word {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.ipa-card-zh {
  font-size: 11px;
  color: var(--text-muted);
}

.hl-letter {
  color: var(--primary-dark);
  background: #ffe6dc;
  border-radius: 4px;
  padding: 0 2px;
  font-weight: 900;
}

/* 通用游戏卡片与顶栏 */
.game-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.game-header-bar .chip-scroll {
  flex: 1;
  padding-bottom: 2px;
}

.combo-pill {
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff0e6;
  color: #c2410c;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #fed7aa;
}

.combo-pill.combo-blue {
  background: var(--accent-soft);
  color: #4f46e5;
  border-color: #d8d4ff;
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* ============ 听音捉精灵 ============ */
.stage-prompt-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.prompt-emoji {
  font-size: 40px;
  line-height: 1;
}

.prompt-zh {
  font-size: 19px;
  font-weight: 800;
}

.prompt-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.audio-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.big-play-btn {
  flex: 1;
  min-height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff8f6b, var(--primary));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 5px 0 var(--primary-dark);
}

.big-play-btn.playing {
  animation: pulseRing 0.8s ease infinite;
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 5px 0 var(--primary-dark), 0 0 0 0 rgba(255, 122, 89, 0.5);
  }
  70% {
    box-shadow: 0 5px 0 var(--primary-dark), 0 0 0 12px rgba(255, 122, 89, 0);
  }
  100% {
    box-shadow: 0 5px 0 var(--primary-dark), 0 0 0 0 rgba(255, 122, 89, 0);
  }
}

.sub-play-btn {
  padding: 0 14px;
  min-height: 56px;
  border-radius: var(--radius-md);
  background: #f3f4ff;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  border: 1.5px solid #dad6ff;
}

.catch-word-preview {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 14px;
  color: var(--text);
}

.catch-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.option-bubble {
  min-height: 82px;
  border-radius: var(--radius-md);
  background: #fffdf9;
  border: 2.5px solid var(--border);
  box-shadow: 0 4px 0 var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  transition: all 0.16s ease;
}

.option-bubble .opt-sym {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
}

.option-bubble .opt-nick {
  font-size: 11px;
  color: var(--text-muted);
}

.option-bubble.correct {
  background: #dcfce7;
  border-color: var(--secondary);
  box-shadow: 0 4px 0 var(--secondary-dark);
  animation: popBounce 0.35s ease;
}

.option-bubble.wrong {
  background: #fee2e2;
  border-color: var(--danger);
  animation: shakeX 0.35s ease;
}

@keyframes popBounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

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

/* ============ 音标拼词工坊 ============ */
.spell-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f3f1ff 0%, #eef9ff 100%);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.spell-emoji-wrap {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: var(--shadow-sm);
}

.spell-meta {
  flex: 1;
}

.spell-zh {
  font-size: 21px;
  font-weight: 900;
}

.spell-ipa {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}

.round-sound-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c74ff, var(--accent));
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.32);
  flex-shrink: 0;
}

.spell-guide {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.spell-slots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.spell-slot {
  min-width: 78px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: #fafafa;
  border: 2.5px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.16s ease;
}

.spell-slot.active-next {
  border-color: var(--accent);
  background: #f5f3ff;
}

.spell-slot.filled {
  border-style: solid;
  border-color: var(--accent);
  background: #ede9fe;
}

.spell-slot.correct {
  border-color: var(--secondary);
  background: #dcfce7;
}

.spell-slot.wrong {
  border-color: var(--danger);
  background: #fee2e2;
  animation: shakeX 0.35s ease;
}

.slot-phoneme {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.slot-letters {
  font-size: 24px;
  font-weight: 900;
  min-height: 32px;
  color: var(--text);
}

.spell-tiles {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.letter-tile {
  min-width: 68px;
  min-height: 58px;
  padding: 8px 16px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 0 #d97706;
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.letter-tile.used {
  opacity: 0.28;
  pointer-events: none;
  box-shadow: none;
  transform: translateY(3px);
}

.spell-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.spell-actions-row > button {
  flex: 1;
}

/* ============ 记忆翻翻乐 ============ */
.memory-stats {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.memory-stats strong {
  color: var(--text);
}

.memory-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mem-card {
  aspect-ratio: 0.88;
  perspective: 800px;
}

.mem-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.mem-card.flipped .mem-card-inner,
.mem-card.matched .mem-card-inner {
  transform: rotateY(180deg);
}

.mem-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
}

.mem-back {
  background: linear-gradient(135deg, #6c63ff, #4895ef);
  color: #fff;
  font-size: 28px;
  box-shadow: 0 4px 0 #4f46e5;
}

.mem-front {
  transform: rotateY(180deg);
  background: #fff;
  border: 2.5px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.mem-card.matched .mem-front {
  border-color: var(--secondary);
  background: #ecfdf5;
}

.mem-type-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.mem-type-ipa {
  background: #f1efff;
  color: var(--accent);
}

.mem-type-word {
  background: #fff1ec;
  color: var(--primary-dark);
}

.mem-ipa-sym {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent);
}

.mem-word-text {
  font-size: 17px;
  font-weight: 900;
}

.mem-word-zh {
  font-size: 11px;
  color: var(--text-muted);
}

.victory-banner {
  margin-top: 16px;
  padding: 18px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ecfdf5 0%, #fef9c3 100%);
  border: 2px solid #86efac;
  text-align: center;
}

.victory-emoji {
  font-size: 42px;
}

.victory-banner h3 {
  margin: 4px 0;
  font-size: 18px;
}

.victory-banner p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ 通用按钮与反馈 ============ */
.primary-btn {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #34d399, var(--secondary));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--secondary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary-btn.mastered-on {
  background: linear-gradient(135deg, #fbbf24, var(--gold));
  box-shadow: 0 4px 0 #b45309;
}

.ghost-btn {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.full-btn {
  width: 100%;
}

.feedback-box {
  margin: 14px 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
}

.feedback-box.ok {
  background: #dcfce7;
  color: #166534;
  border: 1.5px solid #86efac;
}

.feedback-box.err {
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fecaca;
}

/* ============ 底部手机导航栏 ============ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  position: relative;
}

.nav-icon {
  font-size: 22px;
  transition: transform 0.18s ease;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  transform: scale(1.18) translateY(-1px);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 34px;
  height: 3.5px;
  border-radius: 0 0 6px 6px;
  background: var(--primary);
}

/* ============ 底部抽屉弹窗（手机极佳单手体验） ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 44, 0.48);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 12px 18px calc(22px + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.14);
  animation: sheetUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 0 auto 12px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
}

.sheet-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 900;
}

/* 音标详情弹窗内容 */
.ipa-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 36px;
}

.ipa-hero-symbol {
  min-width: 72px;
  height: 72px;
  padding: 0 10px;
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 32px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ipa-hero-info {
  flex: 1;
}

.ipa-hero-info h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 900;
}

.ipa-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1ec;
  color: var(--primary-dark);
}

.tag-voice {
  background: #eef2ff;
  color: #4338ca;
}

.mouth-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.mouth-svg-box {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mouth-chant {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.mouth-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pair-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
}

.pair-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.rules-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.rule-word-btn {
  background: #fffdf9;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 3px 0 var(--border);
}

.rule-letter-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffe6dc;
  color: var(--primary-dark);
}

.rule-word-text {
  font-size: 16px;
  font-weight: 900;
}

.rule-word-zh {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-footer-btns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

/* 勋章与进度弹窗 */
.progress-summary-card {
  background: linear-gradient(135deg, #fff5eb 0%, #f0f9ff 100%);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.35s ease;
}

.summary-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.summary-mini-item {
  background: #fff;
  border-radius: 12px;
  padding: 8px 4px;
}

.mini-num {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.mini-label {
  font-size: 11px;
  color: var(--text-muted);
}

.sub-heading {
  margin: 0 0 10px;
  font-size: 15px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.badge-card {
  border-radius: 16px;
  padding: 12px 10px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  text-align: center;
  opacity: 0.58;
}

.badge-card.unlocked {
  opacity: 1;
  background: linear-gradient(135deg, #fffbeb 0%, #ecfdf5 100%);
  border-color: #fcd34d;
}

.badge-emoji {
  font-size: 32px;
  margin-bottom: 4px;
}

.badge-name {
  font-size: 13px;
  font-weight: 800;
}

.badge-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* 设置弹窗 */
.setting-group {
  margin-bottom: 16px;
}

.setting-label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}

.setting-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segmented-control {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
}

.seg-btn {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.seg-btn.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.toggle-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 13px;
}

.toggle-pill.on {
  background: var(--secondary);
  color: #fff;
}

.setting-danger {
  text-align: center;
  padding-top: 6px;
}

.danger-link {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

/* Toast 与撒花庆祝层 */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(39, 35, 67, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  animation: confettiFall 1.1s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(82vh) rotate(540deg);
    opacity: 0;
  }
}
