:root{font-family:Inter,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:#234a4d;background:#78bfc2;--ink:#234a4d;--mint:#48b6a4;--coral:#f1784c;--cream:#fffaf1;--line:#e2e9e2;--muted:#678082}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.48;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #f2ad64;outline-offset:2px}[hidden]{display:none!important}#app{height:100dvh;min-height:550px;position:relative;overflow:hidden}#world{position:absolute;width:100%;height:100%;display:block;touch-action:none;background:linear-gradient(#a7d8ce,#75c4c6)}.glass{background:rgba(255,251,241,.94);border:1px solid rgba(255,255,255,.7);box-shadow:0 12px 42px rgba(29,79,80,.13);backdrop-filter:blur(15px)}.header{position:absolute;top:17px;left:19px;max-width:min(590px,calc(100vw - 400px));border-radius:24px;padding:17px 23px;z-index:10;display:flex;gap:25px;align-items:center}.eyebrow{font-size:10px;font-weight:850;letter-spacing:1.6px;color:#d36b42;text-transform:uppercase}.header h1{font-size:clamp(20px,2.1vw,32px);line-height:1.2;letter-spacing:1px;margin:5px 0}.header h1 em{font-style:normal;color:#e26e44}.header p{margin:0;font-size:12px;color:#657e7c}.user-bar{font-size:12px;font-weight:700;white-space:nowrap;text-align:right}.user-bar>*{display:block;margin-top:6px}.mini{background:#f5eadb;border:0;border-radius:8px;padding:6px 12px;color:#665b53;font-weight:700}.sidebar{position:absolute;right:18px;top:18px;bottom:18px;width:323px;z-index:10;border-radius:24px;overflow:auto;padding:17px 18px 25px;scrollbar-width:thin}.sidebar-head{display:flex;align-items:center;justify-content:space-between}.sidebar-head h2{margin:4px 0 15px;font-size:22px}.sidebar h3{font-size:14px;margin:22px 0 9px;border-bottom:1px solid var(--line);padding-bottom:8px}.sidebar h3 small{font-weight:450;color:var(--muted);font-size:10px}.progressbox{background:#e8f5ee;border-radius:16px;padding:14px}.progresslabel{display:flex;justify-content:space-between;align-items:center;font-size:14px}.progresslabel strong{font-size:18px}.progressbar{height:8px;background:#cee5d9;border-radius:10px;overflow:hidden;margin:10px 0}.progressbar i{display:block;width:0;height:100%;background:linear-gradient(90deg,#50b89c,#f2a65c);border-radius:10px;transition:width .3s}.progressbox p{font-size:11px;line-height:1.6;margin:5px 0 0;color:#52736d}.chapters{display:grid;gap:9px}.chapter{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #e0e7dd;background:#fff;padding:10px 9px;border-radius:12px;text-align:left;color:var(--ink);transition:transform .2s,box-shadow .2s}.chapter:hover{transform:translateY(-2px);box-shadow:0 4px 15px #275c5130}.chapter span:nth-child(2){flex:1;min-width:0}.chapter b{display:block;font-size:12px}.chapter small{display:block;font-size:10px;color:var(--muted);margin-top:2px}.chapter .count{font-size:10px;color:#d16d47;white-space:nowrap}.chapter-emoji{width:32px;height:32px;border-radius:10px;background:#e5f7ed;text-align:center;line-height:32px;font-size:18px}.rankboard{background:white;border:1px solid #e5ebe2;border-radius:13px;padding:7px}.rank-row{display:flex;align-items:center;gap:8px;padding:7px 9px;border-bottom:1px solid #f2f1e9;font-size:12px}.rank-row:last-child{border-bottom:0}.rank-row .medal{font-weight:850;color:#d57d4e;width:22px}.rank-row b{flex:1}.rank-row em{font-style:normal;font-weight:850}.rankboard.compact .rank-row{padding:4px 8px;font-size:11px}.muted,.sidebar-note{font-size:11px;color:var(--muted);line-height:1.6}.sidebar-note{margin:13px 0}.primary,.secondary{border:0;padding:11px 16px;border-radius:12px;font-weight:850}.primary{background:#e9774f;color:white;box-shadow:0 4px 0 #b75637}.primary:not(:disabled):hover{background:#de6640}.secondary{background:#eef4ee;color:#355a58}.wide{width:100%}.side-history{font-size:12px;margin-top:12px;color:#687d7a}.map-tools{position:absolute;z-index:9;top:153px;left:20px;display:flex;gap:5px;border-radius:16px;padding:6px}.map-tools button{border:0;border-radius:10px;background:white;color:#427775;width:36px;height:36px;font-weight:900;font-size:19px}.bottom-controls{position:absolute;left:20px;bottom:20px;z-index:9;display:flex;gap:20px;align-items:center;border-radius:16px;padding:13px 15px;font-size:11px;max-width:calc(100% - 380px)}.desktop-help{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.desktop-help b{margin-right:7px}.online-indicator{white-space:nowrap}.online-indicator .dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#44c58a;margin-right:4px}.online-indicator small{color:#88948e}kbd{background:#fff;border:1px solid #e1e1d8;box-shadow:0 2px 0 #d8d7cb;padding:2px 5px;border-radius:5px;font-size:11px;font-weight:800}.labels{position:absolute;inset:0;pointer-events:none;z-index:4}.world-label{pointer-events:auto;position:absolute;transform:translate(-50%,-50%);border-radius:16px;background:rgba(255,253,247,.95);padding:11px 15px;box-shadow:0 5px 16px #33596534;color:#304b4c;text-align:center;min-width:144px;transition:filter .25s;cursor:pointer;border:2px solid #fff}.world-label:hover{filter:brightness(.95)}.world-label b{display:block;font-size:13px}.world-label small{display:block;color:#d87244;font-weight:800;font-size:10px;margin-top:3px}.world-label .bubble-arrow{position:absolute;bottom:-11px;left:calc(50% - 7px);border:7px solid transparent;border-top-color:white}.enter-tip{position:absolute;bottom:100px;left:50%;transform:translateX(-50%);z-index:12;background:#fffbe8;border:2px solid #f4ba65;border-radius:14px;padding:10px 17px;font-weight:800;cursor:pointer;box-shadow:0 5px 20px #0002;font-size:12px}#speechLayer{pointer-events:none;position:absolute;inset:0;z-index:5}.speech{position:absolute;transform:translate(-50%,-110%);background:#fffdfa;border:1px solid white;box-shadow:0 5px 20px #1b3d4d35;border-radius:16px;padding:8px 12px;font-size:10px;font-weight:650;color:#365452;max-width:180px;line-height:1.5;text-align:center;pointer-events:none}.speech:after{content:"";position:absolute;bottom:-6px;left:48%;width:9px;height:9px;transform:rotate(45deg);background:#fffdfa}.speech.teacher{background:#fff2d7;border-color:#ffcc80}.speech.teacher:after{background:#fff2d7}.overlay{position:fixed;inset:0;background:rgba(18,57,64,.55);display:flex;align-items:center;justify-content:center;z-index:30;backdrop-filter:blur(8px)}.login-card{width:min(450px,calc(100vw - 26px));padding:25px 30px 24px;background:#fffaf0;border-radius:25px;box-shadow:0 25px 80px #163b4666;max-height:92vh;overflow-y:auto}.login-card.slim{max-width:480px}.island-crest{font-size:26px;color:#e9744e;display:flex;gap:8px;align-items:center}.island-crest span{font-size:11px;border:2px solid #edd6a9;padding:4px 8px;border-radius:20px;font-weight:800}.login-card h2{font-size:30px;line-height:1.3;margin:14px 0 8px}.login-card h2 strong{color:#e8744c}.login-card p{color:#668080;font-size:13px;line-height:1.7}.tabs{display:flex;background:#ececde;border-radius:12px;padding:4px;margin:20px 0}.tabs button{flex:1;border:0;background:transparent;padding:10px;color:#628080;border-radius:9px;font-weight:800}.tabs button.selected{background:#fff;box-shadow:0 2px 6px #0001;color:#d46943}.login-card label,.reflection label{font-size:12px;font-weight:800;display:block;margin:14px 0}.login-card input:not([type=checkbox]),.teacher-list input{width:100%;padding:13px;border:1px solid #d2dcd7;border-radius:9px;background:white;margin-top:6px;outline:none}.field-help,.tiny{color:#83928d!important;font-size:11px!important}.login-card .checkline,.checkline{display:flex;align-items:flex-start;gap:10px;font-size:12px;font-weight:600;line-height:1.6}.checkline input{margin-top:4px;accent-color:#e37c51}.error{color:#b44c3c;margin:10px 0;font-size:12px;min-height:16px}.tiny{text-align:center;margin-top:15px}.side-overlay{justify-content:flex-end;background:#0f3e4577;backdrop-filter:blur(5px)}.quiz-panel{width:min(700px,100%);height:100%;background:#fffaf1;display:flex;flex-direction:column;box-shadow:-12px 0 55px #15383c55}.quiz-top{padding:20px 25px 12px;border-bottom:1px solid #e9e8dd;display:flex;align-items:center;gap:15px}.back{border:0;background:transparent;color:#537575;font-weight:800}.chapter-pill{background:#dfefe2;color:#427962;padding:5px 10px;border-radius:7px;font-size:11px;font-weight:850}.question-number{margin-left:auto;color:#da774f;font-weight:900;font-size:12px}.quiz-scroll{padding:28px clamp(18px,5vw,43px);flex:1;overflow:auto;scrollbar-width:thin}.quiz-kicker{color:#e17e53;font-size:11px;font-weight:900;letter-spacing:2px}.quiz-scroll h2{font-size:clamp(20px,2vw,27px);line-height:1.6;color:#294b48;margin:12px 0 22px}.source{background:#e8f3ec;border-left:4px solid #78bda2;padding:10px 15px;border-radius:8px;margin-bottom:22px}.source b{font-size:12px;color:#35736c}.source p{margin:5px 0;font-size:12px;line-height:1.7}.options{display:grid;gap:11px}.option{display:flex;align-items:flex-start;gap:12px;text-align:left;border:2px solid #e3e9df;background:white;padding:14px;border-radius:12px;color:#315154;transition:border-color .2s,background .2s;font-size:14px;line-height:1.55}.option span{width:26px;height:26px;flex:none;display:grid;place-items:center;border-radius:8px;background:#eff3eb;font-weight:900;color:#5d8884}.option.selected{border-color:#e68d69;background:#fff7ec}.option.selected span{background:#e87651;color:white}.option:disabled{opacity:.75}.quiz-scroll>.primary.wide{margin-top:15px}.result-banner{margin-top:15px;padding:14px;border-radius:10px;background:#fff2df;border-left:4px solid #e58a57;color:#86563b;font-size:13px;line-height:1.65}.result-banner.ok{background:#e8f4ec;border-left-color:#69ad84;color:#426b53}.reflection,.hint-panel{margin-top:18px;background:#fff;border:1px solid #e3e6d9;border-radius:14px;padding:17px}.reflection{background:#fff8e8}.reflection h3,.hint-panel h3{margin:0 0 7px;font-size:15px}.reflection p,.hint-panel p{color:#64807b;font-size:12px;line-height:1.8}.reflection textarea{width:100%;border:1px solid #dcdccf;border-radius:10px;padding:13px;resize:vertical;background:#fff;line-height:1.7}.reflection button{margin:10px 10px 0 0}.hint-controls{display:flex;gap:8px;margin-top:12px}.hint-btn{border:1px solid #dae3d8;background:#f4f7ef;color:#527976;border-radius:8px;padding:7px 12px;font-weight:850;font-size:11px}.hint-btn.selected{background:#467c77;color:white}.hint-panel h3 small{font-size:11px;font-weight:500;color:#90a29d}.quiz-footer{display:flex;gap:15px;justify-content:space-between;align-items:center;padding:12px 22px 19px;border-top:1px solid #e8e6dd}.quiz-footer span{font-size:12px;color:#76918b}.result-card{background:#fffaf1;border-radius:24px;max-width:620px;max-height:92vh;overflow:auto;width:calc(100vw - 30px);padding:28px;box-shadow:0 25px 80px #13383b88}.result-card h2{font-size:29px;margin:9px 0}.result-card p{font-size:13px;line-height:1.8;color:#66817b}.score-big{font-size:76px;font-weight:1000;color:#e56d45}.score-big small{font-size:15px;color:#6e827f}.review-list{max-height:300px;overflow:auto;margin:15px 0}.review-item{background:#eef5e9;border-radius:10px;margin:9px 0;padding:12px 14px}.review-item b{font-size:14px}.review-item p{font-size:12px;margin:5px 0}.result-card>button{margin-right:9px;margin-top:10px}.teacher-overlay{position:fixed;inset:0;overflow:auto;padding:28px clamp(15px,4vw,60px);background:#f8f7ef;z-index:40;color:#26494d}.teacher-header{display:flex;justify-content:space-between;align-items:center}.teacher-header h2{margin:6px 0 20px}.teacher-stats{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:20px}.teacher-stat{background:white;border-radius:12px;padding:16px;min-width:160px;border:1px solid #e6e9df}.teacher-stat b{font-size:24px;display:block;color:#d56b45}.teacher-stat span{font-size:11px}.teacher-list{background:white;border-radius:16px;padding:20px}.teacher-list-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.teacher-list-head>div{display:flex;gap:8px;align-items:center}.teacher-list input{width:210px;margin:0}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px;margin-top:16px}th,td{text-align:left;padding:13px 11px;border-bottom:1px solid #e9ece7;white-space:nowrap}th{background:#edf2ec}td button{border:none;color:#bf663f;background:#fff1e5;padding:5px 10px;border-radius:7px}.teacher-detail{position:fixed;z-index:50;top:4%;right:3%;width:min(650px,94vw);height:92vh;overflow:auto;background:#fffaf0;box-shadow:0 15px 60px #0004;padding:24px;border-radius:15px}.teacher-detail .detailrow{border-bottom:1px solid #e2e6dd;padding:10px 0;font-size:12px;line-height:1.7}.teacher-detail h3{margin-top:22px}.toast{position:fixed;bottom:85px;left:50%;transform:translateX(-50%);z-index:80;background:#2d5655;color:white;border-radius:13px;padding:10px 18px;font-size:13px;box-shadow:0 10px 25px #1b505840;opacity:0;pointer-events:none;transition:opacity .2s;max-width:90vw;text-align:center}.toast.show{opacity:1}.mobile-pad{display:none}
@media(max-width:1050px){.header{max-width:calc(100vw - 360px)}.header p{display:none}.sidebar{width:302px}.bottom-controls{max-width:calc(100% - 347px)}}
@media(max-width:760px){.header{top:10px;left:10px;right:10px;max-width:none;padding:11px 14px;border-radius:14px}.header h1{font-size:19px}.eyebrow{font-size:9px;letter-spacing:1px}.header p{display:block;font-size:10px}.user-bar{font-size:10px}.map-tools{top:110px;left:10px;gap:4px}.map-tools button{width:32px;height:32px}.sidebar{width:calc(100% - 20px);top:auto;bottom:12px;max-height:44vh;right:10px;border-radius:17px;padding:10px 13px;box-shadow:0 3px 30px #19494b25}.sidebar-head h2{font-size:15px;margin:0 0 5px}#sideDetails{display:none}.sidebar.expanded{max-height:73vh}.sidebar.expanded #sideDetails{display:block}.bottom-controls{left:10px;bottom:68px;max-width:calc(100% - 20px);padding:7px 9px;display:none}.mobile-pad{display:block;position:absolute;z-index:13;left:10px;bottom:70px;pointer-events:none}.mobile-pad button{pointer-events:auto;border:1px solid white;background:#fff9eddd;border-radius:12px;width:50px;height:49px;color:#456b6a;font-size:16px;font-weight:900;margin:2px;box-shadow:0 4px 9px #174a4b33}.mobile-pad>button:first-child{margin-left:56px}.mobile-pad #mobileEnter{width:150px;height:35px;font-size:12px;margin-top:5px;background:#eb8a63;color:white}.world-label{padding:6px 8px;min-width:100px;border-radius:11px}.world-label b{font-size:10px}.world-label small{font-size:8px}.speech{max-width:140px;font-size:9px}.enter-tip{bottom:245px;font-size:11px;width:210px;text-align:center}.quiz-panel{width:100%}.quiz-top{padding:12px 16px}.quiz-scroll{padding:16px 18px}.quiz-scroll h2{font-size:19px}.options{gap:8px}.option{font-size:13px;padding:11px}.quiz-footer{padding:10px 13px}.quiz-footer .secondary{padding:9px;font-size:12px}.result-card{padding:21px}.score-big{font-size:54px}.teacher-overlay{padding:15px}.teacher-list{padding:12px}.teacher-header h2{font-size:18px}}

.avatar-label{position:absolute;z-index:6;transform:translate(-50%,-100%);background:#fff1bd;color:#83633a;font-size:11px;font-weight:900;padding:4px 10px;border-radius:20px;border:2px solid white;box-shadow:0 3px 12px #274f5538;white-space:nowrap;pointer-events:none}

/* 2026 midterm: student-ID sign-in, teacher preview, class roster import */
.mode-card{width:min(670px,calc(100vw - 28px))}.mode-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin:18px 0}.mode-option{border:2px solid #e8e9e0;border-radius:16px;background:#fff;padding:22px 18px;text-align:left;color:var(--ink);min-height:140px;display:flex;flex-direction:column;gap:12px}.mode-option:hover,.mode-option:focus-visible{border-color:#f1784c;box-shadow:0 6px 20px #f1784c23}.mode-option strong{font-size:19px}.mode-option small{font-size:13px;color:var(--muted);line-height:1.6}.teacher-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.teacher-actions button{font-weight:750}.roster-import{background:#fff;border:1px solid #dce6df;border-radius:18px;display:flex;align-items:center;gap:12px;padding:16px 20px;margin:17px 0;flex-wrap:wrap}.roster-import h3{margin:0 0 5px}.roster-import p{font-size:12px;margin:0;color:#607a78;line-height:1.6}.roster-import>div{flex:1;min-width:240px}.roster-import #rosterStatus{width:100%;font-size:12px;color:#2c6761}.roster-upload{cursor:pointer;white-space:nowrap}.teacher-test-tools{position:fixed;top:92px;left:18px;max-width:min(650px,calc(100vw - 36px));z-index:26;border-radius:15px;background:#fff7e3f5;border:2px solid #f1bd71;box-shadow:0 6px 25px #15383c40;padding:9px;display:flex;gap:7px;align-items:center;flex-wrap:wrap;color:#685331;font-size:12px}.teacher-test-tools .mini{white-space:nowrap;background:#ffe4bb}.quiz-top #quizTeacherExit{background:#fff0d7;border:1px solid #e5aa71;color:#8c583d}.result-card #resultTeacherExit{margin-left:8px}
@media (max-width:760px){.mode-choice-grid{grid-template-columns:1fr}.mode-option{min-height:106px;padding:13px}.teacher-test-tools{top:122px;left:8px;right:8px;max-width:none;padding:6px;font-size:11px}.teacher-test-tools .mini{font-size:10px;padding:5px}.teacher-actions{align-items:flex-start}.roster-import{padding:12px}}

@media(max-width:760px){body.teacher-test-active .map-tools{top:175px}}
