:root{--bg:#f7f7f7;--surface:#fff;--ink:#1f1f1f;--muted:#87918c;--line:#e8ece9;--green:#4c4c4c;--green-dark:#383838;--mint:#f0f0f0;--orange:#ed9a57;--red:#dc6d5f;--shadow:0 12px 35px rgba(31,53,42,.055);font-family:'DM Sans','Noto Sans SC',sans-serif;color:var(--ink);font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:var(--bg);min-height:100vh}button,input,textarea,select{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex}.sidebar{width:246px;flex:none;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:30px 18px 17px;position:fixed;inset:0 auto 0 0;z-index:4}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-size:21px;font-weight:800;letter-spacing:-.5px;margin:0 0 54px 9px}.brand-dot{color:var(--green)}.brand small{display:block;font-size:10px;letter-spacing:1.45px;color:#a7b0ab;font-weight:700;margin-top:2px}.brand-mark{height:37px;width:37px;border-radius:12px;background:var(--green);display:flex;align-items:center;justify-content:center;gap:3px;transform:rotate(-4deg)}.brand-mark i{width:4px;border-radius:4px;background:#fff;height:13px}.brand-mark i:nth-child(2){height:20px}.brand-mark i:nth-child(3){height:9px}.side-label{font-size:12px;letter-spacing:1.5px;font-weight:700;color:#aab2ae;padding:0 11px;margin-bottom:11px}.nav-list{display:grid;gap:5px}.nav-item{border:0;background:transparent;color:#737e78;border-radius:10px;padding:11px 12px;display:flex;align-items:center;gap:12px;width:100%;text-align:left;font-size:13px;font-weight:600;transition:.18s}.nav-item:hover{background:#f7f7f7;color:var(--ink)}.nav-item.active{background:#f0f0f0;color:var(--green-dark)}.nav-icon{font-size:19px;width:22px;text-align:center;font-weight:400;color:inherit}.nav-pill{margin-left:auto;font-size:11px;background:#dedede;color:var(--green);padding:3px 6px;border-radius:5px}.nav-count{margin-left:auto;color:#a4ada8;font-size:12px}.sidebar-bottom{margin-top:auto}.sidebar-tip{background:#f7f7f7;border:1px solid #f0f0f0;border-radius:12px;padding:13px 12px;display:flex;gap:10px;margin:0 0 18px}.tip-icon{color:var(--green);font-size:18px}.sidebar-tip strong{font-size:12px}.sidebar-tip p{margin:4px 0 0;color:#8c9690;font-size:12px}.settings-link{margin-bottom:10px}.profile{border-top:1px solid var(--line);padding:16px 3px 0;display:flex;align-items:center;gap:10px}.profile strong{font-size:12px;display:block}.profile small{font-size:11px;color:#99a29d;display:block;margin-top:3px}.avatar{height:33px;width:33px;border-radius:11px;background:#e8e8e8;color:var(--green);font-size:13px;font-weight:700;display:grid;place-items:center}.avatar-small{width:31px;height:31px;border-radius:50%;font-size:13px}.profile-more{margin-left:auto;color:#aab2ae;letter-spacing:1px}.main-area{margin-left:246px;width:calc(100% - 246px);min-height:100vh}.topbar{height:68px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.72);display:flex;align-items:center;justify-content:space-between;padding:0 47px;position:sticky;top:0;z-index:3;backdrop-filter:blur(12px)}.topbar[hidden]{display:none}.breadcrumb{font-size:12px;display:flex;gap:11px;align-items:center;color:#a0a9a4}.breadcrumb b{font-weight:400;color:#d4dad6}.breadcrumb strong{font-weight:600;color:#47534c}.top-actions{display:flex;align-items:center;gap:16px}.today-label{color:#929c96;font-size:12px}.icon-button{background:white;border:1px solid var(--line);color:#6f7b74;border-radius:9px;width:32px;height:32px}.page-root{max-width:1260px;margin:auto;padding:37px 47px 70px}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:24px}.eyebrow{text-transform:uppercase;letter-spacing:1.8px;color:var(--green);font-size:11px;font-weight:700;margin-bottom:9px}.page-heading h1{font-size:25px;margin:0;letter-spacing:-.7px}.page-heading p{font-size:12px;color:#8b9690;margin:8px 0 0}.primary-button,.secondary-button,.subtle-button,.danger-button{border:0;border-radius:9px;padding:10px 15px;font-size:12px;font-weight:700;display:inline-flex;align-items:center;gap:8px;transition:.18s}.primary-button{background:var(--green);color:#fff;box-shadow:0 5px 13px #4c4c4c20}.primary-button:hover{background:var(--green-dark);transform:translateY(-1px)}.secondary-button{background:white;border:1px solid var(--line);color:#54615a}.subtle-button{background:var(--mint);color:var(--green)}.danger-button{background:#fff1ef;color:#c35d52}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-bottom:23px}.stat-card{padding:17px 19px;background:white;border:1px solid var(--line);border-radius:12px;display:flex;align-items:center;gap:14px;box-shadow:0 3px 12px #3b3b3b10}.stat-icon{width:38px;height:38px;border-radius:11px;background:#f2f2f2;color:var(--green);display:grid;place-items:center;font-size:17px}.stat-icon.orange{background:#fff4e9;color:#d78a43}.stat-icon.pink{background:#fff0ef;color:#d16b5e}.stat-copy{flex:1}.stat-copy span{font-size:12px;color:#89938d;display:block}.stat-copy strong{font-size:20px;display:block;margin-top:5px;letter-spacing:-.5px}.stat-note{font-size:11px;color:#a1aaa5}.hero-card{min-height:230px;border-radius:16px;background:#424242;color:white;position:relative;overflow:hidden;padding:27px 31px;display:flex;align-items:center;margin-bottom:25px}.hero-card:before{content:"";position:absolute;width:340px;height:340px;right:70px;top:-168px;border-radius:50%;border:1px solid #ffffff20;box-shadow:0 0 0 35px #ffffff09,0 0 0 72px #ffffff08}.hero-card:after{content:"";position:absolute;width:240px;height:240px;right:160px;bottom:-180px;border-radius:50%;background:#b2b2b227}.hero-content{position:relative;z-index:1;max-width:460px}.hero-kicker{font-size:11px;color:#d1d1d1;letter-spacing:1.5px;font-weight:700}.hero-card h2{font-size:25px;letter-spacing:-.6px;margin:11px 0 7px}.hero-card p{font-size:12px;color:#dbdbdb;margin:0 0 19px;line-height:1.8}.hero-card .primary-button{background:#f7f7f7;color:#424242;box-shadow:none}.hero-art{position:absolute;right:65px;top:25px;width:190px;height:180px;z-index:1}.art-sheet{position:absolute;right:18px;top:5px;width:112px;height:151px;background:#fff;border-radius:7px;transform:rotate(8deg);padding:17px 13px;box-shadow:0 15px 26px #2929292d}.art-sheet:before{content:"";position:absolute;inset:13px;background:repeating-linear-gradient(to bottom,transparent 0 10px,#ebebeb 10px 11px)}.art-check{position:absolute;right:85px;top:61px;background:#ebebeb;color:#4c4c4c;font-size:18px;width:37px;height:37px;border-radius:50%;display:grid;place-items:center;box-shadow:0 5px 14px #2929292a}.art-pencil{position:absolute;width:8px;height:115px;background:#e7a56b;border-radius:5px;transform:rotate(37deg);right:151px;top:49px;box-shadow:inset 0 0 0 2px #f2c392}.home-lower{display:grid;grid-template-columns:1.22fr .78fr;gap:17px}.panel{background:white;border:1px solid var(--line);border-radius:13px;padding:19px 20px;box-shadow:0 3px 12px #3b3b3b08}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.panel-head h3{font-size:13px;margin:0}.text-link{background:none;border:0;color:var(--green);font-size:12px;font-weight:700}.empty-small{border:1px dashed #e3e3e3;border-radius:10px;text-align:center;padding:25px 15px;color:#9aa49e;font-size:12px}.empty-small strong{display:block;color:#65736b;font-size:12px;margin-bottom:5px}.activity-item,.mistake-row,.source-row{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #f0f2f0}.activity-item:last-child,.mistake-row:last-child,.source-row:last-child{border-bottom:0}.activity-glyph{height:32px;width:32px;border-radius:9px;background:#f2f2f2;color:var(--green);display:grid;place-items:center}.activity-copy,.mistake-main{flex:1;min-width:0}.activity-copy strong,.mistake-main strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.activity-copy span,.mistake-main span{display:block;color:#a0a8a3;font-size:11px;margin-top:4px}.activity-right{font-size:11px;color:#929c96}.tag{display:inline-flex;align-items:center;border-radius:6px;padding:4px 7px;background:#f1f3f1;color:#738077;font-size:11px;font-weight:600}.tag.red{background:#fff0ee;color:#c76658}.tag.green{background:#f0f0f0;color:#545454}.tag.amber{background:#fff6e9;color:#ba823e}.tag.blue{background:#f5f5f5;color:#808080}.page-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(240px,.75fr);gap:17px}.upload-card{border:1px solid var(--line);background:white;border-radius:13px;padding:20px}.dropzone{border:1.5px dashed #dedede;background:#fcfcfc;border-radius:12px;padding:28px 18px;text-align:center;transition:.2s;cursor:pointer}.dropzone:hover,.dropzone.dragover{border-color:#8c8c8c;background:#f7f7f7}.upload-symbol{margin:0 auto 10px;width:45px;height:45px;border-radius:14px;background:#f0f0f0;color:var(--green);font-size:22px;display:grid;place-items:center}.dropzone h3{font-size:13px;margin:0 0 6px}.dropzone p{font-size:12px;color:#929d96;margin:0 0 14px}.file-list{display:grid;gap:8px;margin-top:13px}.file-chip{display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:12px}.file-chip span:nth-child(2){flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-chip button{border:0;background:none;color:#9da8a1}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:15px}.field{display:grid;gap:6px}.field label{font-size:12px;font-weight:700;color:#57635c}.input,.textarea,.select{width:100%;border:1px solid #e6e6e6;border-radius:8px;background:#fff;padding:10px 11px;font-size:12px;color:#3b3b3b;outline:none}.input:focus,.textarea:focus,.select:focus{border-color:#919191;box-shadow:0 0 0 3px #4c4c4c12}.textarea{min-height:95px;resize:vertical;line-height:1.7}.form-hint{font-size:11px;line-height:1.7;color:#9aa39e;margin:10px 0}.upload-footer{display:flex;align-items:center;justify-content:space-between;margin-top:15px}.helper-card{padding:19px;background:#f2f2f2;border:1px solid #ebebeb;border-radius:12px}.helper-card h4{font-size:12px;margin:0 0 10px}.helper-step{display:flex;gap:9px;margin:12px 0;color:#69766e;font-size:12px;line-height:1.5}.helper-step span{width:20px;height:20px;flex:none;border-radius:50%;display:grid;place-items:center;background:#e6e6e6;color:var(--green);font-size:11px;font-weight:700}.helper-card .muted{font-size:11px;line-height:1.7;color:#919c95;margin:12px 0 0}.source-row{padding:13px 0}.file-icon{height:36px;width:34px;background:#fff0ed;border-radius:9px;color:#cc6c5b;font-size:11px;font-weight:800;display:grid;place-items:center}.source-meta{flex:1}.source-meta strong{font-size:12px;display:block}.source-meta small{font-size:11px;color:#98a29c;display:block;margin-top:4px}.source-actions{display:flex;gap:6px}.small-button{border:1px solid var(--line);background:#fff;border-radius:7px;color:#718078;padding:6px 8px;font-size:11px}.grade-upload{padding:22px}.grade-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.grade-toolbar strong{font-size:13px}.grade-toolbar span{font-size:11px;color:#95a099}.grade-drop{min-height:225px;display:grid;place-items:center}.grade-preview{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:12px}.preview-thumb{position:relative;aspect-ratio:1.08;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#f5f5f5}.preview-thumb img{width:100%;height:100%;object-fit:cover}.preview-thumb button{position:absolute;top:5px;right:5px;border:0;background:#1c1c1ccc;color:white;border-radius:50%;width:21px;height:21px}.grade-side{display:grid;gap:12px;align-content:start}.step-card{background:white;border:1px solid var(--line);border-radius:12px;padding:16px}.step-card h4{font-size:12px;margin:0 0 10px}.step-card p{font-size:11px;color:#919c95;line-height:1.7;margin:0}.result-shell{display:grid;grid-template-columns:minmax(260px,.9fr) minmax(350px,1.1fr);gap:15px}.result-image{width:100%;height:auto;max-height:650px;object-fit:contain;border-radius:9px;background:#f5f6f4}.result-list{display:grid;gap:10px;align-content:start}.question-card{background:white;border:1px solid var(--line);border-radius:11px;padding:14px}.question-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}.question-top strong{font-size:12px}.question-body{white-space:pre-wrap;font-size:12px;line-height:1.75;color:#48554d}.question-answer{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}.answer-box{padding:9px;background:#f7f7f7;border-radius:7px;font-size:11px;line-height:1.7;color:#69756e}.answer-box b{display:block;margin-bottom:3px;color:#526058}.question-explain{font-size:12px;line-height:1.7;color:#65736b;margin-top:10px}.question-footer{display:flex;justify-content:space-between;align-items:center;margin-top:12px;padding-top:10px;border-top:1px solid #f0f2f0}.question-footer small{font-size:10px;color:#a1aaa5}.filter-bar{display:flex;align-items:center;gap:8px;margin-bottom:14px}.filter-bar .input{max-width:240px}.filter-chip{border:1px solid var(--line);background:#fff;border-radius:7px;padding:8px 10px;font-size:11px;color:#6c7971}.filter-chip.active{background:#f0f0f0;border-color:#e3e3e3;color:var(--green)}.mistakes-list{display:grid;gap:0}.mistake-row{padding:14px 2px}.check{accent-color:var(--green);width:14px;height:14px}.mistake-title{display:flex;align-items:center;gap:8px}.row-actions{display:flex;gap:6px}.practice-shell{max-width:780px;margin:auto}.practice-progress{font-size:12px;color:#919c95;margin-bottom:11px}.practice-question{background:#fff;border:1px solid var(--line);border-radius:14px;padding:24px;margin-bottom:13px}.practice-question h2{font-size:15px;line-height:1.7;margin:12px 0}.practice-answer{min-height:140px}.practice-nav{display:flex;justify-content:space-between;align-items:center}.settings-card{max-width:780px;background:#fff;border:1px solid var(--line);border-radius:13px;padding:22px;margin-bottom:14px}.settings-card h3{font-size:13px;margin:0 0 6px}.settings-card>p{font-size:12px;color:#909a94;line-height:1.7;margin:0 0 17px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.settings-grid .wide{grid-column:1/-1}.api-status{display:flex;align-items:center;gap:8px;font-size:11px;color:#89948d;margin-top:11px}.api-dot{width:7px;height:7px;border-radius:50%;background:#b7c0ba}.api-dot.ok{background:#787878}.api-dot.warn{background:#e1a45c}.empty-state{padding:42px 18px;text-align:center;color:#96a099}.empty-state .empty-icon{margin:0 auto 13px;width:48px;height:48px;border-radius:15px;background:#f2f2f2;color:var(--green);display:grid;place-items:center;font-size:21px}.empty-state strong{display:block;color:#56645b;font-size:13px}.empty-state p{font-size:12px;line-height:1.7;max-width:320px;margin:6px auto 14px}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,15px);padding:10px 15px;border-radius:9px;background:#292929;color:#fff;font-size:12px;opacity:0;pointer-events:none;transition:.2s;z-index:20;box-shadow:var(--shadow)}.toast.show{opacity:1;transform:translate(-50%,0)}.modal-backdrop{position:fixed;inset:0;background:#1c1c1c66;z-index:10;display:grid;place-items:center;padding:20px}.modal{width:min(460px,100%);border-radius:15px;background:white;padding:22px;box-shadow:0 20px 70px #1c1c1c30}.modal h3{margin:0 0 7px;font-size:15px}.modal p{font-size:12px;color:#909a94;line-height:1.7}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.spinner{width:15px;height:15px;border:2px solid #ffffff66;border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.button-disabled{opacity:.6;pointer-events:none}.text-muted{color:#929c96}.notice-bar{padding:10px 12px;background:#fff6e9;color:#98713f;border-radius:8px;font-size:11px;line-height:1.7;margin-bottom:12px}.mobile-menu{display:none}
@media(max-width:1050px){.sidebar{width:215px}.main-area{margin-left:215px;width:calc(100% - 215px)}.page-root{padding:30px}.topbar{padding:0 30px}.hero-art{right:15px;opacity:.8}.hero-card:before{right:0}.home-lower{grid-template-columns:1fr}.page-grid{grid-template-columns:1fr}.grade-side{grid-template-columns:1fr 1fr}.result-shell{grid-template-columns:1fr}.result-image{max-height:420px}}
@media(max-width:680px){.sidebar{width:62px;padding:18px 8px}.brand{margin:0 auto 32px}.brand>span:last-child,.side-label,.nav-item:not(.active) .nav-pill,.nav-item:not(.active) .nav-count,.nav-item{font-size:0}.brand-mark{width:36px;height:36px}.nav-list{gap:7px}.nav-item{justify-content:center;padding:12px 4px;font-size:0}.nav-icon{font-size:19px}.nav-item.active{font-size:0}.nav-pill,.nav-count,.sidebar-bottom .nav-item{display:none}.sidebar-tip{display:none}.profile{justify-content:center;padding-top:13px}.profile>div:not(.avatar),.profile-more{display:none}.main-area{margin-left:62px;width:calc(100% - 62px)}.topbar{height:58px;padding:0 15px}.today-label{display:none}.page-root{padding:24px 15px 40px}.page-heading{align-items:flex-start;gap:12px}.page-heading h1{font-size:21px}.page-heading p{font-size:12px;line-height:1.6}.page-heading>.primary-button{padding:9px;font-size:0}.page-heading>.primary-button span{font-size:14px}.stats-grid{grid-template-columns:1fr 1fr;gap:8px}.stat-card{padding:12px;gap:9px}.stat-note{display:none}.stat-icon{width:31px;height:31px}.stat-copy strong{font-size:18px}.stat-copy span{font-size:11px}.stats-grid .stat-card:last-child{grid-column:1/-1}.hero-card{min-height:224px;padding:22px 20px}.hero-card h2{font-size:21px;max-width:230px;line-height:1.4}.hero-card p{max-width:230px;font-size:12px}.hero-art{right:-53px;top:41px;transform:scale(.78);opacity:.7}.hero-content{z-index:2}.panel{padding:16px}.form-row,.settings-grid{grid-template-columns:1fr}.settings-grid .wide{grid-column:auto}.grade-side{grid-template-columns:1fr}.filter-bar{flex-wrap:wrap}.filter-bar .input{max-width:none;flex-basis:100%}.result-shell{display:flex;flex-direction:column}.question-answer{grid-template-columns:1fr}.top-actions{gap:9px}.breadcrumb{font-size:12px}.profile{border:0}}

.codex-connection{margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}
.codex-heading,.codex-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.codex-heading h3{margin:0}.codex-badge{font-size:13px;border-radius:20px;background:#f2f2f2;padding:4px 10px;color:#454b54}
.codex-actions{margin:14px 0}.codex-notice{white-space:pre-wrap;overflow-wrap:anywhere}.codex-account-label{overflow-wrap:anywhere}
/* Visual refresh: calm paper background, confident ink, brighter study accents. */
:root{--bg:#f5f4f0;--surface:#fff;--ink:#262626;--muted:#7c838b;--line:#e9e7e1;--green:#949494;--green-dark:#7d7d7d;--mint:#f5f5f5;--orange:#eea34a;--red:#d66d61;--shadow:0 8px 24px rgba(37,42,59,.045)}
body{background:var(--bg);color:var(--ink)}
.sidebar{background:#fbfaf7;border-color:#e9e7e1;padding-top:27px}
.brand{font-size:22px;gap:11px;margin-bottom:49px;letter-spacing:-.8px}
.brand small{letter-spacing:.6px;font-size:11px;color:#8b8e98;font-weight:600}
.brand-mark{background:#949494;border-radius:12px;transform:rotate(0)}
.side-label{font-size:12px;color:#a2a3a7;letter-spacing:1px}
.nav-item{font-size:13px;color:#737780;border-radius:9px;padding:12px}
.nav-item.active{background:#f5f5f5;color:#858585}
.nav-icon{font-size:18px}
.sidebar-tip{background:#f2f1ed;border-color:#eae8e2}
.tip-icon{color:#949494}
.topbar{background:rgba(249,248,245,.86);border-color:#e8e6e0;height:70px}
.breadcrumb{font-size:13px}
.page-root{padding-top:42px}
.eyebrow{color:#919191;font-size:12px;letter-spacing:.8px;margin-bottom:8px}
.page-heading h1{font-size:29px;letter-spacing:-1px;font-weight:700}
.page-heading p{font-size:13px;color:#797f87;margin-top:9px}
.primary-button{background:#949494;box-shadow:0 5px 12px #9494941c;padding:11px 16px;font-size:13px;border-radius:8px}
.primary-button:hover{background:#828282}
.secondary-button,.small-button,.subtle-button,.danger-button{font-size:12px;border-radius:8px}
.subtle-button{background:#f5f5f5;color:#8a8a8a}
.stats-grid{gap:14px;margin-bottom:20px}
.stat-card{box-shadow:none;border:1px solid #ebe9e3;border-radius:11px;padding:16px 18px}
.stat-icon{background:#f7f7f7;color:#949494;border-radius:10px}
.stat-icon.pink{background:#fff0ed;color:#d66d61}.stat-icon.orange{background:#fff3e3;color:#d58c39}
.stat-copy span{font-size:12px;color:#787e86}.stat-copy strong{font-size:22px;margin-top:4px}
.stat-note{font-size:12px;color:#a0a1a5}
.hero-card{min-height:239px;padding:30px 32px;border-radius:13px;background:#383838;margin-bottom:23px}
.hero-card:before{border-color:#ffffff14;box-shadow:0 0 0 38px #ffffff08,0 0 0 78px #ffffff05}
.hero-card:after{background:#c2c2c21f}
.hero-kicker{font-size:12px;letter-spacing:.7px;color:#e0e0e0}
.hero-card h2{font-size:27px;line-height:1.4;letter-spacing:-.7px;margin:9px 0 7px}
.hero-card p{font-size:13px;line-height:1.8;color:#d9d9d9;margin-bottom:16px}
.hero-card .primary-button{background:#ffd568;color:#303030;font-weight:700;border-radius:8px;padding:10px 14px;box-shadow:none}
.hero-card .primary-button:hover{background:#ffdf8d}
.hero-art{right:72px;top:32px}
.art-sheet{border-radius:5px;box-shadow:0 14px 30px #21212140;transform:rotate(5deg)}
.art-sheet:before{inset:16px;background:repeating-linear-gradient(to bottom,transparent 0 11px,#ededed 11px 12px)}
.art-check{background:#ffd568;color:#404040;box-shadow:0 6px 18px #26262645}
.art-pencil{background:#ff9b70;box-shadow:inset 0 0 0 2px #ffc1a4}
.home-lower{gap:14px}.panel{box-shadow:none;border-color:#e9e7e1;border-radius:11px;padding:19px 20px}
.panel-head h3{font-size:14px}
.activity-copy strong,.mistake-main strong{font-size:13px}.activity-copy span,.mistake-main span{font-size:12px}
.activity-glyph{background:#f7f7f7;color:#919191}
.text-link{color:#949494;font-size:12px}
.empty-small{font-size:12px}.empty-small strong{font-size:13px}
.tag{font-size:12px}.nav-count{font-size:13px}
.upload-card,.step-card,.settings-card{border-color:#e9e7e1;box-shadow:none;border-radius:11px}
.dropzone{background:#fcfcfc;border-color:#e3e3e3;border-radius:10px}
.dropzone:hover,.dropzone.dragover{border-color:#b2b2b2;background:#fafafa}
.upload-symbol{background:#f5f5f5;color:#949494}
.dropzone h3{font-size:14px}.dropzone p{font-size:12px;color:#858b94}
.field label{font-size:12px}.input,.textarea,.select{font-size:13px;border-color:#e5e4df;border-radius:8px;padding:11px 12px}
.form-hint,.muted,.step-card p,.helper-card .muted{font-size:12px}
.helper-card{background:#f5f5f5;border-color:#ebebeb;border-radius:11px}
.helper-card h4,.step-card h4{font-size:13px}
.helper-step{font-size:12px}.helper-step span{background:#f0f0f0;color:#8a8a8a}
.file-icon{background:#fff0ed}.source-meta strong{font-size:13px}.source-meta small{font-size:12px}
.question-card{border-radius:10px}.question-top strong{font-size:13px}.question-body{font-size:12px}.answer-box,.question-explain{font-size:12px}
.filter-chip{font-size:12px}.mistake-row{padding:15px 2px}.empty-state strong{font-size:13px}.empty-state p{font-size:12px}
.settings-card h3{font-size:14px}.settings-card>p{font-size:12px}
.practice-question h2{font-size:17px}.practice-progress{font-size:12px}
@media(max-width:680px){
  .sidebar{position:fixed;inset:auto 0 0;width:100%;height:69px;padding:6px 8px max(6px,env(safe-area-inset-bottom));background:#fff;border:0;border-top:1px solid #e8e6e0;box-shadow:0 -5px 18px #3030300a;z-index:8;display:block}
  .brand{display:none}.side-label{display:none}.nav-list{height:100%;display:grid;grid-template-columns:repeat(5,1fr);gap:2px;align-items:center}
  .nav-item,.nav-item.active{height:54px;padding:5px 2px;display:flex;flex-direction:column;gap:3px;justify-content:center;background:transparent;color:#8c9098;font-size:12px;font-weight:500;border-radius:9px}
  .nav-item.active{color:#8c8c8c;background:#f7f7f7}.nav-icon{font-size:18px;line-height:1}.nav-pill,.nav-count{display:none}
  .sidebar-bottom{display:none}.main-area{margin:0;width:100%;padding-bottom:72px}
  .topbar{height:57px;padding:0 16px}.breadcrumb{font-size:12px}.top-actions{gap:8px}.page-root{padding:25px 16px 28px}
  .page-heading{align-items:flex-start;gap:9px;margin-bottom:20px}.page-heading h1{font-size:25px}.page-heading p{font-size:12px;line-height:1.7;max-width:275px}.page-heading>.primary-button{font-size:0;padding:9px 11px}.page-heading>.primary-button span{font-size:17px}
  .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:16px}.stats-grid .stat-card:last-child{grid-column:auto}.stat-card{display:block;padding:11px 10px;min-height:89px;border-radius:10px;position:relative}.stat-icon{width:28px;height:28px;margin-bottom:8px;font-size:14px}.stat-copy span{font-size:11px;white-space:nowrap}.stat-copy strong{font-size:19px}.stat-note{display:none}
  .hero-card{min-height:220px;padding:21px 18px;border-radius:12px;margin-bottom:15px}.hero-kicker{font-size:11px}.hero-card h2{font-size:21px;max-width:240px;line-height:1.45}.hero-card p{font-size:12px;max-width:235px;line-height:1.7}.hero-art{right:-49px;top:36px;transform:scale(.72);opacity:.5}.hero-content{z-index:2}
  .home-lower{gap:12px}.panel{padding:15px;border-radius:10px}.panel-head h3{font-size:13px}.activity-copy strong,.mistake-main strong{font-size:12px}.activity-copy span,.mistake-main span{font-size:11px}
  .form-row,.settings-grid{grid-template-columns:1fr}.settings-grid .wide{grid-column:auto}.grade-side{grid-template-columns:1fr}.filter-bar{flex-wrap:wrap}.filter-bar .input{max-width:none;flex-basis:100%}.result-shell{display:flex;flex-direction:column}.question-answer{grid-template-columns:1fr}.profile{border:0}
  .hero-art{display:none}
}

/* Figma desktop workspace refresh */
:root{--bg:#f7f7f7;--surface:#fff;--ink:#1d1d1f;--muted:#6e737d;--line:#ebebeb;--green:#878787;--green-dark:#7a7a7a;--mint:#f7f7f7;--shadow:0 8px 26px rgba(20,24,33,.06);font-family:'DM Sans','Noto Sans SC',sans-serif;color:var(--ink)}
body{background:#fff;color:#1d1d1f}
.app-shell{min-height:100vh}
.sidebar{width:270px;padding:20px 12px 0;background:#f5f5f5;border-color:#ebebeb}
.brand{height:52px;margin:0 4px 16px 8px;gap:12px;font-family:'Noto Serif SC','Noto Serif TC','Songti SC','STSong','SimSun',serif;font-weight:400;font-size:32px;letter-spacing:0;color:#303030}
.brand-mark{width:44px;height:44px;border-radius:0;background:transparent;transform:none;object-fit:contain}
.brand-name{line-height:1.2}
.nav-list{gap:3px;margin:0 0 14px}
.nav-item{height:44px;padding:0 12px;gap:12px;border-radius:9px;color:#555b64;font-size:15px;font-weight:500}
.nav-item:hover{background:#ebebeb;color:#1d1d1f}
.nav-item.active{background:#e9e9e9;color:#1d1d1f;font-weight:600}
.nav-icon{width:20px;height:20px;object-fit:contain;flex:none;color:inherit;font-size:0}
.nav-pill{background:#fff;color:#6e737d;font-size:12px;margin-left:auto}
.nav-count{font-size:13px;color:#777}
.recent-section{min-height:0;flex:1;display:flex;flex-direction:column;border-top:1px solid #e5e5e5;padding:16px 4px 8px;overflow:hidden}
.recent-title{padding:0 9px 8px;font-size:13px;font-weight:600;color:#3b3b3b}
.recent-chats{overflow-y:auto;display:grid;align-content:start;gap:2px}
.recent-empty{padding:12px 9px;color:#969ba1;font-size:13px;margin:0}
.recent-chat{border:0;background:transparent;border-radius:8px;min-height:38px;display:flex;align-items:center;gap:10px;padding:0 10px;text-align:left;font-size:13px;color:#52565d;overflow:hidden}
.recent-chat:hover,.recent-chat.active{background:#ebebeb;color:#1d1d1f}
.recent-chat>span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recent-dot{width:7px;height:7px;border:1px solid #b7bbc0;border-radius:50%;flex:none}
.sidebar-bottom{position:relative;margin:0 -12px;border-top:1px solid #ebebeb;padding:4px 12px 8px}
.profile{width:100%;min-height:52px;padding:6px 8px;border:0;border-radius:8px;background:transparent;display:flex;align-items:center;gap:10px;text-align:left;color:#303030}
.profile:hover{background:#ebebeb}
.profile .avatar{width:30px;height:30px;border-radius:50%;background:#ebebeb;color:#919191;font-size:13px;flex:none}
.profile-copy{min-width:0;flex:1}.profile-copy strong{font-size:13px;font-weight:500}.profile-copy small{display:none}
.profile-more{font-size:17px;color:#7b8086}
.profile-menu{position:absolute;left:12px;right:12px;bottom:62px;padding:6px;background:#fff;border:1px solid #e7e7e7;border-radius:12px;box-shadow:0 10px 32px #1a1a1a1a;z-index:8}
.profile-menu button{width:100%;border:0;border-radius:7px;background:transparent;text-align:left;padding:10px 12px;color:#34383e;font-size:13px}
.profile-menu button:hover{background:#f5f5f5}
.main-area{margin-left:270px;width:calc(100% - 270px);min-width:0;background:#fff}
.topbar{height:72px;padding:0 40px;border:0;background:rgba(255,255,255,.78);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);position:sticky;top:0;z-index:5}
.breadcrumb{font-size:20px;color:#1d1d1f}.breadcrumb strong{font-family:'Noto Serif SC','Noto Serif TC','Songti SC','STSong','SimSun',serif;font-weight:400;color:#1d1d1f}
.top-actions{gap:12px}.new-chat-button{border:1px solid #e6e7e9;border-radius:9px;background:#fff;padding:8px 12px;color:#35383c;font-size:13px;display:inline-flex;gap:7px;align-items:center}.new-chat-button:hover{background:#f5f5f5}.new-chat-button[hidden]{display:none}
.page-root{max-width:none;margin:0;padding:36px 40px 64px}
.page-heading{margin-bottom:26px}.eyebrow{font-size:13px;color:#878787;letter-spacing:.8px}.page-heading h1{font-family:'Noto Serif SC',serif;font-size:30px;font-weight:500;letter-spacing:0}.page-heading p{font-size:14px;color:#6e737d}
.primary-button{background:#878787}.primary-button:hover{background:#7a7a7a}.nav-item:focus-visible,.composer-tool:focus-visible,.send-button:focus-visible,button:focus-visible{outline:2px solid #b5b5b5;outline-offset:2px}
.chat-workspace{min-height:calc(100vh - 72px);display:flex;flex-direction:column;align-items:center;padding:132px 40px 50px;background:#fff}
.welcome-block{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0 0 56px}
.welcome-block h1{display:flex;align-items:center;justify-content:center;gap:18px;margin:0;color:#171717;font:400 44px/1.35 'Noto Serif SC','Noto Serif TC','Songti SC','STSong','SimSun',serif;letter-spacing:.01em}
.welcome-tagline{margin:10px 0 0;color:#777d86;text-align:center;font-size:15px;letter-spacing:.08em}
.welcome-block img{width:48px;height:48px;object-fit:contain;flex:none}
.chat-composer{width:min(860px,100%);min-height:172px;display:flex;flex-direction:column;gap:10px;padding:18px 20px 14px;background:#fff;border:1px solid #e5e6e9;border-radius:28px;box-shadow:0 8px 24px rgba(22,28,40,.045)}
.chat-composer:focus-within{border-color:#d9d9d9;box-shadow:0 8px 26px rgba(22,28,40,.07)}
.chat-composer textarea{display:block;width:100%;min-height:76px;max-height:180px;resize:none;border:0;outline:0;padding:0 2px;background:transparent;color:#1d1d1f;font-size:18px;line-height:1.65}
.chat-composer textarea::placeholder{color:#858990;opacity:1}
.attached-strip{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.attached-strip:empty{display:none}
.attached-photo{position:relative;width:68px;height:68px;border:1px solid #e8e8e8;border-radius:10px;overflow:hidden;background:#f7f7f7}.attached-photo img{width:100%;height:100%;object-fit:cover}.attached-photo button{position:absolute;right:4px;top:4px;border:0;border-radius:50%;width:20px;height:20px;background:#111b;color:#fff;font-size:16px;line-height:1}
.selected-source-chip{display:inline-flex;align-items:center;gap:7px;max-width:250px;height:32px;border:1px solid #e6e6e6;border-radius:9px;background:#fafafa;padding:0 9px;color:#464a50;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chip-stack{font-size:15px;color:#747b83}.chip-remove{font-size:17px;color:#8a8f96}
.composer-footer{width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px}.composer-left,.composer-right{display:flex;align-items:center;gap:8px;min-width:0}.composer-right{gap:10px}.tool-wrap{position:relative;display:flex;align-items:center}
.composer-tool{height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:10px;background:transparent;padding:0 10px;color:#262626;font-size:14px;white-space:nowrap;transition:background .16s}.composer-tool:hover,.composer-tool[aria-expanded=true],.composer-tool.has-selection{background:#f5f5f6}.composer-tool>img{width:20px;height:20px;object-fit:contain}.model-tool{min-width:112px}.chevron{width:7px;height:7px;border-right:1.5px solid #555b61;border-bottom:1.5px solid #555b61;transform:rotate(45deg) translateY(-2px);margin-left:1px}
.composer-context{font-size:12px;color:#8a8f96;margin-left:3px;white-space:nowrap}.send-button{width:40px;height:40px;flex:none;border:1px solid #e6e6e6;border-radius:50%;background:#fff;display:grid;place-items:center;color:#656a70;transition:background .16s,border .16s}.send-button:hover{background:#f7f7f8;border-color:#d9d9d9}.send-button img{width:20px;height:20px;object-fit:contain}.send-button.is-stop{background:#262626;border-color:#262626}.stop-square{width:11px;height:11px;border-radius:2px;background:#fff}
.chat-model-picker{position:relative;min-width:0}.chat-model-trigger{height:42px;max-width:218px;min-width:88px;display:flex;align-items:center;gap:10px;padding:0 10px;border:0;border-radius:11px;background:transparent;color:#242424;text-align:left}.chat-model-trigger:hover,.chat-model-trigger[aria-expanded=true]{background:#f5f5f5}.chat-model-trigger:disabled{opacity:.55}.chat-model-trigger-copy{display:grid;gap:3px;min-width:0}.chat-model-name{max-width:178px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:550}.chat-model-provider{font-size:12px;color:#858b93}.chat-model-menu{position:absolute;right:0;bottom:calc(100% + 10px);z-index:12;width:min(310px,calc(100vw - 36px));max-height:min(440px,65vh);overflow:auto;padding:8px;background:#fff;border:1px solid #e7e8eb;border-radius:15px;box-shadow:0 14px 40px rgba(22,28,40,.16)}.chat-model-menu[hidden]{display:none}.chat-model-group+.chat-model-group{margin-top:8px;padding-top:8px;border-top:1px solid #f0f0f0}.chat-model-group-title{padding:7px 9px 5px;color:#7c828b;font-size:12px;font-weight:550}.chat-model-option{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 10px;border:0;border-radius:9px;background:transparent;color:#242424;text-align:left}.chat-model-option:hover,.chat-model-option.selected{background:#f7f7f7}.chat-model-option>span:first-child{display:grid;gap:3px;min-width:0}.chat-model-option strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:550}.chat-model-option small{color:#878d95;font-size:12px}.chat-model-check{width:18px;flex:none;color:#808080;font-size:14px;text-align:center}.chat-model-empty{margin:0;padding:14px 10px;color:#737982;font-size:13px;line-height:1.7}
.composer-menu{position:absolute;left:0;bottom:calc(100% + 12px);z-index:7;width:280px;padding:8px;background:#fff;border:1px solid #e7e8eb;border-radius:14px;box-shadow:0 14px 40px rgba(22,28,40,.14)}.composer-menu[hidden]{display:none}.photo-menu button,.model-option{width:100%;display:flex;align-items:center;gap:11px;min-height:52px;padding:8px 10px;border:0;border-radius:9px;background:transparent;text-align:left;color:#242424}.photo-menu button:hover,.model-option:hover{background:#f5f5f5}.photo-menu button>span:last-child,.model-option>span:last-child{display:grid;gap:3px}.photo-menu strong,.model-option strong{font-size:13px;font-weight:550}.photo-menu small,.model-option small,.menu-heading span{font-size:12px;color:#80868e}.menu-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:9px;background:#f2f2f2;color:#515761;font-size:18px}.menu-heading{display:flex;align-items:baseline;justify-content:space-between;padding:8px 10px 10px}.menu-heading strong{font-size:13px;font-weight:600}.knowledge-option{min-height:48px;display:flex;align-items:center;gap:9px;padding:7px 9px;border-radius:8px;cursor:pointer}.knowledge-option:hover{background:#f7f7f7}.knowledge-option>input{accent-color:#878787;width:15px;height:15px}.source-mini{font-size:10px;color:#8f8f8f;background:#f7f7f7;border-radius:5px;padding:5px}.knowledge-copy{min-width:0;display:grid;gap:3px}.knowledge-copy strong{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.knowledge-copy small{font-size:12px;color:#858b92}.knowledge-empty{text-align:center;padding:16px 8px;font-size:13px;line-height:1.8;color:#5b6068}.knowledge-empty small{font-size:12px;color:#8a9098}.knowledge-empty .text-link{display:block;margin:8px auto 0;color:#878787;font-size:13px}
.model-option.selected{background:#f7f7f7}.model-check{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;font-size:13px;color:#878787}.prompt-suggestions{width:min(860px,100%);display:grid;gap:12px;margin-top:26px}.prompt-suggestions button{width:max-content;max-width:100%;border:0;background:transparent;padding:0;text-align:left;color:#6e737d;font:400 17px/1.55 'Noto Serif SC','Noto Serif TC','Songti SC','STSong','SimSun',serif}.prompt-suggestions button:hover{color:#25282d}.prompt-suggestions span{padding-left:8px;color:#b8b8b8;font-family:'DM Sans',sans-serif}
.chat-workspace.has-chat{justify-content:flex-end;padding-top:22px;padding-bottom:26px}.chat-history{width:min(860px,100%);flex:1 1 auto;min-height:200px;max-height:calc(100vh - 290px);overflow:auto;margin:0 auto 22px;padding:14px 4px 26px;scroll-behavior:smooth}.chat-message{display:flex;align-items:flex-start;gap:12px;margin:24px 0}.message-avatar{width:30px;height:30px;flex:none;border-radius:50%;background:#f2f2f2;display:grid;place-items:center;color:#51565d;font-size:13px}.from-user .message-avatar{order:2}.from-user .message-body{order:1;margin-left:auto;max-width:min(76%,680px);padding:14px 17px;border-radius:18px;background:#f5f5f5}.from-assistant .message-body{flex:1;min-width:0;padding:2px 0;color:#262626}.message-text{font-size:16px;line-height:1.85;white-space:normal;overflow-wrap:anywhere}.message-photos{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 12px}.message-photos img{max-width:300px;max-height:240px;object-fit:contain;border:1px solid #e8e8e8;border-radius:12px;background:#f7f7f8}.thinking-row{display:flex;align-items:center;gap:10px;color:#777d85;font-size:13px;margin:24px 0 12px 42px}.ink-spinner{border-color:#dbdbdb;border-top-color:#59616c}.chat-history+.chat-composer{flex:none}
.chat-stage{} .camera-modal{width:min(560px,100%);position:relative;border-radius:18px;background:#fff;padding:26px;box-shadow:0 20px 70px #1c1c1c30}.camera-modal h2{margin:0 0 6px;font:500 23px 'Noto Serif SC',serif}.camera-modal>p{margin:0 0 18px;color:#707781;font-size:13px}.camera-view{width:100%;aspect-ratio:4/3;border-radius:12px;background:#1a1a1a;overflow:hidden}.camera-view video{width:100%;height:100%;object-fit:contain}.camera-shutter{display:flex;margin:18px auto 0}.modal-close{position:absolute;right:16px;top:13px;border:0;background:transparent;font-size:24px;color:#737982}.permission-modal{width:min(440px,100%)}.permission-modal h3{font:500 20px 'Noto Serif SC',serif}.permission-modal p{font-size:13px}
.page-heading h1{font-family:'Noto Serif SC','Noto Serif TC','Songti SC','STSong','SimSun',serif;font-weight:500;letter-spacing:0}.page-heading .eyebrow{text-transform:none}
.page-root:has(.chat-workspace){padding:0}
@media(max-width:1050px){.sidebar{width:250px}.main-area{margin-left:250px;width:calc(100% - 250px)}.chat-workspace{padding-left:28px;padding-right:28px}.prompt-suggestions{padding:0 4px}}
@media(max-width:560px){.composer-right{gap:3px}.chat-model-trigger{max-width:148px;gap:6px;padding:0 6px}.chat-model-name{max-width:108px;font-size:13px}.chat-model-provider{font-size:11px}.chat-model-trigger .chevron{width:6px;height:6px}.chat-model-menu{width:min(310px,calc(100vw - 28px))}}
@media(max-width:680px){
 .sidebar{inset:auto 0 0;width:100%;height:70px;padding:5px 8px max(5px,env(safe-area-inset-bottom));background:#fff;border:0;border-top:1px solid #ebebeb;box-shadow:0 -4px 16px #2b2b2b0a;z-index:8;display:block}
 .brand,.recent-section,.profile-menu{display:none!important}.nav-list{height:100%;display:grid;grid-template-columns:repeat(5,1fr);gap:2px;align-items:center;margin:0}.nav-item,.nav-item.active{height:56px;padding:4px 2px;display:flex;flex-direction:column;gap:3px;justify-content:center;background:transparent;color:#7b8087;font-size:12px;font-weight:500;border-radius:9px}.nav-item.active{color:#858585;background:#f7f7f7}.nav-icon{width:18px;height:18px}.nav-pill,.nav-count{display:none}.sidebar-bottom{display:none}.main-area{margin:0;width:100%;padding-bottom:70px}.topbar{height:58px;padding:0 16px}.breadcrumb{font-size:17px}.new-chat-button{padding:7px 9px;font-size:13px}.page-root{padding:24px 16px 32px}.chat-workspace{min-height:calc(100svh - 128px);padding:76px 16px 30px}.welcome-block{margin-bottom:38px}.welcome-block h1{font-size:clamp(27px,7vw,36px);gap:12px}.welcome-block img{width:36px;height:36px}.chat-composer{min-height:160px;padding:16px 14px 12px;border-radius:21px}.chat-composer textarea{font-size:16px;min-height:65px}.composer-footer{align-items:flex-end;gap:4px}.composer-left,.composer-right{gap:3px}.composer-tool{gap:5px;height:36px;padding:0 6px;font-size:13px}.composer-tool>img{width:18px;height:18px}.composer-context{display:none}.model-tool{min-width:0}.send-button{width:38px;height:38px}.prompt-suggestions{gap:11px;margin-top:23px}.prompt-suggestions button{font-size:14px}.chat-workspace.has-chat{min-height:calc(100svh - 128px);padding:8px 12px 16px}.chat-history{max-height:none;min-height:0;margin-bottom:10px;padding:5px 2px 15px}.message-text{font-size:14px}.from-user .message-body{max-width:88%;padding:11px 13px}.composer-menu{width:min(280px,calc(100vw - 35px))}.model-menu{right:0;left:auto}.page-heading{align-items:flex-start;gap:12px}.page-heading h1{font-size:24px}.page-heading p{font-size:13px;line-height:1.7}.page-heading>.primary-button{padding:9px;font-size:0}.page-heading>.primary-button span{font-size:14px}.home-lower{grid-template-columns:1fr}.page-grid{grid-template-columns:1fr}.grade-side{grid-template-columns:1fr}.result-shell{display:flex;flex-direction:column}.question-answer{grid-template-columns:1fr}.camera-modal{padding:22px 16px}.attached-photo{width:58px;height:58px}.selected-source-chip{max-width:145px;font-size:12px}
}
@media(min-width:681px) and (max-height:760px){.chat-workspace{padding-top:48px}.welcome-block{margin-bottom:28px}.chat-composer{min-height:150px}.prompt-suggestions{margin-top:18px;gap:8px}.chat-workspace.has-chat{padding-top:14px}.chat-history{max-height:calc(100vh - 250px)}}

.library-toolbar{display:grid;grid-template-columns:auto minmax(150px,220px) 1fr;align-items:center;gap:10px;padding:0 0 15px;border-bottom:1px solid #ededed;margin-bottom:3px}.library-toolbar label{font-size:13px;font-weight:600;color:#555b64}.library-toolbar small{font-size:12px;color:#8a9098}.source-error{display:block;margin:-5px 0 10px 47px;color:#9b7951;font-size:12px;line-height:1.6}.source-row .source-actions{flex:none}
@media(max-width:680px){.library-toolbar{grid-template-columns:auto 1fr}.library-toolbar small{grid-column:1/-1}.source-row{gap:8px}.source-row .source-actions{flex-wrap:wrap;justify-content:flex-end}.source-error{margin-left:0}}

.question-editor{width:min(850px,95vw);max-height:90vh;overflow:auto}.question-editor .field{margin:12px 0}.question-editor textarea{min-height:70px}.question-editor canvas{max-width:100%;height:auto;touch-action:none;cursor:crosshair}.question-editor #edit-error{color:#b33131}.result-shell figure{margin:12px}.result-shell figcaption{padding:8px}

/* Local PDF page review workspace */
.pdf-workspace{width:min(1200px,96vw);max-height:94vh;overflow:auto;padding:24px}
.pdf-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pdf-heading h3{margin:0 0 8px}.pdf-heading p{font-size:13px;overflow-wrap:anywhere}
.pdf-note{font-size:13px!important;line-height:1.7;color:#737983}.pdf-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}.pdf-controls label{font-size:13px}.pdf-controls input{width:72px;padding:8px;border:1px solid #e3e3e3;border-radius:6px}.pdf-controls button{font-size:13px;padding:9px 12px}.pdf-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.pdf-preview{background:#f2f2f2;min-height:200px;max-height:65vh;overflow:auto;border:1px solid #e3e3e3;padding:8px}.pdf-preview img{display:block;width:100%;height:auto}.pdf-preview img[hidden]{display:none}.pdf-editor{min-width:0}.pdf-editor label{font-size:13px}.pdf-editor textarea{display:block;box-sizing:border-box;margin-top:10px;width:100%;min-height:45vh;padding:14px;resize:vertical;border:1px solid #e3e3e3;border-radius:8px;font-size:14px;line-height:1.8}#pdf-page-status{font-size:13px;color:#757575}
@media(max-width:680px){.pdf-columns{grid-template-columns:1fr}.pdf-workspace{padding:16px}.pdf-preview{max-height:40vh}.pdf-editor textarea{min-height:35vh}}

/* Chat message Markdown and math */
.message-text>*:first-child{margin-top:0}
.message-text>*:last-child{margin-bottom:0}
.message-text p{margin:0 0 .9em}
.message-text h1,.message-text h2,.message-text h3,.message-text h4{line-height:1.45;margin:1.15em 0 .55em;font-weight:700;color:#262626}
.message-text h1{font-size:1.35em}.message-text h2{font-size:1.2em}.message-text h3,.message-text h4{font-size:1.08em}
.message-text ul,.message-text ol{padding-left:1.55em;margin:.45em 0 .9em}
.message-text li{padding-left:.15em;margin:.25em 0}
.message-text blockquote{margin:.8em 0;padding:.1em 0 .1em 1em;border-left:3px solid #e8e8e8;color:#616873}
.message-text a{color:#858585;text-decoration:underline;text-underline-offset:2px}
.message-text code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em;background:#f5f5f5;border-radius:4px;padding:.12em .35em}
.message-text pre{overflow:auto;margin:.7em 0 1em;padding:12px 14px;border-radius:9px;background:#f5f5f5;line-height:1.6}
.message-text pre code{padding:0;background:transparent;font-size:.86em}
.message-text table{display:block;max-width:100%;overflow:auto;border-collapse:collapse;margin:.8em 0}
.message-text th,.message-text td{padding:7px 10px;border:1px solid #e6e6e6;text-align:left}
.message-text th{background:#f7f7f7;font-weight:650}
.message-text hr{border:0;border-top:1px solid #e8e8e8;margin:1.2em 0}
.message-text .math-display{overflow-x:auto;overflow-y:hidden;padding:.25em .1em;margin:.7em 0;text-align:center}
.message-text .katex{font-size:1.04em}
.message-text .katex-display{margin:0}

/* Keep the chat canvas inside the viewport: the transcript scrolls while the
   composer remains at the bottom, like the DeepTutor conversation layout. */
body:has(.chat-workspace){height:100dvh;min-height:0;overflow:hidden}
.app-shell:has(.chat-workspace){height:100dvh;min-height:0}
.main-area:has(.chat-workspace){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.main-area:has(.chat-workspace)>.topbar{flex:none}
.page-root:has(.chat-workspace){height:calc(100dvh - 72px);min-height:0;flex:1 1 auto;overflow:hidden}
.chat-workspace{height:100%;min-height:0}
.chat-workspace.has-chat{justify-content:flex-start;gap:12px;padding:14px 40px 16px}
.chat-history{width:min(920px,100%);min-height:0;max-height:none;flex:1 1 0;margin:0 auto;padding:12px 8px 20px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.chat-composer{width:min(920px,100%);flex:none;margin:0 auto}
.chat-message{gap:14px;margin:18px 0}
.from-assistant .message-body{line-height:1.75}
.message-text{font-size:16px;line-height:1.78;letter-spacing:.005em}
.message-text .katex{font-size:1.08em}
.message-text .katex-display{margin:.95em 0;overflow-x:auto;overflow-y:hidden;text-align:center}
.message-text .katex-display>.katex{white-space:normal}

@media(max-width:680px){
 .main-area:has(.chat-workspace){height:100dvh}
 .page-root:has(.chat-workspace){height:calc(100dvh - 128px);flex:1 1 auto}
 .chat-workspace.has-chat{gap:6px;padding:6px 12px 10px}
 .chat-history{padding:5px 2px 12px;scrollbar-gutter:auto}
 .chat-message{gap:9px;margin:14px 0}
 .message-text{font-size:14px;line-height:1.72}
 .message-text .katex{font-size:1.04em}
 .message-text .katex-display{margin:.7em 0}
}

.chat-composer.drop-active{border-color:#c4c4c4;box-shadow:0 0 0 3px #b5b5b51c,0 8px 26px rgba(22,28,40,.07)}

/* Compact, centered welcome composer and a pinned conversation composer. */
.chat-workspace:not(.has-chat){justify-content:center;gap:0;padding:0 28px clamp(140px,24vh,280px)}
.welcome-block{width:min(780px,100%);margin:0 auto 22px}
.welcome-block h1{gap:13px;font-size:clamp(30px,3vw,40px)}
.welcome-block img{width:42px;height:42px}
.chat-composer{width:min(780px,100%);min-height:132px;gap:8px;padding:14px 16px 12px;border-radius:24px}
.chat-composer textarea{min-height:42px;max-height:160px;padding:1px 2px;font-size:16px;line-height:1.6}
.composer-footer{gap:10px}
.composer-left{gap:10px}
.composer-plus-wrap{position:relative}
.composer-plus{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:50%;background:#f4f5f6;color:#4d535b;font:300 25px/1 'DM Sans',sans-serif;cursor:pointer;transition:background .15s,transform .15s}
.composer-plus:hover,.composer-plus[aria-expanded=true]{background:#ededed}
.composer-plus[aria-expanded=true]{transform:rotate(45deg)}
.composer-context{font-size:13px;color:#858b93}
.unified-menu{left:0;bottom:calc(100% + 12px);width:min(340px,calc(100vw - 32px));max-height:min(540px,calc(100dvh - 150px));overflow-y:auto;overscroll-behavior:contain}
.composer-menu-actions{display:grid;gap:2px}
.composer-menu-actions button{width:100%;display:flex;align-items:center;gap:11px;min-height:54px;padding:8px 10px;border:0;border-radius:9px;background:transparent;text-align:left;color:#242424}
.composer-menu-actions button:hover{background:#f5f5f5}
.composer-menu-actions button>span:last-child{display:grid;gap:3px}
.composer-menu-actions strong{font-size:13px;font-weight:550}
.composer-menu-actions small{font-size:12px;color:#80868e}
.menu-divider{height:1px;background:#f0f0f0;margin:7px 2px}
.unified-menu .menu-heading{padding-top:7px}
.attached-document{height:38px;max-width:min(340px,100%);display:flex;align-items:center;gap:8px;padding:0 7px;border:1px solid #e8e8e8;border-radius:10px;background:#fafafa;color:#4c5159;font-size:13px}
.document-icon,.message-document>span{flex:none;padding:4px 5px;border-radius:5px;background:#f7f7f7;color:#919191;font-size:11px;font-weight:600}
.document-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.save-document-button{flex:none;border:0;background:transparent;padding:4px 0;color:#7a7a7a;font-size:12px;white-space:nowrap;cursor:pointer}
.save-document-button:hover:not(:disabled){color:#858585}
.save-document-button:disabled{color:#8b929c;cursor:default}
.attached-document button{flex:none;width:22px;height:22px;border:0;border-radius:50%;background:transparent;color:#858b93;font-size:17px;cursor:pointer}
.attached-document button:hover{background:#f0f0f0;color:#3b3b3b}
.prompt-suggestions{width:min(780px,100%);display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin-top:16px;padding:0}
.prompt-suggestions button{width:auto;border:1px solid #ebebeb;border-radius:999px;background:#fff;padding:8px 12px;color:#68707a;font:400 13px/1.4 'DM Sans','Noto Sans SC',sans-serif;transition:background .15s,border .15s}
.prompt-suggestions button:hover{background:#fafafa;border-color:#dedede;color:#25282d}
.prompt-suggestions span{padding-left:4px;font-family:inherit}
.chat-workspace.has-chat{justify-content:flex-start;gap:10px;padding:12px 30px 16px}
/* Keep the reading column centered while moving the scroll rail 16px outward. */
.chat-history{width:min(812px,100%);margin:0 auto;padding:8px 21px 18px}
.chat-workspace.has-chat .chat-composer{margin:0 auto 2px}
.message-documents{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.message-document{display:inline-flex;align-items:center;gap:7px;max-width:280px;padding:5px 8px;border:1px solid #e7e8eb;border-radius:8px;background:#fafafa;color:#626871;font-size:12px}
.message-document{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.message-document>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Use Source Han Serif (served as Noto Serif SC) for conversational Chinese. */
.message-text,.chat-composer textarea{font-family:'Noto Serif SC','Source Han Serif SC','Songti SC','STSong',serif}

/* Desktop sidebar collapse rail. */
.sidebar-brand-row{height:48px;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 4px 16px 8px;flex:none}
.sidebar-brand-row .brand{height:48px;min-width:0;flex:1;margin:0;gap:8px}
.sidebar-toggle{width:34px;height:34px;flex:none;display:grid;place-items:center;border:1px solid transparent;border-radius:9px;background:transparent;color:#747982;cursor:pointer;transition:background .16s,border-color .16s,color .16s}
.sidebar-toggle:hover{background:#fff;border-color:#e4e5e8;color:#30343a}
.sidebar-toggle-icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.sidebar-toggle-arrow{transition:transform .2s ease;transform-origin:11.25px 10px}
body.sidebar-collapsed .sidebar{width:80px;padding-right:10px;padding-left:10px;transition:width .2s ease,padding .2s ease}
body.sidebar-collapsed .sidebar-brand-row{justify-content:center;gap:4px;margin:0 0 16px}
body.sidebar-collapsed .sidebar-brand-row .brand{width:26px;flex:none;justify-content:center}
body.sidebar-collapsed .brand-mark{width:26px;height:26px}
body.sidebar-collapsed .brand-name,body.sidebar-collapsed .recent-section,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .nav-count,body.sidebar-collapsed .profile-copy,body.sidebar-collapsed .profile-more{display:none}
body.sidebar-collapsed .sidebar-toggle{width:28px;height:30px}
body.sidebar-collapsed .sidebar-toggle-arrow{transform:rotate(180deg)}
body.sidebar-collapsed .nav-list{gap:5px;margin-bottom:14px}
body.sidebar-collapsed .nav-item{justify-content:center;gap:0;padding:0}
body.sidebar-collapsed .nav-icon{width:20px;height:20px}
body.sidebar-collapsed .sidebar-bottom{margin:0 -10px;padding:4px 10px 8px}
body.sidebar-collapsed .profile{justify-content:center;padding:6px 0}
body.sidebar-collapsed .profile-menu{left:calc(100% + 8px);right:auto;bottom:8px;width:190px}
body.sidebar-collapsed .main-area{margin-left:80px;width:calc(100% - 80px);transition:margin-left .2s ease,width .2s ease}
@media(max-width:680px){
 .sidebar-brand-row{display:none}
 .sidebar-toggle{display:none}
 body.sidebar-collapsed .sidebar{inset:auto 0 0;width:100%;height:70px;padding:5px 8px max(5px,env(safe-area-inset-bottom));}
 body.sidebar-collapsed .main-area{margin:0;width:100%}
}

/* A4 worksheet preview and browser PDF/print output. */
.paper-builder{width:min(100%,1000px);margin:0 auto;padding:24px 24px 48px}
.paper-toolbar{position:sticky;top:12px;z-index:2;margin:0 auto 18px;padding:14px 16px;border:1px solid #e8e8e8;border-radius:14px;background:#ffffffed;backdrop-filter:blur(12px);box-shadow:0 8px 24px #1c1c1c0c}
.paper-toolbar-top{display:flex;align-items:center;gap:14px}
.paper-toolbar-top>div{display:grid;gap:3px;flex:1;min-width:0}.paper-toolbar-top>div strong{font-size:14px;font-weight:600}.paper-toolbar-top>div span{font-size:12px;color:#858b93}
.paper-options{display:flex;align-items:flex-end;gap:16px;margin-top:13px;padding-top:12px;border-top:1px solid #f0f0f0}
.paper-title-field{display:grid;gap:6px;flex:1;max-width:360px;font-size:12px;font-weight:600;color:#5c626b}.paper-title-field .input{font-size:13px}
.paper-answer-toggle{display:inline-flex;align-items:center;gap:7px;padding-bottom:10px;font-size:13px;color:#51565e;white-space:nowrap}.paper-answer-toggle input{accent-color:#878787}
.paper-print-hint{margin-left:auto;padding-bottom:10px;color:#858b93;font-size:12px;text-align:right}
.paper-sheet{width:min(100%,210mm);min-height:260mm;margin:0 auto;padding:17mm 16mm;background:#fff;border:1px solid #e5e6e9;box-shadow:0 10px 35px #1f1f1f10;color:#202124;font-family:'Noto Serif SC','Source Han Serif SC','Songti SC','STSong',serif}
.worksheet-header{text-align:center;padding-bottom:9mm;border-bottom:1px solid #292c30}
.worksheet-kicker{font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:12px;letter-spacing:.12em;color:#717782}
.worksheet-header h1{margin:5mm 0 2mm;font-size:25px;line-height:1.4;font-weight:600;letter-spacing:.04em;color:#1a1a1a}
.worksheet-subtitle{font-size:13px;color:#666c74}
.worksheet-student-meta{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 16px;margin-top:8mm;font-size:12px;color:#3d4147}
.worksheet-instructions{margin:7mm 0 5mm;font-size:12px;color:#555b63}
.paper-question-list{margin:0;padding-left:1.6em}
.paper-question{padding-left:.4em;margin:0 0 6mm;break-inside:avoid;page-break-inside:avoid}
.paper-question::marker{font-family:'DM Sans','Noto Sans SC',sans-serif;font-weight:600;color:#202124}
.paper-question-copy{font-size:13px;line-height:1.85;overflow-wrap:anywhere}
.paper-question-copy>*:first-child{margin-top:0}.paper-question-copy>*:last-child{margin-bottom:0}
.paper-question-copy p{margin:0 0 2mm}.paper-question-copy ul,.paper-question-copy ol{margin:2mm 0;padding-left:1.5em}
.paper-question-copy .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;margin:3mm 0;text-align:center}
.paper-question-copy .katex{font-size:1em}.paper-question-copy .katex-display>.katex{white-space:normal}
.paper-question-copy pre{white-space:pre-wrap}.paper-answer-lines{display:grid;grid-template-rows:repeat(var(--answer-lines,4),7mm);margin-top:2mm}
.paper-answer-lines span{border-bottom:1px solid #d9d9d9}
.paper-image-appendix{break-before:page;page-break-before:always}
.paper-image-appendix h2{margin:0 0 8mm;padding-bottom:3mm;border-bottom:1px solid #30343a;font-size:18px;font-weight:600}
.paper-image-figure{margin:0 0 10mm;text-align:center;break-inside:avoid;page-break-inside:avoid}
.paper-image-figure figcaption{margin-bottom:4mm;font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:12px;color:#59606a}
.paper-image-figure img{display:block;max-width:100%;max-height:230mm;width:auto;height:auto;margin:0 auto;object-fit:contain}
.paper-answer-key{break-before:page;page-break-before:always}
.paper-answer-key.is-hidden{display:none}
.answer-key-header{margin-bottom:8mm}
.paper-answer-item{margin:0 0 8mm;break-inside:avoid;page-break-inside:avoid}
.paper-answer-item h3{margin:0 0 3mm;font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:13px;font-weight:600}
.paper-answer-content,.paper-explanation{font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.paper-answer-content>*:first-child,.paper-explanation>*:first-child{margin-top:0}.paper-answer-content>*:last-child,.paper-explanation>*:last-child{margin-bottom:0}
.paper-explanation{margin-top:3mm;padding:3mm 4mm;border-left:2px solid #d4d4d4;background:#f7f7f7}
.paper-explanation strong{display:block;margin-bottom:1mm;font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:12px;color:#626a74}
.paper-answer-item .katex{font-size:1em}.paper-answer-item .katex-display{margin:.4em 0}
@media(max-width:680px){.paper-builder{padding:14px 10px 28px}.paper-toolbar{top:4px;padding:12px}.paper-toolbar-top{gap:8px}.paper-toolbar-top .secondary-button,.paper-toolbar-top .primary-button{padding:8px;font-size:12px}.paper-options{flex-wrap:wrap;gap:8px 12px}.paper-title-field{max-width:none;flex-basis:100%}.paper-answer-toggle{padding-bottom:0}.paper-print-hint{margin-left:0;padding:0;text-align:left}.paper-sheet{min-height:0;padding:12mm 9mm}}
@page{size:A4 portrait;margin:15mm 16mm}
@media print{
 html,body{width:auto!important;min-height:0!important;height:auto!important;margin:0!important;background:#fff!important}
 body{overflow:visible!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .app-shell{display:block!important;min-height:0!important;height:auto!important}
 .sidebar,.topbar,.paper-toolbar,#toast,#modal-root{display:none!important}
 .main-area{display:block!important;width:auto!important;min-width:0!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important}
 .page-root{display:block!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important}
 .paper-builder{display:block!important;width:auto!important;margin:0!important;padding:0!important}
 .paper-sheet{width:auto!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important}
 .worksheet-header,.worksheet-instructions,.paper-question-list,.paper-image-appendix,.paper-answer-key{break-inside:auto;page-break-inside:auto}
 .paper-question,.paper-image-figure,.paper-answer-item{break-inside:avoid;page-break-inside:avoid}
 .paper-image-appendix,.paper-answer-key{break-before:page;page-break-before:always}
 .paper-answer-key.is-hidden{display:none!important}
 .paper-image-figure img{max-height:235mm}
 .paper-question-copy .katex-display,.paper-answer-item .katex-display{max-width:100%;overflow:visible;font-size:.92em}
 a{color:inherit;text-decoration:none}
}

@media(max-width:680px){
 .chat-workspace:not(.has-chat){justify-content:center;gap:0;padding:0 14px 3vh}
 .welcome-block{margin-bottom:20px}
 .welcome-block h1{gap:10px;font-size:clamp(26px,7vw,34px)}
 .welcome-block img{width:34px;height:34px}
 .chat-composer{min-height:104px;padding:10px 11px 9px;border-radius:20px}
 .chat-composer textarea{min-height:42px;font-size:16px}
 .composer-plus{width:34px;height:34px}
 .composer-context{font-size:12px}
 .unified-menu{left:-2px;width:min(320px,calc(100vw - 28px));max-height:calc(100dvh - 180px)}
 .prompt-suggestions{justify-content:flex-start;gap:7px;margin-top:15px}
 .prompt-suggestions button{padding:7px 10px;font-size:13px}
 .chat-workspace.has-chat{gap:6px;padding:6px 12px 10px}
 .chat-history{padding:5px 2px 12px}
 .chat-workspace.has-chat .chat-composer{margin-bottom:0}
 .attached-document{max-width:100%}
}

/* Task-focused workspaces and persistent actions. */
.sidebar-new-chat{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:10px 14px;margin:0 0 14px;border:1px solid #e3e3e3;border-radius:10px;background:#fff;color:#26282c;font-size:14px;font-weight:600;text-align:left;cursor:pointer}
.sidebar-new-chat>span:first-child{font-size:23px;line-height:1}.sidebar-new-chat:hover{background:#ededed}
body.sidebar-collapsed .new-chat-label{display:none}body.sidebar-collapsed .sidebar-new-chat{justify-content:center;padding:10px}
button:disabled{opacity:.48;cursor:not-allowed;pointer-events:auto}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #d4d4d4;outline-offset:3px}input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #d4d4d4;outline-offset:1px}
.workflow-page,.settings-workspace{max-width:1100px;margin:0 auto;padding-bottom:32px}.workflow-page .page-heading,.settings-workspace .page-heading{margin-bottom:26px;display:block}.workflow-page .page-heading h1,.settings-workspace .page-heading h1{font-size:28px;font-weight:650;letter-spacing:-.5px}.workflow-page .page-heading p,.settings-workspace .page-heading p{font-size:14px;line-height:1.8;color:#737984;margin-top:8px}
.work-card{padding:26px;border:1px solid #e8e8e8;border-radius:16px;background:#fff;box-shadow:0 3px 16px #2b2b2b03}.card-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.card-title h2,.library-upload h2{font-size:17px;line-height:1.5;font-weight:650;margin:0;color:#292929}.card-title>span,.quiet-copy{font-size:13px;color:#7a808a;line-height:1.7}.workflow-page .field label,.settings-workspace .field label{font-size:13px;font-weight:550;color:#4f4f4f;margin-bottom:8px}.workflow-page .input,.workflow-page .select,.settings-workspace .input,.settings-workspace .select{min-height:44px;padding:10px 12px;font-size:14px;border-radius:9px;border:1px solid #e3e3e3;background:#fff;box-sizing:border-box;width:100%}.workflow-page .textarea{font-size:14px;line-height:1.7;min-height:90px;padding:12px}.workflow-page .field small,.grade-submit small{font-size:13px;color:#838994;line-height:1.7}.workflow-page .primary-button,.settings-workspace .primary-button{font-size:14px;padding:11px 18px;border-radius:9px;background:#292929;color:#fff;border:1px solid #292929}.workflow-page .secondary-button,.settings-workspace .secondary-button{font-size:13px;padding:10px 16px;border-radius:9px;background:#fff;border:1px solid #e3e3e3;color:#3d3d3d}.workflow-page .small-button{font-size:13px;padding:7px 11px;border-radius:7px}.workflow-page .empty-state{padding:48px 20px}.workflow-page .empty-state strong{font-size:17px}.workflow-page .empty-state p{font-size:13px}.workflow-page .empty-state .secondary-button{margin-top:14px}
.workflow-steps{display:flex;gap:28px;align-items:center;margin-bottom:24px;padding-bottom:18px;border-bottom:1px solid #f0f0f0;color:#969ca5;font-size:13px}.workflow-steps .active{color:#404040;font-weight:600}
.grade-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr);gap:24px;align-items:start}.plain-fieldset{border:0;padding:0;margin:0;min-width:0}.grade-options .field{margin-bottom:20px}.grade-drop{min-height:245px;border:1.5px dashed #d9d9d9;background:#fafafa;border-radius:12px;display:grid;place-items:center;cursor:pointer;text-align:center;transition:background .15s,border-color .15s}.grade-drop h3{font-size:18px;margin:10px 0 6px}.grade-drop p{font-size:13px;line-height:1.7;color:#848a94;margin:0 0 18px}.upload-symbol{display:inline-grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#f2f2f2;color:#6e6e6e;font-size:24px}.grade-drop.dragover,.library-drop.dragover{background:#f5f5f5;border-color:#949494}.grade-drop.has-photos{min-height:140px}.grade-drop.has-photos .upload-symbol,.grade-drop.has-photos h3{display:none}.grade-preview{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-top:16px}.photo-tile{border:1px solid #e8e8e8;border-radius:10px;overflow:hidden;background:#fafafa}.photo-tile>img{display:block;object-fit:contain;width:100%;height:150px;background:#f2f2f2}.photo-tile>div{display:flex;align-items:center;padding:8px;gap:4px}.photo-tile span{font-size:13px;margin-right:auto;color:#666d78}.photo-tile button{border:0;background:#fff;border-radius:5px;padding:4px 6px;color:#555;cursor:pointer}.advanced-options{border-top:1px solid #eee;padding-top:16px}.advanced-options summary{font-size:13px;cursor:pointer;color:#676f7c;margin-bottom:18px}.grade-submit{border-top:1px solid #eee;padding-top:18px}.grade-submit .primary-button{width:100%;margin:6px 0 12px}.inline-error{font-size:13px;line-height:1.65;color:#b2443e!important}.recent-grades{margin-top:24px}.history-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 0;width:100%;border:0;border-top:1px solid #f2f2f2;background:transparent;text-align:left;color:#6b7280;cursor:pointer;font-size:13px}.history-row strong{display:block;font-size:14px;color:#3d3d3d;font-weight:550}.history-row small{display:block;font-size:13px;margin-top:5px;color:#9298a1}.history-row:hover{background:#fafafa}
.library-upload{margin-bottom:24px}.library-upload-copy{display:flex;align-items:center;gap:16px}.library-upload-copy>div{flex:1}.library-upload-copy p{font-size:13px;line-height:1.7;color:#838a95;margin:4px 0 0}.library-drop{border:1.5px dashed #e0e0e0;border-radius:10px;text-align:center;padding:22px;margin:22px 0 16px;font-size:13px;color:#8a919b;background:#fcfcfc}.library-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;border:0;padding:0;margin:0}.library-toolbar label{font-size:13px;color:#626b76}.library-toolbar .select{width:250px}.library-toolbar small{font-size:13px;color:#7d8490}.count-badge{font-size:13px;font-weight:500;background:#f2f2f2;color:#777f8a;border-radius:6px;padding:3px 7px;margin-left:6px}.document-filters{display:flex;gap:12px;margin-bottom:12px}.document-filters .input{flex:1}.document-filters .select{width:140px}.document-row{padding:20px 0;border-top:1px solid #f0f0f0}.document-main{display:flex;align-items:center;gap:14px}.document-main>div{flex:1;min-width:0}.document-main .file-icon{width:40px;height:48px;border-radius:8px;background:#f5f0eb;color:#9b735b;font-size:12px;display:grid;place-items:center;flex:none}.document-title{display:block;border:0;padding:0;background:none;color:#383838;font-weight:550;font-size:14px;text-align:left;overflow-wrap:anywhere;cursor:pointer}.document-title:hover{text-decoration:underline}.document-main p{font-size:13px;color:#89909b;margin:5px 0 0}.document-main .tag{font-size:12px;white-space:nowrap}.document-warning{font-size:13px;color:#a46c31;line-height:1.7;padding:10px 12px;background:#fff9ef;border-radius:8px;margin:12px 0 0}.document-actions{display:flex;gap:8px;margin-top:14px;padding-left:54px;align-items:center}.document-more{position:relative;margin-left:auto;font-size:13px}.document-more summary{cursor:pointer;color:#818895;list-style:none;padding:7px 9px}.document-more>div{position:absolute;right:0;top:100%;z-index:5;background:#fff;border:1px solid #e8e8e8;border-radius:10px;padding:5px;box-shadow:0 10px 30px #26262616;width:155px}.document-more button{width:100%;border:0;background:none;text-align:left;font-size:13px;padding:10px;cursor:pointer;border-radius:6px}.document-more button:hover{background:#f5f5f5}.danger-text{color:#b44a48}.source-preview{width:min(800px,94vw);max-height:85vh;display:flex;flex-direction:column;padding:26px}.source-preview-body{overflow:auto;white-space:pre-wrap;line-height:1.9;font-size:14px;color:#4c4c4c}.source-preview-body p{font-size:14px;color:inherit;padding:14px 0;border-top:1px solid #f0f0f0}.source-preview .card-title{margin-bottom:4px}
.settings-workspace{max-width:860px}.settings-sections{display:flex;gap:6px;margin:0 0 24px;flex-wrap:wrap}.settings-sections a{padding:9px 14px;background:#f7f7f7;border-radius:8px;color:#636363;text-decoration:none;font-size:13px}.settings-sections a:hover{background:#ededed}.settings-workspace .settings-card{max-width:none;border:1px solid #e8e8e8;border-radius:14px;padding:26px;margin-bottom:20px;scroll-margin-top:85px;box-shadow:none}.settings-workspace .settings-card h3{font-size:17px;color:#383838;margin:0 0 8px}.settings-workspace .settings-card>p{font-size:13px;line-height:1.8;color:#7a828f;margin-bottom:22px}.settings-workspace .settings-grid{gap:20px}.settings-workspace .api-status{font-size:13px;line-height:1.7;margin-top:18px;align-items:flex-start}.settings-workspace .text-link{font-size:13px}.reveal-key{margin:6px 0 0;align-self:flex-end}.settings-workspace .form-hint{font-size:13px;line-height:1.8;margin-top:6px}.settings-savebar{position:sticky;bottom:16px;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid #e6e6e6;background:#fffffff5;backdrop-filter:blur(14px);border-radius:13px;padding:14px 18px;box-shadow:0 6px 30px #26262612;margin-top:24px}.settings-savebar>span{font-size:13px;line-height:1.6}.settings-savebar>div{display:flex;gap:8px;flex:none}.unsaved-status{color:#a67530}.saved-status{color:#757575}.settings-workspace .danger-button{font-size:13px;padding:10px 14px;margin-top:10px;border-radius:9px}
@media(max-width:900px){.grade-layout{grid-template-columns:1fr}.grade-options{max-width:none}.workflow-page,.settings-workspace{width:100%}.work-card{padding:20px}.library-upload-copy{flex-wrap:wrap}}
@media(max-width:680px){.sidebar-new-chat{display:none}.topbar{display:flex!important}.workflow-page .page-heading h1,.settings-workspace .page-heading h1{font-size:24px}.workflow-page .page-heading p,.settings-workspace .page-heading p{font-size:13px}.workflow-steps{gap:12px;font-size:12px;justify-content:space-between}.work-card,.settings-workspace .settings-card{padding:18px;border-radius:12px}.document-main{gap:10px}.document-main .tag{font-size:12px}.document-actions{padding-left:0}.library-upload-copy>button{width:100%}.library-upload-copy>.upload-symbol{display:none}.library-toolbar .select{width:100%}.settings-savebar{bottom:78px;flex-wrap:wrap;padding:12px}.settings-savebar>div{width:100%}.settings-savebar button{flex:1}.settings-workspace .settings-grid{grid-template-columns:1fr}.source-preview{padding:18px}.source-preview .card-title h2{font-size:16px}.grade-submit small{display:block}.new-chat-button{font-size:13px}.settings-sections{gap:5px}.settings-sections a{padding:8px 10px}.document-main .file-icon{width:32px;height:40px}}

/* Subject notebooks, opt-in collection, and model question cards. */
[hidden]{display:none!important}
.notebook-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.notebook-heading>.secondary-button{white-space:nowrap;margin-top:4px}.notebook-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:24px;align-items:start}.notebook-rail{padding:10px 0;position:sticky;top:90px}.notebook-subject,.notebook-book{width:100%;display:flex;justify-content:space-between;gap:10px;align-items:center;background:none;border:0;border-radius:9px;padding:11px 12px;text-align:left;color:#68717e;font-size:13px;cursor:pointer}.notebook-subject>span:first-child,.notebook-book>span:first-child{overflow-wrap:anywhere}.notebook-subject>span:last-child,.notebook-book>span:last-child{font-size:12px;color:#9198a3}.notebook-subject:hover,.notebook-book:hover{background:#f5f5f5}.notebook-subject.active,.notebook-book.active{background:#f0f0f0;color:#3b3b3b;font-weight:600}.notebook-book{font-size:13px;padding-left:15px}.rail-divider{height:1px;background:#ededed;margin:17px 10px}.rail-label{font-size:12px;color:#a0a7b0;padding:0 12px 9px}.notebook-rail>.text-link{margin:16px 12px;font-size:13px}.notebook-rail>.quiet-copy{padding:0 12px}.notebook-content{padding:24px;min-width:0}.notebook-filters{display:grid;grid-template-columns:minmax(0,1fr) 120px 120px;gap:10px}.notebook-filters .input,.notebook-filters .select{min-width:0;font-size:13px}.notebook-selection{display:flex;align-items:center;gap:16px;margin:20px 0 4px;color:#88909c;font-size:13px}.notebook-selection label{display:flex;gap:7px;align-items:center}.notebook-selection button{margin-left:auto;font-size:13px}.notebook-question{display:flex;align-items:flex-start;gap:14px;padding:22px 0;border-top:1px solid #f0f0f0}.notebook-question.selected{background:#fafafa}.notebook-check{padding-top:4px}.notebook-question-body{min-width:0;flex:1}.notebook-question-meta{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-bottom:10px;color:#9097a2;font-size:12px}.notebook-question-meta .tag{font-size:12px}.notebook-question-title{display:block;background:none;border:0;padding:0;font-size:14px;line-height:1.9;text-align:left;color:#404040;cursor:pointer;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.notebook-question-title:hover{color:#7a7a7a}.notebook-tags{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:12px 0}.notebook-tags button,.notebook-tags>span{background:#f5f5f5;border:0;border-radius:5px;color:#8a8a8a;font-size:12px;padding:4px 7px;cursor:pointer}.notebook-tags small{font-size:12px;color:#a2a9b2;margin-left:auto}.notebook-question-actions{display:flex;gap:6px;flex-wrap:wrap}.notebook-question-actions .small-button{font-size:12px;padding:6px 9px}.notebook-batch{position:sticky;bottom:16px;display:flex;gap:12px;align-items:center;justify-content:space-between;background:#fffffff5;backdrop-filter:blur(10px);border-top:1px solid #ebebeb;margin:6px -8px -10px;padding:16px 8px 6px;z-index:3;font-size:13px;color:#79828f}.notebook-batch>div{display:flex;gap:7px;flex-wrap:wrap}.notebook-batch .primary-button,.notebook-batch .secondary-button{font-size:13px;padding:9px 12px}.notebook-content .empty-state .secondary-button{margin-top:15px}
.grading-question-content{font-size:14px;color:#545454;line-height:1.85;padding:12px 0}.grading-question-content p{font-size:14px!important;line-height:1.85!important;color:inherit!important}.grading-explanation{padding:16px;margin:14px 0;background:#fafafa;border-radius:8px}

.intelligent-card{width:min(620px,95vw);max-height:90dvh;padding:28px;overflow-y:auto}.intelligent-card h2{margin:8px 0 12px;font-size:22px;color:#404040;line-height:1.5}.intelligent-card .quiet-copy{font-size:13px;color:#999999;line-height:1.8}.intelligent-card .field{margin:20px 0}.intelligent-card label,.intelligent-card legend{font-size:13px;color:#737373}.intelligent-card .input,.intelligent-card .select{width:100%;min-height:43px;border:1px solid #e3e3e3;border-radius:8px;padding:10px 12px;font-size:14px;background:#fff;box-sizing:border-box}.intelligent-card .input+.input,.intelligent-card .select+.input{margin-top:10px}.card-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#9c9c9c;font-size:12px;letter-spacing:.02em}.card-eyebrow button{margin-left:auto}.card-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:22px;padding-top:16px;border-top:1px solid #f2f2f2}.tag-picker{border:0;padding:0;margin:24px 0;display:flex;gap:8px;flex-wrap:wrap}.tag-picker legend{margin-bottom:12px}.tag-picker>label{cursor:pointer;display:inline-flex;position:relative}.tag-picker>label input{position:absolute;opacity:0;width:1px;height:1px}.tag-picker>label span{font-size:13px;border:1px solid #e6e6e6;padding:7px 11px;border-radius:20px;background:#fff;color:#999999}.tag-picker>label input:checked+span{color:#757575;background:#f5f5f5;border-color:#c2c2c2}.tag-picker>label input:focus-visible+span{outline:2px solid #a6a6a6}.tag-picker>.input{margin-top:8px}.mistake-detail-scroll{max-height:55dvh;overflow-y:auto;padding-right:6px}.intelligent-card .answer-box{font-size:13px}.intelligent-card .answer-box b{font-size:13px;margin-bottom:10px}
@media(max-width:1000px){.notebook-layout{grid-template-columns:170px minmax(0,1fr);gap:16px}.notebook-filters{grid-template-columns:minmax(0,1fr) 110px}.notebook-filters .input{grid-column:1/-1}.notebook-batch{flex-direction:column;align-items:flex-start}.notebook-content{padding:18px}}
@media(max-width:680px){.notebook-heading{flex-direction:column;gap:0;margin-bottom:20px}.notebook-heading .page-heading{margin-bottom:10px}.notebook-heading>.secondary-button{font-size:13px}.notebook-layout{display:block}.notebook-rail{position:static;display:flex;gap:5px;flex-wrap:wrap;margin-bottom:18px}.notebook-rail>.quiet-copy,.notebook-rail .rail-divider,.notebook-rail .rail-label,.notebook-rail>.text-link{display:none}.notebook-subject,.notebook-book{width:auto;padding:8px 10px;font-size:13px;border:1px solid #ebebeb;border-radius:20px;gap:7px}.notebook-book{font-size:12px}.notebook-content{padding:16px}.notebook-question{gap:9px}.notebook-question-meta{font-size:12px}.notebook-question-title{font-size:13px}.notebook-tags small{margin-left:0}.notebook-batch{bottom:72px;gap:10px;background:#fff;border-radius:10px;box-shadow:0 -6px 15px #36363608;padding-bottom:12px}.notebook-batch>div{width:100%;display:flex;gap:5px}.notebook-batch button{font-size:12px!important;flex:1;padding:9px 7px!important}.grading-review{padding:15px 12px;border-radius:12px}.score-badge{font-size:12px;padding:5px 9px}.grading-summary{gap:6px;margin-bottom:16px}.grading-evidence{font-size:13px;margin-bottom:16px}.grading-review-toolbar strong{font-size:13px}.grading-review .primary-button,.grading-review .secondary-button{font-size:12px;padding:8px 10px}.grading-table{font-size:13px}.grading-table td,.grading-table th{padding:12px 7px}.grading-table td{min-width:55px}.grading-table td p{font-size:13px}.grading-table .tag{font-size:12px;padding:4px 7px}.grading-table td:nth-last-child(1){min-width:60px}.grading-detail-row>td{padding:0 7px!important}.grading-explanation{padding:12px}.grading-review .collection-mode-hint{font-size:12px}.intelligent-card{padding:22px;max-height:86dvh}.intelligent-card h2{font-size:19px}.ask-user-card{padding:17px 14px}.ask-question-pane legend{font-size:15px}.ask-option{padding:11px;gap:9px}.ask-user-card .card-actions{gap:7px;flex-wrap:wrap}.ask-user-card .card-actions button{font-size:13px;padding:9px 12px}.notebook-content .card-title{gap:8px}}
@media print{.notebook-batch,.ask-user-card,.grading-review{display:none!important}}

/* Focused exam review: one score summary, navigable question map, and one detail view. */
/* Focused grading result workspace */
.result-page{--bg:#f5f5f5;--surface:#FFFFFF;--ink:#262626;--muted:#86868B;--line:#E5E5E7;--selected:#343434;--green:#696969;--red:#A6534D;--control:#F2F2F4;background:var(--bg);width:100%;max-width:none;margin:0 auto;padding:26px 40px 48px;color:var(--ink)}
.main-area:has(.result-page),.page-root:has(.result-page){background:#f5f5f5}
.page-root:has(.result-page){padding:0}
.workflow-page.result-page .page-heading.result-page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 30px}
.result-heading-title{display:flex;align-items:center;gap:12px}
.result-heading-title h1{margin:0;color:var(--ink);font-family:'DM Sans','Noto Sans SC',sans-serif;font-size:25px;font-weight:600;letter-spacing:-.3px}
.result-page-heading>div>p{margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.6}
.result-page-heading>div>p strong{color:var(--ink);font-weight:550}
.result-completed{display:inline-flex;align-items:center;padding:4px 8px;border:1px solid var(--line);border-radius:7px;background:var(--control);color:var(--muted);font-size:12px;font-weight:500}
.result-page .secondary-button,.result-page .primary-button{font-size:13px;padding:10px 14px;border-radius:9px}
.result-page .primary-button{background:var(--green);color:var(--surface);box-shadow:none}
.result-page .primary-button:hover{background:var(--green);filter:brightness(.92);transform:none}
.result-page .secondary-button{background:var(--surface);border-color:var(--line);color:var(--ink)}
.result-page .secondary-button:hover{background:var(--control)}
.result-page .text-link{color:var(--ink)}
.result-page button:focus-visible{outline:2px solid var(--selected);outline-offset:2px}
.result-page .primary-button:active{filter:brightness(.85)}
.result-summary-card{display:grid;grid-template-columns:auto minmax(100px,1fr);align-items:center;gap:24px;margin:0 0 20px;padding:17px 20px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.result-summary-copy{display:grid;grid-template-columns:auto auto;align-items:baseline;column-gap:12px;row-gap:3px}
.result-summary-copy>span{color:var(--muted);font-size:13px}
.result-summary-copy>strong{color:var(--ink);font-size:34px;font-weight:600;line-height:1.1;letter-spacing:-1px}
.result-summary-copy>small{grid-column:2;color:var(--muted);font-size:13px}
.result-summary-track{height:4px;overflow:hidden;border-radius:99px;background:var(--control)}
.result-summary-track>span{display:block;height:100%;border-radius:inherit;background:var(--green)}
.grading-summary-row{display:flex;align-items:baseline;gap:14px;margin:0 0 34px;padding:0;border:0;background:transparent}
.grading-summary-row>span{color:var(--muted);font-size:13px}
.grading-summary-row>strong{display:flex;align-items:baseline;gap:9px;color:var(--ink);font-size:42px;font-weight:600;line-height:1.15;letter-spacing:-1.5px}
.grading-summary-row>strong b{font-weight:600}
.grading-summary-row>strong small{color:var(--muted);font-size:24px;font-weight:450;letter-spacing:-.3px}
.result-workspace{display:grid;grid-template-columns:minmax(245px,270px) minmax(0,1fr);gap:18px;align-items:start}
.result-page .work-card{padding:20px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:none}
.question-map-card{position:sticky;top:24px}
.result-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 17px}
.result-card-heading h2{margin:0;color:var(--ink);font-size:15px;font-weight:600}
.result-card-heading>span{color:var(--muted);font-size:13px}
.question-map-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:min(58vh,560px);overflow:auto;align-content:start;overscroll-behavior:contain;padding:1px}
/* Result markers and selection are independent: an inset line never colors the border. */
.question-map-item{--status-marker:inset 0 0 0 transparent;display:flex;min-width:0;min-height:42px;align-items:center;justify-content:center;padding:6px 4px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);box-shadow:var(--status-marker);transition:border-color .14s,background-color .14s,box-shadow .14s}
.question-map-item.correct{--status-marker:inset 0 -3px 0 var(--green)}
.question-map-item.partial{--status-marker:inset 2px 0 0 var(--muted)}
.question-map-item.incorrect{--status-marker:inset 0 -3px 0 var(--red)}
.question-map-item.pending{--status-marker:inset 0 0 0 transparent}
.question-map-item:hover{background:var(--control)}
.question-map-item.selected{border-color:var(--selected);box-shadow:inset 0 0 0 1px var(--selected),var(--status-marker);background:var(--surface)}
.question-map-item:active{background:var(--control)}
.question-map-item:focus-visible{outline:2px solid var(--selected);outline-offset:2px}
.question-map-number{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:550}
.question-map-legend{display:flex;flex-wrap:wrap;gap:13px;margin-top:17px;padding-top:13px;border-top:1px solid var(--line)}
.question-map-legend span{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px}
.question-map-legend i{width:9px;height:9px;border-radius:3px}
.question-map-legend i.correct{background:var(--green)}.question-map-legend i.partial{background:var(--muted)}.question-map-legend i.incorrect{background:var(--red)}
.question-map-legend i.pending{background:var(--line)}
.result-bulk-action{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:15px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:12px}
.result-bulk-action .text-link{flex:none;font-size:12px}.result-bulk-action button:disabled{color:var(--muted);cursor:default}
.result-question-detail{min-width:0;padding:26px 30px!important}
.result-detail-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-bottom:17px;border-bottom:1px solid var(--line)}
.result-detail-heading h2{margin:0;color:var(--ink);font-size:20px;line-height:1.45;font-weight:600}
.result-detail-heading h2 small{color:var(--muted);font-size:14px;font-weight:450}
.result-detail-meta{display:flex;flex:none;align-items:center;gap:12px}
.result-detail-meta>small{color:var(--muted);font-size:13px;white-space:nowrap}
.result-status-pill{display:inline-flex;align-items:center;padding:5px 8px;border:1px solid transparent;border-radius:7px;font-size:12px;font-weight:550;white-space:nowrap}
.result-status-pill.correct{background:var(--control);color:var(--green)}.result-status-pill.partial{background:var(--control);color:var(--muted)}.result-status-pill.incorrect{background:var(--control);color:var(--red)}
.result-status-pill.pending{background:var(--control);color:var(--muted)}
.accuracy-summary>strong{gap:12px}
.grading-summary-row.accuracy-summary>strong small{color:var(--muted);font-size:15px;font-weight:450;letter-spacing:0}
.result-question-stem{padding:22px 0 20px;border-bottom:1px solid var(--line)}
.result-question-stem .result-markdown{font-size:16px;line-height:1.85}
.result-question-stem .result-markdown p{margin-bottom:13px}
.result-question-stem .result-markdown p:last-child{margin-bottom:0}
.result-question-stem .result-markdown ul,.result-question-stem .result-markdown ol{padding-left:1.5em;margin:10px 0}
.result-question-stem .result-markdown li{padding-left:3px;margin:5px 0}
.result-question-stem .result-markdown table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse}
.result-question-stem .result-markdown th,.result-question-stem .result-markdown td{padding:7px 10px;border:1px solid var(--line);text-align:left}
.result-question-stem .result-choice-list{--choice-marker-width:30px;display:grid;grid-template-columns:minmax(0,1fr);gap:10px;list-style:none;margin:18px 0 0;padding:0}
.result-question-stem .result-choice-list-wide{--choice-marker-width:48px}
.result-question-stem .result-choice-option{display:grid;grid-template-columns:var(--choice-marker-width) minmax(0,1fr);align-items:baseline;gap:8px;margin:0;padding:3px 0}
.result-choice-marker{color:var(--ink);font-size:15px;font-weight:550;line-height:1.85;white-space:nowrap}
.result-choice-content{min-width:0}
.result-question-stem .result-choice-content p{margin:0 0 8px}
.result-question-stem .result-choice-content p:last-child{margin-bottom:0}
.result-choice-content>:first-child{margin-top:0}
.result-choice-content pre,.result-choice-content .katex-display{max-width:100%;overflow-x:auto}
@media(max-width:560px){.result-question-stem .result-choice-list{--choice-marker-width:26px;gap:9px;margin-top:16px}.result-question-stem .result-choice-list-wide{--choice-marker-width:44px}.result-question-stem .result-choice-option{gap:7px}.result-choice-marker{font-size:14px}}
.result-completion-tools{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px;margin-top:15px}
.result-completion-tools .text-link{padding:0;font-size:13px;font-weight:500;text-align:left}
.result-completion-tools button:disabled{color:var(--muted);cursor:wait}
.result-completion-status{color:var(--muted);font-size:12px;line-height:1.7}
.result-question-provenance{margin-top:16px;color:var(--muted);font-size:13px;line-height:1.7}
.result-question-provenance summary{cursor:pointer;outline-offset:4px}
.result-question-provenance>section{margin:13px 0;padding-left:12px;border-left:2px solid var(--line)}
.result-question-provenance h3{margin:0 0 6px;font-size:12px;font-weight:550;color:var(--muted)}
.result-question-stem .result-question-provenance .result-markdown{font-size:13px;line-height:1.8}
.result-question-provenance blockquote{margin:0}
.result-markdown{min-width:0;color:var(--ink);font-size:15px;line-height:1.85;overflow-wrap:anywhere}
.result-markdown p{margin:0 0 10px}.result-markdown p:last-child{margin-bottom:0}
.result-markdown pre{overflow:auto;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--control)}
.result-markdown .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden}
.result-question-image{margin:22px 0 0;padding:14px 0 0;border-top:1px solid var(--line);text-align:center}
.result-question-image figcaption{margin-bottom:9px;color:var(--muted);font-size:12px;text-align:left}
.result-image-preview{display:grid;width:100%;min-height:220px;max-height:260px;place-items:center;overflow:hidden;padding:0;border:1px solid var(--line);border-radius:9px;background:var(--control);cursor:zoom-in}
.result-image-preview:hover{background:#ececef}
.result-image-preview img{display:block;width:auto;max-width:100%;height:auto;max-height:258px;object-fit:contain;border:0;border-radius:8px;background:#fff}
.result-image-preview:focus-visible{outline:2px solid #777;outline-offset:3px}
.result-answer-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px 0}
.result-answer-grid>section{min-width:0;padding:14px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
.result-answer-grid h3,.result-feedback h3{margin:0 0 8px;color:var(--muted);font-size:13px;font-weight:550}
.result-answer-grid .result-markdown{font-size:14px;line-height:1.75}
.result-feedback{margin:0;padding:4px 0 4px 14px;border:0;border-left:2px solid var(--line);border-radius:0;background:transparent}
.result-feedback .result-markdown{font-size:14px;line-height:1.85}
.result-feedback-empty{margin:0;color:var(--muted);font-size:13px;line-height:1.7}
.result-question-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:23px;padding-top:18px;border-top:1px solid var(--line)}
.result-question-actions .result-collect-button{min-height:40px}
.result-collect-button{display:inline-flex;align-items:center;gap:7px;border-radius:9px}
.result-page .collected-button{display:inline-flex;align-items:center;gap:7px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--control);color:var(--muted);font-size:13px;font-weight:550}
.result-question-actions .result-edit-question{padding:8px 4px;color:var(--muted);font-size:13px}
.result-question-actions .result-tutor-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;margin-left:auto;padding:10px 15px;border:1px solid var(--green);border-radius:9px;background:var(--green);color:#fff;font-size:13px;font-weight:550}
.result-question-actions .result-tutor-open:hover{background:var(--green);filter:brightness(.92)}
.result-empty,.result-no-question{padding:24px;color:var(--muted);font-size:13px}
.result-image-backdrop{background:rgba(20,20,20,.72)}
.result-image-modal{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:max-content;max-width:94vw;max-height:92vh;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.result-image-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:2px 38px 2px 2px;color:var(--muted);font-size:13px}
.result-image-toolbar>div{display:flex;gap:6px}
.result-image-toolbar button{width:32px;height:30px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font-size:16px;line-height:1}
.result-image-toolbar .modal-close{position:absolute;top:15px;right:12px;z-index:1;width:30px;height:30px;border:0;background:transparent;font-size:22px;color:var(--muted)}
.result-image-stage{display:grid;max-width:90vw;max-height:78vh;place-items:center;overflow:auto;background:var(--control)}
.result-image-stage img{display:block;max-width:88vw;max-height:76vh;object-fit:contain;transform:scale(1);transform-origin:center;transition:transform .15s ease}
.result-image-navigation{display:flex;justify-content:space-between;gap:8px}
.result-image-navigation button:disabled{opacity:.45;cursor:default}
@media(max-width:1050px){.result-page{padding:24px}.result-workspace{grid-template-columns:minmax(230px,250px) minmax(0,1fr);gap:16px}.result-question-detail{padding:24px!important}}
@media(max-width:820px){.result-workspace{grid-template-columns:minmax(0,1fr)}.question-map-card{position:static}.question-map-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.result-question-detail{padding:22px!important}}
@media(max-width:560px){.result-page{padding:18px 14px 32px}.workflow-page.result-page .page-heading.result-page-heading{align-items:flex-start;gap:10px;margin-bottom:18px}.result-heading-title{gap:8px}.result-heading-title h1{font-size:21px}.result-completed{padding:4px 7px;font-size:12px}.result-page-heading>button{padding:8px 10px!important;font-size:12px!important;white-space:nowrap}.result-page-heading>div>p{max-width:60vw;font-size:12px}.result-summary-card{grid-template-columns:1fr;gap:12px;margin-bottom:15px;padding:14px 16px}.result-summary-copy{grid-template-columns:auto auto;justify-content:start}.result-summary-copy>strong{font-size:30px}.result-summary-track{width:100%}.result-page .work-card{padding:16px;border-radius:12px}.result-card-heading{margin-bottom:13px}.question-map-grid{gap:6px;max-height:38vh}.question-map-item{min-height:39px}.result-question-detail{padding:18px 16px!important}.result-detail-heading{align-items:flex-start;gap:8px}.result-detail-heading h2{font-size:17px}.result-detail-heading h2 small{font-size:13px}.result-detail-meta{align-items:flex-end;flex-direction:column;gap:5px}.result-question-stem{padding:17px 0}.result-question-stem .result-markdown{font-size:15px}.result-markdown{font-size:14px}.result-answer-grid{grid-template-columns:minmax(0,1fr);gap:8px;padding:15px 0}.result-answer-grid>section{padding:12px}.result-feedback .result-markdown{font-size:13px}.result-question-actions{gap:8px;margin-top:18px;padding-top:15px}.result-question-actions .result-tutor-open{width:100%;margin-left:0}.result-question-actions .result-edit-question{margin-left:auto}.result-image-preview{min-height:210px;max-height:230px}.result-image-preview img{max-height:228px}.result-image-modal{width:94vw;padding:10px}.result-image-stage{max-width:calc(94vw - 22px);max-height:70vh}.result-image-stage img{max-width:calc(94vw - 22px);max-height:68vh}}

/* Account profile, local token activity, and focused composer styling. */
.profile .avatar>img,.mobile-profile-toggle .avatar>img,.account-menu-avatar>img,.message-avatar>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.profile-menu{position:fixed;left:16px;right:auto;bottom:76px;width:292px;max-height:min(78vh,620px);overflow:auto;padding:0;border:1px solid #e8e8e8;border-radius:14px;background:#fff;box-shadow:0 14px 42px #1a1a1a20;z-index:12}
.profile-menu:not([hidden]){display:block!important}
body.sidebar-collapsed .profile-menu{left:88px;right:auto;bottom:12px;width:292px}
.profile-menu-head{display:flex;align-items:center;gap:11px;padding:16px 16px 14px}.profile-menu-head>div{min-width:0;display:grid;gap:4px}.profile-menu-head strong{font-size:14px;color:#2f3339;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-menu-head small,.account-usage>small{font-size:12px;color:#9298a2}.account-menu-avatar{width:38px;height:38px;border-radius:50%;flex:none;background:#f0f0f0;color:#919191;overflow:hidden}
.account-usage{margin:0 14px 12px;padding:12px;border:1px solid #f0f0f0;border-radius:10px;background:#fcfcfc}.account-usage-heading{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:11px}.account-usage-heading strong{font-size:13px;color:#454a52}.account-usage-heading span{font-size:12px;color:#8a9099;white-space:nowrap}.usage-heatmap{display:grid;grid-template-rows:repeat(7,12px);grid-auto-flow:column;grid-auto-columns:12px;gap:4px;justify-content:center;overflow:hidden}.usage-cell,.usage-legend i{width:12px;height:12px;border-radius:3px;background:#f0f0f0}.usage-cell.level-1,.usage-legend i.level-1{background:#e0e0e0}.usage-cell.level-2,.usage-legend i.level-2{background:#bdbdbd}.usage-cell.level-3,.usage-legend i.level-3{background:#878787}.usage-cell.level-4,.usage-legend i.level-4{background:#4f4f4f}.usage-legend{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin:9px 0 5px;color:#9298a2;font-size:12px}.usage-legend span:first-child{margin-right:2px}.usage-legend span:last-child{margin-left:2px}.usage-legend i{display:block;width:10px;height:10px;border-radius:2px}.account-usage>small{display:block;text-align:right;font-size:12px}
.profile-menu-actions{border-top:1px solid #f0f0f0;padding:6px}.profile-menu-actions button{padding:10px 11px;font-size:13px}.profile-menu-actions .profile-menu-danger{color:#a7544d}
.mobile-profile-toggle{display:none;width:34px;height:34px;padding:2px;border:1px solid #e3e3e3;border-radius:50%;background:#fff;cursor:pointer}.mobile-profile-toggle .avatar{width:28px;height:28px;overflow:hidden;border-radius:50%;font-size:13px}
.message-avatar.assistant-message-avatar{background:#fff;color:inherit}.message-avatar .assistant-logo{width:26px;height:26px;object-fit:contain;border-radius:0}
.profile-editor{width:min(460px,100%);padding:24px}.profile-editor-heading{display:flex;align-items:center;gap:14px;margin-bottom:22px}.profile-editor-heading h3{margin:0 0 5px;font-size:18px}.profile-editor-heading p{margin:0;font-size:13px;color:#858b95}.profile-editor-avatar{width:58px;height:58px;border-radius:50%;background:#f0f0f0;color:#919191;font-size:20px;overflow:hidden;flex:none}.profile-editor .field{margin:14px 0}.profile-editor .field label{display:block;margin-bottom:7px;font-size:13px;font-weight:600;color:#515762}.profile-editor .input{width:100%;min-height:42px;padding:10px 12px;border:1px solid #e3e3e3;border-radius:9px;font-size:13px}.profile-editor .profile-file-input{padding:8px}.profile-editor .field small{display:block;margin-top:7px;font-size:12px;color:#8b919a}.profile-remove-avatar{margin-top:0;padding:0;font-size:13px}.profile-editor .inline-error{margin:12px 0 0}.profile-editor .modal-actions{margin-top:20px}
.profile-editor-avatar>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.chat-composer textarea:focus,.chat-composer textarea:focus-visible{outline:0!important;box-shadow:none!important}.chat-composer:focus-within{border-color:#d9d9d9!important;box-shadow:0 8px 26px rgba(22,28,40,.07)!important}
.source-outline{border:1px solid #ededed;border-radius:10px;background:#fafafa;padding:14px 16px;margin:10px 0 14px;max-height:230px;overflow:auto}.source-outline-title{display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:13px;color:#4c4c4c}.source-outline-title span,.source-outline li small{font-size:12px;color:#858d99}.source-outline ol{list-style:none;padding:0;margin:10px 0 0}.source-outline li{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-top:1px solid #f0f0f0;font-size:13px;color:#545454}.source-outline li.level-2{padding-left:16px}.source-outline li.level-3{padding-left:30px}.source-outline li.level-4,.source-outline li.level-5,.source-outline li.level-6{padding-left:44px}.source-outline li small{white-space:nowrap}.source-outline-empty{font-size:13px;color:#8a6d40;background:#fffaf1;border-color:#f0e3cd}.source-preview-body{display:flex;flex-direction:column;gap:8px}.source-preview-chunk{border-top:1px solid #f0f0f0;padding:10px 0}.source-preview-chunk>small{display:block;color:#8a919b;font-size:12px;margin-bottom:5px}.source-preview-chunk p{font-size:13px;line-height:1.8;color:#4c4c4c;white-space:pre-wrap;margin:0}
@media(max-width:680px){
 .profile-menu:not([hidden]){display:block!important;left:auto;right:12px;top:64px;bottom:auto;width:min(300px,calc(100vw - 24px));max-height:calc(100svh - 150px)}
 body.sidebar-collapsed .profile-menu:not([hidden]){left:auto;right:12px;top:64px;bottom:auto;width:min(300px,calc(100vw - 24px))}
 .mobile-profile-toggle{display:grid;place-items:center}.top-actions{gap:8px}
}

.model-settings-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.model-settings-heading h3{font-size:17px;color:#383838;margin:0 0 8px}.model-settings-heading p{font-size:13px;line-height:1.8;color:#7a828f;margin:0 0 14px}.model-list-status{font-size:13px;line-height:1.7;color:#828282;margin:0 0 18px}.settings-workspace .model-custom-input{margin-top:8px}.vision-test-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid #f0f0f0;margin-top:20px;padding-top:18px}.vision-test-tools small{font-size:13px;line-height:1.65;color:#7b8491}.vision-test-result{max-height:320px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid #e8e8e8;border-radius:10px;background:#fafafa;color:#3b3b3b;padding:14px;font-family:inherit;font-size:13px;line-height:1.75;margin:14px 0 0}.vision-test-result[hidden]{display:none}@media(max-width:680px){.model-settings-heading{align-items:stretch;flex-direction:column}.model-settings-heading .secondary-button{align-self:flex-start}}

.grading-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.grading-controls .primary-button{flex:1}
.grading-controls .secondary-button{flex:none}
.grading-resume-box{margin:4px 0 12px;padding:12px;border:1px solid #e8e8e8;border-radius:10px;background:#fafafa}
.grading-resume-box>p{display:grid;gap:4px;margin:0 0 9px;font-size:13px;line-height:1.6;color:#5c626c}
.grading-resume-box>p strong{font-size:13px;color:#3d3d3d}
.grading-resume-box>p span{overflow-wrap:anywhere;color:#818791}
@media(max-width:680px){.grading-controls .primary-button{flex-basis:100%}.grading-controls .secondary-button{flex:1}}
.grading-controls .primary-button{width:auto;margin:0}
.grade-photo-actions{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.grade-photo-actions .secondary-button{min-height:42px;padding:10px 16px}
.grade-drop{min-height:185px!important;outline:none}
.grade-drop:focus-visible{border-color:#7d7d7d;box-shadow:0 0 0 3px #66666612}
.grade-drop h3{font-size:16px!important}
.grade-drop p{margin-bottom:0!important}
.grade-drop.has-photos{min-height:118px!important}
.grade-photo-hint{margin-top:12px;font-size:13px;line-height:1.7}
.grade-camera-modal{max-height:92vh;overflow:auto}
.camera-device-picker{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.camera-device-picker label{flex:none;font-size:13px;font-weight:600;color:#555b64}
.camera-device-picker .select{max-width:100%;min-height:38px;padding:8px 10px;font-size:13px}
.grade-camera-status{text-align:center;font-size:13px;color:#737982;margin:12px 0 0}
.grade-camera-actions{display:flex;justify-content:center;gap:10px;margin-top:12px}
.grade-camera-actions .primary-button,.grade-camera-actions .secondary-button{margin:0}
@media(max-width:680px){.grade-photo-actions{display:grid;grid-template-columns:1fr 1fr}.grade-photo-actions button{justify-content:center;min-height:44px}.grade-drop{min-height:150px!important;padding:20px 12px}.grade-drop h3{font-size:14px!important;line-height:1.6}.grade-photo-hint{font-size:12px}.grade-camera-actions{flex-direction:column}.grade-camera-actions button{width:100%;justify-content:center}}
.chat-history{scroll-behavior:auto}
/* Notebook management and question proofreading. */
.notebook-heading-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:5px}
.notebook-rail-row{display:flex;align-items:center;gap:2px;min-width:0}
.notebook-rail-row>.notebook-subject,.notebook-rail-row>.notebook-book{flex:1;min-width:0}
.rail-more,.recent-chat-more{flex:none;border:0;background:transparent;color:#7f8792;border-radius:6px;font-size:19px;cursor:pointer;width:28px;height:30px}
.rail-more:hover,.recent-chat-more:hover{background:#ededed;color:#2e2e2e}
.recent-chat-row{display:flex;align-items:center;border-radius:8px;min-width:0}
.recent-chat-row.active{background:#ebebeb}.recent-chat-row>.recent-chat{flex:1;min-width:0;width:0}
.recent-chat-more{margin-right:4px;font-size:20px;width:26px}
.notebook-type-tabs{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid #ededed;margin:4px 0 18px}
.notebook-type-tabs button{flex:none;display:flex;align-items:center;gap:7px;border:0;border-bottom:2px solid transparent;background:transparent;color:#858d99;padding:11px 10px;font-size:13px;cursor:pointer}
.notebook-type-tabs button.active{color:#666666;border-color:#787878;font-weight:600}
.notebook-type-tabs button span{font-size:12px;min-width:18px;padding:1px 4px;border-radius:4px;background:#f5f5f5;color:#8c8c8c}
.notebook-selection{flex-wrap:wrap;gap:12px}.notebook-selection input{accent-color:#737373}
.notebook-question-title{display:block;overflow:visible;-webkit-line-clamp:unset;margin-bottom:8px;font-weight:600;font-size:13px;line-height:1.5}
.notebook-question-title>span{font-weight:400;color:#8c8c8c;font-size:13px}
.notebook-question-preview{font-size:14px;line-height:1.85;max-height:210px;overflow:hidden;color:#424242}
.notebook-question-preview p{margin:0 0 5px}.notebook-question-preview .result-choice-list{margin-top:8px}
.notebook-question-meta>div{display:flex;align-items:center;gap:7px}
.review-badge{border:1px solid #ead5ad;background:#fcf7ec;color:#9d7131;padding:3px 7px;border-radius:5px;font-size:12px;cursor:pointer}
.question-review-panel{border:1px solid #eadfca;background:#fcf9f2;border-radius:8px;padding:12px 14px;margin:14px 0;font-size:13px;line-height:1.8;color:#83652f}
.question-review-panel b{font-weight:600}.question-review-panel ul{padding-left:19px;margin:5px 0 0}.question-review-panel p{margin:4px 0 0;font-size:13px}
.question-figure{margin:14px 0;text-align:center;break-inside:avoid}.question-figure img{max-width:100%;max-height:340px;object-fit:contain}
.question-figure figcaption{font-size:13px;color:#8b929d;margin-top:5px}
.question-edit-grid{display:grid;grid-template-columns:1fr 2fr;gap:14px}.question-edit-grid .field{margin-bottom:0}
.intelligent-card .textarea{width:100%;min-height:78px;font-size:14px;line-height:1.8;border:1px solid #e3e3e3;border-radius:8px;padding:10px 12px;resize:vertical;box-sizing:border-box}
.intelligent-card .question-stem-editor{min-height:145px}
.choice-editor{border:1px solid #ebebeb;border-radius:9px;padding:14px;margin:20px 0}
.choice-editor legend{padding:0 6px}.option-edit-row{display:grid;grid-template-columns:44px minmax(0,1fr) 28px;align-items:start;gap:8px;margin-bottom:10px}
.option-edit-row>.input{padding:10px 5px;text-align:center}.option-edit-row>.textarea{min-height:55px}.option-edit-row>.small-button{margin-top:5px;padding:5px}
.choice-editor>.text-link{font-size:13px}.choice-editor .quiet-copy{font-size:12px;margin-bottom:0}
.figure-edit-row{display:grid;grid-template-columns:90px minmax(0,1fr);gap:10px;margin-bottom:12px;align-items:center}
.figure-edit-row>img{max-width:90px;max-height:90px;grid-row:span 2}.figure-edit-row>.small-button{justify-self:start}
.figure-file-label{display:inline-flex;cursor:pointer;font-size:13px!important;margin-top:8px}
.figure-crop-details{margin:18px 0;border:1px solid #ebebeb;padding:12px;border-radius:8px}
.figure-crop-details summary{cursor:pointer;font-size:13px;color:#808080}.figure-crop-details canvas{display:block;width:100%;height:auto;margin:12px 0;touch-action:none;cursor:crosshair}
.review-confirm{display:flex;align-items:flex-start;gap:8px;font-size:13px!important;line-height:1.7}.review-confirm input{margin-top:4px;accent-color:#737373}
.classification-manager>section{border-bottom:1px solid #f0f0f0;padding:15px 0}.manager-subject,.manager-book,.tag-manager>div{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px}
.manager-subject{margin-bottom:8px}.manager-book{padding:10px 0 10px 14px;color:#7a7a7a}.manager-book small{margin-left:6px;color:#a6a6a6}
.manager-book>.text-link,.tag-manager .text-link{font-size:13px}.tag-manager>div{padding:12px 0;border-bottom:1px solid #f2f2f2}
.intelligent-card [hidden]{display:none!important}
.toast.show{pointer-events:auto;display:flex;align-items:center;gap:16px;max-width:min(90vw,560px)}
.toast-undo{border:0;background:transparent;color:#e3e3e3;font:inherit;font-weight:600;cursor:pointer;padding:2px 0;white-space:nowrap}
.practice-question-content{font-size:16px;line-height:1.9;margin:18px 0}.practice-question-content p{margin:0 0 10px}

/* A4 exam pages: the preview and printed pages use the same physical geometry. */
.exam-builder{max-width:1080px;width:100%;padding:20px 24px 48px}
.paper-space-field{display:grid;gap:6px;font-size:12px;font-weight:600;color:#5c626b}.paper-space-field .select{font-size:13px;min-height:39px}
.paper-review-notice{padding:14px 17px;border:1px solid #e9d7b8;border-radius:10px;background:#fffaf1;margin-bottom:18px;color:#8b6935;font-size:13px;line-height:1.8}
.paper-review-notice>strong{display:block;font-size:13px}.paper-review-notice>div{display:flex;flex-wrap:wrap;gap:5px 18px;margin-top:6px}
.paper-review-notice .text-link{font-size:13px;color:#8b6935}
.paper-flow-source{display:none!important}
.paper-pages{display:grid;justify-items:center;gap:24px;width:100%;min-width:0;--paper-zoom:1}
.exam-page{zoom:var(--paper-zoom);box-sizing:border-box;width:210mm;height:297mm;padding:11mm 16mm 10mm;background:#fff;color:#111;border:1px solid #e6e6e6;box-shadow:0 6px 25px #2626260a;display:flex;flex-direction:column;font-family:'Songti SC','STSong','Noto Serif SC','Source Han Serif SC',serif;font-size:11pt;line-height:1.65}
.exam-running-header{flex:none;height:7mm;border-bottom:.25mm solid #777;margin-bottom:4mm;font-size:8pt;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.exam-first-page .exam-running-header{display:none}
.exam-page-body{flex:1;min-height:0;overflow:visible}.exam-page-body>*{box-sizing:border-box}
.exam-page-footer{flex:none;display:flex;justify-content:space-between;align-items:center;border-top:.2mm solid #999;padding-top:2mm;height:8mm;margin-top:3mm;font-size:8pt;color:#555;gap:10mm}
.exam-page-footer>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exam-page-number{white-space:nowrap}
.exam-document-header{margin:0 0 5mm;text-align:center}.exam-title{font-family:'Songti SC','STSong','Noto Serif SC',serif;font-size:19pt;line-height:1.4;font-weight:700;margin:0 0 6mm;color:#111;overflow-wrap:anywhere}
.exam-section-heading{font-size:12pt;line-height:1.6;font-weight:700;margin:4mm 0 3mm;padding:0;color:#111}
.exam-section-heading small{font-size:9pt;font-weight:400;margin-left:4mm}
.exam-question{margin:0 0 5mm;break-inside:avoid;page-break-inside:avoid;font-size:11pt;line-height:1.8}
.exam-question-prompt{display:flex;gap:2mm;align-items:baseline}.exam-question-number{min-width:4mm;flex:none;font-weight:700;font-family:'Times New Roman',serif}
.exam-question-stem{flex:1;min-width:0}.exam-question p{margin:0 0 1.5mm}.exam-question-stem>*:last-child{margin-bottom:0}
.exam-choice-options{display:grid;gap:1.5mm 4mm;margin:2mm 0 1mm 6mm}.exam-choice-options.columns-4{grid-template-columns:repeat(4,minmax(0,1fr))}.exam-choice-options.columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}.exam-choice-options.columns-1{grid-template-columns:minmax(0,1fr)}
.exam-choice-option{display:flex;gap:2mm;min-width:0;align-items:baseline}.exam-choice-option>b{font-weight:400;font-family:'Times New Roman',serif}.exam-choice-option>div{min-width:0;overflow-wrap:anywhere}.exam-choice-option p{margin:0}
.exam-short-answer{margin:1mm 0 0 6mm;font-size:10pt;height:7mm}.exam-fill-space{height:7mm}
.exam-workspace{position:relative;margin:1mm 0 0 6mm;min-height:15mm;max-height:180mm}.exam-workspace>span{font-size:10pt;position:absolute;top:1mm;left:0}
.exam-subquestion{margin-left:6mm}.exam-subquestion .exam-workspace{margin-left:0}
.exam-figure{margin:3mm 0 3mm 6mm;text-align:center;break-inside:avoid}.exam-figure img{max-width:100%;max-height:55mm;object-fit:contain}.exam-figure figcaption{font-size:9pt;margin:1mm 0}
.exam-question img{max-width:100%}.exam-question table,.exam-answer-item table{border-collapse:collapse;max-width:100%;font-size:10pt}.exam-question th,.exam-question td,.exam-answer-item th,.exam-answer-item td{border:.2mm solid #666;padding:1mm 2mm}
.exam-page .katex{font-size:1em}.exam-page .katex-display{margin:2mm 0;overflow:visible}.exam-page .katex-display>.katex{white-space:normal}
.exam-answer-header{text-align:center;margin:0 0 7mm}.exam-answer-header h1{font-size:17pt;margin:0 0 2mm}.exam-answer-header p{margin:0;font-size:10pt}
.exam-answer-item{margin:0 0 6mm;font-size:10.5pt;line-height:1.8;break-inside:avoid}.exam-answer-line{display:flex;gap:2mm;align-items:baseline}
.exam-answer-line>b{flex:none;font-size:11pt}
.exam-reference-answer p{margin:0}
.exam-reference-answer p+p{margin-top:1.5mm}.exam-answer-item p{margin:0 0 2mm}
.exam-explanation{margin-top:1.5mm}
.exam-explanation b{margin-right:2mm}
.exam-explanation p{margin:0}
.exam-explanation p:first-child{display:inline}
.exam-explanation p+p{margin-top:1.5mm}.exam-explanation>b{font-size:9pt;display:block;margin-bottom:1mm}
.review-check-list{padding-left:0;list-style:none;max-height:45vh;overflow:auto}.review-check-list li{padding:12px 0;border-bottom:1px solid #f0f0f0;font-size:13px}.review-check-list span{display:block;color:#8b784f;line-height:1.8;margin:5px 0}.review-check-list .text-link{font-size:13px}
@media(max-width:680px){
 .notebook-heading-actions{margin:0 0 15px}.notebook-heading-actions button{font-size:13px}.notebook-rail-row{flex:none;border:1px solid #ebebeb;border-radius:20px;padding-right:4px}.notebook-rail-row .notebook-subject,.notebook-rail-row .notebook-book{border:0}.notebook-rail-row>.rail-more{height:24px;width:22px}
 .notebook-type-tabs{margin-top:10px}.notebook-type-tabs button{font-size:13px;padding:10px 8px}.notebook-selection{font-size:12px}.notebook-selection button{margin-left:0}.notebook-batch{bottom:76px;display:block}.notebook-batch>span{display:block;margin-bottom:8px}.notebook-batch>div{flex-wrap:wrap}.notebook-batch button{flex:1 1 auto!important}
 .notebook-question-preview{font-size:13px;max-height:180px}.option-edit-row{grid-template-columns:36px minmax(0,1fr) 25px;gap:5px}.question-edit-grid{gap:10px}.figure-edit-row{grid-template-columns:65px minmax(0,1fr)}.figure-edit-row>img{max-width:65px}.card-actions{flex-wrap:wrap}
 .exam-builder{padding:14px 8px 28px}.paper-options{align-items:center}.paper-title-field{flex-basis:100%;max-width:none}.paper-pages{gap:16px}.paper-toolbar-top>div span{font-size:12px}.paper-space-field{flex:1}.paper-answer-toggle{font-size:12px}
}
@page{size:A4 portrait;margin:0}
@media print{
 html,body{margin:0!important;padding:0!important;width:210mm!important;background:white!important}
 .sidebar,.topbar,.paper-toolbar,.paper-review-notice,#toast,#modal-root,.paper-flow-source{display:none!important}
 .app-shell,.main-area,.page-root,.exam-builder{display:block!important;margin:0!important;padding:0!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;overflow:visible!important}
 .paper-pages{display:block!important;width:auto!important;gap:0!important;margin:0!important}
 .exam-page{zoom:1!important;box-shadow:none!important;border:0!important;margin:0!important;width:210mm!important;height:296.8mm!important;break-after:page;page-break-after:always;overflow:hidden}
 .exam-page:last-child{break-after:auto;page-break-after:auto}
 .exam-question,.exam-answer-item,.exam-figure{break-inside:auto!important;page-break-inside:auto!important}
 .exam-page *{color:#111!important}
}

.chat-history-button{border:1px solid #e8e8e8;border-radius:8px;background:#fff;padding:7px 10px;font-size:13px;color:#757575;white-space:nowrap}
.conversation-history-list{max-height:55vh;overflow:auto}.conversation-history-row{display:flex;gap:12px;align-items:center;border-bottom:1px solid #f0f0f0;padding:12px 0}
.conversation-history-open{flex:1;min-width:0;border:0;background:transparent;text-align:left;font-size:13px;color:#454545;line-height:1.8;overflow-wrap:anywhere}
.notebook-question-preview .result-choice-list,.intelligent-card .result-choice-list,.practice-question-content .result-choice-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:5px}
.notebook-question-preview .result-choice-option,.intelligent-card .result-choice-option,.practice-question-content .result-choice-option{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:baseline;gap:6px;margin:0;padding:0}
.notebook-question-preview .result-choice-content p,.intelligent-card .result-choice-content p,.practice-question-content .result-choice-content p{margin:0}
.notebook-question-preview .result-choice-marker,.intelligent-card .result-choice-marker{font-size:13px;font-weight:500}
@media(max-width:420px){.top-actions{gap:5px}.chat-history-button{font-size:12px;padding:6px}.mobile-profile-toggle{display:none}.breadcrumb{font-size:15px}}
@media print{.chat-history-button{display:none!important}}
.enabled-chat-model-settings{margin-top:24px;padding-top:20px;border-top:1px solid #f0f0f0}.enabled-chat-model-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.enabled-chat-model-heading>div{display:grid;gap:5px}.enabled-chat-model-heading strong{font-size:13px;color:#3d3d3d}.enabled-chat-model-heading small{font-size:13px;line-height:1.6;color:#858c96}.enabled-chat-model-heading>span{flex:none;color:#949494;font-size:13px;font-weight:600}.enabled-chat-model-search{max-width:360px;margin-bottom:10px}.enabled-chat-model-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:260px;overflow:auto;padding:2px}.enabled-chat-model-option{display:flex;align-items:center;gap:9px;min-width:0;padding:9px 10px;border:1px solid #ededed;border-radius:9px;background:#fff;cursor:pointer}.enabled-chat-model-option:hover{background:#fafafa;border-color:#e6e6e6}.enabled-chat-model-option[hidden]{display:none}.enabled-chat-model-option input{width:15px;height:15px;flex:none;accent-color:#949494}.enabled-chat-model-option span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#4a4a4a;font-size:13px}.enabled-chat-model-empty{grid-column:1/-1;margin:0;padding:12px;color:#8a9099;font-size:13px}
@media(max-width:680px){.enabled-chat-model-list{grid-template-columns:1fr;max-height:240px}.enabled-chat-model-heading{align-items:flex-start}}

/* Question tutoring uses the existing chat canvas, with a quiet mode switch. */
.tutor-mode-bar{width:min(920px,100%);flex:none;display:flex;align-items:center;gap:12px;margin:0 auto;padding:0 8px;color:#777d85;font-size:13px}
.tutor-segmented{display:inline-flex;gap:2px;padding:3px;border:1px solid #e7e8eb;border-radius:10px;background:#f5f5f5}
.tutor-segmented button{min-height:30px;padding:0 12px;border:0;border-radius:7px;background:transparent;color:#777d85;font:inherit;cursor:pointer;transition:background .16s,color .16s,box-shadow .16s}
.tutor-segmented button:hover{color:#30343a}
.tutor-segmented button.selected{background:#fff;color:#25282d;box-shadow:0 1px 3px #21212114;font-weight:550}
.tutoring-question-context{padding:4px 0 18px;margin:0 0 14px;border-bottom:1px solid #f0f0f0;color:#30343a}
.tutoring-context-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;color:#686f79;font-size:13px}
.tutoring-context-heading strong{color:#444a53;font-weight:600}
.tutoring-context-stem{font-size:14px;line-height:1.8;color:#30343a}
.tutoring-answer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:14px}
.tutoring-answer-grid section{min-width:0;font-size:13px;line-height:1.75;overflow-wrap:anywhere}
.tutoring-answer-grid h3,.tutoring-grading-note h3{margin:0 0 5px;color:#7c828b;font-size:12px;font-weight:550}
.tutoring-answer-grid small,.tutoring-grading-note>small{display:block;margin-top:5px;color:#858b93;font-size:12px;line-height:1.6}
.tutoring-grading-note{margin-top:14px;font-size:13px;line-height:1.8}
.tutoring-context-missing{color:#737982;font-size:13px;line-height:1.7}
.tutoring-context-missing strong{color:#434951}
.tutoring-context-missing p{margin:4px 0 0}
.tutoring-question-collapsed{font-size:13px;color:#545b64}
.tutoring-question-collapsed summary{cursor:pointer;color:#606772}
.tutoring-question-collapsed>div,.tutoring-question-collapsed>p{margin:8px 0;line-height:1.7}
.tutoring-context-note{margin:9px 0 0;color:#858b93;font-size:12px;line-height:1.6}
.message-mode-label{margin:0 0 5px;color:#858b93;font-size:12px;line-height:1.4}
.tutoring-sources{margin:9px 0 4px;color:#777e87;font-size:12px;line-height:1.6}
.tutoring-sources summary{cursor:pointer;list-style:none}
.tutoring-sources summary::-webkit-details-marker{display:none}
.tutoring-sources summary:hover{color:#4a4a4a}
.tutoring-sources>div{display:grid;gap:8px;margin-top:8px;padding-left:10px;border-left:1px solid #e8e8e8}
.tutoring-sources article{display:grid;gap:2px}
.tutoring-sources article strong{color:#555c66;font-weight:550}
.tutoring-sources article small{color:#858b93;font-size:12px}
.tutoring-sources article p{margin:3px 0 0;color:#656c76;white-space:pre-wrap}
.tutoring-source-open{justify-self:start;margin-top:3px;padding:0;border:0;background:transparent;color:#878787;font-size:12px;line-height:1.7;cursor:pointer}
.tutoring-source-open:hover{text-decoration:underline}
.tutoring-source-note{margin:8px 0 3px;color:#858b93;font-size:12px;line-height:1.6}
@media(max-width:680px){.tutor-mode-bar{width:100%;padding:0 2px;gap:9px}.tutor-segmented button{min-height:29px;padding:0 10px;font-size:12px}.tutoring-answer-grid{grid-template-columns:1fr;gap:10px}.tutoring-context-stem{font-size:13px}.tutoring-question-context{padding-bottom:13px;margin-bottom:9px}}

.retrieval-process{margin-top:16px;border:1px solid #ebebeb;border-radius:12px;background:#fafafa;color:#59616c;font-size:13px;overflow:hidden}
.retrieval-process>summary{padding:10px 13px;cursor:pointer;user-select:none;font-weight:600;color:#59616c}
.retrieval-process[open]>summary{border-bottom:1px solid #ebebeb}
.retrieval-trace-list{padding:4px 12px 12px}
.retrieval-trace-round{padding:10px 0;border-bottom:1px solid #f0f0f0}
.retrieval-trace-round:last-of-type{border-bottom:0}
.retrieval-trace-round h4{margin:0 0 7px;font-size:13px;color:#424242}
.retrieval-trace-query{margin:0 0 9px;overflow-wrap:anywhere;color:#717985}
.retrieval-trace-hit{margin:8px 0;padding:10px 11px;border:1px solid #ededed;border-radius:9px;background:#fff}
.retrieval-trace-hit header{display:flex;justify-content:space-between;gap:8px;color:#4c4c4c;font-size:13px}
.retrieval-trace-hit small{display:block;margin-top:5px;color:#858c96}
.retrieval-trace-text{margin-top:7px;white-space:pre-wrap;overflow-wrap:anywhere;color:#59616c;font-size:13px;line-height:1.65;max-height:220px;overflow:auto}
.retrieval-trace-hit footer{margin-top:7px;color:#89909a;font-size:12px}
.retrieval-trace-empty,.retrieval-trace-note{margin:6px 0;color:#89909a;font-size:12px}

.textbook-upload-panel,.textbook-catalog,.textbook-detail{background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:20px 22px;box-shadow:0 3px 12px #2b2b2b08}
.textbook-upload-panel{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.textbook-upload-panel>div{flex:1;min-width:0}.textbook-upload-panel>.primary-button{flex:none}
.textbook-upload-panel strong{font-size:13px;font-weight:650}.textbook-upload-panel p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.65}
.textbook-workspace{display:grid;grid-template-columns:1fr;gap:14px;min-width:0}.textbook-workspace>*{min-width:0}.textbook-catalog>.card-title{margin-bottom:12px}
.textbook-list{display:grid}.textbook-row{padding:15px 0;border-top:1px solid var(--line)}
.textbook-row-main{display:flex;align-items:center;gap:12px}.textbook-row-copy{min-width:0;flex:1}.textbook-row-copy button{border:0;background:none;padding:0;color:var(--ink);font-size:13px;font-weight:650;text-align:left;cursor:pointer}.textbook-row-copy button:hover{color:var(--green)}.textbook-row-copy p{margin:5px 0 0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}.textbook-row-stats{display:flex;flex-wrap:wrap;gap:6px 16px;margin:10px 0 0 46px;color:#747e78;font-size:12px}.textbook-row-link{display:block;margin:7px 0 0 46px;padding:0;border:0;background:none;color:var(--green);font-size:12px;font-weight:650}
.textbook-empty{padding:40px 20px;text-align:center;color:var(--muted);font-size:12px}.textbook-empty strong{color:var(--ink);font-size:13px}.textbook-empty p{line-height:1.7}
.textbook-detail{padding:20px 22px}.textbook-detail-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.textbook-title-block h2{margin:0;color:var(--ink);font-size:20px;letter-spacing:-.35px}.textbook-title-block p{margin:7px 0 0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.textbook-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:18px 0;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.textbook-metrics span{display:grid;gap:4px}.textbook-metrics strong{font-size:16px;font-weight:650}.textbook-metrics small{color:var(--muted);font-size:12px}
.textbook-detail-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:14px 0}.textbook-detail-actions .danger-text{margin-left:auto}.textbook-progress-count{margin:0 0 8px;color:#69736d;font-size:12px}
.textbook-process,.textbook-sections,.textbook-questions{margin-top:22px}.textbook-process .card-title,.textbook-sections .card-title,.textbook-questions .card-title{margin-bottom:11px}.textbook-process .card-title h3,.textbook-sections .card-title h3,.textbook-questions .card-title h3{margin:0;font-size:13px}.textbook-process .card-title span,.textbook-sections .card-title span,.textbook-questions .card-title span{color:var(--muted);font-size:12px}
.textbook-stage-list{display:grid;gap:0;margin:0;padding:0;list-style:none}.textbook-stage-list li{display:flex;gap:10px;min-height:35px;color:#9aa19c}.textbook-stage-list li>span{position:relative;display:block;width:10px;height:10px;flex:none;margin:3px 0 0;border:1px solid #cbd1cc;border-radius:50%;background:var(--surface)}.textbook-stage-list li:not(:last-child)>span:after{position:absolute;top:9px;left:3px;width:1px;height:25px;background:#e3e7e4;content:""}.textbook-stage-list li.done{color:#5d6b62}.textbook-stage-list li.done>span{border-color:#696969;background:#696969}.textbook-stage-list li.active{color:var(--ink)}.textbook-stage-list li.active>span{border:2px solid var(--green)}.textbook-stage-list li.failed{color:#a7554d}.textbook-stage-list li.failed>span{border-color:#c87369;background:#c87369}.textbook-stage-list strong{font-size:12px;font-weight:600}.textbook-stage-list small{display:block;margin:3px 0 7px;color:#89928c;font-size:12px;line-height:1.6}
.textbook-sections ol{display:grid;gap:7px;margin:0;padding-left:20px;color:#434c46;font-size:12px}.textbook-sections li{padding-left:3px}.textbook-sections li small{display:block;margin-top:3px;color:var(--muted);font-size:12px}
.textbook-question{margin-top:9px;padding:14px 0;border-top:1px solid var(--line)}.textbook-question>header{display:flex;align-items:center;justify-content:space-between;gap:10px}.textbook-question>header>div{display:flex;align-items:center;gap:8px}.textbook-question>header strong{font-size:13px;font-weight:650}.textbook-question-stem{margin:10px 0;color:#303a34;font-size:13px;line-height:1.75;white-space:pre-wrap}.textbook-question ul{display:grid;gap:4px;padding-left:18px;color:#4b554f;font-size:12px;line-height:1.65}.textbook-question-answer{display:grid;gap:7px;margin:10px 0;padding:10px 12px;border-left:2px solid #d9d9d9;background:#fafafa;color:#59645d;font-size:12px;line-height:1.7}.textbook-question-answer span{overflow-wrap:anywhere}.textbook-question>small{display:block;color:var(--muted);font-size:12px;line-height:1.6}.textbook-issues{margin:8px 0 0;color:#9a6a36;font-size:12px;line-height:1.6}.textbook-ai-draft{margin:8px 0 0;color:#747e78;font-size:12px}
.textbook-question-editor{width:min(760px,calc(100vw - 32px));max-height:min(88vh,900px);overflow:auto}.textbook-question-editor h2{margin:0;font-size:16px}.textbook-question-editor .field{margin:12px 0}.textbook-question-editor .textarea{min-height:58px}.textbook-page-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.textbook-page-fields label{display:grid;gap:6px;color:#616b64;font-size:12px}.textbook-ai-suggestion{margin:14px 0;padding:10px;border:1px solid var(--line);border-radius:9px;color:#66716a;font-size:12px}.textbook-ai-suggestion pre{max-height:180px;overflow:auto;white-space:pre-wrap;font-size:12px}.textbook-loading{color:var(--muted);font-size:12px}
@media(max-width:680px){.nav-list{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:680px){.textbook-upload-panel{flex-direction:column;align-items:stretch}.textbook-upload-panel>.primary-button{align-self:flex-start}.textbook-catalog,.textbook-detail,.textbook-upload-panel{padding:16px}.textbook-row-main{gap:8px}.textbook-row-stats,.textbook-row-link{margin-left:40px}.textbook-metrics{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}.textbook-detail-actions{gap:6px}.textbook-detail-actions .danger-text{margin-left:0}.textbook-question>header{align-items:flex-start}.textbook-question>header strong{max-width:170px}.textbook-page-fields{grid-template-columns:1fr}.textbook-question-editor .modal-actions{flex-wrap:wrap}.textbook-question-editor .modal-actions button{flex:1}}

/* ===== 移动端适配补强（≤680px）：主页 Hero 折叠、iOS 输入缩放、触控目标、安全区 ===== */
@media(max-width:680px){
  /* 主页：折叠桌面版的大留白 Hero */
  .chat-workspace{padding:20px 16px 96px}
  .chat-workspace.has-chat{padding:16px 12px 96px}
  .welcome-block{margin:0 0 22px}
  .welcome-block h1{font-size:29px;gap:10px;flex-wrap:wrap}
  .welcome-block img{width:36px;height:36px}
  .welcome-tagline{font-size:13px;letter-spacing:.04em}
  .prompt-suggestions{margin-top:14px;gap:6px}
  .prompt-suggestions button{font-size:15px;line-height:1.5;min-height:34px}

  /* 输入框 ≥16px，避免 iOS Safari 聚焦时自动放大页面 */
  .input,.textarea,.select,
  :is(.workflow-page,.settings-workspace,.intelligent-card,.notebook-filters,.library-toolbar,.document-filters,.pdf-editor) :is(.input,.select,.textarea),
  .pdf-controls input{font-size:16px}
  .chat-composer{border-radius:20px;padding:14px 14px 12px;min-height:0}
  .chat-composer textarea{min-height:52px;font-size:16px}
  .chat-model-name{font-size:13px}
  .composer-tool{font-size:13px}

  /* 顶栏紧凑化 */
  .breadcrumb{font-size:16px}
  .chat-history-button,.new-chat-button{padding:7px 10px;font-size:13px}
  .mobile-profile-toggle .avatar{width:30px;height:30px;font-size:12px}

  /* 触控目标加大：主按钮至少 44px 高 */
  .primary-button,.secondary-button,.subtle-button{min-height:44px;justify-content:center}
  .grading-controls .primary-button{min-height:46px;font-size:14px}
  .small-button{min-height:36px}

  /* 底部 Tab 栏与内容区留出安全区 */
  .main-area{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .sidebar{height:auto;min-height:69px}
  .nav-item,.nav-item.active{height:56px;gap:4px}
  .nav-icon{font-size:20px}
  .toast{bottom:calc(80px + env(safe-area-inset-bottom));left:12px;right:12px;transform:none;width:auto}
  .toast.show{transform:none}
}

/* ===== 输入框右下角：上下文圆环 + 模型文字选择器（紧凑一组） ===== */
.composer-cluster{position:relative;display:flex;align-items:center;gap:6px}
.context-pill{width:26px;height:26px;border:0;background:transparent;display:grid;place-items:center;padding:0;color:#555b61;border-radius:8px;transition:background .16s}
.context-pill:hover,.context-pill[aria-expanded=true]{background:#f5f5f5}
.context-pill:focus-visible{outline:2px solid #b5b5b5;outline-offset:1px}
.context-ring .ring-track{stroke:#e0e0e0}
.context-ring .ring-fill{stroke:#878787}
.context-pill.warn .ring-fill{stroke:#d9822b}
.context-pill.full .ring-fill{stroke:#c2504a}
.context-popover{position:absolute;right:0;bottom:calc(100% + 12px);z-index:9;width:300px;padding:16px;background:#fff;border:1px solid #e7e8eb;border-radius:14px;box-shadow:0 14px 40px rgba(22,28,40,.16);color:#3a3f46}
.context-popover[hidden]{display:none}
.context-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.context-title{margin:0;font-size:15px;font-weight:650;color:#262626}
.context-total{font-size:13px;font-weight:550;color:#5a616c;white-space:nowrap}
.context-meter{height:8px;border-radius:99px;background:#ededed;margin:12px 0 11px;overflow:hidden}
.context-meter span{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#919191,#b2b2b2)}
.context-rows{display:grid;gap:7px;margin:0}
.context-rows>div{display:flex;justify-content:space-between;align-items:center;font-size:13px}
.context-rows dt{display:flex;align-items:center;gap:8px;color:#6d747e;margin:0}
.context-rows dd{margin:0;color:#3d3d3d;font-weight:550}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
.dot-input{background:#919191}
.dot-output{background:#c4c4c4}
.dot-free{background:#dbdbdb}
.context-divider{height:1px;background:#f2f2f2;margin:13px 0 11px}
.context-cache{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:#6d747e}
.context-cache b{color:#3d3d3d;font-weight:550}
.context-empty{margin:6px 0 2px;font-size:13px;color:#7c828b;line-height:1.7}
.chat-model-trigger{height:38px;min-width:0;max-width:200px;justify-content:center;gap:6px;padding:0 10px}
.chat-model-trigger .chat-model-name{max-width:158px;font-size:13px;font-weight:550;color:#242424}
.chat-model-trigger .chevron{width:7px;height:7px;margin-left:0}
.chat-model-menu{scrollbar-width:thin;overscroll-behavior:contain}
@media(max-width:680px){
  .context-popover{right:-4px;width:min(280px,calc(100vw - 32px))}
  .chat-model-trigger{padding:0 7px}
  .chat-model-trigger .chat-model-name{max-width:112px}
}

/* ===== 错题本视觉优化 ===== */
.notebook-rail{background:#fafafa;border:1px solid #ededed;border-radius:14px;padding:14px 10px}
.notebook-subject,.notebook-book{min-height:40px}
.notebook-subject>span:last-child,.notebook-book>span:last-child{background:#f2f2f2;border-radius:99px;padding:1px 8px;font-size:12px;color:#7c8492;font-weight:500}
.notebook-subject:hover>span:last-child,.notebook-book:hover>span:last-child{background:#ebebeb}
.notebook-subject.active>span:last-child,.notebook-book.active>span:last-child{background:#ededed;color:#808080}
.notebook-question{border:1px solid #ededed;border-radius:12px;padding:16px 18px;background:#fff;transition:border-color .15s,box-shadow .15s}
.notebook-question:hover{border-color:#dbdbdb;box-shadow:0 2px 10px rgba(24,32,46,.05)}
.notebook-question.selected{border-color:#d4d4d4;background:#fcfcfc}
.notebook-question-title{font-size:14px;color:#404040;margin:2px 0 10px}
.notebook-question-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding-top:11px;border-top:1px solid #f2f2f2}
.notebook-question-foot .notebook-tags{margin:0}
.notebook-question-foot small{color:#ababab;flex:none}
.notebook-tags button{background:#f5f5f5;color:#787878;font-weight:500}
.notebook-tags button:hover{background:#ededed;color:#808080}
.review-badge{background:#fef1f0;color:#b3453c;border:1px solid #f5d8d5;font-weight:600}
.tag.blue{background:#f0f0f0;color:#808080;font-weight:600}
.tag.amber{background:#fdf1df;color:#a06a1b;font-weight:600}
.tag.green{background:#ebebeb;color:#4c4c4c;font-weight:600}
.notebook-selection{flex-wrap:wrap;gap:10px 18px;margin:18px 0 8px}
.notebook-filters{gap:10px}
.notebook-batch{gap:14px;padding:14px 4px 4px}
.notebook-batch>span{color:#949494}
.notebook-batch>div{gap:8px}
.notebook-batch #nb-delete{order:5;margin-left:8px}
.empty-state .empty-icon{font-size:22px}

/* ===== 教材库视觉优化 ===== */
.textbook-upload-panel{display:flex;align-items:center;justify-content:space-between;gap:28px;padding:22px 26px;border:1px solid #e8e8e8;border-radius:16px;background:linear-gradient(180deg,#fcfcfc,#fff);margin-bottom:22px;flex-wrap:wrap}
.textbook-upload-copy strong{font-size:16px;color:#292929;display:block}
.textbook-upload-copy p{margin:7px 0 0;font-size:13px;color:#7d8490;max-width:600px;line-height:1.7}
.textbook-upload-side{display:flex;flex-direction:column;align-items:flex-end;gap:9px;flex:none}
.textbook-upload-side .primary-button{margin:0}
.textbook-upload-hint{font-size:12px;color:#a3a3a3;max-width:270px;text-align:right;line-height:1.6}
.textbook-list{margin-top:4px}
.textbook-row{display:flex;gap:16px;align-items:flex-start;padding:18px 10px 18px 12px;border-top:1px solid #f0f0f0;border-radius:10px;transition:background .15s}
.textbook-row:first-child{border-top:0}
.textbook-row:hover{background:#fcfcfc}
.textbook-row.failed{background:#fffafa}
.textbook-row.failed:hover{background:#fdf6f5}
.textbook-cover{width:42px;height:56px;border-radius:5px 9px 9px 5px;background:linear-gradient(150deg,#808080,#b2b2b2);color:#fff;display:grid;place-items:center;font-size:19px;font-weight:600;flex:none;box-shadow:inset -5px 0 0 #636363,0 3px 9px rgba(38,64,140,.16)}
.textbook-row{min-width:0}.textbook-row-copy{flex:1;min-width:0}
.textbook-row-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.textbook-row-title{background:none;border:0;padding:0;font-size:14.5px;font-weight:600;color:#363636;text-align:left;overflow-wrap:anywhere;cursor:pointer}
.textbook-row-title:hover{color:#808080;text-decoration:underline}
.textbook-row-copy>p{font-size:12.5px;color:#949494;margin:5px 0 0}
.textbook-row-stats{display:flex;align-items:center;gap:9px;margin-top:9px;flex-wrap:wrap}
.textbook-stat{font-size:12.5px;color:#767f8d}
.textbook-stat-dot{color:#d4d4d4}
.textbook-progress{width:110px;height:5px;background:#ededed;border-radius:99px;overflow:hidden;flex:none}
.textbook-progress i{display:block;height:100%;background:linear-gradient(90deg,#919191,#b2b2b2);border-radius:99px}
.textbook-row-fail{display:flex;align-items:center;gap:10px;margin-top:10px;padding:8px 11px;background:#fdf3f2;border:1px solid #f3d9d6;border-radius:8px;overflow:hidden;min-width:0;max-width:100%}
.textbook-row-fail span{flex:1;min-width:0;font-size:12.5px;color:#a2524a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.textbook-row-fail .small-button{flex:none}
.textbook-row-link{border:0;background:transparent;color:#bfbfbf;font-size:22px;line-height:1;padding:6px 4px;flex:none;cursor:pointer;transition:color .15s}
.textbook-row:hover .textbook-row-link{color:#808080}
.textbook-empty{padding:46px 20px;text-align:center;color:#949494}
.textbook-empty strong{display:block;color:#545454;font-size:15px}
.textbook-empty p{font-size:13px;line-height:1.8;max-width:360px;margin:8px auto 0}
@media(max-width:680px){
  .textbook-upload-panel{flex-direction:column;align-items:stretch;gap:14px;padding:18px}
  .textbook-upload-side{align-items:flex-start}
  .textbook-upload-hint{text-align:left;max-width:none}
  .textbook-row{padding:14px 4px;gap:12px}
  .textbook-cover{width:34px;height:46px;font-size:16px}
  .textbook-row-stats{gap:7px}
  .notebook-question{padding:13px 12px}
  .notebook-question-foot{flex-direction:column;align-items:flex-start;gap:8px}
  .notebook-batch>div{flex-wrap:wrap}
}


/* ===== 黑白灰主题：变量统一重定义（蓝/绿装饰色全部退场，仅保留错误红与警告琥珀） ===== */
:root{--green:#1f2124;--green-dark:#000;--mint:#f1f2f4}
/* ===== 黑白灰主题强调层：主操作/焦点/控件统一墨黑 ===== */
.primary-button{background:#1f2124}
.primary-button:hover{background:#000}
input[type="checkbox"],input[type="radio"]{accent-color:#1f2124}
.nav-item:focus-visible,.composer-tool:focus-visible,.send-button:focus-visible,button:focus-visible,a:focus-visible{outline-color:#1f1f1f}
.textbook-progress i{background:#1f2124}
.context-meter span{background:#1f2124}
.context-ring .ring-fill{stroke:#1f2124}

/* ===== 知识库引用菜单：列表可滚动、条目整理、箭头内收 ===== */
.composer-menu .knowledge-list{max-height:244px;overflow-y:auto;overscroll-behavior:contain;margin:0 -4px;padding:0 4px 2px;scrollbar-width:thin}
.composer-menu .knowledge-list::-webkit-scrollbar{width:5px}
.composer-menu .knowledge-list::-webkit-scrollbar-thumb{background:#dedede;border-radius:3px}
.knowledge-option{min-height:52px;gap:10px;padding:8px 10px}
.knowledge-option:hover{background:#f6f6f6}
.knowledge-option:has(input:checked){background:#f2f2f2}
.knowledge-option:has(input:checked) .knowledge-copy strong{color:#111}
.knowledge-option .source-mini{flex:none;width:34px;height:24px;display:grid;place-items:center;padding:0;border-radius:5px;background:#f2f2f2;color:#8b8b8b;font-size:10px;font-weight:600;letter-spacing:.4px}
.knowledge-option .knowledge-copy small{font-size:12px;color:#8a9098}
.knowledge-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;padding:9px 10px 2px;border-top:1px solid #f0f0f0;font-size:12px;color:#949aa2}
.knowledge-foot .text-link{font-size:12px;padding:0}
.knowledge-empty .text-link{color:#7c7c7c}

/* ===== 下拉框：自定义小箭头，内收不贴边线 ===== */
.select,:is(.workflow-page,.settings-workspace,.intelligent-card,.camera-device-picker) .select{appearance:none;-webkit-appearance:none;padding-right:36px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23767c85' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}

/* ===== 学习资料列表：卡片化整理 ===== */
#source-list{display:grid;gap:12px}
.document-row{padding:16px 18px 14px;border:1px solid #ebebeb;border-radius:13px;background:#fff}
.document-row .document-warning{margin:12px 0 0}
.document-actions{margin-top:13px;padding:12px 0 0;border-top:1px solid #f2f2f2;flex-wrap:wrap;row-gap:8px}
.document-more{position:relative;margin-left:auto;font-size:13px}
.document-more>div{top:calc(100% + 4px)}

/* ===== 输入区右下角：模型箭头与边缘留出间距 ===== */
.composer-cluster{margin-right:4px}
.chat-model-trigger .chevron{border-right-color:#82878f;border-bottom-color:#82878f}

/* ===== 弹出菜单整体限高：矮窗口内可滚，不顶出视野 ===== */
.composer-menu{max-height:calc(100vh - 150px);max-height:calc(100svh - 150px);overflow-y:auto;overscroll-behavior:contain}

/* ===== 说明收纳：小 ⓘ 圆圈，悬停/点按展开解释 ===== */
.info-dot{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;margin-left:7px;padding:0;border:1px solid #cfcfcf;border-radius:50%;background:#fff;color:#8b8b8b;font-size:12px;font-style:italic;font-family:Georgia,'Times New Roman',serif;line-height:1;vertical-align:1px;cursor:help;position:relative;-webkit-tap-highlight-color:transparent}
.info-dot:hover,.info-dot:focus,.info-dot:focus-visible{border-color:#8f8f8f;color:#4c4c4c;outline:none}
.info-dot::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 9px);transform:translateX(-50%) translateY(3px);width:max-content;max-width:250px;padding:8px 11px;border:1px solid #e4e4e4;border-radius:9px;background:#fff;color:#5c5c5c;font-size:12px;font-style:normal;font-family:'DM Sans','Noto Sans SC',sans-serif;font-weight:400;line-height:1.65;text-align:left;white-space:normal;box-shadow:0 10px 28px rgba(20,20,20,.12);opacity:0;pointer-events:none;transition:opacity .15s,transform .15s;z-index:30}
.info-dot:hover::after,.info-dot:focus::after,.info-dot:focus-visible::after{opacity:1;transform:translateX(-50%) translateY(0)}
.info-dot.tip-open::after{opacity:1;transform:translateX(-50%) translateY(0)}
.info-dot.tip-open{border-color:#8f8f8f;color:#4c4c4c}

/* ===== 恢复模型用量热力图绿色梯度（用户指定保留） ===== */
.usage-cell,.usage-legend i{background:#eceef1}
.usage-cell.level-1,.usage-legend i.level-1{background:#d9eadd}
.usage-cell.level-2,.usage-legend i.level-2{background:#a8d1b1}
.usage-cell.level-3,.usage-legend i.level-3{background:#65a879}
.usage-cell.level-4,.usage-legend i.level-4{background:#28764b}

/* ===== 学习资料：知识库 / 教材库 平级双区 ===== */
.library-zone-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.library-zone-title h2{font-size:17px;line-height:1.5;font-weight:650;color:#292929;margin:0}
.library-zone-title>span{display:block;font-size:13px;color:#8a9099;margin-top:3px}
.library-zone-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.library-zone-actions .select{width:215px}
.library-zone .library-drop{margin:0 0 14px}
.library-zone .document-filters{margin-bottom:12px}
@media(max-width:680px){.library-zone-actions{width:100%}.library-zone-actions .select{flex:1;width:auto;min-width:0}}

/* ===== 黄色警告收起：单行紧凑，悬停/点按展开全文 ===== */
.document-warning{display:flex;align-items:baseline;gap:7px;max-height:30px;overflow:hidden;padding:5px 11px;border:0;border-left:3px solid #e0b26e;border-radius:7px;background:#faf7f1;color:#8a6f45;font-size:12.5px;line-height:1.5;cursor:default;transition:max-height .18s ease}
.document-warning::before{content:"⚠";flex:none;font-size:11px;color:#c69a4e;transform:translateY(1px)}
.document-warning:hover,.document-warning:focus-within{max-height:240px}

/* ===== 教材库蓝色主题恢复层（用户指定；仅作用于教材库页元素） ===== */
.textbook-cover{background:linear-gradient(150deg,#3159cc,#6f96f4);color:#fff;box-shadow:inset -5px 0 0 #26469f,0 3px 9px rgba(38,64,140,.16)}
.textbook-upload-panel{background:linear-gradient(180deg,#fafcff,#fff);border-color:#e5e7eb}
.textbook-row-title:hover{color:#3159cc}
.textbook-row{border-top:1px solid #eceef2}
.textbook-progress{background:#e9ecf2}
.textbook-progress i{background:linear-gradient(90deg,#3b6fe8,#6f96f4)}
.textbook-row-link{color:#b6bdc8}
.textbook-row-link:hover{color:#3159cc}
.textbook-row .tag.blue,.textbook-detail .tag.blue{background:#e3ecfc;color:#3a5ec7;font-weight:600}

/* ===== 答案条目紧凑排版修正层 ===== */
.exam-answer-item .exam-answer-line{display:flex;gap:2mm;align-items:baseline}
.exam-answer-item .exam-answer-line>b{flex:none;font-size:11pt}
.exam-answer-item .exam-reference-answer p{margin:0}
.exam-answer-item .exam-reference-answer p+p{margin-top:1.5mm}
.exam-answer-item .exam-explanation{margin-top:1.5mm}
.exam-answer-item .exam-explanation b{margin-right:2mm}
.exam-answer-item .exam-explanation p{margin:0}
.exam-answer-item .exam-explanation p:first-of-type{display:inline}
.exam-answer-item .exam-explanation p+p{margin-top:1.5mm}

/* Keep account settings reachable on narrow phones. */
@media(max-width:420px){.mobile-profile-toggle{display:grid;place-items:center;flex:none}}

.backup-tools{padding:14px 0;border-bottom:1px solid #eee;margin-bottom:16px}.backup-tools .modal-actions{justify-content:flex-start;flex-wrap:wrap}.backup-tools p{font-size:13px;line-height:1.7;color:#69707b}
