/* Reserve feedback height before the first reward so writing surfaces never resize on completion. */
/* Same typography policy as css/style.css and css/tools.css; font subsets are served locally. */
@font-face{font-family:"KaiTi-CJK";src:local("STKaiti-SC-Regular"),local("STKaiti"),local("Kaiti SC"),local("BiauKai"),local("KaiTi"),local("楷体"),local("楷体_GB2312");unicode-range:U+2E80-2EFF,U+2F00-2FDF,U+3000-303F,U+3040-30FF,U+31F0-31FF,U+3200-32FF,U+3400-4DBF,U+4E00-9FFF,U+F900-FAFF,U+FE30-FE4F,U+FF00-FFEF,U+20000-2A6DF}
:root{--font-ui:"KaiTi-CJK","LXGW WenKai Lite",serif;--jade:#57896e;--dark:#345d49;--ink:#486552;--muted:#859783;--paper:#fffef9;--line:#dce7d8;font-family:var(--font-ui);color:var(--ink);font-synthesis:weight}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{height:100dvh;display:flex;flex-direction:column;isolation:isolate;background:radial-gradient(ellipse at 85% 8%,#fbefcf99,transparent 48%),linear-gradient(150deg,#e5f0e8,#f5f7ed 65%,#e8efdc);-webkit-font-smoothing:antialiased}body:before,body:after{content:"";position:fixed;z-index:-1;pointer-events:none;width:75vw;height:38vh;border-radius:50%;background:#bdcfaa38;bottom:-24vh;left:-15vw;transform:rotate(8deg)}body:after{left:auto;right:-18vw;bottom:-22vh;transform:rotate(-12deg);background:#a9c7ab26}
button,a{-webkit-tap-highlight-color:transparent}button{font:400 17px/1.3 var(--font-ui);cursor:pointer;color:var(--dark);background:#fffef9;border:1px solid var(--line);border-radius:15px;min-height:46px;padding:9px 19px;transition:background .18s,transform .18s,box-shadow .18s}button:hover{background:#f2f7eb}button:active{transform:translateY(2px)}button:focus-visible,a:focus-visible{outline:3px solid #d4a443;outline-offset:4px}[hidden]{display:none!important}
header{flex:none;width:min(1280px,100%);margin:auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;padding:20px 32px 18px}#back{justify-self:start;display:inline-flex;align-items:center;min-height:44px;padding:8px 15px;color:var(--dark);text-decoration:none;font-size:17px;border:1px solid #d4dfcc;border-radius:14px;background:#fffff680;transition:background .18s}#back:hover{background:#fffef8}h1{margin:0;display:flex;gap:11px;align-items:center;justify-content:center;font:400 34px/1.2 var(--font-ui);letter-spacing:2px;color:#345d49;white-space:nowrap}.brand-mark{flex:none;width:36px;height:40px}.header-actions{justify-self:end;display:flex;align-items:center;gap:5px}.header-actions button{font-size:15px;min-height:42px;padding:7px 11px;background:#fffff680;border-color:#d4dfcc;border-radius:13px}#help{font-size:22px;width:42px;padding:0}
main{flex:1;min-height:0;width:100%;display:flex;justify-content:center;padding:0 32px 24px}.workshop{position:relative;flex:1;min-height:0;max-width:1216px;display:flex;flex-direction:column;gap:13px;padding:22px 24px 20px;border:2px solid #ffffffd9;background:#fafff6b8;border-radius:32px;box-shadow:0 16px 48px #4e705b0a,0 2px 0 #a9bfa42b}.boards{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;gap:22px}.practice{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;gap:0;padding:0 12px 10px;background:#fffef9;border:1px solid #e1e9d9;border-radius:23px;box-shadow:0 4px 0 #dce6d43b;overflow:hidden}.practice h2{position:relative;flex:none;width:calc(100% + 24px);display:flex;align-items:center;gap:12px;margin:0;padding:11px 19px;background:#edf4e5;color:#60825e;font:400 17px/1.3 var(--font-ui)}#chinese-panel h2{background:#faf1e1;color:#ab8655}.practice h2 strong{display:grid;place-items:center;min-width:31px;height:31px;margin-left:auto;background:#ffffffa8;border-radius:10px;font:400 24px/1 var(--font-ui)}.complete{position:absolute;right:64px;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;color:#fff;background:#76a371;font:400 18px/1 var(--font-ui)}
.paper-slot{position:relative;flex:1;min-height:0;width:100%;display:flex;align-items:center;justify-content:center}.paper-slot svg{width:var(--board-size,100%);height:var(--board-size,100%);max-width:100%;max-height:100%;display:block;touch-action:none;user-select:none;cursor:crosshair}.practice[data-phase=demo]{border-color:#dcca9b}.practice[data-phase=review]{border-color:#9cbd8a}.practice[data-phase=review] h2{background:#e2efdc;color:#4c784e}.cross{stroke:#adbd98;stroke-width:1;stroke-dasharray:4 9;opacity:.3}.guides path{fill:none;stroke:#b9cdb9;stroke-width:52;stroke-linecap:round;stroke-linejoin:round}.guides .guide-fill{stroke:#f5f9ef;stroke-width:47}.guides .centerline{stroke:#b79a61;stroke-width:2;stroke-dasharray:3 8}.guides .glyph-outline{fill:#f5f9ef;stroke:#a8bea6;stroke-width:3;stroke-linejoin:round}.direction-arrow{fill:none;stroke:#ad8848;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.stroke-start circle{fill:#fffef4;stroke:#b87351;stroke-width:1.5}.stroke-start text{font:700 16px var(--font-ui);fill:#a35e40}.stroke-start[data-current=true] circle{fill:#b87351}.stroke-start[data-current=true] text{fill:#fff}.start-leader{stroke:#b29666;stroke-width:1;stroke-dasharray:2 4}.ink path,.demo-ink path{fill:none;stroke:var(--jade);stroke-width:19;stroke-linecap:round;stroke-linejoin:round}.demo-ink path{stroke:#d8aa53}.target,.demo-dot,.milestones,.starts{pointer-events:none}.target,.demo-dot{filter:drop-shadow(0 2px 3px #b48d3626)}.star{animation:twinkle 1.5s ease-in-out infinite;transform-box:fill-box;transform-origin:center}.ink{transition:opacity .3s}.practice[data-phase=erase] .ink{opacity:0}.practice[data-phase=review]{border-color:#a4bd91;background:linear-gradient(135deg,#fffff8,#f3f7e9)}.practice[data-phase=review] .guides{opacity:.3}.practice[data-phase=review] .milestones,.practice[data-phase=review] .starts{opacity:.25}.practice[data-phase=demo] .ink{opacity:.35}
.clear{display:flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:38px;padding:5px 14px;border:0;border-radius:11px;color:#81957c;background:#f0f5e9;font:400 15px/1.3 var(--font-ui)}.clear:hover{color:var(--dark);background:#e8f1df}.clear:before{content:"";width:17px;height:17px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 4 6 6a2 2 0 0 1 0 3l-7 7H7l-4-4a2 2 0 0 1 0-3l8-9a2 2 0 0 1 3 0ZM8 9l9 8M13 20h8'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
.quantity{flex:none;align-self:center;max-width:100%;display:flex;align-items:center;justify-content:center;gap:16px;min-height:60px;padding:6px 22px;border:1px solid #e0e8d5;border-radius:18px;background:#f2f6e9}.count-label{color:#8a9d7e;font-size:16px;white-space:nowrap;padding-right:16px;border-right:1px solid #d9e3ce}#quantity-caption{margin:0;white-space:nowrap;font:400 18px/1.4 var(--font-ui);color:#9f7e50}#objects{display:flex;justify-content:center;align-items:flex-start;gap:9px}.count-object{text-align:center;flex:none;width:32px}.count-object svg{display:block;width:32px;height:32px;filter:drop-shadow(0 2px 1px #a9623015)}.count-object span{display:block;font:400 12px/1.1 var(--font-ui);color:#9aab87;margin-top:2px}#zero-message{margin:0;font-size:15px;color:#859776}.empty-basket{width:44px;height:40px}
.feedback{position:relative;flex:none;display:grid;grid-template-rows:minmax(0,1fr);height:36px;align-items:center;padding:0 120px}.feedback>#message,.feedback>#celebration{grid-area:1/1}.companion{position:absolute;left:2px;bottom:-64px;width:132px;height:198px;object-fit:contain;pointer-events:none;user-select:none}#message{margin:0;text-align:center;font:400 16px/1.5 var(--font-ui);color:#83987b}#celebration{display:flex;align-items:center;justify-content:center;gap:10px;font:400 18px/1.4 var(--font-ui);color:#9c7a47}#celebration[hidden]{display:flex!important;visibility:hidden}.feedback:has(#celebration:not([hidden])) #message{visibility:hidden}#result-stars{line-height:1;color:#d3a942;letter-spacing:3px;font-size:27px}.actions{flex:none;display:flex;gap:14px;justify-content:center}.actions button{min-width:176px;min-height:50px;font:400 18px/1.3 var(--font-ui);border-radius:16px}#next{display:flex;gap:18px;align-items:center;justify-content:center;background:#638f6c;color:#fffef1;border:1px solid #5b8561;box-shadow:0 4px 0 #426b4840}#next:after{content:'→';font-size:22px}#next:hover{background:#537f5d}#next:active{box-shadow:0 1px 0 #426b4840}#demo{display:flex;gap:9px;align-items:center;justify-content:center;background:#fffaf0;border:1px solid #e6d9bc;color:#a68c5b;box-shadow:0 3px 0 #dfd5b92e}#demo:before{content:'';width:13px;height:15px;border:1.5px solid currentColor;clip-path:polygon(0 0,100% 50%,0 100%);background:currentColor;opacity:.65}
.svg-defs,.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}#fireworks{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:40}dialog{margin:auto;width:min(90vw,460px);max-height:90dvh;overflow:auto;border:2px solid #fff;border-radius:25px;padding:30px;background:#fafcf3;color:var(--ink);font:400 18px/1.8 var(--font-ui);box-shadow:0 20px 80px #254c4138}dialog h2{margin:0;font:400 29px/1.4 var(--font-ui);color:var(--dark)}dialog button{width:100%;margin-top:8px;background:#eaf1de}dialog::backdrop{background:#31523e42;backdrop-filter:blur(5px)}html[lang=en] h1{font-size:28px;letter-spacing:0}.boards.single-board{grid-template-columns:minmax(0,1fr);width:72%;align-self:center}
@keyframes twinkle{50%{transform:scale(1.1)}}
@media(max-width:1000px){header{padding:16px 22px;gap:12px;grid-template-columns:auto 1fr auto}h1{font-size:30px;letter-spacing:1px}#back{font-size:15px;padding:8px 11px}.header-actions button{font-size:13px;padding:6px 9px}html[lang=en] h1{font-size:23px}.brand-mark{width:30px;height:34px}main{padding:0 20px 20px}.workshop{padding:18px;gap:10px}.boards{gap:16px}.quantity{gap:12px;padding:5px 16px}.companion{width:112px;height:168px;bottom:-58px}.feedback{padding:0 100px}}
@media(orientation:portrait) and (max-width:850px){header{grid-template-columns:1fr auto;padding:14px 20px;gap:12px}h1{grid-column:1/-1;grid-row:1;font-size:34px}#back{grid-column:1;grid-row:2}.header-actions{grid-column:2;grid-row:2}html[lang=en] h1{font-size:29px}.workshop{gap:12px}.practice h2{font-size:16px;padding:11px 14px}.quantity{gap:9px}.count-label{padding-right:9px}.companion{width:112px;height:168px}.feedback{padding:0 100px}.count-object,.count-object svg{width:27px}.count-object svg{height:27px}#objects{gap:6px}}
@media(max-width:600px) and (orientation:portrait){header{padding:12px 14px 14px;gap:12px}h1{font-size:30px}.brand-mark{width:29px;height:33px}#back{font-size:13px;min-height:38px;padding:7px 9px;border-radius:11px}.header-actions{gap:4px}.header-actions button{font-size:12px;min-height:37px;padding:6px 8px;border-radius:11px}#help{width:32px;font-size:19px}html[lang=en] h1{font-size:26px}main{padding:0 10px 14px}.workshop{padding:11px 10px 15px;border-radius:25px;gap:12px}.boards{gap:10px}.practice{padding:0 6px 8px;border-radius:17px}.practice h2{width:calc(100% + 12px);font-size:13px;padding:9px 10px;gap:5px}.practice h2 strong{font-size:20px;min-width:25px;height:26px;border-radius:8px}.complete{right:39px;width:19px;height:19px;font-size:14px}.clear{font-size:12px;min-height:38px;padding:5px 8px;gap:4px}.clear:before{width:14px;height:14px}.quantity{min-height:47px;gap:7px;padding:5px 10px;border-radius:14px}.count-label{display:none}#quantity-caption{font-size:14px}#objects{gap:4px}.count-object,.count-object svg{width:22px}.count-object svg{height:22px}.count-object span{font-size:10px;margin-top:1px}#zero-message{font-size:12px}.feedback{height:86px;padding:0 6px 0 78px}.companion{width:58px;height:86px;left:8px;bottom:0}#message{font-size:13px;line-height:1.5;text-align:left}#celebration{font-size:14px;gap:5px;flex-wrap:wrap;justify-content:flex-start}#result-stars{font-size:23px}.actions{gap:10px}.actions button{min-width:130px;min-height:47px;font-size:16px;border-radius:14px}#next{gap:8px}#next:after{font-size:18px}.boards.single-board{width:100%}html[lang=en] .practice h2{font-size:11px}html[lang=en] .clear{font-size:11px}}
@media(orientation:landscape) and (max-height:620px){header{padding:8px 22px;gap:10px}h1{font-size:26px}.brand-mark{width:26px;height:29px}#back{font-size:13px;min-height:34px;padding:6px 10px}.header-actions button{font-size:12px;min-height:32px;padding:5px 9px}#help{width:32px;font-size:18px}html[lang=en] h1{font-size:23px}main{padding:0 20px 12px}.workshop{padding:12px 16px;gap:7px;border-radius:24px}.boards{gap:14px}.practice{padding:0 8px 6px;border-radius:17px}.practice h2{width:calc(100% + 16px);padding:6px 12px;font-size:14px}.practice h2 strong{font-size:19px;min-width:25px;height:25px}.clear{min-height:32px;padding:4px 9px;font-size:12px}.quantity{min-height:37px;padding:3px 14px;gap:10px;border-radius:13px}.count-label{font-size:13px;padding-right:10px}#quantity-caption{font-size:14px}.count-object,.count-object svg{width:21px}.count-object svg{height:21px}.count-object span{font-size:9px;margin:0}#objects{gap:5px}.feedback{height:24px;padding:0 94px}#message{font-size:12px}#celebration{font-size:14px}#result-stars{font-size:21px}.companion{width:88px;height:132px;bottom:-46px}.actions button{min-height:36px;min-width:140px;font-size:14px;border-radius:11px}#next:after{font-size:17px}}
@media(max-height:380px) and (orientation:landscape){header{padding:5px 14px}h1{font-size:21px}.brand-mark{width:23px;height:25px}#back{font-size:11px;min-height:30px;padding:5px 7px}.header-actions button{font-size:10px;min-height:29px;padding:4px 6px}#help{width:27px}html[lang=en] h1{font-size:18px}main{padding:0 10px 8px}.workshop{padding:8px 10px;gap:4px;border-radius:18px}.practice{padding:0 5px 3px;border-radius:12px}.practice h2{width:calc(100% + 10px);padding:3px 9px;font-size:11px}.practice h2 strong{font-size:15px;height:19px;min-width:20px;border-radius:6px}.clear{min-height:27px;padding:3px 8px;font-size:10px;gap:4px}.clear:before{width:12px;height:12px}.quantity{min-height:24px;padding:2px 10px;gap:8px}.count-label{font-size:11px}#quantity-caption{font-size:11px}.count-object,.count-object svg{width:17px}.count-object svg{height:17px}.count-object span{display:none}.feedback{height:17px;padding:0 65px}#message{font-size:10px;line-height:16px}#celebration{font-size:11px;line-height:16px}#result-stars{font-size:17px}.companion{width:58px;height:87px;bottom:-35px}.actions button{min-height:29px;min-width:116px;font-size:11px;padding:4px 9px;border-radius:9px}#next:after{font-size:14px}.complete{width:18px;height:18px;font-size:12px;right:36px}}
@media(max-width:600px) and (max-height:650px) and (orientation:portrait){header{padding:8px 11px 10px;gap:7px}h1{font-size:25px}.brand-mark{height:28px;width:25px}#back{font-size:11px;min-height:34px;padding:6px 8px}.header-actions button{font-size:10px;min-height:33px;padding:5px 7px}#help{width:28px}html[lang=en] h1{font-size:23px}main{padding:0 8px 9px}.workshop{padding:8px;gap:7px;border-radius:21px}.practice h2{padding:6px 8px;font-size:12px}.practice h2 strong{height:24px;min-width:22px;font-size:18px}.clear{min-height:33px;font-size:10px;padding:4px 7px}.quantity{min-height:33px;padding:3px 7px;gap:5px}#quantity-caption{font-size:12px}.count-object,.count-object svg{width:18px}.count-object svg{height:18px}.count-object span{font-size:9px}#objects{gap:3px}.feedback{height:64px;padding-left:57px}.companion{width:44px;height:64px;bottom:0;left:5px}#message{font-size:11px}#celebration{font-size:12px}#result-stars{font-size:18px}.actions button{flex:1;min-height:40px;min-width:0;font-size:13px;padding:7px 9px}.actions #demo{gap:6px}.actions #next{gap:6px}.actions{gap:8px}html[lang=en] .practice h2{font-size:10px}html[lang=en] .clear{font-size:10px}}
@media(prefers-reduced-motion:reduce){.star{animation:none}.ink,button{transition:none}}
/* Reuse the companion's face for the title avatar. */
.brand-mark{position:relative;display:block;overflow:hidden;border-radius:50%;background:#fff9ed;aspect-ratio:1;align-self:center}.brand-mark img{position:absolute;width:150%;height:auto;max-width:none;left:-25%;top:-55%;pointer-events:none}
