:root {
  --cream: #fff9ed;
  --paper: #fffefd;
  --ink: #403b55;
  --muted: #777086;
  --coral: #ff8c7d;
  --coral-dark: #df6c60;
  --yellow: #ffd66b;
  --yellow-dark: #dca635;
  --mint: #73d4be;
  --mint-dark: #369b84;
  --blue: #84c9f4;
  --blue-dark: #4a9aca;
  --purple: #b7a1ec;
  --purple-dark: #8069bd;
  --pink: #ffc3d5;
  --success: #43ad82;
  --danger: #e77670;
  --shadow: 0 8px 0 rgba(101, 80, 73, 0.07), 0 16px 36px rgba(101, 80, 73, 0.08);
  --small-shadow: 0 5px 0 rgba(101, 80, 73, 0.08);
  --radius-lg: 32px;
  --radius-md: 22px;
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 214, 107, 0.18) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 36%, rgba(115, 212, 190, 0.18) 0 6px, transparent 7px),
    linear-gradient(180deg, #fff8e8 0%, #fffdf6 58%, #f3fbf4 100%);
  background-size: 120px 120px, 150px 150px, auto;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 4px solid rgba(80, 152, 230, 0.42);
  outline-offset: 4px;
}
button:disabled { cursor: default; }
.button-reset { padding: 0; border: 0; background: none; cursor: pointer; }

.sky-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cloud { position: absolute; width: 110px; height: 34px; border-radius: 40px; background: rgba(255,255,255,0.78); }
.cloud::before, .cloud::after { position: absolute; content: ""; border-radius: 50%; background: inherit; }
.cloud::before { width: 48px; height: 48px; left: 18px; bottom: 5px; }
.cloud::after { width: 58px; height: 58px; right: 13px; bottom: 2px; }
.cloud-one { top: 145px; left: -26px; transform: scale(0.9); }
.cloud-two { top: 230px; right: -20px; transform: scale(0.7); }
.little-star { position: absolute; color: rgba(238,183,63,0.36); font-size: 27px; animation: twinkle 3s ease-in-out infinite; }
.star-one { top: 16%; right: 11%; }
.star-two { top: 55%; left: 4%; animation-delay: 0.8s; }
.star-three { bottom: 12%; right: 5%; animation-delay: 1.6s; }
@keyframes twinkle { 50% { opacity: 0.35; transform: scale(0.75) rotate(15deg); } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 10px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; text-align: left; }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 18px;
  background: var(--yellow);
  box-shadow: var(--small-shadow);
  font-size: 28px;
  transform: rotate(-4deg);
}
.brand strong { display: block; font-size: 19px; font-weight: 950; letter-spacing: 0.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.unit-directory-nav { width: min(1080px, calc(100% - 36px)); margin: 4px auto 0; }
.units-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 15px;
  gap: 7px;
  border: 2px solid #e9dfd6;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 3px 0 rgba(101,80,73,0.06);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.units-home-link:hover { border-color: var(--mint); transform: translateY(-1px); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.star-pill {
  display: flex;
  align-items: center;
  min-width: 76px;
  height: 46px;
  padding: 0 15px;
  gap: 7px;
  border: 2px solid #f6e2a5;
  border-radius: 999px;
  background: #fff9dc;
  box-shadow: 0 3px 0 rgba(194,152,54,0.1);
  font-size: 19px;
}
.star-pill strong { min-width: 20px; text-align: center; }
.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 2px solid #eee5dc;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(101,80,73,0.06);
  cursor: pointer;
  font-size: 20px;
  transition: transform 0.18s ease;
}
#chart-button { width: 56px; color: #4d806d; font-size: 13px; font-weight: 950; }
.icon-button:hover { transform: translateY(-2px) rotate(3deg); }

