:root,
body.set-ng {
  --paper: #fff4e3;
  --card: #fffaf1;
  --ink: #2b1b12;
  --muted: #7a5840;
  --tiger: #e26a12;
  --tiger-dark: #b84b08;
  --gold: #ffd56a;
  --leaf: #2f7d4a;
  --shadow: 0 10px 24px rgba(84, 42, 12, 0.12);
  --wash: #ffe7bf;
  --wash-2: #ffd9a3;
  --stripe: rgba(226, 106, 18, 0.05);
  --slider: #ffe3c2;
  --chip: #ffe0b0;
  --word-hover: #ffe9c8;
  --playing-bg: #fff1d2;
  --highlight-top: #ffefb0;
  --highlight-hover-top: #ffe58a;
  --highlight-hover-bottom: #ffc84a;
  --ok: #2f7d4a;
  --bad: #d23b3b;
}

body.set-ang {
  --paper: #eef6ff;
  --card: #f7fbff;
  --ink: #1a2c3d;
  --muted: #4d6478;
  --tiger: #1d6fb8;
  --tiger-dark: #14548c;
  --gold: #b9ddfb;
  --leaf: #2f7d4a;
  --shadow: 0 10px 24px rgba(20, 60, 100, 0.12);
  --wash: #d6ebff;
  --wash-2: #ffe7c2;
  --stripe: rgba(29, 111, 184, 0.06);
  --slider: #dceefe;
  --chip: #d4e8fb;
  --word-hover: #e3f1fd;
  --playing-bg: #e7f3ff;
  --highlight-top: #e5f2ff;
  --highlight-hover-top: #cfe6fb;
  --highlight-hover-bottom: #8ec4f0;
  --ok: #2f7d4a;
  --bad: #d23b3b;
}

body.set-eng {
  --paper: #eff8ef;
  --card: #fbfff8;
  --ink: #20392f;
  --muted: #516f60;
  --tiger: #32805e;
  --tiger-dark: #236044;
  --gold: #bde5b6;
  --leaf: #b06a1f;
  --shadow: 0 10px 24px rgba(35, 80, 56, 0.12);
  --wash: #dcefd5;
  --wash-2: #ffe7bb;
  --stripe: rgba(50, 128, 94, 0.05);
  --slider: #dcefdc;
  --chip: #d8ecd2;
  --word-hover: #e2f1db;
  --playing-bg: #eaf6e3;
  --highlight-top: #e5f3c9;
  --highlight-hover-top: #d4ecac;
  --highlight-hover-bottom: #a8d998;
  --ok: #2f7d4a;
  --bad: #d23b3b;
}

body.set-ing {
  --paper: #f6f0fc;
  --card: #fdfaff;
  --ink: #302242;
  --muted: #705c85;
  --tiger: #8050ad;
  --tiger-dark: #613589;
  --gold: #dfc6f4;
  --leaf: #2f7d4a;
  --shadow: 0 10px 24px rgba(83, 46, 115, 0.12);
  --wash: #eadcf7;
  --wash-2: #fce0e8;
  --stripe: rgba(128, 80, 173, 0.05);
  --slider: #ecdef7;
  --chip: #e7d4f5;
  --word-hover: #f0e5fa;
  --playing-bg: #f1e7fc;
  --highlight-top: #efe1fb;
  --highlight-hover-top: #e2c8f5;
  --highlight-hover-bottom: #c59fe3;
  --ok: #2f7d4a;
  --bad: #d23b3b;
}

body.set-ong {
  --paper: #eefaf8;
  --card: #f7fffd;
  --ink: #14343a;
  --muted: #4d6d73;
  --tiger: #0f8f8a;
  --tiger-dark: #0b6c68;
  --gold: #b7efe6;
  --leaf: #b06a1f;
  --shadow: 0 10px 24px rgba(12, 80, 78, 0.12);
  --wash: #d5f3f0;
  --wash-2: #ffe7c2;
  --stripe: rgba(15, 143, 138, 0.06);
  --slider: #d7f3ef;
  --chip: #d2f0ea;
  --word-hover: #e3f7f4;
  --playing-bg: #e7f8f6;
  --highlight-top: #e5faf6;
  --highlight-hover-top: #c9f3ea;
  --highlight-hover-bottom: #7fd9cc;
  --ok: #2f7d4a;
  --bad: #d23b3b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 8%, var(--wash) 0 18%, transparent 19%),
    radial-gradient(circle at 88% 0%, var(--wash-2) 0 14%, transparent 15%),
    repeating-linear-gradient(-18deg, transparent 0 28px, var(--stripe) 28px 32px),
    var(--paper);
  color: var(--ink);
  font-family: Fredoka, Nunito, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", ui-rounded, sans-serif;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.hero {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.mascot svg {
  display: block;
  filter: drop-shadow(0 8px 0 rgba(184, 75, 8, 0.18));
}

