/* ================= 数学小火龙 · 童趣风格 ================= */
:root {
  --c-bg-top: #aee6ff;
  --c-bg-bottom: #fff3c4;
  --c-primary: #ff7043;
  --c-primary-dark: #e64a19;
  --c-green: #66bb6a;
  --c-red: #ef5350;
  --c-yellow: #ffd54f;
  --c-blue: #42a5f5;
  --c-purple: #ab47bc;
  --c-ink: #4e342e;
  --c-card: #ffffff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-pop: 0 6px 0 rgba(0, 0, 0, 0.12), 0 10px 24px rgba(0, 0, 0, 0.15);
  --font-fun: "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-fun);
  color: var(--c-ink);
  background: linear-gradient(180deg, var(--c-bg-top) 0%, var(--c-bg-bottom) 100%);
  overflow-x: hidden;
  user-select: none;
}

/* 飘浮的云朵背景 */
body::before, body::after {
  content: "☁";
  position: fixed;
  font-size: 90px;
  color: rgba(255, 255, 255, 0.75);
  animation: drift 60s linear infinite;
  pointer-events: none;
  z-index: 0;
}
body::before { top: 8%; left: -120px; }
body::after { top: 28%; left: -220px; font-size: 60px; animation-duration: 85s; animation-delay: -30s; }

@keyframes drift { to { transform: translateX(calc(100vw + 300px)); } }

#app { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 20px 16px 120px; min-height: 100dvh; }

.screen.hidden, .hidden { display: none !important; }

