/* =========================================================
   奶蛙 DSE 中文 · 卷一練習
   奶蛙黃 / 奶油白 / 暖棕 / 圓體 / 誇張貼紙感
   ========================================================= */

:root {
  --bg: #FFF9EC;
  --bg-2: #FFF3D6;
  --bg-3: #FFE9B8;
  --ink: #342814;
  --ink-soft: #5E4A1E;
  --muted: #7A5A1E;
  --line: #EAD3A0;
  --line-strong: #DDB86A;
  --card: #FFFDF6;
  --yellow: #FFD23F;
  --yellow-2: #FFC42E;
  --yellow-deep: #F2A81E;
  --orange: #E8912D;
  --brown: #6B4A12;
  --success: #5CBE78;
  --success-soft: #E9F7EA;
  --success-line: #B7E2C0;
  --red: #F4704E;
  --red-soft: #FFE8DE;
  --red-line: #F6C2B2;
  --shadow: 0 8px 0 rgba(107, 74, 18, .08), 0 18px 30px rgba(107, 74, 18, .08);
  --shadow-sm: 0 4px 0 rgba(107, 74, 18, .07), 0 8px 18px rgba(107, 74, 18, .06);
  --radius: 26px;
  --radius-sm: 18px;
  --nav-h: 76px;
  --font: "Yuanti TC", "Yuanti SC", "YouYuan", "幼圓", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, #FFF9EC 0%, #FFF3D6 52%, #FFE9B8 100%) fixed;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(255, 196, 46, .55); }
:focus-visible { outline: 3px solid var(--yellow-deep); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- 背景奶蛙 ---------- */

.naiwa-watermark {
  position: fixed;
  z-index: 0;
  pointer-events: none;
}
.naiwa-watermark svg { width: 100%; height: 100%; display: block; }
.naiwa-watermark--lg {
  width: min(46vw, 440px);
  height: min(46vw, 440px);
  right: -80px;
  bottom: -90px;
  opacity: .13;
  transform: rotate(-12deg);
}
.naiwa-watermark--sm {
  width: min(23vw, 200px);
  height: min(23vw, 200px);
  left: -50px;
  top: 9vh;
  opacity: .08;
  transform: rotate(10deg);
}

/* ---------- 基本佈局 ---------- */

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 18px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom));
}

.loading {
  min-height: 70vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.frog { width: 120px; height: 120px; display: block; }
.frog--small { width: 72px; height: 72px; }
.frog--tiny { width: 42px; height: 42px; }
.frog--bounce { animation: naiwa-bounce 2.6s ease-in-out infinite; }

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  color: var(--orange);
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* ---------- 貼紙按鈕 ---------- */

.btn {
  --btn-bg: var(--yellow-2);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 13px 22px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, opacity .1s ease;
  box-shadow: 0 5px 0 var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--wide { width: 100%; }
.btn--small {
  min-height: 46px;
  padding: 8px 15px;
  font-size: 14px;
  border-width: 2.5px;
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
}
.btn--small:active { transform: translateY(3px); box-shadow: none; }
.btn--ghost { --btn-bg: var(--card); }
.btn--soft { --btn-bg: var(--yellow); }
.btn--danger {
  --btn-bg: var(--red-soft);
  --btn-ink: var(--red);
  border-color: var(--red);
  box-shadow: 0 3px 0 var(--red);
}
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 3px solid var(--line-strong);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 4px 0 var(--line);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--back svg { transform: rotate(180deg); }

.card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- 頂欄 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--ink);
}
.brand__mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--card);
  border: 3px solid var(--yellow);
  box-shadow: 0 4px 0 var(--yellow-deep);
  display: grid;
  place-items: center;
  transform: rotate(-3deg);
  transition: transform .15s ease;
}
.brand:hover .brand__mark { transform: rotate(6deg); }
.brand__mark .frog { width: 38px; height: 38px; }
.brand small {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--muted);
  margin-top: -2px;
}

