*{box-sizing:border-box}
:root{font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color-scheme:light;--purple:#7545e7;--purple-dark:#6031c9;--ink:#30263f;--muted:#91859e}
html,body{margin:0;min-height:100%}
body{height:100vh;height:100dvh;display:flex;flex-direction:column;padding:0 clamp(16px,3vw,48px);overflow:hidden;background:#4d4d69 url("/static/campus.jpg") center/cover fixed no-repeat;color:var(--ink)}
.campus-shade{position:fixed;inset:0;background:rgba(29,32,56,.43);z-index:-1}
button,textarea{font:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:not-allowed}
button:focus-visible,a:focus-visible{outline:3px solid #c8b0ff;outline-offset:4px}
[hidden]{display:none!important}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.brandbar{width:min(1440px,100%);height:100px;flex:0 0 100px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:24px;color:#fff}
.brand{display:flex;align-items:center;gap:13px;color:inherit;text-decoration:none;min-width:0}
.brand img{width:52px;height:52px;border-radius:50%;border:3px solid #fff;background:#fff;object-fit:contain;flex:none}
.school-name{font-size:24px;font-weight:750;letter-spacing:.5px;white-space:nowrap}
.school-name small{display:block;font-size:11px;font-weight:400;letter-spacing:2px;margin-top:6px;opacity:.85}
.header-actions{display:flex;align-items:center;gap:14px;flex:none}
.app-name{font-size:15px;font-weight:500;letter-spacing:2px;margin-right:4px}
.class-status{display:flex;align-items:center;gap:7px;font-size:12px;line-height:1.4;padding:9px 12px;border-radius:99px;color:#fff;background:#ffffff1c;border:1px solid #ffffff26;white-space:nowrap}
.class-status i{width:6px;height:6px;border-radius:100%;background:#d4cbdc;flex:none}
.class-status.open{color:#d5ffed;background:#164f42aa;border-color:#b8f1d433}
.class-status.open i{background:#5de2aa}
.new-chat{display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid #ffffffbf;border-radius:11px;background:#fff;color:#65488c;font-size:13px;font-weight:600;padding:10px 14px;white-space:nowrap}
.new-chat svg{width:17px;height:17px}
.new-chat:hover:enabled{background:#f4ecff;border-color:#fff}
.new-chat:disabled{opacity:.6}
.workspace{width:min(1120px,100%);min-height:0;flex:1 1 0;margin:0 auto;display:flex;flex-direction:column;position:relative}
.workspace.is-empty{justify-content:center;padding:0 0 42px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#ffffff66 transparent}
.chat-body{min-height:0}
.is-empty .chat-body{flex:0 0 auto;overflow:visible}
.welcome{text-align:center;padding:16px 24px 28px}
.welcome h1{font-size:clamp(30px,3.1vw,43px);line-height:1.3;letter-spacing:1px;font-weight:700;color:#fff;text-shadow:0 2px 18px #1b173c33;margin:0}
.composer-wrap{width:calc(100% - 48px);max-width:860px;flex:none;align-self:center;margin:0}
.composer{border:1px solid #fff;border-radius:21px;background:#fff;padding:20px 22px 16px;box-shadow:0 18px 55px #20163229}
.composer:focus-within{border-color:#c8aff9;box-shadow:0 0 0 3px #b597f333,0 18px 55px #20163229}
textarea{display:block;resize:none;outline:none;border:0;background:transparent;width:100%;height:68px;min-height:68px;max-height:68px;padding:0;line-height:1.7;font-size:18px;color:var(--ink);overflow-y:auto}
textarea::placeholder{color:#aaa0b5;opacity:1}
textarea:disabled{background:transparent}
.composer-bottom{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:12px}
.send-group{display:flex;align-items:center;gap:14px}
#charCount{font-size:11px;color:#ad9fb8;white-space:nowrap}
.send-button,.stop-button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:9px 17px;border-radius:11px;font-size:14px;font-weight:600;border:1px solid transparent;white-space:nowrap}
.send-button{background:var(--purple);color:#fff;box-shadow:0 4px 12px #7545e726}
.send-button:hover:enabled{background:var(--purple-dark)}
.send-button:disabled{opacity:.58;box-shadow:none}
.send-button svg{width:18px;height:18px}
.stop-button{background:#f6f1fc;border-color:#e7dcf7;color:#7855a2}
.stop-button span{font-size:11px}
.notice{padding:0 3px;margin:10px 0 0;font-size:12px;line-height:1.6;color:#fff}
.notice.error{color:#ffe3e8}
.composer-foot{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:14px;row-gap:6px;margin-top:12px;padding:0 3px;font-size:11px;line-height:1.5;color:#ffffffe0}
#quota{white-space:nowrap}
.composer-foot #quota{justify-self:start}
.answer-reminder{justify-self:center;text-align:center}
.suggestions{display:flex;align-items:center;justify-content:center;gap:10px;margin:21px auto 0;flex:none;max-width:100%;padding:0 16px}
.prompt-chip{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:12px;font-weight:600;line-height:1.5;padding:9px 14px;border:1px solid transparent;border-radius:99px;white-space:nowrap}
.prompt-chip svg{width:18px;height:18px}
.prompt-chip.violet{background:#f1e9ff;color:#7141c5;border-color:#dcc8ff}
.prompt-chip.blue{background:#e8f1ff;color:#3271c4;border-color:#c4dcff}
.prompt-chip.green{background:#e4f6ed;color:#168a60;border-color:#bce5cf}
.prompt-chip.violet:hover{background:#e5d5ff}
.prompt-chip.blue:hover{background:#d5e5ff}
.prompt-chip.green:hover{background:#ccebdc}
.page-footer{width:min(1440px,100%);flex:0 0 42px;min-height:42px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:11px;line-height:1.5;color:#ffffffc9}
.page-footer a{color:inherit;text-decoration:none;white-space:nowrap}
.page-footer a:hover{color:#fff}
.page-footer a span{margin-left:3px}
.toast{position:fixed;left:50%;bottom:42px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:12px 18px;background:#2e2343;color:#fff;box-shadow:0 8px 24px #221a3133;border-radius:11px;font-size:13px;line-height:1.5;text-align:center;z-index:10}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

/* A readable conversation surface appears after the first question. */
.workspace.is-chatting{border:1px solid #ffffff66;border-radius:25px;background:#fff;padding:0 0 12px;box-shadow:0 18px 60px #1e17372b;overflow:hidden}
.is-chatting .chat-body{flex:1 1 0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ccc1d8 transparent}
.is-chatting .composer-wrap{width:calc(100% - 40px);max-width:1040px}
.is-chatting .composer{display:flex;align-items:center;gap:12px;border-color:#e6ddef;border-radius:15px;padding:10px 12px;box-shadow:none}
.is-chatting .composer:focus-within{border-color:#bca0ee;box-shadow:0 0 0 3px #7545e70a}
.is-chatting textarea{flex:1 1 0;min-width:0;font-size:15px;line-height:22px;height:44px;min-height:44px;max-height:44px}
.is-chatting .composer-bottom{flex:none;margin-top:0}
.is-chatting .send-group{gap:10px}
.is-chatting .composer-foot{color:#a59aac;font-size:10px;margin-top:6px}
.is-chatting #quota{color:#8a69ad}
.is-chatting .notice{color:#8b7b9b;margin-top:8px}
.is-chatting .notice.error{color:#b33d59}
.messages{width:min(1040px,100%);margin:0 auto;padding:20px 24px;display:flex;flex-direction:column;gap:18px}
.messages:empty{padding:0}
.message{display:flex;gap:10px;align-items:flex-start}
.message.user{flex-direction:row-reverse}
.message-avatar{display:grid;place-items:center;width:26px;height:26px;flex:none;background:#f1e9ff;color:#8a58d9;border-radius:9px;font-size:18px}
.user .message-avatar{background:#f3eff8;color:#8f7aab;font-size:11px}
.message-content{min-width:0;max-width:86%}
.assistant .message-content{flex:1;max-width:calc(100% - 36px)}
.bubble{font-size:15px;line-height:1.65;overflow-wrap:anywhere;color:#40364f}
.user .bubble{border-radius:14px 4px 14px 14px;background:#f0eafa;padding:8px 13px;white-space:pre-wrap}
.bubble p{margin:0 0 7px}
.bubble p:last-child{margin:0}
.bubble h2,.bubble h3,.bubble h4{font-size:17px;line-height:1.5;margin:10px 0 6px}
.bubble ul,.bubble ol{padding-left:22px;margin:6px 0}
.bubble pre{padding:15px;background:#f5f2f9;border-radius:10px;white-space:pre-wrap;font-size:14px;line-height:1.7}
.bubble code{font-family:Consolas,monospace;background:#f2edf8;border-radius:4px;padding:2px 5px;font-size:.9em}
.bubble pre code{background:none;padding:0}
.bubble table{width:100%;border-collapse:collapse;font-size:14px;margin:12px 0}
.bubble th,.bubble td{padding:8px;text-align:left;border:1px solid #e9e2f1}
.bubble th{background:#f8f5fc}
.bubble blockquote{margin:10px 0;border-left:3px solid #ccb6ed;padding-left:13px;color:#8c7b9c}
.message-tools{display:flex;align-items:center;gap:12px;margin-top:4px}
.copy-button{border:0;background:none;color:#a495b2;font-size:11px;padding:3px 0}
.copy-button:hover{color:var(--purple)}
.message-note{font-size:11px;color:#a495b2}
.message-note.error{color:#b33d59}

@media(max-height:760px) and (min-width:761px){
 .brandbar{height:78px;flex-basis:78px}
 .workspace.is-empty{padding-bottom:24px}
 .welcome{padding-top:12px;padding-bottom:23px}
 .welcome h1{font-size:35px}
 .composer{padding:17px 20px 13px}
 textarea{height:60px;min-height:60px;max-height:60px;font-size:17px}
 .suggestions{margin-top:17px}
 .page-footer{min-height:34px;flex-basis:34px}
}
@media(max-height:650px) and (min-width:761px){
 .brandbar{height:68px;flex-basis:68px}
 .brand img{width:44px;height:44px}
 .school-name{font-size:21px}
 .school-name small{font-size:10px;margin-top:4px}
 .workspace.is-empty{padding-bottom:16px}
 .welcome{padding-bottom:19px}
 .welcome h1{font-size:31px}
 .composer{padding:14px 17px 11px}
 textarea{height:52px;min-height:52px;max-height:52px;font-size:17px}
 .composer-bottom{margin-top:8px}
 .send-button,.stop-button{min-height:36px;padding:7px 14px}
 .composer-foot{margin-top:9px}
 .suggestions{margin-top:15px}
 .prompt-chip{padding:8px 12px}
 .page-footer{min-height:30px;flex-basis:30px}
}
@media(max-width:1000px) and (min-width:761px){
 .school-name{font-size:21px}
 .brand img{width:46px;height:46px}
 .header-actions{gap:9px}
 .app-name{font-size:13px;margin-right:0}
 .class-status{font-size:11px;padding:8px 10px}
 .new-chat{font-size:12px;padding:9px 11px}
}
@media(max-width:760px){
 body{padding:0 16px;background-position:46% center}
 .brandbar{height:auto;min-height:118px;flex:0 0 auto;flex-wrap:wrap;gap:12px;padding:15px 0 12px}
 .brand{gap:10px}
 .brand img{width:43px;height:43px}
 .school-name{font-size:19px}
 .school-name small{font-size:9px;letter-spacing:1.5px;margin-top:4px}
 .header-actions{width:100%;justify-content:space-between;gap:9px}
 .app-name{font-size:12px;letter-spacing:1.5px;margin:0}
 .class-status{font-size:11px;padding:7px 10px}
 .new-chat{font-size:12px;padding:8px 11px;border-radius:9px}
 .new-chat svg{width:15px;height:15px}
 .workspace.is-empty{padding-bottom:24px}
 .welcome{padding:12px 4px 23px}
 .welcome h1{font-size:30px;letter-spacing:0}
 .composer-wrap{width:100%}
 .composer{border-radius:18px;padding:16px 15px 13px}
 textarea{font-size:16px;height:64px;min-height:64px;max-height:64px}
 .composer-bottom{justify-content:flex-end;margin-top:10px}
 .send-group{gap:12px}
 .send-button,.stop-button{font-size:13px;padding:8px 13px;min-height:37px}
 #charCount{font-size:10px}
 .composer-foot{font-size:10px;gap:10px;line-height:1.5;margin-top:10px}
 .suggestions{gap:7px;margin-top:17px;padding:0;flex-wrap:wrap}
 .prompt-chip{font-size:11px;padding:8px 10px;gap:5px}
 .prompt-chip svg{width:16px;height:16px}
 .page-footer{font-size:9px;flex-basis:34px;min-height:34px;gap:10px}
 .workspace.is-chatting{border-radius:20px;padding-bottom:10px}
 .is-chatting .composer-wrap{width:calc(100% - 24px)}
 .is-chatting .composer{gap:9px;padding:8px 10px;border-radius:13px}
 .is-chatting textarea{font-size:16px;line-height:22px;height:44px;min-height:44px;max-height:44px}
 .is-chatting .composer-foot{font-size:9px;gap:7px}
 .messages{padding:16px 14px;gap:16px}
 .message{gap:9px}
 .message-avatar{width:25px;height:25px;border-radius:8px}
 .message-content{max-width:calc(100% - 36px)}
 .bubble{font-size:15px}
}
@media(max-width:760px) and (max-height:600px){
 .brandbar{min-height:98px;padding:10px 0 8px;gap:8px}
 .brand img{width:35px;height:35px}
 .school-name{font-size:17px}
 .school-name small{display:none}
 .header-actions{gap:7px}
 .class-status{font-size:10px;padding:6px 9px}
 .new-chat{padding:6px 10px}
 .workspace.is-empty{padding-bottom:8px}
 .welcome{padding:6px 0 14px}
 .welcome h1{font-size:26px}
 .composer{padding:12px}
 textarea{height:46px;min-height:46px;max-height:46px}
 .composer-bottom{margin-top:7px}
 .send-button,.stop-button{min-height:34px;padding-top:6px;padding-bottom:6px}
 .composer-foot{font-size:9px;margin-top:7px}
 .suggestions{margin-top:12px}
 .prompt-chip{font-size:10px;padding:6px 8px}
 .prompt-chip svg{width:14px;height:14px}
 .page-footer{flex-basis:28px;min-height:28px;font-size:8px}
}

/* Students may select a mode only when the teacher allows it. */
.thinking-controls{display:inline-flex;align-items:center;justify-self:end;gap:7px;flex:none}
.thinking-options{display:inline-flex;align-items:center;gap:2px;padding:2px;border:1px solid #e6dcf3;background:#ffffffed;border-radius:99px}
.thinking-option{border:0;border-radius:99px;min-height:22px;padding:3px 9px;background:transparent;color:#8c76a4;font-size:11px;font-weight:600;line-height:1.3;white-space:nowrap}
.thinking-option[aria-pressed="true"]{background:var(--purple);color:#fff}
.thinking-option:hover:enabled{background:#e9dcff;color:#6d3dc5}
.thinking-option[aria-pressed="true"]:hover:enabled{background:var(--purple-dark);color:#fff}
.thinking-option:disabled{opacity:.68}
.thinking-policy{font-size:10px;line-height:1.4;white-space:nowrap;opacity:.9}
.is-chatting .thinking-options{background:#f7f3fc;border-color:#e9e0f3}
@media(max-width:640px){
 .composer-foot{grid-template-columns:minmax(0,1fr) auto}
 .thinking-controls{grid-column:2;grid-row:1}
 .answer-reminder{grid-column:1/-1;grid-row:2}
}
@media(max-width:480px){
 .thinking-controls{gap:5px}
 .thinking-option{font-size:10px;padding:3px 7px}
 .thinking-policy{font-size:9px}
 .composer-foot{column-gap:8px;row-gap:5px}
}
