/* ============ 单词星球 - 样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 保证 hidden 属性不被自定义 display 覆盖 */
[hidden] { display: none !important; }

:root {
  --bg1: #a1c4fd;
  --bg2: #c2e9fb;
  --primary: #ff9f43;
  --primary-dark: #e08209;
  --success: #2ed573;
  --success-dark: #1aa656;
  --danger: #ff6b81;
  --danger-dark: #d64559;
  --blue: #1e90ff;
  --star: #ffa502;
  --ink: #2f3542;
  --ink-light: #747d8c;
  --card-bg: #ffffff;
  --radius: 24px;
}

html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%) fixed;
  color: var(--ink);
  font-size: 17px;
  padding-bottom: 92px; /* 给底部导航留空间 */
}

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

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 6px;
}
.logo { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 4px rgba(30,90,160,.35); display: flex; align-items: center; gap: 6px; }
.logo-icon { font-size: 26px; }
.star-badge {
  background: #fff; border-radius: 999px; padding: 7px 16px;
  font-size: 17px; font-weight: 700; color: var(--ink);
  box-shadow: 0 3px 8px rgba(30,90,160,.18);
  cursor: pointer;
}

/* ---------- 年级选择 ---------- */
.grade-bar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 14px 8px;
}
.grade-label { color: #fff; font-weight: 700; flex-shrink: 0; text-shadow: 0 1px 3px rgba(30,90,160,.4); }
.grade-group { display: flex; align-items: center; gap: 8px; }
.grade-group-name {
  flex-shrink: 0; width: 60px; text-align: right;
  color: rgba(255,255,255,.9); font-size: 12px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(30,90,160,.4);
}
.grade-group-chips {
  flex: 1; min-width: 0; display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none; padding: 2px 0;
}
.grade-group-chips::-webkit-scrollbar { display: none; }
.grade-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.75); color: var(--ink);
  font-size: 14px; font-weight: 700; transition: all .15s;
}
.grade-chip.active { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark); }

/* 宽屏：组内 chips 自动换行，不再横向滚动 */
@media (min-width: 760px) {
  .grade-group-chips { flex-wrap: wrap; overflow: visible; }
  .grade-group-name { width: 72px; font-size: 13px; }
}