/* ---------- 首頁主卡 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 20px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 8%, #FFF3D0 0, #FFF3D0 16%, transparent 52%),
    linear-gradient(160deg, #FFFDF6 0%, #FFF7E4 55%, #FFEFC8 100%);
  border: 3px solid var(--yellow);
  box-shadow: 0 9px 0 rgba(242, 168, 30, .20), 0 20px 30px rgba(107, 74, 18, .10);
  margin-bottom: 18px;
}
.hero::after {
  content: "哈";
  position: absolute;
  right: -16px;
  bottom: -52px;
  z-index: 0;
  font-size: 180px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 196, 46, .20);
  transform: rotate(-14deg);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  transform: rotate(-1.5deg);
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card);
  color: var(--brown);
  border: 2px solid var(--line-strong);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.streak svg { width: 15px; height: 15px; color: var(--orange); }

.hero__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.hero__copy { flex: 1; min-width: 0; }
.hero h1 {
  font-size: clamp(24px, 6.8vw, 40px);
  line-height: 1.18;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.hero h1 .ha { color: var(--orange); }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 58%, rgba(255, 196, 46, .75) 58%);
  padding: 0 4px;
  border-radius: 4px;
}
.hero__sub {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  max-width: 22em;
}

.hero__mascot {
  position: relative;
  flex: none;
  width: 132px;
  height: 132px;
  transform: rotate(-4deg);
  animation: naiwa-bob 3s ease-in-out infinite;
}
.hero__mascot .frog { width: 100%; height: 100%; }
.speech {
  position: absolute;
  top: -4px;
  left: -14px;
  z-index: 2;
  padding: 2px 8px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 12px 12px 12px 3px;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  transform: rotate(-9deg);
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
}

.hero__bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.hero__bottom .btn { flex: 1; min-height: 56px; }

.ring {
  --p: 0%;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--yellow-2) var(--p), rgba(255, 210, 63, .22) 0);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
  position: relative;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--card);
}
.ring span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.02em;
}
.ring small {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  margin-top: -2px;
}

/* ---------- 快捷統計 ---------- */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.quick-stat {
  padding: 14px 10px;
  border-radius: 20px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 rgba(234, 211, 160, .9);
  text-align: center;
}
.quick-stat b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}
.quick-stat span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

/* ---------- 區塊標題 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 12px;
}
.section-head h2 {
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--ink);
}
.section-head span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

/* ---------- 12 篇卡 ---------- */

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

.text-card {
  position: relative;
  display: block;
  padding: 17px 18px 15px;
  border-radius: 22px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  -webkit-tap-highlight-color: transparent;
}
.text-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  background: var(--accent, var(--yellow-deep));
}
.text-card:hover {
  transform: translateY(-3px) rotate(-.4deg);
  border-color: var(--yellow-deep);
  box-shadow: 0 8px 0 rgba(242, 168, 30, .15), 0 12px 24px rgba(107, 74, 18, .10);
}
.text-card:active { transform: translateY(1px); }
.text-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.text-card__num {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--accent, var(--orange));
}
.text-card__cat {
  font-size: 10px;
  font-weight: 800;
  color: var(--brown);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.text-card h3 {
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: .01em;
  color: var(--ink);
  margin-bottom: 2px;
}
.text-card__source {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.progress {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--yellow-2));
  transition: width .4s ease;
}
.text-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.text-card__foot .go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent, var(--orange));
  font-weight: 900;
}
.text-card__foot .go svg { width: 14px; height: 14px; }

/* ---------- 篇章詳情 ---------- */

.text-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 28px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.text-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--accent, var(--yellow-deep));
}
.text-hero__cat {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 10px;
}
.text-hero h1 {
  font-size: clamp(27px, 7vw, 38px);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 4px;
}
.text-hero__source { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.text-hero__intro { color: var(--ink-soft); font-size: 15px; font-weight: 600; line-height: 1.8; }

.key-points {
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--bg-2);
  border: 3px solid var(--yellow);
  margin-bottom: 16px;
}
.key-points h2 {
  font-size: 14px;
  font-weight: 900;
  color: var(--brown);
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.key-points li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  margin: 5px 0;
}
.key-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow-deep);
}

.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.lesson-card__copy { min-width: 0; }
.lesson-card__copy h3 { font-size: 19px; color: var(--ink); margin-bottom: 3px; }
.lesson-card__copy p { font-size: 12px; color: var(--muted); font-weight: 600; }
.lesson-card .btn { flex: none; }

/* ---------- 測驗 ---------- */

.quiz-shell { padding-bottom: 90px; }

.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.quiz-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  overflow: hidden;
}
.quiz-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--yellow-deep));
  transition: width .35s ease;
}
.quiz-count {
  font-size: 12px;
  font-weight: 900;
  color: var(--brown);
  min-width: 36px;
  text-align: right;
}

