:root {
  color-scheme: light;
  --ink: #273550;
  --muted: #6d7890;
  --paper: #fffdf8;
  --cream: #fff8e9;
  --line: rgba(43, 54, 81, .11);
  --shadow: 0 16px 40px rgba(72, 61, 39, .11);
  --theme: #4ba777;
  --theme-soft: #e9f7ef;
  --theme-dark: #26704d;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(circle at 8% 8%, rgba(255, 214, 102, .18) 0 90px, transparent 92px), radial-gradient(circle at 91% 35%, rgba(139, 211, 203, .14) 0 120px, transparent 122px), var(--cream);
}
body[data-theme="math"] { --theme: #49a978; --theme-soft: #eaf8ef; --theme-dark: #236e4b; }
body[data-theme="physics"] { --theme: #ef8758; --theme-soft: #fff0e7; --theme-dark: #aa482b; }
body[data-theme="chemistry"] { --theme: #8d75d2; --theme-soft: #f2edff; --theme-dark: #58419a; }
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 4px solid #2b78e4; outline-offset: 4px; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -60px; padding: 10px 16px; border-radius: 12px; color: white; background: var(--ink); }
.skip-link:focus { top: 12px; }

.topbar { width: min(1160px, calc(100% - 40px)); height: 90px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { border: 0; padding: 0; display: flex; gap: 11px; align-items: center; background: transparent; cursor: pointer; text-align: left; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 18px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.brand-face { position: relative; width: 45px; height: 45px; border-radius: 15px 15px 19px 19px; background: #ffd15c; transform: rotate(-3deg); box-shadow: inset 0 -5px rgba(216, 155, 26, .13); }
.brand-face::before, .brand-face::after { content: ""; position: absolute; top: 17px; width: 5px; height: 7px; border-radius: 9px; background: #4b3a32; }
.brand-face::before { left: 12px; } .brand-face::after { right: 12px; }
.brand-face b { position: absolute; left: 17px; top: 27px; width: 12px; height: 6px; border-bottom: 3px solid #4b3a32; border-radius: 50%; }
.brand-face i:first-child { position: absolute; left: -5px; top: -5px; width: 17px; height: 18px; border-radius: 12px 4px; background: #ffb747; transform: rotate(-24deg); }
.brand-face i:nth-child(2) { position: absolute; right: -4px; top: -5px; width: 17px; height: 18px; border-radius: 4px 12px; background: #ffb747; transform: rotate(24deg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.surprise-button { min-height: 45px; padding: 0 14px; border: 2px solid rgba(255, 111, 145, .2); border-radius: 999px; display: flex; align-items: center; gap: 7px; color: #8a3852; background: rgba(255, 239, 244, .88); box-shadow: 0 8px 24px rgba(122, 55, 75, .07); cursor: pointer; font-weight: 900; }
.surprise-button span { font-size: 21px; animation: gift-wiggle 3s ease-in-out infinite; }
.surprise-button:hover { transform: translateY(-2px); background: #ffe4ed; }
@keyframes gift-wiggle { 0%, 84%, 100% { transform: rotate(0); } 88% { transform: rotate(-10deg); } 92% { transform: rotate(10deg); } 96% { transform: rotate(-5deg); } }
.star-wallet { min-width: 142px; height: 48px; padding: 0 17px; border: 2px solid rgba(231, 175, 42, .24); border-radius: 999px; display: flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .78); box-shadow: 0 8px 24px rgba(88, 66, 24, .07); }
.star-wallet > span { color: #f4b92e; font-size: 24px; filter: drop-shadow(0 2px 0 #d89313); }
.star-wallet strong { font-size: 20px; }
.star-wallet small { color: #826d43; font-weight: 700; }

main { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 56px; }
.view { animation: view-in .38s ease both; }
.view[hidden] { display: none !important; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.home-heading { text-align: center; padding: 48px 0 36px; }
.hello-pill, .eyebrow { display: inline-block; padding: 7px 13px; border-radius: 999px; color: #725823; font-size: 13px; font-weight: 800; background: #fff0b9; }
h1, h2, p { margin-top: 0; }
.home-heading h1 { margin: 15px 0 10px; font-size: clamp(34px, 5vw, 54px); line-height: 1.15; letter-spacing: -.035em; }
.home-heading p { margin-bottom: 0; color: var(--muted); font-size: 17px; }

.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.subject-card { position: relative; min-height: 390px; padding: 0; overflow: hidden; border: 0; border-radius: 34px; cursor: pointer; text-align: left; display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); transition: transform .24s ease, box-shadow .24s ease; }
.subject-card:hover { transform: translateY(-7px) rotate(-.4deg); box-shadow: 0 24px 48px rgba(72, 61, 39, .16); }
.subject-card:nth-child(2):hover { transform: translateY(-7px) rotate(.4deg); }
.subject-card::after { content: "去看看  →"; position: absolute; top: 20px; right: 22px; padding: 7px 11px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 900; background: rgba(40, 54, 66, .24); backdrop-filter: blur(5px); }
.subject-art { position: relative; height: 205px; display: block; overflow: hidden; }
.math .subject-art { background: linear-gradient(#bfeacc, #e8f6cf); }
.physics .subject-art { background: linear-gradient(#ffd3ad, #ffe6c8); }
.chemistry .subject-art { background: linear-gradient(#d9cbff, #f0ddff); }
.math-art::before { content: ""; position: absolute; left: -6%; right: -6%; bottom: -70px; height: 155px; border-radius: 50%; background: #72bd78; box-shadow: 0 -18px 0 rgba(90, 171, 96, .28); }
.math-art b { position: absolute; z-index: 2; bottom: 34px; width: 54px; height: 54px; border: 4px solid rgba(255,255,255,.66); border-radius: 17px; display: grid; place-items: center; color: white; font-size: 27px; box-shadow: 0 9px 0 rgba(29, 107, 64, .16); }
.math-art b:first-child { left: 21%; background: #f6aa50; transform: rotate(-8deg); }
.math-art b:nth-child(2) { left: 42%; bottom: 56px; background: #df6c70; transform: rotate(5deg); }
.math-art b:nth-child(3) { right: 20%; background: #5e94dc; transform: rotate(-3deg); }
.math-art i { position: absolute; left: 18%; top: 28px; width: 15px; height: 15px; border-radius: 50%; background: #fff7bd; box-shadow: 60px 12px #fff7bd, 147px -6px #fff7bd, 205px 18px #fff7bd; }
.physics-art::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -70px; height: 135px; border-radius: 50%; background: #eebc6e; }
.physics-art .hill { position: absolute; left: 15%; bottom: 55px; width: 70%; height: 58px; border: 13px solid #fff2da; border-left: 0; border-bottom: 0; border-radius: 50% 60% 0 0; transform: rotate(-8deg); }
.physics-art .car { position: absolute; z-index: 2; left: 41%; bottom: 86px; width: 77px; height: 35px; border-radius: 16px 23px 10px 10px; background: #ec654e; transform: rotate(-8deg); box-shadow: -13px -15px 0 -6px #ec654e; }
.physics-art .car::before, .physics-art .car::after { content: ""; position: absolute; bottom: -8px; width: 18px; height: 18px; border: 5px solid #f6f0df; border-radius: 50%; background: #435064; }
.physics-art .car::before { left: 9px; } .physics-art .car::after { right: 8px; }
.physics-art b { position: absolute; left: 21px; top: 31px; width: 42px; height: 18px; border-radius: 99px; background: rgba(255,255,255,.7); box-shadow: 218px 23px 0 rgba(255,255,255,.7); }
.chemistry-art i:first-child, .chemistry-art i:nth-child(2) { position: absolute; bottom: 28px; border: 7px solid rgba(255,255,255,.8); background: rgba(114, 87, 194, .26); }
.chemistry-art i:first-child { left: 23%; width: 72px; height: 94px; border-radius: 14px 14px 35px 35px; }
.chemistry-art i:nth-child(2) { right: 23%; width: 82px; height: 120px; border-radius: 12px 12px 42px 42px; }
.chemistry-art b { position: absolute; left: 24%; right: 24%; bottom: 29px; height: 53px; border-radius: 10px 10px 35px 35px; background: rgba(240, 108, 144, .7); box-shadow: 105px -2px 0 rgba(103, 199, 200, .72); }
.chemistry-art em { position: absolute; left: 31%; top: 30px; width: 15px; height: 15px; border-radius: 50%; background: rgba(255,255,255,.82); box-shadow: 67px 17px 0 -3px rgba(255,255,255,.82), 125px -3px 0 2px rgba(255,255,255,.82); }
.subject-copy { flex: 1; padding: 24px 26px 20px; display: grid; gap: 5px; }
.subject-copy small { color: var(--accent); font-weight: 900; }
.subject-copy strong { font-size: 27px; }
.subject-copy em { color: var(--muted); font-size: 14px; font-style: normal; }
.math { --accent: #33865c; } .physics { --accent: #bd5c33; } .chemistry { --accent: #6952ad; }
.subject-footer { min-height: 61px; padding: 0 26px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 800; }
.subject-footer b { color: var(--ink); font-size: 15px; }
.subject-footer i { color: #f1b42a; font-style: normal; font-size: 18px; }
.home-stars { width: fit-content; margin: 32px auto 0; padding: 12px 20px; border-radius: 999px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.7); color: var(--muted); }
.home-stars > span { color: #f4b92e; font-size: 22px; }
.home-stars p { margin: 0; }
.home-stars strong { color: var(--ink); }

.back-button { margin: 22px 0 28px; padding: 10px 16px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(50, 45, 35, .07); cursor: pointer; font-weight: 800; }
.back-button span { margin-right: 7px; color: var(--theme); }
.subject-heading, .series-heading { display: flex; align-items: center; gap: 24px; margin-bottom: 38px; }
.subject-heading-icon { width: 106px; height: 106px; flex: 0 0 auto; border-radius: 34px; display: grid; place-items: center; color: white; background: var(--theme); box-shadow: 0 12px 0 color-mix(in srgb, var(--theme-dark), transparent 74%); font-size: 25px; font-weight: 950; transform: rotate(-3deg); }
.eyebrow { color: var(--theme-dark); background: var(--theme-soft); }
.subject-heading h1, .series-heading h1 { margin: 9px 0 6px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.03em; }
.subject-heading p, .series-heading p { margin: 0; max-width: 680px; color: var(--muted); }
.series-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.series-title-row h2 { margin: 0; font-size: 23px; }
.series-title-row span { color: var(--muted); font-size: 13px; }
.series-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.series-card { position: relative; min-height: 215px; padding: 24px; border: 2px solid transparent; border-radius: 28px; display: grid; grid-template-columns: 112px 1fr; gap: 22px; text-align: left; background: white; box-shadow: var(--shadow); cursor: pointer; transition: .22s ease; }
.series-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--theme), white 35%); }
.series-cover { width: 112px; height: 112px; border-radius: 31px; display: grid; place-items: center; background: var(--theme-soft); font-size: 51px; box-shadow: inset 0 -8px rgba(74, 63, 103, .05); }
.series-copy { min-width: 0; }
.series-copy small { color: var(--theme-dark); font-weight: 900; }
.series-copy h3 { margin: 7px 0; font-size: 23px; }
.series-copy p { min-height: 42px; margin-bottom: 15px; color: var(--muted); line-height: 1.5; }
.series-meta { display: flex; gap: 13px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 800; }
.series-meta .stars { color: #a36b00; }
.mini-progress { height: 7px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--theme); }
.series-arrow { position: absolute; right: 21px; bottom: 18px; width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--theme); font-weight: 900; }

.series-heading { justify-content: space-between; }
.series-score { width: 135px; height: 135px; flex: 0 0 auto; border-radius: 39px; display: grid; place-content: center; justify-items: center; background: white; box-shadow: var(--shadow); transform: rotate(3deg); }
.series-score span { color: #f3b72d; font-size: 35px; line-height: 1; }
.series-score strong { font-size: 29px; line-height: 1.1; }
.series-score small { color: var(--muted); font-size: 11px; font-weight: 800; }
.map-card { position: relative; height: 530px; overflow: hidden; border: 10px solid white; border-radius: 38px; background: linear-gradient(#cceef1 0 58%, #bce4a9 58% 100%); box-shadow: var(--shadow); }
.map-card::before, .map-card::after { content: ""; position: absolute; left: -8%; right: 36%; bottom: -86px; height: 260px; border-radius: 50%; background: #83c984; box-shadow: 420px 48px 0 80px #72bc76; }
.map-card::after { z-index: 1; left: -10%; right: 65%; bottom: 25px; height: 135px; opacity: .9; box-shadow: 720px -75px 0 40px #79c382; }
.map-sky i { position: absolute; z-index: 1; top: 65px; left: 8%; width: 110px; height: 31px; border-radius: 99px; background: rgba(255,255,255,.7); box-shadow: 35px -19px 0 -4px rgba(255,255,255,.7), 690px 35px 0 8px rgba(255,255,255,.66); }
.map-sky i:nth-child(2) { left: 41%; top: 42px; transform: scale(.62); }
.map-sky b { position: absolute; z-index: 1; right: 9%; top: 47px; width: 58px; height: 58px; border-radius: 50%; background: #ffe684; box-shadow: 0 0 0 13px rgba(255, 235, 139, .26); }
.map-route { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-route path { fill: none; stroke: rgba(255,255,255,.92); stroke-width: 24; stroke-linecap: round; stroke-dasharray: 4 38; filter: drop-shadow(0 4px 0 rgba(61, 117, 80, .12)); }
.map-levels { position: absolute; z-index: 4; inset: 0; }
.map-node { position: absolute; left: var(--x); top: var(--y); width: 88px; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.map-node .node-circle { position: relative; width: 68px; height: 68px; border: 7px solid white; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--theme); box-shadow: 0 8px 0 color-mix(in srgb, var(--theme-dark), transparent 25%), 0 12px 22px rgba(33, 70, 57, .18); font-size: 24px; font-weight: 950; transition: .2s ease; }
.map-node:hover .node-circle { transform: translateY(-4px) scale(1.05); }
.map-node .node-label { max-width: 115px; padding: 5px 9px; border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.92); font-size: 11px; font-weight: 900; white-space: nowrap; box-shadow: 0 4px 10px rgba(34, 63, 49, .1); }
.map-node.done .node-circle { background: #f2bd31; box-shadow: 0 8px 0 #d49518, 0 12px 22px rgba(76, 63, 20, .18); }
.map-node.done .node-circle::after { content: "★"; }
.map-node.done .node-number { display: none; }
.map-node.current .node-circle { animation: current-bounce 1.6s ease-in-out infinite; }
.map-node.locked { cursor: not-allowed; filter: grayscale(.65); opacity: .7; }
.map-node.locked .node-circle { background: #96a1a5; box-shadow: 0 8px 0 #727c80; }
.map-node.locked .node-number { font-size: 0; }
.map-node.locked .node-number::after { content: "🔒"; font-size: 20px; }
@keyframes current-bounce { 50% { transform: translateY(-6px); } }
.map-node.shake { animation: shake .35s ease; }
@keyframes shake { 30% { transform: translate(-56%, -50%); } 70% { transform: translate(-44%, -50%); } }
.map-finish { position: absolute; z-index: 4; left: 90%; top: 20%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; filter: grayscale(.7); opacity: .72; }
.map-finish.unlocked { filter: none; opacity: 1; animation: current-bounce 1.7s ease-in-out infinite; }
.map-finish span { font-size: 55px; filter: drop-shadow(0 8px 0 rgba(85, 77, 34, .14)); }
.map-finish small { padding: 5px 9px; border-radius: 9px; background: rgba(255,255,255,.9); font-weight: 900; }
.series-bottom { margin-top: 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 17px; align-items: center; }
.series-bottom p { margin: 0; color: var(--muted); font-size: 13px; }
.series-bottom p span { color: #e9ac22; }
.series-progress-bar { height: 12px; overflow: hidden; border: 3px solid white; border-radius: 99px; background: #e2e8e3; box-shadow: 0 4px 12px rgba(34,64,44,.08); }
.series-progress-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--theme); transition: width .4s ease; }
.series-bottom strong { min-width: 48px; }

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(33, 39, 55, .55); backdrop-filter: blur(6px); }
.welcome-dialog { width: min(540px, calc(100% - 28px)); overflow: visible; }
.welcome-shell { position: relative; padding: 45px 48px 40px; overflow: hidden; border: 8px solid white; border-radius: 40px; text-align: center; background: radial-gradient(circle at 15% 12%, rgba(255, 215, 94, .28) 0 52px, transparent 53px), radial-gradient(circle at 90% 26%, rgba(255, 116, 153, .18) 0 72px, transparent 73px), #fffdf8; box-shadow: 0 30px 90px rgba(31, 28, 44, .32); }
.welcome-shell::before, .welcome-shell::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 8px; transform: rotate(24deg); background: #8d75d2; opacity: .18; }
.welcome-shell::before { left: 34px; top: 126px; }
.welcome-shell::after { right: 44px; bottom: 92px; background: #5bbfb0; }
.welcome-close { position: absolute; right: 14px; top: 13px; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #6c7181; background: #f0f1f3; cursor: pointer; font-size: 25px; }
.gift-box { width: 112px; height: 112px; margin: 0 auto 17px; border-radius: 35px; display: grid; place-items: center; background: linear-gradient(145deg, #ffe99a, #ffd05a); box-shadow: inset 0 -10px rgba(205, 138, 19, .12), 0 14px 0 rgba(221, 155, 28, .15); animation: gift-pop .75s cubic-bezier(.2,1.5,.4,1) both; }
.gift-box span { font-size: 65px; filter: drop-shadow(0 6px 0 rgba(137, 85, 15, .12)); }
@keyframes gift-pop { from { opacity: 0; transform: scale(.2) rotate(-18deg); } 70% { transform: scale(1.08) rotate(4deg); } }
.welcome-kicker { display: inline-block; padding: 7px 12px; border-radius: 99px; color: #8a3852; background: #ffe6ef; font-size: 12px; font-weight: 900; }
.welcome-shell h2 { margin: 14px 0 11px; font-size: clamp(28px, 6vw, 38px); letter-spacing: -.03em; }
.welcome-shell > p { margin: 0 auto 22px; max-width: 410px; color: var(--muted); line-height: 1.7; }
.explorer-badge { width: fit-content; margin: 0 auto 25px; padding: 10px 16px; border: 2px solid #f2d477; border-radius: 17px; display: flex; align-items: center; gap: 9px; color: #6f531c; background: #fff6ce; transform: rotate(-1deg); }
.explorer-badge span { font-size: 25px; }
.welcome-start { width: 100%; min-height: 56px; border: 0; border-radius: 18px; color: white; background: linear-gradient(135deg, #ff6f91, #e85881); box-shadow: 0 8px 0 #c83f67; cursor: pointer; font-size: 17px; font-weight: 950; }
.welcome-start:active { transform: translateY(4px); box-shadow: 0 4px 0 #c83f67; }
.candy-confetti { position: fixed; z-index: 9999; inset: 0; overflow: hidden; pointer-events: none; }
.candy-confetti i { position: absolute; left: var(--left); top: -24px; width: 12px; height: 18px; border-radius: 5px; background: var(--color); animation: candy-fall 1.65s var(--delay) cubic-bezier(.18,.75,.38,1) forwards; }
.candy-confetti i:nth-child(3n) { width: 14px; height: 14px; border-radius: 50%; }
.candy-confetti i:nth-child(4n) { transform: rotate(45deg); }
@keyframes candy-fall { to { opacity: .15; transform: translate(var(--drift), calc(100vh + 50px)) rotate(540deg); } }
.lesson-dialog { width: min(570px, calc(100% - 28px)); overflow: visible; }
.lesson-shell { position: relative; min-height: 570px; padding: 44px 54px 42px; border: 8px solid white; border-radius: 38px; text-align: center; background: var(--paper); box-shadow: 0 28px 80px rgba(21, 26, 40, .28); }
.dialog-close { position: absolute; z-index: 3; right: 16px; top: 13px; width: 39px; height: 39px; border: 0; border-radius: 50%; color: #687185; background: #edf0f2; font-size: 25px; cursor: pointer; }
.lesson-badge { display: inline-block; padding: 7px 13px; border-radius: 99px; color: var(--theme-dark); background: var(--theme-soft); font-size: 12px; font-weight: 900; }
.lesson-mascot { position: relative; width: 86px; height: 75px; margin: 22px auto 15px; border-radius: 35px 35px 28px 28px; background: #ffd05a; box-shadow: inset 0 -8px rgba(214, 149, 20, .12); }
.lesson-mascot::before, .lesson-mascot::after { content: ""; position: absolute; top: 28px; width: 7px; height: 9px; border-radius: 50%; background: #473b38; }
.lesson-mascot::before { left: 25px; } .lesson-mascot::after { right: 25px; }
.lesson-mascot b { position: absolute; left: 34px; top: 45px; width: 18px; height: 8px; border-bottom: 3px solid #473b38; border-radius: 50%; }
.lesson-mascot i:first-child { position: absolute; left: -10px; top: -6px; width: 32px; height: 31px; border-radius: 19px 5px; background: #ffb84c; transform: rotate(-25deg); }
.lesson-mascot i:nth-child(2) { position: absolute; right: -10px; top: -6px; width: 32px; height: 31px; border-radius: 5px 19px; background: #ffb84c; transform: rotate(25deg); }
.lesson-step h2, .success-step h2 { margin: 0 0 11px; font-size: 30px; }
.lesson-question { margin-bottom: 10px; color: var(--theme-dark); font-size: 19px; font-weight: 900; }
.lesson-summary { margin: 0 auto 17px; max-width: 410px; color: var(--muted); line-height: 1.55; }
.goal-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-bottom: 19px; }
.goal-chips span { padding: 6px 10px; border-radius: 10px; color: #606b7a; background: #f0f3f1; font-size: 12px; font-weight: 800; }
.lesson-materials { display: grid; gap: 8px; margin-bottom: 19px; }
.material-button { width: 100%; padding: 11px 14px; border: 2px solid color-mix(in srgb, var(--theme), white 65%); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; text-align: left; background: var(--theme-soft); cursor: pointer; }
.material-button strong { display: block; color: var(--theme-dark); font-size: 13px; }
.material-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.material-button > span:last-child { color: var(--theme); font-weight: 900; }
.complete-button, .continue-button { width: 100%; min-height: 54px; border: 0; border-radius: 17px; color: white; background: var(--theme); box-shadow: 0 7px 0 var(--theme-dark); cursor: pointer; font-size: 16px; font-weight: 950; }
.complete-button:active, .continue-button:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--theme-dark); }
.complete-button.completed { color: var(--theme-dark); background: var(--theme-soft); box-shadow: 0 5px 0 color-mix(in srgb, var(--theme), white 55%); }
.success-step { padding-top: 45px; }
.success-step > span { color: var(--theme-dark); font-weight: 900; }
.success-step p { margin: 14px 0 32px; color: var(--muted); }
.success-step strong { color: var(--ink); }
.big-star { margin: 0 auto 27px; color: #f5bd30; font-size: 125px; line-height: 1; filter: drop-shadow(0 13px 0 #dc961c); animation: star-pop .65s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes star-pop { from { opacity: 0; transform: scale(.15) rotate(-50deg); } }

.material-dialog { width: min(1120px, calc(100% - 30px)); height: min(850px, calc(100% - 30px)); }
.material-shell { height: 100%; padding: 0; overflow: hidden; border: 8px solid white; border-radius: 28px; display: grid; grid-template-rows: auto 1fr auto; background: white; box-shadow: 0 28px 80px rgba(21,26,40,.3); }
.material-shell header, .material-shell footer { padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.material-shell header span { color: var(--theme-dark); font-size: 11px; font-weight: 900; }
.material-shell header h2 { margin: 2px 0 0; font-size: 20px; }
.material-shell header button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #eef0f2; font-size: 24px; cursor: pointer; }
.material-frame-wrap { min-height: 0; background: #e8edf1; }
.material-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: white; }
.material-shell footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.material-shell footer p { max-width: 70%; margin: 0; }
.material-shell footer div { display: flex; gap: 8px; }
.material-shell footer a { padding: 8px 10px; border-radius: 10px; color: var(--theme-dark); background: var(--theme-soft); text-decoration: none; font-weight: 900; }

@media (max-width: 850px) {
  .subject-grid { grid-template-columns: 1fr; }
  .subject-card { min-height: 220px; display: grid; grid-template-columns: 42% 1fr; grid-template-rows: 1fr auto; }
  .subject-art { height: 100%; grid-row: 1 / 3; }
  .subject-card::after { display: none; }
  .series-list { grid-template-columns: 1fr; }
  .map-card { height: 460px; }
  .series-bottom { grid-template-columns: 1fr auto; }
  .series-bottom p { grid-column: 1 / 3; }
}
@media (max-width: 560px) {
  .topbar, main { width: min(100% - 24px, 1160px); }
  .topbar { height: 76px; }
  .brand small, .star-wallet small, .surprise-button small { display: none; }
  .topbar-actions { gap: 7px; }
  .surprise-button { min-width: 44px; height: 44px; padding: 0; justify-content: center; }
  .star-wallet { min-width: auto; height: 44px; padding: 0 13px; }
  .home-heading { padding: 32px 0 25px; }
  .home-heading h1 { font-size: 35px; }
  .subject-card { min-height: 310px; display: flex; }
  .subject-art { width: 100%; height: 150px; flex: 0 0 auto; }
  .subject-copy { padding: 18px 20px 14px; }
  .subject-copy strong { font-size: 23px; }
  .subject-footer { padding: 0 20px; min-height: 53px; }
  .subject-heading { align-items: flex-start; gap: 15px; }
  .subject-heading-icon { width: 70px; height: 70px; border-radius: 23px; font-size: 19px; }
  .subject-heading h1, .series-heading h1 { font-size: 30px; }
  .series-title-row span { display: none; }
  .series-card { grid-template-columns: 76px 1fr; gap: 14px; padding: 18px; }
  .series-cover { width: 76px; height: 76px; border-radius: 23px; font-size: 38px; }
  .series-copy h3 { font-size: 19px; }
  .series-copy p { min-height: 0; }
  .series-heading { align-items: flex-end; gap: 12px; }
  .series-score { width: 90px; height: 90px; border-radius: 28px; }
  .series-score span { font-size: 23px; }
  .series-score strong { font-size: 22px; }
  .map-card { height: 490px; border-width: 6px; border-radius: 28px; }
  .map-node { width: 75px; }
  .map-node .node-circle { width: 57px; height: 57px; border-width: 5px; font-size: 20px; }
  .map-node .node-label { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
  .map-finish span { font-size: 43px; }
  .lesson-shell { min-height: 0; padding: 38px 20px 26px; border-width: 5px; border-radius: 30px; }
  .welcome-shell { padding: 40px 22px 28px; border-width: 5px; border-radius: 30px; }
  .gift-box { width: 92px; height: 92px; border-radius: 29px; }
  .gift-box span { font-size: 54px; }
  .lesson-mascot { margin-top: 16px; }
  .material-shell footer p { display: none; }
  .material-shell footer { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
