:root {
  --ink: #2f3350;
  --muted: #777a91;
  --cream: #fffaf0;
  --paper: #fffdf8;
  --orange: #ff7d55;
  --orange-dark: #e9653e;
  --yellow: #ffd761;
  --green: #69c99a;
  --green-dark: #3b9e73;
  --blue: #76bff0;
  --blue-dark: #3a87bd;
  --pink: #ffb8c9;
  --purple: #9a85e8;
  --line: #eee8db;
  --shadow: 0 18px 50px rgba(83, 66, 37, 0.1);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 8%, rgba(255, 215, 97, 0.18), transparent 24rem),
    radial-gradient(circle at 94% 33%, rgba(118, 191, 240, 0.15), transparent 28rem),
    var(--cream);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(58, 135, 189, 0.3);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

mark {
  color: inherit;
  background: linear-gradient(transparent 58%, rgba(255, 215, 97, 0.7) 58%);
  padding: 0 2px;
}

.sky-decor {
  position: absolute;
  inset: 0 0 auto;
  height: 510px;
  overflow: hidden;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 110px;
  height: 32px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.68);
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 46px;
  height: 46px;
  left: 18px;
  bottom: 8px;
}

.cloud::after {
  width: 58px;
  height: 58px;
  right: 15px;
  bottom: 6px;
}

.cloud-one {
  top: 110px;
  left: -20px;
  animation: cloud-drift 13s ease-in-out infinite alternate;
}

.cloud-two {
  top: 250px;
  right: 4%;
  transform: scale(0.75);
  opacity: 0.75;
  animation: cloud-drift 16s ease-in-out -5s infinite alternate-reverse;
}

.spark {
  position: absolute;
  color: var(--yellow);
  font-size: 25px;
  animation: twinkle 2.6s ease-in-out infinite;
}

.spark-one {
  top: 130px;
  right: 8%;
}

.spark-two {
  top: 330px;
  left: 4%;
  font-size: 16px;
  animation-delay: -1s;
}

.spark-three {
  top: 390px;
  right: 26%;
  color: var(--pink);
  animation-delay: -1.8s;
}

@keyframes cloud-drift {
  to {
    transform: translateX(28px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(18deg);
  }
}

.topbar {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px 15px 19px 15px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 18px rgba(255, 125, 85, 0.28);
  font-family: var(--kai);
  font-size: 29px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.brand span:last-child {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streak-pill,
.icon-button {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 28px rgba(91, 74, 46, 0.08);
  backdrop-filter: blur(12px);
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 17px;
  border-radius: 100px;
  font-size: 13px;
}

.streak-pill b {
  color: var(--orange-dark);
  font-size: 15px;
}

.icon-button {
  width: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.welcome-panel {
  min-height: 360px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 34px 42px 30px;
  border-radius: 40px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 251, 239, 0.94) 0%, rgba(255, 251, 239, 0.67) 50%, rgba(255, 251, 239, 0) 72%),
    linear-gradient(135deg, #ffe88c 0%, #ffd98c 53%, #b9e8c9 100%);
  box-shadow: var(--shadow);
}

.welcome-panel::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  right: 20%;
  top: -170px;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
  padding-bottom: 10px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "✦";
  margin-right: 7px;
}

.welcome-copy h1 {
  margin: 0;
  font-family: var(--kai);
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.13;
  letter-spacing: 0.02em;
  font-weight: 900;
}

.welcome-copy h1 span {
  color: var(--orange);
  position: relative;
}

.welcome-copy h1 span::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 0;
  bottom: -4px;
  height: 10px;
  border-radius: 70%;
  border-top: 5px solid rgba(255, 125, 85, 0.26);
  transform: rotate(-1deg);
}

.welcome-note {
  max-width: 500px;
  margin: 20px 0 24px;
  color: #636577;
  font-size: 14px;
  line-height: 1.9;
}

.daily-facts {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.daily-facts div {
  min-width: 90px;
  padding: 12px 18px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.daily-facts div + div {
  border-left: 1px solid #eee6d8;
}

.daily-facts strong {
  color: var(--orange);
  font-size: 25px;
  line-height: 1;
}

.daily-facts span {
  color: var(--muted);
  font-size: 11px;
}

.mascot-scene {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44%;
  height: 100%;
  z-index: 1;
}

.sun {
  position: absolute;
  top: 42px;
  right: 64px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff3ad;
  box-shadow: 0 0 0 15px rgba(255, 243, 173, 0.18), 0 0 50px #fff2a1;
}

.speech-bubble {
  position: absolute;
  top: 62px;
  right: 28%;
  z-index: 5;
  padding: 11px 16px;
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 16px 16px 4px 16px;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(4deg);
  box-shadow: 4px 5px 0 rgba(47, 51, 80, 0.1);
}

.mascot {
  position: absolute;
  z-index: 4;
  right: 18%;
  bottom: 45px;
  width: 152px;
  height: 230px;
  animation: mascot-bob 3.2s ease-in-out infinite;
}

@keyframes mascot-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(1deg);
  }
}

.ear {
  position: absolute;
  top: 9px;
  width: 50px;
  height: 58px;
  border-radius: 50% 50% 44% 44%;
  background: #ef9b56;
  border: 3px solid var(--ink);
  z-index: -1;
}

.ear::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: #ffc4ad;
}