.quiz-main { animation: fadeUp .28s ease both; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 12px;
  transform: rotate(-2deg);
}

.question {
  font-size: clamp(22px, 5.6vw, 28px);
  line-height: 1.55;
  letter-spacing: .01em;
  color: var(--ink);
  margin-bottom: 20px;
}

.options { display: grid; gap: 10px; }

.option {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 16px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  text-align: left;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .1s ease, box-shadow .1s ease;
  box-shadow: 0 4px 0 var(--line);
  -webkit-tap-highlight-color: transparent;
}
.option:not([disabled]):hover {
  border-color: var(--yellow-deep);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--yellow-deep);
}
.option:not([disabled]):active { transform: translateY(3px); box-shadow: none; }
.option__key {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
  margin-top: 1px;
}
.option__body { flex: 1; min-width: 0; }
.option__icon { flex: none; width: 22px; height: 22px; display: none; margin-top: 3px; }

.option--correct {
  border-color: var(--success);
  background: var(--success-soft);
  box-shadow: 0 4px 0 var(--success);
}
.option--correct .option__key { background: var(--success); border-color: var(--success); color: #fff; }
.option--correct .option__icon { display: block; color: var(--success); }

.option--wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 4px 0 var(--red);
}
.option--wrong .option__key { background: var(--red); border-color: var(--red); color: #fff; }
.option--wrong .option__icon { display: block; color: var(--red); }

.option--dim { opacity: .55; }
.option[disabled] { cursor: default; }

.feedback {
  position: relative;
  margin-top: 16px;
  padding: 16px 17px;
  border-radius: 20px;
  border: 3px solid var(--line);
  background: var(--card);
  animation: fadeUp .25s ease both;
}
.feedback--correct { border-color: var(--success-line); background: var(--success-soft); }
.feedback--wrong { border-color: var(--red-line); background: var(--red-soft); }
.feedback__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 6px;
}
.feedback--correct .feedback__head { color: #2E7D4F; }
.feedback--wrong .feedback__head { color: #B4472D; }
.feedback__head svg { width: 20px; height: 20px; }
.feedback p {
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.75;
  padding-right: 44px;
}
.feedback__mascot {
  position: absolute;
  top: -18px;
  right: 10px;
  width: 58px;
  height: 58px;
  transform: rotate(8deg);
}
.feedback__mascot svg { width: 100%; height: 100%; }

.quote-card {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 253, 246, .8);
  border: 2px dashed var(--line-strong);
}
.quote-card__label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 5px;
}
.quote-card p {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--ink);
  padding-right: 0;
}

.quiz-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(255, 249, 236, 0));
}
.quiz-foot__inner { max-width: 780px; margin: 0 auto; }

/* ---------- 結果 ---------- */

.result {
  position: relative;
  text-align: center;
  padding-top: 8px;
  animation: fadeUp .35s ease both;
}
.result .frog {
  width: 170px;
  height: 170px;
  margin: 0 auto 6px;
}
.result h1 {
  font-size: clamp(52px, 16vw, 76px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 4px 0 2px;
}
.result h1 small {
  font-size: .4em;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
}
.result__xp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 20px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}
.result-stat {
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(234, 211, 160, .9);
}
.result-stat b {
  display: block;
  font-size: 22px;
  color: var(--ink);
}
.result-stat span { font-size: 11px; color: var(--muted); font-weight: 800; }

.result-actions { display: grid; gap: 10px; margin-top: 18px; }

.wrong-review { text-align: left; margin-top: 26px; }
.wrong-review h2 {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 10px;
}
.wrong-item {
  padding: 16px;
  border-radius: 20px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(234, 211, 160, .9);
  margin-bottom: 10px;
}
.wrong-item__q {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 8px;
}
.wrong-item__a {
  font-size: 13px;
  color: #2E7D4F;
  font-weight: 900;
  margin-bottom: 6px;
}
.wrong-item__e { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.7; }

/* ---------- 錯題 / 統計 / 關於 ---------- */

.page-title {
  font-size: clamp(28px, 7.4vw, 38px);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 4px;
}
.page-sub { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 20px; }