.app-shell { width: min(1080px, calc(100% - 36px)); min-height: calc(100vh - 190px); margin: 18px auto 0; padding-bottom: 34px; }
.site-footer { display: flex; align-items: center; justify-content: center; padding: 4px 20px 24px; gap: 10px; color: #93899a; font-size: 13px; font-weight: 700; text-align: center; }
.student-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.text-button { padding: 5px 2px; border: 0; background: none; color: #568d7c; cursor: pointer; font-size: 13px; font-weight: 900; }
.text-button:hover { text-decoration: underline; }

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  min-height: 352px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fff3cb 0%, #fff9e9 52%, #e7f8ef 100%);
  box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 2; align-self: center; padding: 40px 8px 40px 44px; }
.eyebrow { display: inline-flex; align-items: center; margin: 0 0 12px; padding: 7px 13px; gap: 6px; border-radius: 999px; background: rgba(255,255,255,0.82); color: #8b6636; font-size: 12px; font-weight: 900; letter-spacing: 0.06em; }
.hero-copy h1 { max-width: 480px; margin: 0; font-size: clamp(31px, 4.2vw, 48px); font-weight: 950; line-height: 1.2; letter-spacing: -0.035em; }
.hero-copy h1 span { color: var(--coral-dark); }
.hero-copy > p:not(.eyebrow) { max-width: 440px; margin: 15px 0 23px; color: #746578; font-size: 15px; font-weight: 600; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-note { color: #8f7d7c; font-size: 12px; font-weight: 700; }

.primary-button, .secondary-button, .soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 22px;
  gap: 9px;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.primary-button { border: 2px solid #eb7e70; background: var(--coral); box-shadow: 0 6px 0 #d96e62; color: #fff; font-size: 16px; }
.secondary-button { border: 2px solid #e5ddd7; background: #fff; box-shadow: 0 5px 0 #e4ddd6; }
.soft-button { min-height: 44px; border: 2px solid #e4e0f2; background: #f6f2ff; box-shadow: 0 4px 0 #dfd8ec; color: #655879; font-size: 14px; }
.soft-button.mint { border-color: #b9e6d9; background: #eafaf5; box-shadow: 0 4px 0 #c9e7dd; color: #347d6b; }
.primary-button:hover, .secondary-button:hover, .soft-button:hover { transform: translateY(-2px); }
.primary-button:active, .secondary-button:active, .soft-button:active { transform: translateY(3px); box-shadow: none; }
.button-icon { font-size: 19px; }

.pinyin-scene { position: relative; min-height: 340px; overflow: hidden; }
.scene-sun { position: absolute; top: 30px; right: 36px; display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 12px rgba(255,214,107,0.18); font-size: 29px; }
.scene-hill { position: absolute; right: -45px; bottom: -90px; width: 490px; height: 285px; border-radius: 50%; background: #bfe7c1; transform: rotate(-5deg); }
.scene-hill::after { position: absolute; inset: 20px -50px auto auto; width: 300px; height: 180px; border-radius: 50%; background: #a9dab4; content: ""; }
.scene-panda { position: absolute; z-index: 2; top: 68px; left: 50%; font-size: 83px; filter: drop-shadow(0 8px 5px rgba(76,75,58,0.12)); transform: translateX(-50%) rotate(-5deg); }
.scene-bubble { position: absolute; z-index: 3; top: 34px; left: 24px; padding: 9px 14px; border: 2px solid #fff; border-radius: 15px 15px 15px 4px; background: rgba(255,255,255,0.9); color: #7a675f; box-shadow: 0 4px 0 rgba(101,80,73,0.05); font-size: 12px; font-weight: 800; }
.scene-bubble strong { color: var(--coral-dark); font-size: 16px; }
.pinyin-train { position: absolute; z-index: 3; right: 25px; bottom: 54px; left: 27px; display: flex; align-items: end; justify-content: center; gap: 8px; }
.train-car { position: relative; display: grid; width: 90px; height: 82px; place-items: center; border: 4px solid #fff; border-radius: 19px 19px 14px 14px; background: var(--blue); box-shadow: 0 7px 0 #65a8cf; color: #384153; font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 48px; font-weight: 800; }
.train-car.final { background: var(--yellow); box-shadow: 0 7px 0 #d9b34e; }
.train-car.result { width: 112px; background: var(--coral); box-shadow: 0 7px 0 #d97569; color: #fff; }
.train-car::before, .train-car::after { position: absolute; bottom: -17px; width: 19px; height: 19px; border: 4px solid #fff; border-radius: 50%; background: #625a6c; content: ""; }
.train-car::before { left: 12px; }
.train-car::after { right: 12px; }
.train-car small { position: absolute; right: 8px; bottom: 5px; font-family: inherit; font-size: 14px; opacity: 0.9; }
.train-plus { align-self: center; padding-bottom: 10px; color: #8d7a77; font-size: 26px; font-weight: 900; }
.scene-bamboo { position: absolute; right: 12px; bottom: 116px; font-size: 55px; transform: rotate(8deg); }

.home-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin: 17px 5px 32px; gap: 13px; color: var(--muted); font-size: 12px; font-weight: 750; }
.home-progress strong { color: var(--ink); }
.progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #eee8df; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #9ddd86); transition: width 0.35s ease; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 3px 16px; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 23px; font-weight: 950; letter-spacing: -0.02em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.5; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.mode-card {
  --mode: var(--coral);
  --mode-soft: #fff0ec;
  --mode-dark: var(--coral-dark);
  position: relative;
  display: flex;
  min-height: 292px;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(101,80,73,0.06), 0 10px 24px rgba(101,80,73,0.05);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mode-card::before { position: absolute; top: 0; right: 0; left: 0; height: 8px; background: var(--mode); content: ""; }
.mode-card.purple { --mode: var(--purple); --mode-soft: #f2edff; --mode-dark: var(--purple-dark); }
.mode-card.yellow { --mode: var(--yellow); --mode-soft: #fff8dc; --mode-dark: #a87a20; }
.mode-card.blue { --mode: var(--blue); --mode-soft: #ebf7ff; --mode-dark: var(--blue-dark); }
.mode-card.mint { --mode: var(--mint); --mode-soft: #eaf9f4; --mode-dark: var(--mint-dark); }
.mode-card.pink { --mode: var(--pink); --mode-soft: #fff0f5; --mode-dark: #c76d8c; }
.mode-card:hover { transform: translateY(-5px); box-shadow: 0 9px 0 rgba(101,80,73,0.06), 0 16px 28px rgba(101,80,73,0.08); }
.mode-top { display: flex; align-items: center; justify-content: space-between; }
.mode-emoji { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 18px; background: var(--mode-soft); font-size: 29px; transform: rotate(-3deg); }
.mode-number { color: var(--mode-dark); font-size: 12px; font-weight: 950; letter-spacing: 0.12em; }
.mode-done { position: absolute; top: 68px; right: 20px; padding: 4px 8px; border-radius: 999px; background: #e8f8f0; color: #398669; font-size: 10px; font-weight: 900; }
.mode-card h3 { margin: 16px 0 6px; font-size: 21px; font-weight: 950; }
.mode-card > p { min-height: 43px; margin: 0 0 13px; color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.65; }
.skill-chip { align-self: flex-start; padding: 5px 9px; border-radius: 999px; background: var(--mode-soft); color: var(--mode-dark); font-size: 11px; font-weight: 900; }
.mode-result { margin-top: auto; padding-top: 16px; }
.mode-result-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.mode-result-label strong { color: var(--ink); }
.mode-result .progress-track { height: 8px; }
.mode-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: var(--mode-dark); font-size: 12px; font-weight: 900; }
.mode-card-footer b { font-size: 20px; }

.reference-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin-top: 20px; padding: 20px 23px; gap: 16px; border: 3px solid #fff; border-radius: 24px; background: linear-gradient(110deg, #edf8ff, #f5f0ff); box-shadow: var(--small-shadow); }
.reference-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; background: #fff; font-size: 26px; }
.reference-card h3 { margin: 0 0 4px; font-size: 17px; }
.reference-card p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.5; }
.reference-actions { display: flex; gap: 10px; }

.game-header { display: grid; grid-template-columns: auto 1fr minmax(160px,240px); align-items: center; margin: 2px 0 17px; gap: 15px; }
.back-button { display: grid; width: 45px; height: 45px; place-items: center; border: 2px solid #e9dfd6; border-radius: 15px; background: #fff; box-shadow: 0 3px 0 #e7ded4; cursor: pointer; font-size: 23px; font-weight: 900; }
.game-title h1 { margin: 0; font-size: 21px; font-weight: 950; }
.game-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.game-progress { display: flex; align-items: center; gap: 10px; }
.game-progress .progress-track { flex: 1; }
.round-label { white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 900; }
.game-card { max-width: 850px; min-height: 510px; margin: 0 auto; padding: 31px 36px 30px; border: 3px solid #fff; border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.prompt-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.prompt-mascot { font-size: 29px; }
.prompt-row h2 { margin: 0; font-size: 22px; font-weight: 950; }
.prompt-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.question-stage { display: flex; align-items: center; justify-content: center; min-height: 165px; margin: 17px 0 5px; gap: 18px; }
.sound-showcase { position: relative; display: flex; align-items: center; justify-content: center; min-width: 235px; min-height: 145px; padding: 18px 26px; gap: 20px; border: 3px solid #f2e7d9; border-radius: 26px; background: linear-gradient(145deg,#fff9e9,#f3fbf6); }
.showcase-emoji { font-size: 43px; filter: drop-shadow(0 4px 3px rgba(80,60,70,0.08)); }
.showcase-char { font-size: 64px; font-weight: 850; line-height: 1; }
.showcase-pinyin { color: #665578; font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 62px; font-weight: 750; letter-spacing: 0.02em; }
.showcase-label { position: absolute; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.85); color: #8b7b80; font-size: 10px; font-weight: 800; }
.listen-orb { display: grid; flex: 0 0 auto; width: 72px; height: 72px; place-items: center; border: 3px solid #d9f0e6; border-radius: 50%; background: #e9f9f2; box-shadow: 0 5px 0 #cde7db; cursor: pointer; font-size: 31px; transition: transform 0.15s ease; }
.listen-orb:hover { transform: scale(1.06); }
.listen-orb.playing { animation: soundPulse 0.7s ease-in-out infinite alternate; }
@keyframes soundPulse { to { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(115,212,190,0.18); } }
.listen-hint { margin: 0 0 17px; color: #8b7e89; font-size: 12px; font-weight: 700; }
.listen-hint .text-button { display: inline; font-size: 12px; }

.tone-guide { display: flex; justify-content: center; margin: 3px 0 10px; gap: 7px; }
.tone-guide span { padding: 5px 10px; border-radius: 10px; background: #f5f0ff; color: #75638f; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 18px; font-weight: 800; }
.blend-equation { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 13px; }
.blend-tile { display: grid; width: 105px; height: 105px; place-items: center; border: 4px solid #fff; border-radius: 24px; box-shadow: 0 6px 0 rgba(90,75,95,0.12); font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 56px; font-weight: 800; }
.blend-tile.initial { background: #e8f5ff; color: #4584ad; }
.blend-tile.final { background: #fff5d5; color: #a47b2c; }
.blend-symbol { color: #9b8a91; font-size: 31px; font-weight: 900; }
.blend-tile.unknown { border: 3px dashed #d8cadc; background: #f8f4fb; color: #a593b0; box-shadow: none; }
.pair-badges { display: flex; justify-content: center; margin: 7px 0 0; gap: 9px; }
.pair-badges span { padding: 6px 13px; border-radius: 12px; background: #edf6fd; color: #527c98; font-family: "Avenir Next", sans-serif; font-size: 21px; font-weight: 850; }
.pair-badges i { align-self: center; color: #aa9ba4; font-size: 12px; font-style: normal; font-weight: 800; }

.answer-instruction { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.option-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); max-width: 680px; margin: 0 auto; gap: 12px; }
.option-grid.whole-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
.option-grid.contrast-options { grid-template-columns: repeat(2,minmax(0,180px)); justify-content: center; }
.option-button { position: relative; display: flex; min-height: 76px; align-items: center; justify-content: center; padding: 12px 8px; gap: 8px; border: 3px solid #eae3ec; border-radius: 19px; background: #fff; box-shadow: 0 5px 0 #e7dfe7; cursor: pointer; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 29px; font-weight: 800; transition: transform 0.14s ease, border-color 0.14s ease; }
.option-button:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-2px); }
.option-button.tone-option { flex-direction: column; gap: 2px; font-size: 25px; }
.tone-option small { color: var(--muted); font-family: "PingFang SC", sans-serif; font-size: 11px; font-weight: 800; }
.option-button.char-option { min-height: 92px; font-size: 42px; }
.option-button.wrong { border-color: #f0aaa4; background: #fff2f0; box-shadow: 0 4px 0 #edc4c0; color: #bf6963; animation: shake 0.3s ease; }
.option-button.correct { border-color: #75c6a6; background: #ebf9f2; box-shadow: 0 4px 0 #b9dfcd; color: #317c61; }
.option-button.dimmed { opacity: 0.42; }
.answer-badge { position: absolute; top: -10px; right: -8px; display: grid; width: 27px; height: 27px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--success); color: #fff; font-size: 15px; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.feedback-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; max-width: 700px; margin: 22px auto 0; padding: 15px 16px; gap: 14px; border: 2px solid #cce8da; border-radius: 20px; background: #f0faf5; text-align: left; animation: feedbackIn 0.25s ease-out; }
@keyframes feedbackIn { from { opacity: 0; transform: translateY(8px); } }
.feedback-example { display: flex; min-width: 105px; align-items: center; gap: 8px; border-radius: 12px; cursor: pointer; text-align: left; }
.feedback-example:hover { background: rgba(115,212,190,0.12); }
.feedback-example > span:first-child { font-size: 30px; }
.feedback-example strong { display: block; font-size: 27px; }
.feedback-example small { display: block; margin-top: 1px; color: #4d8973; font-family: "Avenir Next", sans-serif; font-size: 15px; font-weight: 800; }
.feedback-copy h3 { margin: 0 0 4px; color: #357c61; font-size: 16px; }
.feedback-copy p { margin: 0; color: #65786f; font-size: 12px; font-weight: 650; line-height: 1.6; }
.feedback-card .primary-button { min-height: 43px; padding: 9px 16px; white-space: nowrap; font-size: 14px; }
.star-burst { position: fixed; z-index: 50; top: 45%; left: 50%; pointer-events: none; font-size: 42px; animation: burst 0.85s ease-out forwards; }
@keyframes burst { from { opacity: 1; transform: translate(-50%,-50%) scale(0.5); } to { opacity: 0; transform: translate(-50%,-130%) scale(1.4) rotate(12deg); } }

.summary-card { position: relative; max-width: 740px; margin: 12px auto 0; padding: 40px; overflow: hidden; border: 3px solid #fff; border-radius: 34px; background: linear-gradient(145deg,#fff8d9,#fffefd 55%,#eaf8f2); box-shadow: var(--shadow); text-align: center; }
.summary-mascot { font-size: 72px; animation: float 2.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-7px) rotate(3deg); } }
.summary-card h1 { margin: 10px 0 7px; font-size: 34px; font-weight: 950; }
.summary-card > p { max-width: 500px; margin: 0 auto; color: var(--muted); font-size: 14px; font-weight: 650; line-height: 1.75; }
.summary-score { display: inline-flex; align-items: center; margin: 22px 0; padding: 13px 24px; gap: 9px; border: 2px solid #f1d890; border-radius: 999px; background: #fff9df; color: #916e2b; font-size: 25px; font-weight: 950; }
.summary-stats { display: grid; grid-template-columns: repeat(3,1fr); max-width: 470px; margin: 0 auto 22px; gap: 12px; }
.summary-stat { padding: 14px 8px; border: 2px solid #eee5de; border-radius: 17px; background: rgba(255,255,255,0.8); }
.summary-stat strong { display: block; font-size: 24px; }
.summary-stat span { color: var(--muted); font-size: 11px; font-weight: 750; }
.summary-rule { max-width: 520px; margin: 0 auto 24px; padding: 13px 16px; border-radius: 15px; background: rgba(255,255,255,0.76); color: #766c78; font-size: 12px; font-weight: 650; line-height: 1.65; }
.summary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; overflow-y: auto; background: rgba(55,45,65,0.45); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(850px,100%); max-height: calc(100vh - 44px); padding: 28px; overflow-y: auto; border: 3px solid #fff; border-radius: 29px; background: var(--paper); box-shadow: 0 24px 70px rgba(50,35,60,0.25); }
.modal-card.small { width: min(610px,100%); }
.modal-close { position: sticky; z-index: 2; top: 0; float: right; display: grid; width: 39px; height: 39px; margin: -8px -8px 0 8px; place-items: center; border: 2px solid #e9e0e6; border-radius: 13px; background: #fff; cursor: pointer; font-size: 21px; }
.modal-heading { margin: 0 45px 6px 0; font-size: 25px; font-weight: 950; }
.modal-intro { margin: 0 45px 19px 0; color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.65; }
.chart-group { margin-top: 18px; padding: 18px; border-radius: 20px; background: #fff7ef; }
.chart-group.front-nasal { background: #eef7fe; }
.chart-group.back-nasal { background: #ecf8f3; }
.chart-group.whole-group { background: #f3effc; }
.chart-group-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.chart-group h3 { margin: 0; font-size: 17px; }
.chart-group-heading span { color: #7e7480; font-size: 11px; font-weight: 700; }
.chart-group > p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pinyin-chart-grid { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 7px; }
.pinyin-chart-grid.five-columns { grid-template-columns: repeat(5,minmax(0,1fr)); }
.pinyin-chart-grid.four-columns { grid-template-columns: repeat(4,minmax(0,1fr)); }
.pinyin-chart-grid.whole-grid { grid-template-columns: repeat(8,minmax(0,1fr)); }
.chart-item { min-width: 0; padding: 10px 4px 8px; border: 2px solid rgba(220,210,215,0.65); border-radius: 12px; background: rgba(255,255,255,0.88); cursor: pointer; text-align: center; }
.chart-item:hover { border-color: var(--mint); transform: translateY(-2px); }
.chart-item strong { display: block; font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 23px; }
.chart-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.chart-item.playing { border-color: var(--mint-dark); background: #e4f8ef; }
.modal-bottom-action { display: flex; justify-content: center; margin-top: 20px; }
.source-image { display: block; width: 100%; height: auto; border: 1px solid #e6ddd7; border-radius: 16px; }

.report-hero { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-radius: 20px; background: linear-gradient(120deg,#fff7d9,#edf8f2); }
.report-hero p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.report-hero strong { display: block; margin-top: 3px; font-size: 29px; }
.report-hero > span { font-size: 48px; }
.report-list { display: grid; margin-top: 17px; gap: 9px; }
.report-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 12px 14px; gap: 12px; border: 2px solid #eee7e3; border-radius: 16px; }
.report-row > span:first-child { font-size: 25px; }
.report-row h3 { margin: 0 0 5px; font-size: 14px; }
.report-row p { margin: 6px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.report-row .progress-track { height: 7px; }
.report-score { text-align: right; }
.report-score strong { display: block; color: #997126; font-size: 13px; }
.report-score small { color: var(--muted); font-size: 10px; }
.report-note { margin: 17px 0 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }

.login-card { max-width: 650px; margin: 35px auto 0; padding: 37px; border: 3px solid #fff; border-radius: 32px; background: linear-gradient(145deg,#fff8de,#fff 58%,#edf8f3); box-shadow: var(--shadow); text-align: center; }
.login-mascot { font-size: 67px; }
.login-card h1 { margin: 12px 0 8px; font-size: 30px; font-weight: 950; }
.login-card > p { margin: 0 0 23px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.student-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.student-button { display: flex; min-height: 76px; align-items: center; justify-content: center; padding: 11px; gap: 8px; border: 2px solid #e7ded5; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #e8dfd7; cursor: pointer; font-weight: 850; }
.student-button:hover { border-color: var(--mint); transform: translateY(-2px); }
.student-avatar { font-size: 27px; }
.answer-placeholder { grid-column: 1/-1; margin: 10px; color: var(--muted); font-size: 13px; }
.new-student { display: flex; margin-top: 21px; gap: 11px; }
.new-student input { min-width: 0; flex: 1; padding: 13px 16px; border: 2px solid #e3d9d2; border-radius: 16px; background: #fff; color: var(--ink); }
.new-student .primary-button { white-space: nowrap; }

.toast { position: fixed; z-index: 200; bottom: 28px; left: 50%; max-width: calc(100% - 32px); padding: 12px 19px; border-radius: 999px; background: #4a4055; box-shadow: 0 8px 25px rgba(45,35,55,0.2); color: #fff; font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%,20px); transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 900px) {
  .mode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero-copy { padding-left: 32px; }
  .train-car { width: 74px; height: 74px; font-size: 40px; }
  .train-car.result { width: 92px; }
  .pinyin-chart-grid, .pinyin-chart-grid.whole-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .feedback-card { grid-template-columns: auto 1fr; }
  .feedback-card .primary-button { grid-column: 1/-1; width: 100%; }
}

@media (max-width: 680px) {
  .topbar { width: calc(100% - 24px); padding-top: 15px; }
  .brand-mark { width: 47px; height: 47px; border-radius: 15px; font-size: 24px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 9px; letter-spacing: 0; }
  .topbar-actions { gap: 6px; }
  .star-pill { min-width: 61px; height: 42px; padding: 0 10px; font-size: 16px; }
  .icon-button { width: 42px; height: 42px; border-radius: 14px; }
  #chart-button { display: none; }
  .unit-directory-nav, .app-shell { width: calc(100% - 24px); }
  .app-shell { margin-top: 13px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px 25px 12px; text-align: center; }
  .hero-copy h1 { margin: 0 auto; font-size: 34px; }
  .hero-copy > p:not(.eyebrow) { margin-right: auto; margin-left: auto; }
  .hero-actions { justify-content: center; }
  .pinyin-scene { min-height: 245px; }
  .scene-panda { top: 35px; font-size: 67px; }
  .scene-sun { top: 20px; right: 23px; width: 51px; height: 51px; }
  .scene-bubble { top: 17px; left: 20px; }
  .pinyin-train { right: 20px; bottom: 42px; left: 20px; }
  .train-car { width: 75px; height: 65px; font-size: 38px; }
  .train-car.result { width: 92px; }
  .scene-bamboo { display: none; }
  .home-progress { grid-template-columns: 1fr auto; margin-bottom: 25px; }
  .home-progress .progress-track { grid-column: 1/-1; grid-row: 2; }
  .home-progress > span:last-child { text-align: right; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 20px; }
  .section-heading p { font-size: 12px; }
  .reference-card { grid-template-columns: auto 1fr; }
  .reference-actions { grid-column: 1/-1; }
  .reference-actions button { flex: 1; }
  .game-header { grid-template-columns: auto 1fr; }
  .game-title h1 { font-size: 18px; }
  .game-title p { display: none; }
  .game-progress { grid-column: 1/-1; }
  .game-card { min-height: 490px; padding: 25px 18px; }
  .prompt-row h2 { font-size: 19px; }
  .question-stage { min-height: 148px; gap: 10px; }
  .sound-showcase { min-width: 0; flex: 1; padding: 17px 14px; gap: 12px; }
  .showcase-char { font-size: 55px; }
  .showcase-pinyin { font-size: 48px; }
  .showcase-emoji { font-size: 34px; }
  .listen-orb { width: 61px; height: 61px; font-size: 27px; }
  .option-grid, .option-grid.whole-options, .option-grid.contrast-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .blend-tile { width: 83px; height: 88px; font-size: 46px; }
  .blend-equation { gap: 8px; }
  .blend-symbol { font-size: 24px; }
  .feedback-card { grid-template-columns: 1fr; text-align: center; }
  .feedback-example { justify-content: center; }
  .feedback-card .primary-button { grid-column: auto; }
  .modal-card { padding: 22px 17px; }
  .pinyin-chart-grid, .pinyin-chart-grid.whole-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .pinyin-chart-grid.five-columns { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .pinyin-chart-grid.four-columns { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .chart-group { padding: 14px 11px; }
  .chart-group-heading { align-items: start; flex-direction: column; gap: 4px; }
  .login-card { margin-top: 20px; padding: 29px 21px; }
  .student-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .brand { min-width: 0; flex: 1; gap: 8px; }
  .brand > span:last-child { min-width: 0; }
  .brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .brand small { display: none; }
  .topbar-actions { flex: 0 0 auto; gap: 5px; }
  .star-pill { min-width: 55px; padding: 0 8px; }
  .mode-grid { grid-template-columns: 1fr; gap: 13px; }
  .mode-card { min-height: 250px; }
  .mode-card > p { min-height: 0; }
  .new-student { flex-direction: column; }
  .summary-card { padding: 30px 18px; }
  .summary-card h1 { font-size: 28px; }
  .summary-stats { gap: 7px; }
  .summary-stat strong { font-size: 20px; }
  .report-row { grid-template-columns: auto 1fr; }
  .report-score { grid-column: 2; text-align: left; }
  .report-score strong, .report-score small { display: inline; margin-right: 8px; }
  .site-footer { font-size: 11px; }
}

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