.ear-left {
  left: 13px;
  transform: rotate(-26deg);
}

.ear-right {
  right: 13px;
  transform: rotate(26deg);
}

.face {
  position: absolute;
  top: 18px;
  left: 21px;
  width: 110px;
  height: 92px;
  border: 3px solid var(--ink);
  border-radius: 46% 46% 44% 44%;
  background: #f7b36c;
  z-index: 2;
}

.eye {
  position: absolute;
  top: 35px;
  width: 9px;
  height: 12px;
  background: var(--ink);
  border-radius: 50%;
}

.eye:first-child {
  left: 27px;
}

.eye:nth-child(2) {
  right: 27px;
}

.eye::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}

.nose {
  position: absolute;
  top: 50px;
  left: 50%;
  width: 11px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

.smile {
  position: absolute;
  top: 60px;
  left: 50%;
  width: 25px;
  height: 13px;
  border-bottom: 3px solid var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

.cheek {
  position: absolute;
  top: 58px;
  width: 18px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 116, 128, 0.45);
}

.cheek-left {
  left: 14px;
}

.cheek-right {
  right: 14px;
}

.body {
  position: absolute;
  bottom: 0;
  left: 29px;
  width: 95px;
  height: 130px;
  border-radius: 42% 42% 24px 24px;
  border: 3px solid var(--ink);
  background: #5bb786;
}

.body::after {
  content: "";
  position: absolute;
  inset: 12px -2px auto;
  height: 40px;
  border-radius: 30% 30% 50% 50%;
  background: #61c08d;
  border-bottom: 3px solid var(--ink);
}

.belly {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 55px;
  transform: translateX(-50%) rotate(-4deg);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8e7;
  border: 2px solid var(--ink);
  font-family: var(--kai);
  font-size: 28px;
  font-weight: 900;
}

.paw {
  position: absolute;
  z-index: 3;
  bottom: 16px;
  width: 40px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #f7b36c;
}

.paw-left {
  left: -29px;
  transform: rotate(-28deg);
}

.paw-right {
  right: -29px;
  transform: rotate(28deg);
}

.hill {
  position: absolute;
  bottom: -90px;
  border-radius: 50% 50% 0 0;
}

.hill-back {
  right: -50px;
  width: 460px;
  height: 230px;
  background: #94d8a9;
  transform: rotate(-4deg);
}

.hill-front {
  right: -85px;
  width: 520px;
  height: 180px;
  background: #63bd86;
  transform: rotate(4deg);
}

.flower {
  position: absolute;
  z-index: 3;
  color: #fff;
  font-size: 34px;
  text-shadow: 0 2px 0 rgba(47, 51, 80, 0.12);
}

.flower-one {
  bottom: 35px;
  right: 52px;
}

.flower-two {
  bottom: 14px;
  left: 25px;
  color: #ffe066;
  font-size: 24px;
}

.lesson-shell {
  margin: -8px 18px 0;
  padding: 32px;
  position: relative;
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 25px 65px rgba(83, 66, 37, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.lesson-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.lesson-toolbar .section-kicker {
  margin-bottom: 5px;
  color: var(--green-dark);
}

.lesson-toolbar h2 {
  margin: 0;
  font-family: var(--kai);
  font-size: 28px;
  letter-spacing: 0.04em;
}

.lesson-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.round-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(47, 51, 80, 0.05);
  transition: 0.2s ease;
}

.round-button:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
}

.lesson-layout {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 235px;
  gap: 18px;
  align-items: stretch;
}

.character-rail,
.daily-card {
  border-radius: var(--radius-lg);
  background: #fbf7ed;
  border: 1px solid #f2eadc;
}

.character-rail {
  padding: 16px 12px;
}

.rail-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 4px 12px;
  color: var(--muted);
  font-size: 10px;
}

