:root {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #4d4035; background: #fff8e8;
  --blue: #4b91c5; --blue-soft: #e8f5ff; --orange: #e98244; --orange-soft: #fff0df;
  --green: #579867; --green-soft: #eaf7ec; --purple: #8a72b5; --purple-soft: #f1eafa;
  --ink: #4d4035; --muted: #88786b; -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 8% 4%, #ffebba 0 8rem, transparent 8.1rem), linear-gradient(#fff8e8, #fffdf8); }
button { color: inherit; font: inherit; }
.app { width: min(100%, 1060px); min-height: 100vh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) max(44px, env(safe-area-inset-bottom)); }
h1, h2, p { margin-top: 0; }
.topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.title-block { flex: 1; }
.eyebrow { margin-bottom: 5px; color: #b56736; font-size: clamp(14px, 2vw, 18px); font-weight: 900; letter-spacing: .08em; }
h1 { margin-bottom: 5px; font-size: clamp(32px, 5vw, 50px); line-height: 1.1; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: clamp(16px, 2.2vw, 20px); }
.back-button, .sound-badge { min-height: 54px; border: 2px solid #eddec9; border-radius: 18px; background: rgba(255,255,255,.85); font-weight: 900; }
.back-button { width: 58px; font-size: 30px; } .sound-badge { padding: 0 18px; }
.welcome-card, .tip-card, .category-note, .study-card, .writing-section, .related-section { border: 3px solid rgba(255,255,255,.96); border-radius: 30px; background: rgba(255,255,255,.92); box-shadow: 0 12px 35px rgba(99,72,43,.11), 0 6px 0 rgba(160,126,85,.10); }
.welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; }
.welcome-card > div, .tip-card { display: flex; align-items: center; gap: 16px; }
.welcome-emoji { font-size: 54px; } .welcome-card b { font-size: 22px; } .welcome-card p { margin: 4px 0 0; color: var(--muted); }
.progress-pill { flex: none; padding: 11px 16px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-weight: 900; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.category-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; min-height: 170px; padding: 24px; border: 3px solid white; border-radius: 30px; text-align: left; box-shadow: 0 8px 0 rgba(84,61,41,.09); cursor: pointer; }
.category-card.blue { background: var(--blue-soft); } .category-card.orange { background: var(--orange-soft); } .category-card.green { background: var(--green-soft); } .category-card.purple { background: var(--purple-soft); }
.category-card.yellow { background: #fff6ce; } .category-card.pink { background: #ffecef; } .category-card.teal { background: #e4f7f3; }
.category-card.red { background: #ffebe5; } .category-card.cyan { background: #e5f8fb; }
.category-emoji { font-size: 64px; } .category-cover { width: 110px; height: 105px; border-radius: 20px; object-fit: cover; } .category-copy b, .category-copy small { display: block; }
.category-copy b { font-size: clamp(25px, 3vw, 34px); } .category-copy small { margin-top: 6px; color: var(--muted); font-size: 17px; }
.category-count { align-self: end; font-weight: 900; }
.tip-card { margin-top: 26px; padding: 20px 24px; } .tip-card > span { font-size: 34px; } .tip-card b { font-size: 19px; } .tip-card p { margin: 3px 0 0; color: var(--muted); }
.category-note { margin-bottom: 22px; padding: 18px 22px; color: #695481; background: var(--purple-soft); font-size: 19px; }
.category-hero { position: relative; height: 260px; margin-bottom: 22px; overflow: hidden; border: 3px solid white; border-radius: 28px; box-shadow: 0 8px 0 rgba(84,61,41,.09); }
.category-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.category-hero span { position: absolute; right: 18px; bottom: 16px; padding: 9px 15px; border-radius: 999px; color: white; background: rgba(58,49,42,.78); font-size: 18px; font-weight: 900; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .lesson-grid.compact { grid-template-columns: repeat(4, 1fr); }
.lesson-tile { position: relative; min-height: 210px; padding: 18px 10px; border: 3px solid white; border-radius: 27px; background: rgba(255,255,255,.9); box-shadow: 0 7px 0 rgba(87,63,43,.10); cursor: pointer; }
.lesson-tile.completed { background: #f0faef; }
.tile-emoji, .tile-symbol, .tile-word { display: block; } .tile-emoji { font-size: 48px; }
.tile-image { display: block; width: calc(100% + 8px); height: 122px; margin: -8px -4px 8px; border-radius: 20px; object-fit: cover; }
.tile-symbol { margin: 8px 0 3px; color: var(--blue); font-family: "Avenir Next", sans-serif; font-size: clamp(48px, 7vw, 70px); font-weight: 800; line-height: 1; }
.tile-word { color: var(--muted); font-size: 18px; font-weight: 900; }
.done-mark { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.study-card { overflow: hidden; }
.visual-stage { position: relative; display: grid; place-items: center; width: 100%; min-height: 330px; border: 0; background: linear-gradient(145deg, #fff6d5, #e7f6ff); cursor: pointer; }
.visual-stage > span { font-size: clamp(130px, 23vw, 220px); filter: drop-shadow(0 10px 3px rgba(97,70,43,.10)); }
.visual-stage img { display: block; width: 100%; height: 390px; object-fit: cover; }
.visual-stage em { position: absolute; right: 22px; bottom: 18px; padding: 11px 16px; border-radius: 999px; color: white; background: rgba(59,51,44,.78); font-style: normal; font-weight: 900; }
.study-copy { padding: 22px 26px 12px; text-align: center; } .study-copy > p { margin-bottom: 0; color: var(--green); font-weight: 900; letter-spacing: .1em; }
.study-copy h2 { margin: 2px 0 8px; color: var(--ink); font-family: "Avenir Next", sans-serif; font-size: clamp(68px, 12vw, 118px); line-height: 1; }
.word-line { display: flex; align-items: center; justify-content: center; gap: 14px; } .word-line b { font-size: 30px; } .word-line span { color: var(--muted); font-size: 21px; }
.formula { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 12px 24px 24px; }
.formula .part { min-width: 112px; padding: 13px 18px; border-radius: 22px; font-family: "Avenir Next", sans-serif; font-size: 55px; font-weight: 800; }
.formula .initial { color: #347fac; background: var(--blue-soft); } .formula .final { color: #d26c35; background: var(--orange-soft); } .formula .result { color: #438453; background: var(--green-soft); }
.formula .medial { color: #765ca5; background: var(--purple-soft); }
.formula.triple { gap: 9px; }
.formula.triple .part { min-width: 88px; padding-inline: 12px; font-size: 45px; }
.formula.triple i { font-size: 29px; }
.spelling-tip { width: fit-content; margin: -8px auto 24px; padding: 10px 16px; border-radius: 16px; color: #6c568e; background: var(--purple-soft); font-size: 17px; font-weight: 900; }
.formula i { color: #9d8d81; font-size: 35px; font-style: normal; font-weight: 900; }
.tone-path { display: flex; justify-content: center; gap: 22px; padding-bottom: 22px; color: var(--purple); font-size: 42px; font-weight: 900; }
.listen-button { display: flex; align-items: center; justify-content: center; gap: 15px; width: calc(100% - 52px); min-height: 78px; margin: 0 26px 28px; border: 0; border-radius: 23px; color: white; background: linear-gradient(135deg, #f39a56, #df7540); box-shadow: 0 7px 0 #c65f33; cursor: pointer; }
.listen-button > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #df7540; background: white; }
.listen-button b, .listen-button small { display: block; text-align: left; } .listen-button b { font-size: 21px; } .listen-button small { margin-top: 3px; opacity: .9; }
.writing-section, .related-section { margin-top: 26px; padding: 24px 26px 28px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; } .section-title h2 { margin-bottom: 0; font-size: 32px; } .section-title > span { color: var(--muted); }
.four-line { position: relative; height: 210px; margin-top: 20px; overflow: hidden; border: 2px solid #f0dfd1; border-radius: 22px; background: #fffdf9; }
.four-line i { position: absolute; right: 0; left: 0; border-top: 2px solid #e79090; } .four-line i:nth-child(1) { top: 12%; } .four-line i:nth-child(2) { top: 37%; border-top-style: dashed; } .four-line i:nth-child(3) { top: 62%; border-top-style: dashed; } .four-line i:nth-child(4) { top: 87%; }
.four-line b { position: absolute; top: 21%; left: 50%; translate: -50%; color: var(--blue); font-family: "Avenir Next", sans-serif; font-size: 122px; line-height: 1; }
.related-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 20px; }
.related-row button { min-height: 145px; padding: 12px 7px; border: 2px solid #eee0d4; border-radius: 20px; background: #fffdf9; cursor: pointer; }
.related-row span, .related-row b, .related-row small { display: block; } .related-row span { font-size: 32px; } .related-row b { margin: 5px 0; color: var(--green); font-family: "Avenir Next", sans-serif; font-size: 35px; } .related-row small { color: var(--muted); font-size: 15px; }
.related-row img { display: block; width: 100%; height: 70px; border-radius: 13px; object-fit: cover; }
.lesson-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; } .lesson-footer button { min-height: 68px; border: 0; border-radius: 20px; font-size: 19px; font-weight: 900; cursor: pointer; }
.complete-button { color: white; background: #efa63b; } .complete-button.done { background: var(--green); } .next-button { color: #347fac; background: var(--blue-soft); }
.toast { position: fixed; z-index: 10; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); translate: -50% 20px; padding: 12px 20px; border-radius: 999px; color: white; background: rgba(54,47,41,.92); font-weight: 900; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { translate: -50% 0; opacity: 1; }
@media (max-width: 1200px) {
  .lesson-grid, .lesson-grid.compact { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sound-badge span { display: none; } .category-grid { grid-template-columns: 1fr; gap: 14px; } .category-card { min-height: 128px; } .category-cover { width: 125px; height: 92px; }
  .lesson-grid, .lesson-grid.compact { grid-template-columns: 1fr 1fr; gap: 12px; } .lesson-tile { min-height: 180px; }
  .visual-stage { min-height: 270px; } .visual-stage img { height: 300px; }
  .related-row { display: flex; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; } .related-row button { flex: 0 0 128px; scroll-snap-align: start; }
}
@media (max-width: 480px) {
  .app { padding-inline: 11px; } .topbar { align-items: flex-start; gap: 10px; } .back-button { width: 50px; } .sound-badge { padding: 0 12px; }
  .welcome-card { align-items: flex-start; flex-direction: column; } .category-card { grid-template-columns: auto 1fr; padding: 14px; } .category-count { grid-column: 2; } .category-emoji { font-size: 50px; } .category-cover { width: 92px; height: 82px; }
  .lesson-tile { min-height: 160px; } .tile-emoji { font-size: 38px; } .tile-symbol { font-size: 52px; }
  .study-card, .writing-section, .related-section { border-radius: 24px; } .visual-stage { min-height: 235px; } .visual-stage img { height: 250px; }
  .formula { gap: 7px; padding-inline: 10px; } .formula .part { min-width: 80px; padding-inline: 9px; font-size: 42px; }
  .formula.triple { flex-wrap: wrap; } .formula.triple .part { min-width: 66px; font-size: 36px; }
  .word-line { align-items: center; flex-direction: column; gap: 3px; } .listen-button { width: calc(100% - 24px); margin-inline: 12px; }
  .four-line { height: 170px; } .four-line b { font-size: 100px; } .lesson-footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

