/* ============================================================
 * 幼小衔接工作台 - 样式表
 * 儿童友好风格：明亮色彩 / 大圆角 / 卡通元素 / 灵动动画
 * ============================================================ */

:root {
  --primary: #FF9F43;
  --primary-dark: #F76C1B;
  --secondary: #4CAF9C;
  --accent: #4FC3F7;
  --pink: #FF6B9D;
  --purple: #9B7EDE;
  --yellow: #FFD93D;
  --green: #6BCB77;
  --red: #FF6B6B;
  --cream: #FFF9F0;
  --text: #4A3F35;
  --text-light: #8D7B6A;
  --shadow: 0 8px 24px rgba(255, 159, 67, .18);
  --shadow-soft: 0 4px 14px rgba(74, 63, 53, .10);
  --radius: 20px;
  --sidebar-w: 176px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #FFF6E9 0%, #E8F7FF 55%, #EAF9EF 100%);
  overflow: hidden;
}

/* ---------- 背景装饰 ---------- */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-decor .cloud {
  position: absolute; font-size: 60px; opacity: .5; animation: drift 40s linear infinite;
}
.cloud.c1 { top: 8%; left: -80px; animation-duration: 55s; }
.cloud.c2 { top: 30%; left: 20%; font-size: 44px; opacity: .35; animation-duration: 70s; animation-delay: -20s; }
.cloud.c3 { top: 65%; left: 65%; font-size: 52px; opacity: .4; animation-duration: 60s; animation-delay: -10s; }
@keyframes drift {
  from { transform: translateX(-10vw); } to { transform: translateX(110vw); }
}
.bg-decor .sun {
  position: absolute; top: 5%; right: 5%; font-size: 64px;
  animation: spin 30s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.bg-decor .balloon { position: absolute; font-size: 36px; opacity: .5; animation: floatY 6s ease-in-out infinite; }
.balloon.b1 { bottom: 18%; left: 4%; animation-delay: 0s; }
.balloon.b2 { bottom: 28%; right: 3%; font-size: 30px; animation-delay: 2s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); }
}

/* ---------- 应用框架 ---------- */
.app-shell {
  position: relative; z-index: 1;
  display: flex; height: 100vh; max-width: 1440px; margin: 0 auto;
}

/* ===== 左侧导航栏 ===== */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, #FFE3B3 0%, #FFD6A5 100%);
  border-right: 3px solid rgba(255,255,255,.6);
  display: flex; flex-direction: column;
  box-shadow: 6px 0 18px rgba(247, 108, 27, .10);
}
.side-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 14px 14px;
}
.logo-badge { font-size: 34px; animation: wiggle 3s ease-in-out infinite; display: inline-block; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); }
}
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text strong { font-size: 17px; color: var(--primary-dark); letter-spacing: 1px; }
.logo-text small { font-size: 11px; color: var(--text-light); }

.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 10px; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 12px; margin-bottom: 6px;
  border: none; border-radius: 14px;
  background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
  transition: all .2s ease; text-align: left;
}
.nav-item .nav-icon { font-size: 22px; transition: transform .2s; }
.nav-item:hover { background: rgba(255,255,255,.55); transform: translateX(3px); }
.nav-item:hover .nav-icon { transform: scale(1.15); }
.nav-item.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(247, 108, 27, .22);
  transform: translateX(3px);
}
.nav-item.active .nav-icon { animation: bounce 0.5s ease; }
@keyframes bounce {
  0%,100% { transform: translateY(0); } 40% { transform: translateY(-5px); }
}

.side-mascot {
  padding: 12px 14px; font-size: 30px; text-align: center;
  animation: floatY 4s ease-in-out infinite;
}
.side-mascot small { display: block; font-size: 11px; color: var(--text-light); font-weight: 400; }