.rail-heading span:last-child {
  color: var(--orange);
  font-weight: 800;
}

.character-list {
  display: grid;
  gap: 8px;
}

.character-button {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
}

.character-button:hover {
  transform: translateX(3px);
  border-color: #f1d8c7;
}

.character-button .mini-char {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff9e9;
  font-family: var(--kai);
  font-size: 25px;
  font-weight: 900;
}

.character-button .mini-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.character-button .mini-info small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.character-button .learned-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  box-shadow: 0 2px 5px rgba(59, 158, 115, 0.3);
}

.character-button.learned .learned-dot {
  display: grid;
}

.character-button.active {
  border-color: var(--orange);
  background: #fff7eb;
  box-shadow: 0 5px 12px rgba(255, 125, 85, 0.09);
}

.character-button.active .mini-char {
  background: var(--orange);
  color: #fff;
}

.study-card {
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(47, 51, 80, 0.055);
}

.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  background: #faf7f1;
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  flex: 1;
  height: 43px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
}

.mode-tab span {
  margin-right: 4px;
}

.mode-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.mode-tab.active {
  color: var(--orange-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(83, 66, 37, 0.08);
}

.mode-panel {
  min-height: 425px;
  padding: 25px 26px 22px;
}

#recognizePanel {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 24px;
}

.character-stage {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.8), transparent 40%),
    linear-gradient(145deg, #fff6dc, #fff1d7 55%, #ffe9d1);
}

.character-stage::before,
.character-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(217, 166, 93, 0.33);
}

.character-stage::before {
  width: 250px;
  height: 250px;
  animation: spin 30s linear infinite;
}

.character-stage::after {
  width: 195px;
  height: 195px;
  animation: spin 24s linear infinite reverse;
}

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

.character-halo {
  position: absolute;
  width: 154px;
  height: 154px;
  border-radius: 46% 54% 52% 48%;
  background: rgba(255, 255, 255, 0.58);
  transform: rotate(8deg);
  box-shadow: 0 15px 40px rgba(255, 192, 105, 0.2);
}

