.study-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.language-label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.study-owned select,.study-owned input[type=search]{padding:9px 11px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);font:inherit;max-width:100%}
.topbar{flex-wrap:wrap}.study-home{padding:28px 30px;margin:8px 0 24px;border:1px solid var(--line);border-radius:18px;background:var(--card);box-shadow:0 8px 30px #18366b09}
.study-home h2{font-size:clamp(23px,3vw,34px);line-height:1.3;letter-spacing:-.6px;margin:10px 0}.study-home p{max-width:800px;line-height:1.8;color:var(--muted)}
.study-home .btn,.study-actions .btn,.book-feedback .btn{margin:6px 10px 0 0}.study-eyebrow{font-size:11px;font-weight:800;letter-spacing:1.5px;color:#3971ba;text-transform:uppercase}
.study-dialog{width:min(1160px,94vw);max-width:94vw;max-height:90vh;padding:0;border:1px solid var(--line);border-radius:18px;background:var(--bg,#f6f8fc);color:var(--ink);box-shadow:0 25px 100px #0004}
.study-dialog::backdrop{background:#10223b99;backdrop-filter:blur(4px)}.study-dialog-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 22px;background:var(--card);border-bottom:1px solid var(--line)}
.study-dialog-head h2{font-size:19px;margin:0}.study-layout{display:grid;grid-template-columns:245px minmax(0,1fr)}.study-chapter-nav{padding:18px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:6px;align-self:start}
.study-chapter-button{padding:10px 12px;text-align:left;line-height:1.5;border:0;border-radius:8px;background:transparent;color:var(--muted);font:inherit;cursor:pointer;font-size:13px}
.study-chapter-button[aria-current=true]{background:#e5eefc;color:#164a94;font-weight:700}.study-reading{padding:24px;min-width:0}.study-source{font-size:12px;line-height:1.65;color:var(--muted);margin-top:0}
.study-card{padding:26px;border:1px solid var(--line);border-radius:14px;background:var(--card);line-height:1.85;margin-bottom:16px;min-width:0}.study-card h2{font-size:25px;line-height:1.35;margin:8px 0 14px}.study-card h3{font-size:15px;margin:20px 0 6px}
.study-card p{margin:6px 0 12px;overflow-wrap:anywhere}.study-core{font-size:16px}.study-block{max-width:82ch}.study-example{padding:0 18px 12px;background:#4883d60a;border-left:3px solid #4883d6;border-radius:0 10px 10px 0}.study-example ol{padding-left:24px}.study-example li{margin:9px 0;padding-left:4px}
.study-equation{overflow-x:auto;overflow-y:hidden;padding:12px 8px;border:1px solid var(--line);border-radius:9px;margin:18px 0;background:var(--bg,#f8fafc);max-width:100%;font-size:1.04em}.study-equation .katex-display{margin:4px 0}.study-equation .katex-display>.katex{white-space:normal}
.study-actions{padding-top:8px}.legacy-lab{margin-bottom:20px}.legacy-lab>summary{padding:12px 16px;margin-bottom:12px;cursor:pointer;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:13px}
.study-bank-link{padding:16px;margin-bottom:16px;display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;background:var(--card)}
.study-book-body{padding:22px}.book-filters{display:flex;gap:14px;align-items:end;flex-wrap:wrap;padding:15px 0;border-bottom:1px solid var(--line)}.book-filters label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}.book-filters select{max-width:370px}.book-filters .book-wrong-filter{flex-direction:row;align-items:center;padding:12px 0}
.book-progress{font-size:13px;color:var(--muted);padding:16px 0}.book-navigation{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}.book-navigation>span{min-width:80px;text-align:center;font-variant-numeric:tabular-nums}
.book-question{background:var(--card);padding:24px;border:1px solid var(--line);border-radius:12px;font-size:16px;line-height:1.8}.book-html{overflow-wrap:anywhere;max-width:100%;overflow-x:auto}.book-html p{margin:12px 0}.book-html img{max-width:100%;height:auto;vertical-align:middle;background:#fff}.book-html figure{margin:16px 0}.book-html table{border-collapse:collapse;margin:14px 0;max-width:100%;font-size:14px}.book-html th,.book-html td{border:1px solid var(--line);padding:8px 12px}.book-html ol,.book-html ul{padding-left:28px}.book-alpha{list-style-type:lower-alpha}.book-context{padding:14px 16px;background:var(--bg,#f8fafc);border:1px solid var(--line);border-radius:10px;margin-bottom:18px}.book-context summary,.book-source-sheet summary{cursor:pointer;font-size:13px;color:var(--muted)}
.book-options{margin:20px 0;padding:0;border:0;display:grid;gap:10px}.book-options legend{font-size:13px;color:var(--muted);padding-bottom:10px}.book-option{display:flex;align-items:start;gap:12px;border:1px solid var(--line);border-radius:10px;padding:12px;cursor:pointer}.book-option:has(input:checked){border-color:#3971ba;background:#3971ba0c}.book-option input{margin-top:7px;flex:none}.book-option>b{min-width:18px}.book-option>.book-html{min-width:0}.book-option .book-html p{margin:0}
.book-written{display:flex;flex-direction:column;gap:8px;margin:20px 0;font-size:13px;color:var(--muted)}.book-written textarea{resize:vertical;border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--bg);color:var(--ink);font:inherit;font-size:16px;line-height:1.8}
.book-feedback{margin:20px 0;padding:18px;border:1px solid var(--line);border-radius:10px}.book-correct{color:#27875a}.book-incorrect{color:#bc543c}.book-source-sheet{margin-top:24px;border-top:1px solid var(--line);padding-top:14px}.book-source-sheet:not([open])>.book-html{display:none}.study-loading{padding:24px}.study-formula-row{border-bottom:1px solid var(--line);padding-bottom:16px}.study-formula-row p{font-size:13px;line-height:1.7;color:var(--muted)}
@media(max-width:700px){.study-toolbar{width:100%;padding:5px 0}.study-home{padding:20px}.study-dialog{width:96vw;max-width:96vw;max-height:94vh}.study-dialog-head{padding:12px}.study-layout{grid-template-columns:1fr}.study-chapter-nav{border-right:0;border-bottom:1px solid var(--line);flex-direction:row;overflow-x:auto;padding:10px}.study-chapter-button{flex:0 0 180px}.study-reading,.study-book-body{padding:14px}.study-card,.book-question{padding:18px}.book-filters{align-items:stretch}.book-filters label{width:100%}.book-filters select{width:100%;max-width:100%}.book-navigation{gap:8px}.study-equation{font-size:.85em}.study-bank-link{flex-wrap:wrap}}


.study-dialog-actions{display:flex;gap:8px;flex-shrink:0}.book-upper{list-style-type:upper-alpha}
.study-teaching{padding:8px 0 16px;border-bottom:1px solid var(--line);max-width:78ch}.study-teaching h3{font-size:20px;line-height:1.5;margin-top:24px}.study-teaching p{font-size:16px;line-height:1.95;margin:14px 0}
.study-roadmap{background:#3971ba08;border:1px solid var(--line);border-radius:10px;padding:0 18px 10px;margin:20px 0}.study-roadmap h3{margin-top:14px}.study-recap{padding:14px 0;margin:10px 0}.study-recap>summary,.study-check summary{cursor:pointer;color:#3264a9;font-size:14px;min-height:30px;line-height:1.7}
.study-checks{margin:24px 0}.study-check{padding:14px 18px;border:1px solid var(--line);border-radius:10px;margin:12px 0}.study-check details>p{padding:10px 12px;background:#3971ba08;border-radius:8px}
.study-term{font-weight:800;color:var(--ink);cursor:help;text-decoration:underline;text-decoration-style:dotted;text-decoration-color:#3971ba65;text-underline-offset:4px}.study-term:focus-visible{outline:2px solid #3971ba;outline-offset:3px;border-radius:2px}
.study-lookup-hint{font-size:12px!important;line-height:1.7!important;color:var(--muted);padding:10px 12px;background:#3971ba08;border-radius:8px}
.study-word-popup{position:fixed;z-index:10000;width:320px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--card,#fff);color:var(--ink,#16223a);box-shadow:0 12px 45px #11223b35;font-size:14px;line-height:1.75;text-align:left}
.study-word-popup p{margin:8px 0 14px;overflow-wrap:anywhere}.study-word-title{display:block;padding-right:44px;font-size:18px;overflow-wrap:anywhere}.study-word-close{position:absolute;right:10px;top:10px;background:transparent;border:0;color:var(--muted);cursor:pointer;font:inherit;font-size:12px;padding:6px}.study-word-popup .btn{font-size:12px;padding:8px 12px}
.study-chapter-nav{position:sticky;top:68px;max-height:calc(90vh - 75px);overflow-y:auto}
@media(max-width:700px){.study-teaching h3{font-size:18px}.study-teaching p{font-size:15px;line-height:1.9}.study-dialog-head h2{font-size:16px}.study-dialog-actions{gap:4px}.study-dialog-actions .btn{padding:8px 10px}.study-roadmap{padding:0 12px 8px}}
@media(max-width:700px){.study-chapter-nav{position:relative;top:0;max-height:none;overflow-y:hidden}}
.wm{max-width:calc(100vw - 24px);white-space:normal;text-align:right}.wm-row{display:flex;flex-wrap:wrap;justify-content:flex-end;column-gap:20px}.wm-row>span{white-space:nowrap}
.study-teaching .study-symbol-note{font-size:13px;line-height:1.8;color:var(--muted);padding:10px 12px;border-left:2px solid var(--line)}
.study-ai-popup{position:fixed;z-index:10001;box-sizing:border-box;background:var(--card,#fff);color:var(--ink,#16223a);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 40px #11223b35;font-size:14px;line-height:1.7;text-align:left;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:hidden}
.study-ai-toolbar{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:9px;background:var(--card,#fff);box-shadow:0 8px 25px #11223b28}
.study-ai-toolbar .btn{font-size:13px;padding:6px 14px;margin:0;cursor:pointer}
.study-ai-panel{width:400px;display:flex;flex-direction:column;max-height:min(520px,calc(100dvh - 24px))}
.study-ai-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--card,#fff);flex-shrink:0}
.study-ai-title{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink,#16223a);flex:1}
.study-ai-close{background:transparent;border:0;color:var(--muted,#64748b);cursor:pointer;font:inherit;font-size:16px;line-height:1;padding:4px 6px;border-radius:4px}
.study-ai-close:hover{color:var(--ink,#16223a)}
.study-ai-body{padding:12px 14px;overflow-y:auto;flex:1 1 auto;display:flex;flex-direction:column;gap:10px}
.study-ai-content{white-space:pre-wrap;word-break:break-word;line-height:1.7;color:var(--ink,#16223a);font-size:14px}
.study-ai-status{font-size:12px;color:var(--muted,#64748b)}
.study-ai-status.error{color:#c53030;font-weight:600}
.study-ai-actions{display:flex;gap:8px}
.study-ai-actions .btn{font-size:12px;padding:5px 12px;margin:0}
.study-ai-messages{display:flex;flex-direction:column;gap:10px;overflow-y:auto;max-height:280px}
.study-ai-msg{padding:8px 12px;border-radius:9px;font-size:13px;line-height:1.65;white-space:pre-wrap;word-break:break-word}
.study-ai-msg-user{background:#3971ba14;color:var(--ink,#16223a);align-self:flex-end;max-width:85%;border:1px solid #3971ba30}
.study-ai-msg-assistant{background:var(--bg,#f8fafc);color:var(--ink,#16223a);align-self:flex-start;max-width:95%;border:1px solid var(--line)}
.study-ai-form{display:flex;gap:6px;margin-top:auto;padding-top:10px;border-top:1px solid var(--line);flex-shrink:0}
.study-ai-input{flex:1;padding:7px 10px;border:1px solid var(--line);border-radius:7px;font-size:13px;background:var(--card,#fff);color:var(--ink,#16223a);font:inherit}
.study-ai-send{padding:7px 14px;font-size:13px;margin:0;cursor:pointer}
@media(max-width:700px){.study-ai-panel{width:calc(100vw - 16px);max-height:calc(100dvh - 32px)}}
