/* =========================================================
   拼音乐园 · Pinyin Playground
   A warm, tactile, kid-friendly visual system.
   ========================================================= */

:root {
  --bg: #fff7ea;
  --bg-deep: #f6ead5;
  --paper: #fffdf8;
  --ink: #2d2924;
  --ink-soft: #6f6559;
  --ink-faint: #7e7264;
  --line: #eadcc7;

  --coral: #f47b5f;
  --coral-deep: #cf5b40;
  --coral-soft: #ffe2d8;

  --mint: #3faf9a;
  --mint-deep: #288575;
  --mint-soft: #ddf3ed;

  --sky: #4c9fe8;
  --sky-deep: #317fc4;
  --sky-soft: #dceeff;

  --lilac: #a470d6;
  --lilac-deep: #7f51ae;
  --lilac-soft: #f0e2fa;

  --sun: #f6c445;
  --sun-deep: #c99418;
  --sun-ink: #7a5908;
  --sun-soft: #fff0bd;

  --green: #48a868;
  --green-soft: #dff3e4;

  --shadow: 0 18px 40px rgba(86, 62, 33, 0.1);
  --shadow-soft: 0 8px 22px rgba(86, 62, 33, 0.08);

  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;

  --font:
    "Arial Rounded MT Bold", "Nunito", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Microsoft JhengHei", sans-serif;
  --font-pinyin:
    "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 8% 4%, rgba(244, 123, 95, 0.1) 0 13rem, transparent 13.1rem),
    radial-gradient(circle at 94% 16%, rgba(76, 159, 232, 0.1) 0 15rem, transparent 15.1rem),
    radial-gradient(circle at 78% 92%, rgba(63, 175, 154, 0.09) 0 17rem, transparent 17.1rem),
    var(--bg);
}

body.modal-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(86, 62, 33, 0.1) 1px, transparent 1.2px);
  background-size: 26px 26px;
  content: "";
  opacity: 0.35;
  pointer-events: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 28px 42px;
}

.noscript {
  max-width: 560px;
  margin: 40px auto;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  text-align: center;
}

/* =========================================================
   Header
   ========================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 2px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 17px;
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 0 4px 0 rgba(45, 41, 36, 0.16);
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-5deg);
  transition: transform 180ms ease;
}

.brand:hover .brand-mark {
  transform: rotate(4deg) translateY(-2px);
}

.brand-mark::after {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
  content: "";
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

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

.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px 0 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--bg-deep);
  font-size: 14px;
  font-weight: 900;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.star-pill:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--bg-deep);
}

.star-pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--bg-deep);
}

.star-pill .star-icon {
  width: 22px;
  height: 22px;
  color: var(--sun-deep);
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  place-items: center;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--bg-deep);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.icon-btn:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--bg-deep);
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--bg-deep);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

/* =========================================================
   Home hero
   ========================================================= */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 20px;
  min-height: 430px;
  padding: 48px 52px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 42px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.5), transparent 55%),
    var(--paper);
  box-shadow: 0 12px 0 var(--bg-deep);
}

.hero::before {
  position: absolute;
  top: -130px;
  left: -110px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--sun-soft);
  content: "";
  opacity: 0.7;
}

.hero::after {
  position: absolute;
  right: 26%;
  bottom: -160px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: var(--mint-soft);
  content: "";
  opacity: 0.55;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 13px;
  border: 1.5px solid rgba(45, 41, 36, 0.14);
  border-radius: 999px;
  color: var(--coral-deep);
  background: #fff9ec;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(244, 123, 95, 0.17);
  content: "";
}

.hero h1 {
  max-width: 520px;
  font-size: clamp(3rem, 5.4vw, 5.1rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.04;
}

.hero h1 em {
  position: relative;
  isolation: isolate;
  color: var(--coral-deep);
  font-style: normal;
  white-space: nowrap;
}

.hero h1 em::after {
  position: absolute;
  right: 2%;
  bottom: -7px;
  left: 1%;
  height: 10px;
  border-radius: 999px;
  background: var(--sun);
  content: "";
  opacity: 0.7;
  transform: rotate(-1.5deg);
  z-index: -1;
}

.hero-copy > p {
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.btn-primary {
  color: #fffdf8;
  background: var(--ink);
  box-shadow: 0 6px 0 #c9b89f;
}

.btn-primary:hover {
  background: #443e36;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #c9b89f;
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #c9b89f;
}

.btn-ghost {
  background: var(--paper);
  box-shadow: 0 6px 0 var(--bg-deep);
}

.btn-ghost:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--bg-deep);
}

.btn-ghost:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--bg-deep);
}

.btn-quiz {
  color: var(--ink);
  background: var(--coral);
  box-shadow: 0 6px 0 var(--coral-deep);
}

.btn-quiz:hover {
  background: #f68a70;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--coral-deep);
}

.btn-quiz:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--coral-deep);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

/* Hero illustration */

.hero-art {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 330px;
  place-items: center;
}

.hero-art::before {
  position: absolute;
  width: 300px;
  height: 300px;
  border: 2px dashed rgba(45, 41, 36, 0.16);
  border-radius: 50%;
  content: "";
  animation: slow-spin 45s linear infinite;
}