/* ---------- 首页 ---------- */
.home-hero { text-align: center; padding: 40px 0 24px; animation: pop-in 0.5s ease; }
.app-title {
  font-size: clamp(34px, 7vw, 56px);
  color: var(--c-primary-dark);
  text-shadow: 3px 3px 0 #ffe0b2, 6px 6px 0 rgba(0,0,0,0.08);
  letter-spacing: 4px;
}
.app-en { font-size: clamp(16px, 3vw, 24px); font-weight: 900; letter-spacing: 3px; color: var(--c-blue); margin-top: 8px; text-transform: uppercase; }
.app-slogan { font-size: 14px; letter-spacing: 4px; color: #ab47bc; margin-top: 2px; }
.app-subtitle { font-size: clamp(16px, 3vw, 22px); margin-top: 10px; color: #7b5e57; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding: 16px 8px; }

.module-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 20px;
  border: 5px solid #fff;
  border-radius: var(--radius-lg);
  background: var(--c-card);
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.module-card:hover { transform: translateY(-6px) scale(1.03); }
.module-card:active { transform: scale(0.97); }
.module-add { background: linear-gradient(160deg, #fff 60%, #ffe0d3); }
.module-sub { background: linear-gradient(160deg, #fff 60%, #d7f0d7); }
.module-emoji { font-size: 64px; }
.module-name { font-size: 28px; font-weight: 900; color: var(--c-ink); }
.module-add .module-name { color: #d84315; }
.module-sub .module-name { color: #2e7d32; }
.module-desc { font-size: 15px; color: #9e9e9e; }

/* ---------- 设置页 ---------- */
.setup-title { text-align: center; font-size: clamp(26px, 5vw, 40px); margin: 20px 0; color: var(--c-primary-dark); text-shadow: 2px 2px 0 #ffe0b2; }
.setup-block { margin: 26px 0; }
.setup-label { font-size: 22px; margin-bottom: 14px; }

.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px 10px;
  border: 4px solid #fff;
  border-radius: var(--radius-md);
  background: var(--c-card);
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  color: var(--c-ink);
  transition: transform 0.15s ease;
}
.level-card:hover { transform: translateY(-4px); }
.level-card.selected { border-color: var(--c-yellow); background: #fffde7; transform: scale(1.05); box-shadow: var(--shadow-pop); }
.level-big { font-size: 40px; font-weight: 900; color: var(--c-blue); }
.level-tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; margin-top: 6px; }
.tag-easy { background: #c8e6c9; color: #2e7d32; }
.tag-mid { background: #fff9c4; color: #f57f17; }
.tag-hard { background: #ffcdd2; color: #c62828; }

.count-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.count-pill {
  padding: 14px 26px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: var(--c-card);
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  font-family: inherit;
  font-size: 20px;
  cursor: pointer;
  color: var(--c-ink);
  transition: transform 0.15s ease;
}
.count-pill:hover { transform: scale(1.08); }
.count-pill.selected { background: var(--c-primary); color: #fff; transform: scale(1.1); box-shadow: var(--shadow-pop); }

.btn-start {
  display: block; margin: 36px auto 0;
  padding: 20px 70px;
  font-family: inherit; font-size: 28px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ffb74d, var(--c-primary));
  border: 5px solid #fff; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-start:hover:not(:disabled) { transform: scale(1.06); animation: wiggle 0.4s ease; }
.btn-start:disabled { filter: grayscale(0.9); opacity: 0.6; cursor: not-allowed; }

.btn-back {
  margin-top: 8px; padding: 10px 22px;
  font-family: inherit; font-size: 18px; color: var(--c-ink);
  background: rgba(255,255,255,0.8);
  border: 3px solid #fff; border-radius: 999px;
  cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}

/* ---------- 答题页 ---------- */
.quiz-header { display: flex; align-items: center; gap: 14px; padding: 8px 0 16px; }
.btn-quit, .btn-quit:active { font-size: 26px; padding: 8px 14px; background: #fff; border: 3px solid #fff; border-radius: 14px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.1); }
.quiz-progress { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.progress-track { height: 18px; background: rgba(255,255,255,0.7); border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--c-yellow), var(--c-primary)); border-radius: 999px; transition: width 0.4s ease; }
.progress-text { font-size: 14px; color: #7b5e57; }
.quiz-score { font-size: 24px; font-weight: 900; color: #f57f17; background: #fff; padding: 6px 16px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,0.1); }

.question-bubble {
  margin: 8px auto 4px; max-width: 560px;
  padding: 12px 24px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
  font-size: 19px;
  text-align: center;
  animation: pop-in 0.4s ease;
}
.question-bubble::after { content: ""; position: absolute; }

.equation {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 34px;
  font-size: clamp(40px, 9vw, 68px);
  font-weight: 900;
}
.num {
  min-width: 1.6em; padding: 6px 16px;
  background: #fff; border-radius: 20px;
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.op { color: var(--c-purple); }
.op.op-mul { color: #e91e63; }
.eq-sign { color: var(--c-ink); }
.eq-normal-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.equation.eq-mode { flex-direction: column; }
.eq-x-row {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px; width: 100%;
}
.eq-full { width: 100%; min-width: 0; text-align: center; }
.eq-full .num, .num.eq-full { padding: 6px 16px; }
.var-x {
  display: inline-block;
  color: #6a1b9a; background: #ede7f6;
  border: 3px dashed #b39ddb; border-radius: 16px;
  padding: 2px 14px;
  transform: rotate(-4deg);
}

.answer-box {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.2em; height: 1.7em;
  padding: 0 12px;
  background: #fff9c4;
  border: 6px dashed var(--c-primary);
  border-radius: 24px;
  color: #b0b0b0;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.answer-box.drag-over { transform: scale(1.12); border-style: solid; background: #ffe0b2; }
.answer-box.correct { border-style: solid; border-color: var(--c-green); background: #c8e6c9; color: #1b5e20; animation: bounce 0.5s ease; }
.answer-box.wrong { border-style: solid; border-color: var(--c-red); background: #ffcdd2; color: #b71c1c; animation: shake 0.45s ease; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 480px; margin: 0 auto; }
@media (min-width: 560px) { .options { grid-template-columns: repeat(4, 1fr); } }

.option {
  padding: 22px 10px;
  font-family: inherit;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  color: var(--c-ink);
  background: var(--c-card);
  border: 4px solid #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s ease;
}
.option:nth-child(1) { border-color: #ffcc80; }
.option:nth-child(2) { border-color: #a5d6a7; }
.option:nth-child(3) { border-color: #90caf9; }
.option:nth-child(4) { border-color: #ce93d8; }
.option:hover { transform: translateY(-5px) rotate(-1deg); }
.option.dragging { opacity: 0.45; cursor: grabbing; }
.option.faded { opacity: 0.3; pointer-events: none; }
.option.is-correct-reveal { background: #c8e6c9; animation: bounce 0.6s ease; }

.drag-ghost {
  position: fixed; z-index: 200;
  pointer-events: none;
  padding: 18px 30px;
  font-size: 34px; font-weight: 900;
  background: #fff; border: 4px solid var(--c-yellow);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%) scale(1.1);
}

/* ---------- 错题解析 ---------- */
.explain-panel {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in 0.25s ease;
  padding: 16px;
}
.explain-card {
  width: min(560px, 94vw);
  max-height: 86dvh; overflow-y: auto;
  background: #fff;
  border: 6px solid var(--c-yellow);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  animation: pop-in 0.35s ease;
  text-align: center;
}
.explain-title { font-size: 26px; color: var(--c-primary-dark); margin-bottom: 18px; }
.explain-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.btn-show-explain, .btn-skip {
  padding: 16px 34px;
  font-family: inherit; font-size: 21px; font-weight: 900;
  border: 4px solid #fff; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  cursor: pointer; color: #fff;
  transition: transform 0.15s ease;
}
.btn-show-explain { background: linear-gradient(180deg, #ffb74d, var(--c-primary)); }
.btn-skip { background: linear-gradient(180deg, #64b5f6, #1e88e5); }
.btn-show-explain:hover, .btn-skip:hover { transform: scale(1.06); }
.explain-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.explain-step {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff8e1;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-20px);
  animation: slide-in 0.4s ease forwards;
}
.explain-step .step-icon { font-size: 26px; }
.explain-step .step-text { flex: 1; text-align: left; }
.explain-step .step-math { color: var(--c-blue); white-space: nowrap; }
.explain-step.final { background: #c8e6c9; }

.btn-continue {
  padding: 16px 44px;
  font-family: inherit; font-size: 22px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #66bb6a, #43a047);
  border: 4px solid #fff; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
}
.btn-continue:hover { transform: scale(1.05); }

/* ---------- 结果页 ---------- */
.result-card {
  max-width: 480px; margin: 60px auto 0;
  padding: 40px 28px;
  background: #fff;
  border: 6px solid var(--c-yellow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  text-align: center;
  animation: pop-in 0.5s ease;
}
.result-title { font-size: 34px; color: var(--c-primary-dark); }
.result-stars { font-size: 52px; margin: 16px 0; letter-spacing: 8px; }
.result-stars .star { display: inline-block; opacity: 0; transform: scale(0); animation: star-pop 0.5s ease forwards; }
.result-stars .star:nth-child(2) { animation-delay: 0.25s; }
.result-stars .star:nth-child(3) { animation-delay: 0.5s; }
.result-accuracy { font-size: 24px; font-weight: 900; color: var(--c-blue); margin: 8px 0; }
.result-msg { font-size: 18px; color: #7b5e57; margin: 10px 0 24px; }
.result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-retry, .btn-home {
  padding: 14px 30px;
  font-family: inherit; font-size: 20px; font-weight: 900;
  border: 4px solid #fff; border-radius: 999px;
  cursor: pointer; color: #fff;
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s ease;
}
.btn-retry { background: linear-gradient(180deg, #ffa726, var(--c-primary)); }
.btn-home { background: linear-gradient(180deg, #64b5f6, #1e88e5); }
.btn-retry:hover, .btn-home:hover { transform: scale(1.06); }

/* ---------- 首页打卡状态与功能入口 ---------- */
.home-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 4px 0 18px; }
.stat-chip {
  padding: 8px 18px;
  background: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  font-size: 16px;
}
.stat-chip.done { background: #c8e6c9; color: #1b5e20; }
.stat-chip.todo { background: #fff9c4; color: #f57f17; }
.home-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.btn-home-action.install { background: linear-gradient(160deg, #fff 60%, #e3f2fd); color: #1565c0; }

/* 收藏到桌面弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(40, 30, 10, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 24px; padding: 26px 30px;
  max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-card h3 { margin: 0 0 14px; color: #e65100; font-size: 22px; }
.install-steps { text-align: left; color: #5d4037; font-size: 15px; line-height: 1.8; }
.install-steps p { margin: 8px 0; }
@keyframes modal-pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.btn-home-action {
  padding: 16px 34px;
  font-family: inherit; font-size: 21px; font-weight: 900; color: #fff;
  border: 4px solid #fff; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-home-action:hover { transform: scale(1.06); }
.btn-home-action.challenge { background: linear-gradient(180deg, #ba68c8, #8e24aa); }
.btn-home-action.report { background: linear-gradient(180deg, #4fc3f7, #0288d1); }

/* 乘除模块卡片配色 */
.module-mult { background: linear-gradient(160deg, #fff 60%, #e1d7f5); }
.module-mult .module-name { color: #6a1b9a; }
.module-div { background: linear-gradient(160deg, #fff 60%, #d4ecfa); }
.module-div .module-name { color: #01579b; }
.module-eq { background: linear-gradient(160deg, #fff 60%, #ffe8cc); }
.module-eq .module-name { color: #e65100; }
.module-py { background: linear-gradient(160deg, #fff 60%, #f3e5f5); }
.module-py .module-name { color: #6a1b9a; }

/* 版本号 + 检查更新 */
.ver-row { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.ver-row em { font-size: 12px; color: rgba(255,255,255,0.75); font-style: normal; opacity: 0.9; }
.ver-row button {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: #fff; background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 999px; padding: 5px 14px; transition: all 0.15s;
}
.ver-row button:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.ver-row button:active { transform: scale(0.95); }
.ver-row button:disabled { opacity: 0.6; cursor: wait; }

/* ---------- 拼音王国 ---------- */
.py-intro { text-align: center; color: #6a1b9a; font-weight: 700; font-size: 17px; margin: 6px 0 12px; }
.py-pools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.py-pool-tab {
  font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  color: #6a1b9a; background: #f3e5f5; border: 2px solid transparent;
  border-radius: 999px; padding: 7px 16px; transition: all 0.15s;
}
.py-pool-tab:hover { border-color: #ab47bc; }
.py-pool-tab.active { background: #6a1b9a; color: #fff; transform: scale(1.06); }
/* 学习乐园里的发音按钮 */
.py-speak {
  font-family: inherit; font-size: 18px; cursor: pointer;
  background: #f3e5f5; border: 2px solid #ce93d8; border-radius: 999px;
  padding: 4px 12px; margin: 0 4px; transition: transform 0.12s;
}
.py-speak:hover { transform: scale(1.15); background: #e1bee7; }
.py-speak:active { transform: scale(0.92); }
.py-tone { display: inline-flex; align-items: center; margin: 0 8px; font-size: 26px; font-weight: 900; color: #6a1b9a; }
.py-tone i { font-size: 12px; font-weight: 600; color: #8e24aa; margin-left: 4px; font-style: normal; }
.py-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 560px; margin: 0 auto; }
.py-mode-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border: 3px solid #e1bee7; border-radius: 22px;
  padding: 22px 16px; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 16px rgba(106, 27, 154, 0.12);
  transition: transform 0.15s;
}
.py-mode-card:hover { transform: translateY(-4px) scale(1.03); }
.py-progress { text-align: center; font-weight: 800; color: #8e24aa; font-size: 16px; }
.py-target {
  font-size: 64px; font-weight: 900; color: #6a1b9a; text-align: center;
  background: #f3e5f5; border-radius: 24px; padding: 10px 40px; margin: 14px auto;
  display: table; cursor: pointer; user-select: none;
  min-width: 120px; min-height: 100px; line-height: 100px;
}
.py-target:active { transform: scale(0.96); }
.py-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 420px; margin: 16px auto; }
.py-option {
  font-family: inherit; font-size: 34px; font-weight: 900; color: #4a148c;
  background: #fff; border: 3px solid #ce93d8; border-radius: 18px;
  padding: 18px 10px; cursor: pointer; transition: transform 0.12s;
}
.py-option:hover:not(:disabled) { transform: scale(1.05); border-color: #ab47bc; }
.py-option.right { background: #c8e6c9; border-color: #43a047; animation: pop-in 0.3s; }
.py-option.wrong { background: #ffcdd2; border-color: #e53935; animation: shake 0.4s; }
.py-option:disabled { opacity: 0.9; cursor: default; }
.py-note {
  max-width: 480px; margin: 12px auto; text-align: center;
  background: #fff8e1; border: 2px dashed #ffca28; border-radius: 16px;
  padding: 10px 16px; color: #6d4c41; font-size: 16px;
}
.py-note strong { color: #6a1b9a; font-size: 22px; }
.py-finish { text-align: center; background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 8px 24px rgba(106, 27, 154, 0.15); }
.py-finish-title { font-size: 26px; font-weight: 900; color: #6a1b9a; }
.py-finish-score { font-size: 20px; color: #4a148c; margin: 12px 0 6px; }
.py-finish-stars { font-size: 15px; color: #f57f17; margin-bottom: 16px; }
.py-finish-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 学习乐园 ---------- */
.learn-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.learn-tab {
  border: 2px solid #ffd54f; background: #fff; color: #795548;
  padding: 10px 18px; border-radius: 999px; font-size: 16px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.learn-tab:hover { transform: translateY(-2px) scale(1.04); }
.learn-tab.active { background: #ffb300; color: #fff; border-color: #ff8f00; box-shadow: 0 4px 12px rgba(255, 143, 0, 0.4); }
.learn-card { background: #fff; border-radius: 22px; padding: 24px 26px; box-shadow: 0 8px 24px rgba(66, 66, 66, 0.12); }
.learn-title { font-size: 20px; font-weight: 800; color: #4e342e; text-align: center; margin-bottom: 16px; }
.learn-steps { display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.learn-step {
  display: flex; align-items: center; gap: 12px; background: #fff8e1;
  border: 2px solid #ffe082; border-radius: 16px; padding: 12px 16px;
  opacity: 0; transform: translateY(14px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.learn-step.show { opacity: 1; transform: translateY(0) scale(1); }
.learn-step.final { background: #e8f5e9; border-color: #a5d6a7; }
.step-icon { font-size: 24px; flex-shrink: 0; }
.step-text { font-size: 15px; color: #5d4037; font-weight: 600; }
.step-math { margin-left: auto; font-size: 20px; font-weight: 800; color: #e65100; white-space: nowrap; }
.learn-step.final .step-math { color: #2e7d32; font-size: 24px; }
.learn-actions { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---------- 家长报告 ---------- */
.report-summary { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.report-block { max-width: 640px; margin: 0 auto 28px; }
.report-empty { text-align: center; color: #9e9e9e; padding: 16px; font-size: 17px; }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 16px; }
.stat-name { width: 120px; font-weight: 700; }
.stat-bar { flex: 1; height: 16px; background: rgba(255,255,255,0.8); border-radius: 999px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.stat-rate { width: 52px; font-weight: 900; text-align: right; }
.stat-detail { color: #9e9e9e; font-size: 13px; white-space: nowrap; }
.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06);
  font-size: 17px;
}
.wrong-expr { font-weight: 900; color: #2e7d32; }
.wrong-mine { color: #c62828; font-size: 14px; }
.wrong-date { margin-left: auto; color: #b0b0b0; font-size: 13px; }
.btn-start.small { font-size: 20px; padding: 14px 44px; margin-top: 20px; }

/* ---------- 战绩卡 ---------- */
.share-card {
  display: block;
  width: min(420px, 92%);
  margin: 6px auto 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
}
.btn-download {
  display: block; margin: 16px auto 0;
  padding: 14px 34px;
  font-family: inherit; font-size: 19px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ab47bc, #7b1fa2);
  border: 4px solid #fff; border-radius: 999px;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-download:hover { transform: scale(1.05); }
.btn-download.hidden { display: none; }

/* ---------- 背景音乐开关 ---------- */
.music-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  width: 52px; height: 52px;
  font-size: 26px; line-height: 1;
  background: #fff;
  border: 4px solid var(--c-yellow);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.music-toggle:hover { transform: scale(1.12) rotate(8deg); }
.music-toggle:active { transform: scale(0.95); }

/* ---------- 作者信息 ---------- */
.site-footer {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 12px 90px;
  font-size: 14px;
  color: #8d6e63;
  text-align: center;
}
.footer-links { display: flex; gap: 14px; }
.site-footer a {
  color: #e64a19; text-decoration: none; font-weight: 700;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid #fff; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}
.site-footer a:hover { transform: scale(1.1); }

/* ---------- 小火龙吉祥物 ---------- */
.dragon {
  position: fixed; right: 10px; bottom: 6px; z-index: 50;
  width: 130px; height: 150px;
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: dragon-idle 2.6s ease-in-out infinite;
}
.dragon svg { width: 100%; height: 100%; overflow: visible; }
.dragon:hover { transform: scale(1.1); }
.dragon.happy { animation: dragon-happy 0.6s ease; }
.dragon.sad { animation: dragon-sad 0.6s ease; }
body.fx-shake-heavy { animation: screen-shake-heavy 2.6s ease; }
@keyframes screen-shake-heavy {
  0%, 100% { transform: translate(0, 0); }
  5% { transform: translate(-18px, 12px) rotate(-0.8deg); }
  10% { transform: translate(16px, -14px) rotate(0.8deg); }
  15% { transform: translate(-15px, 10px); }
  20% { transform: translate(14px, 12px) rotate(-0.7deg); }
  26% { transform: translate(-13px, -11px); }
  32% { transform: translate(12px, 10px) rotate(0.6deg); }
  40% { transform: translate(-11px, 9px); }
  48% { transform: translate(10px, -9px) rotate(-0.5deg); }
  56% { transform: translate(-9px, 8px); }
  64% { transform: translate(8px, 7px); }
  72% { transform: translate(-7px, -6px) rotate(0.4deg); }
  80% { transform: translate(6px, 5px); }
  88% { transform: translate(-4px, 4px); }
  94% { transform: translate(3px, -2px); }
}

.dragon.breathing { animation: dragon-breathe 1.4s ease; }

/* 🔥 大招按钮：位于火龙上方，答对10题解锁 */
.dragon-ult {
  position: fixed; right: 14px; bottom: 185px; z-index: 51;
  padding: 10px 20px;
  font-family: inherit; font-size: 17px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ff8a65, #e64a19);
  border: 3px solid #fff; border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 120, 40, 0.7), var(--shadow-pop);
  cursor: pointer;
  transition: transform 0.15s ease;
  animation: ult-glow 1.6s ease-in-out infinite;
}
.dragon-ult:hover { transform: scale(1.1); }
.dragon-ult.hidden { display: none; }
@keyframes ult-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 120, 40, 0.5), var(--shadow-pop); }
  50% { box-shadow: 0 0 26px rgba(255, 150, 60, 0.95), var(--shadow-pop); }
}

/* 离家出走：扇着翅膀飞走 */
.dragon.leaving { animation: dragon-leave 1.7s ease-in forwards; }
@keyframes dragon-leave {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  30% { transform: translate(6vw, -6vh) rotate(-12deg); }
  60% { transform: translate(18vw, -22vh) rotate(12deg); opacity: 1; }
  100% { transform: translate(40vw, -55vh) rotate(-10deg) scale(0.5); opacity: 0; }
}
/* 溜达回来：从右上角飞回 */
.dragon.returning { animation: dragon-return 1.6s ease-out; }
@keyframes dragon-return {
  0% { transform: translate(40vw, -55vh) rotate(10deg) scale(0.5); opacity: 0; }
  50% { transform: translate(15vw, -20vh) rotate(-10deg); opacity: 1; }
  100% { transform: translate(0, 0) rotate(0) scale(1); }
}

/* 喷火时的蓄力 + 吐火姿势 */
@keyframes dragon-breathe {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(6px) scale(0.92) rotate(6deg); }
  40% { transform: translateY(-16px) scale(1.18) rotate(-14deg); }
  60% { transform: translateY(-10px) scale(1.14) rotate(-10deg); }
  80% { transform: translateY(-4px) scale(1.05) rotate(-4deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

/* 冰火特效开场时的全屏震动 */
body.fx-shake { animation: screen-shake 1.2s ease; }
@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  8% { transform: translate(-12px, 8px) rotate(-0.5deg); }
  16% { transform: translate(11px, -9px) rotate(0.5deg); }
  24% { transform: translate(-10px, -7px); }
  32% { transform: translate(9px, 7px) rotate(-0.4deg); }
  40% { transform: translate(-8px, 6px); }
  50% { transform: translate(7px, -6px) rotate(0.3deg); }
  60% { transform: translate(-6px, 5px); }
  70% { transform: translate(5px, -4px); }
  80% { transform: translate(-4px, 3px); }
  90% { transform: translate(3px, -2px); }
}
.dragon.speaking .dragon-mouth { animation: talk 0.35s ease-in-out infinite; }

/* 进化演出 */
.evolution-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,241,118,0.9), rgba(0,0,0,0.85));
  animation: fade-in 0.4s ease;
}
.evo-dragon { width: min(300px, 60vw); animation: evo-shake 0.4s ease infinite; filter: drop-shadow(0 0 40px #ffd54f); }
.evo-dragon.evolved { animation: evo-burst 0.7s ease forwards; }
.evo-text {
  margin-top: 24px; font-size: clamp(30px, 7vw, 52px); font-weight: 900;
  color: #fff; text-shadow: 0 0 20px #ffb300, 4px 4px 0 rgba(0,0,0,0.3);
  opacity: 0; animation: pop-in 0.5s ease 0.5s forwards;
}

.fx-canvas { position: fixed; inset: 0; z-index: 140; pointer-events: none; }

/* ---------- 动画 ---------- */
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { to { opacity: 1; transform: translateX(0); } }
@keyframes bounce { 0%,100% { transform: scale(1); } 40% { transform: scale(1.25); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes star-pop { to { opacity: 1; transform: scale(1); } }
@keyframes dragon-idle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes dragon-happy { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-30px) scale(1.1) rotate(-6deg); } 60% { transform: translateY(-10px) rotate(6deg); } }
@keyframes dragon-sad { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
@keyframes talk { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.3); } }
@keyframes evo-shake { 0%,100% { transform: scale(1); } 25% { transform: scale(1.02) rotate(-2deg); } 75% { transform: scale(1.02) rotate(2deg); } }
@keyframes evo-burst { 0% { transform: scale(1); filter: brightness(1); } 40% { transform: scale(0.92); filter: brightness(3) blur(2px); } 100% { transform: scale(1.15); filter: brightness(1); } }

@media (max-width: 480px) {
  .dragon { width: 96px; height: 112px; }
  .explain-step { font-size: 18px; }
}
