/* A「清晰秩序」: 正式网页共用样式。 */
body.learner{--accent:#4d61cc;--soft:#edf0ff;--bg:#f5f7fb;--text:#202b43;--muted:#637088;--line:#dfe5ef;--rail:184px;--nav-height:64px;--page-head-height:81px;--page-title-size:21px;--page-head-gutter:36px;display:block;margin:0;padding:0 0 0 var(--rail);background:var(--bg);color:var(--text);font:15px/1.65 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
.learner main{margin:0 auto;max-width:1044px;min-height:100dvh;border:0;border-radius:0;background:transparent;padding:0 32px 40px}
.learner a{color:var(--accent)}.learner :focus-visible{outline:3px solid #a6b5ff;outline-offset:2px}
.learner button,.learner input,.learner textarea,.learner select{font:inherit;border-color:var(--line);border-radius:9px}
.learner button:not(.secondary):not(.danger):not(:disabled){background:var(--accent);color:white}
.learner .secondary,.learner button.link{background:white;color:var(--accent)}
.learner button:disabled{background:#edf0f5;color:#697487;border-color:var(--line)}
.learner h1{font-size:23px;line-height:1.4;margin:0}.learner h2{font-size:20px;line-height:1.45}
.learner .app-nav{position:fixed;z-index:4;inset:0 auto 0 0;width:var(--rail);border:0;border-right:1px solid var(--line);border-radius:0;margin:0;background:white;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:6px;padding:20px 12px}
.app-nav strong{display:block;font-size:18px;color:var(--text);padding:9px 12px 27px}
.learner .app-nav a{display:flex;align-items:center;gap:12px;min-height:48px;text-decoration:none;border:0;border-radius:9px;padding:9px 14px;font-weight:500;color:var(--muted)}
.learner .app-nav a[aria-current=page]{background:var(--soft);color:var(--accent);font-weight:650}
.learner .icon{width:21px;height:21px;flex:none}.learner .app-nav a:hover{background:var(--bg)}
.notebook{--book-gutter:32px;--book-column:980px}
.learner.notebook main{padding-inline:0}
.notebook:not(.task-page):is([data-screen=book],[data-screen=ai]) main{max-width:none}
.notebook-content{max-width:calc(var(--book-column) + 2 * var(--book-gutter));margin-inline:auto;padding-inline:var(--book-gutter)}
.notebook-head{display:flex;align-items:center;gap:16px;min-height:var(--page-head-height);background:white;border-bottom:1px solid var(--line);margin:0 0 20px;padding:12px var(--book-gutter)}
@media(min-width:960px){
 .notebook[data-screen=book] .notebook-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,360px) minmax(0,1fr);padding-inline:max(var(--book-gutter),calc((100% - var(--book-column))/2))}
 .notebook[data-screen=book] #tabs{display:grid;grid-column:2/-1;grid-template-columns:subgrid;column-gap:inherit}
 .notebook[data-screen=book] #search-tools{width:100%;margin:0}.notebook[data-screen=book] #collect-link{justify-self:end}
}
.notebook-head h1{font-size:var(--page-title-size)}
.page-name{display:flex;align-items:baseline;gap:12px;white-space:nowrap}.page-name span{color:var(--muted);font-size:13px}
.learner #notice{background:transparent;padding:0;color:var(--muted);font-size:14px;margin:14px 0}
.notebook #tabs{flex:1;gap:10px;margin:0;justify-content:flex-end}.notebook #search-tools{margin:auto}
.notebook #tabs a,.empty-book a{text-decoration:none}.notebook #collect-link,.notebook #book .empty-book a:first-of-type{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:var(--accent);color:white;border-radius:10px;padding:9px 16px;min-height:44px}
.notebook #collect-link[hidden]{display:none}.notebook #home-book,body[data-screen=book] #book>.touch-collect{display:none}
.notebook[data-screen=chapter] #home-book{display:inline-flex}.notebook[data-screen=ai] #tabs,.notebook[data-screen=detail] #tabs{display:none}
.notebook #book .topic-card,.notebook .empty-book,.notebook #work:not(.chat-panel),.notebook[data-screen=detail] #book,.account #profile-card,.learner .paper{background:white;border:1px solid var(--line);border-radius:16px;padding:22px}
.notebook .empty-book{text-align:center;max-width:520px;margin:8vh auto}.notebook #book .empty-book a{display:block;width:fit-content;margin:.5rem auto;color:var(--accent)}
.topics,.notebook #book .question-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.topic-card small,.knowledge-tags{color:var(--muted)}.topic-card h2{margin:0 0 .6rem}
.notebook #book .topic-card a{display:flex;gap:12px;align-items:center;min-height:60px;padding:8px 0;border-top:1px solid var(--line);text-decoration:none;color:var(--text)}.topic-card a small{margin-left:auto}
.notebook #book .question-list{align-items:stretch}.notebook #book .question-list a{display:flex;flex-direction:column;padding:22px;color:var(--text);background:white;border:1px solid var(--line);border-radius:15px}
.question-list strong{font-size:14px;color:var(--muted)}.question-list p{font-size:16px;line-height:1.65;margin:.7rem 0 1rem}
.question-preview-more{font-size:13px;color:var(--accent);margin:-.35rem 0 1rem}
.question-figures{display:flex;gap:12px;margin:0 0 1rem;min-width:0}
.question-figure{display:flex;align-items:center;justify-content:center;flex:1;min-width:0;height:140px;padding:6px;background:var(--bg);border-radius:8px}
.question-list .question-figure canvas{display:block;width:100%;height:100%;object-fit:contain}
.question-figure canvas[hidden]{display:none}.question-figure small{font-size:13px;color:var(--muted)}
.question-figure-count{font-size:12px;color:var(--muted);margin:-.4rem 0 1rem}
.knowledge-tags{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:auto;border-top:1px solid var(--line);padding-top:12px}.knowledge-tags span,.recommendation,.progress-label{font-size:13px;padding:3px 8px;background:var(--soft);color:var(--accent);border-radius:5px}
.notebook[data-screen=ai] #work{max-width:880px;margin:auto}.notebook .chat-panel{display:flex;flex-direction:column;align-items:stretch;min-height:calc(100dvh - 190px)}
.notebook .chat-panel>h2{margin-bottom:0}.notebook .chat-panel>a{width:fit-content;color:var(--accent)}.notebook .chat-panel article{background:white;border:1px solid var(--line);border-radius:14px;padding:16px}
.notebook .chat-panel form.composer{position:sticky;bottom:0;z-index:1;background:var(--bg);padding:10px 0;margin:auto 0 0;gap:6px}
.composer>label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;margin:0}.composer select{width:auto;min-height:36px;background:white}
.composer-bar{display:flex;align-items:flex-end;gap:6px;background:white;border:1px solid var(--line);padding:7px;border-radius:18px}.composer-bar label{flex:1;margin:0}
.notebook .chat-panel .composer-bar textarea{min-height:44px;max-height:8rem;field-sizing:content;resize:none;border:0}.composer-bar button{flex:none;width:44px;height:44px;margin:0;display:grid;place-items:center;border-radius:50%}
.learner .composer-bar button:first-child{color:var(--accent);background:var(--soft);border:0}
.learner #work svg.icon{border:0}.notebook #work fieldset{border:1px solid var(--line);border-radius:12px}.notebook #work input{accent-color:var(--accent)}
.notebook #work label small:not(.recommendation){color:var(--muted)}.action-row{display:flex;gap:10px;margin-top:18px}.action-row button{flex:1}
.notebook #work details,.notebook[data-screen=detail] #book details{background:#f8f9fd;border:1px solid var(--line);border-radius:10px;margin:12px 0;padding:4px 12px}
.learner dialog{max-height:85dvh;width:min(510px,calc(100% - 28px));border:1px solid var(--line);border-radius:16px;color:var(--text);padding:22px}.learner dialog::backdrop{background:#202b4373}
.photo-tools{display:flex;gap:10px}.photo-tools label{display:block;flex:1;color:var(--accent);border:1px solid var(--line);border-radius:9px;text-align:center;padding:10px;cursor:pointer;position:relative}.photo-tools input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}.photo-tools label:focus-within{outline:2px solid var(--accent)}.photo-tools label.phone-camera{display:none}
.learner .thumbs{list-style:none;display:flex;gap:8px;overflow:auto;padding:2px;margin:0}.thumbs:empty{display:none}.learner .thumbs li{flex:0 0 78px;height:76px;position:relative;border:1px solid var(--line);border-radius:10px;background:white;overflow:hidden;padding:0}.thumbs img{width:100%;height:100%;object-fit:cover}.learner .thumbs button{position:absolute;right:0;top:0;width:30px;min-height:30px;padding:0;margin:0;border:0}.learner .thumbs .more-photos{inset:0;width:100%;height:100%}
.task-page .app-nav{display:none}.learner.task-page{padding-left:0}
@media(max-width:959px){
 body.learner{--page-head-height:64px;--page-title-size:19px;--page-head-gutter:17px;padding:0 0 calc(var(--nav-height) + env(safe-area-inset-bottom))}.learner main{padding:0 16px 24px;min-height:0}
 .learner .app-nav{inset:auto 0 0;width:auto;display:grid;grid-template-columns:repeat(4,1fr);height:calc(var(--nav-height) + env(safe-area-inset-bottom));padding:4px 6px calc(4px + env(safe-area-inset-bottom));border:0;border-top:1px solid var(--line);gap:0}
 .learner .app-nav strong{display:none}.learner .app-nav a{font-size:12px;gap:1px;align-items:center;justify-content:center;flex-direction:column;padding:3px}.learner.task-page .app-nav{display:none}
 .notebook{--book-gutter:16px}.notebook-head{min-height:var(--page-head-height);margin-bottom:12px;padding:9px var(--page-head-gutter)}
 .page-name{display:grid;gap:0}.page-name span{font-size:12px}.topics,.notebook #book .question-list{grid-template-columns:1fr;gap:16px}
 .notebook #tabs{gap:8px}.notebook #search-tools{margin-left:auto;margin-right:0;flex:0}.notebook #search-fields{display:none}.notebook #open-search,.notebook #close-search{display:inline-grid;place-items:center}
 .notebook #tabs.search-expanded #search-tools{flex:1;max-width:none}.notebook #tabs.search-expanded #search-fields{display:flex}.notebook #tabs.search-expanded :is(#collect-link,#open-search),.notebook-head:has(#tabs.search-expanded) .page-name{display:none}
 .photo-tools label.phone-camera{display:block}.notebook .chat-panel{min-height:calc(100dvh - 215px - env(safe-area-inset-bottom))}.notebook .chat-panel form.composer{bottom:calc(var(--nav-height) + env(safe-area-inset-bottom))}
 .notebook #work:not(.chat-panel),.notebook[data-screen=detail] #book{padding:16px}.notebook .empty-book{margin:5vh auto}
}
@media(max-width:959px){body.notebook[data-screen=book]:has(#tabs.search-expanded) #book>.touch-collect{display:inline-flex;min-height:44px;align-items:center;color:var(--accent)}}
.notebook .welcome-chat{background:white;border:1px solid var(--line);border-radius:18px;align-self:center;max-width:600px;padding:28px;text-align:center;margin:18px 0 28px}
.notebook #work .welcome-chat>.icon{box-sizing:content-box;width:26px;height:26px;padding:13px;border-radius:15px;color:var(--accent);background:var(--soft)}
.welcome-chat h2{font-size:clamp(21px,3vw,28px);margin:.5rem 0}.welcome-chat p,.welcome-chat small,.composer>small{color:var(--muted)}
.notebook #work .mode-switch{display:flex;gap:4px;border:0;background:var(--bg);width:fit-content;margin:12px auto;padding:4px}
.notebook #work .mode-switch label{position:relative;display:block;margin:0;padding:0;cursor:pointer;min-height:44px}
.notebook #work .mode-switch input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.mode-switch span{display:block;border-radius:9px;padding:9px 15px}.mode-switch input:checked+span{color:white;background:var(--accent)}.mode-switch input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.chat-tools{display:flex;gap:8px}.notebook .chat-tools a{padding:6px 14px;border:1px solid var(--line);border-radius:9px;text-decoration:none;background:white}
.composer>small{font-size:12px}.notebook #work .collection-choices label{display:grid;grid-template-columns:22px 1fr;align-items:center;gap:3px 8px}
.collection-choices label>small{grid-column:2}.recommendation{white-space:nowrap;margin-left:6px}
.collection-choices{display:grid;gap:12px}.notebook #work .collection-choices fieldset{min-width:0;margin:0}
.detail-question{background:#f8f9fd;padding:12px 18px;border-radius:12px;font-size:18px;margin:14px 0}
@media(min-width:960px){.collection-choices{grid-template-columns:1fr 1fr}.notebook[data-screen=detail] main{max-width:904px}}
@media(max-width:959px){.notebook .welcome-chat{padding:20px 16px;margin:12px 0}.learner .thumbs button{min-width:44px;min-height:44px}}
/* Account and entry use the dimensions of A's profile column and auth shell. */
html:has(body.learner){background:#f5f7fb}.learner.account{min-height:100dvh}.account .account-head{position:sticky;top:0;z-index:2;background:white;border-bottom:1px solid var(--line);padding:18px var(--page-head-gutter);min-height:var(--page-head-height);display:flex;align-items:center}
.account .account-head h1{font-size:var(--page-title-size)}.account #home>h2,.account .auth-brand,.account .register-foot:not(:has(#register-start:not([hidden]))),.account #notice:empty{display:none}
.learner.account:has(#home:not([hidden])) main{padding:0 0 40px;max-width:none}
.account:has(#home:not([hidden])) main>:is(#home,button,#notice){width:min(600px,calc(100% - 34px));margin:16px auto}
.account:has(#home:not([hidden])) main>button{display:block}.account:has(#home:not([hidden])) main>#home{margin-top:28px}
.learner.account #profile-card{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:12px 16px;align-items:center;padding:20px}
.account #profile-card .portrait{width:64px;height:64px;background:#e5e9fc;color:var(--accent);border-radius:16px}.account #profile-card .portrait>span{font-size:16px;font-weight:600}
.account #current-name{font-size:20px;margin:0}.account #current-gender,.account #current-signature{font-size:14px;color:var(--muted)}
.account #current-signature{grid-column:1/-1;border-top:1px solid var(--line);padding-top:12px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.account #edit-profile{width:auto;border:0;background:transparent;padding:8px 12px}.account #account-options{margin-top:32px}
.account #account-options h2{font-size:17px;margin:0 0 12px}.settings-card,.account #profile-editor{background:white;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.account #profile-editor{padding:18px;margin:16px 0}
.account .settings-card .email-row,.account #password-panel summary,.account .settings-link{margin:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 18px;min-height:54px;border:0;color:var(--text);border-radius:0;background:white;font:inherit}
.account .email-row #identity{min-width:0;text-align:right;color:var(--muted);overflow-wrap:anywhere}.account .email-row>span:first-child{flex:none}
.account #password-panel,.account .settings-link{border-top:1px solid var(--line)}.account #password-panel summary{list-style:none}.account #password-panel summary::-webkit-details-marker{display:none}
.account #password-panel summary::after,.account .settings-link::after{content:'›';font-size:22px;color:var(--muted)}.account #password-panel[open] summary::after{transform:rotate(90deg)}
.account #change-password,.account #forgot-current{width:calc(100% - 36px);margin:8px 18px 16px}
.account:not(:has(#home:not([hidden]))){padding:0 12px 24px}
.learner.account:not(:has(#home:not([hidden]))) main{width:100%;max-width:520px;min-height:0;margin:32px auto;padding:32px 39px;background:white;border:1px solid var(--line);border-radius:20px;box-shadow:0 12px 32px #23385c0d}
.account:not(:has(#home:not([hidden]))) .account-head{display:none}.account:not(:has(#home:not([hidden]))) .auth-brand{position:relative;display:block;padding-bottom:28px;border-bottom:1px solid var(--line);margin-bottom:32px}
.account .auth-brand::after{content:"";position:absolute;bottom:-1px;left:0;width:32px;height:3px;border-radius:2px;background:var(--accent)}
.account .auth-brand strong{display:flex;align-items:center;gap:10px;font-size:19px}.account .auth-brand b{border-radius:10px;background:var(--accent);color:white;display:grid;place-items:center;width:36px;height:36px}.auth-brand p{color:var(--muted);font-size:14px;margin:10px 0 4px}
.account #login h1{font-size:28px;line-height:1.4;margin:0 0 32px}.account #login input:not([type=checkbox]){min-width:0;min-height:48px}
.account #login label[for=login-password]{margin-bottom:4px}
.login-secret{position:relative}.account .login-secret>input{padding-right:58px}
.account .reveal-control{position:absolute;inset:0 0 0 auto;display:grid;place-items:center;width:54px;margin:0;cursor:pointer;color:var(--accent);font-size:13px}
.reveal-control input{position:absolute;inset:0;opacity:0;cursor:pointer;margin:0}.reveal-control:focus-within{outline:3px solid #a6b5ff}
.account .text-action,.account #login .text-action{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:44px;background:transparent;border:0;color:var(--accent);font-size:14px;text-decoration:none;margin:0;padding:6px}
.account #login #recover-start{display:flex;width:fit-content;margin-left:auto}.register-foot{display:flex;justify-content:center;align-items:center;color:var(--muted);font-size:14px;gap:4px;margin-top:6px}
@media(max-width:959px){
 .account .account-head{min-height:64px;padding:12px 17px}.account:has(#home:not([hidden])) main>#home{margin-top:16px}
 .learner.account:not(:has(#home:not([hidden]))) main{max-width:478px;padding:24px 18px;margin:16px auto;border-radius:18px}
 .account #login h1{font-size:26px}.account:not(:has(#home:not([hidden]))) .auth-brand{padding-bottom:24px;margin-bottom:24px}
}
.notebook #notice.announce-only{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#detail-origin:empty{display:none}#detail-origin a{display:inline-flex;align-items:center;min-height:44px;gap:4px;font-size:14px;text-decoration:none}#detail-origin a::before{content:'‹';font-size:24px}
.notebook[data-screen=detail] #book:has(.detail-question){padding:0;border:0;border-radius:0;background:transparent}
.notebook .detail-tags{color:var(--muted);font-size:13px;margin:0 0 8px}.notebook .detail-tags a{color:inherit}
.notebook .detail-question{margin:14px 0;padding:20px;background:white;border:1px solid var(--line);border-radius:14px;font-size:17px;line-height:1.85}
.notebook .detail-question p{margin:0;white-space:pre-wrap}.notebook[data-screen=detail] #book:has(.detail-question) details{background:white}
.notebook .detail-question~h3{margin:24px 0 8px}.notebook #book:has(.detail-question)>small{display:block;margin-top:20px;color:var(--muted)}.notebook #book:has(.detail-question) #recheck-status{border-top:1px solid var(--line);margin-top:12px}
/* AI welcome and collection retain the adopted A conversation hierarchy. */
.notebook .welcome-chat{background:transparent;border:0;border-radius:0;align-self:stretch;width:100%;max-width:600px;box-sizing:border-box;margin:26px auto;padding:32px 8px}
.notebook #work .mode-switch{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px;background:transparent;border:0;padding:0;margin:14px 0}
.notebook #work .mode-switch span{border:1px solid var(--line);background:white;font-weight:600;font-size:14px;padding:10px}
.notebook .welcome-chat h2{font-size:28px}.notebook .welcome-chat p{font-size:14px}
.notebook .chat-panel:has(.welcome-chat){min-height:calc(100dvh - 118px)}
.notebook .chat-panel form.composer{padding-bottom:18px}
.notebook #work.collection-panel{border:0;padding:0;background:transparent}
.collection-progress,.collection-card,.collection-context{background:white;border:1px solid var(--line);border-radius:16px;padding:18px;margin:16px 0}
.collection-context article+article{border-top:1px solid var(--line);padding-top:12px}.collection-context p{white-space:pre-wrap;overflow-wrap:anywhere}.collection-context small,.collection-card>small{color:var(--muted)}
.collection-progress p{font-size:13px;color:var(--muted);margin:8px 0}.collection-progress ol{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:8px}.collection-progress li{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:8px;border-radius:8px}.collection-progress li[aria-current]{background:var(--soft);font-weight:600}.collection-progress li small{white-space:nowrap;color:var(--muted)}
.collection-card>p{white-space:pre-wrap;font-size:17px;line-height:1.9}.collection-card>h2{margin:12px 0}.collection-card>small:last-child{display:block;margin-top:12px}.collection-card .action-row button{min-height:44px}
.collection-notice{margin:16px 0;padding:14px 16px;background:#fff9ed;border:1px solid #ead7ad;border-radius:12px;overflow-wrap:anywhere}
.collection-notice h3{margin:0 0 8px;font-size:16px;color:#74531d}.collection-notice p{margin:8px 0 0;line-height:1.7;white-space:pre-wrap}
.notebook #return-list{display:inline-flex;align-items:center;min-height:44px;text-decoration:none}.notebook #return-list[hidden]{display:none}
@media(min-width:960px){.collection-card .action-row{justify-content:flex-end}.collection-card .action-row button{flex:0 1 220px}}
@media(max-width:959px){.notebook .welcome-chat h2{font-size:23px}.notebook .chat-panel:has(.welcome-chat){min-height:calc(100dvh - 158px - var(--nav-height) - env(safe-area-inset-bottom))}.collection-progress,.collection-card,.collection-context{padding:16px}.notebook .welcome-chat{padding:32px 8px;margin:18px auto}}
.notebook #work .mode-switch input:checked+span{background:var(--accent);color:white;border-color:var(--accent)}
.notebook #work .welcome-chat>.icon{display:block;margin:0 auto 20px}
.notebook .chat-tools{align-items:center;flex-wrap:wrap}.notebook .chat-tools>a,.notebook .chat-tools>button{flex:none;width:auto;white-space:nowrap;font-size:13px;min-height:44px;padding:8px 12px;margin:0}
.notebook .chat-panel .composer-bar button:first-child{color:var(--accent);background:var(--soft)}
.collection-card{scroll-margin-top:16px}
.notebook .history-list{list-style:none;padding:0;margin:16px 0}.notebook .chat-panel .history-card{padding:18px;border:1px solid var(--line);border-radius:13px;margin:12px 0;background:white}.notebook .history-card>a:first-child{display:block;font-weight:600;font-size:17px;overflow-wrap:anywhere;margin:0}.notebook .history-card small{color:var(--muted);font-size:13px;margin:6px 0 12px}.notebook .history-card button{width:auto;min-height:44px;margin:0}
.notebook.task-page .chat-panel>.chat-page-title{display:none}.notebook.task-page .notebook-head{flex-wrap:wrap}.notebook.task-page .notebook-head .page-name{flex:1}.notebook.task-page .chat-panel{min-height:0}.notebook.task-page .notebook-content{max-width:880px}
.notebook #work.review-panel{padding-bottom:160px}.review-panel button{scroll-margin-block:24px 160px}
.account .privacy-link{text-decoration:none;border-top:1px solid var(--line);padding:14px 18px;min-height:48px}.account #privacy-page{display:none}
.account.privacy-view:has(#home:not([hidden])) #home>:not(#privacy-page),.account.privacy-view:has(#home:not([hidden])) :is(.app-nav,.account-head,#logout){display:none!important}
.account.privacy-view #home #privacy-page{display:block}
/* Account secondary pages share the approved, centered layout on both devices. */
.learner.account:is(.rotation-view,.privacy-view:has(#home:not([hidden]))){padding:0}
.learner.account:is(.rotation-view,.privacy-view:has(#home:not([hidden]))) main{width:min(600px,calc(100% - 48px));max-width:600px;min-height:100dvh;margin:0 auto;padding:24px 0 48px;background:transparent;border:0;border-radius:0;box-shadow:none}
.account.privacy-view:has(#home:not([hidden])) main>#home{width:100%;margin:0}
.account.rotation-view :is(.auth-brand,.app-nav,#register-cancel,#recovery-title){display:none!important}
.account .subpage-heading{margin:0 0 24px}
.account .subpage-back{display:inline-flex;align-items:center;gap:7px;width:auto;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;color:var(--accent);font-size:14px;font-weight:400;text-decoration:none;margin:0 0 8px}
.account .subpage-back svg{width:18px;height:18px;flex:none}
.account .subpage-heading h1{font-size:24px;line-height:1.4;margin:0;color:var(--text);font-weight:650}
.account.rotation-view #rotation-heading{margin-bottom:0}
.account.rotation-view #notice{margin:10px 0 24px;line-height:1.7}
.account #privacy-page .paper,.account.rotation-view :is(#recover,#backup){background:white;border:1px solid var(--line);border-radius:16px;padding:24px;margin:0 0 16px}
.account #privacy-page .paper h2,.account.rotation-view #backup h2{font-size:18px;font-weight:650;line-height:1.45;margin:0 0 16px}
.account #privacy-page .paper p{color:var(--muted);font-size:15px;line-height:1.8;margin:0 0 16px}
.account #privacy-page .paper p:last-child{margin-bottom:0}
.account.rotation-view #recover label{margin:0 0 16px;gap:10px;font-size:15px}
.account.rotation-view #recover .secret-input{gap:10px}
.account.rotation-view #recover>.secret-input{margin-bottom:16px}
.account.rotation-view #recover input{height:48px;background:white}
.account.rotation-view #recover .secret-input button{height:48px;min-width:64px;margin:0;padding:10px 14px}
.account.rotation-view #recover>button{min-height:48px;margin:0;font-weight:600}
@media(max-width:959px){
 .learner.account:is(.rotation-view,.privacy-view:has(#home:not([hidden]))) main{width:calc(100% - 34px);padding:12px 0 32px}
 .account .subpage-heading{margin-bottom:20px}
 .account .subpage-heading h1{font-size:23px}
 .account.rotation-view #notice{margin-bottom:20px}
 .account #privacy-page .paper,.account.rotation-view :is(#recover,#backup){padding:20px;margin-bottom:14px}
}
/* 2026-11-03: persistent records, a quiet transcript and contextual original images. */
body.notebook[data-screen=ai]{overflow:hidden}
.notebook[data-screen=ai] main{max-width:none;height:100dvh;min-height:0;padding-bottom:0;display:flex;flex-direction:column}
.notebook[data-screen=ai] .notebook-head{flex:none;min-height:var(--page-head-height);margin:0;padding:12px var(--page-head-gutter);gap:12px}
.notebook[data-screen=ai] .page-name{flex:1;min-width:0;display:block}.notebook[data-screen=ai] h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notebook[data-screen=ai] #detail-origin{max-width:28%;overflow:hidden}.notebook[data-screen=ai] #detail-origin a{overflow:hidden;text-overflow:ellipsis;max-width:100%}
#ai-toolbar{display:flex;align-items:center;gap:12px;flex:none}#chat-mode{font-size:12px;white-space:nowrap;color:var(--muted)}
#ai-toolbar button{width:auto;margin:0;min-width:44px}#show-conversations{display:none}
.chat-more{position:relative}.chat-more>summary{list-style:none;cursor:pointer;font-size:23px;display:grid;place-items:center;width:44px;height:44px;border-radius:8px}.chat-more summary::-webkit-details-marker{display:none}
.chat-more>button{position:absolute;right:0;top:44px;min-width:144px;z-index:6;box-shadow:0 8px 25px #202b4320;background:white}
.notebook[data-screen=ai] .notebook-content{width:100%;max-width:none;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:16px 28px 0;scroll-padding-top:16px}
.notebook[data-screen=ai] #work{width:100%;min-width:0}.notebook[data-screen=ai] .chat-panel,.notebook[data-screen=ai] .chat-panel:has(.welcome-chat){min-height:100%;padding:0}
.notebook[data-screen=ai] #notice:empty{display:none}.notebook[data-screen=ai] #return-list{font-size:13px}
#conversation-sidebar{position:fixed;z-index:5;inset:0 auto 0 var(--rail);width:var(--records);display:flex;flex-direction:column;gap:8px;background:#f8f9fc;border-right:1px solid var(--line);padding:20px 12px 12px}
.record-heading{display:flex;align-items:center;justify-content:space-between;padding:0 8px}.record-heading h2{font-size:14px;margin:0;color:var(--muted)}
#close-conversations{display:none}.new-conversation{display:flex;align-items:center;justify-content:center;min-height:44px;border:1px solid var(--line);border-radius:9px;background:white;text-decoration:none;margin:8px 0}
#record-notice{font-size:13px;margin:0;padding:0 6px;color:var(--muted)}#record-notice:empty{display:none}#record-notice button{font-size:12px;margin:6px 0}
#conversation-records{flex:1;min-height:0;overflow:auto;list-style:none;margin:0;padding:0;overscroll-behavior:contain}
#conversation-records li{border:0;margin:3px 0;padding:0;display:flex;position:relative;border-radius:9px}
.record-row>a{display:flex;align-items:center;flex:1;min-width:0;min-height:64px;padding:10px 34px 10px 10px;border-radius:9px;text-decoration:none;color:var(--text)}
.record-row>a[aria-current=page]{background:var(--soft);color:var(--accent)}.record-row>a:hover{background:#edf0f6}.record-row>a>span{min-width:0}.record-row strong{display:block;font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.record-row small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.record-row>details{position:absolute;top:10px;right:0}.record-row summary{list-style:none;display:grid;place-items:center;cursor:pointer;width:32px;height:44px}.record-row summary::-webkit-details-marker{display:none}
.record-row details>button{position:absolute;z-index:2;right:4px;top:38px;width:145px;background:white;box-shadow:0 6px 24px #202b4326;margin:0}
.notebook .chat-panel article.chat-turn,.collection-context article.chat-turn{border:0;border-radius:0;background:transparent;padding:0;margin:12px 0 28px;display:flow-root}
.chat-messages{padding:12px 0}.user-message{width:fit-content;max-width:86%;margin-left:auto;background:#eaf0fb;border-radius:16px 16px 4px 16px;padding:12px 16px;color:#243450}
.user-message p,.assistant-message p{margin:0;line-height:1.85}.assistant-message{padding:20px 0 0}.chat-turn>small{display:block;color:var(--muted);font-size:13px;margin:10px 0}
.chat-turn>a{display:inline-flex;align-items:center;min-height:44px;font-size:14px}.queue-actions{display:flex;gap:8px}.queue-actions button{width:auto;font-size:13px}
.sent-photos{display:flex;gap:8px;flex-wrap:wrap}.sent-photos:not(:first-child){margin-top:10px}.learner .sent-photo{display:flex;flex-direction:column;align-items:center;justify-content:center;width:124px;max-width:100%;min-height:112px;gap:4px;margin:0;padding:6px;background:white!important;border:1px solid var(--line);color:var(--muted);font-weight:400}
.sent-photo>span{display:grid;place-items:center;width:100%;height:90px;overflow:hidden}.sent-photo svg{width:100%;max-height:90px;border:0!important}.sent-photo small{font-size:11px}
.notebook[data-screen=ai] .chat-panel form.composer{flex:none;bottom:0;background:var(--bg);padding:16px 0 18px;z-index:2}
.notebook .chat-panel .composer-bar textarea{outline:none!important;box-shadow:none;min-width:0;line-height:1.6;padding:10px 8px;overflow-y:auto}
.composer-bar:focus-within{border-color:#9ba9eb;box-shadow:0 0 0 2px #4d61cc12}.composer-bar label{min-width:0}
.notebook #work details.collection-context{padding:4px 14px}.collection-context>summary{font-size:13px;color:var(--muted)}
#question-image{padding:20px;width:min(800px,calc(100% - 28px));max-width:none;max-height:90dvh}#question-image .image-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;background:white}#question-image h2{font-size:16px;margin:0}#question-image button{width:auto;margin:0}
#question-image-content{overflow:auto;margin-top:14px}#question-image-content>span{display:block}#question-image-content svg{display:block;width:100%;height:auto;max-height:none}
body.comparing-image{padding-right:clamp(300px,32vw,520px)}.comparing-image #question-image{position:fixed;inset:0 0 0 auto;margin:0;width:clamp(300px,32vw,520px);height:100dvh;max-height:none;border:0;border-left:1px solid var(--line);border-radius:0;background:white;overflow:auto}
#record-backdrop{position:fixed;inset:0;z-index:7;border:0;border-radius:0;background:#202b4366;margin:0}
@media(max-width:1199px) and (min-width:960px){.notebook[data-screen=ai] .notebook-content{padding-inline:20px}.comparing-image #question-image{width:330px}body.comparing-image{padding-right:330px}}
@media(max-width:959px){
 .notebook[data-screen=ai] main{height:calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom));min-height:0}
 .notebook[data-screen=ai] .notebook-head{padding:8px var(--page-head-gutter);gap:8px}.notebook[data-screen=ai] #detail-origin{max-width:32%}.notebook[data-screen=ai] #detail-origin a{font-size:12px}
 #ai-toolbar{gap:2px}#show-conversations{display:block}#conversation-sidebar{z-index:8;background:#f8f9fc;padding-top:max(18px,env(safe-area-inset-top));box-shadow:8px 0 32px #202b431a}#close-conversations{display:block;width:44px;margin:0}
 .notebook[data-screen=ai] .notebook-content{padding:12px 16px 0}.notebook[data-screen=ai] .chat-panel form.composer{padding:12px 0;bottom:0}.user-message{max-width:92%;padding:10px 13px}.assistant-message{padding-top:16px}
 .notebook[data-screen=ai] .welcome-chat{margin:auto;padding:24px 0}.notebook .welcome-chat h2{font-size:24px}.sent-photo{width:112px!important}
 body.comparing-image{padding-right:0}.comparing-image #question-image{inset:0;margin:auto;width:calc(100% - 28px);height:auto;max-height:90dvh;border:1px solid var(--line);border-radius:16px}
}
.collection-progress li:has(.collection-result){flex-wrap:wrap}.collection-result{display:flex;align-items:center;justify-content:space-between;flex-basis:100%;gap:12px;font-weight:400}.collection-result a{font-size:13px;min-height:44px;display:inline-flex;align-items:center}

.notebook[data-screen=ai] #chat-mode{display:block;font-size:11px;line-height:16px}.notebook[data-screen=ai] #chat-mode:empty{display:none}
.learner .thumbs img{object-fit:contain}.learner .thumbs .more-photos:not(:disabled){background:white;color:var(--accent);font-size:22px;border:0}
.learner .thumbs li.pdf-attachment{flex-basis:220px;padding:8px 44px 8px 10px;box-sizing:border-box}.pdf-attachment a{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;overflow-wrap:anywhere;font-size:13px;line-height:18px}

.batch-wait{display:flex;align-items:center;gap:.65em}
.batch-wait::before{content:"";width:1em;height:1em;flex:none;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:batch-spin .85s linear infinite}
@keyframes batch-spin{to{transform:rotate(1turn)}}
@media(prefers-reduced-motion:reduce){.batch-wait::before{animation:none}}
.candidate-result>p{white-space:pre-wrap;overflow-wrap:anywhere}

.collection-card .candidate-result .action-row{justify-content:flex-end;flex-wrap:wrap}
.collection-card .candidate-result .action-row button{flex:0 1 auto;width:auto;min-height:44px;padding:8px 12px;font-size:15px}

.collection-learning-actions,.notebook-study-actions{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.collection-learning-actions button,.notebook-study-actions button{width:auto;min-height:44px;margin:0}.assistant-message [data-learning-next]{min-height:44px;width:auto}
.notebook #work .collection-learning-actions>button:not(:disabled){background:#626fc3}

/* Retained views share one navigation; each page keeps its own controls. */
[data-learner-view]{display:contents}
.page-navigation{display:none!important}
#navigation-status{padding:20px 32px;color:#637088}
#navigation-status{position:fixed;z-index:8;top:calc(var(--page-head-height) + 12px);left:calc(var(--rail) + 24px);right:24px;margin:0;padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:white}
#navigation-status button{width:auto;margin:0 0 0 12px}
@media(max-width:959px){#navigation-status{left:16px;right:16px}}

/* AI replies: compact prose, structured explanations and locally scrolling math. */
.notebook .chat-panel article.chat-turn{margin:10px 0 24px}
.chat-panel .user-message{padding:9px 14px}
.chat-panel .user-message p{line-height:1.6}
.chat-panel .assistant-message{padding-top:16px;min-width:0;line-height:1.75;overflow-wrap:anywhere}
#work .reply-prose p{white-space:pre-line;line-height:1.75;margin:0 0 12px}
#work .reply-prose>:last-child{margin-bottom:0}
.reply-prose :is(h1,h2,h3,h4,h5,h6){font-size:1.06em;line-height:1.5;margin:20px 0 10px;font-weight:650}
.reply-prose>:is(h1,h2,h3,h4,h5,h6):first-child{margin-top:0}
.reply-prose strong{font-weight:650}
.reply-prose :is(ul,ol){margin:8px 0 14px;padding-left:1.5em}
.notebook .chat-panel .reply-prose li{margin:6px 0;padding:0;border:0;line-height:1.75}
.reply-prose ul{list-style:disc}
.reply-prose code{display:inline;font-size:.9em}
.reply-prose pre code{display:block}
#work .reply-prose li p{margin:4px 0}
#work .reply-prose .reply-topic{font-size:13px;color:var(--muted);font-weight:500;margin-bottom:8px}
.reply-prose .reply-summary{border-left:3px solid #c6d2ef;background:#edf2fc;padding:12px 16px;margin:16px 0;border-radius:0 10px 10px 0}
#work .reply-prose .reply-summary-title{font-weight:650;margin:0 0 8px;font-size:1em}
#work .reply-prose .reply-summary>:last-child{margin-bottom:0}
.reply-prose .katex{font-size:1.08em;overflow-wrap:normal}
.reply-prose .katex-display{margin:12px 0;text-align:left;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:4px 0}
.reply-prose .katex-display>.katex{text-align:left}
#work .reply-prose .katex svg{display:inline;border:0}
.reply-prose :is(pre,table){max-width:100%;overflow-x:auto;display:block}
.reply-prose pre{padding:12px;background:#edf0f6;border-radius:8px;white-space:pre}
.reply-prose blockquote{margin:12px 0;padding-left:14px;border-left:3px solid var(--line);color:var(--muted)}
@media(max-width:959px){.chat-panel .user-message{padding:8px 12px}.chat-panel .assistant-message{padding-top:14px}.reply-prose .reply-summary{padding:10px 12px}}

/* Completed operations stay available without dominating the learning conversation. */
.notebook #work .question-selection.is-submitted .reply-author{display:none}
.notebook #work .question-selection details.selection-history{padding:0 14px;margin:0;border:1px solid var(--line);border-radius:12px;background:#f9faff}
.notebook #work .selection-history>summary{padding:11px 0;min-height:44px;box-sizing:border-box;font-size:14px;line-height:22px;font-weight:600;color:#42527a;cursor:pointer}
.notebook #work .selection-history>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
.notebook #work .selection-history>div>p{color:var(--muted);font-size:13px;margin:0 0 12px}
.notebook #work .question-selection label.selection-option,.selection-record{display:flex;align-items:flex-start;gap:12px;padding:14px 12px;margin:8px 0;border:1px solid var(--line);border-radius:10px;min-width:0;background:#fbfcff;line-height:1.65}
.notebook #work .question-selection label.selection-option{cursor:pointer;min-height:44px}
.notebook #work .question-selection label.selection-option:has(input:checked),.selection-record[data-selected=true]{background:#eef2ff;border-color:#b7c3f1}
.notebook #work .question-selection label.selection-option:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.notebook #work .question-selection label.selection-option input{flex:none;width:20px;height:20px;margin:3px 0 0;accent-color:var(--accent)}
.selection-question{display:block;min-width:0;flex:1}
.selection-question>strong{display:block;font-size:14px;line-height:22px;margin:0 0 5px;color:#334265;font-weight:650}
.question-prose{display:block;min-width:0;overflow-wrap:anywhere;line-height:1.7}
.notebook #work .question-prose p{white-space:pre-line;margin:0 0 6px;line-height:1.7}
.question-prose>:last-child{margin-bottom:0!important}
.question-prose .katex{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle;font-size:1.05em;white-space:nowrap;overflow-wrap:normal}
.question-prose .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;text-align:left;margin:8px 0}
.question-prose .katex-display>.katex{display:block;text-align:left}
.notebook #work .question-prose .katex svg{display:inline;border:0}
.selection-state{flex:none;min-width:28px;margin-top:2px;font-size:12px;color:#637088}
.selection-record[data-selected=true] .selection-state{font-weight:600;color:#4255ad}
.selection-item{position:relative;margin:8px 0 12px}
.notebook #work .question-selection .selection-item label.selection-option{margin:0}
.selection-item .selection-question>strong{padding-right:108px}
.notebook #work .question-selection details.selection-figure{position:static;margin:0;padding:0;border:0;background:transparent}
.notebook #work .question-selection details.selection-figure[open]{padding:12px 0 0}
.notebook #work .question-selection details.selection-figure>summary{position:absolute;top:0;right:4px;display:list-item;width:104px;min-height:44px;box-sizing:border-box;padding:10px 12px 10px 16px;font-size:13px;line-height:24px;color:var(--muted);cursor:pointer;border-radius:7px}
.notebook #work .question-selection details.selection-figure>summary:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

.collection-receipt{margin:0 0 16px}
.collection-receipt>strong{font-size:15px;font-weight:650;color:#334265}
.notebook .chat-panel .collection-receipt ul{display:flex;flex-wrap:wrap;gap:6px 10px;list-style:none;margin:8px 0 0;padding:0}
.notebook .chat-panel .collection-receipt li{display:flex;align-items:center;gap:12px;border:1px solid #e1e6ef;border-radius:7px;padding:5px 10px;margin:0;background:#f9faff;line-height:22px;font-size:13px}
.collection-receipt li>span:last-child{color:#637088}
.collection-receipt li[data-result=collected]>span:last-child{color:#38675d}
#work .collection-complete-note{font-size:13px;color:var(--muted);margin:12px 0 0}
#work .reply-prose .reply-topic{font-size:16px;line-height:1.5;font-weight:650;color:#334265;margin:0 0 10px}
#work .reply-prose .reply-status{display:flex;align-items:baseline;gap:7px;font-size:13px;line-height:1.6;color:#637088;margin:0 0 16px}
.reply-status::before{content:'✓';flex:none;color:#477468;font-size:12px}
.chat-panel .assistant-message.learning-start{border-top:1px solid #dce3ef;margin-top:20px;padding-top:20px}
.chat-panel .assistant-message.learning-continuation{padding-top:14px}
@media(max-width:959px){
 .notebook #work .question-selection label.selection-option,.selection-record{padding:12px 10px;gap:10px}
 .notebook #work .question-selection details.selection-history{padding-inline:12px}
 .notebook .chat-panel .collection-receipt li{gap:8px;padding:4px 8px}
 .chat-panel .assistant-message.learning-start{margin-top:16px;padding-top:16px}
}
.question-options{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:10px}
.question-option{flex:1 1 auto;min-width:calc(50% - 9px);max-width:100%;line-height:1.7;overflow-wrap:anywhere}
.notebook #work .question-prose p.question-option{margin:0}

/* Detail actions: learning stays together; deletion remains visually separate. */
.notebook #book .detail-actions{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:16px}
.notebook #book .detail-actions .notebook-study-actions{margin:0;flex-wrap:nowrap}
.notebook #book .detail-actions button{min-height:48px}
.notebook #book .detail-actions .notebook-study-actions button{width:92px;padding-inline:16px;letter-spacing:.08em}
.notebook #book .detail-actions .secondary{border-color:var(--accent);background:transparent;color:var(--accent)}
.notebook #book .detail-actions>.delete-link{margin:0;background:transparent;border-color:transparent;color:#913129;white-space:nowrap}
.notebook #book .detail-actions>.delete-link:hover:not(:disabled){background:#9131290a}
@media(max-width:959px){
  .notebook #book .detail-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  .notebook #book .detail-actions .notebook-study-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .notebook #book .detail-actions .notebook-study-actions button{width:100%}
  .notebook #book .detail-actions>.delete-link{justify-self:end}
}

/* Shared formula layout: preserve complete expressions in every content surface. */
.math-expression{display:inline-block;max-width:100%;vertical-align:middle;overflow-x:auto;overflow-y:hidden;padding:3px 0;white-space:normal}
.math-expression:has(>.katex-display){display:block}
.math-expression .katex-display{margin:8px 0;text-align:left}
.math-expression .katex{white-space:nowrap;overflow-wrap:normal;font-size:1.08em}
.math-expression .katex svg{display:inline!important;border:0!important;max-width:none}
.math-fallback{white-space:pre-wrap;overflow-wrap:anywhere}
.reply-prose :not(.katex-display)>.katex{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle;padding:3px 0}

.question-list>li,.question-list>li>a,.question-preview{min-width:0}