.mascot {
  position: relative;
  width: min(100%, 370px);
  filter: drop-shadow(0 18px 20px rgba(86, 62, 33, 0.14));
  animation: floaty 5s ease-in-out infinite;
}

.mascot svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.float-letter {
  position: absolute;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--bg-deep);
  font-family: var(--font-pinyin);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  animation: floaty 4.6s ease-in-out infinite;
}

.float-letter:nth-of-type(1) {
  top: 7%;
  left: 4%;
  --float-rotate: -8deg;
  color: var(--coral-deep);
  background: var(--coral-soft);
  transform: rotate(-8deg);
  animation-delay: -0.4s;
}

.float-letter:nth-of-type(2) {
  top: 20%;
  right: 2%;
  --float-rotate: 8deg;
  color: var(--mint-deep);
  background: var(--mint-soft);
  transform: rotate(8deg);
  animation-delay: -1.8s;
}

.float-letter:nth-of-type(3) {
  bottom: 13%;
  left: 2%;
  --float-rotate: 5deg;
  width: 52px;
  height: 52px;
  color: var(--lilac-deep);
  background: var(--lilac-soft);
  transform: rotate(5deg);
  animation-delay: -2.8s;
}

.float-letter:nth-of-type(4) {
  right: 5%;
  bottom: 7%;
  --float-rotate: -6deg;
  width: 66px;
  height: 52px;
  color: var(--sky-deep);
  background: var(--sky-soft);
  font-size: 20px;
  transform: rotate(-6deg);
  animation-delay: -1.1s;
}

.hello-bubble {
  position: absolute;
  top: 2%;
  right: 10%;
  z-index: 3;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px 14px 14px 4px;
  background: #fffdf8;
  box-shadow: 0 4px 0 var(--bg-deep);
  font-size: 13px;
  font-weight: 900;
  transform: rotate(4deg);
  animation: floaty 4s ease-in-out infinite;
  animation-delay: -1.2s;
}

/* =========================================================
   Home sections
   ========================================================= */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 44px 4px 16px;
}

.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.section-head span {
  padding-bottom: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.module-card {
  --accent: var(--coral);
  --accent-deep: var(--coral-deep);
  --accent-soft: var(--coral-soft);
  --card-shadow: #f1d0c4;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, var(--accent-soft), transparent 48%),
    var(--paper);
  box-shadow: 0 7px 0 var(--card-shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 11px 0 var(--card-shadow);
}

.module-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--card-shadow);
}

.module-coral {
  --accent: var(--coral);
  --accent-deep: var(--coral-deep);
  --accent-soft: var(--coral-soft);
  --card-shadow: #f1d0c4;
}

.module-mint {
  --accent: var(--mint);
  --accent-deep: var(--mint-deep);
  --accent-soft: var(--mint-soft);
  --card-shadow: #c5e5dc;
}

.module-sky {
  --accent: var(--sky);
  --accent-deep: var(--sky-deep);
  --accent-soft: var(--sky-soft);
  --card-shadow: #c9dff3;
}

.module-lilac {
  --accent: var(--lilac);
  --accent-deep: var(--lilac-deep);
  --accent-soft: var(--lilac-soft);
  --card-shadow: #dfccef;
}

.module-main {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 2px;
  text-align: left;
}

.module-icon {
  display: grid;
  width: 74px;
  height: 74px;
  flex: none;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 22px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  box-shadow: 0 4px 0 var(--card-shadow);
  font-family: var(--font-pinyin);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  transition: transform 180ms ease;
}

.module-main:hover .module-icon {
  transform: rotate(-5deg) scale(1.04);
}

.module-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.module-kicker {
  margin-bottom: 1px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.module-copy strong {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.module-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.module-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1.5px solid rgba(45, 41, 36, 0.18);
  border-radius: 50%;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.54);
  font-size: 17px;
  font-weight: 900;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.module-main:hover .module-arrow {
  background: var(--accent-soft);
  transform: translateX(3px);
}

.module-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--line);
}

.progress-track {
  position: relative;
  height: 9px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(45, 41, 36, 0.08);
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-copy {
  flex: none;
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-quiz {
  flex: none;
  padding: 7px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.mini-quiz:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.tip-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 17px 22px;
  border: 1.5px dashed rgba(45, 41, 36, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.55);
}

.tip-strip .tip-sun {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--sun-deep);
  background: var(--sun-soft);
}

.tip-strip svg {
  width: 21px;
  height: 21px;
}

.tip-strip p {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.tip-strip strong {
  color: var(--ink);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 38px;
  padding: 18px 4px 0;
  border-top: 1.5px solid rgba(45, 41, 36, 0.1);
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
}

.footer-heart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-heart svg {
  width: 14px;
  height: 14px;
  color: var(--coral);
}

/* =========================================================
   Sub page bar
   ========================================================= */

.screen {
  animation: screen-in 260ms ease both;
}

.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 2px 18px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px 0 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--bg-deep);
  font-size: 13px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.back-btn:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--bg-deep);
}

.back-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--bg-deep);
}

.back-btn svg {
  width: 17px;
  height: 17px;
}

.subbar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.subbar-title .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent, var(--coral));
}