/* PEP小学：新版 / 旧版 两列 */
.grade-group.has-parts { align-items: flex-start; }
.grade-group-parts {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.grade-part {
  border-radius: 16px; padding: 9px 11px 11px;
  box-shadow: 0 3px 10px rgba(30,90,160,.14);
}
.grade-part.new { background: rgba(238,244,255,.94); }
.grade-part.old { background: rgba(255,244,230,.94); }
.grade-part-name {
  display: block; font-size: 12px; font-weight: 800;
  color: var(--ink-light); margin-bottom: 7px;
}
.grade-part.new .grade-part-name { color: #2b44b0; }
.grade-part.old .grade-part-name { color: #b5691e; }
.grade-part .grade-group-chips { flex-wrap: wrap; overflow: visible; gap: 6px; }
.grade-part .grade-chip { padding: 5px 11px; font-size: 13px; }

/* 宽屏：真正的左右两列 */
@media (min-width: 680px) {
  .grade-group-parts { grid-template-columns: 1fr 1fr; }
}

/* 危险操作卡片 */
.danger-card { border: 2px solid #f6d0d6; background: #fff7f8; }

/* ---------- 主区域 ---------- */
.main { max-width: 640px; margin: 0 auto; padding: 12px 14px 110px; /* 底部留白，避免最后一项被固定导航遮挡 */ }
.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 22px 18px; margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(40,90,160,.12);
}
.card-title { font-size: 19px; margin-bottom: 12px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(40,90,160,.10);
}
.tab {
  position: relative; flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 16px;
  font-size: 13px; font-weight: 700; color: var(--ink-light);
}
.tab span { font-size: 22px; }
.tab.active { color: var(--primary-dark); background: #fff3e0; }
.tab-badge {
  position: absolute; top: 2px; right: 12%;
  background: var(--danger); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 999px; padding: 0 4px; font-weight: 700;
}

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 28px 18px 24px; }
.hero-emoji { font-size: 58px; animation: float 2.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero h1 { font-size: 24px; margin: 8px 0 6px; }
.hero-sub { color: var(--ink-light); font-size: 15px; margin-bottom: 14px; }
.btn-review {
  width: 100%; padding: 14px; border-radius: 18px;
  background: linear-gradient(90deg, #ff9f43, #ff6b81);
  color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 5px 0 var(--danger-dark);
  transition: transform .1s;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.btn-review.done {
  background: #dff5e4; color: var(--success-dark);
  box-shadow: none; animation: none; font-weight: 700;
}
.btn-review:active { transform: translateY(3px); }

.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.mode-card {
  background: var(--card-bg); border-radius: 20px; padding: 18px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 6px 18px rgba(40,90,160,.12);
  transition: transform .12s;
}
.mode-card:active { transform: scale(.95); }
.mode-icon { font-size: 38px; }
.mode-title { font-size: 17px; font-weight: 800; }
.mode-desc { font-size: 12px; color: var(--ink-light); }

/* 玩法规则说明（默认折叠） */
.rules-card { padding: 14px 18px; margin-bottom: 14px; }
.rules-card summary {
  cursor: pointer; font-size: 15px; font-weight: 800; color: var(--ink);
  user-select: none; list-style: none;
}
.rules-card summary::before { content: "▸ "; color: var(--ink-light); }
.rules-card[open] summary::before { content: "▾ "; }
.rules-list { margin: 10px 0 2px; padding-left: 4px; list-style: none; }
.rules-list li {
  font-size: 13px; line-height: 1.7; color: var(--ink-light);
  padding: 6px 0; border-top: 1px dashed #eef2f7;
}
.rules-list li:first-child { border-top: none; }
.rules-list b { color: var(--ink); }

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.progress-name { width: 66px; flex-shrink: 0; font-size: 14px; color: var(--ink-light); font-weight: 700; }
.progress-track { flex: 1; height: 14px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffa502, #ff9f43); transition: width .5s ease; }
.progress-fill.green { background: linear-gradient(90deg, #2ed573, #7bed9f); }
.progress-fill.purple { background: linear-gradient(90deg, #a55eea, #d6a4ff); }
.progress-num { font-size: 14px; min-width: 52px; text-align: right; }
.tip { font-size: 13px; color: var(--ink-light); line-height: 1.7; background: #f6f9ff; border-radius: 12px; padding: 10px 12px; }

/* ---------- 通用按钮 ---------- */
.btn {
  padding: 12px 22px; border-radius: 16px;
  font-size: 16px; font-weight: 800; color: #fff;
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(3px); box-shadow: none !important; }
.btn-big { width: 100%; padding: 15px; font-size: 18px; }
.btn-primary { background: var(--blue); box-shadow: 0 5px 0 #1565c0; }
.btn-success { background: var(--success); box-shadow: 0 5px 0 var(--success-dark); }
.btn-danger { background: var(--danger); box-shadow: 0 5px 0 var(--danger-dark); }
.btn-ghost { background: #eef2f7; color: var(--ink-light); box-shadow: 0 5px 0 #d6dee9; }

/* ---------- 学习会话头部 ---------- */
.session-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.btn-back {
  padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.85);
  font-weight: 700; font-size: 15px; color: var(--ink);
  box-shadow: 0 3px 8px rgba(40,90,160,.12);
}
.session-progress-track { flex: 1; height: 12px; background: rgba(255,255,255,.7); border-radius: 999px; overflow: hidden; }
.session-progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffa502, #ff6b81); transition: width .3s; }
.session-count { font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(30,90,160,.4); }

/* ---------- 卡片翻转 ---------- */
.flip-zone { perspective: 1000px; margin-bottom: 16px; }
.flip-inner {
  position: relative; width: 100%; min-height: 340px;
  transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.7,.3,1.1);
}
.flip-inner.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(40,90,160,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 24px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip-back { transform: rotateY(180deg); }
.flip-zone { cursor: pointer; }

.card-emoji { font-size: 72px; line-height: 1; }
.card-word { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.card-word.small { font-size: 26px; color: var(--ink-light); }
.card-ipa { font-size: 17px; color: var(--blue); font-weight: 600; }
.card-zh { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.card-sentence { font-size: 16px; color: var(--ink-light); font-style: italic; text-align: center; line-height: 1.6; }
.flip-hint { font-size: 13px; color: #b0bac9; margin-top: 6px; }

.sound-btn {
  position: absolute; top: 14px; right: 14px;
  width: 46px; height: 46px; border-radius: 50%;
  background: #eef4ff; font-size: 22px;
  transition: transform .12s;
}
.sound-btn:active { transform: scale(.85); }
.sound-btn.big { position: static; width: auto; height: auto; padding: 10px 20px; border-radius: 999px; font-size: 16px; font-weight: 700; color: var(--blue); background: #eef4ff; }

.judge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 拼写 ---------- */
.spell-card { text-align: center; }
.spell-mode-tag {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
  background: #eef4ff; color: var(--blue);
}
.spell-mode-tag.review { background: #fff0f3; color: var(--danger-dark); }
.spell-zh { font-size: 28px; font-weight: 800; margin: 6px 0 12px; }
.spell-input {
  width: 100%; margin: 16px 0 4px; padding: 15px 18px;
  font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 2px;
  border: 3px solid #dbe6f3; border-radius: 16px; outline: none; color: var(--ink);
  transition: border-color .2s;
}
.spell-input:focus { border-color: var(--blue); }
.spell-input.correct { border-color: var(--success); background: #f0fff6; }
.spell-input.wrong { border-color: var(--danger); background: #fff5f6; }

.spell-feedback { margin: 10px 0 4px; font-size: 16px; font-weight: 700; line-height: 1.8; }
.spell-feedback.ok { color: var(--success-dark); }
.spell-feedback.no { color: var(--danger-dark); }
.spell-feedback .answer { font-size: 22px; letter-spacing: 2px; }
.spell-feedback .answer .hit { color: var(--success-dark); }
.spell-feedback .answer .miss { color: var(--danger); text-decoration: underline; }

.spell-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.pop { animation: pop .35s; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------- 错词本 ---------- */
.wrong-head .btn { width: 100%; margin-top: 6px; }
.wrong-sub { font-size: 14px; color: var(--ink-light); margin-bottom: 12px; line-height: 1.6; }
.wrong-empty { text-align: center; padding: 10px 0; color: var(--ink-light); line-height: 1.8; }
.wrong-list { display: flex; flex-direction: column; gap: 10px; }
/* 复习页列表较长时可滚动，避免被底部导航遮挡 */
#reviewList { max-height: calc(100vh - 560px); overflow-y: auto; padding-bottom: 12px; }
.wrong-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg); border-radius: 18px; padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(40,90,160,.10);
}
.wrong-emoji { font-size: 32px; }
.wrong-info { flex: 1; min-width: 0; }
.wrong-en { font-size: 18px; font-weight: 800; }
.wrong-zh { font-size: 13px; color: var(--ink-light); }
.wrong-times { font-size: 12px; color: var(--danger); font-weight: 700; background: #fff0f3; border-radius: 999px; padding: 3px 10px; flex-shrink: 0; }
.wrong-del { width: 40px; height: 40px; border-radius: 12px; background: #f1f5fa; font-size: 18px; flex-shrink: 0; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 36px 18px; }
.empty-emoji { font-size: 56px; margin-bottom: 10px; }
.empty p { color: var(--ink-light); margin-bottom: 16px; line-height: 1.7; }

/* ---------- 结果弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,50,80,.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-sheet {
  width: 100%; max-width: 380px; text-align: center;
  background: #fff; border-radius: 28px; padding: 30px 22px;
  animation: sheetUp .3s cubic-bezier(.2,.7,.3,1.2);
}
@keyframes sheetUp { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.result-emoji { font-size: 64px; }
.modal-sheet h2 { font-size: 22px; margin: 8px 0 16px; }
.result-stats { display: flex; justify-content: space-around; margin-bottom: 14px; }
.result-stat b { display: block; font-size: 26px; color: var(--primary-dark); }
.result-stat span { font-size: 13px; color: var(--ink-light); }
.result-msg { font-size: 14px; color: var(--ink-light); margin-bottom: 18px; line-height: 1.7; }
.result-btns { display: grid; gap: 10px; }

/* ---------- 撒星星特效 ---------- */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.fx-star {
  position: absolute; font-size: 26px;
  animation: fxFall 1.6s ease-in forwards;
}
@keyframes fxFall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: .6; }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 380px) {
  .mode-title { font-size: 15px; }
  .card-word { font-size: 28px; }
  .flip-inner { min-height: 300px; }
}

/* ---------- 批量加单词 ---------- */
.hint { font-size: 13px; color: var(--ink-light); line-height: 1.8; background: #f6f9ff; border-radius: 12px; padding: 10px 12px; }
#batchInput {
  width: 100%; padding: 12px; margin: 12px 0;
  font-size: 16px; font-family: inherit; line-height: 1.8;
  border: 2px solid #dbe6f3; border-radius: 14px; outline: none; resize: vertical;
}
#batchInput:focus { border-color: var(--blue); }
.add-result { margin-top: 12px; font-size: 14px; font-weight: 700; border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.add-result.ok { background: #eafff2; color: var(--success-dark); }
.add-result.warn { background: #fff7e6; color: #b26a00; }
.custom-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 540px); min-height: 120px; overflow-y: auto; padding-bottom: 12px; }
.custom-item { display: flex; align-items: center; gap: 10px; background: #f6f9ff; border-radius: 12px; padding: 8px 12px; }
.custom-item .ci-en { font-weight: 800; }
.custom-item .ci-zh { color: var(--ink-light); font-size: 13px; flex: 1; }

/* ---------- 打印单词表 ---------- */
.print-opts { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 12px 0 16px; font-size: 15px; }
.print-opts label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.print-opts select {
  padding: 8px 10px; border-radius: 10px; border: 2px solid #dbe6f3;
  font-size: 15px; font-weight: 700; color: var(--ink); background: #fff;
}
.font-label { flex-basis: 100%; }
#printFont { width: 170px; accent-color: var(--blue); }
.font-val { display: inline-block; min-width: 52px; font-size: 14px; color: var(--ink-light); }
.print-preview-card { overflow: auto; }

/* 打印纸样式（屏幕预览与打印共用），字号由 --print-font 控制 */
.sheet { --print-font: 13pt; }
.sheet-head h1 { font-size: calc(var(--print-font) + 5pt); margin-bottom: 8px; }
.sheet-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: calc(var(--print-font) - 2pt); color: #555; border-bottom: 2px solid #333;
  padding-bottom: 8px; margin-bottom: 12px;
}
.sheet-list { list-style: decimal; padding-left: 2.2em; }
.sheet-list li { padding: .35em 0; font-size: var(--print-font); break-inside: avoid; }
.sheet-list .s-zh { margin-left: .7em; color: #333; }
.sheet-list .s-ipa { color: var(--blue); }
.sheet-list .s-blank { display: inline-block; width: 11em; border-bottom: 1px dotted #999; margin-left: .8em; }
.sheet-list.two-col { column-count: 2; column-gap: 2.6em; }

/* 打印输出区：屏幕上隐藏，打印时独占页面 */
#printArea { display: none; }
@media print {
  @page { margin: 1.4cm; }
  body { background: #fff !important; padding: 0 !important; }
  .topbar, .grade-bar, .tabbar, .main, .modal, #fxLayer { display: none !important; }
  #printArea { display: block !important; }
  /* 字号沿用用户在滑块上选择的值 */
  .sheet-list li { font-size: var(--print-font); }
}

/* ============ 星星商店 ============ */
/* 首页英雄区：装扮 + 伙伴 */
.hero-stage { position: relative; display: inline-block; line-height: 1; }
.hero-hat {
  position: absolute; top: -14px; left: 50%; transform: translateX(-58%);
  font-size: 30px; z-index: 2;
}
.hero-pet {
  position: absolute; right: -28px; bottom: -8px;
  font-size: 32px; z-index: 2; animation: float 2.2s ease-in-out infinite;
}

/* 商店头部 */
.shop-hero { text-align: center; }
.shop-balance { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.shop-balance b {
  background: #fff3e0; color: var(--primary-dark);
  padding: 6px 14px; border-radius: 999px; margin-left: 6px;
}
.shop-double {
  margin-top: 10px; background: #eef4ff; color: #2b44b0;
  font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 12px;
}

/* 分类筛选条 */
.shop-filter {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 10px; scrollbar-width: none;
}
.shop-filter::-webkit-scrollbar { display: none; }
.shop-chip {
  flex-shrink: 0; background: rgba(255,255,255,.8);
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.shop-chip.active { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark); }

/* 商品网格 */
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 14px;
}
@media (min-width: 560px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
.shop-item {
  background: #fff; border-radius: 20px; padding: 16px 10px 14px;
  text-align: center; box-shadow: 0 6px 18px rgba(40,90,160,.12);
  display: flex; flex-direction: column; align-items: center;
}
.shop-item-emoji { font-size: 42px; line-height: 1.2; }
.shop-item-name { font-size: 15px; font-weight: 800; margin-top: 2px; }
.shop-item-desc { font-size: 12px; color: var(--ink-light); min-height: 32px; margin: 2px 0 8px; }
.shop-buy {
  margin-top: auto; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 800;
  background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark);
}
.shop-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-dark); }
.shop-buy.use {
  width: 100%; margin-bottom: 6px;
  background: #3742fa; box-shadow: 0 3px 0 #202bb5;
}
.shop-buy.owned { background: #fff3e0; color: var(--primary-dark); box-shadow: 0 3px 0 #f0c185; }
.shop-buy.equipped { background: var(--success); box-shadow: 0 3px 0 var(--success-dark); }
.shop-buy.poor { background: #e7eaf0; color: #9aa3b2; box-shadow: 0 3px 0 #ccd2dd; }

/* 背包 */
.shop-owned { display: flex; flex-wrap: wrap; }
.owned-chip {
  background: #f3f6fb; border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 700;
  margin: 0 6px 6px 0; color: var(--ink);
}
.owned-chip.on { background: #e8fbf0; color: var(--success-dark); }

/* ============ 打地鼠小游戏 ============ */
.game-sheet { max-width: 420px; }
.game-hud {
  display: flex; justify-content: space-between;
  font-size: 17px; font-weight: 800; color: var(--ink);
  margin-bottom: 12px; padding: 0 4px;
}
.game-hud b { color: var(--primary-dark); font-size: 20px; }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hole {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #c99a68, #96683c 70%, #7c5530);
  box-shadow: inset 0 10px 16px rgba(0,0,0,.30), 0 3px 0 rgba(0,0,0,.06);
  overflow: hidden; padding: 0;
}
.hole .mole {
  position: absolute; left: 50%; bottom: -62%;
  transform: translateX(-50%);
  font-size: clamp(30px, 9vw, 42px); line-height: 1;
  transition: bottom .11s ease-out;
  pointer-events: none;
}
.hole.up .mole { bottom: 8%; }
.hole.hit { animation: holeHit .28s ease; }
.hole.hit .mole { bottom: 8%; }
@keyframes holeHit {
  0% { filter: brightness(1); } 35% { filter: brightness(1.55); } 100% { filter: brightness(1); }
}
.hole.miss { animation: holeMiss .22s ease; }
@keyframes holeMiss {
  0%,100% { transform: none; } 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); }
}

/* 翻牌配对 */
.mem-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.mem-card {
  position: relative; aspect-ratio: 1; border-radius: 14px;
  background: #dfe6f5; border: none; padding: 0;
  font-size: clamp(26px, 8vw, 36px);
  transition: background .15s, transform .1s;
}
.mem-card:active { transform: scale(.94); }
.mem-face, .mem-pic {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.mem-pic { opacity: 0; }
.mem-card.flipped { background: #fff; box-shadow: 0 4px 10px rgba(40,90,160,.14); }
.mem-card.flipped .mem-face { opacity: 0; }
.mem-card.flipped .mem-pic { opacity: 1; }
.mem-card.done { background: #d9f7e6; box-shadow: inset 0 0 0 3px #2ed573; }
.mem-card.done .mem-face { opacity: 0; }
.mem-card.done .mem-pic { opacity: 1; }

/* 记忆序列 Simon */
.simon-status { text-align: center; font-size: 15px; font-weight: 800; color: var(--ink); margin: 2px 0 10px; }
.simon-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.simon-key {
  aspect-ratio: 1.5; border-radius: 20px; border: none;
  font-size: clamp(28px, 8vw, 40px); color: rgba(255,255,255,.9);
  text-shadow: 0 2px 4px rgba(0,0,0,.2);
  opacity: .72; transition: opacity .12s, transform .1s;
}
.simon-key:active { transform: scale(.96); }
.simon-key.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 22px rgba(255,255,255,.9); }

/* 轻提示 */
#shopToast {
  position: fixed; left: 50%; top: 18%; z-index: 100;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(47,53,66,.92); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s;
  max-width: 86%; text-align: center;
}
#shopToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 发音故障提示 */
.tts-hint {
  position: fixed; left: 50%; bottom: 96px; z-index: 100;
  transform: translateX(-50%);
  width: min(92vw, 380px);
}
.tts-hint-card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(30,50,80,.18);
  padding: 14px 16px;
  animation: hintPop .25s ease;
}
@keyframes hintPop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.tts-hint-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.tts-hint-card p { font-size: 13px; color: var(--ink-light); line-height: 1.6; margin-bottom: 10px; }
.tts-hint-btns { display: flex; gap: 10px; }
.btn-sm { padding: 8px 14px !important; font-size: 13px; flex: 1; }

/* 可兑换的页面背景 */
body[data-theme="night"]  { background: linear-gradient(180deg,#172a57 0%,#3a5d96 100%) fixed; }
body[data-theme="ocean"]  { background: linear-gradient(180deg,#0b6ea8 0%,#56c7e8 100%) fixed; }
body[data-theme="forest"] { background: linear-gradient(180deg,#2e7d4f 0%,#9bd17a 100%) fixed; }
body[data-theme="sunset"] { background: linear-gradient(180deg,#ff7e5f 0%,#feb96b 100%) fixed; }
body[data-theme="candy"] { background: linear-gradient(180deg,#ff9ab2 0%,#c9a0f1 100%) fixed; }
body[data-theme="sakura"] { background: linear-gradient(180deg,#ffb6d5 0%,#ffe9f2 100%) fixed; }
body[data-theme="mint"]   { background: linear-gradient(180deg,#5fd3b0 0%,#dcf9ec 100%) fixed; }
body[data-theme="ice"]    { background: linear-gradient(180deg,#8fc9ff 0%,#eaf6ff 100%) fixed; }
body[data-theme="grape"]  { background: linear-gradient(180deg,#8a6ee8 0%,#d2c2fb 100%) fixed; }
body[data-theme="rainbow"] {
  background: linear-gradient(180deg,#ff9a9e 0%,#fecfef 35%,#a1c4fd 70%,#c2e9fb 100%) fixed;
}

/* 7 个导航项时，窄屏收紧避免拥挤 */
.tabbar { gap: 2px; }
@media (max-width: 420px) {
  .tab { font-size: 12px; }
  .tab span { font-size: 20px; }
}

/* ============ 学单词 · 单元选择 ============ */
.unit-choice-list { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 540px); overflow-y: auto; padding-bottom: 12px; }
.unit-choice { text-align: left; background: #f7f9fe;
  border: 2px solid #e8edf7; border-radius: 18px;
  padding: 13px 15px; transition: transform .1s, border-color .15s;
}
.unit-choice:active { transform: scale(.98); }
.unit-choice:hover { border-color: #ffd8a8; }
.unit-choice.done { background: #f1faf4; border-color: #cdeedd; }
.uc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.uc-top b { font-size: 15px; font-weight: 800; }
.uc-status {
  flex-shrink: 0; font-size: 12px; font-weight: 800;
  background: #fff3e0; color: var(--primary-dark);
  padding: 3px 10px; border-radius: 999px;
}
.unit-choice.done .uc-status { background: #e1f6ea; color: var(--success-dark); }
.uc-bar { height: 8px; border-radius: 999px; background: #e6ebf4; overflow: hidden; }
.uc-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#ffc46b,#ff9f43); transition: width .3s; }
.unit-choice.done .uc-bar > div { background: linear-gradient(90deg,#5be291,#2ed573); }
.uc-meta { font-size: 12px; color: var(--ink-light); margin-top: 6px; }