.stories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: inherit;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(43, 27, 18, 0.12);
}

.story-link:hover {
  filter: brightness(1.03);
}

.story-link.is-active {
  background: var(--tiger);
  color: white;
  box-shadow: 0 3px 0 var(--tiger-dark);
}

.tab-icon {
  font-size: 17px;
  line-height: 1;
}

.tab-best {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
}

.best {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--tiger-dark);
}

h1 {
  margin: 0;
  font-family: Fredoka, "PingFang SC", ui-rounded, sans-serif;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 0.98;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.loading {
  margin: 40px 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

/* ---------------------------------------------------------------- 答题 */

.quiz-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quiz-head h2 {
  margin: 0;
  font-family: Fredoka, "PingFang SC", sans-serif;
  font-size: 26px;
}

.quiz-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.quiz-head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 13px;
  font-weight: 800;
}

.ghost {
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--chip);
}

.ghost:hover {
  color: var(--ink);
}

.quiz-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.quiz-card {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qnum {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--chip);
  font-family: Fredoka, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.say {
  font: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.say:hover {
  transform: scale(1.08);
}

.say.is-speaking {
  animation: ring 0.7s ease-in-out infinite;
  background: var(--tiger);
  color: white;
}

.qword {
  margin: 10px 0 12px;
  text-align: center;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.06em;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.option {
  font: inherit;
  font-weight: 800;
  font-size: 19px;
  padding: 12px 10px;
  border: 0;
  border-radius: 16px;
  background: var(--chip);
  color: inherit;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(43, 27, 18, 0.12);
  transition: transform 0.12s ease, background 0.12s ease;
}

.option:hover {
  background: var(--word-hover);
}

.option:active {
  transform: translateY(2px);
}

.option.is-selected {
  background: var(--tiger);
  color: white;
  box-shadow: 0 3px 0 var(--tiger-dark);
}

.focus-tag {
  margin: 12px 0 0;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quiz-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffe3e3;
  color: #a32020;
  font-weight: 700;
}

.quiz-foot {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(to top, var(--paper) 62%, transparent);
}

.progress {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: inset 0 0 0 2px rgba(43, 27, 18, 0.08);
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--tiger);
  transition: width 0.2s ease;
}

.submit {
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  min-width: 132px;
  padding: 14px 22px;
  border: 0;
  border-radius: 16px;
  background: var(--leaf);
  color: white;
  cursor: pointer;
  box-shadow: 0 5px 0 #1e5a34;
}

.submit:disabled {
  background: var(--chip);
  color: var(--muted);
  box-shadow: 0 5px 0 rgba(43, 27, 18, 0.1);
  cursor: not-allowed;
}

.submit:not(:disabled):active {
  transform: translateY(2px);
}

/* ---------------------------------------------------------------- 结果 */

.score-card {
  padding: 24px 22px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.score {
  margin: 4px 0 0;
  font-family: Fredoka, "PingFang SC", sans-serif;
  line-height: 1;
}

.score strong {
  font-size: clamp(48px, 14vw, 76px);
  color: var(--tiger);
}

.score span {
  font-size: 26px;
  color: var(--muted);
}

.score-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.badge {
  margin: 12px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.result-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.review-title {
  margin: 26px 0 12px;
  font-family: Fredoka, "PingFang SC", sans-serif;
  font-size: 22px;
}

.review {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.review-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 8px solid var(--chip);
}

.review-card.is-right {
  border-left-color: var(--ok);
}

.review-card.is-wrong {
  border-left-color: var(--bad);
}

.rhead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rnum {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--chip);
  font-family: Fredoka, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.rword {
  font-size: 22px;
  font-weight: 800;
}

.rfocus {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  font-weight: 800;
}

.rrow {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

.rrow .ok {
  color: var(--ok);
  font-weight: 800;
}

.rrow .bad {
  color: var(--bad);
  font-weight: 800;
}

.rexplain {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--chip);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@keyframes ring {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-12deg);
  }
  75% {
    transform: rotate(12deg);
  }
}

@media (max-width: 560px) {
  .hero {
    align-items: flex-start;
  }

  .options {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .submit {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .options {
    grid-template-columns: 1fr;
  }

  .qword {
    font-size: 34px;
  }
}