.subbar-count {
  min-width: 70px;
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

/* =========================================================
   Learn screen
   ========================================================= */

.learn-wrap {
  width: 100%;
  max-width: 790px;
  margin: 0 auto;
}

.learn-progress {
  height: 10px;
  margin: 0 2px 18px;
  overflow: hidden;
  border: 1.5px solid rgba(45, 41, 36, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
}

.learn-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--coral));
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.learn-card {
  --accent: var(--coral);
  --accent-deep: var(--coral-deep);
  --accent-soft: var(--coral-soft);
  --card-shadow: #f1d0c4;
  position: relative;
  padding: 30px 36px 32px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 2%, var(--accent-soft), transparent 34%),
    radial-gradient(circle at 0 100%, var(--accent-soft), transparent 30%),
    var(--paper);
  box-shadow: 0 11px 0 var(--card-shadow);
}

.learn-card::before {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 5px;
  border-radius: 0 0 999px 999px;
  background: var(--accent);
  content: "";
  opacity: 0.55;
}

.learn-card.theme-coral {
  --accent: var(--coral);
  --accent-deep: var(--coral-deep);
  --accent-soft: var(--coral-soft);
  --card-shadow: #f1d0c4;
}

.learn-card.theme-mint {
  --accent: var(--mint);
  --accent-deep: var(--mint-deep);
  --accent-soft: var(--mint-soft);
  --card-shadow: #c5e5dc;
}

.learn-card.theme-sky {
  --accent: var(--sky);
  --accent-deep: var(--sky-deep);
  --accent-soft: var(--sky-soft);
  --card-shadow: #c9dff3;
}

.learn-card.theme-lilac {
  --accent: var(--lilac);
  --accent-deep: var(--lilac-deep);
  --accent-soft: var(--lilac-soft);
  --card-shadow: #dfccef;
}

.learn-card.tone-1 {
  --accent: var(--coral);
  --accent-deep: var(--coral-deep);
  --accent-soft: var(--coral-soft);
  --card-shadow: #f1d0c4;
}

.learn-card.tone-2 {
  --accent: var(--mint);
  --accent-deep: var(--mint-deep);
  --accent-soft: var(--mint-soft);
  --card-shadow: #c5e5dc;
}

.learn-card.tone-3 {
  --accent: var(--sky);
  --accent-deep: var(--sky-deep);
  --accent-soft: var(--sky-soft);
  --card-shadow: #c9dff3;
}

.learn-card.tone-4 {
  --accent: var(--lilac);
  --accent-deep: var(--lilac-deep);
  --accent-soft: var(--lilac-soft);
  --card-shadow: #dfccef;
}

.learn-card.tone-5 {
  --accent: #91857a;
  --accent-deep: #655b51;
  --accent-soft: #eee8df;
  --card-shadow: #ddd3c7;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1.5px solid rgba(45, 41, 36, 0.15);
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.learned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border: 1.5px solid rgba(45, 41, 36, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 900;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.learned-badge:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.learned-badge.is-learned {
  color: var(--green);
  border-color: rgba(72, 168, 104, 0.32);
  background: var(--green-soft);
}

.learned-badge svg {
  width: 15px;
  height: 15px;
}

.pinyin-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 18px 0 8px;
  text-align: center;
}

.pinyin-giant {
  display: block;
  color: var(--accent-deep);
  font-family: var(--font-pinyin);
  font-size: clamp(7.2rem, 17vw, 11.5rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.95;
  text-shadow: 0 6px 0 var(--accent-soft);
  animation: pinyin-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pinyin-giant.is-blend {
  font-size: clamp(6rem, 15vw, 10rem);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.speak-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: 0 5px 0 var(--card-shadow);
  font-size: 14px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.speak-pill:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--card-shadow);
}

.speak-pill:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--card-shadow);
}

.speak-pill svg {
  width: 21px;
  height: 21px;
  flex: none;
}

.speak-pill.secondary {
  min-height: 46px;
  padding: 0 16px;
  border-width: 1.5px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 0 var(--card-shadow);
  font-size: 12px;
}

.speak-pill.is-speaking svg {
  animation: speaker-bounce 520ms ease infinite;
}

.call-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.call-row strong {
  color: var(--accent-deep);
  font-family: var(--font-pinyin);
  font-size: 20px;
  font-weight: 900;
}

.call-row .hint {
  color: var(--ink-faint);
}

.example-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1.5px solid rgba(45, 41, 36, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
}

.example-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px 8px;
}

.example-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border: 1.5px solid rgba(45, 41, 36, 0.14);
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.example-play:hover {
  background: #fff;
  transform: translateY(-1px);
}

.example-play:active {
  transform: translateY(1px);
}

.example-play svg {
  width: 13px;
  height: 13px;
}