.empty {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 3px dashed var(--line-strong);
}
.empty .frog { width: 130px; height: 130px; margin: 0 auto 10px; }
.empty h2 { font-size: 21px; color: var(--ink); margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 14px; font-weight: 600; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(234, 211, 160, .9);
}
.stat-card b {
  display: block;
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
}
.stat-card span { font-size: 11px; color: var(--muted); font-weight: 800; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 124px;
  padding: 14px 16px 10px;
  border-radius: 20px;
  background: var(--card);
  border: 3px solid var(--line);
  margin-bottom: 20px;
}
.bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
}
.bar-chart__bar {
  width: 100%;
  max-width: 28px;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: var(--yellow);
  border: 1px solid rgba(107, 74, 18, .15);
  transition: height .3s ease;
}
.bar-chart__col--today .bar-chart__bar { background: var(--orange); }
.bar-chart__label { font-size: 9px; color: var(--muted); font-weight: 800; }

.text-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 17px;
  background: var(--card);
  border: 2px solid var(--line);
  margin-bottom: 8px;
}
.text-stat-row__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-stat-row__bar {
  flex: none;
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.text-stat-row__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow-2);
}
.text-stat-row__num {
  flex: none;
  width: 34px;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.about-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(234, 211, 160, .9);
  margin-bottom: 12px;
}
.about-card h2 {
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
}
.about-card p, .about-card li {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.8;
}
.about-card ul { margin-top: 4px; }
.about-card li { position: relative; padding-left: 15px; }
.about-card li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--orange);
  font-weight: 900;
}
.goal-row { display: flex; gap: 8px; margin-top: 10px; }
.goal-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 14px;
  border: 3px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
}
.goal-btn--active {
  background: var(--yellow);
  border-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

/* ---------- 底部導航 ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 249, 236, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 3px solid var(--yellow);
}
.bottom-nav__inner {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px 5px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: color .12s ease, background .12s ease, transform .12s ease;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item--active {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 3px 0 var(--yellow-deep);
  transform: translateY(-1px);
}

/* ---------- 動畫 ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes naiwa-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes naiwa-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1); }
  50% { transform: translateY(-8px) rotate(2deg) scale(1.03); }
}
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.anim-pop { animation: pop .3s ease; }
.anim-shake { animation: shake .25s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 平板 / 桌面 ---------- */

@media (min-width: 560px) {
  .app { padding-left: 24px; padding-right: 24px; }
  .text-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 24px 26px 24px; }
  .hero__mascot { width: 160px; height: 160px; }
  .quiz-main { max-width: 620px; margin: 0 auto; }
  .quiz-top { max-width: 620px; margin-left: auto; margin-right: auto; }
  .quiz-foot__inner { max-width: 620px; }
  .result, .wrong-review { max-width: 620px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 760px) {
  .app { padding-top: 30px; }
  .hero h1 { font-size: 44px; }
  .hero__mascot { width: 184px; height: 184px; }
  .text-grid { gap: 14px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 22px; }
  .hero__mascot { width: 100px; height: 100px; }
}

@media (max-width: 560px) {
  .naiwa-watermark--lg { width: 280px; height: 280px; right: -100px; bottom: -80px; }
  .naiwa-watermark--sm { width: 120px; height: 120px; left: -40px; top: 12vh; }
}

/* 結果頁奶蛙碎念 */
.result__quip {
  margin: -10px 0 18px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 700;
}

/* 結果頁貼紙徽章 */
.result .eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  transform: rotate(-2deg);
  color: var(--ink);
}

/* =========================================================
   真奶蛙圖 + 圖鑑 + 奶蛙舞
   ========================================================= */

.frog {
  width: 120px;
  height: 120px;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.hero__mascot .frog { width: 100%; height: 100%; }
.result__mascot {
  width: 170px;
  height: 170px;
  object-fit: contain;
  margin: 0 auto 6px;
  mix-blend-mode: multiply;
}
.brand__img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.nav-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.feedback__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.naiwa-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* 圖鑑入口 */
.mood-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: -8px 0 22px;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 0 rgba(234, 211, 160, .9);
  transition: transform .12s ease, border-color .12s ease;
}
.mood-link:hover { transform: translateY(-2px); border-color: var(--yellow-deep); }
.mood-link img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  mix-blend-mode: multiply;
  flex: none;
}
.mood-link__copy { flex: 1; min-width: 0; }
.mood-link__copy b { display: block; font-size: 15px; color: var(--ink); }
.mood-link__copy small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.mood-link svg { width: 20px; height: 20px; color: var(--orange); flex: none; }