.character-stage .pinyin {
  z-index: 2;
  margin-bottom: 5px;
  color: var(--orange-dark);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.big-character {
  z-index: 2;
  width: 156px;
  height: 156px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--kai);
  font-size: 116px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.big-character:hover {
  transform: scale(1.06) rotate(-2deg);
}

.big-character.pop {
  animation: char-pop 0.45s ease;
}

@keyframes char-pop {
  50% {
    transform: scale(1.12) rotate(3deg);
  }
}

.listen-button {
  z-index: 2;
  margin-top: 9px;
  padding: 10px 18px;
  border: 1px solid #f0d5c2;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.listen-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.character-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.meaning-line {
  margin: 0 0 7px;
  font-size: 14px;
}

.meaning-line > span {
  margin-right: 5px;
  font-size: 20px;
}

.memory-tip {
  min-height: 43px;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.word-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.word-title h3 {
  margin: 0;
  font-size: 14px;
}

.word-title span {
  color: #aaa99f;
  font-size: 9px;
}

.word-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.word-chip {
  min-width: 0;
  padding: 12px 8px 10px;
  border: 1.5px solid #eee8dd;
  border-radius: 13px;
  background: #fffcf7;
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s ease;
}

.word-chip b {
  display: block;
  font-family: var(--kai);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.word-chip small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.word-chip:hover {
  border-color: #ffbd76;
  background: #fff7e9;
  transform: translateY(-2px);
}

.sentence-card {
  margin-top: 15px;
  padding: 12px 13px;
  border-left: 3px solid var(--yellow);
  border-radius: 3px 12px 12px 3px;
  background: #fff9e8;
}

.sentence-label {
  display: block;
  margin-bottom: 4px;
  color: #b48b42;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.sentence-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.read-layout {
  min-height: 370px;
  display: grid;
  grid-template-columns: 38% 62%;
  gap: 30px;
  align-items: stretch;
}

.read-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(140deg, #d7f1e3, #eefaf4);
  background-size: 24px 24px, 24px 24px, auto;
}

.read-hero .pinyin {
  color: var(--green-dark);
  font-weight: 800;
}

.read-character {
  margin: 3px 0 14px;
  font-family: var(--kai);
  font-size: 105px;
  font-weight: 900;
  line-height: 1.1;
}

.read-hero .listen-button {
  color: var(--green-dark);
  border-color: #c2e5d3;
}

.read-practice {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.read-kicker {
  margin: 0 0 15px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.reading-line {
  padding: 13px 17px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #e8eee9;
  border-radius: 15px;
  background: #fbfefc;
}

.reading-line span {
  font-family: var(--kai);
  font-size: 26px;
  font-weight: 900;
}

.reading-line small {
  color: var(--muted);
  font-size: 9px;
}

.sentence-line {
  margin-top: 9px;
  padding: 15px 17px 17px;
}

.sentence-line span {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

.read-actions {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-button {
  border: 1px solid var(--orange);
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 18px rgba(255, 125, 85, 0.2);
}

.primary-button:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
}

.secondary-button {
  border: 1px solid #e8e1d6;
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  border-color: #cfc5b5;
  transform: translateY(-2px);
}

.read-actions button {
  flex: 1;
}

.read-status {
  margin: 12px 0 0;
  min-height: 20px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.read-status.success {
  color: var(--green-dark);
  font-weight: 700;
}

.read-status.listening {
  color: var(--orange-dark);
}

.write-layout {
  min-height: 370px;
  display: grid;
  grid-template-columns: minmax(280px, 46%) 54%;
  gap: 28px;
}

.write-board-wrap {
  padding: 12px;
  border-radius: 21px;
  background: #eff9f7;
  border: 1px solid #d6ece7;
}

.board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 3px 9px;
}

.board-tools strong {
  color: #477b73;
  font-size: 11px;
}

.tiny-button {
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #6d918b;
  font-size: 9px;
  cursor: pointer;
}

.tiny-button.active {
  border-color: #c6e3dc;
  background: rgba(255, 255, 255, 0.75);
  color: #2d6d63;
}

#writingCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  max-height: 290px;
  border-radius: 12px;
  background:
    linear-gradient(rgba(87, 157, 145, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 157, 145, 0.1) 1px, transparent 1px),
    #fff;
  background-size: 25% 25%;
  border: 1px solid #deece9;
  touch-action: none;
  cursor: crosshair;
}

.board-buttons {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.board-buttons button {
  flex: 1;
  min-height: 38px;
  font-size: 10px;
}

.write-guide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.write-step {
  color: #d7cfc0;
  font-family: Georgia, serif;
  font-size: 48px;
  font-weight: 900;
  line-height: 0.9;
}

.write-guide h3 {
  margin: 8px 0;
  font-family: var(--kai);
  font-size: 24px;
}

.write-guide > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.stroke-tip {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff8e5;
  color: #736648;
}

.stroke-tip > span {
  font-size: 17px;
}

.stroke-tip p {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
}

.write-status {
  margin-top: 12px !important;
  color: var(--green-dark) !important;
  font-weight: 700;
}

.learn-footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #faf7f1;
  border-top: 1px solid var(--line);
}

.learn-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.step-badge {
  display: inline-block;
  margin-right: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  color: #8d6f3c;
  background: #ffebbe;
  font-weight: 800;
}

.learned-button {
  min-width: 178px;
  height: 43px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--orange);
  border-radius: 13px;
  color: #fff;
  background: var(--orange);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.learned-button:hover {
  transform: translateY(-2px);
  background: var(--orange-dark);
}

.learned-button.is-learned {
  color: var(--green-dark);
  border-color: #bde2cf;
  background: #e9f8f0;
}

.daily-card {
  padding: 19px 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.daily-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
}

.daily-card-head > span {
  font-size: 25px;
}

.daily-card-head div {
  display: flex;
  flex-direction: column;
}

.daily-card-head strong {
  font-size: 13px;
}

.daily-card-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.progress-ring {
  --size: 128px;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  margin: 20px 0 15px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--progress) * 1%), #f0e9dd 0);
  position: relative;
  transition: background 0.5s ease;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: inset 0 1px 8px rgba(83, 66, 37, 0.08);
}

.progress-ring > div {
  z-index: 1;
  display: flex;
  align-items: baseline;
}

.progress-ring strong {
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1;
}

.progress-ring span {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 10px;
  background: #eee7db;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  transition: width 0.4s ease;
}

.progress-message {
  min-height: 32px;
  margin: 9px 0 13px;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.game-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #6d76cc, #8f7ee2);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 9px 19px rgba(112, 101, 198, 0.2);
  transition: 0.2s ease;
}

.game-button:not(.locked):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(112, 101, 198, 0.27);
}

.game-button.locked {
  color: #9899a6;
  background: #eeebea;
  box-shadow: none;
  cursor: not-allowed;
}

.game-button-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.17);
}

