/* ===== 全局基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --pink: #FF6B9D;
  --purple: #9B7BE8;
  --blue: #5BB8FF;
  --green: #5ED49A;
  --yellow: #FFD23F;
  --orange: #FF9F5B;
  --bg: #FFF5F8;
  --card: #FFFFFF;
  --text: #3D3D5C;
  --text-light: #8A8AA8;
  --radius: 20px;
  --shadow: 0 6px 20px rgba(155, 123, 232, 0.15);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
h1, h2, h3 { font-weight: 700; }

/* ===== 启动屏 ===== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #FF6B9D, #9B7BE8);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; }
.splash-logo { font-size: 80px; animation: bounce 1.2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.splash-title { font-size: 32px; margin-top: 16px; letter-spacing: 2px; }
.splash-sub { font-size: 15px; opacity: .9; margin-top: 8px; }
.splash-load {
  width: 50px; height: 50px; margin: 30px auto 0;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 顶部栏 ===== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FF6B9D, #FF9F5B);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255,107,157,.3);
}
.app-title { flex: 1; text-align: center; font-size: 20px; }
.back-btn, .voice-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.25); color: #fff;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.back-btn { visibility: hidden; }
.back-btn.show { visibility: visible; }

/* ===== 主内容 ===== */
.app-main {
  padding: 16px 16px 90px;
  max-width: 640px; margin: 0 auto;
  min-height: calc(100vh - 60px);
}
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-subtitle {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
  color: var(--text);
}

