*{box-sizing:border-box}html{--ink:#2e2938;--accent:#725398;--wash:#ede3f6;--dark:#593779;color:var(--ink);background-color:#f8f5ef;background-image:radial-gradient(#dcd5c9 1px,transparent 1px);background-size:19px 19px;font:16px/1.6 "DM Sans","PingFang SC","Microsoft YaHei",sans-serif}body{margin:0}main{width:min(100% - 32px,860px);margin:auto;padding-bottom:max(36px,env(safe-area-inset-bottom))}header,.bar,.actions,#wait{display:flex;align-items:center;gap:10px}header{padding:18px 0;border-bottom:1px solid #cfc8bd}header strong{font:italic 700 27px Georgia,serif;letter-spacing:-1px}.brandmark{display:grid;place-items:center;background:var(--ink);color:#f8eca7;border-radius:11px;width:34px;height:34px;font-size:24px}button,select,.file{font:inherit;color:inherit;border:1px solid #d2cbd4;background:#fffdf9;border-radius:12px;padding:8px 14px;cursor:pointer}button:hover,.file:hover{border-color:var(--accent)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:2px}header button,.bar button,#send,#seconds{margin-left:auto}.solid{background:var(--ink);color:white;border-color:var(--ink);font-weight:700}#signin{width:min(100%,390px);margin:10vh auto;padding:28px;background:#fffdf9;border:1px solid #d6ced8;border-radius:22px;box-shadow:5px 6px 0 var(--wash)}h1,h2,p{margin:0}#signin h1{margin-bottom:22px;font-size:28px}input:not([type=file]),textarea,select{width:100%;font:inherit;color:var(--ink);border:1px solid #cfc7d0;border-radius:10px;padding:10px 12px;background:white}#login input{margin:4px 0 14px}#login button{width:100%}#subjects{display:flex;flex-wrap:wrap;gap:6px;padding:19px 0 14px}#subjects button{flex:1 0 auto;font-weight:650;padding:7px 12px}#subjects button[aria-pressed=true]{background:var(--dark);border-color:var(--dark);color:white}.cover{display:flex;align-items:center;justify-content:space-between;position:relative;overflow:hidden;padding:22px 28px;background:var(--wash);border:1px solid #cec5d0;border-radius:20px;background-image:linear-gradient(90deg,#ffffff50 1px,transparent 1px),linear-gradient(#ffffff50 1px,transparent 1px);background-size:20px 20px}.cover h1{font-size:clamp(26px,4vw,36px);letter-spacing:-1px}.cover button{padding:4px 12px;margin-top:6px;font-size:14px}.illustration{width:130px;height:93px;position:relative;flex-shrink:0}.sheet,.pencil{display:block;position:absolute}.sheet{width:58px;height:70px;top:14px;left:28px;border:2px solid var(--ink);border-radius:5px}.back{background:#ffe598;transform:rotate(-16deg)}.front{transform:translate(12px,-6px) rotate(9deg);background:repeating-linear-gradient(0deg,#fffdf5 0 10px,#d2cfda 10px 11px);box-shadow:3px 3px 0 #3526412b}.front:after{content:'✧';position:absolute;font:700 28px Georgia;color:var(--dark);right:4px;top:-5px}.pencil{width:12px;height:60px;right:14px;bottom:8px;transform:rotate(28deg);background:#ffa78f;border:2px solid var(--ink);border-radius:4px 4px 1px 1px}.pencil:after{content:'';position:absolute;bottom:-10px;left:-2px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:10px solid var(--ink)}.bar{margin:20px 0 10px}.bar h2,#askLabel{font-size:18px;font-weight:750}.bar button{font-size:14px}article,#ask,.live{padding:18px 20px;margin:12px 0;border:1px solid #d7d0d7;background:#fffdf9;border-radius:16px}article h2{font-size:14px;color:var(--dark);margin-bottom:5px}article p,.live{white-space:pre-wrap;overflow-wrap:anywhere}article p+p,article p+h2{margin-top:15px}article img{width:100%;height:auto}.transcript{background:var(--wash);padding:12px;border-radius:10px}.katex-display{overflow-x:auto;overflow-y:hidden;max-width:100%}#ask textarea{margin:8px 0 6px;resize:vertical;min-height:84px}.actions{flex-wrap:wrap}.file{position:relative;overflow:hidden;font-size:14px}.file input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}#chosen{font-size:13px}.solid{padding-inline:22px}#wait{margin:10px 0;background:var(--wash);padding:9px 14px;border-radius:12px;color:var(--dark)}#wait i{width:9px;height:9px;border-radius:50%;background:var(--accent)}#seconds{font-variant-numeric:tabular-nums}#status,#listMsg{margin-top:8px;color:#833f30}dialog{width:min(92vw,550px);max-height:78vh;overflow:auto;border:1px solid #c8bdca;border-radius:18px;padding:18px 22px;background:#fffcf6;color:var(--ink)}dialog::backdrop{background:#21192c66}dialog .bar{margin:0 0 12px}#oldQuestions button{display:block;text-align:left;width:100%;margin:6px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}details{border-top:1px solid #d2cbd4;margin-top:14px;padding-top:12px}summary{cursor:pointer}details label{display:block;margin:8px 0 4px}#fileOld{margin-top:8px}button:disabled,input:disabled{opacity:.55}[hidden]{display:none!important}@media(max-width:550px){main{width:calc(100% - 24px)}header{padding:10px 0}#subjects{gap:5px;padding:12px 0}#subjects button{padding:6px 9px;font-size:14px;min-height:36px}.cover{padding:16px}.illustration{transform:scale(.85);transform-origin:right center;width:104px;height:83px}article,#ask{padding:14px}.bar{margin-top:14px}.actions{gap:6px}.solid{padding-inline:16px}}

#wait{position:fixed;z-index:4;bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);box-shadow:0 3px 18px #30203926;border:1px solid #b5a6bd;pointer-events:none}
#seconds{margin-left:8px}.live p{margin-top:5px}.file:focus-within{outline:3px solid var(--accent)}

#accountName{margin-left:auto;font-size:14px}#changeBtn,#exit{margin-left:0;padding:6px 9px;font-size:14px}
#firstFields{border:0;padding:0;margin:0}#changeForm label{display:block;margin:8px 0}#changeMsg{color:#833f30}
@media(max-width:430px){header{gap:6px}header strong{font-size:21px}.brandmark{width:26px;height:26px}#changeBtn,#exit{padding:5px}}

#wait{flex-wrap:wrap;justify-content:center;pointer-events:auto}
#wait button,.reviewLink,#reviewFailed{color:var(--dark);min-height:44px;font-weight:650}
.reviewLink{margin-top:12px}.opinion{border-inline-start:4px solid var(--dark)}
#reviewDialog label{display:block;font-weight:700;margin:12px 0 4px}
#reviewDialog textarea{resize:vertical;line-height:1.55}
.reviewHint,#reviewMsg{font-size:14px;margin:6px 0 10px}

#modelPanel{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap;margin:14px 0 0;padding:12px 15px;border:1px solid #cfc5d3;border-radius:14px;background:#fffdf9}
#modelPanel strong{color:var(--dark)}#modelClock{font-variant-numeric:tabular-nums;white-space:nowrap}
#modelNote{font-size:14px}#reloadModel{min-height:44px;margin-left:auto}

#reviewPicture{margin:12px 0;padding:10px;border:1px solid #cfc5d3;border-radius:10px}
#reviewPicture label{display:block}#pictureFile{display:block;max-width:100%}
#picturePreview{max-width:100%;max-height:180px;object-fit:contain;margin-top:6px}
#reviewPicture input[type=checkbox]{width:auto}