/* 圖鑑頁 */
.gallery-progress {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 14px;
  margin-bottom: 16px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 13px;
  font-weight: 900;
  transform: rotate(-1deg);
}
.gallery-progress b { font-size: 20px; }
.meme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.meme-card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(234, 211, 160, .9);
}
.meme-card__img {
  aspect-ratio: 1 / 1;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.meme-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}
.meme-card__img.is-locked img {
  filter: grayscale(1) blur(6px);
  opacity: .35;
  transform: scale(1.1);
}
.meme-card__body { padding: 12px 13px 14px; }
.meme-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.meme-card__top h3 { font-size: 17px; color: var(--ink); }
.meme-card__badge {
  font-size: 9px;
  font-weight: 900;
  background: var(--success-soft);
  color: #2E7D4F;
  border: 1.5px solid var(--success-line);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}
.meme-card__badge--lock {
  background: var(--bg-2);
  color: var(--muted);
  border-color: var(--line);
}
.meme-card__body p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 600;
}

/* 五格導航 */
.bottom-nav__inner { grid-template-columns: repeat(5, 1fr); }
.nav-item { font-size: 9.5px; }

/* 奶蛙舞 */
.dance-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(52, 40, 20, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeUp .2s ease both;
}
.dance-card {
  width: min(360px, 100%);
  padding: 22px 20px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 10px 0 var(--ink);
  text-align: center;
}
.dance-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 0 auto 6px;
  mix-blend-mode: multiply;
  animation: naiwa-dance .8s ease-in-out infinite;
}
.dance-card h2 { font-size: 24px; color: var(--ink); }
.dance-card p {
  margin: 4px 0 18px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
@keyframes naiwa-dance {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  25% { transform: rotate(8deg) scale(1.06); }
  50% { transform: rotate(-6deg) scale(1.02); }
  75% { transform: rotate(6deg) scale(1.08); }
}

/* 白底奶蛙照：當成貼紙 */
.frog--sticker {
  background: #FFF;
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 4px 0 rgba(107, 74, 18, .10);
}
.feedback__img {
  background: #FFF;
  border-radius: 14px;
}

/* 奶蛙游標（桌面） */
body {
  cursor: url("memes/cursor-naiwa-32.png") 2 2, auto;
}
a, button, .option, .text-card, .nav-item, .goal-btn, .mood-link {
  cursor: url("memes/cursor-naiwa-32.png") 2 2, pointer;
}

/* 可戳的奶蛙 */
button.hero__mascot {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* 連擊 */
.combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 0 0 12px 6px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
  transform: rotate(1deg);
  vertical-align: middle;
}
.combo img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* 答題奶蛙碎念 */
.feedback__quip {
  margin: -2px 0 8px;
  padding-right: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

/* 分享提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 22px);
  transform: translateX(-50%);
  z-index: 200;
  max-width: 90vw;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #FFF9EC;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 8px 24px rgba(52, 40, 20, .28);
  animation: fadeUp .2s ease both;
}

/* 圖鑑大圖 */
.meme-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(52, 40, 20, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeUp .2s ease both;
}
.meme-modal__card {
  width: min(360px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 10px 0 var(--ink);
  text-align: center;
}
.meme-modal__img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin: 0 auto 6px;
  mix-blend-mode: multiply;
}
.meme-modal__card h2 {
  font-size: 24px;
  color: var(--ink);
}
.meme-modal__card p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}
.meme-modal__card .tiny {
  font-size: 12px;
  color: var(--muted);
}
.meme-modal__actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

/* 圖鑑卡可以是 button */
.meme-card { display: block; }
button.meme-card {
  width: 100%;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

/* 戳我提示 */
.poke-hint {
  position: absolute;
  left: -10px;
  bottom: -8px;
  z-index: 3;
  padding: 2px 7px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 10px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  animation: poke-bob 1.8s ease-in-out infinite;
}
@keyframes poke-bob {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-3px); }
}

/* 成績分享卡 */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(52, 40, 20, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeUp .2s ease both;
}
.share-modal__card {
  width: min(360px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 14px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--ink);
  text-align: center;
}
.share-modal__img {
  width: 100%;
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  background: var(--bg);
}
.share-modal__actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