.game-button.locked .game-button-icon {
  background: rgba(255, 255, 255, 0.7);
}

.game-button > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-button b {
  font-size: 11px;
}

.game-button small {
  font-size: 8px;
  opacity: 0.75;
}

.parent-note {
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #ded5c6;
}

.parent-note strong {
  color: #837761;
  font-size: 9px;
}

.parent-note p {
  margin: 5px 0 0;
  color: #928a7d;
  font-size: 8px;
  line-height: 1.7;
}

.reward-strip {
  margin: 72px 18px 0;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 28px;
  background: #eef8f2;
  border: 1px solid #dcefe4;
}

.reward-copy h2 {
  margin: 0;
  font-family: var(--kai);
  font-size: 23px;
}

.badge-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px dashed #c7dcd1;
  color: #b7c9c0;
  background: rgba(255, 255, 255, 0.45);
  font-family: var(--kai);
  font-size: 17px;
  position: relative;
}

.badge.completed {
  color: #fff;
  border: 3px solid #ffe596;
  background: linear-gradient(135deg, #69c99a, #3b9e73);
  box-shadow: 0 5px 12px rgba(59, 158, 115, 0.22);
}

.badge.completed::after {
  content: "✓";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #96742b;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 900;
}

.method-section {
  margin: 84px 18px 80px;
  display: grid;
  grid-template-columns: 28% 72%;
  gap: 44px;
}

.method-intro h2 {
  margin: 0 0 13px;
  font-family: var(--kai);
  font-size: 31px;
}

.method-intro > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.method-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.method-cards article {
  min-height: 177px;
  padding: 19px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.63);
  transition: 0.2s ease;
}

.method-cards article:hover {
  transform: translateY(-4px);
  border-color: #f2d5c4;
  background: #fff;
}

.method-cards article > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--orange-dark);
  background: #ffeadf;
  font-size: 10px;
  font-weight: 900;
}

.method-cards h3 {
  margin: 17px 0 8px;
  font-family: var(--kai);
  font-size: 19px;
}

.method-cards p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 25px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #ece4d7;
}

.footer-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 22px;
}

.footer-brand strong {
  font-size: 15px;
}

.footer-brand small {
  font-size: 9px;
}

.reset-button {
  border: 0;
  background: transparent;
  color: #aaa397;
  font-size: 10px;
  cursor: pointer;
}

.reset-button:hover {
  color: var(--orange-dark);
  text-decoration: underline;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 25px rgba(47, 51, 80, 0.25);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: 0.25s ease;
}

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

.game-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(45, 50, 72, 0.56);
  backdrop-filter: blur(8px);
}

.game-modal {
  width: min(730px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 40px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 2% 100%, rgba(255, 215, 97, 0.24), transparent 16rem),
    radial-gradient(circle at 100% 0%, rgba(118, 191, 240, 0.18), transparent 18rem),
    #fffdf8;
  box-shadow: 0 30px 90px rgba(25, 28, 50, 0.35);
  position: relative;
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 1px solid #e7e1d6;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  cursor: pointer;
  font-size: 21px;
}

.game-start,
.quiz-result {
  text-align: center;
  padding: 16px;
}

.detective-badge {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff0b7, #ffdd75);
  border: 3px solid var(--ink);
  transform: rotate(-4deg);
  box-shadow: 7px 7px 0 rgba(47, 51, 80, 0.11);
}

.detective-badge span {
  font-size: 39px;
}

