/* =========================================================
 * 小熊猫英语乐园 - 样式
 * 移动端优先：大按钮、大圆角、暖色系、可爱动画
 * ========================================================= */

:root {
  --bg: #FFF8EC;
  --card: #FFFFFF;
  --ink: #4A3B32;
  --muted: #9A877A;
  --primary: #FF8C42;
  --primary-dark: #E9741F;
  --green: #4CAF7D;
  --green-dark: #3A9468;
  --pink: #E35D8F;
  --blue: #3AA7C9;
  --purple: #7E6BC4;
  --yellow: #FFD166;
  --danger: #E5484D;
  --radius: 20px;
  --shadow: 0 6px 20px rgba(163, 109, 45, 0.12);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body { overflow: hidden; }

#app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(120, 70, 20, 0.08);
  background: var(--bg);
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  flex: 0 0 auto;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
}

.logo-badge {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

.logo-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.topbar-stats {
  display: flex;
  gap: 6px;
}

.stat-chip {
  background: var(--card);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.stat-chip b { color: var(--primary-dark); }

/* ---------- 主视图 ---------- */
.view {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 96px;
  -webkit-overflow-scrolling: touch;
}

.page-head h1 {
  font-size: 22px;
  margin: 6px 0 2px;
}

.page-head p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.section-head a {
  color: var(--primary-dark);
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
  text-decoration: none;
  font-family: inherit;
  color: var(--ink);
  background: #F5EDE0;
}

.btn:active { transform: translateY(2px) scale(0.99); }

.btn-big {
  width: 100%;
  min-height: 54px;
  font-size: 17px;
  background: linear-gradient(180deg, #FFA85F, var(--primary));
  color: #FFF;
  box-shadow: 0 4px 0 var(--primary-dark), 0 8px 18px rgba(233, 116, 31, 0.3);
  border-radius: 18px;
}

.btn-big:active { box-shadow: 0 1px 0 var(--primary-dark), 0 4px 10px rgba(233, 116, 31, 0.25); }

.btn-ghost {
  width: 100%;
  background: var(--card);
  border: 2px solid #F0E3D0;
  color: var(--ink);
  box-shadow: none;
}

.btn-danger {
  background: #FDECEC;
  color: var(--danger);
  box-shadow: none;
}

.sound-btn {
  background: linear-gradient(180deg, #7FD3A8, var(--green));
  box-shadow: 0 4px 0 var(--green-dark), 0 8px 18px rgba(74, 175, 125, 0.3);
}

.sound-btn:active { box-shadow: 0 1px 0 var(--green-dark); }

/* ---------- 首页 ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 14px;
  background: linear-gradient(135deg, #FFE9D2, #FFF3E3 60%, #FFEAF2);
  border-radius: 24px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.hero-mascot { flex: 0 0 auto; }

.mascot-hero { animation: gentleBounce 3s ease-in-out infinite; }

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-bubble {
  position: relative;
  flex: 1;
  background: #FFF;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 3px 10px rgba(163, 109, 45, 0.12);
}

.hero-bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 28px;
  border: 10px solid transparent;
  border-right-color: #FFF;
  border-left: 0;
}

.mission-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(160deg, #FFF, #FFF3E4);
  border: 2px solid #FFE1BE;
}

.mission-card.done { border-color: #BFE8D2; background: linear-gradient(160deg, #FFF, #EAF9F0); }
.mission-card-left { flex: 0 0 auto; }
.mascot-sm { display: block; }
.mission-card-right { flex: 1; }

.mission-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

.mission-card.done .mission-label { color: var(--green-dark); }

.mission-title {
  font-size: 19px;
  font-weight: 900;
  margin: 2px 0;
}

.mission-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.panda-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panda-info { flex: 1; }
.panda-level-name { font-weight: 900; font-size: 15px; margin-bottom: 6px; }
.panda-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.panda-emoji { font-size: 20px; font-weight: 900; }

.panda-bar {
  height: 12px;
  background: #F3E8DA;
  border-radius: 999px;
  overflow: hidden;
}

.panda-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFD166, var(--primary));
  transition: width 0.5s ease;
}

.unit-preview-list { display: flex; flex-direction: column; gap: 8px; }

.unit-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF9F0;
  border-radius: 14px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid #F6E7D2;
}

.unit-preview.locked { opacity: 0.55; }

.up-emoji { font-size: 24px; }
.up-titles { flex: 1; display: flex; flex-direction: column; }
.up-titles b { font-size: 14px; }
.up-titles i { font-size: 12px; color: var(--muted); font-style: normal; }
.up-stars { font-weight: 800; font-size: 13px; }

/* ---------- 地图 ---------- */
.map-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 10px;
}

.map-node-wrap { display: flex; flex-direction: column; align-items: center; }
.map-connector {
  width: 6px;
  height: 34px;
  background: linear-gradient(#FFD9AE, #FFBE82);
  border-radius: 4px;
  margin: 2px 0;
}

.map-node-wrap.locked .map-connector { background: #E8DCCB; }

.map-node {
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(160deg, #FFF, #FFF3E4);
  border: 2px solid #FFE1BE;
  border-radius: 22px;
  padding: 14px 10px 12px;
  box-shadow: var(--shadow);
}

.map-node.done { border-color: #BFE8D2; background: linear-gradient(160deg, #FFF, #EAF9F0); }
.map-node-wrap.locked .map-node { background: #F4ECE1; border-color: #E4D8C8; opacity: 0.75; }

.map-node-badge {
  font-size: 38px;
  line-height: 1.1;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.1));
}

.map-node-name { font-size: 14px; font-weight: 900; }
.map-node-cn { font-size: 12px; color: var(--muted); }
.map-node-stars { font-size: 13px; font-weight: 800; margin-top: 2px; }

.map-node-wrap:not(.locked) .map-node { animation: islandFloat 3.5s ease-in-out infinite; }
.map-node-wrap:nth-child(2n):not(.locked) .map-node { animation-delay: 0.7s; }
.map-node-wrap:nth-child(3n):not(.locked) .map-node { animation-delay: 1.3s; }

@keyframes islandFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.locked-tip {
  text-align: center;
  font-size: 16px;
  line-height: 1.8;
  padding: 30px 20px;
}

/* ---------- 单元页 ---------- */
.unit-head {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--uc), color-mix(in srgb, var(--uc) 55%, #FFB36B));
  border-radius: 24px;
  padding: 18px;
  color: #FFF;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.unit-head-emoji { font-size: 46px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.2)); }
.unit-head-txt { flex: 1; }
.unit-head-txt h1 { margin: 0; font-size: 20px; }
.unit-head-txt p { margin: 2px 0 0; font-size: 14px; opacity: 0.92; }
.unit-head-stars { font-size: 18px; font-weight: 900; }

.unit-progress-card { padding: 14px 16px; }
.progress-label { font-size: 14px; font-weight: 800; margin-bottom: 7px; }
.progress-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

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

.act-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 12px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.act-card:active { border-color: var(--primary); }

.act-emoji { font-size: 30px; }
.act-name { font-weight: 900; font-size: 15px; }
.act-desc { font-size: 12px; color: var(--muted); min-height: 32px; }
.act-stars { font-size: 13px; letter-spacing: 1px; }

/* ---------- 闪卡 ---------- */
.flash-card {
  text-align: center;
  padding: 28px 18px;
  border: 2px solid #FFE1BE;
}

.flash-emoji { font-size: 84px; line-height: 1.2; }
.flash-en { font-size: 38px; font-weight: 900; letter-spacing: 1px; }
.flash-ipa { color: var(--muted); font-size: 15px; margin-top: 2px; }
.flash-zh { font-size: 18px; font-weight: 700; margin: 8px 0 18px; color: #7A5A40; }

.flash-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- 游戏通用 ---------- */
.game-wrap { min-height: 320px; }

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.game-title { font-weight: 900; font-size: 17px; }
.game-progress {
  background: #FFF;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.tile-btn {
  background: var(--card);
  border: 3px solid transparent;
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-size: 40px;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}

.tile-btn:active { transform: scale(0.96); }
.tile-emoji { font-size: 46px; }
.tile-word { font-size: 16px; font-weight: 800; color: var(--ink); }
.tile-ok { border-color: var(--green); background: #EAF9F0; animation: pop 0.35s ease; }
.tile-no { border-color: var(--danger); background: #FDECEC; animation: shake 0.4s ease; }

.big-emoji {
  text-align: center;
  font-size: 88px;
  padding: 10px 0 18px;
  animation: pop 0.4s ease;
}

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

.word-grid:has(.opt-btn:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }

.opt-btn {
  background: var(--card);
  border: 3px solid #F0E3D0;
  border-radius: 16px;
  min-height: 58px;
  padding: 8px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}

.opt-btn:active { transform: scale(0.96); }
.opt-ok { border-color: var(--green); background: #EAF9F0; animation: pop 0.35s ease; }
.opt-no { border-color: var(--danger); background: #FDECEC; animation: shake 0.4s ease; }

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

.match-card {
  position: relative;
  min-height: 92px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: transparent;
  padding: 0;
  perspective: 600px;
}

.match-card > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  backface-visibility: hidden;
  transition: transform 0.35s ease;
}

.match-back {
  background: linear-gradient(160deg, #FFB36B, var(--primary));
  color: #FFF;
  font-size: 26px;
  box-shadow: 0 3px 0 var(--primary-dark);
}

.match-front {
  background: var(--card);
  box-shadow: var(--shadow);
  border: 2px solid #F0E3D0;
  transform: rotateY(180deg);
}

.match-emoji { font-size: 32px; }
.match-word { font-weight: 900; font-size: 16px; }

.match-card.open .match-back { transform: rotateY(180deg); }
.match-card.open .match-front { transform: rotateY(0deg); }
.match-card.done .match-front { border-color: var(--green); background: #EAF9F0; }
.match-card.done .match-back { transform: rotateY(180deg); }
.match-card.done .match-front { transform: rotateY(0deg); }

/* ---------- 测验 ---------- */
.quiz-prompt { text-align: center; margin-bottom: 16px; }
.q-hint { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: #7A5A40; }
.quiz-word { font-size: 34px; font-weight: 900; margin-top: 6px; }

/* ---------- 结果 ---------- */
.result-card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.result-emoji { font-size: 64px; line-height: 1.1; }
.result-title { font-size: 22px; font-weight: 900; }
.result-stars { font-size: 26px; letter-spacing: 4px; }
.result-detail { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

.celebrate-gains {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0 8px;
}

.celebrate-gains span {
  background: #FFF4E4;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 800;
}

.unlock-tip {
  background: #EAF9F0;
  color: var(--green-dark);
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
}

.celebrate-card { border: 3px solid #FFE1BE; }

/* ---------- 反馈 / 彩带 ---------- */
.flash {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 17px;
  color: #FFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: flashPop 0.9s ease forwards;
  pointer-events: none;
}

.flash-ok { background: var(--green); }
.flash-no { background: var(--danger); }

@keyframes flashPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  25% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.95); }
}

@keyframes pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

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

.confetti {
  position: fixed;
  top: -20px;
  width: 11px;
  height: 18px;
  border-radius: 3px;
  z-index: 80;
  animation: confettiFall 2.8s ease-in forwards;
  pointer-events: none;
}

@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

/* ---------- 跟读 ---------- */
.speak-card { text-align: center; padding: 26px 18px; }
.speak-en { font-size: 30px; font-weight: 900; }
.speak-zh { color: var(--muted); font-size: 15px; margin: 6px 0 16px; }
.speak-result { margin-top: 10px; font-size: 14px; color: var(--green-dark); font-weight: 700; }
.recording { background: #FDECEC !important; color: var(--danger) !important; }

/* ---------- 歌曲 ---------- */
.song-card { text-align: center; }
.song-title { font-size: 20px; font-weight: 900; margin-bottom: 12px; }
.song-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  text-align: left;
}

.song-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF9F0;
  border: 2px solid #F6E7D2;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}

.song-line.playing { border-color: var(--primary); background: #FFF0DE; }
.song-idx {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFF;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.song-hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.song-done {
  background: #EAF9F0;
  color: var(--green-dark);
  font-weight: 900;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  animation: pop 0.4s ease;
}

/* ---------- AI 对话 ---------- */
.chat-wrap { display: flex; flex-direction: column; }
.chat-box { display: flex; flex-direction: column; gap: 10px; }
.chat-intro {
  background: #FFF3E4;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #8A5A30;
}

.chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.bubble {
  max-width: 82%;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  position: relative;
}

.bubble.bot {
  align-self: flex-start;
  background: #FFF;
  box-shadow: var(--shadow);
  border-bottom-left-radius: 4px;
  padding-right: 42px;
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(160deg, #FFA85F, var(--primary));
  color: #FFF;
  border-bottom-right-radius: 4px;
}

.bubble-zh { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.bubble-replay {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #FFF3E4;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
}

.chat-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.chip-btn {
  background: #FFF;
  border: 2px solid #FFE1BE;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: var(--shadow);
}

.chip-btn:disabled { opacity: 0.55; }
.chip-zh { font-size: 11px; color: var(--muted); font-weight: 600; }

.chat-done { text-align: center; padding: 10px 0; }
.chat-done-emoji { font-size: 44px; }
.chat-done-title { font-size: 18px; font-weight: 900; margin: 6px 0 12px; }

/* ---------- 每日任务 ---------- */
.mission-head { margin: 4px 0 12px; }
.mission-step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.mission-step-dots span {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #F0E3D0;
  transition: background 0.3s;
}

.mission-step-dots span.on { background: linear-gradient(90deg, var(--primary), #FFD166); }

.mission-step-label {
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.step-sub { font-size: 12px; color: var(--muted); font-weight: 700; }

.mission-intro { text-align: center; padding: 26px 18px; }
.intro-emoji { font-size: 72px; }
.intro-title { font-size: 22px; font-weight: 900; margin: 6px 0; }
.intro-text { font-size: 15px; color: #7A5A40; line-height: 1.7; margin-bottom: 10px; }
.intro-note {
  display: inline-block;
  background: #FFF3E4;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

/* ---------- 家长端 ---------- */
.pin-card { text-align: center; padding: 26px 16px; }
.pin-dots { font-size: 30px; letter-spacing: 12px; margin-bottom: 18px; color: var(--primary-dark); }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-key {
  min-height: 58px;
  border-radius: 16px;
  border: none;
  background: #FFF9F0;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 3px 0 #EFDCC2;
}

.pin-key:active { transform: translateY(2px); box-shadow: none; }
.pin-error { color: var(--danger); font-size: 13px; margin-top: 14px; font-weight: 700; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card b { font-size: 20px; font-weight: 900; color: var(--primary-dark); }
.stat-card i { font-size: 11px; font-style: normal; color: var(--muted); }

.week-row { display: flex; justify-content: space-between; gap: 6px; }
.week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #F7EFE3;
  border-radius: 12px;
  padding: 8px 2px;
  font-size: 13px;
}

.week-day.done { background: #EAF9F0; }
.week-day i { font-size: 10px; font-style: normal; color: var(--muted); }

.unit-bar-list { display: flex; flex-direction: column; gap: 9px; }
.unit-bar-row { display: flex; align-items: center; gap: 8px; }
.ub-name { width: 92px; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.unit-bar-row .panda-bar { flex: 1; }
.ub-num { font-size: 12px; font-weight: 800; color: var(--muted); }

.vocab-detail { display: flex; flex-direction: column; gap: 6px; }
.vocab-unit summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 4px;
  border-radius: 10px;
}

.vocab-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
}

.vocab-item {
  background: #FFF9F0;
  border: 1px solid #F6E7D2;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border-bottom: 1px dashed #F0E3D0;
  padding-bottom: 6px;
}

.log-item span { color: var(--muted); flex: 0 0 auto; font-size: 11px; }
.log-item b { flex: 1; font-weight: 700; }
.log-item i { font-style: normal; color: var(--primary-dark); font-weight: 800; }
.log-empty { color: var(--muted); font-size: 13px; }

.settings-form { display: flex; flex-direction: column; gap: 12px; }
.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  color: #7A5A40;
}

.settings-form input[type="text"],
.settings-form input[type="password"],
.settings-form input:not([type]),
.settings-form select {
  border: 2px solid #F0E3D0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: #FFF;
  font-family: inherit;
}

.settings-form input:focus, .settings-form select:focus { outline: none; border-color: var(--primary); }

.settings-form input[type="range"] { accent-color: var(--primary); }
.range-val { color: var(--primary-dark); font-size: 15px; }

.toggle-row { flex-direction: row !important; align-items: center; justify-content: space-between; }
.toggle-row input { width: 44px; height: 26px; accent-color: var(--green); }

.settings-divider {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  border-top: 2px dashed #F0E3D0;
  padding-top: 12px;
}

.settings-tip {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 0;
  line-height: 1.6;
  font-weight: 500;
}

.data-actions { display: flex; gap: 10px; }
.data-actions .btn { flex: 1; }

.tips-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.tips-list li { font-size: 13px; line-height: 1.6; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #F0E3D0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 0;
  border-radius: 12px;
}

.tabbar a span { font-size: 22px; line-height: 1; }
.tabbar a.active { color: var(--primary-dark); background: #FFF3E4; }

/* ---------- 吉祥物动画 ---------- */
.mascot .mascot-tail {
  transform-origin: 160px 168px;
  animation: tailWag 2.6s ease-in-out infinite;
}

@keyframes tailWag {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-9deg); }
}

.mascot .mascot-eyes {
  transform-origin: 104px 88px;
  animation: blink 5s infinite;
}

@keyframes blink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.08); }
}

.mascot .mascot-ear {
  transform-origin: 66px 42px;
  animation: earTwitchL 4s ease-in-out infinite;
}

.mascot .mascot-ear.ear-r { transform-origin: 142px 42px; animation-name: earTwitchR; }

@keyframes earTwitchL {
  0%, 86%, 100% { transform: rotate(-18deg); }
  90% { transform: rotate(-28deg); }
}

@keyframes earTwitchR {
  0%, 86%, 100% { transform: rotate(18deg); }
  90% { transform: rotate(28deg); }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 380px) {
  .logo-name { display: none; }
  .hero-bubble { font-size: 13px; }
  .act-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-head-stars { font-size: 15px; }
}

@media (min-width: 561px) {
  .view { padding-left: 20px; padding-right: 20px; }
}