.example-play.is-speaking svg {
  animation: speaker-bounce 520ms ease infinite;
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.example-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(45, 41, 36, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.example-item.is-primary {
  border-color: rgba(45, 41, 36, 0.12);
  background: var(--accent-soft);
}

.example-emoji {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 23px;
  line-height: 1;
}

.example-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0;
}

.example-label {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.example-word {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.example-pinyin {
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 11px;
  font-weight: 700;
}

.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 16px;
  background: #fff8e6;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
}

.tip-text {
  flex: 1;
}

.tip-speak {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border: 1.5px solid rgba(45, 41, 36, 0.14);
  border-radius: 50%;
  color: var(--sun-ink);
  background: rgba(255, 255, 255, 0.66);
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.tip-speak:hover {
  background: #fff;
  transform: scale(1.06);
}

.tip-speak:active {
  transform: scale(0.96);
}

.tip-speak svg {
  width: 15px;
  height: 15px;
}

.tip-speak.is-speaking svg {
  animation: speaker-bounce 520ms ease infinite;
}

button.is-speaking svg {
  animation: speaker-bounce 520ms ease infinite;
}

.tip-box .tip-label {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--sun-ink);
  background: var(--sun-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

/* Blend formula */

.blend-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 12px;
}

.formula-chip {
  display: grid;
  min-width: 56px;
  height: 54px;
  padding: 0 12px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--accent-soft);
  box-shadow: 0 4px 0 var(--card-shadow);
  font-family: var(--font-pinyin);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.formula-chip.formula-result {
  min-width: 86px;
  color: #fffdf8;
  background: var(--accent-deep);
  font-size: 30px;
}

.formula-op {
  color: var(--ink-faint);
  font-family: var(--font-pinyin);
  font-size: 20px;
  font-weight: 900;
}

/* Tone visual */

.tone-visual {
  margin-top: 18px;
  padding: 14px 18px 10px;
  border: 1.5px solid rgba(45, 41, 36, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.tone-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.tone-visual-head strong {
  color: var(--accent-deep);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.tone-visual svg {
  width: 100%;
  height: 80px;
}

.tone-visual .grid-line {
  stroke: rgba(45, 41, 36, 0.1);
  stroke-dasharray: 3 5;
  stroke-width: 1.4;
}

.tone-visual .tone-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6;
}

.tone-visual .tone-dot {
  fill: var(--accent-deep);
  stroke: #fffdf8;
  stroke-width: 3;
}

/* Learn navigation */

.learn-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 21px;
}

.round-btn {
  display: grid;
  width: 52px;
  height: 52px;
  flex: none;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--bg-deep);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.round-btn:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--bg-deep);
}

.round-btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--bg-deep);
}

.round-btn svg {
  width: 21px;
  height: 21px;
}

.next-btn {
  min-width: 190px;
}

.learn-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  padding: 0 2px;
}

.learn-hint {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
}

.learn-hint strong {
  color: var(--ink-soft);
}

/* =========================================================
   Quiz
   ========================================================= */

.quiz-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.quiz-top-progress {
  height: 10px;
  margin: 0 2px 18px;
  overflow: hidden;
  border: 1.5px solid rgba(45, 41, 36, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
}

.quiz-top-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-card {
  position: relative;
  padding: 30px 36px 32px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0, var(--sun-soft), transparent 35%),
    var(--paper);
  box-shadow: 0 11px 0 var(--bg-deep);
}

.quiz-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1.5px solid rgba(45, 41, 36, 0.13);
  border-radius: 999px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.quiz-kicker::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.quiz-question {
  margin-top: 16px;
  font-size: clamp(1.25rem, 3.2vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.quiz-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
}

.quiz-visual {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 24px;
  padding: 18px 22px;
  border: 1.5px dashed rgba(45, 41, 36, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0, var(--sun-soft), transparent 68%),
    rgba(255, 255, 255, 0.5);
  text-align: center;
}

.quiz-visual-main {
  color: var(--ink);
  font-family: var(--font-pinyin);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.quiz-visual.is-word .quiz-visual-main {
  font-family: var(--font);
  font-size: 38px;
  letter-spacing: 0;
}

.quiz-visual.is-text .quiz-visual-main {
  max-width: 100%;
  font-family: var(--font);
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.35;
}

.quiz-visual-sub {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.quiz-emoji-wrap {
  display: grid;
  width: 104px;
  height: 104px;
  flex: none;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--sun-soft);
  box-shadow: 0 6px 0 #ead9b3;
  font-size: 54px;
  line-height: 1;
  transform: rotate(-3deg);
}

.quiz-emoji {
  filter: drop-shadow(0 4px 2px rgba(45, 41, 36, 0.08));
}

.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sky-soft);
  box-shadow: 0 5px 0 #bfd8ee;
  font-size: 14px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.listen-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #bfd8ee;
}

.listen-btn:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #bfd8ee;
}

.listen-btn svg {
  width: 22px;
  height: 22px;
}

.quiz-blend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 18px;
  border: 1.5px dashed rgba(45, 41, 36, 0.18);
  border-radius: 20px;
  background: rgba(240, 226, 250, 0.38);
}

.quiz-blend .formula-chip {
  min-width: 64px;
  height: 62px;
  font-size: 30px;
}

.quiz-help {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 26px;
}

.option {
  position: relative;
  display: flex;
  min-height: 78px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 6px 0 var(--bg-deep);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.option:hover:not(:disabled) {
  background: var(--sun-soft);
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--bg-deep);
}

.option:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--bg-deep);
}