.game-start h2,
.quiz-result h2 {
  margin: 0;
  font-family: var(--kai);
  font-size: 38px;
}

.game-start > p:not(.section-kicker),
.quiz-result > p:not(.section-kicker) {
  max-width: 470px;
  margin: 13px auto 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.game-start-button {
  display: block;
  min-width: 180px;
  margin: 0 auto 12px;
}

.game-start > small {
  color: #aaa193;
  font-size: 9px;
}

.quiz-view {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.quiz-stars {
  display: flex;
  gap: 4px;
}

.quiz-stars span {
  color: #ddd6ca;
  font-size: 16px;
}

.quiz-stars span.current {
  color: var(--yellow);
  transform: scale(1.14);
}

.quiz-stars span.correct {
  color: var(--yellow);
}

.quiz-stars span.wrong {
  color: #e7a99e;
}

.quiz-progress {
  height: 6px;
  margin: 11px 0 35px;
  overflow: hidden;
  border-radius: 10px;
  background: #eee8dd;
}

.quiz-progress span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  transition: width 0.4s ease;
}

.question-kicker {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.quiz-question {
  margin: 0;
  font-family: var(--kai);
  font-size: 29px;
  line-height: 1.4;
}

.audio-prompt {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 9px;
}

.audio-orb {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--orange-dark);
  background: #ffebe2;
  cursor: pointer;
  animation: orb-pulse 2s ease-in-out infinite;
}

@keyframes orb-pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(255, 125, 85, 0.08);
  }
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
  margin-top: 25px;
}

.quiz-option {
  min-height: 82px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px solid #e7e1d6;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: #ffb28e;
  background: #fff8f0;
  transform: translateY(-2px);
}

.quiz-option strong {
  font-family: var(--kai);
  font-size: 28px;
}

.quiz-option small {
  color: var(--muted);
  font-size: 9px;
}

.quiz-option .option-emoji {
  font-size: 25px;
}

.quiz-option.correct {
  border-color: var(--green);
  background: #eafaf1;
  box-shadow: 0 0 0 3px rgba(105, 201, 154, 0.12);
}

.quiz-option.wrong {
  border-color: #e9927e;
  background: #fff0ec;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-feedback {
  min-height: 29px;
  margin-top: 13px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.quiz-feedback.wrong {
  color: var(--orange-dark);
}

.next-question {
  display: block;
  min-width: 130px;
  margin: 4px 0 0 auto;
}

.result-stars {
  margin-bottom: 15px;
  color: var(--yellow);
  font-size: 35px;
  letter-spacing: 8px;
  text-shadow: 0 4px 0 #eabf4b;
}

.result-score {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: -3px auto 19px;
  padding-top: 26px;
  border-radius: 50%;
  background: #fff8e3;
  border: 2px dashed #f1cf70;
}

.result-score strong {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 48px;
  line-height: 1;
}

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

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall 2.4s linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(780px) rotate(520deg);
  }
}

