:root{color-scheme:light;font-family:Inter,PingFang SC,Microsoft YaHei,Noto Sans SC,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:#1d2d35;background:#e9e5da;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;--surface: #f7f4eb;--surface-strong: #fffdf6;--ink: #1d2d35;--muted: #657178;--line: #ded8ca;--teal: #0f8b8d;--teal-dark: #0a6364;--gold: #f4d35e;--coral: #ee6c4d;--blue: #3d5a80;--green: #4d9f6f;--danger: #b14d43;--shadow: 0 18px 50px rgba(36, 42, 46, .14);--radius-sm: 8px;--radius-md: 14px;--radius-lg: 22px;--header-height: 74px;--nav-height: 94px}*{box-sizing:border-box}html,body,#root{min-height:100%;margin:0}body{overflow-x:hidden}button,a{font:inherit}button{color:inherit}a{color:inherit;text-decoration:none}.app-screen{min-height:100svh;background:linear-gradient(90deg,rgba(15,139,141,.08) 1px,transparent 1px),linear-gradient(0deg,rgba(61,90,128,.08) 1px,transparent 1px),#e9e5da;background-size:38px 38px}html{scrollbar-gutter:stable}.app-frame{width:min(100%,500px);min-height:100svh;margin:0 auto;background:var(--surface);box-shadow:var(--shadow);position:relative}.app-header{min-height:var(--header-height);padding:calc(12px + env(safe-area-inset-top)) 18px 10px;display:flex;align-items:flex-end;justify-content:space-between;gap:14px;border-bottom:1px solid rgba(29,45,53,.08);background:#f7f4ebeb;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);position:sticky;top:0;z-index:20}.brand-row{display:flex;align-items:center;gap:8px;font-weight:850;font-size:17px}.app-header p{margin:4px 0 0;color:var(--muted);font-size:13px}.header-stats{display:flex;flex-direction:column;align-items:flex-end;gap:6px;font-size:13px;color:var(--ink)}.header-stats span{display:inline-flex;align-items:center;gap:5px;min-height:24px}.app-main{min-height:calc(100svh - var(--header-height) - var(--nav-height));padding:14px 16px calc(var(--nav-height) + 34px + env(safe-area-inset-bottom))}.bottom-nav{position:fixed;left:50vw;bottom:calc(10px + env(safe-area-inset-bottom));transform:translate(-50%);width:min(calc(100vw - 24px),468px);min-height:82px;padding:8px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;background:linear-gradient(180deg,#fffdf6f5,#f7f4ebe6),#fffdf6eb;border:1px solid rgba(255,255,255,.72);border-radius:999px;box-shadow:0 16px 36px #242a2e29,inset 0 1px #ffffffc7;-webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);z-index:30}.bottom-nav__item{min-height:66px;display:flex;flex-direction:column;align-items:center;place-items:center;justify-content:center;gap:5px;color:var(--muted);border-radius:28px;font-size:14px;font-weight:750;line-height:1;transition:color .16s ease,background .16s ease,box-shadow .16s ease,transform .16s ease}.bottom-nav__item svg{stroke-width:2.35}.bottom-nav__item.active{color:var(--teal-dark);background:radial-gradient(circle at 30% 16%,rgba(255,255,255,.78),transparent 38%),linear-gradient(180deg,#d5efe7f5,#e1f4eedb);box-shadow:0 10px 24px #0f8b8d24,inset 0 1px #ffffffdb}.bottom-nav__item.active svg{stroke-width:2.75}.page{display:grid;gap:18px}.page--compact{gap:14px}.page-heading p{margin:0 0 5px;color:var(--teal-dark);font-weight:800;font-size:13px}.page-heading h1{margin:0;font-size:28px;line-height:1.12;letter-spacing:0}.home-hero{min-height:266px;position:relative;overflow:hidden;border-radius:var(--radius-lg);background:#dcd7cb;isolation:isolate}.home-hero img{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover;z-index:-1}.home-hero:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(90deg,#f7f4ebf0,#f7f4eb7a,#f7f4eb33);z-index:-1}.home-hero__content{width:min(72%,310px);min-height:266px;padding:24px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:10px}.home-hero__content p,.lesson-kicker{margin:0;font-size:13px;color:var(--teal-dark);font-weight:850}.home-hero__content h1,.lesson-stage h1{margin:0;font-size:34px;line-height:1.06;letter-spacing:0}.home-hero__content span{color:#415057;line-height:1.45}.status-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;overflow:hidden;border-radius:var(--radius-md);border:1px solid var(--line);background:var(--line)}.status-strip div{min-height:74px;display:grid;place-items:center;align-content:center;gap:4px;background:var(--surface-strong)}.status-strip strong{font-size:22px}.status-strip span{font-size:12px;color:var(--muted)}.action-list,.chapter-list,.lesson-stage,.mistake-list,.badge-grid,.settings-section,.retry-panel,.reference-list,.reference-problem-list{display:grid;gap:12px}.action-row,.lesson-node,.mistake-row,.settings-section{min-height:68px;width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-strong);text-align:left}.action-row span,.lesson-node span,.mistake-row span,.settings-section span{min-width:0;display:grid;gap:4px}.action-row strong,.lesson-node strong,.mistake-row strong,.settings-section strong{font-size:16px}.action-row small,.lesson-node small,.mistake-row small,.settings-section small{color:var(--muted);line-height:1.35}.chapter-band{padding:15px;border-radius:var(--radius-lg);background:var(--surface-strong);border-left:5px solid var(--teal)}.chapter-band--gold{border-left-color:var(--gold)}.chapter-band--coral{border-left-color:var(--coral)}.chapter-band--blue{border-left-color:var(--blue)}.chapter-band__heading{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}.chapter-band__heading h2{margin:0 0 4px;font-size:19px}.chapter-band__heading p{margin:0;color:var(--muted);line-height:1.4}.chapter-band__heading>span,.lesson-node em,.mistake-row em{color:var(--muted);font-style:normal;font-size:12px;white-space:nowrap}.lesson-node-list{display:grid;gap:8px}.lesson-node{min-height:76px;padding:12px}.lesson-node__status{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#0f8b8d1a;color:var(--teal-dark)}.lesson-node.is-done .lesson-node__status{color:var(--green);background:#4d9f6f1f;box-shadow:0 0 0 6px #4d9f6f0f;animation:done-node-glow 1.8s ease-in-out both}.lesson-topbar,.lesson-progress,.operation-row,.target-row,.trace-controls{display:flex;align-items:center;justify-content:space-between;gap:10px}.lesson-topbar>span,.lesson-progress span,.target-row,.trace-count{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:13px}.lesson-stage{min-height:calc(100svh - 190px);align-content:start}.lesson-stage>p{margin:0;color:var(--muted);line-height:1.45}.lesson-copy,.summary-box{padding:18px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-strong);line-height:1.65}.summary-box{display:flex;gap:14px;align-items:flex-start}.summary-box p{margin:0}.lesson-visual{min-height:156px;padding:18px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;border-radius:var(--radius-lg);background:linear-gradient(135deg,#f4d35e47,#0f8b8d1f),var(--surface-strong);border:1px solid var(--line)}.lesson-visual span{min-width:72px;min-height:50px;display:grid;place-items:center;border-radius:var(--radius-sm);background:#fffaf0;box-shadow:0 7px 18px #1d2d351a;font-weight:850;animation:rise-in .42s ease both;animation-delay:var(--delay)}.primary-action,.secondary-action,.icon-button,.option-button,.small-icon,.toggle-action{border:0;cursor:pointer}.primary-action,.secondary-action{min-height:48px;border-radius:var(--radius-md);display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 18px;font-weight:850}.primary-action{color:#fffdf6;background:var(--teal)}.primary-action--light{color:var(--ink);background:var(--gold)}.primary-action:disabled{cursor:not-allowed;opacity:.55}.secondary-action{background:transparent;color:var(--teal-dark);border:1px solid rgba(15,139,141,.28)}.secondary-action.danger{color:var(--danger);border-color:#b14d4347}.icon-button{min-height:44px;border-radius:var(--radius-sm);display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;background:#0f8b8d14;color:var(--teal-dark)}.icon-button:disabled,.small-icon:disabled{opacity:.45;cursor:not-allowed}.problem-surface,.retry-panel,.settings-section,.empty-state{padding:16px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-strong)}.problem-heading{display:grid;gap:5px;margin-bottom:14px}.problem-heading span{width:fit-content;padding:4px 8px;border-radius:999px;background:#ee6c4d1f;color:var(--coral);font-weight:800;font-size:12px}.problem-heading h2,.retry-panel h2,.empty-state h2,.badge-tile h2{margin:0;font-size:20px;line-height:1.18}.problem-heading p,.empty-state p,.badge-tile p{margin:0;color:var(--muted);line-height:1.45}.option-list,.chip-row{display:grid;gap:9px}.option-button{min-height:48px;padding:12px 13px;border-radius:var(--radius-md);background:#f2eee2;border:1px solid var(--line);text-align:left;display:flex;align-items:center;gap:8px}.option-button--selected{border-color:var(--teal);background:#0f8b8d1a}.feedback{position:relative;overflow:hidden;padding:14px;border-radius:var(--radius-md);display:grid;gap:4px;margin-top:12px}.feedback p{margin:0;line-height:1.45}.feedback--correct{background:#4d9f6f24;color:#2d6f4b;box-shadow:inset 0 0 0 1px #4d9f6f14}.feedback--wrong{background:#ee6c4d1f;color:#904330}.feedback-sparks{position:absolute;top:10px;right:14px;width:46px;height:26px;pointer-events:none}.feedback-sparks span{position:absolute;width:7px;height:7px;border-radius:50%;background:var(--gold);opacity:0;animation:feedback-spark .92s ease-out both}.feedback-sparks span:nth-child(1){left:2px;top:12px}.feedback-sparks span:nth-child(2){left:20px;top:2px;background:var(--teal);animation-delay:80ms}.feedback-sparks span:nth-child(3){right:0;top:14px;background:var(--coral);animation-delay:.14s}.drop-bucket{min-height:82px;padding:12px;border-radius:var(--radius-md);border:1px dashed rgba(29,45,53,.2);background:#f2eee2;display:grid;gap:10px}.drop-bucket.is-over{border-color:var(--teal);background:#0f8b8d14}.bucket-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}.bucket-items,.chip-row{display:flex;flex-wrap:wrap;gap:8px}.number-chip{min-width:46px;min-height:44px;border:0;border-radius:var(--radius-sm);background:var(--gold);color:var(--ink);font-weight:850;cursor:grab;touch-action:none}.number-chip.is-dragging{opacity:.75;box-shadow:0 10px 20px #1d2d3538}.number-grid{display:grid;grid-template-columns:repeat(var(--grid-columns),minmax(0,1fr));gap:7px}.grid-number{min-height:44px;border-radius:var(--radius-sm);border:1px solid var(--line);background:#f2eee2;font-weight:800}.grid-number.is-selected{background:var(--teal);border-color:var(--teal);color:#fffdf6}.sequence-preview{min-height:66px;padding:12px;border-radius:var(--radius-md);background:#f2eee2;display:grid;gap:4px;margin-bottom:10px}.sequence-preview span{color:var(--muted)}.code-puzzle{display:grid;gap:8px}.code-block{min-height:50px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border-radius:var(--radius-sm);background:#1d2d35;color:#fffdf6}.code-block code,.trace-line code,.debug-line code{font-family:Cascadia Code,SFMono-Regular,Consolas,monospace;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}.small-icon{width:34px;height:34px;display:inline-grid;place-items:center;border-radius:var(--radius-sm);background:#fffdf621;color:#fffdf6}.debug-code,.figure-board{overflow:hidden;border-radius:var(--radius-md);background:#1d2d35;color:#fffdf6}.debug-line{display:grid;grid-template-columns:34px minmax(0,1fr);gap:8px;padding:8px 10px;border-bottom:1px solid rgba(255,253,246,.08)}.debug-line span{color:#fffdf67a}.debug-options{display:grid;gap:9px;margin-top:10px}.debug-option{min-height:64px;display:grid;gap:4px;padding:12px;border-radius:var(--radius-md);border:1px solid var(--line);background:#f2eee2;text-align:left}.debug-option span{color:var(--muted);line-height:1.35}.debug-option.is-selected{border-color:var(--teal);background:#0f8b8d1a}.figure-board{display:grid;gap:8px;padding:14px;margin-bottom:10px}.figure-board strong{color:var(--gold)}.figure-board pre{margin:0;overflow-x:auto;font-family:Cascadia Code,SFMono-Regular,Consolas,monospace;font-size:17px;line-height:1.35;letter-spacing:0}.train-track{min-height:94px;display:flex;align-items:center;gap:8px;overflow-x:auto;padding:12px;border-radius:var(--radius-md);background:#e3ded1}.train-car{min-width:58px;min-height:54px;border:0;border-radius:var(--radius-sm);background:var(--coral);color:#fffdf6;font-size:20px;font-weight:900}.train-car.is-selected{outline:4px solid var(--gold)}.structure-view{min-height:86px;display:flex;align-items:center;gap:8px;padding:14px;border-radius:var(--radius-md);background:#f2eee2}.structure-view--stack{min-height:140px;flex-direction:column-reverse;align-items:center;justify-content:flex-start}.structure-view span:not(.muted){min-width:48px;min-height:38px;display:grid;place-items:center;border-radius:var(--radius-sm);background:var(--blue);color:#fffdf6;font-weight:850}.trace-player{display:grid;gap:12px}.trace-code{overflow:hidden;border-radius:var(--radius-md);background:#1d2d35;color:#f8f3e6}.trace-line{display:grid;grid-template-columns:34px minmax(0,1fr);gap:8px;padding:8px 10px;border-left:4px solid transparent}.trace-line span{color:#fffdf66b}.trace-line--active{background:#f4d35e24;border-left-color:var(--gold)}.trace-panels{display:grid;gap:8px}.trace-panel{display:grid;gap:8px;padding:12px;border-radius:var(--radius-md);background:#f2eee2}.trace-output span{min-height:34px;display:inline-grid;place-items:center start;font-family:Cascadia Code,Consolas,monospace;font-weight:850}.var-grid{display:flex;flex-wrap:wrap;gap:7px}.var-pill{padding:7px 9px;border-radius:var(--radius-sm);background:var(--gold);font-family:Cascadia Code,Consolas,monospace;font-weight:800}.trace-explain{padding:12px;border-radius:var(--radius-md);background:#0f8b8d14;line-height:1.5}.trace-explain p{margin:7px 0 0}.condition-badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-weight:850;font-size:12px}.condition-badge.is-true{color:#2d6f4b;background:#4d9f6f24}.condition-badge.is-false{color:#904330;background:#ee6c4d1f}.muted{color:var(--muted)}.reward-stage{position:relative;overflow:hidden;text-align:center;justify-items:stretch}.reward-stage>*:not(.reward-confetti){position:relative;z-index:1}.reward-confetti{position:absolute;top:72px;left:50%;z-index:2;width:1px;height:1px;pointer-events:none}.reward-confetti span{position:absolute;width:7px;height:13px;border-radius:2px;background:var(--confetti-color);opacity:0;animation:confetti-burst 1.6s cubic-bezier(.16,1,.3,1) both;animation-delay:var(--confetti-delay)}.reward-confetti span:nth-child(3n){width:10px;height:6px}.reward-medal{width:92px;height:92px;display:grid;place-items:center;justify-self:center;border-radius:50%;background:var(--gold);color:var(--ink);box-shadow:0 14px 26px #f4d35e47;animation:trophy-rise 1.5s cubic-bezier(.2,.8,.2,1) both}.badge-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.badge-tile{min-height:168px;padding:15px;display:grid;align-content:start;gap:8px;border:1px solid var(--line);border-radius:var(--radius-md);background:#f2eee2;opacity:.68}.badge-tile.is-unlocked{background:var(--surface-strong);opacity:1;border-color:#0f8b8d3d;box-shadow:inset 0 0 0 1px #0f8b8d0d}.badge-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:var(--gold);font-weight:900}.badge-tile.is-unlocked .badge-icon{box-shadow:0 0 0 6px #f4d35e2e;animation:badge-unlock-pop .98s ease both}.mistake-row{border:1px solid var(--line);cursor:pointer}.mistake-row.is-mastered{opacity:.64}.empty-state{min-height:280px;display:grid;justify-items:center;align-content:center;gap:10px;text-align:center}.settings-section{grid-template-columns:minmax(0,1fr)}.reference-source{padding:15px;border-radius:var(--radius-lg);background:var(--surface-strong);border:1px solid var(--line);display:grid;gap:12px}.reference-source>p{margin:0;color:var(--muted);line-height:1.45}.reference-source__heading{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px}.reference-source__heading span{min-width:0;display:grid;gap:3px}.reference-source__heading small,.reference-problem__meta,.reference-note{color:var(--muted)}.reference-source__heading em{font-style:normal;font-size:12px;color:var(--teal-dark);white-space:nowrap}.reference-problem{padding:14px;border-radius:var(--radius-md);background:#f2eee2;display:grid;gap:9px}.reference-problem__meta{display:flex;justify-content:space-between;gap:10px;font-size:12px}.reference-problem__meta span{color:var(--teal-dark);font-weight:850}.reference-problem__meta em{font-style:normal}.reference-problem h2{margin:0;font-size:18px;line-height:1.2}.reference-problem p{margin:0;line-height:1.6}.reference-input{padding:9px 10px;border-radius:var(--radius-sm);background:#0f8b8d14;font-weight:800}.reference-code{margin:0;padding:12px;overflow-x:auto;border-radius:var(--radius-sm);background:#1d2d35;color:#fffdf6}.reference-code code{font-family:Cascadia Code,SFMono-Regular,Consolas,monospace;font-size:13px;line-height:1.45;white-space:pre}.reference-note{line-height:1.45}.reference-answer{padding:10px 12px;border-radius:var(--radius-sm);background:var(--surface-strong)}.reference-answer summary{cursor:pointer;color:var(--teal-dark);font-weight:850}.reference-answer strong{display:block;margin-top:8px}.settings-section>div{display:flex;align-items:center;gap:12px}.toggle-action{min-height:44px;padding:0 14px;border-radius:var(--radius-sm);border:1px solid rgba(15,139,141,.24);background:#0f8b8d14;color:var(--teal-dark);font-weight:850}.toggle-action.is-on{background:var(--teal);color:#fffdf6;border-color:var(--teal)}@keyframes rise-in{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes medal-pop{0%{transform:scale(.76);opacity:0}to{transform:scale(1);opacity:1}}@keyframes trophy-rise{0%{transform:translateY(18px) scale(.84);opacity:0}58%{transform:translateY(-8px) scale(1.05);opacity:1}to{transform:translateY(0) scale(1);opacity:1}}@keyframes confetti-burst{0%{transform:translate(-50%,20px) rotate(0) scale(.6);opacity:0}16%{opacity:1}to{transform:translate(calc(var(--confetti-x) - 50%),-54px) rotate(var(--confetti-rotate)) scale(1);opacity:0}}@keyframes feedback-spark{0%{transform:translateY(8px) scale(.5);opacity:0}28%{opacity:1}to{transform:translateY(-8px) scale(1);opacity:0}}@keyframes badge-unlock-pop{0%{transform:scale(.88)}45%{transform:scale(1.08)}to{transform:scale(1)}}@keyframes done-node-glow{0%{box-shadow:0 0 #4d9f6f1a}60%{box-shadow:0 0 0 7px #4d9f6f14}to{box-shadow:0 0 0 6px #4d9f6f0f}}@media(prefers-reduced-motion:reduce){.reward-medal,.reward-confetti span,.feedback-sparks span,.badge-tile.is-unlocked .badge-icon,.lesson-node.is-done .lesson-node__status{animation:none}}@media(max-width:380px){.app-main{padding-inline:12px}.home-hero__content{width:78%;padding:18px}.home-hero__content h1,.lesson-stage h1{font-size:30px}.bucket-grid,.badge-grid{grid-template-columns:1fr}.status-strip strong{font-size:19px}.brand-row{font-size:15px}.bottom-nav__item{min-height:62px;font-size:13px}}@media(min-width:760px){.app-frame{min-height:calc(100svh - 28px);margin-block:14px;border-radius:28px;overflow:hidden}.bottom-nav{bottom:26px}}