.option-pinyin {
  font-family: var(--font-pinyin);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: center;
}

.option.is-text {
  min-height: 72px;
}

.option.is-text .option-pinyin {
  font-family: var(--font);
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.3;
}

.option.is-word {
  min-height: 86px;
  gap: 0;
}

.option.is-word .option-pinyin {
  font-family: var(--font);
  font-size: 24px;
  letter-spacing: 0;
}

.option-emoji {
  margin-bottom: 2px;
  font-size: 18px;
  line-height: 1;
}

.option-label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.option.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 6px 0 #b5dfc0;
  animation: correct-pop 360ms ease both;
}

.option.is-wrong {
  border-color: var(--coral-deep);
  background: var(--coral-soft);
  box-shadow: 0 6px 0 #eab5a7;
  animation: shake 360ms ease both;
}

.option.is-muted {
  opacity: 0.5;
}

.option:disabled {
  cursor: default;
}

.quiz-feedback {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.quiz-feedback.is-correct {
  color: var(--green);
}

.quiz-feedback.is-wrong {
  color: var(--coral-deep);
}

.quiz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.quiz-note {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.quit-quiz {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
}

.quit-quiz:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.7);
}

/* Result */

.result-card {
  position: relative;
  padding: 48px 32px 38px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 0, var(--sun-soft), transparent 48%),
    var(--paper);
  box-shadow: 0 11px 0 var(--bg-deep);
  text-align: center;
}

.result-card > * {
  position: relative;
  z-index: 1;
}

.result-card::before,
.result-card::after {
  position: absolute;
  z-index: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral-soft);
  content: "";
}

.result-card::before {
  top: 42px;
  left: 48px;
}

.result-card::after {
  right: 54px;
  bottom: 48px;
  background: var(--mint-soft);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--sun-ink);
  background: var(--sun-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-badge svg {
  width: 14px;
  height: 14px;
}

.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 17px 0 8px;
}

.result-star {
  color: #ddd1bd;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  line-height: 1;
  text-shadow: 0 4px 0 rgba(45, 41, 36, 0.08);
}