@media (max-width: 1060px) {
  .lesson-layout {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .daily-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 190px 130px 1fr 240px;
    align-items: center;
    gap: 20px;
  }

  .daily-card-head {
    width: auto;
  }

  .progress-ring {
    --size: 94px;
    margin: 0;
  }

  .progress-ring strong {
    font-size: 30px;
  }

  .progress-track {
    display: none;
  }

  .progress-message {
    margin: 0;
    text-align: left;
  }

  .parent-note {
    display: none;
  }

  .method-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 820px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 720px);
  }

  .welcome-panel {
    padding: 30px 26px 250px;
  }

  .welcome-copy {
    max-width: 100%;
  }

  .mascot-scene {
    width: 100%;
    height: 280px;
    opacity: 0.98;
  }

  .mascot {
    right: calc(50% - 76px);
    bottom: 13px;
    transform: scale(0.78);
    transform-origin: bottom;
    animation: none;
  }

  .sun {
    top: 65px;
    right: 22%;
  }

  .speech-bubble {
    right: 9%;
    top: 78px;
  }

  .lesson-shell {
    margin: -6px 0 0;
    padding: 22px 18px;
  }

  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .character-rail {
    padding: 12px;
  }

  .rail-heading {
    flex-direction: row;
    justify-content: space-between;
  }

  .character-list {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }

  .character-button {
    height: 54px;
    padding: 0;
    justify-content: center;
  }

  .character-button .mini-info {
    display: none;
  }

  .character-button .mini-char {
    width: 38px;
    height: 38px;
  }

  .character-button:hover {
    transform: translateY(-2px);
  }

  .daily-card {
    grid-template-columns: 1fr 100px 1fr;
    gap: 14px;
    grid-column: auto;
  }

  .daily-card .game-button {
    grid-column: 1 / -1;
  }

  .reward-strip {
    margin: 45px 0 0;
    padding: 25px;
    flex-direction: column;
    align-items: flex-start;
  }

  .badge-row {
    justify-content: flex-start;
  }

  .method-section {
    margin: 62px 0;
  }

  .method-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  footer {
    padding-bottom: 25px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding-top: 18px;
  }

  .brand small,
  .streak-pill span:last-child {
    display: none;
  }

  .streak-pill {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .streak-pill span:first-child {
    font-size: 19px;
  }

  .welcome-panel {
    padding: 26px 22px 220px;
    border-radius: 28px;
  }

  .welcome-copy h1 {
    font-size: 38px;
  }

  .welcome-note {
    margin: 15px 0 18px;
    font-size: 12px;
  }

  .daily-facts div {
    min-width: 0;
    flex: 1;
    padding: 10px 9px;
  }

  .daily-facts {
    width: 100%;
  }

  .daily-facts strong {
    font-size: 21px;
  }

  .mascot-scene {
    height: 245px;
  }

  .mascot {
    bottom: -1px;
  }

  .sun {
    top: 45px;
    right: 15%;
    width: 58px;
    height: 58px;
  }

  .speech-bubble {
    top: 63px;
    right: 7%;
  }

  .lesson-shell {
    padding: 18px 12px;
    border-radius: 26px;
  }

  .lesson-toolbar {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .lesson-toolbar h2 {
    font-size: 23px;
  }

  .lesson-switcher {
    gap: 5px;
  }

  .round-button {
    width: 33px;
    height: 33px;
  }

  .mode-panel {
    min-height: 0;
    padding: 16px;
  }

  #recognizePanel {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .character-stage {
    min-height: 235px;
  }

  .character-stage::before {
    width: 200px;
    height: 200px;
  }

  .character-stage::after {
    width: 155px;
    height: 155px;
  }

  .character-halo {
    width: 124px;
    height: 124px;
  }

  .big-character {
    width: 126px;
    height: 115px;
    font-size: 86px;
  }

  .memory-tip {
    min-height: 0;
  }

  .word-chips {
    gap: 6px;
  }

  .word-chip {
    padding: 9px 5px;
  }

  .word-chip b {
    font-size: 16px;
  }

  .read-layout,
  .write-layout {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .read-hero {
    min-height: 180px;
  }

  .read-character {
    font-size: 75px;
  }

  .read-actions {
    flex-direction: column;
  }

  .write-board-wrap {
    margin: 0 auto;
    width: 100%;
    max-width: 380px;
  }

  .write-step {
    font-size: 34px;
  }

  .write-guide h3 {
    font-size: 21px;
  }

  .learn-footer {
    padding: 13px;
    flex-direction: column;
    align-items: stretch;
  }

  .learned-button {
    width: 100%;
  }

  .daily-card {
    grid-template-columns: 1fr 84px;
    padding: 16px;
  }

  .daily-card-head {
    align-self: start;
  }

  .progress-ring {
    --size: 78px;
    grid-row: span 2;
  }

  .progress-ring::before {
    inset: 9px;
  }

  .progress-message {
    align-self: start;
  }

  .daily-card .game-button {
    grid-column: 1 / -1;
  }

  .reward-copy h2 {
    font-size: 20px;
  }

  .method-cards {
    grid-template-columns: 1fr;
  }

  .method-cards article {
    min-height: 0;
  }

  .game-overlay {
    padding: 10px;
  }

  .game-modal {
    padding: 30px 17px;
    border-radius: 24px;
  }

  .game-start h2,
  .quiz-result h2 {
    font-size: 30px;
  }

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

  .quiz-options {
    gap: 8px;
  }

  .quiz-option {
    min-height: 72px;
  }

  .quiz-option strong {
    font-size: 24px;
  }

  .result-actions {
    flex-direction: column;
  }

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

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

@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;
  }
}