/* ===== 主区域 ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 8px; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-title { font-size: 22px; color: var(--primary-dark); white-space: nowrap; }
.day-badge {
  background: var(--primary); color: #fff;
  padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(255, 159, 67, .4);
  animation: popIn .4s ease;
}
@keyframes popIn {
  0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; }
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.sound-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--accent); background: #fff;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.sound-btn:hover { transform: scale(1.1); }
.sound-btn.off { filter: grayscale(1); opacity: .55; }
.points-chip {
  background: linear-gradient(135deg, #FFD93D, #FFB03A);
  color: #6B4E00; font-weight: 800;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(255, 176, 58, .4);
  font-size: 14px;
}
.points-chip.bump { animation: bump .4s ease; }
@keyframes bump {
  0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); }
}

/* ===== 学习进度控制条 ===== */
.progress-bar-area {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 20px 10px; flex-shrink: 0;
}
.progress-nav {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #fff; cursor: pointer;
  font-size: 14px; color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
  transition: all .2s; flex-shrink: 0;
}
.progress-nav:hover { background: var(--primary); color: #fff; transform: scale(1.1); }
.progress-wrap { flex: 1; min-width: 0; }
.progress-info {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.progress-label { font-size: 13px; font-weight: 800; color: var(--primary-dark); }
.progress-date { font-size: 12px; color: var(--text-light); }
.progress-track {
  position: relative; height: 14px;
  background: rgba(255,255,255,.85);
  border: 2px solid rgba(255,159,67,.35);
  border-radius: 999px; cursor: pointer;
}
.progress-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 30%; border-radius: 999px;
  background: linear-gradient(90deg, #FFD93D, #FF9F43, #F76C1B);
  transition: width .3s ease;
}
.progress-knob {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transition: left .3s ease; cursor: grab; z-index: 2;
  user-select: none;
}
.progress-knob:active { cursor: grabbing; }
.progress-tip { position: absolute; bottom: -20px; left: 0; font-size: 10px; color: var(--text-light); white-space: nowrap; }

/* ===== 内容区 ===== */
.content {
  flex: 1; overflow-y: auto; padding: 8px 20px 24px;
  scroll-behavior: smooth;
}
.page { animation: pageIn .35s ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; }
}

/* ---------- 通用组件 ---------- */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px; margin-bottom: 16px;
  border: 2px solid rgba(255,255,255,.9);
}
.card-title {
  font-size: 17px; font-weight: 800; color: var(--primary-dark);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.card-title .em { font-size: 22px; }
.section-sub { color: var(--text-light); font-size: 13px; margin-bottom: 14px; }

.btn {
  border: none; border-radius: 14px; cursor: pointer;
  font-weight: 700; font-size: 15px;
  padding: 12px 22px; color: #fff;
  transition: all .2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: scale(.94); }
.btn-primary { background: linear-gradient(135deg, #FF9F43, #F76C1B); }
.btn-green { background: linear-gradient(135deg, #6BCB77, #3FA34D); }
.btn-blue { background: linear-gradient(135deg, #4FC3F7, #2196F3); }
.btn-purple { background: linear-gradient(135deg, #9B7EDE, #7C5CD6); }
.btn-pink { background: linear-gradient(135deg, #FF6B9D, #E94E77); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 17px; border-radius: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #FFF3E0; color: var(--primary-dark);
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}

/* 进度环 */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ring {
  position: relative; width: 110px; height: 110px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ring::before {
  content: ''; position: absolute; inset: 9px;
  background: #fff; border-radius: 50%;
}
.ring .ring-num { position: relative; font-size: 22px; font-weight: 900; color: var(--primary-dark); }
.ring .ring-num small { font-size: 12px; }

/* 任务清单 */
.task-list { list-style: none; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: #FAF7F2; margin-bottom: 10px;
  cursor: pointer; transition: all .2s;
  border: 2px solid transparent;
}
.task-item:hover { border-color: var(--primary); transform: translateX(3px); }
.task-item .task-icon { font-size: 26px; }
.task-item .task-info { flex: 1; min-width: 0; }
.task-item .task-info strong { display: block; font-size: 15px; }
.task-item .task-info small { color: var(--text-light); font-size: 12px; }
.task-item .task-status {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  border: 2px dashed #C9B8A5; color: transparent;
  transition: all .3s;
}
.task-item.done .task-status {
  background: linear-gradient(135deg, #6BCB77, #3FA34D);
  border: none; color: #fff; animation: popIn .3s;
}
.task-item.done .task-info strong { color: #999; text-decoration: line-through; }

/* ---------- 古诗板块 ---------- */
.poem-paper {
  background: linear-gradient(180deg, #FFFDF5 0%, #FFF8E1 100%);
  border: 2px dashed #E8C87A; border-radius: 18px;
  padding: 26px 20px; text-align: center;
  position: relative;
}
.poem-paper::before {
  content: '📜'; position: absolute; top: -16px; left: 50%;
  transform: translateX(-50%); font-size: 32px;
  background: var(--cream); padding: 0 10px; border-radius: 10px;
}
.poem-title { font-size: 24px; font-weight: 900; color: #8B5E2A; }
.poem-author { color: #A88B5A; font-size: 13px; margin: 4px 0 18px; }
.poem-lines { margin: 0 0 8px; }
.poem-line { font-size: 22px; line-height: 2; color: #6B4E00; letter-spacing: 3px; }
.poem-pinyin { font-size: 12px; color: #C9A96E; line-height: 1.6; margin-bottom: 14px; }
.poem-meaning {
  background: rgba(255,217,61,.15); border-radius: 12px;
  padding: 12px; font-size: 13px; color: #8B7355;
  margin-top: 14px; text-align: left; line-height: 1.7;
}
.poem-read-btn {
  margin-top: 14px;
  background: linear-gradient(135deg, #FFD93D, #FF9F43);
  color: #6B4E00;
}

/* ---------- 拼音板块 ---------- */
.pinyin-stage { display: flex; gap: 8px; margin-bottom: 16px; }
.stage-chip {
  flex: 1; text-align: center; padding: 8px 4px;
  border-radius: 12px; font-size: 13px; font-weight: 700;
  background: #F3EEE6; color: var(--text-light);
}
.stage-chip.active {
  background: linear-gradient(135deg, #4FC3F7, #2196F3); color: #fff;
  box-shadow: 0 3px 8px rgba(33,150,243,.35);
}
.pinyin-quiz { text-align: center; }
.pinyin-char-big {
  font-size: 84px; font-weight: 900; color: var(--primary-dark);
  display: inline-block; margin: 6px 0; animation: popIn .3s;
}
.pinyin-parts {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 30px; font-weight: 800; color: var(--secondary); margin: 10px 0;
}
.pinyin-parts .part { background: #E8F5EF; padding: 6px 12px; border-radius: 12px; }
.pinyin-parts .plus { color: #C9B8A5; font-size: 20px; }
.option-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 18px;
}
.option-btn {
  padding: 16px; border-radius: 16px; border: 3px solid #E8E0D5;
  background: #fff; font-size: 26px; font-weight: 800; color: var(--text);
  cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.option-btn small { font-size: 12px; color: var(--text-light); font-weight: 500; }
.option-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.option-btn.correct {
  border-color: var(--green); background: #EAF9EF; animation: popIn .3s;
}
.option-btn.wrong {
  border-color: var(--red); background: #FFECEC; animation: shake .4s;
}
@keyframes shake {
  0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); } 75% { transform: translateX(-4px); }
}
.score-line {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 2px dashed #F0E8DC;
}
.score-num { font-size: 20px; font-weight: 900; color: var(--primary-dark); }

/* ---------- 生字板块 ---------- */
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.char-card {
  background: #fff; border: 3px solid #F0E8DC; border-radius: 16px;
  padding: 14px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all .2s;
}
.char-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.char-card.learned { border-color: var(--green); background: #F2FBF4; }
.char-big {
  font-size: 38px; font-weight: 900; color: var(--primary-dark);
  width: 54px; height: 54px; border-radius: 14px;
  background: #FFF3E0; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.char-info { flex: 1; min-width: 0; }
.char-info strong { font-size: 15px; display: block; }
.char-info small { color: var(--text-light); font-size: 12px; }
.char-check { font-size: 20px; }

/* 认字测试 */
.char-test-word { font-size: 96px; font-weight: 900; color: var(--primary-dark); text-align: center; margin: 10px 0; }

/* ---------- 口算板块 ---------- */
.math-problem {
  font-size: 52px; font-weight: 900; text-align: center;
  color: var(--primary-dark); margin: 12px 0; letter-spacing: 4px;
  animation: popIn .25s;
}
.math-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.math-option {
  padding: 18px; border-radius: 16px; border: 3px solid #E8E0D5;
  background: #fff; font-size: 30px; font-weight: 900; color: var(--text);
  cursor: pointer; transition: all .2s;
}
.math-option:hover { border-color: var(--accent); transform: translateY(-2px); }
.math-option.correct { border-color: var(--green); background: #EAF9EF; animation: popIn .3s; }
.math-option.wrong { border-color: var(--red); background: #FFECEC; animation: shake .4s; }
.math-stats { display: flex; gap: 14px; justify-content: center; margin-top: 14px; }
.math-stat { text-align: center; background: #F8F4EE; padding: 8px 16px; border-radius: 12px; }
.math-stat strong { font-size: 20px; color: var(--primary-dark); display: block; }
.math-stat small { font-size: 11px; color: var(--text-light); }

/* 计时挑战 */
.timer-big { font-size: 48px; font-weight: 900; text-align: center; color: var(--red); font-variant-numeric: tabular-nums; }

/* ---------- 数独板块 ---------- */
.sudoku-meta { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.sudoku-board { margin: 0 auto; background: #fff; border-radius: 16px; padding: 10px; max-width: 400px; box-shadow: var(--shadow-soft); }
.sudoku-row { display: flex; }
.sudoku-cell {
  flex: 1; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--text);
  border: 1px solid #E8E0D5; cursor: pointer; background: #fff;
  transition: background .15s; user-select: none;
}
.sudoku-cell.given { background: #F8F4EE; color: #A58F7A; }
.sudoku-cell.selected { background: #FFF3E0; }
.sudoku-cell.same { background: #E8F5EF; }
.sudoku-cell.correct { color: var(--green); }
.sudoku-cell.wrong { color: var(--red); background: #FFECEC; }
.sudoku-cell:hover { background: #FFF9F0; }
/* 宫格边框 */
.sudoku-board[data-size="4"] .sudoku-cell:nth-child(odd) { border-right: 2px solid var(--primary); }
.sudoku-board[data-size="4"] .sudoku-row:nth-child(odd) { border-bottom: 2px solid var(--primary); }
.sudoku-board[data-size="6"] .sudoku-cell:nth-child(3n) { border-right: 2px solid var(--primary); }
.sudoku-board[data-size="6"] .sudoku-row:nth-child(2n) { border-bottom: 2px solid var(--primary); }
.num-pad { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.num-pad button {
  width: 42px; height: 42px; border-radius: 12px; border: 2px solid #E8E0D5;
  background: #fff; font-size: 19px; font-weight: 800; color: var(--text); cursor: pointer;
  transition: all .15s;
}
.num-pad button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 英语板块 ---------- */
.en-card {
  background: linear-gradient(135deg, #4FC3F7, #2196F3);
  border-radius: 18px; padding: 18px; color: #fff;
  margin-bottom: 12px; box-shadow: 0 6px 16px rgba(33,150,243,.3);
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: all .2s;
}
.en-card:hover { transform: translateY(-2px) scale(1.01); }
.en-card:active { transform: scale(.97); }
.en-index {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.25); display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.en-info { flex: 1; min-width: 0; }
.en-info strong { font-size: 17px; display: block; letter-spacing: .5px; }
.en-info small { font-size: 13px; opacity: .9; }
.en-speak {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: #fff; color: #2196F3; font-size: 19px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.en-speak:hover { transform: scale(1.15); }
.en-speak.playing { animation: pulse .6s infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); } 50% { transform: scale(1.2); }
}
.en-tip { background: #FFF3E0; color: var(--primary-dark); border-radius: 10px; padding: 4px 10px; font-size: 11px; font-weight: 700; }

/* ---------- 专注力 ---------- */
.focus-card { text-align: center; }
.focus-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.focus-action {
  border: 3px solid #E8E0D5; border-radius: 16px; background: #fff;
  padding: 18px 10px; cursor: pointer; transition: all .2s; font-size: 15px; font-weight: 700;
}
.focus-action:hover { border-color: var(--secondary); transform: translateY(-2px); }
.focus-action .fa { font-size: 30px; display: block; margin-bottom: 6px; }
.schulte-grid { display: grid; gap: 8px; margin: 0 auto; max-width: 340px; }
.schulte-cell {
  aspect-ratio: 1; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #4FC3F7, #2196F3);
  color: #fff; font-size: 22px; font-weight: 900; cursor: pointer;
  transition: all .15s;
}
.schulte-cell:hover { transform: scale(1.05); }
.schulte-cell:disabled { background: #D5D0C8; color: transparent; }
.schulte-cell.next { outline: 4px solid #FFD93D; }

/* 找不同 */
.diff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 0 auto; }
.diff-cell {
  aspect-ratio: 1; border-radius: 16px; border: none;
  font-size: 36px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .2s; background: #fff;
  box-shadow: var(--shadow-soft);
}
.diff-cell:hover { transform: scale(1.08); }
.diff-cell.found { background: #EAF9EF; animation: popIn .3s; }
.diff-cell.miss { animation: shake .4s; }

/* 记忆挑战 */
.mem-display {
  font-size: 44px; font-weight: 900; letter-spacing: 10px;
  text-align: center; color: var(--secondary);
  min-height: 70px; display: flex; align-items: center; justify-content: center;
}
.mem-input { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.mem-input button {
  width: 46px; height: 46px; border-radius: 12px; border: 2px solid #E8E0D5;
  background: #fff; font-size: 20px; font-weight: 800; color: var(--text); cursor: pointer;
}
.mem-input button:hover { background: var(--secondary); color: #fff; }

/* 颜色干扰 */
.color-word { font-size: 72px; font-weight: 900; text-align: center; margin: 16px 0; animation: popIn .3s; }
.color-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }
.color-opt {
  padding: 18px; border-radius: 16px; border: 3px solid #E8E0D5;
  font-size: 19px; font-weight: 800; cursor: pointer; background: #fff; transition: all .2s;
}
.color-opt:hover { transform: translateY(-2px); }

/* 左右手游戏 */
.hand-area { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }
.hand-btn {
  width: 110px; height: 110px; border-radius: 50%;
  border: none; font-size: 52px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: var(--shadow-soft);
}
.hand-btn:hover { transform: scale(1.1); }
.hand-btn.left { background: #FFF3E0; }
.hand-btn.right { background: #E8F5EF; }
.hand-btn:active { transform: scale(.9); }
.hand-btn.correct { outline: 5px solid var(--green); }
.hand-btn.wrong { outline: 5px solid var(--red); animation: shake .4s; }
.hand-cmd {
  font-size: 26px; font-weight: 800; color: var(--primary-dark);
  background: #FFF3E0; border-radius: 14px; padding: 14px 20px;
  display: inline-block; animation: popIn .3s;
}

/* ---------- 游戏区 ---------- */
.game-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.game-tile {
  background: #fff; border-radius: 20px; padding: 20px 14px;
  text-align: center; cursor: pointer; border: 3px solid #F0E8DC;
  transition: all .2s;
}
.game-tile:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); }
.game-tile .gt-icon { font-size: 44px; display: block; margin-bottom: 8px; }
.game-tile strong { font-size: 15px; display: block; }
.game-tile small { font-size: 12px; color: var(--text-light); }
.game-tile .best { margin-top: 6px; font-size: 11px; color: var(--primary-dark); font-weight: 700; }

/* 翻牌（对对碰） */
.match-board { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; }
.match-card {
  aspect-ratio: 1; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #FF9F43, #F76C1B);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: #fff;
  position: relative; transition: transform .35s;
  transform-style: preserve-3d; user-select: none;
}
.match-card .m-front, .match-card .m-back {
  position: absolute; inset: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden;
}
.match-card .m-front {
  background: linear-gradient(135deg, #FF9F43, #F76C1B);
  font-size: 30px;
}
.match-card .m-back {
  background: #fff; border: 3px solid #F0E8DC;
  transform: rotateY(180deg);
  flex-direction: column; font-size: 20px; color: var(--text);
}
.match-card .m-back small { font-size: 12px; color: var(--text-light); }
.match-card.flipped { transform: rotateY(180deg); }
.match-card.matched .m-back { background: #EAF9EF; border-color: var(--green); }
.match-card.matched { animation: matchPop .4s; }
@keyframes matchPop {
  0% { transform: rotateY(180deg) scale(1); } 50% { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* 拼拼乐 */
.build-area {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 20px 0; flex-wrap: wrap;
}
.build-part {
  width: 90px; height: 110px; border-radius: 16px;
  border: 3px dashed #C9B8A5; background: #FFFDF5;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 900; color: var(--text);
  cursor: pointer; transition: all .2s;
}
.build-part.filled { border-style: solid; border-color: var(--green); background: #EAF9EF; }
.build-part:hover { transform: scale(1.05); }
.build-eq { font-size: 40px; font-weight: 900; color: var(--primary-dark); }
.build-result {
  width: 100px; height: 120px; border-radius: 16px;
  background: linear-gradient(135deg, #FFD93D, #FF9F43);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 900; color: #fff;
  box-shadow: var(--shadow);
}
.build-candidates { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.build-cand {
  width: 64px; height: 64px; border-radius: 14px;
  border: 2px solid #E8E0D5; background: #fff;
  font-size: 30px; font-weight: 900; cursor: pointer; transition: all .15s;
}
.build-cand:hover { transform: scale(1.1); border-color: var(--secondary); }

/* 古诗填字 */
.poem-blank {
  font-size: 24px; letter-spacing: 2px; line-height: 2.2; text-align: center; color: #6B4E00;
}
.poem-blank .blank {
  display: inline-block; min-width: 34px; height: 40px;
  border-bottom: 3px solid var(--primary); margin: 0 2px;
  vertical-align: bottom; cursor: pointer; position: relative;
  background: #FFF3E0; border-radius: 8px 8px 0 0;
  font-weight: 900; color: var(--primary-dark);
  line-height: 40px;
}
.poem-blank .blank.filled { background: #EAF9EF; border-color: var(--green); }

/* 计时挑战结果 */
.result-emoji { font-size: 64px; text-align: center; margin: 10px 0; animation: bounce .6s; }
.result-title { font-size: 24px; font-weight: 900; text-align: center; color: var(--primary-dark); }
.result-sub { text-align: center; color: var(--text-light); font-size: 14px; margin: 6px 0 16px; }

/* ---------- 打卡积分 ---------- */
.points-hero {
  background: linear-gradient(135deg, #FFD93D, #FF9F43);
  border-radius: 22px; padding: 22px; color: #6B4E00;
  text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.points-hero::after {
  content: '⭐'; position: absolute; font-size: 90px; opacity: .15;
  right: -10px; top: -10px; transform: rotate(20deg);
}
.points-big { font-size: 56px; font-weight: 900; line-height: 1.1; }
.points-big small { font-size: 18px; }
.points-to-reward { font-size: 14px; font-weight: 700; margin-top: 4px; }
.reward-progress { height: 18px; background: rgba(255,255,255,.5); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.reward-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #6BCB77, #3FA34D);
  transition: width .5s ease; position: relative;
}
.reward-fill::after { content: '🎁'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 15px; }

.points-log { list-style: none; margin-top: 4px; }
.points-log li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: #FAF7F2;
  margin-bottom: 8px; font-size: 14px;
}
.points-log .pl-icon { font-size: 22px; }
.points-log .pl-time { margin-left: auto; color: var(--text-light); font-size: 11px; }
.points-log .pl-pts { color: var(--primary-dark); font-weight: 800; }

.toy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.toy-card {
  border-radius: 16px; padding: 16px 10px; text-align: center;
  background: #fff; border: 3px solid #F0E8DC; cursor: pointer;
  transition: all .2s; position: relative;
}
.toy-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.toy-card .toy-icon { font-size: 40px; display: block; margin-bottom: 6px; }
.toy-card strong { font-size: 14px; display: block; }
.toy-card small { font-size: 11px; color: var(--text-light); display: block; margin-top: 3px; }
.toy-card .toy-cost { margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--primary-dark); }
.toy-card.owned { border-color: var(--green); background: #F2FBF4; }
.toy-card .owned-tag {
  position: absolute; top: -8px; right: -8px;
  background: var(--green); color: #fff; font-size: 10px;
  padding: 3px 8px; border-radius: 999px; font-weight: 700;
}

/* ---------- 首页 ---------- */
.home-greet { font-size: 20px; font-weight: 900; color: var(--primary-dark); margin-bottom: 4px; }
.home-sub { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }
.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.home-tile {
  background: #fff; border-radius: 18px; padding: 16px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 3px solid #F0E8DC; transition: all .2s;
}
.home-tile:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-soft); }
.home-tile .ht-icon { font-size: 34px; }
.home-tile .ht-info { flex: 1; min-width: 0; }
.home-tile .ht-info strong { font-size: 15px; display: block; }
.home-tile .ht-info small { font-size: 11px; color: var(--text-light); }
.home-tile .ht-status { font-size: 13px; }
.ht-status.done { color: var(--green); font-weight: 800; }
.ht-status.todo { color: #C9B8A5; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(60, 45, 30, .55);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; }
.modal-card {
  background: #fff; border-radius: 24px; max-width: 420px; width: 92%;
  padding: 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .35s cubic-bezier(.34,1.56,.64,1);
  max-height: 86vh; overflow-y: auto;
}
@keyframes modalIn {
  from { transform: scale(.6) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: #F3EEE6; font-size: 15px;
  cursor: pointer; transition: all .2s; z-index: 2;
}
.modal-close:hover { background: var(--red); color: #fff; transform: rotate(90deg); }
.modal-body { text-align: center; }
.modal-btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(74, 63, 53, .92); color: #fff;
  padding: 10px 22px; border-radius: 999px; font-size: 14px; font-weight: 700;
  z-index: 200; opacity: 0; transition: all .3s; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 彩带 ---------- */
#confettiBox { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -20px; border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .8; }
}

/* ---------- 底部常驻导航（移动端，无需点击弹出，直接选择） ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: linear-gradient(180deg, #FFF9EF 0%, #FFEFD6 100%);
  border-top: 3px solid rgba(255,255,255,.75);
  box-shadow: 0 -6px 22px rgba(247, 108, 27, .14);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.tabbar .nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; width: auto; padding: 7px 2px 5px; margin: 0;
  border-radius: 14px; text-align: center; font-size: 11px;
}
.tabbar .nav-item .nav-icon { font-size: 22px; line-height: 1; }
.tabbar .nav-item:hover { background: rgba(255,255,255,.75); transform: none; }
.tabbar .nav-item:hover .nav-icon { transform: scale(1.12); }
.tabbar .nav-item.active { background: #fff; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); }
  .main { height: 100vh; }
  .topbar { padding: 12px 14px 8px; }
  .app-title { font-size: 17px; }
  .day-badge { font-size: 12px; padding: 4px 10px; }
  .points-chip { font-size: 12px; padding: 6px 12px; }
  .sound-btn { width: 36px; height: 36px; font-size: 16px; }
  .progress-bar-area { padding: 4px 14px 8px; }
  .content { padding: 6px 12px 118px; }
  .home-grid { grid-template-columns: 1fr; }
  .game-menu { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-tip { display: none; }
}

@media (max-width: 480px) {
  .char-grid { grid-template-columns: 1fr; }
  .toy-grid { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .focus-actions { grid-template-columns: 1fr 1fr; }
  .poem-line { font-size: 19px; letter-spacing: 2px; }
}

/* 滚动条美化 */
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: rgba(255,159,67,.4); border-radius: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