.result-star.is-filled {
  color: var(--sun);
  text-shadow: 0 5px 0 var(--sun-deep);
  animation: star-pop 460ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.result-star:nth-child(2) {
  animation-delay: 90ms;
}

.result-star:nth-child(3) {
  animation-delay: 180ms;
}

.result-card h2 {
  margin-top: 10px;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.result-card p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}

.result-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 16px;
  padding: 9px 18px;
  border: 1.5px solid rgba(45, 41, 36, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.result-score strong {
  color: var(--ink);
  font-family: var(--font-pinyin);
  font-size: 23px;
  font-weight: 900;
}

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

/* =========================================================
   Pronunciation detail
   ========================================================= */

.detail-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1.5px dashed rgba(45, 41, 36, 0.2);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.55);
  text-align: left;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.detail-link:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.detail-link-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.detail-link-icon svg {
  width: 19px;
  height: 19px;
}

.detail-link-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.detail-link-copy strong {
  font-size: 13px;
  font-weight: 900;
}

.detail-link-copy small {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.detail-link-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.detail-link-arrow svg {
  width: 15px;
  height: 15px;
}

.modal.detail-modal {
  width: min(100%, 620px);
  max-height: min(90vh, 880px);
  padding: 26px 28px 24px;
}

.detail-heading {
  min-width: 0;
}

.detail-kicker {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--coral-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.detail-heading h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-pinyin);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.detail-heading h2 small {
  color: var(--ink-faint);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.detail-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
  padding: 14px;
  border: 1.5px solid rgba(45, 41, 36, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, var(--sun-soft), transparent 52%),
    rgba(255, 255, 255, 0.62);
}

.detail-symbol {
  display: grid;
  width: 82px;
  height: 82px;
  flex: none;
  place-items: center;
  border: 1.5px solid rgba(45, 41, 36, 0.16);
  border-radius: 22px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  font-family: var(--font-pinyin);
  font-size: 43px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.detail-summary-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.detail-summary-copy p {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.detail-summary-copy p strong {
  color: var(--ink);
  font-family: var(--font-pinyin);
  font-size: 19px;
  font-weight: 900;
}

.detail-summary-copy > span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.detail-listen {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border: 1.5px solid rgba(45, 41, 36, 0.16);
  border-radius: 50%;
  background: #fff;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.detail-listen:hover {
  background: var(--coral-soft);
  transform: scale(1.05);
}

.detail-listen svg {
  width: 20px;
  height: 20px;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.detail-chip {
  display: flex;
  min-width: 72px;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid rgba(45, 41, 36, 0.1);
  border-radius: 12px;
  background: rgba(246, 234, 213, 0.32);
}

.detail-chip small {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.detail-chip strong {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.detail-section {
  margin-top: 21px;
}

.teacher-play {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1.5px dashed rgba(45, 41, 36, 0.18);
  border-radius: 14px;
  color: var(--sky-deep);
  background: var(--sky-soft);
  text-align: left;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.teacher-play:hover {
  background: #fff;
  transform: translateY(-1px);
}

.teacher-play svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.teacher-play span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.teacher-play strong {
  font-size: 11px;
  font-weight: 900;
}

.teacher-play small {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 600;
}

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

.detail-section-head h3 {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.detail-section-head span {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.detail-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: detail-step;
}

.detail-steps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(246, 234, 213, 0.28);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  counter-increment: detail-step;
}

.detail-steps li::before {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: #fffdf8;
  background: var(--coral);
  content: counter(detail-step);
  font-family: var(--font-pinyin);
  font-size: 11px;
  font-weight: 900;
}

.detail-mistake {
  padding: 12px 14px;
  border-radius: 15px;
  background: #fff5e7;
}

.detail-mistake .detail-section-head {
  margin-bottom: 5px;
}

.detail-mistake p {
  color: #74583f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.contrast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contrast-card {
  position: relative;
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 9px 36px 9px 12px;
  border: 1.5px solid rgba(45, 41, 36, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.contrast-card:hover {
  border-color: var(--coral);
  background: var(--coral-soft);
  transform: translateY(-1px);
}

.contrast-pinyin {
  color: var(--coral-deep);
  font-family: var(--font-pinyin);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.contrast-word {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
}

.contrast-speaker {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%);
}

.contrast-speaker svg {
  width: 14px;
  height: 14px;
}

.detail-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 17px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--sun-soft);
}

.detail-note-label {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--sun-ink);
  background: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-note p {
  color: #745f38;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.detail-source {
  margin-top: 18px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.detail-caveat {
  margin-top: 9px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

.rules-section {
  padding-top: 17px;
  border-top: 1.5px dashed var(--line);
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rule-item {
  border: 1px solid rgba(45, 41, 36, 0.1);
  border-radius: 13px;
  background: rgba(246, 234, 213, 0.26);
  overflow: hidden;
}

.rule-item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.rule-item summary::-webkit-details-marker {
  display: none;
}

.rule-item summary strong {
  flex: 1;
  font-size: 12px;
  font-weight: 900;
}

.rule-badge {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.rule-toggle {
  color: var(--ink-faint);
  font-family: var(--font-pinyin);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  transition: transform 150ms ease;
}

.rule-item[open] .rule-toggle {
  transform: rotate(45deg);
}

.rule-item p {
  padding: 0 11px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.65;
}

.rule-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 11px 11px;
}

.rule-example {
  padding: 3px 7px;
  border: 1px solid rgba(45, 41, 36, 0.09);
  border-radius: 6px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.58);
  font-family: var(--font-pinyin);
  font-size: 10px;
  font-weight: 700;
}

/* =========================================================
   Progress modal
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(45, 41, 36, 0.38);
  backdrop-filter: blur(5px);
  animation: fade-in 180ms ease both;
}

.modal {
  width: min(100%, 480px);
  max-height: min(86vh, 720px);
  padding: 28px;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 14px 0 rgba(45, 41, 36, 0.16);
  animation: modal-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.modal-head p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1.5px solid rgba(45, 41, 36, 0.16);
  border-radius: 50%;
  background: #fff;
}

.modal-close:hover {
  background: var(--sun-soft);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.total-stars {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1.5px solid rgba(45, 41, 36, 0.13);
  border-radius: 20px;
  background: var(--sun-soft);
}

.total-stars svg {
  width: 42px;
  height: 42px;
  flex: none;
  color: var(--sun-deep);
}

.total-stars strong {
  display: block;
  font-family: var(--font-pinyin);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.total-stars span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(246, 234, 213, 0.4);
}

.progress-row-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  color: var(--row-accent, var(--coral-deep));
  background: var(--row-soft, var(--coral-soft));
  font-family: var(--font-pinyin);
  font-size: 16px;
  font-weight: 900;
}

.progress-row-copy {
  min-width: 0;
  flex: 1;
}

.progress-row-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
}

.progress-row-title span {
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 10px;
  font-weight: 800;
}

.progress-row .progress-track {
  height: 6px;
  margin-top: 5px;
}

.progress-row .progress-track > span {
  background: var(--row-accent, var(--coral));
}

.best-score {
  flex: none;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.best-score strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--font-pinyin);
  font-size: 11px;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1.5px dashed var(--line);
}

.reset-btn {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
}

.reset-btn:hover {
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.modal-note {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}

/* =========================================================
   Toast + particles
   ========================================================= */

.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 80;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: #fffdf8;
  background: var(--ink);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.15);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.star-particle {
  position: fixed;
  z-index: 70;
  color: var(--sun);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 2px 0 var(--sun-deep);
  animation: particle-burst 900ms cubic-bezier(0.22, 0.8, 0.36, 1) forwards;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pinyin-in {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(var(--float-rotate, 0deg));
  }
  50% {
    transform: translateY(-9px) rotate(var(--float-rotate, 0deg));
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes speaker-bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes correct-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-18deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes particle-burst {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.7) rotate(0);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(1.2) rotate(var(--rot));
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 38px 36px 30px;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .hero h1 {
    max-width: 640px;
  }

  .hero-copy > p {
    margin-top: 20px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-art {
    min-height: 300px;
    margin-top: 4px;
  }

  .hero::after {
    right: -100px;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 0 18px 34px;
  }

  .topbar {
    padding-top: 18px;
  }

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

  .section-head {
    margin-top: 34px;
  }

  .learn-card,
  .quiz-card {
    padding: 25px 22px 26px;
    border-radius: 30px;
  }

  .learn-controls {
    gap: 10px;
  }

  .next-btn {
    min-width: 0;
    flex: 1;
  }

  .learn-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .learn-bottom .btn {
    width: 100%;
  }

  .learn-hint {
    order: 2;
    text-align: center;
  }

  .options {
    gap: 10px;
  }

  .modal {
    padding: 22px;
  }
}

@media (max-width: 540px) {
  body {
    background:
      radial-gradient(circle at 8% 3%, rgba(244, 123, 95, 0.1) 0 8rem, transparent 8.1rem),
      radial-gradient(circle at 96% 14%, rgba(76, 159, 232, 0.1) 0 10rem, transparent 10.1rem),
      var(--bg);
  }

  .app {
    padding: 0 14px 28px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 24px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .star-pill {
    min-height: 40px;
    padding: 0 12px 0 10px;
    font-size: 12px;
  }

  .star-pill .star-icon {
    width: 19px;
    height: 19px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding: 30px 20px 22px;
    border-radius: 30px;
    box-shadow: 0 8px 0 var(--bg-deep);
  }

  .hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.7rem);
  }

  .hero-copy > p {
    font-size: 14px;
  }

  .hero-actions {
    width: 100%;
    gap: 9px;
    margin-top: 23px;
  }

  .hero-actions .btn {
    min-height: 48px;
    padding: 0 17px;
    font-size: 13px;
  }

  .hero-art {
    min-height: 245px;
  }

  .float-letter {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 21px;
  }

  .float-letter:nth-of-type(4) {
    width: 54px;
    height: 44px;
    font-size: 17px;
  }

  .hello-bubble {
    top: 0;
    right: 5%;
    padding: 7px 10px;
    font-size: 11px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    margin: 30px 3px 13px;
  }

  .section-head span {
    padding: 0;
    font-size: 11px;
  }

  .module-card {
    padding: 16px;
  }

  .module-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 29px;
  }

  .module-copy strong {
    font-size: 22px;
  }

  .module-arrow {
    display: none;
  }

  .module-footer {
    margin-top: 15px;
    padding-top: 12px;
  }

  .mini-quiz {
    padding: 6px 10px;
    font-size: 10px;
  }

  .tip-strip {
    align-items: flex-start;
    padding: 14px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-top: 28px;
    font-size: 10px;
  }

  .subbar {
    padding: 16px 0 14px;
  }

  .subbar-count {
    min-width: 58px;
    font-size: 11px;
  }

  .back-btn {
    min-height: 38px;
    padding: 0 12px 0 10px;
    font-size: 12px;
  }

  .learn-progress {
    height: 8px;
    margin-bottom: 13px;
  }

  .learn-card {
    padding: 20px 17px 22px;
  }

  .card-top {
    align-items: flex-start;
  }

  .learned-badge {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .pinyin-stage {
    min-height: 205px;
    padding-top: 20px;
  }

  .pinyin-giant {
    font-size: clamp(5.8rem, 30vw, 8.2rem);
  }

  .pinyin-giant.is-blend {
    font-size: clamp(4.9rem, 24vw, 7rem);
  }

  .speak-pill {
    min-height: 46px;
    padding: 0 16px;
    font-size: 12px;
  }

  .speak-pill.secondary {
    min-height: 42px;
    padding: 0 13px;
    font-size: 11px;
  }

  .example-panel {
    margin-top: 10px;
    padding: 10px;
  }

  .example-panel-head {
    padding-bottom: 6px;
  }

  .example-item {
    gap: 9px;
    padding: 7px 8px;
  }

  .example-emoji {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 21px;
  }

  .example-word {
    font-size: 15px;
  }

  .example-pinyin {
    font-size: 10px;
  }

  .example-play {
    min-height: 26px;
    padding: 0 8px;
    font-size: 8px;
  }

  .tip-box {
    padding: 11px 12px;
    font-size: 11px;
  }

  .tip-speak {
    width: 28px;
    height: 28px;
  }

  .tip-speak svg {
    width: 13px;
    height: 13px;
  }

  .blend-formula {
    gap: 6px;
  }

  .formula-chip {
    min-width: 44px;
    height: 43px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 22px;
  }

  .formula-chip.formula-result {
    min-width: 65px;
    font-size: 23px;
  }

  .formula-op {
    font-size: 16px;
  }

  .tone-visual {
    padding: 10px 12px 6px;
  }

  .tone-visual svg {
    height: 64px;
  }

  .learn-controls {
    margin-top: 17px;
  }

  .round-btn {
    width: 46px;
    height: 46px;
  }

  .next-btn {
    min-height: 46px;
    font-size: 13px;
  }

  .learn-bottom {
    margin-top: 20px;
  }

  .quiz-card {
    padding: 21px 17px 23px;
  }

  .quiz-question {
    font-size: 20px;
  }

  .quiz-clue {
    gap: 12px;
    margin-top: 19px;
  }

  .quiz-visual {
    min-height: 112px;
    margin-top: 19px;
    padding: 14px;
    border-radius: 20px;
  }

  .quiz-visual-main {
    font-size: 50px;
  }

  .quiz-visual.is-word .quiz-visual-main {
    font-size: 32px;
  }

  .quiz-visual.is-text .quiz-visual-main {
    font-size: 24px;
  }

  .quiz-emoji-wrap {
    width: 82px;
    height: 82px;
    border-radius: 23px;
    font-size: 43px;
  }

  .listen-btn {
    min-height: 48px;
    padding: 0 16px;
    font-size: 12px;
  }

  .options {
    grid-template-columns: 1fr 1fr;
    margin-top: 21px;
  }

  .option {
    min-height: 68px;
    padding: 8px;
    border-radius: 16px;
  }

  .option-pinyin {
    font-size: 25px;
  }

  .option-label {
    font-size: 9px;
  }

  .quiz-feedback {
    margin-top: 14px;
    font-size: 12px;
  }

  .result-card {
    padding: 38px 20px 28px;
  }

  .result-card::before {
    left: 24px;
  }

  .result-card::after {
    right: 24px;
  }

  .result-actions .btn {
    width: 100%;
  }

  .modal {
    padding: 20px;
    border-radius: 24px;
  }

  .modal.detail-modal {
    padding: 20px 17px 18px;
  }

  .detail-heading h2 {
    font-size: 33px;
  }

  .detail-summary {
    gap: 10px;
    padding: 10px;
  }

  .detail-symbol {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 34px;
  }

  .detail-summary-copy p {
    font-size: 11px;
  }

  .detail-summary-copy p strong {
    font-size: 17px;
  }

  .detail-summary-copy > span {
    font-size: 9px;
  }

  .detail-listen {
    width: 40px;
    height: 40px;
  }

  .detail-chip {
    min-width: 62px;
    padding: 7px 8px;
  }

  .detail-chip strong {
    font-size: 10px;
  }

  .detail-steps li {
    padding: 8px 9px;
    font-size: 11px;
  }

  .detail-link {
    padding: 10px 11px;
  }

  .detail-link-copy strong {
    font-size: 12px;
  }

  .detail-link-copy small {
    font-size: 9px;
  }

  .detail-link-icon {
    width: 34px;
    height: 34px;
  }

  .modal-head h2 {
    font-size: 22px;
  }

  .total-stars {
    padding: 13px;
  }

  .total-stars strong {
    font-size: 24px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .reset-btn {
    align-self: center;
  }
}

@media (max-width: 370px) {
  .brand-copy {
    display: none;
  }

  .hero-actions .btn {
    width: 100%;
  }

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

  .learn-hint {
    display: none;
  }

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

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

/* =========================================================
   账号（学员/家长 登录）
   ========================================================= */

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--bg-deep);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.account-pill:hover {
  background: var(--sun-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--bg-deep);
}

.account-pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--bg-deep);
}

.account-pill svg {
  width: 20px;
  height: 20px;
}

.account-pill.is-on {
  background: var(--coral-soft);
}

.account-modal {
  max-width: 420px;
}

.account-body {
  padding: 2px 4px 6px;
}

.account-tip {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.6;
}

.account-field {
  margin-bottom: 12px;
}

.account-field label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.text-input:focus {
  outline: none;
  border-color: var(--ink);
}

.account-code-row {
  display: flex;
  gap: 8px;
}

.code-btn {
  white-space: nowrap;
  min-width: 106px;
  min-height: 46px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--bg-deep);
}

.code-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.account-msg {
  min-height: 18px;
  font-size: 13px;
  margin: 8px 0 10px;
  color: var(--ink-soft);
}

.account-msg.is-error {
  color: var(--coral-deep);
}

.account-msg.is-ok {
  color: var(--mint-deep);
}

.account-dev {
  font-size: 12px;
  background: var(--sun-soft);
  color: var(--sun-ink);
  padding: 8px 10px;
  border-radius: 10px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.account-wide {
  width: 100%;
}

.account-foot {
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
  margin: 10px 0 0;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--coral-soft);
  display: grid;
  place-items: center;
  color: var(--ink);
}

.account-avatar svg {
  width: 26px;
  height: 26px;
}

.account-phone {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.account-meta {
  display: flex;
  gap: 20px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
}

.account-meta dt {
  font-size: 11px;
  color: var(--ink-soft);
}

.account-meta dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 800;
}

/* 窄屏：账号按钮只留图标，避免顶栏被撑爆 */
@media (max-width: 560px) {
  .account-pill {
    padding: 0 10px;
    min-width: 44px;
    justify-content: center;
  }

  .account-pill span {
    display: none;
  }
}

/* 订阅套餐卡片 */
.plan-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  box-shadow: 0 3px 0 var(--bg-deep);
  transition: transform 120ms ease, border-color 120ms ease;
}

.plan-card:hover:not(:disabled) {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.plan-card.is-best {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.plan-card:disabled {
  opacity: 0.6;
  box-shadow: none;
}

.plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.plan-head strong {
  font-weight: 800;
}

.plan-head em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--coral-deep);
  padding: 2px 7px;
  border-radius: 999px;
}

.plan-price {
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
}

.plan-price small {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 2px;
}