/* ===== 首页 Hero ===== */
.hero {
  text-align: center; padding: 24px 0 16px;
}
.hero-emoji { font-size: 56px; }
.hero h2 { font-size: 22px; margin-top: 8px; }
.hero-date { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* ===== 今日推荐卡片 ===== */
.daily-card {
  background: linear-gradient(135deg, #FFE0EC, #F0E6FF);
  border-radius: var(--radius); padding: 20px;
  margin: 16px 0; position: relative;
  box-shadow: var(--shadow);
}
.daily-badge {
  display: inline-block; background: var(--pink); color: #fff;
  padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.daily-title { font-size: 22px; font-weight: 700; margin-top: 12px; }
.daily-desc { color: var(--text-light); font-size: 14px; margin-top: 4px; }
.daily-play {
  margin-top: 16px; padding: 12px 28px;
  background: var(--pink); color: #fff;
  border-radius: 24px; font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(255,107,157,.4);
}

/* ===== 模块网格 ===== */
.module-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px;
}
.module-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 14px;
  text-align: left; box-shadow: var(--shadow);
  transition: transform .15s;
}
.module-card:active { transform: scale(.96); }
.module-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.module-name { font-size: 17px; font-weight: 700; margin-top: 10px; }
.module-tip { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ===== 故事列表 ===== */
.story-list { display: flex; flex-direction: column; gap: 12px; }
.story-group-title {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 -2px;
}
.story-group-title:first-child { margin-top: 0; }
.level-badge {
  display: inline-block; color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 10px; white-space: nowrap;
}
.story-group-tip { font-size: 12px; color: var(--text-light); }
.story-level-row { text-align: center; margin-top: 8px; }
.story-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.story-item:active { transform: scale(.98); }
.story-cover {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  flex-shrink: 0;
}
.story-info { flex: 1; min-width: 0; }
.story-title { font-size: 16px; font-weight: 700; }
.story-cn { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.story-len { font-size: 12px; color: var(--pink); margin-top: 4px; }

/* ===== 故事详情 ===== */
.story-detail .story-hero {
  text-align: center; padding: 16px 0 20px;
}
.story-detail .story-hero-emoji { font-size: 64px; }
.story-detail h2 { font-size: 24px; margin-top: 12px; text-align: center; }
.story-detail .story-cn-full { text-align: center; color: var(--text-light); margin-top: 4px; }
.story-controls {
  display: flex; justify-content: center; gap: 12px; margin: 20px 0;
}
.story-controls button {
  padding: 12px 24px; border-radius: 24px; font-size: 15px; font-weight: 600;
}
.btn-play { background: var(--green); color: #fff; }
.btn-stop { background: var(--orange); color: #fff; }
.btn-replay { background: var(--blue); color: #fff; }
.story-text {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  line-height: 2; font-size: 17px; box-shadow: var(--shadow);
}
.story-text p { margin-bottom: 14px; }
.story-text .highlight {
  background: linear-gradient(180deg, transparent 60%, #FFE066 60%);
  font-weight: 600;
}
.story-text p.reading {
  background: #FFF3B0; border-radius: 8px;
  animation: pulse 1s ease;
}
.story-text p { cursor: pointer; padding: 4px 6px; border-radius: 8px; }
@keyframes pulse { 0%,100% { background: transparent; } 50% { background: #FFF3B0; border-radius: 8px; } }

/* ===== 单词分类 ===== */
.word-categories {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 12px;
  scrollbar-width: none;
}
.word-categories::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 600;
  background: #fff; color: var(--text-light); white-space: nowrap;
  box-shadow: var(--shadow);
}
.cat-chip.active { background: var(--purple); color: #fff; }
.word-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.word-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 8px;
  text-align: center; box-shadow: var(--shadow);
  transition: transform .15s;
}
.word-card:active { transform: scale(.94); }
.word-emoji { font-size: 42px; }
.word-en { font-size: 15px; font-weight: 700; margin-top: 6px; }
.word-cn { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ===== 句子列表 ===== */
.sentence-list { display: flex; flex-direction: column; gap: 10px; }
.sentence-item {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
}
.sentence-item:active { transform: scale(.98); }
.sentence-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.sentence-text { flex: 1; }
.sentence-en { font-size: 16px; font-weight: 600; }
.sentence-cn { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.sentence-play { font-size: 22px; color: var(--green); }

/* ===== 小游戏 ===== */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-card {
  background: var(--card); border-radius: var(--radius); padding: 22px 14px;
  text-align: center; box-shadow: var(--shadow);
}
.game-card:active { transform: scale(.96); }
.game-icon { font-size: 44px; }
.game-name { font-size: 16px; font-weight: 700; margin-top: 8px; }
.game-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* 游戏通用 */
.game-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.game-score { font-size: 18px; font-weight: 700; color: var(--purple); }
.game-feedback {
  text-align: center; font-size: 24px; line-height: 1.4; margin: 16px 0; min-height: 40px;
}

/* 听音选图 */
.listen-question {
  text-align: center; padding: 24px;
  background: linear-gradient(135deg, #E0F4FF, #F0E6FF);
  border-radius: var(--radius); margin-bottom: 16px;
}
.listen-q-text { font-size: 20px; font-weight: 700; margin-top: 8px; }
.listen-q-btn {
  margin-top: 12px; padding: 10px 24px; background: var(--blue); color: #fff;
  border-radius: 20px; font-size: 16px;
}
.listen-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.listen-opt {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  text-align: center; font-size: 50px; box-shadow: var(--shadow);
}
.listen-opt.correct { background: #D4F5E2; }
.listen-opt.wrong { background: #FFD4D4; }

/* 单词配对 */
.match-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.match-cell {
  aspect-ratio: 1; background: var(--card); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: var(--shadow);
  transition: transform .15s;
}
.match-cell.flipped { background: #F0E6FF; }
.match-cell.matched { background: #D4F5E2; }
.match-cell:active { transform: scale(.94); }

/* 拼写挑战 */
.spell-area { text-align: center; padding: 20px; }
.spell-emoji { font-size: 70px; }
.spell-word { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: 4px; }
.spell-cn { color: var(--text-light); margin-top: 4px; }
.spell-letters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px;
}
.spell-letter {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--purple); color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.spell-letter:disabled { opacity: .3; }
.spell-answer {
  display: flex; justify-content: center; gap: 6px; margin-top: 24px; min-height: 50px;
}
.spell-slot {
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; border: 2px dashed var(--text-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--purple);
}

/* 记忆翻牌 */
.memory-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.memory-card {
  aspect-ratio: 1; border-radius: 14px; background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: transparent;
  transition: all .2s;
}
.memory-card.open { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.memory-card.done { background: #D4F5E2; color: var(--text); }

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-around;
  background: #fff; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  max-width: 640px; margin: 0 auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-light); font-size: 10px; padding: 4px 7px;
  border-radius: 12px; flex: 1; min-width: 0;
}
.nav-item .nav-icon { font-size: 21px; }
.nav-item.active { color: var(--pink); }
.nav-item.active .nav-icon { transform: scale(1.1); }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 24px; width: 88%; max-width: 360px;
}
.modal-box h3 { font-size: 20px; margin-bottom: 20px; }
.setting-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.setting-row label { width: 70px; font-size: 14px; }
.setting-row input[type="range"] { flex: 1; }
.setting-row span { width: 32px; text-align: right; font-weight: 600; color: var(--purple); }
.setting-block { margin-bottom: 18px; }
.block-label { display: block; font-size: 14px; margin-bottom: 8px; }
.rate-chips { display: flex; gap: 8px; }
.rate-chip {
  flex: 1; padding: 9px 4px; border-radius: 12px; background: #F3F1F8;
  font-size: 13px; font-weight: 600; color: var(--text-light);
  border: 2px solid transparent;
}
.rate-chip.active { background: #FFF0F5; border-color: var(--pink); color: var(--pink); }
.setting-hint {
  font-size: 11px; color: var(--text-light); line-height: 1.5;
  margin: -6px 0 14px;
}
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #ccc; border-radius: 26px; transition: .3s;
}
.switch .slider:before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .3s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(22px); }
.modal-close {
  width: 100%; padding: 12px; background: var(--purple); color: #fff;
  border-radius: 14px; font-size: 16px; font-weight: 600; margin-top: 8px;
}
.modal-close.ghost { background: #F1F1F6; color: var(--text); }
.voice-test {
  width: 100%; padding: 11px; background: var(--green); color: #fff;
  border-radius: 14px; font-size: 15px; font-weight: 600; margin-top: 4px;
}

/* ===== 安装说明 ===== */
.install-how { font-size: 14px; line-height: 1.7; color: var(--text); }
.install-how p { margin-bottom: 8px; }
.install-how ol { margin: 6px 0 10px 18px; }
.install-how li { margin-bottom: 5px; }
.install-how .how-warn {
  background: #FFF4E5; color: #A15C00; border-radius: 10px;
  padding: 10px 12px; font-size: 13px;
}
.install-how .how-ok { color: var(--green); font-weight: 600; }
.install-how .how-note { font-size: 12px; color: var(--text-light); }

/* ===== 首页安装入口 ===== */
.install-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: linear-gradient(135deg, #EAF6FF, #F3EBFF);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 14px;
  box-shadow: var(--shadow); text-align: left;
}
.install-card-icon { font-size: 26px; }
.install-card-text { flex: 1; display: flex; flex-direction: column; }
.install-card-text b { font-size: 15px; color: var(--text); }
.install-card-text small { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.install-card-arrow { font-size: 22px; color: var(--purple); }

/* ===== 浏览器环境提示 ===== */
.env-tip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  display: none; align-items: center; gap: 10px;
  background: #FFF3D6; color: #8A5A00;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  font-size: 12px; line-height: 1.5;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
}
.env-tip.show { display: flex; }
.env-tip span { flex: 1; }
.env-tip .dismiss { background: none; color: #8A5A00; font-size: 20px; padding: 0 4px; }

/* ===== 安装提示 ===== */
.install-tip {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  display: none; align-items: center; gap: 10px; font-size: 13px; z-index: 90;
  max-width: 92%;
}
.install-tip.show { display: flex; }
.install-tip button { padding: 6px 14px; background: var(--green); color: #fff; border-radius: 12px; font-weight: 600; }
.install-tip .dismiss { background: none; color: var(--text-light); font-size: 20px; padding: 0 6px; }

/* ===== 学习记录 ===== */
.record-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--purple); }
.stat-num small { font-size: 13px; font-weight: 600; color: var(--text-light); margin-left: 3px; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.record-section {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.record-section h4 { font-size: 15px; margin-bottom: 12px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar {
  width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #FF9F5B, #FF6B9D);
  min-height: 3px; transition: height .3s;
}
.bar-item.today .bar { background: linear-gradient(180deg, var(--purple), var(--blue)); }
.bar-label { font-size: 10px; color: var(--text-light); }
.bar-val { font-size: 10px; color: var(--text-light); height: 12px; }
.record-list { display: flex; flex-direction: column; gap: 8px; }
.record-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #F8F6FF; border-radius: 12px; font-size: 14px;
}
.record-row .rr-main { flex: 1; min-width: 0; }
.record-row .rr-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.record-row .rr-score { color: var(--orange); font-weight: 700; font-size: 13px; }
.record-row .rr-done { font-size: 12px; color: var(--green); font-weight: 600; }
.record-row .rr-todo { font-size: 12px; color: var(--text-light); }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  background: linear-gradient(135deg, #E0F4FF, #F0E6FF);
  border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 600;
}
.word-chip small { font-weight: 400; color: var(--text-light); margin-left: 3px; }
.record-empty { text-align: center; color: var(--text-light); font-size: 14px; padding: 24px 0; }
.record-clear {
  width: 100%; padding: 12px; border-radius: 14px;
  background: #FFF0F0; color: #E5484D; font-size: 14px; font-weight: 600;
  margin-top: 4px;
}
.record-note { text-align: center; font-size: 11px; color: var(--text-light); margin-top: 10px; }

/* ===== 连续打卡 ===== */
.streak-card {
  background: linear-gradient(135deg, #FF9F5B, #FF6B9D);
  border-radius: var(--radius); padding: 18px 16px; color: #fff;
  margin-bottom: 14px; box-shadow: 0 8px 20px rgba(255,107,157,.3);
}
.streak-top { display: flex; align-items: center; gap: 12px; }
.streak-fire { font-size: 38px; }
.streak-num { font-size: 16px; font-weight: 600; }
.streak-num b { font-size: 27px; }
.streak-tip { font-size: 12px; opacity: .9; margin-top: 2px; }
.streak-dots { display: flex; gap: 6px; margin-top: 14px; }
.streak-dot {
  flex: 1; text-align: center; font-size: 11px; padding: 6px 0;
  border-radius: 10px; background: rgba(255,255,255,.22); color: rgba(255,255,255,.85);
}
.streak-dot.on { background: #fff; color: var(--pink); font-weight: 700; }
.streak-dot.today { box-shadow: inset 0 0 0 2px #fff; }

/* ===== 家长周报 ===== */
.weekly-card { border-top: 4px solid var(--yellow); }
.weekly-range { font-size: 12px; color: var(--text-light); margin: -4px 0 10px; }
.weekly-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.weekly-item { background: #F8F6FF; border-radius: 12px; padding: 10px 6px; text-align: center; }
.weekly-item b { display: block; font-size: 20px; color: var(--purple); }
.weekly-item span { font-size: 11px; color: var(--text-light); }
.weekly-compare {
  margin: 12px 0 4px; font-size: 13px; font-weight: 600;
  color: var(--pink); background: #FFF3F8; border-radius: 10px;
  padding: 8px 10px; text-align: center;
}
.weekly-block { margin-top: 14px; }
.weekly-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.weekly-advice {
  margin-top: 14px; font-size: 13px; line-height: 1.7;
  background: #FFF9E8; border-radius: 12px; padding: 12px; color: #7A5C00;
}

/* ===== 通用动画 ===== */
.correct-pop { animation: correctPop .4s ease; }
@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); background: #D4F5E2; }
  100% { transform: scale(1); }
}
.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* 响应式：平板/桌面居中 */
@media (min-width: 640px) {
  .app-main { padding-top: 20px; }
}

/* 关卡、最高记录、新游戏 */
.game-header { gap: 8px; flex-wrap: wrap; }
.game-level {
  font-size: 12px; font-weight: 700; color: #FF6B9D;
  background: #FFF0F6; padding: 4px 10px; border-radius: 20px;
}
.game-best { margin-top: 6px; font-size: 11px; font-weight: 700; color: #FF8AB0; }
.game-best:empty { display: none; }
.spell-letter.used { opacity: .35; }
.word-options, .cn-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.word-opt {
  padding: 16px 8px; border-radius: 16px; border: 2px solid #FFE0EC;
  background: #fff; font-size: 18px; font-weight: 800; color: #5A4653;
  font-family: inherit; cursor: pointer;
}
.word-opt.correct { background: #E7F9E9; border-color: #7ED08A; color: #2E8B57; }
.word-opt.wrong { background: #FFEAEA; border-color: #FF9A9A; color: #D9534F; }
.cn-question { text-align: center; margin: 18px 0 6px; }
.cn-word { font-size: 34px; font-weight: 900; color: #FF6B9D; letter-spacing: .5px; }
.cn-opt {
  padding: 14px 8px; border-radius: 16px; border: 2px solid #FFE0EC;
  background: #fff; font-size: 16px; font-weight: 700; color: #5A4653;
  font-family: inherit; cursor: pointer;
}
.cn-opt.correct { background: #E7F9E9; border-color: #7ED08A; color: #2E8B57; }
.cn-opt.wrong { background: #FFEAEA; border-color: #FF9A9A; color: #D9534F; }

/* ===== 磨耳朵连播 ===== */
.cont-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #FFF0F6, #F1E9FF);
  box-shadow: var(--shadow); text-align: left;
}
.cont-icon { font-size: 28px; }
.cont-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cont-text b { font-size: 16px; color: var(--text); }
.cont-text small { font-size: 12px; color: var(--text-light); }
.cont-arrow { font-size: 22px; color: var(--pink); }

.btn-loop-story {
  display: block; width: 100%; margin: -6px 0 18px;
  padding: 12px; border-radius: 22px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #FFE0EC, #EADFFF); color: #C23B76;
}

.mini-player {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 99; max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 10px 10px 14px; border-radius: 20px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 8px 24px rgba(155, 123, 232, .25);
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.mini-player.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mini-info { flex: 1; min-width: 0; }
.mini-title {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-sub {
  font-size: 11px; color: var(--text-light); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-btn {
  width: 34px; height: 34px; border-radius: 50%; font-size: 14px;
  background: #F7F3FF; color: #8A6FD1; flex: 0 0 34px;
}
.mini-btn.main {
  width: 42px; height: 42px; flex: 0 0 42px; font-size: 16px;
  background: linear-gradient(135deg, #FF8FB1, #FF6B9D); color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 157, .35);
}
.mini-btn.close { background: #FFF0F3; color: #FF6B9D; }
.mini-player { cursor: pointer; }
.mini-player .mini-btn { cursor: pointer; }
.sentence-item.reading {
  background: #FFF7E0;
  box-shadow: inset 0 0 0 2px #FFD166;
}
.word-card.reading {
  box-shadow: 0 0 0 3px #FFB3C7, 0 6px 18px rgba(255, 107, 157, .25);
  transform: translateY(-2px);
}
body.mini-on .app-main { padding-bottom: 170px; }

/* ===== 单词表 A-Z ===== */
.wordbook-entry {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  margin-bottom: 14px; padding: 13px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #EAF4FF, #F3EAFF);
  text-align: left; font-size: 15px; font-weight: 700; color: #4A5A8A;
  box-shadow: var(--shadow);
}
.wordbook-entry-tip { font-size: 12px; font-weight: 400; color: #8A93B2; }
.letter-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.letter-chips::-webkit-scrollbar { display: none; }
.letter-chip {
  flex: 0 0 auto; min-width: 34px; padding: 7px 10px; border-radius: 12px;
  background: #fff; color: #7A7A8C; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(155, 123, 232, .12);
}
.letter-chip.active { background: linear-gradient(135deg, #FF8FB1, #FF6B9D); color: #fff; }
.wordbook-count { font-size: 12px; color: var(--text-light); margin-bottom: 8px; padding-left: 2px; }
.wordbook-list { display: flex; flex-direction: column; gap: 8px; }
.wb-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: 14px; background: #fff;
  box-shadow: 0 2px 8px rgba(155, 123, 232, .10); text-align: left;
}
.wb-item:active { transform: scale(.985); }
.wb-en { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.wb-cn { font-size: 13px; color: var(--text-light); }
.wb-play { font-size: 16px; }
.wb-item.reading {
  box-shadow: 0 0 0 3px #FFB3C7, 0 6px 18px rgba(255, 107, 157, .25);
}

/* ===== 上一章 / 下一章 ===== */
.chapter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 10px 0 14px;
}
.chapter-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 600;
  background: #fff; color: #8A6FD1; box-shadow: 0 2px 8px rgba(155, 123, 232, .14);
}
.chapter-btn:disabled { opacity: .35; }
.chapter-pos { font-size: 12px; color: var(--text-light); }

/* 单词分类连读按钮 */
.word-play-bar { display: flex; gap: 8px; margin: 4px 0 12px; }
.word-play-bar .btn-loop-story { flex: 1; margin: 0; font-size: 13px; padding: 10px 6px; }
.word-play-bar .btn-loop-story.secondary { background: #F1EBFF; color: #8A6FD1; box-shadow: none; }

/* ===== 中文提示 ===== */
.cn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.story-cn-line {
  display: block; margin-top: 4px;
  font-size: 14px; line-height: 1.5; color: #9A8FA8; font-weight: 400;
  padding: 2px 6px; border-radius: 8px; transition: background .2s ease;
}
.cn-reading { background: #FFE3EC !important; color: #C23B76 !important; }
body.cn-off .story-cn-line,
body.cn-off .sentence-cn,
body.cn-off .word-cn,
body.cn-off .wb-cn { display: none; }

/* ===== 故事动画剧场 ===== */
.stage-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 18px 0 10px; padding: 8px 14px;
  border-radius: 14px;
}
.stage-head b { font-size: 15px; color: #6B5B8A; }
.stage-head span { font-size: 12px; color: #9A8FA8; }
.theater-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: #fff; border-radius: 18px; padding: 10px;
  box-shadow: 0 3px 12px rgba(92, 70, 145, .11);
  margin-bottom: 12px; text-align: left;
  transition: transform .15s ease;
}
.theater-card:active { transform: scale(.98); }
.theater-thumb {
  position: relative; flex: 0 0 116px; width: 116px; aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden; background: #EEE9F7;
}
.theater-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.theater-play-dot {
  position: absolute; inset: 0; margin: auto; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(45, 35, 70, .72); color: #fff;
  font-size: 13px; padding-left: 2px;
}
.theater-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.theater-card-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.theater-card-cn { font-size: 13px; color: #8A6FD1; font-weight: 600; margin-top: 3px; }
.theater-card-len { font-size: 11px; color: var(--text-light); margin-top: 5px; }
.theater-badge {
  flex-shrink: 0; align-self: flex-end; font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: 10px; background: #FFE0EC; color: #C23B76;
  white-space: nowrap;
}
.video-note {
  margin: 16px 8px 0; text-align: center;
  font-size: 11px; line-height: 1.6; color: #9A8FA8;
}
body.theater-open { overflow: hidden; }
.theater-player {
  display: none; position: fixed; inset: 0; z-index: 10001;
  width: 100vw; height: 100vh; height: 100dvh;
  overflow: hidden; background: #151225; color: #fff;
  touch-action: manipulation;
}
.theater-player.show { display: block; }
.theater-player:fullscreen { width: 100vw; height: 100vh; }
.theater-scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transform-origin: center;
}
.theater-scene.moving { animation: theaterKenBurns 14s ease-out both; }
@keyframes theaterKenBurns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.2%, -1%, 0); }
}
.theater-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 10, 28, .66) 0, transparent 22%, transparent 48%, rgba(12, 10, 28, .82) 100%);
}
.theater-top {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
}
.theater-icon-btn {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20, 17, 40, .48); color: #fff; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.theater-heading { flex: 1; min-width: 0; text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.theater-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theater-pos { margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.82); }
.theater-caption {
  position: absolute; z-index: 2; left: max(7vw, 28px); right: max(7vw, 28px);
  bottom: calc(88px + env(safe-area-inset-bottom));
  text-align: center; text-shadow: 0 2px 8px rgba(0,0,0,.75);
}
.theater-caption.line-in { animation: theaterLineIn .3s ease-out; }
@keyframes theaterLineIn {
  from { opacity: .3; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.theater-en {
  display: inline; font-size: clamp(21px, 3.2vw, 34px); font-weight: 700;
  line-height: 1.4; padding: 3px 8px; border-radius: 8px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.theater-en.reading { background: rgba(255, 210, 63, .24); color: #FFF4AF; }
.theater-cn {
  margin-top: 7px; font-size: clamp(15px, 2.1vw, 23px); line-height: 1.4;
  color: rgba(255,255,255,.94); padding: 3px 8px; border-radius: 8px;
}
.theater-cn.cn-reading { background: rgba(255, 107, 157, .4) !important; color: #fff !important; }
body.cn-off .theater-cn { display: none; }
.theater-status {
  position: absolute; z-index: 2; left: 20px; right: 20px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  text-align: center; font-size: 13px; color: #FFF4AF; pointer-events: none;
}
.theater-controls {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  bottom: calc(15px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 24px;
}
.theater-control {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(20, 17, 40, .58); color: #fff; font-size: 21px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.theater-control.main {
  width: 58px; height: 58px; background: #FF6B9D; font-size: 25px;
  box-shadow: 0 5px 20px rgba(255, 107, 157, .4);
}
.theater-progress {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255,255,255,.16);
}
.theater-progress span { display: block; width: 0; height: 100%; background: #FFD23F; transition: width .35s ease; }
.theater-rotate-tip {
  display: none; position: absolute; z-index: 4; top: 74px; left: 50%;
  transform: translateX(-50%); padding: 10px 16px; border-radius: 18px;
  background: rgba(20, 17, 40, .86); color: #fff; font-size: 13px; white-space: nowrap;
}
.theater-rotate-tip.show { display: block; }
@media (orientation: landscape) and (max-height: 500px) {
  .theater-top { padding-top: calc(6px + env(safe-area-inset-top)); }
  .theater-icon-btn { width: 40px; height: 40px; flex-basis: 40px; }
  .theater-caption { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .theater-controls { bottom: calc(10px + env(safe-area-inset-bottom)); gap: 22px; }
  .theater-control { width: 42px; height: 42px; }
  .theater-control.main { width: 50px; height: 50px; }
  .theater-status { bottom: calc(61px + env(safe-area-inset-bottom)); }
}
@media (orientation: portrait) {
  .theater-scene { object-fit: contain; }
  .theater-caption { left: 20px; right: 20px; bottom: calc(120px + env(safe-area-inset-bottom)); }
  .theater-en { font-size: clamp(20px, 5.6vw, 28px); }
  .theater-cn { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .theater-scene.moving, .theater-caption.line-in { animation: none; }
  .theater-progress span { transition: none; }
}
