:root {
  --cream: #FBF8F1;
  --cream-deep: #F5EFE3;
  --blue-soft: #DDEFD6;
  --blue-mid: #8DBF73;
  --blue-deep: #4E8F42;
  --blue-text: #2F6B37;
  --mint: #C8E6D5;
  --peach: #F8D7C9;
  --yellow: #FCE8A8;
  --lavender: #E0D4F0;
  --pink-soft: #F5D5D5;
  --text-dark: #4A4A4A;
  --text-mid: #7A7A7A;
  --text-light: #A0A0A0;
  --star: #F5B84B;
  --star-deep: #E89B2F;
  --done: #7FCB9A;
  --shadow: 0 4px 14px rgba(78, 143, 66, 0.16);
  --shadow-hover: 0 8px 24px rgba(78, 143, 66, 0.26);
  --radius: 18px;
  --radius-sm: 12px;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #FBF8F1 0%, #E6F4DF 50%, #F5EFE3 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* 顶部云朵装饰 */
.cloud-deco {
  position: fixed;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}
.cloud-1 { top: 40px; left: -30px; font-size: 60px; animation: float 8s ease-in-out infinite; }
.cloud-2 { top: 120px; right: -20px; font-size: 50px; animation: float 10s ease-in-out infinite reverse; }
.cloud-3 { bottom: 80px; left: 10%; font-size: 45px; animation: float 12s ease-in-out infinite; }

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

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  position: relative;
  z-index: 1;
}

/* ============ 顶部欢迎栏 ============ */
.header {
  background: linear-gradient(135deg, #ffffff 0%, #F2FAEE 100%);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 2px solid #DCEED5;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: "🚀";
  position: absolute;
  top: -10px;
  right: 30px;
  font-size: 70px;
  opacity: 0.12;
  transform: rotate(-15deg);
}
.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(111, 161, 87, 0.4);
  flex-shrink: 0;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.9);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.header-title h1 {
  font-size: 22px;
  color: var(--blue-text);
  font-weight: 700;
}
.header-title p {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 2px;
}
.header-stats {
  margin-left: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-pill {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  padding: 8px 16px;
  border-radius: 16px;
  text-align: center;
  border: 1.5px solid #F0E8D8;
  min-width: 80px;
}
.stat-pill .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--star-deep);
  line-height: 1;
}
.stat-pill .lbl {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}
.stat-pill.streak .num { color: #E87B4F; }
.stat-pill.badge .num { color: var(--blue-deep); }

/* 进度总条 */
.progress-bar-wrap {
  margin-top: 18px;
  background: #F0E8D8;
  height: 14px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-deep), var(--star));
  border-radius: 10px;
  transition: width 0.6s ease;
  position: relative;
}
.progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shine 2s linear infinite;
}
@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 8px;
}

/* ============ 导航 Tab ============ */
.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: #fff;
  padding: 6px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.nav-tab {
  flex: 1;
  min-width: 90px;
  padding: 12px 8px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 600;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nav-tab .icon { font-size: 20px; }
.nav-tab:hover { background: var(--blue-soft); }
.nav-tab.active {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(111, 161, 87, 0.4);
}

/* ============ 页面容器 ============ */
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 卡片通用 ============ */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1.5px solid #E4F0DC;
  transition: box-shadow 0.3s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .emoji { font-size: 22px; }
.card-title .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
  background: var(--cream-deep);
  padding: 3px 10px;
  border-radius: 10px;
}

