:root{--ink:#24263d;--muted:#6d7189;--purple:#6747eb;--purple-dark:#4e30c6;--lime:#d9f766;--paper:#f5f5fb;--line:#e6e6f0;--orange:#ffae76;--pink:#ffe6ef;--green:#16876f;font-family:"Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;font-size:16px;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer;border:0}button:disabled{cursor:wait;opacity:.6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #9a77ff;outline-offset:3px}a{color:var(--purple)}.hidden{display:none!important}.topbar{height:92px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 max(5vw,24px);border-bottom:1px solid var(--line)}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);font-weight:900;font-size:24px;letter-spacing:1px}.brand small{display:block;font-size:13px;color:var(--muted);letter-spacing:2px;margin-top:2px}.logo{display:grid;place-items:center;background:var(--purple);width:48px;height:48px;border-radius:16px;color:white;font-size:32px;transform:rotate(-8deg);position:relative}.logo span{position:absolute;right:-7px;top:-13px;color:#efb938;font-size:27px}.topright{display:flex;align-items:center;gap:14px}.grade{font-size:14px;padding:8px 13px;border-radius:20px;background:var(--paper);color:var(--muted)}.wallet{background:#fff2cf;border:1px solid #f7d67b;color:#94621a;padding:10px 18px;border-radius:24px;font-weight:800}.quiet{background:transparent;color:var(--muted);padding:10px}.primary,.secondary,.danger{min-height:48px;border-radius:14px;padding:13px 24px;font-weight:800;transition:transform .18s,background .18s}.primary{color:white;background:var(--purple);box-shadow:0 4px 0 #4930ad}.primary:hover{background:var(--purple-dark);transform:translateY(-1px)}.secondary{background:#eeebff;color:var(--purple)}.danger{background:#fff0ed;color:#b43d39}.wide{width:100%}.small{font-size:14px;padding:9px 14px;min-height:40px}.eyebrow{font-size:13px;letter-spacing:2px;font-weight:800;color:var(--purple)}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(32px,4.5vw,54px);line-height:1.28;letter-spacing:-1.5px}h2{font-size:25px;line-height:1.5}h3{font-size:19px}p{line-height:1.8}.muted{color:var(--muted)}.loading{text-align:center;padding:100px}.auth{max-width:1130px;margin:56px auto;display:grid;grid-template-columns:1.15fr 1fr;gap:60px;align-items:center;padding:0 28px}.auth-intro h1 em{font-style:normal;color:var(--purple);position:relative}.auth-intro>p{max-width:470px;color:var(--muted);font-size:18px}.pill{display:inline-flex;align-items:center;gap:7px;background:white;border:1px solid var(--line);padding:8px 14px;border-radius:24px;font-size:14px}.auth-card,.panel{background:white;border:1px solid var(--line);border-radius:26px;padding:30px;box-shadow:0 8px 32px #39335106}.auth-card .switch{display:flex;background:var(--paper);border-radius:13px;padding:5px;gap:5px;margin-bottom:26px}.switch button{flex:1;border-radius:9px;background:transparent;padding:12px;font-size:15px;color:var(--muted)}.switch button.active{background:white;color:var(--purple);font-weight:800;box-shadow:0 2px 7px #30205f0e}label{display:block;font-size:15px;font-weight:700;margin-bottom:17px}input,select{display:block;width:100%;background:#f8f8fc;border:1px solid #ddddea;border-radius:12px;padding:13px 15px;color:var(--ink);margin-top:8px;min-height:48px}input::placeholder{color:#9193a8;font-weight:400}.helper{font-size:14px;color:var(--muted);line-height:1.7}.form-error{color:#bd4545;background:#fff0ed;border-radius:10px;padding:10px 13px;font-size:14px}.auth-features{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}.mascot-art{width:100%;max-width:430px;height:240px;margin-top:18px}.shell{max-width:1200px;margin:0 auto;padding:24px 28px 50px}.nav{display:flex;gap:8px;margin-bottom:26px;overflow:auto}.nav button{white-space:nowrap;padding:13px 20px;border-radius:12px;background:transparent;color:var(--muted);font-weight:700}.nav button.active{background:#eae5ff;color:var(--purple)}.hero{position:relative;display:grid;grid-template-columns:1.45fr 1fr;background:#eae4ff;border:1px solid #dfd6ff;border-radius:28px;overflow:hidden;min-height:290px;padding:36px 38px}.hero h1{font-size:38px;margin:12px 0}.hero p{color:#655982;max-width:510px}.hero .primary{background:var(--ink);box-shadow:0 4px 0 #111325}.hero-art{display:flex;align-items:center;justify-content:center}.hero-art svg{width:100%;height:240px}.hero-tags{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.hero-tags span{font-size:13px;padding:7px 11px;border-radius:20px;background:#ffffffa3;color:#675984}.dashboard-grid{display:grid;grid-template-columns:1fr 300px;gap:24px;margin-top:24px}.section-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.section-top h2{margin:0}.section-top small{color:var(--muted)}.topics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.topic{border:1px solid var(--line);background:white;border-radius:20px;padding:20px;min-height:150px}.topic-symbol{display:flex;width:44px;height:44px;border-radius:14px;align-items:center;justify-content:center;font-weight:900;font-size:23px;margin-bottom:14px;background:#f0eaff;color:var(--purple)}.topic:nth-child(2n) .topic-symbol{background:#e8f7ed;color:var(--green)}.topic:nth-child(3n) .topic-symbol{background:#fff0e3;color:#b46a27}.topic h3{margin:0 0 7px}.topic p{font-size:13px;color:var(--muted);margin:0}.stats{display:flex;gap:14px;margin-bottom:23px}.stat{flex:1;background:#f6f5ff;border-radius:17px;padding:18px;text-align:center}.stat b{display:block;font-size:29px;margin-bottom:7px;color:var(--purple)}.stat span{font-size:13px;color:var(--muted)}.side-note{background:#f4f9df;border-radius:17px;padding:19px;font-size:14px;color:#647034}.side-note p{margin:0}.badge{border:1px solid var(--line);border-radius:14px;padding:15px;margin-top:11px;display:flex;align-items:center;gap:13px}.badge .icon{font-size:25px}.badge small{display:block;color:var(--muted);margin-top:5px;font-size:13px}.badge.locked{opacity:.5}.practice{max-width:850px;margin:0 auto}.progress-info{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--muted);margin-bottom:10px}.progress{height:9px;border-radius:10px;background:#e5e0f6;overflow:hidden;margin-bottom:28px}.progress>span{display:block;height:100%;background:var(--purple);transition:width .3s}.question-card{padding:32px 38px;border-radius:26px;background:white;border:1px solid var(--line);box-shadow:0 7px 35px #30205f07}.question-head{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.difficulty{font-size:14px;border-radius:20px;padding:7px 14px;font-weight:800}.easy{background:#e4f7ed;color:#257b60}.medium{background:#fff0d9;color:#aa6818}.hard{background:#f0e5ff;color:#8b4dc0}.question-topic{font-size:14px;color:var(--muted)}.question-prompt{font-size:22px;line-height:1.95;margin:25px 0 28px;font-weight:700;white-space:pre-line}.answer-row{display:flex;align-items:center;gap:12px}.answer-row input{margin:0;flex:1;font-size:23px;min-width:80px}.answer-row .unit{min-width:60px;font-size:16px;color:var(--muted)}.answer-row button{white-space:nowrap}.assist-row{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.hint{background:#fff7e5;border-left:4px solid #f3c35e;border-radius:10px;padding:17px 20px;font-size:16px;line-height:1.9;margin-bottom:14px}.solution{background:#f1edff;border-left:4px solid var(--purple);padding:18px 22px;border-radius:10px;margin-bottom:14px;line-height:1.9}.solution ol{padding-left:22px;margin-bottom:0}.feedback{padding:15px 18px;border-radius:12px;line-height:1.8;margin:15px 0}.feedback.good{background:#e5f6ee;color:#28795d}.feedback.wrong{background:#fff0ed;color:#b65b45}.practice-bottom{display:flex;justify-content:space-between;gap:15px;margin-top:23px;align-items:center}.reward-hint{font-size:14px;color:var(--muted)}.scratch{margin-top:20px;color:var(--muted);font-size:14px}.scratch textarea{width:100%;min-height:85px;border:1px dashed #d8d1ee;border-radius:12px;background:#faf9ff;padding:14px;font:inherit;resize:vertical;margin-top:8px}.parent-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:22px}.parent-grid .panel{margin-bottom:22px}.child{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:18px 0;border-bottom:1px solid var(--line)}.avatar{width:45px;height:45px;border-radius:16px;background:#e9e2ff;display:grid;place-items:center;color:var(--purple);font-size:21px;font-weight:900}.child-name{display:flex;gap:12px;align-items:center}.child-name small{display:block;margin-top:5px;color:var(--muted);font-size:13px}.child .coins{font-size:20px;font-weight:800;color:#a77817}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 15px}.full{grid-column:1/-1}.section-title{margin:12px 0 25px}.shop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:19px}.prize{background:white;border:1px solid var(--line);border-radius:22px;padding:28px;text-align:center}.prize .gift{display:grid;place-items:center;background:#f8efff;width:80px;height:80px;font-size:39px;border-radius:25px;margin:0 auto 20px}.prize strong{display:block;color:#a77817;font-size:23px;margin-bottom:20px}.empty{padding:32px;border:1px dashed #d8d3e8;border-radius:18px;text-align:center;color:var(--muted);line-height:1.9}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{padding:15px 13px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}th{color:var(--muted);font-weight:600}td.reason{white-space:normal;min-width:230px;line-height:1.7}.positive{color:var(--green);font-weight:800}.negative{color:#ba5e4a;font-weight:800}.request{background:#f8f7fd;border-radius:14px;padding:16px;margin-bottom:12px}.request p{margin-bottom:11px}.request-actions{display:flex;gap:9px}.summary{max-width:700px;margin:20px auto;text-align:center}.summary .big-star{font-size:70px;color:#e5b23a}.summary p{color:var(--muted)}.pending{background:#fff6dd;border:1px solid #eddc9d;border-radius:16px;padding:18px;margin-bottom:20px}.pending button{margin:8px 8px 0 0}.notice{background:#eeebff;padding:15px;border-radius:14px;color:#605887;line-height:1.8;font-size:14px;margin-top:20px}footer{display:flex;gap:18px;align-items:center;justify-content:center;padding:27px 20px;font-size:13px;color:#85859c;flex-wrap:wrap;border-top:1px solid var(--line)}footer button{font-size:13px}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;padding:15px 22px;border-radius:15px;box-shadow:0 10px 40px #0002;z-index:40;max-width:90%;display:none}#toast.visible{display:block}dialog{border:0;border-radius:28px;padding:38px;max-width:min(600px,93vw);color:var(--ink);box-shadow:0 22px 100px #1c153a44}dialog::backdrop{background:#21183899;backdrop-filter:blur(4px)}#chest-dialog{text-align:center;width:500px}.dialog-close{position:absolute;right:18px;top:12px;background:transparent;font-size:28px;color:var(--muted)}.confetti{font-size:35px;letter-spacing:15px;color:#d7a13b}.chest{width:170px;height:130px;margin:45px auto 30px;position:relative;filter:drop-shadow(0 10px 8px #77470e22)}.chest-box{position:absolute;bottom:0;width:170px;height:90px;border:7px solid #86502a;background:repeating-linear-gradient(90deg,#dd9646 0 20px,#cb8136 20px 24px);border-radius:0 0 20px 20px;display:grid;place-items:center}.chest-box span{background:#ffde63;color:#8d5b16;width:43px;height:48px;border-radius:10px;font-size:29px;font-weight:900;border:4px solid #b77e27}.chest-lid{position:absolute;z-index:2;top:0;width:170px;height:55px;background:#f1b85b;border:7px solid #86502a;border-radius:40px 40px 7px 7px;transform-origin:50% 100%;transition:transform .65s}.chest.open .chest-lid{transform:translateY(-35px) rotate(-13deg)}.chest.open{animation:bounce .7s}.coin-win{font-size:43px;font-weight:900;color:#b68013}#about-dialog li{margin-bottom:10px;line-height:1.7}#about-dialog a{overflow-wrap:anywhere;font-size:14px}.error-page{padding:70px;text-align:center}.streak{color:#ae6e20;font-size:14px}@keyframes bounce{50%{transform:translateY(-15px) rotate(4deg)}}
@media(max-width:850px){.auth{grid-template-columns:1fr;max-width:600px;gap:20px;margin-top:28px}.auth-intro h1{font-size:38px}.mascot-art{display:none}.dashboard-grid,.parent-grid{grid-template-columns:1fr}.hero{padding:27px;grid-template-columns:1fr}.hero-art{display:none}.hero h1{font-size:31px}.topics{grid-template-columns:repeat(2,1fr)}.shop-grid{grid-template-columns:repeat(2,1fr)}.topbar{height:78px;padding:0 20px}.grade{display:none}.brand{font-size:20px}.wallet{padding:9px 12px;font-size:14px}.shell{padding:18px}.question-card{padding:24px}.question-prompt{font-size:20px}.answer-row{flex-wrap:wrap}.answer-row input{width:65%}.answer-row button{width:100%}.practice-bottom{align-items:flex-start;flex-direction:column}.form-grid{grid-template-columns:1fr}.full{grid-column:auto}.topright{gap:4px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.chapter-link{text-align:left;min-height:205px;color:var(--ink);transition:transform .15s,border-color .15s}.chapter-link:hover{transform:translateY(-4px);border-color:var(--purple)}.chapter-link strong{display:block;color:var(--purple);margin-top:16px;font-size:14px}.chapter-heading{display:flex;align-items:center;gap:22px;margin:20px 0}.chapter-heading h1{margin-bottom:8px}.chapter-heading p{margin-bottom:0}.daily-card{display:flex;align-items:center;justify-content:space-between;gap:26px;background:#eae4ff;border:1px solid #d9ceff;border-radius:24px;padding:28px;margin:24px 0 32px}.daily-card>div{min-width:0}.daily-card h2{margin:14px 0 8px}.daily-card p{max-width:670px;margin-bottom:8px}.daily-card small{color:#75698b}.daily-card>button{flex-shrink:0}.question-map{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}.question-tile{background:white;border:1px solid var(--line);border-radius:17px;padding:18px 12px;display:flex;gap:12px;align-items:center;text-align:left;min-width:0;color:var(--ink)}.question-tile:hover{border-color:var(--purple)}.question-number{font-size:22px;font-weight:900;color:var(--purple)}.question-tile small{display:block;font-size:12px;color:var(--muted);margin-top:6px}.question-tile strong{font-size:14px}.question-tile.solved{background:#eff9f5;border-color:#cce6da}.question-tile.solved .question-number{color:var(--green)}.question-tile:disabled{cursor:default}.answer-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}.answer-option{margin:0;position:relative}.answer-option input{position:absolute;width:18px;height:18px;min-height:0;left:14px;top:16px;margin:0;accent-color:var(--purple)}.answer-option span{display:block;background:#f7f5ff;border:2px solid #e3ddf6;border-radius:14px;padding:17px 13px 17px 42px;cursor:pointer;line-height:1.5}.answer-option input:checked+span{border-color:var(--purple);background:#ebe5ff}.chest-choices{display:flex;justify-content:center;gap:12px;margin:30px 0 24px}.chest-choice{background:#fff9ec;border:2px solid #f0dbaf;border-radius:20px;padding:12px 10px 18px;color:#986318;min-width:0;flex:1}.chest-choice .chest{transform:scale(.59);transform-origin:center;margin:-8px -30px -14px}.chest-choice.chosen{border-color:#bb922e;background:#fff1bf;opacity:1}.chest-choice:disabled{cursor:default}.chest-choice:not(:disabled):hover{transform:translateY(-5px);border-color:#dba64b}#chest-dialog{width:620px}.coin-win{font-size:25px}.record-selector,.record-pages{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:20px 0}.learning-record{margin:16px 0;border:1px solid var(--line);border-radius:15px;padding:18px}.learning-record summary{display:flex;gap:12px;align-items:center;flex-wrap:wrap;cursor:pointer;line-height:1.7}.learning-record summary small{color:var(--muted)}.learning-record>p{margin-top:18px}.learning-record li{margin-bottom:9px;line-height:1.7}.child small{margin-bottom:9px}.question-tile>span:last-child{min-width:0}
@media(max-width:850px){.question-map{grid-template-columns:repeat(3,minmax(0,1fr))}.daily-card{flex-direction:column;align-items:stretch}.daily-card>button{align-self:flex-start}}
@media(max-width:500px){.question-map{grid-template-columns:repeat(2,minmax(0,1fr))}.question-tile{padding:14px 9px;gap:8px}.question-tile strong{font-size:13px}.question-tile small{font-size:11px}.answer-options{grid-template-columns:1fr}#chest-dialog{padding:28px 15px}.chest-choices{gap:5px}.chest-choice{padding:7px 3px 12px}.chest-choice .chest{transform:scale(.42);margin:-18px -47px -26px}.daily-card{padding:22px}.chapter-heading{gap:13px}.chapter-heading h1{font-size:31px}.learning-record{padding:12px}.coin-win{font-size:20px}}

/* Prevent intrinsic form widths from overflowing small screens. */
.auth>* ,.parent-grid>* ,.dashboard-grid>* {min-width:0}input,select{min-width:0}.auth-card .switch button{min-width:0}
@media(max-width:500px){.auth{padding:0 18px;grid-template-columns:minmax(0,1fr)}.auth-card{padding:22px}.switch button{padding:10px 6px;font-size:14px}.auth-intro>p{font-size:16px}.coin-win{font-size:30px}}