/* ============ 首页看板 ============ */
.welcome-banner {
  background: linear-gradient(135deg, #DCEAF7 0%, #FCE8A8 100%);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.welcome-banner h2 {
  font-size: 20px;
  color: var(--blue-text);
}
.welcome-banner p {
  font-size: 14px;
  color: var(--text-mid);
  margin-top: 6px;
}
.welcome-banner .deco-emoji {
  position: absolute;
  font-size: 40px;
  opacity: 0.7;
}
.welcome-banner .d1 { top: 10px; left: 20px; transform: rotate(-10deg); }
.welcome-banner .d2 { bottom: 10px; right: 20px; transform: rotate(10deg); }

.today-tasks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.task-mini {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  border: 2px solid #F0E8D8;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.task-mini:hover { transform: translateY(-2px); border-color: var(--blue-mid); }
.task-mini .tm-icon {
  font-size: 28px;
  width: 44px; height: 44px;
  background: var(--blue-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.task-mini .tm-info { flex: 1; }
.task-mini .tm-name { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.task-mini .tm-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.task-mini .tm-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.task-mini.done { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); border-color: var(--done); }
.task-mini.done .tm-check { background: var(--done); border-color: var(--done); color: #fff; }
.task-mini.done .tm-name { color: var(--text-light); text-decoration: line-through; }

/* 勋章墙 */
.medal-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.medal {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  border: 2px solid #F0E8D8;
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
  transition: all 0.3s;
  opacity: 0.45;
  filter: grayscale(0.6);
}
.medal.unlocked {
  opacity: 1;
  filter: none;
  border-color: var(--star);
  background: linear-gradient(135deg, #FFF8E8, #FCE8A8);
  box-shadow: 0 4px 12px rgba(245, 184, 75, 0.2);
}
.medal .m-icon { font-size: 36px; }
.medal .m-name { font-size: 12px; font-weight: 600; color: var(--text-dark); margin-top: 6px; }
.medal .m-desc { font-size: 10px; color: var(--text-light); margin-top: 2px; }

/* ============ 任务卡片 ============ */
.task-item {
  background: linear-gradient(135deg, #fff, #FCFAF5);
  border: 1.5px solid #F0E8D8;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.25s;
}
.task-item:hover { border-color: var(--blue-mid); transform: translateX(2px); }
.task-item.done {
  background: linear-gradient(135deg, #F1F8F4, #E8F5E9);
  border-color: var(--done);
}
.task-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.task-head .ti-icon {
  font-size: 24px;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-head .ti-title { flex: 1; }
.task-head .ti-title h4 { font-size: 15px; color: var(--text-dark); }
.task-head .ti-title .ti-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.task-head .ti-stars {
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.check-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--blue-mid);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.check-btn:hover { background: var(--blue-soft); }
.task-item.done .check-btn { background: var(--done); border-color: var(--done); color: #fff; }

.task-content {
  background: var(--cream);
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.8;
}
.task-content .tc-label {
  font-size: 12px;
  color: var(--blue-text);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-content .tc-block { margin-bottom: 10px; }
.task-content .tc-block:last-child { margin-bottom: 0; }
.word-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.word-chip {
  background: #fff;
  border: 1.5px solid var(--blue-soft);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-dark);
}
.word-chip .pinyin { font-size: 11px; color: var(--blue-text); display: block; }
.word-chip .meaning { font-size: 10px; color: var(--text-light); display: block; }

/* 数学题 */
.math-q {
  background: #fff;
  border: 1.5px solid var(--blue-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.math-q .q-num { color: var(--blue-text); font-weight: 600; min-width: 24px; }
.math-q .q-text { flex: 1; }
.math-q .q-ans {
  width: 60px;
  border: 1.5px solid var(--blue-mid);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 15px;
  text-align: center;
  background: #fff;
  color: var(--text-dark);
}
.math-q.correct { background: #E8F5E9; border-color: var(--done); }
.math-q.correct .q-ans { border-color: var(--done); color: var(--done); font-weight: 700; }
.math-q.wrong { background: #FFEBEE; border-color: #E87B7B; }

/* 英语字母卡 */
.letter-card {
  background: linear-gradient(135deg, #DCEAF7, #E0D4F0);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}
.letter-big {
  font-size: 64px;
  font-weight: 800;
  color: var(--blue-deep);
  line-height: 1;
  font-family: "Georgia", serif;
}
.letter-small {
  font-size: 28px;
  color: var(--blue-text);
  margin-top: 4px;
  font-family: "Georgia", serif;
}
.letter-sound {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 10px;
}
/* 发音按钮 */
.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(111, 161, 87, 0.3);
}
.speak-btn:hover { transform: scale(1.05); box-shadow: 0 4px 10px rgba(111, 161, 87, 0.4); }
.speak-btn:active { transform: scale(0.95); }
.speak-btn.speaking { background: linear-gradient(135deg, var(--star), var(--star-deep)); animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(245, 184, 75, 0.4); }
  50% { box-shadow: 0 4px 14px rgba(245, 184, 75, 0.7); }
}
.word-chip-with-sound {
  background: #fff;
  border: 1.5px solid var(--blue-soft);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mini-speak {
  background: var(--blue-soft);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.mini-speak:hover { background: var(--blue-mid); transform: scale(1.1); }

/* ============ 奖励商店 ============ */
.shop-section { margin-bottom: 24px; }
.shop-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--star-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.shop-item {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  border: 2px solid #F0E8D8;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all 0.25s;
  position: relative;
}
.shop-item:hover { transform: translateY(-3px); border-color: var(--star); box-shadow: 0 6px 16px rgba(245, 184, 75, 0.2); }
.shop-item .si-icon { font-size: 36px; }
.shop-item .si-name { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-top: 8px; }
.shop-item .si-cost {
  display: inline-block;
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}
.shop-item .si-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  border-radius: 10px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.shop-item .si-btn:hover { background: var(--blue-text); }
.shop-item .si-btn:disabled { background: #ccc; cursor: not-allowed; }
.shop-item.redeemed { opacity: 0.6; }
.shop-item.redeemed .si-btn { background: var(--done); }
.award-mask {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(74, 74, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.award-card {
  width: min(380px, 100%);
  background: linear-gradient(180deg, #FFFDF6 0%, #FFF5D8 100%);
  border: 5px solid #F5B84B;
  border-radius: 24px;
  padding: 22px 18px 18px;
  text-align: center;
  box-shadow: 0 14px 34px rgba(94, 69, 22, 0.22);
  position: relative;
  overflow: hidden;
}
.award-card::before,
.award-card::after {
  content: "★";
  position: absolute;
  top: 14px;
  color: #E89B2F;
  font-size: 24px;
}
.award-card::before { left: 18px; }
.award-card::after { right: 18px; }
.award-ribbon {
  display: inline-block;
  background: linear-gradient(135deg, #E89B2F, #F5B84B);
  color: #fff;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}
.award-icon { font-size: 52px; margin: 4px 0; }
.award-title { font-size: 24px; font-weight: 900; color: #9A6A13; letter-spacing: 2px; margin: 6px 0; }
.award-name {
  background: #fff;
  border: 2px dashed #F5B84B;
  border-radius: 16px;
  padding: 12px 10px;
  color: var(--blue-text);
  font-size: 18px;
  font-weight: 800;
  margin: 12px 0;
}
.award-text { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-bottom: 14px; }
.award-actions { display: flex; gap: 10px; }
.award-actions .btn { flex: 1; min-height: 44px; font-size: 15px; }

/* ============ 我的奖品 ============ */
.prize-summary {
  background: linear-gradient(135deg, #FFF8E7, #F2FAEE);
  border: 2px solid #F3DEAA;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.7;
}
.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.prize-card {
  background: linear-gradient(135deg, #fff, #FFF9E8);
  border: 2px solid #F0E8D8;
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.prize-card:hover { transform: translateY(-2px); border-color: var(--star); }
.prize-card .pc-icon { font-size: 38px; }
.prize-card .pc-name { font-size: 14px; font-weight: 800; color: var(--text-dark); margin-top: 8px; }
.prize-card .pc-meta { font-size: 12px; color: var(--text-light); margin-top: 6px; line-height: 1.5; }
.prize-empty {
  background: #fff;
  border: 2px dashed #E8DCC8;
  border-radius: 18px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-mid);
}
.prize-empty .pe-icon { font-size: 44px; margin-bottom: 8px; }
.prize-use-mask {
  position: fixed;
  inset: 0;
  z-index: 1320;
  background: rgba(74, 74, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.prize-use-box {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(74, 74, 74, 0.22);
}
.prize-use-icon { font-size: 48px; margin-bottom: 8px; }
.prize-use-title { font-size: 20px; font-weight: 900; color: var(--text-dark); margin-bottom: 8px; }
.prize-use-desc { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-bottom: 16px; }
.prize-use-actions { display: flex; gap: 10px; }
.prize-use-actions .btn { flex: 1; min-height: 46px; font-size: 15px; }

/* ============ 学习档案 ============ */
.archive-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.archive-stat {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  border: 2px solid #F0E8D8;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.archive-stat.clickable {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.archive-stat.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-hover);
}
.archive-stat .as-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1;
}
.archive-stat .as-lbl { font-size: 12px; color: var(--text-mid); margin-top: 6px; }
.archive-stat .as-icon { font-size: 24px; margin-bottom: 6px; }

.history-list {
  max-height: 400px;
  overflow-y: auto;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #F0E8D8;
  font-size: 13px;
}
.history-item:last-child { border-bottom: none; }
.history-item .hi-date { color: var(--blue-text); font-weight: 600; min-width: 100px; }
.history-item .hi-tasks { flex: 1; color: var(--text-mid); }
.history-item .hi-stars { color: var(--star-deep); font-weight: 600; }

.char-test-mask {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(74, 74, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.char-test-panel {
  width: min(430px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff 0%, #FBF8F1 100%);
  border-radius: 24px;
  padding: 18px 16px;
  box-shadow: 0 14px 36px rgba(74, 74, 74, 0.22);
  text-align: center;
}
.char-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.char-test-title { font-size: 18px; font-weight: 900; color: var(--blue-text); }
.char-test-close {
  border: none;
  background: var(--cream-deep);
  color: var(--text-mid);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-weight: 900;
  cursor: pointer;
}
.char-test-progress { font-size: 13px; color: var(--text-mid); margin-bottom: 10px; }
.tianzi-card {
  width: min(240px, 72vw);
  height: min(240px, 72vw);
  margin: 0 auto 12px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #E8B9A8 calc(50% - 1px), #E8B9A8 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), #E8B9A8 calc(50% - 1px), #E8B9A8 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(45deg, transparent calc(50% - 1px), #F0D0C4 calc(50% - 1px), #F0D0C4 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), #F0D0C4 calc(50% - 1px), #F0D0C4 calc(50% + 1px), transparent calc(50% + 1px)),
    #FFFDF8;
  border: 4px solid #E8B9A8;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), var(--shadow);
}
.tianzi-char {
  font-size: clamp(104px, 34vw, 158px);
  font-weight: 900;
  color: #3F3A35;
  line-height: 1;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
}
.english-test-card {
  width: min(300px, 82vw);
  min-height: 170px;
  margin: 0 auto 12px;
  background: linear-gradient(180deg, #F7FBFF 0%, #FFFFFF 100%);
  border: 4px solid var(--blue-mid);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), var(--shadow);
}
.english-test-main {
  font-size: clamp(34px, 12vw, 58px);
  font-weight: 900;
  color: var(--blue-text);
  line-height: 1.12;
  word-break: break-word;
}
.english-test-main.phrase {
  font-size: clamp(26px, 8vw, 42px);
}
.english-test-sub {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.5;
}
.char-test-tip { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.char-test-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.char-test-btn {
  border: none;
  border-radius: 16px;
  min-height: 54px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}
.char-test-btn.known { background: linear-gradient(135deg, #A8E6BF, #70C98F); color: #1F6E3A; }
.char-test-btn.unknown { background: linear-gradient(135deg, #FFD0D0, #F29A9A); color: #9A3838; }
.char-test-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.char-test-pill {
  background: #fff;
  border: 1.5px solid #F0E8D8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 700;
}

/* ============ 设置 ============ */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #F0E8D8;
}
.setting-row:last-child { border-bottom: none; }
.setting-row .sr-label { font-size: 14px; color: var(--text-dark); }
.setting-row .sr-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: var(--blue-text); }
.btn.danger { background: #E87B7B; }
.btn.danger:hover { background: #D85F5F; }
.btn.outline { background: transparent; border: 1.5px solid var(--blue-mid); color: var(--blue-text); }
.btn.outline:hover { background: var(--blue-soft); }
.btn.big-touch {
  min-height: 44px;
  min-width: 72px;
  padding: 10px 18px;
}
.reset-confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(74, 74, 74, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.reset-confirm-box {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: 0 12px 32px rgba(74, 74, 74, 0.22);
  text-align: center;
}
.reset-confirm-icon { font-size: 42px; margin-bottom: 8px; }
.reset-confirm-title { font-size: 19px; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; }
.reset-confirm-desc { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-bottom: 16px; }
.reset-confirm-actions { display: flex; gap: 10px; }
.reset-confirm-actions .btn { flex: 1; min-height: 46px; font-size: 15px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 123, 168, 0.3);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask.show { display: flex; animation: fadeIn 0.3s; }
.modal {
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.modal .m-emoji { font-size: 56px; }
.modal .m-title { font-size: 20px; font-weight: 700; color: var(--blue-text); margin-top: 12px; }
.modal .m-text { font-size: 14px; color: var(--text-mid); margin-top: 8px; line-height: 1.7; }
.modal .m-btn {
  margin-top: 20px;
  padding: 10px 32px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* 金色金币图案 */
.gold-coin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.48em;
  height: 1.48em;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #FFF8C6 0%, #FFD95A 36%, #F2A51A 72%, #B86A00 100%);
  border: 1px solid #D89316;
  color: #8A4D00;
  font-size: 1.02em;
  font-weight: 900;
  line-height: 1;
  vertical-align: -0.16em;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.65), inset 0 -2px 3px rgba(139,82,0,0.2), 0 1px 3px rgba(120,80,0,0.22);
}
.gold-coin-icon::before {
  content: "¥";
}

/* 金币飘落 */
.star-fall {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #FFF8C6 0%, #FFD95A 36%, #F2A51A 72%, #B86A00 100%);
  border: 2px solid #D89316;
  color: #8A4D00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 3px 5px rgba(255,255,255,0.65), inset 0 -3px 5px rgba(139,82,0,0.22), 0 4px 10px rgba(150,105,0,0.28);
  animation: fall 1s ease-in forwards;
}
.star-fall::before {
  content: "¥";
}
@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}

/* ============ 庆祝烟花 ============ */
.firework-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}
.celebration-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 501;
  pointer-events: none;
  animation: none;
}
.celebration-text {
  text-align: center;
  animation: celebratePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration-text .ct-emoji { font-size: 72px; }
.celebration-text .ct-title { font-size: 28px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); margin-top: 12px; }
.celebration-text .ct-msg { font-size: 18px; font-weight: 600; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.3); margin-top: 8px; }
@keyframes celebratePop {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-text));
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(111, 161, 87, 0.4);
  z-index: 200;
  animation: slideDown 0.3s, slideUp 0.3s 2s forwards;
}
@keyframes slideDown {
  from { transform: translate(-50%, -60px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes slideUp {
  to { transform: translate(-50%, -60px); opacity: 0; }
}

/* 响应式 */
@media (max-width: 600px) {
  .header-stats { width: 100%; justify-content: space-between; }
  .stat-pill { min-width: 70px; padding: 6px 10px; }
  .stat-pill .num { font-size: 18px; }
  .nav-tab { min-width: 70px; font-size: 12px; padding: 10px 4px; }
  .nav-tab .icon { font-size: 18px; }
  .letter-big { font-size: 48px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 4px; }

/* ============ 游戏页 ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.game-card {
  background: linear-gradient(135deg, #fff, #FBF8F1);
  border: 2px solid #F0E8D8;
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--blue-mid); }
.game-card .gc-icon { font-size: 40px; }
.game-card .gc-name { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-top: 10px; }
.game-card .gc-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.game-card .gc-best { font-size: 11px; color: var(--star-deep); margin-top: 8px; font-weight: 600; }
.game-card .gc-cat { position: absolute; top: 8px; right: 8px; font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.gc-cat-cn { background: var(--peach); color: #C97B5F; }
.gc-cat-math { background: var(--blue-soft); color: var(--blue-text); }
.gc-cat-en { background: var(--lavender); color: #7B5FA8; }

/* ============ 游戏面板（全屏弹层）============ */
.game-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 123, 168, 0.35);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}
.game-mask.show { display: flex; animation: fadeIn 0.3s; }
/* 浮动退出按钮 - 固定在右上角，不受滚动影响 */
.game-float-close {
  display: none;
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(107, 159, 212, 0.92);
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.game-mask.show ~ .game-float-close,
.game-float-close.show {
  display: flex;
}
.game-float-close:active {
  background: rgba(74, 123, 168, 1);
  transform: scale(0.92);
}
.game-panel {
  background: linear-gradient(135deg, #fff 0%, #FBF8F1 100%);
  border-radius: 22px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}
.game-panel-header {
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-deep));
  color: #fff;
  padding: 18px 22px;
  border-radius: 22px 22px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.game-panel-header .gph-icon { font-size: 28px; }
.game-panel-header .gph-title { font-size: 17px; font-weight: 700; flex: 1; }
.game-panel-header .gph-close {
  background: rgba(255,255,255,0.25);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 21;
  flex-shrink: 0;
  touch-action: manipulation;
}
.game-panel-header .gph-close:hover { background: rgba(255,255,255,0.4); }

.game-body { padding: 22px; flex: 1; overflow-y: auto; }

/* 游戏进度条 */
.game-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-mid);
}
.game-progress-info .score-badge {
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  padding: 3px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
}
.game-prev-btn {
  border: none;
  background: var(--cream-deep);
  color: var(--text-mid);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 32px;
}
.game-prev-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.game-progress-bar {
  background: var(--cream-deep);
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.game-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-deep));
  border-radius: 6px;
  transition: width 0.4s;
}

/* 题目区 */
.game-question {
  background: #fff;
  border: 2px solid var(--blue-soft);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.game-question .gq-label { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.game-question .gq-text { font-size: 20px; font-weight: 700; color: var(--text-dark); line-height: 1.6; }
.game-question .gq-sub { font-size: 14px; color: var(--text-mid); margin-top: 6px; }

/* 选项 */
.game-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.game-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}
.game-option-row .game-option {
  width: 100%;
}
.game-option-speak {
  width: 42px;
  min-width: 42px;
  min-height: 56px;
  border-radius: 14px;
  border: 2px solid var(--blue-soft);
  background: var(--blue-soft);
  color: var(--blue-text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.game-option-speak:active {
  transform: scale(0.96);
  background: var(--blue-mid);
}
.game-option {
  background: #fff;
  border: 2px solid var(--blue-soft);
  border-radius: 14px;
  padding: 16px 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .game-option:hover { border-color: var(--blue-deep); background: var(--blue-soft); transform: translateY(-1px); }
}
.game-option:focus, .game-option:focus-visible { outline: none; box-shadow: none; }
.game-option.correct { border-color: var(--done); background: #E8F5E9; color: #2D8C5C; }
.game-option.wrong { border-color: #E87B7B; background: #FFEBEE; color: #C75F5F; }
.game-option.disabled { pointer-events: none; opacity: 0.7; }

/* 单词填字游戏 */
.crossword-wrap {
  background: #fff;
  border: 1px solid #e6e0d4;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  color: #111;
}
.crossword-top {
  margin-bottom: 12px;
}
.crossword-theme {
  font-size: 15px;
  font-weight: 800;
  color: #111;
  margin-bottom: 8px;
  text-align: center;
}
.crossword-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.crossword-word-chip {
  border: 1px solid #111;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
  color: #111;
  background: #fff;
  text-transform: lowercase;
}
.crossword-word-chip.solved {
  color: #7a7a7a;
  border-color: #b8c7d8;
  background: #eef7ff;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.crossword-theme-picker {
  margin: 12px 0 14px;
  padding: 12px;
  background: #f7fbff;
  border: 1.5px solid #d7e8f8;
  border-radius: 14px;
}
.crossword-theme-picker-title {
  font-size: 14px;
  font-weight: 800;
  color: #24415f;
  margin-bottom: 8px;
}
.crossword-theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.crossword-theme-btn {
  border: 1.5px solid #b9d8ef;
  background: #fff;
  color: #24415f;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.crossword-theme-btn.active {
  background: #dff1ff;
  border-color: #54a9e6;
  color: #1268a8;
  box-shadow: 0 3px 8px rgba(84,169,230,0.25);
}
.crossword-theme-note {
  margin-top: 8px;
  font-size: 12px;
  color: #5d7893;
  text-align: center;
}
.crossword-grid {
  display: grid;
  justify-content: center;
  gap: 0;
  margin: 0 auto 12px;
  overflow-x: auto;
}
.crossword-cell {
  width: clamp(34px, 8.8vw, 56px);
  height: clamp(34px, 8.8vw, 56px);
  position: relative;
  box-sizing: border-box;
}
.crossword-cell.empty {
  background: transparent;
}
.crossword-input {
  width: 100%;
  height: 100%;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  text-align: center;
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 800;
  text-transform: lowercase;
  outline: none;
  padding: 10px 2px 2px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
.crossword-input.filled {
  color: #1268d6;
}
.crossword-input:focus {
  box-shadow: inset 0 0 0 2px #f2c94c;
}
.crossword-input.hint {
  color: #111;
  font-weight: 900;
  cursor: default;
}
.crossword-input.solved {
  background: #dff1ff !important;
}
.crossword-input.correct {
  background: #dff1ff !important;
}
.crossword-input.wrong {
  background: #fff0f0 !important;
}
.crossword-num {
  position: absolute;
  top: 1px;
  left: 2px;
  color: #d00000;
  font-size: clamp(8px, 2.3vw, 11px);
  font-weight: 900;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}
.crossword-status {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}
.crossword-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 比大小天平题 */
.compare-balance-wrap {
  background: linear-gradient(180deg, #F8FBFF 0%, #FFF8EA 100%);
  border: 2px solid var(--blue-soft);
  border-radius: 18px;
  padding: 18px 14px 16px;
  margin-bottom: 16px;
  text-align: center;
  overflow: hidden;
}
.compare-balance {
  position: relative;
  width: min(420px, 100%);
  height: 190px;
  margin: 0 auto 10px;
}
.compare-beam {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 70px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #D9A64A, #F8D37B, #D9A64A);
  transform-origin: center;
  transition: transform 0.55s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 5px 10px rgba(130,90,25,0.18);
}
.compare-balance.tilt-left .compare-beam { transform: rotate(-8deg); }
.compare-balance.tilt-right .compare-beam { transform: rotate(8deg); }
.compare-balance.equal .compare-beam { transform: rotate(0deg); }
.compare-stand {
  position: absolute;
  left: 50%;
  top: 76px;
  width: 12px;
  height: 78px;
  transform: translateX(-50%);
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #C28A35, #8A6127);
}
.compare-base {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 130px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, #B67B2D, #E9B85A, #B67B2D);
}
.compare-pan {
  position: absolute;
  top: 92px;
  width: 134px;
  min-height: 62px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid #F0C76E;
  box-shadow: 0 8px 16px rgba(120,80,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-weight: 900;
  color: var(--blue-text);
  font-size: 24px;
  transition: transform 0.55s cubic-bezier(.34,1.56,.64,1);
}
.compare-pan.left { left: 2%; }
.compare-pan.right { right: 2%; }
.compare-balance.tilt-left .compare-pan.left { transform: translateY(18px); }
.compare-balance.tilt-left .compare-pan.right { transform: translateY(-14px); }
.compare-balance.tilt-right .compare-pan.left { transform: translateY(-14px); }
.compare-balance.tilt-right .compare-pan.right { transform: translateY(18px); }
.compare-balance.equal .compare-pan.left,
.compare-balance.equal .compare-pan.right { transform: translateY(0); }
.compare-symbol-slot {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 68px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 18px;
  border: 3px dashed var(--blue-mid);
  background: rgba(255,255,255,0.92);
  color: var(--star-deep);
  font-size: 36px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-options {
  grid-template-columns: repeat(3, 1fr);
}
.compare-options .game-option {
  font-size: 30px;
  font-weight: 900;
}
.compare-hint {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 4px;
}

/* 叠词寻宝消消乐 */
.redup-scene {
  background: linear-gradient(180deg, #FFF9E8 0%, #F4FBFF 100%);
  border: 2px solid var(--blue-soft);
  border-radius: 18px;
  padding: 14px 10px;
  margin-bottom: 14px;
  text-align: center;
}
.redup-train {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  padding: 6px 4px 10px;
  margin-bottom: 10px;
  justify-content: flex-start;
}
.redup-train-engine {
  font-size: 26px;
  flex-shrink: 0;
  margin-right: 2px;
}
.redup-train-car {
  min-width: 42px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
  border: 2px solid var(--blue-soft);
  background: #fff;
  color: var(--text-light);
  transition: all 0.3s;
  line-height: 1.1;
  text-align: center;
  padding: 2px;
}
.redup-train-car.active {
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  border-color: var(--star-deep);
  transform: translateY(-5px) scale(1.12);
  box-shadow: 0 6px 14px rgba(245,184,75,0.35);
}
.redup-train-car.passed {
  background: var(--done);
  border-color: var(--done);
  color: #fff;
  font-size: 18px;
}
.redup-current-type {
  font-size: 18px;
  font-weight: 900;
  color: var(--star-deep);
  margin-bottom: 8px;
}
.redup-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-width: 420px;
  margin: 0 auto 12px;
}
.redup-cell {
  aspect-ratio: 1;
  min-height: 42px;
  border: 2px solid var(--blue-soft);
  border-radius: 12px;
  background: #fff;
  color: var(--text-dark);
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(70,100,130,0.08);
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s, background 0.18s, opacity 0.25s;
}
.redup-cell.selected {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.redup-cell.removed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.redup-cell.wrong {
  background: #FFEBEE;
  border-color: #E87B7B;
  color: #C75F5F;
  animation: shake 0.32s;
}
.redup-selected-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--text-mid);
  font-weight: 700;
}
.redup-picked-char {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--blue-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}
.redup-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.redup-small-btn {
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 800;
  color: var(--text-dark);
  background: var(--cream-deep);
  cursor: pointer;
}

/* 排序题词语区 */
.game-order-source { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; min-height: 48px; }
.game-order-target {
  background: var(--cream);
  border: 2px dashed var(--blue-mid);
  border-radius: 14px;
  padding: 12px;
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.order-word {
  background: #fff;
  border: 1.5px solid var(--blue-mid);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}
.order-word:hover { background: var(--blue-soft); }
.order-word.used { opacity: 0.3; pointer-events: none; }

/* 输入题 */
.game-input-row { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 16px; }
.game-input {
  width: 100px;
  border: 2px solid var(--blue-mid);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--text-dark);
  background: #fff;
}
.game-input:focus { outline: none; border-color: var(--blue-deep); box-shadow: 0 0 0 3px rgba(107,159,212,0.2); }
.game-input.correct { border-color: var(--done); background: #E8F5E9; color: #2D8C5C; }
.game-input.wrong { border-color: #E87B7B; background: #FFEBEE; color: #C75F5F; }

/* 确认按钮 */
.game-confirm-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-text));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.game-confirm-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(107,159,212,0.4); }
.game-confirm-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

/* 即时反馈 */
.game-feedback {
  text-align: center;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 700;
  display: none;
  animation: feedbackPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game-feedback.show { display: block; }
.game-feedback.correct { background: #E8F5E9; color: #2D8C5C; border: 2px solid var(--done); }
.game-feedback.wrong { background: #FFEBEE; color: #C75F5F; border: 2px solid #E87B7B; }
.game-feedback .gf-explain { font-size: 13px; font-weight: 400; color: var(--text-mid); margin-top: 6px; }
@keyframes feedbackPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 开始页 */
.game-start {
  text-align: center;
  padding: 30px 20px;
}
.game-start .gs-icon { font-size: 64px; }
.game-start .gs-title { font-size: 22px; font-weight: 700; color: var(--blue-text); margin-top: 12px; }
.game-start .gs-desc { font-size: 14px; color: var(--text-mid); margin-top: 8px; line-height: 1.7; }
.game-start .gs-rules {
  background: var(--cream);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
  text-align: left;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.8;
}
.game-start .gs-best { font-size: 14px; color: var(--star-deep); font-weight: 600; margin-bottom: 16px; }
.game-start .gs-btn {
  padding: 14px 40px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(245, 184, 75, 0.4);
  animation: pulseBtn 1.5s infinite;
}
@keyframes pulseBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* 结果页 */
.game-result { text-align: center; padding: 20px; }
.game-result .gr-emoji { font-size: 56px; animation: feedbackPop 0.5s; }
.game-result .gr-title { font-size: 22px; font-weight: 700; color: var(--blue-text); margin-top: 10px; }
.game-result .gr-stars { font-size: 32px; margin: 12px 0; letter-spacing: 4px; }
.game-result .gr-score {
  display: inline-block;
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  padding: 8px 28px;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0;
}
.game-result .gr-reward { font-size: 15px; color: var(--star-deep); font-weight: 600; margin: 10px 0; }
.game-result .gr-best { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.game-result .gr-btns { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.game-result .gr-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.gr-btn.primary { background: linear-gradient(135deg, var(--blue-deep), var(--blue-text)); color: #fff; }
.gr-btn.secondary { background: var(--cream-deep); color: var(--text-dark); }

/* ============ 口算闪电战关卡系统 ============ */
.math-level-start .mls-avatar {
  font-size: 56px;
  animation: bounceAvatar 1.5s ease-in-out infinite;
}
@keyframes bounceAvatar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.math-level-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue-mid));
  border-radius: 14px;
  padding: 10px 14px;
}
.math-level-bar .mlb-avatar {
  font-size: 28px;
  flex-shrink: 0;
  animation: bounceAvatar 1.5s ease-in-out infinite;
}
.math-level-bar .mlb-dots {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
}
.math-level-bar .level-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,0.5);
  color: var(--text-mid);
  transition: all 0.3s;
}
.math-level-bar .level-dot.passed {
  background: var(--done);
  color: #fff;
}
.math-level-bar .level-dot.current {
  background: linear-gradient(135deg, var(--star), var(--star-deep));
  color: #fff;
  box-shadow: 0 0 0 3px rgba(245,184,75,0.3);
  animation: pulseDot 1.2s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.math-level-bar .mlb-info {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-text);
  white-space: nowrap;
  flex-shrink: 0;
}
.math-stair-scene {
  background: linear-gradient(180deg, #F2FAEE 0%, #FFF8E8 100%);
  border: 2px solid var(--blue-soft);
  border-radius: 16px;
  padding: 10px 10px 8px;
  margin-bottom: 10px;
}
.math-stairs {
  height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  position: relative;
}
.math-step {
  width: 28px;
  min-height: 18px;
  border-radius: 8px 8px 2px 2px;
  background: #E6EEF7;
  border: 1.5px solid #CFE0F2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3px;
  font-size: 10px;
  font-weight: 900;
  color: var(--blue-text);
  position: relative;
}
.math-step.done {
  background: linear-gradient(180deg, #FFF4BC, #F5B84B);
  border-color: var(--star-deep);
  color: #8A5A00;
}
.math-step.current {
  background: linear-gradient(180deg, #DCEAF7, #9FCAE8);
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(107,159,212,0.22);
}
.math-step.top {
  background: linear-gradient(180deg, #FFECC4, #F0A83A);
}
.math-step-person {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  filter: drop-shadow(0 4px 5px rgba(80,50,0,0.22));
  animation: bounceAvatar 1.2s ease-in-out infinite;
}
.math-stair-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 700;
  margin-top: 4px;
}

/* 口算题目区 */
.game-question.math-q {
  background: linear-gradient(135deg, #fff, #F2FAEE);
  border-color: var(--blue-mid);
  position: relative;
  overflow: hidden;
}
.game-question.math-q .gq-text {
  font-family: "Courier New", monospace;
  letter-spacing: 3px;
}
.math-question-answer {
  display: inline-flex;
  min-width: 56px;
  min-height: 48px;
  padding: 0 8px;
  margin: 0 4px;
  align-items: center;
  justify-content: center;
  border-bottom: 4px solid var(--blue-mid);
  color: var(--blue-deep);
  font-weight: 900;
  vertical-align: baseline;
}
.math-question-answer.filled {
  color: var(--blue-deep);
  border-color: var(--blue-mid);
}
.math-question-answer.wrong {
  color: #E53935;
  border-color: #E53935;
  animation: wrongShake 0.28s ease-in-out;
}
.math-answer-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 76px;
  line-height: 1;
  font-weight: 900;
  color: #E53935;
  text-shadow: 0 4px 12px rgba(229,57,53,0.25);
  pointer-events: none;
  animation: letterCheckPop 0.45s ease-out both;
}
.math-level-prompt {
  width: min(92vw, 430px);
  padding: 28px 20px;
  pointer-events: auto;
  background: rgba(255,255,255,0.96);
  border-radius: 26px;
  box-shadow: 0 18px 45px rgba(47,111,163,0.32);
}
.math-level-prompt .ct-title { color: var(--blue-deep); text-shadow: none; }
.math-level-prompt .ct-msg { color: var(--text-dark); text-shadow: none; }
.math-level-prompt .gr-btns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}
.math-level-prompt .gr-btn {
  min-height: 58px;
  font-size: 18px;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(107,159,212,0.28);
}
.math-level-prompt .gr-btn.secondary {
  background: #FFF1D6;
  color: #8A5A00;
  border: 2px solid #F5B84B;
}

/* 答案输入显示 */
.math-input-display {
  font-size: 48px;
  font-weight: 800;
  color: var(--blue-deep);
  text-align: center;
  min-height: 60px;
  border-bottom: 4px solid var(--blue-mid);
  margin: 16px auto;
  max-width: 200px;
  letter-spacing: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 屏幕数字键盘 */
.math-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 0 auto 16px;
}
.math-keypad .mk-btn {
  padding: 18px 8px;
  font-size: 26px;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, var(--blue-soft));
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 8px rgba(107,159,212,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}
.math-keypad .mk-btn:active {
  transform: scale(0.92);
  background: var(--blue-mid);
}
.math-keypad .mk-btn.mk-clear {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  color: #C75F5F;
  font-size: 16px;
}
.math-keypad .mk-btn.mk-back {
  background: linear-gradient(135deg, var(--cream-deep), #F0E8D8);
  color: var(--text-mid);
  font-size: 22px;
}

/* 口算答题页紧凑模式：控制在一屏内，减少下拉 */
.game-body.math-compact {
  padding: 10px 14px 12px;
  overflow-y: auto;
}
.game-body.math-compact .math-level-bar {
  padding: 6px 10px;
  margin-bottom: 6px;
  gap: 6px;
  border-radius: 12px;
}
.game-body.math-compact .math-level-bar .mlb-avatar {
  font-size: 22px;
}
.game-body.math-compact .math-level-bar .level-dot {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.game-body.math-compact .math-level-bar .mlb-info {
  font-size: 11px;
}
.game-body.math-compact .game-progress-info {
  margin-bottom: 4px;
  font-size: 12px;
}
.game-body.math-compact .game-progress-bar {
  height: 8px;
  margin-bottom: 8px;
}
.game-body.math-compact .game-question.math-q {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 13px;
}
.game-body.math-compact .game-question.math-q .gq-label {
  margin-bottom: 2px;
  font-size: 11px;
}
.game-body.math-compact .game-question.math-q .gq-text {
  font-size: 32px !important;
  line-height: 1.25;
}
.game-body.math-compact .math-input-display {
  font-size: 34px;
  min-height: 42px;
  margin: 6px auto 8px;
  max-width: 160px;
  border-bottom-width: 3px;
  letter-spacing: 4px;
}
.game-body.math-compact .math-keypad {
  max-width: 330px;
  gap: 10px;
  margin: 0 auto 10px;
}
.game-body.math-compact .math-keypad .mk-btn {
  min-height: 58px;
  padding: 12px 6px;
  font-size: 28px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(107,159,212,0.18);
}
.game-body.math-compact .math-keypad .mk-btn.mk-clear {
  font-size: 18px;
}
.game-body.math-compact .math-keypad .mk-btn.mk-back {
  font-size: 26px;
}
.game-body.math-compact .game-confirm-btn {
  max-width: 330px;
  display: block;
  margin: 0 auto;
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 14px;
}
.game-body.math-compact .game-feedback {
  max-width: 260px;
  margin: 8px auto 0;
  padding: 8px;
  font-size: 14px;
  border-radius: 12px;
}

@media (max-height: 720px), (max-width: 480px) {
  .game-body.math-compact {
    padding: 8px 10px 10px;
  }
  .game-body.math-compact .math-level-bar {
    padding: 5px 8px;
  }
  .game-body.math-compact .math-level-bar .level-dot {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  .game-body.math-compact .math-level-bar .mlb-info {
    font-size: 10px;
  }
  .game-body.math-compact .game-question.math-q .gq-text {
    font-size: 28px !important;
  }
  .game-body.math-compact .math-input-display {
    font-size: 30px;
    min-height: 36px;
    margin: 4px auto 6px;
  }
  .game-body.math-compact .math-keypad {
    max-width: 315px;
    gap: 8px;
    margin-bottom: 8px;
  }
  .game-body.math-compact .math-keypad .mk-btn {
    min-height: 52px;
    padding: 9px 4px;
    font-size: 25px;
  }
  .game-body.math-compact .game-confirm-btn {
    max-width: 315px;
    padding: 8px 10px;
  }
}

/* 答对/答错动画 */
@keyframes correctShake {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.05); }
  75% { transform: scale(1.05); }
}
@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.game-question.correct { animation: correctShake 0.4s; border-color: var(--done); }
.game-question.wrong { animation: wrongShake 0.4s; border-color: #E87B7B; }

/* ============ 青蛙过河场景 ============ */
.frog-scene {
  background: linear-gradient(180deg, #D6F0E8 0%, #B8E0F0 100%);
  border-radius: 16px;
  padding: 12px 10px 10px;
  margin-bottom: 8px;
  position: relative;
  min-height: 136px;
}
.frog-river {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  padding: 0 4px;
}
.lily-pad {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #8BC34A 60%, #689F38 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  flex-shrink: 0;
  transition: all 0.4s;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.lily-pad.reached { background: radial-gradient(circle, var(--done) 60%, #5BAE7E 100%); }
.lily-pad.current { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(127,203,154,0.4); }
.frog-avatar {
  display: block;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-1px);
  animation: frogBounce 0.5s;
}
@keyframes frogBounce {
  0% { transform: translateY(-30px) scale(0.5); }
  60% { transform: translateY(5px) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}
.frog-char-display {
  text-align: center;
  margin-bottom: 8px;
}
.frog-char-display .fcd-char {
  font-size: 52px;
  font-weight: 700;
  color: var(--blue-text);
  line-height: 1;
}
.frog-char-display .fcd-pinyin-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}
.frog-progress-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 6px;
}
.frog-question-compact {
  padding: 10px 12px;
  margin-bottom: 8px;
}
.frog-question-compact .gq-label { margin-bottom: 3px; }
.frog-question-compact .gq-text { font-size: 26px !important; line-height: 1.2; }
.frog-question-compact .gq-sub { font-size: 12px; margin-top: 2px; }
.frog-game-options {
  gap: 6px;
  margin-bottom: 8px;
}
.frog-game-options .game-option {
  min-height: 42px;
  padding: 8px 8px;
  font-size: 15px;
  border-radius: 12px;
}

/* ============ 寻宝场景 ============ */
.treasure-scene {
  background: linear-gradient(180deg, #F5E6C8 0%, #E8D5A8 100%);
  border-radius: 16px;
  padding: 20px 12px;
  margin-bottom: 16px;
  position: relative;
  min-height: 120px;
}
.treasure-chests {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.treasure-chest {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.4s;
}
.treasure-chest.opened { background: linear-gradient(135deg, #FFD700, #FFA500); animation: treasurePop 0.5s; }
.treasure-chest.closed { background: #D4A76A; opacity: 0.6; }
.treasure-chest.current {
  width: 70px;
  height: 70px;
  font-size: 42px;
  background: linear-gradient(135deg, #B97934, #F3C06A);
  opacity: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(139, 92, 32, 0.3), 0 0 0 5px rgba(255, 215, 100, 0.28);
  animation: treasureInvite 1.2s ease-in-out infinite;
}
.treasure-chest.current:hover { transform: translateY(-4px) scale(1.04); }
.treasure-chest.opening {
  background: linear-gradient(135deg, #FFD95A, #F2A51A);
  animation: treasureOpenBurst 0.75s ease-out forwards;
}
.treasure-start-hint {
  text-align: center;
  color: #8B6914;
  font-weight: 800;
  font-size: 15px;
  margin-top: 12px;
}
.treasure-question-hidden {
  text-align: center;
  background: rgba(255,255,255,0.78);
  border: 2px dashed #C99A54;
  border-radius: 16px;
  padding: 18px 12px;
  color: #8B6914;
  font-weight: 700;
  margin-top: 12px;
}
.treasure-reward-pop {
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 502;
  pointer-events: none;
  text-align: center;
  animation: treasureRewardFloat 1.55s ease-out forwards;
}
.treasure-reward-pop .treasure-box-open {
  font-size: 76px;
  filter: drop-shadow(0 8px 12px rgba(80,50,0,0.28));
}
.treasure-reward-pop .treasure-gem {
  font-size: 64px;
  margin-top: -18px;
  animation: treasureGemJump 1.1s ease-out forwards;
}
@keyframes treasurePop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes treasureInvite {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.06); }
}
@keyframes treasureOpenBurst {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.18) rotate(-5deg); }
  70% { transform: scale(1.05) rotate(5deg); }
  100% { transform: scale(1.1) rotate(0); }
}
@keyframes treasureRewardFloat {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(0.55); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  72% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -75%) scale(0.92); }
}
@keyframes treasureGemJump {
  0% { transform: translateY(28px) scale(0.35) rotate(-18deg); opacity: 0; }
  35% { transform: translateY(-18px) scale(1.18) rotate(8deg); opacity: 1; }
  70% { transform: translateY(-8px) scale(1) rotate(-4deg); opacity: 1; }
  100% { transform: translateY(-20px) scale(1.05) rotate(0); opacity: 1; }
}
.treasure-progress {
  text-align: center;
  font-size: 13px;
  color: #8B6914;
  margin-top: 10px;
  font-weight: 600;
}

/* ============ 送小动物回家场景 ============ */
.rescue-home-scene {
  background: linear-gradient(180deg, #D6E8F5 0%, #B8D8E8 100%);
  border-radius: 16px;
  padding: 20px 12px;
  margin-bottom: 16px;
  position: relative;
  min-height: 120px;
}
.animal-homes {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.animal-home {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.4s;
}
.animal-home.arrived { background: linear-gradient(135deg, #8BC34A, #689F38); animation: homePop 0.5s; }
.animal-home.waiting { background: #A8C8E8; opacity: 0.6; }
@keyframes homePop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.rescue-progress {
  text-align: center;
  font-size: 13px;
  color: var(--blue-text);
  margin-top: 10px;
  font-weight: 600;
}

/* 麦克风按钮 */
.mic-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FF8A65, #FF6E40);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin: 12px auto;
  box-shadow: 0 4px 12px rgba(255,110,64,0.4);
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.recording { background: linear-gradient(135deg, #E91E63, #C2185B); animation: micPulse 1s infinite; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,30,99,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(233,30,99,0); }
}
.mic-status {
  text-align: center;
  font-size: 14px;
  color: var(--text-mid);
  margin-top: 8px;
  min-height: 20px;
}

/* ============ 动物解救场景 ============ */
.rescue-scene {
  background: linear-gradient(180deg, #FFF3E0 0%, #FFE0B2 100%);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.rescue-cages {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rescue-cages.single {
  margin: 4px auto 12px;
}
.cage {
  width: 48px;
  height: 56px;
  background: #fff;
  border: 2px solid #BCAAA4;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
  transition: all 0.4s;
}
.rescue-cages.single .cage {
  width: 138px;
  height: 138px;
  border-radius: 24px;
  font-size: 78px;
  margin: 0 auto;
}
.cage.locked::after {
  content: "🔒";
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 16px;
}
.cage.sealed {
  background: linear-gradient(180deg, #FFFDF7, #FFF1D8);
  border: 4px solid var(--star-deep);
  box-shadow: 0 10px 22px rgba(150,105,0,0.22), 0 0 0 6px rgba(245,184,75,0.22);
}
.cage.sealed::after {
  content: "🔒";
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 26px;
}
.cage .seal {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 18px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, #E74C3C 0 18px, #FFF1E8 18px 30px);
  border: 2px solid rgba(150,40,30,0.22);
  box-shadow: 0 3px 8px rgba(120,40,20,0.18);
  transform-origin: center;
}
.cage .seal-a { transform: translateY(-50%) rotate(36deg); }
.cage .seal-b { transform: translateY(-50%) rotate(-36deg); }
.cage.freed { background: #E8F5E9; border-color: var(--done); animation: cageOpen 0.6s; }
.cage.freed::after { content: ""; }
.cage.current {
  width: 68px;
  height: 76px;
  font-size: 38px;
  background: linear-gradient(180deg, #FFFDF7, #FFF1D8);
  border-color: var(--star-deep);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(150,105,0,0.22), 0 0 0 5px rgba(245,184,75,0.22);
  animation: rescueInvite 1.15s ease-in-out infinite;
}
.cage.current::after {
  content: "🔒";
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 20px;
}
.cage.unlocking {
  animation: animalUnlock 0.9s ease-out forwards;
}
.rescue-start-hint {
  font-size: 15px;
  color: #9A6A2B;
  font-weight: 800;
  margin-top: 10px;
}
.rescue-question-hidden {
  background: rgba(255,255,255,0.82);
  border: 2px dashed #D8A45F;
  border-radius: 16px;
  padding: 16px 12px;
  color: #9A6A2B;
  font-weight: 700;
  margin-top: 12px;
}
.animal-reward-pop {
  position: fixed;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 502;
  pointer-events: none;
  text-align: center;
  animation: animalRewardFloat 1.55s ease-out forwards;
}
.animal-reward-pop .animal-lock-open {
  font-size: 66px;
}
.animal-reward-pop .animal-free {
  font-size: 92px;
  margin-top: -10px;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,0.2));
  animation: animalJumpOut 1.15s ease-out forwards;
}
.spell-keyboard {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 7px;
  max-width: 430px;
  margin: 0 auto 12px;
}
.spell-key {
  min-height: 48px;
  padding: 8px 4px;
  font-size: 24px;
  font-weight: 900;
  background: var(--blue-soft);
  color: var(--text-dark);
  justify-content: center;
  border-radius: 12px;
}
.spell-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.spell-native-wrap {
  max-width: 420px;
  margin: 10px auto 10px;
}
.spell-native-input {
  width: 100%;
  min-height: 58px;
  border: 3px solid var(--blue-mid);
  border-radius: 16px;
  background: #fff;
  color: var(--blue-text);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(78, 143, 66, 0.12);
}
.spell-native-input:focus {
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 4px rgba(141,191,115,0.25);
}
.spell-native-input.correct {
  border-color: var(--done);
  background: #E8F5E9;
  color: #2D8C5C;
}
.spell-native-input.wrong {
  border-color: #E87B7B;
  background: #FFEBEE;
  color: #C75F5F;
}
.spell-native-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
}
@keyframes cageOpen {
  0% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes rescueInvite {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.06); }
}
@keyframes animalUnlock {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.15) rotate(-6deg); }
  70% { transform: scale(1.05) rotate(6deg); }
  100% { transform: scale(1.1) rotate(0); background:#E8F5E9; border-color:var(--done); }
}
@keyframes animalRewardFloat {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(0.55); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  75% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -78%) scale(0.9); }
}
@keyframes animalJumpOut {
  0% { transform: translateY(30px) scale(0.35); opacity: 0; }
  35% { transform: translateY(-20px) scale(1.15); opacity: 1; }
  70% { transform: translateY(-8px) scale(1); opacity: 1; }
  100% { transform: translateY(-18px) scale(1.05); opacity: 1; }
}
.rescue-progress {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 6px;
}

/* 单词拼写输入框 */
.spell-display {
  text-align: center;
  margin-bottom: 16px;
}
.spell-zh {
  font-size: 28px;
  font-weight: 700;
  color: var(--blue-text);
}
.spell-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}
.spell-question-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.spell-answer-hint {
  display: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: #FFEBEE;
  border: 2px solid #E87B7B;
  color: #C75F5F;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}
.spell-answer-hint.show {
  display: inline-flex;
  align-items: center;
}
.spell-letter-blanks {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.spell-blank-word {
  display: inline-flex;
  gap: 6px;
  align-items: flex-end;
}
.spell-letter-blank {
  width: 22px;
  height: 20px;
  border-bottom: 4px solid var(--blue-mid);
  border-radius: 0 0 4px 4px;
}
.spell-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.spell-box {
  width: 44px;
  height: 52px;
  border: 3px solid var(--blue-mid);
  border-radius: 10px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--blue-deep);
  background: #fff;
  text-transform: lowercase;
  transition: all 0.2s;
}
.spell-box:focus { outline: none; border-color: var(--blue-deep); box-shadow: 0 0 0 3px rgba(107,159,212,0.2); }
.spell-box.correct { border-color: var(--done); background: #E8F5E9; color: #2D8C5C; }
.spell-box.wrong { border-color: #E87B7B; background: #FFEBEE; color: #C75F5F; }

@media (max-width: 600px) {
  .game-options { grid-template-columns: 1fr; }
  .game-panel { max-width: 100%; }
  .lily-pad { width: 36px; height: 36px; font-size: 22px; }
  .spell-box { width: 36px; height: 44px; font-size: 22px; }
  .spell-question-line { gap: 8px; }
  .spell-answer-hint { font-size: 16px; padding: 7px 10px; white-space: normal; }
  .cage { width: 40px; height: 48px; font-size: 24px; }
}

/* ============ 手写画板 ============ */
.handwrite-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}
.handwrite-canvas-wrap {
  position: relative;
  border: 3px dashed var(--blue-mid);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.handwrite-canvas {
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: repeating-linear-gradient(0deg, transparent, transparent 39px, #F0E8D8 40px);
}
.hw-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.hw-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hw-btn.clear { background: #FFEBEE; color: #C75F5F; }
.hw-btn.confirm { background: linear-gradient(135deg, var(--blue-deep), var(--blue-text)); color: #fff; }
.hw-recognized {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue-deep);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 4px;
}
.hw-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* 看拼音写词：田字格与小人进度条 */
.pinyin-road-scene {
  background: linear-gradient(180deg, #F2FAEE 0%, #FFF8E8 100%);
  border: 2px solid var(--blue-soft);
  border-radius: 18px;
  padding: 12px 12px 10px;
  margin: 8px 0 14px;
}
.pinyin-road {
  position: relative;
  height: 54px;
  margin: 2px 8px 4px;
}
.pinyin-road::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 28px;
  height: 10px;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, #C99A54 0 18px, #E7C889 18px 28px);
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.45);
}
.pinyin-road-fill {
  position: absolute;
  left: 8px;
  top: 28px;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-deep));
  transition: width 0.4s ease;
}
.pinyin-runner {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 34px;
  transition: left 0.4s ease;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.18));
}
.pinyin-destination {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 32px;
}
.pinyin-road-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 600;
}
.pinyin-write-card {
  background: #fff;
  border: 2px solid #E4F0DC;
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
}
.pinyin-prompt {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 14px;
  background: #F2FAEE;
  border: 1.5px solid var(--blue-soft);
  color: var(--blue-text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 8px 0 12px;
}
.pinyin-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pinyin-correct-hint {
  display: none;
  padding: 7px 10px;
  border-radius: 12px;
  background: #FFEBEE;
  border: 2px solid #E87B7B;
  color: #C75F5F;
  font-size: 18px;
  font-weight: 900;
}
.pinyin-correct-hint.show {
  display: inline-flex;
}
.pinyin-input-wrap {
  position: relative;
  width: min(520px, 100%);
  margin: 0 auto;
}
.pinyin-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.01;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  z-index: 2;
}
.pinyin-native-input:focus {
  outline: none;
}
.pinyin-tianzige-slots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  min-height: 176px;
  border: 3px solid var(--blue-mid);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(78, 143, 66, 0.12);
}
.pinyin-tianzige-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  font-size: 54px;
  font-weight: 900;
  color: var(--blue-deep);
  border-right: 2px solid #D7B58A;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #E8B9A8 calc(50% - 1px), #E8B9A8 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), #E8B9A8 calc(50% - 1px), #E8B9A8 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(45deg, transparent calc(50% - 1px), #F0D0C4 calc(50% - 1px), #F0D0C4 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), #F0D0C4 calc(50% - 1px), #F0D0C4 calc(50% + 1px), transparent calc(50% + 1px)),
    #FFFDF8;
}
.pinyin-tianzige-slot:last-child {
  border-right: none;
}
.pinyin-tianzige-slot.filled {
  background-color: #FFF8E8;
}
.pinyin-input-wrap.correct .pinyin-tianzige-slot {
  color: var(--blue-deep);
}
.pinyin-input-wrap.wrong .pinyin-tianzige-slot {
  color: #E53935;
}
.pinyin-answer-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 86px;
  line-height: 1;
  font-weight: 900;
  pointer-events: none;
  z-index: 3;
  animation: letterCheckPop 0.42s ease-out both;
}
.pinyin-answer-mark.correct {
  color: #E53935;
  text-shadow: 0 4px 12px rgba(229,57,53,0.25);
}
.pinyin-answer-mark.wrong {
  color: #E53935;
  animation: wrongShake 0.28s ease-in-out;
}
.tianzige-canvas-wrap {
  width: min(520px, 100%);
  border: 3px solid var(--blue-mid);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(78, 143, 66, 0.12);
}
.tianzige-canvas {
  display: block;
  width: 100%;
  height: 176px;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

/* 拼写手写格 */
.spell-handwrite-box {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
  flex-wrap: wrap;
  align-items: center;
}
.spell-slot-word {
  display: inline-flex;
  gap: 8px;
}
.shw-slot {
  width: 60px;
  height: 70px;
  border: 3px solid var(--blue-mid);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--blue-deep);
  position: relative;
}
.shw-slot.active { border-color: var(--star); box-shadow: 0 0 0 3px rgba(245,184,75,0.3); }
.shw-slot.filled { background: #FFF8E8; }
.shw-slot.correct { border-color: var(--done); background: #E8F5E9; color: #2D8C5C; }
.shw-slot.wrong { border-color: #E87B7B; background: #FFEBEE; color: #C75F5F; }

/* 字母听写乐园 */
.letter-park {
  background: linear-gradient(180deg, #F2F8FF 0%, #FFF8E8 100%);
  border: 2px solid var(--blue-soft);
  border-radius: 18px;
  padding: 8px;
  text-align: center;
  margin-bottom: 6px;
}
.letter-train {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
}
.letter-car {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #fff;
  border: 1.5px solid #D8EAF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-text);
}
.letter-car.done { background: #E8F5E9; color: #2D8C5C; border-color: #8DD8AA; }
.letter-car.wrong { background: #FFEBEE; color: #C75F5F; border-color: #E87B7B; }
.letter-car.current { background: var(--star); color: #fff; border-color: var(--star-deep); transform: scale(1.12); }
.letter-dictation-card {
  background: #fff;
  border: 2px dashed var(--blue-mid);
  border-radius: 18px;
  padding: 8px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
.letter-hidden {
  font-size: 34px;
  font-weight: 900;
  color: var(--blue-text);
  letter-spacing: 4px;
  margin: 0;
}
.letter-hidden.revealed {
  color: #C75F5F;
}
.letter-answer-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  line-height: 1;
  font-weight: 900;
  color: #E53935;
  text-shadow: 0 4px 12px rgba(229, 57, 53, 0.25);
  pointer-events: none;
  animation: letterCheckPop 0.45s ease-out both;
}
@keyframes letterCheckPop {
  0% { opacity: 0; transform: scale(0.35) rotate(-12deg); }
  65% { opacity: 1; transform: scale(1.18) rotate(0deg); }
  100% { opacity: 1; transform: scale(1); }
}
.four-line-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 6px auto;
  max-width: 340px;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.four-line-canvas {
  width: 100%;
  height: 132px;
  display: block;
  background:
    linear-gradient(to bottom,
      transparent 14%,
      #E98D8D 14%, #E98D8D calc(14% + 2px),
      transparent calc(14% + 2px), transparent 38%,
      #E98D8D 38%, #E98D8D calc(38% + 2px),
      transparent calc(38% + 2px), transparent 62%,
      #6BA7D6 62%, #6BA7D6 calc(62% + 2px),
      transparent calc(62% + 2px), transparent 86%,
      #E98D8D 86%, #E98D8D calc(86% + 2px),
      transparent calc(86% + 2px)),
    #FFFDF8;
  border-radius: 0;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.letter-writing-lock {
  overflow: hidden;
  overscroll-behavior: none;
}
.letter-submit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 4px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(251,248,241,0.25), #FBF8F1 45%);
  padding-top: 6px;
}
.letter-score-big {
  font-size: 42px;
  font-weight: 900;
  color: var(--star-deep);
  margin: 10px 0;
}

/* 时钟样式 */
.clock-display {
  text-align: center;
  margin: 16px 0;
}
.clock-svg {
  filter: drop-shadow(0 4px 10px rgba(107,159,212,0.25));
}

/* 人民币样式 */
.money-display {
  text-align: center;
  margin: 16px 0;
}
.money-coins {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.coin {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #7A4300;
  background: radial-gradient(circle at 30% 25%, #FFF8C6 0%, #FFD95A 36%, #F2A51A 72%, #B86A00 100%);
  border: 2px solid #D89316;
  box-shadow: inset 0 4px 8px rgba(255,255,255,0.6), inset 0 -4px 8px rgba(139,82,0,0.22), 0 3px 8px rgba(120,80,0,0.18);
}
.coin.c1, .coin.c5, .coin.c10, .coin.c50 {
  background: radial-gradient(circle at 30% 25%, #FFF8C6 0%, #FFD95A 36%, #F2A51A 72%, #B86A00 100%);
}
.coin.y1, .coin.y5, .coin.y10 {
  width: 56px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF1A8 0%, #FFD95A 42%, #E7A21A 100%);
  border-color: #D89316;
  color: #7A4300;
}


/* ============ iPhone 手机版强化适配 ============ */
@media (max-width: 480px) {
  body { font-size: 16px; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
  .app { max-width: 100%; padding: max(12px, env(safe-area-inset-top)) 10px max(72px, env(safe-area-inset-bottom)); }
  .header { padding: 16px 14px; border-radius: 18px; margin-bottom: 12px; }
  .header-title, .card-title, .gs-title { font-size: 20px !important; line-height: 1.35; }
  .nav-tabs { gap: 6px; padding: 8px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-tab { min-width: 78px; padding: 10px 8px; font-size: 14px; border-radius: 14px; }
  .card, .game-card, .tc-block, .game-start, .game-question { border-radius: 16px; padding: 14px 12px; }
  .game-grid, .task-grid, .word-grid, .prize-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .game-mask, .modal-mask { align-items: stretch; padding: 0; }
  .game-panel, .modal { width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .game-body { padding: 10px; overflow-x: hidden; }
  .gq-text { font-size: 22px !important; line-height: 1.45; word-break: break-word; }
  .game-options { gap: 9px; }
  .game-option { min-height: 52px; padding: 12px 10px; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .frog-scene { min-height: 118px; padding: 8px 8px 7px; margin-bottom: 6px; }
  .frog-char-display .fcd-char { font-size: 42px; }
  .frog-char-display .fcd-pinyin-hint { font-size: 12px; margin-top: 2px; }
  .lily-pad { width: 31px; height: 31px; font-size: 18px; }
  .frog-avatar { font-size: 22px; }
  .frog-progress-text { font-size: 11px; margin-top: 4px; }
  .frog-question-compact { padding: 7px 10px !important; margin-bottom: 6px; }
  .frog-question-compact .gq-text { font-size: 22px !important; line-height: 1.15; }
  .frog-question-compact .gq-sub { font-size: 11px; margin-top: 1px; }
  .frog-game-options { gap: 6px; margin-bottom: 6px; }
  .frog-game-options .game-option { min-height: 38px; padding: 6px 6px; font-size: 15px; }
  .speak-btn, .game-confirm-btn, .gs-btn, .gr-btn { min-height: 48px; font-size: 16px; }
  .mini-speak { width: 34px; height: 34px; min-width: 34px; font-size: 16px; }
  .math-keypad { max-width: 100%; gap: 7px; }
  .mk-btn, .hw-btn { min-height: 46px; font-size: 17px; }
  .spell-native-wrap { max-width: 100%; margin: 8px auto; }
  .spell-native-input { min-height: 54px; font-size: 25px; padding: 7px 10px; }
  .spell-letter-blanks { gap: 10px; margin-top: 10px; }
  .spell-blank-word { gap: 4px; }
  .spell-letter-blank { width: 18px; height: 18px; border-bottom-width: 3px; }
  .spell-handwrite-box { gap: 5px; flex-wrap: wrap; }
  .spell-slot-word { gap: 5px; }
  .shw-slot { width: 34px; height: 42px; font-size: 20px; }
  .frog-river, .treasure-chests, .animal-homes, .rescue-cages { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .celebration-text { width: calc(100vw - 28px); padding: 22px 16px; }
}

