/* Open Design / Notion tokens; workspace layout adapted for mathematics. */
:root{font-family:var(--font-body),"PingFang SC","Microsoft YaHei",sans-serif;color:var(--fg-2);background:var(--bg);font-synthesis:none;--line:var(--border);--ink:var(--fg-2);--green:var(--accent)}
*{box-sizing:border-box}body{margin:0;font-size:14px}button,input,select{font:inherit}button{background:none;border:0;color:inherit;cursor:pointer}button:hover{background:var(--surface)}button:disabled{opacity:.4;cursor:default}a{color:inherit;text-decoration:none}button,a,input,select{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,[tabindex]:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}input:focus-visible{outline:none}[hidden]{display:none!important}h1,h2,h3,p{margin:0}svg{display:block}svg:not(#graph):not(.brand-mark svg){fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.skip:focus{position:fixed;top:8px;left:260px;background:var(--bg);z-index:50;padding:8px}
.app-sidebar{position:fixed;inset:0 auto 0 0;width:232px;background:var(--surface);border-right:1px solid var(--border-soft);display:flex;flex-direction:column;padding:22px 12px 12px}.brand{display:flex;align-items:center;gap:9px;padding:0 12px 25px;font-size:20px;font-weight:650}.brand-mark{width:26px;height:28px}.brand-mark svg{width:100%;height:100%;stroke:var(--fg-2);fill:var(--surface);stroke-width:2}.brand-sub{font-size:11px;font-weight:400;color:var(--muted);margin-left:12px}.app-sidebar nav{display:flex;flex-direction:column;gap:3px}.nav-link{text-align:left;padding:9px 12px;border-radius:var(--radius-sm);color:var(--muted);font-size:14px}.nav-link.active{background:var(--border-soft);color:var(--fg-2);font-weight:600}.nav-link:before{display:inline-block;width:23px;font-size:15px;opacity:.65}.nav-link[data-view=explore]:before{content:'⌘'}.nav-link[data-view=catalog]:before{content:'☷'}.nav-link[data-view=methods]:before{content:'ƒ'}.nav-link[data-view=practice]:before{content:'☆'}.nav-count{float:right;color:var(--meta);font-size:12px}.sidebar-divider{border-top:1px solid var(--border);margin:22px 8px 16px}.sidebar-label{padding:0 12px 10px;color:var(--meta);font-size:12px}.chapter-tree{flex:1;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.chapter-tree summary{cursor:pointer;list-style:none}.chapter-tree summary::-webkit-details-marker{display:none}.tree-group>summary{padding:8px 10px;color:var(--muted);font-size:12px;font-weight:500}.tree-group>summary:before,.tree-chapter>summary:before{content:'›';width:14px;display:inline-block;transform-origin:5px center}.tree-group[open]>summary:before,.tree-chapter[open]>summary:before{transform:rotate(90deg)}.tree-chapter>summary{display:flex;align-items:center;min-height:33px;padding:0 7px 0 17px}.tree-chapter>summary:hover{background:var(--border-soft);border-radius:4px}.tree-chapter>summary button{flex:1;text-align:left;font-size:12px;padding:7px 0;white-space:nowrap}.tree-chapter>summary button:hover{background:none}.tree-chapter>summary>span{color:var(--meta);font-size:11px}.tree-topic{display:block;text-align:left;font-size:12px;line-height:1.6;padding:7px 8px 7px 38px;width:100%;border-radius:4px;color:var(--muted)}.chapter-tree button.selected{color:var(--accent)}.tree-topic.selected{background:var(--bg)}.sidebar-about{font-size:11px;color:var(--meta);text-align:left;padding:16px 12px 4px;margin-top:12px}
main{margin-left:232px;min-height:100vh;padding:0 32px;position:relative}.topbar{height:72px;display:flex;align-items:center;gap:14px;border-bottom:1px solid var(--border-soft)}.topbar h1{font-size:17px;font-weight:600;line-height:1.5}.topbar>span{color:var(--meta);font-size:12px;border-left:1px solid var(--border);padding-left:14px}.topbar>button{margin-left:auto;border-radius:4px;padding:4px}kbd{font:11px var(--font-body);color:var(--meta);border:1px solid var(--border);border-radius:4px;padding:3px 6px}.search-area{display:flex;align-items:center;gap:18px;margin:24px 0;max-width:1100px}#search-form{display:flex;align-items:center;gap:10px;height:42px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:4px 4px 4px 12px;background:var(--bg);flex:1;min-width:220px;max-width:600px}#search-form:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.search-icon{width:17px;height:17px;color:var(--meta);flex-shrink:0}#search{width:100%;min-width:0;border:0;background:transparent;font-size:13px;color:var(--fg-2)}#search::placeholder{color:var(--meta)}.search-submit{background:var(--fg-2);color:var(--bg);padding:7px 15px;font-size:12px;border-radius:3px;white-space:nowrap}.search-submit:hover{background:var(--muted)}.search-suggestions{display:flex;gap:12px;flex-wrap:wrap}.search-suggestions button{font-size:12px;padding:4px 0;color:var(--muted)}.search-suggestions button:hover{color:var(--accent);background:none}.view{scroll-margin-top:16px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 304px;border:1px solid var(--border);border-radius:var(--radius-md);min-height:calc(100vh - 220px);overflow:hidden}.graph-card{min-width:0;display:flex;flex-direction:column;background:var(--bg)}.graph-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;height:51px;border-bottom:1px solid var(--border-soft);padding:0 18px}.breadcrumb{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:11px}.breadcrumb button{padding:3px 0;color:var(--muted);font-size:11px}.breadcrumb button:last-child{color:var(--fg-2)}.separator{color:var(--meta)}.text-button{color:var(--muted);font-size:12px;padding:5px;border-radius:4px;white-space:nowrap}.graph-stage{position:relative;min-height:440px;height:calc(100vh - 320px);flex:1;overflow:hidden}#graph{width:100%;height:100%;touch-action:none;user-select:none;cursor:grab}#graph:active{cursor:grabbing}.map-label{position:absolute;left:18px;top:16px;color:var(--meta);font-size:11px;pointer-events:none}.graph-tools{position:absolute;left:16px;bottom:16px;display:flex;align-items:center;background:var(--bg);border:1px solid var(--border);border-radius:4px;gap:4px;padding:3px}.graph-tools button{width:29px;height:28px;border-radius:3px;font-size:18px}.graph-tools>span{font-size:10px;color:var(--muted);min-width:36px;text-align:center}.graph-tools .tool-divider{height:16px;width:1px;min-width:1px;background:var(--border);margin:0 3px}.graph-footer{height:40px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--border-soft);font-size:10px;color:var(--meta)}.legend{display:flex;gap:14px}.legend>span{display:flex;align-items:center;gap:5px}.legend i{width:6px;height:6px;display:block;border-radius:1px;background:var(--meta)}.legend i.legend-topic{background:var(--muted)}.legend i.legend-method{background:var(--accent)}.graph-edge{fill:none;stroke:var(--border);stroke-width:1.5}.graph-edge.on-route{stroke:var(--accent);stroke-width:2;stroke-dasharray:5 4}.node-box{fill:var(--bg);stroke:var(--border);stroke-width:1}.graph-node{cursor:pointer}.graph-node:hover .node-box{fill:var(--surface);stroke:var(--meta)}.graph-node.kind-group .node-box{fill:var(--surface)}.graph-node.kind-root .node-box{fill:var(--fg-2);stroke:var(--fg-2)}.node-title{font-size:17px;font-weight:500;fill:var(--fg-2);text-anchor:middle;pointer-events:none}.node-subtitle{font-size:11px;fill:var(--meta);text-anchor:middle;pointer-events:none}.kind-root .node-title{fill:var(--bg)}.kind-root .node-subtitle{fill:var(--meta)}.graph-node.selected:not(.kind-root) .node-box,.graph-node.on-route:not(.kind-root) .node-box{fill:var(--bg);stroke:var(--accent);stroke-width:1.5}.graph-node.selected:not(.kind-root) .node-title{fill:var(--accent)}
.detail-panel{border-left:1px solid var(--border);padding:24px;max-height:calc(100vh - 220px);overflow:auto;min-height:531px;scrollbar-width:thin}.detail-panel h2{font-size:20px;font-weight:600;line-height:1.5;margin:0 0 18px;letter-spacing:-.4px}.overview-count{color:var(--meta);font-size:12px;margin-top:-10px;margin-bottom:28px}.overview-links{border-top:1px solid var(--border-soft);margin-bottom:28px}.overview-links button{display:flex;justify-content:space-between;width:100%;padding:13px 0;font-size:13px;border-bottom:1px solid var(--border-soft)}.overview-links span{font-size:11px;color:var(--meta)}.detail-label{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin:26px 0 12px}.detail-label>span{color:var(--meta)}.panel-topic{display:flex;align-items:center;gap:10px;text-align:left;line-height:1.65;padding:11px 0;width:100%;border-bottom:1px solid var(--border-soft);font-size:13px}.panel-topic>span:first-child{font-size:10px;color:var(--meta);font-variant-numeric:tabular-nums}.arrow{margin-left:auto;color:var(--meta)}.panel-topic:hover{background:none;color:var(--accent)}.intro{font-size:13px;line-height:1.9;color:var(--muted);margin:18px 0}.formula{padding:20px 10px;background:var(--surface);border-radius:4px;overflow:auto;text-align:center;font-size:16px;margin:20px 0}.panel-tabs{display:flex;gap:20px;border-bottom:1px solid var(--border);margin-bottom:18px}.panel-tabs button{padding:8px 0 10px;font-size:12px;color:var(--muted);border-bottom:2px solid transparent}.panel-tabs button.active{border-color:var(--fg-2);color:var(--fg-2)}.method-chip{font-size:12px;border:1px solid var(--border);border-radius:4px;padding:7px 9px;margin:0 6px 8px 0;line-height:1.5}.subtle-button{display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;font-size:12px;border-top:1px solid var(--border-soft);margin-top:24px;padding:15px 0;color:var(--accent)}.subtle-button:hover{background:none}.panel-note{font-size:11px;line-height:1.8;color:var(--meta);margin-top:22px}.panel-exercise{display:block;width:100%;text-align:left;border-bottom:1px solid var(--border-soft);padding:15px 0}.panel-exercise strong{font-size:13px;font-weight:500;display:block;margin-top:8px}.tiny-meta{display:flex;justify-content:space-between;font-size:11px;color:var(--meta);line-height:1.5}.tiny-meta .arrow{float:right}.empty-within{font-size:13px;color:var(--meta);line-height:1.8;padding:20px 0}
.results{position:absolute;z-index:20;top:142px;left:32px;width:min(700px,calc(100% - 64px));max-height:65vh;overflow:auto;background:var(--bg);border:1px solid var(--border);border-radius:8px;box-shadow:var(--elev-raised);padding:16px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.section-head h2{font-size:15px;font-weight:600;line-height:1.6}.results .section-head{padding:0 6px 12px}.filter-tabs{display:flex;gap:6px;margin-bottom:16px;flex-wrap:wrap}.filter-tabs button{font-size:12px;padding:6px 10px;border-radius:4px;color:var(--muted)}.filter-tabs button.active{background:var(--surface);color:var(--fg-2);font-weight:500}.result-list,.list-grid{display:flex;flex-direction:column}.result-card{width:100%;text-align:left;padding:18px 8px;border-bottom:1px solid var(--border-soft);border-radius:0;display:block}.result-card h3{font-size:14px;font-weight:550;line-height:1.6;margin:5px 0}.result-card p{font-size:12px;line-height:1.8;color:var(--muted);margin:0;max-width:900px}.result-card .result-footer{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--meta);margin-top:9px}.result-card .tiny-meta>span:last-child{display:none}.result-card .result-footer>span:last-child{color:var(--muted)}.result-card .katex{font-size:1em}.empty{padding:40px 16px;text-align:center;color:var(--muted);font-size:13px;line-height:1.9}.empty h3{font-size:15px;font-weight:500;margin-bottom:7px;color:var(--fg-2)}.empty-symbol{display:none}.empty button{margin-top:20px}.list-heading{font-size:13px;font-weight:600;margin:28px 0 10px;display:flex;gap:15px}.list-heading span{font-size:11px;font-weight:400;color:var(--meta)}#catalog-view>.section-head,#methods-view>.section-head,#practice-view>.section-head{display:none}.catalog-chapter{border-bottom:1px solid var(--border-soft)}.catalog-chapter summary{cursor:pointer;padding:16px 8px;font-size:14px}.chapter-topics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:0 24px 18px}.chapter-topics button{text-align:left;font-size:13px;color:var(--muted);padding:8px;border-radius:4px}.method-count{font-size:12px;color:var(--meta);margin-left:auto}.methods-toolbar{display:flex;align-items:center;padding:0 0 16px;border-bottom:1px solid var(--border)}.select-label{font-size:12px;color:var(--muted)}select{margin-left:12px;padding:7px 25px 7px 10px;border:1px solid var(--border);border-radius:4px;background:var(--bg);color:var(--fg-2);font-size:12px}.progress-summary{display:flex;gap:28px;padding:8px 0 24px;margin-bottom:16px;border-bottom:1px solid var(--border)}.progress-summary>div{display:flex;gap:7px;align-items:baseline}.progress-summary strong{font-size:18px;font-weight:600}.progress-summary span{font-size:12px;color:var(--muted)}footer{display:flex;justify-content:space-between;gap:20px;padding:18px 0;font-size:10px;color:var(--meta)}
dialog{border:1px solid var(--border);border-radius:var(--radius-md);padding:28px 32px;max-width:700px;width:calc(100% - 32px);max-height:88vh;background:var(--bg);color:var(--fg-2);box-shadow:var(--elev-raised)}dialog::backdrop{background:var(--border)}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;font-size:12px;color:var(--meta)}.icon-button{height:28px;width:28px;font-size:20px;border-radius:4px;color:var(--muted)}.eyebrow{font-size:11px;letter-spacing:0;color:var(--meta)}.exercise-meta{display:flex;gap:12px;font-size:11px;color:var(--meta);margin-bottom:12px}.modal-title{font-size:22px;line-height:1.5;font-weight:600;margin:0 0 22px}.exercise-stem{padding:16px 0 24px;border-bottom:1px solid var(--border);font-size:16px;line-height:2}.exercise-actions{display:flex;gap:10px;margin:22px 0}.primary-button,.secondary-button{display:inline-flex;gap:8px;align-items:center;justify-content:center;border-radius:4px;padding:9px 14px;font-size:12px;line-height:1.5}.primary-button{background:var(--accent);color:var(--accent-on);border:1px solid transparent}.primary-button:hover{background:var(--accent-hover)}.secondary-button{border:1px solid var(--border);color:var(--fg-2)}.choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0}.choice{text-align:left;padding:12px;border:1px solid var(--border);border-radius:4px;font-size:13px;display:flex;gap:12px}.choice span{color:var(--meta)}.choice.correct{border-color:var(--success)}.choice.wrong{border-color:var(--danger)}.feedback{font-size:12px;color:var(--success);margin:14px 0}.feedback.wrong{color:var(--danger)}.hint-box{background:var(--surface);border-left:2px solid var(--meta);padding:14px 16px;font-size:13px;line-height:1.9}.solution{margin-top:24px}.solution h3{font-size:14px;font-weight:600;margin-bottom:12px}.solution-step{display:flex;align-items:flex-start;gap:14px;font-size:14px;line-height:2;padding:10px 0}.step-number{font-size:11px;color:var(--meta);width:16px;flex-shrink:0}.answer-box{border-top:1px solid var(--border-soft);margin-top:14px;padding:20px 0;font-size:15px}.pitfall{font-size:12px;line-height:1.8;color:var(--muted);padding:8px 0}.exercise-bottom{display:flex;justify-content:space-between;gap:15px;border-top:1px solid var(--border);padding-top:20px;margin-top:24px}.muted{font-size:12px;color:var(--meta)}#about-dialog{max-width:520px}#about-dialog h2{font-size:20px;font-weight:600;margin-bottom:20px}#about-dialog p{font-size:13px;line-height:1.9;color:var(--muted);margin-bottom:16px}#about-dialog a{color:var(--accent)}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);padding:10px 18px;background:var(--fg-2);color:var(--bg);border-radius:4px;z-index:100;font-size:12px}.load-error{text-align:center;padding:80px 20px}.load-error h2{font-size:18px;margin-bottom:16px}.load-error button{margin-top:20px}.noscript{padding:30px;text-align:center}
@media(min-width:1700px){.workspace{grid-template-columns:minmax(0,1fr) 340px}.detail-panel{padding:28px}.graph-stage{min-height:550px}}
@media(max-width:1250px){.search-suggestions{display:none}.app-sidebar{width:210px}main{margin-left:210px;padding:0 24px}.workspace{grid-template-columns:minmax(0,1fr) 280px}.detail-panel{padding:20px}.graph-hint{display:none}.results{left:24px;width:calc(100% - 48px)}}
@media(max-width:1000px){.app-sidebar{width:195px;padding-left:8px;padding-right:8px}.brand-sub{display:none}main{margin-left:195px;padding:0 20px}.workspace{grid-template-columns:1fr;min-height:0}.graph-stage{height:460px;min-height:0;flex:none}.detail-panel{border-left:0;border-top:1px solid var(--border);max-height:none;min-height:0;padding:24px}.overview-links{display:grid;grid-template-columns:1fr 1fr;column-gap:28px}.detail-panel h2{font-size:19px}.chapter-topics{grid-template-columns:1fr 1fr}.results{left:20px;width:calc(100% - 40px)}}
@media(max-width:700px){.app-sidebar{position:static;width:100%;padding:14px 16px 0;border-right:0;border-bottom:1px solid var(--border);background:var(--bg)}.brand{padding:0 0 13px;font-size:18px}.brand-mark{width:23px;height:25px}.brand-sub{display:inline-block}.app-sidebar nav{flex-direction:row;gap:14px;justify-content:space-between}.nav-link{font-size:12px;padding:10px 0;border-radius:0}.nav-link:before{display:none}.nav-link.active{background:none;border-bottom:2px solid var(--fg-2)}.nav-count{margin-left:5px}.sidebar-divider,.sidebar-label,.chapter-tree,.sidebar-about{display:none}main{margin-left:0;padding:0 16px}.topbar{height:52px;border:0}.topbar h1{font-size:15px}.topbar>span{display:none}.search-area{margin:0 0 16px;display:block}#search-form{max-width:none}.graph-stage{height:400px}.graph-toolbar{height:auto;min-height:50px;padding:12px}.breadcrumb{font-size:10px;gap:4px}.breadcrumb button{font-size:10px}.graph-footer{padding:0 12px}.map-label{left:12px;top:12px}.graph-tools{left:12px;bottom:12px}.graph-tools button{height:32px;width:32px}.detail-panel{padding:22px}.results{top:102px;left:16px;width:calc(100% - 32px);max-height:65vh;padding:12px}.chapter-topics{grid-template-columns:1fr;padding:0 8px 14px}.list-heading{margin-top:20px}.progress-summary{gap:16px}.progress-summary>div{display:block}.progress-summary strong{font-size:18px;display:block}.progress-summary span{font-size:11px}.choices{grid-template-columns:1fr}dialog{padding:22px 20px}.modal-title{font-size:20px}.exercise-stem{font-size:14px}.solution-step{font-size:13px}.exercise-bottom{flex-wrap:wrap}footer{font-size:9px;flex-wrap:wrap;padding:16px 0}.result-card{padding:14px 6px}.overview-links{column-gap:16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Reading mode: the article takes precedence over the navigation map. */
.graph-rail{min-width:0;display:flex;flex-direction:column}.graph-rail>.graph-card{flex:1}.graph-card{transform-origin:top left}.related-panel{border-top:1px solid var(--border);padding:20px 0}.related-panel h3{font-size:13px;font-weight:600;margin-bottom:14px}.relation-caption{font-size:11px;color:var(--meta);margin-bottom:6px}.related-topics>button{width:100%;display:flex;justify-content:space-between;gap:12px;padding:11px 0;text-align:left;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-soft)}.related-topics>button:hover{color:var(--accent);background:none}.related-topics>button>span{color:var(--meta)}
.workspace.reading{grid-template-columns:minmax(0,1fr) 280px;grid-template-areas:'article map';gap:32px;border:0;border-radius:0;overflow:visible;align-items:start;min-height:calc(100vh - 220px)}.workspace.reading>.graph-rail{grid-area:map;position:sticky;top:24px;align-self:start}.workspace.reading .graph-card{border:1px solid var(--border);border-radius:6px;overflow:hidden;flex:none;z-index:2;background:var(--bg)}.workspace.reading .graph-stage{height:245px;min-height:0;flex:none}.workspace.reading .graph-toolbar{height:43px;padding:0 12px}.workspace.reading .breadcrumb{font-size:12px;color:var(--muted)}.workspace.reading .graph-toolbar>.text-button{font-size:11px}.workspace.reading .graph-footer,.workspace.reading .map-label{display:none}.workspace.reading .graph-tools{left:8px;bottom:8px;padding:2px;gap:2px}.workspace.reading .graph-tools>button{width:24px;height:24px;font-size:15px}.workspace.reading .graph-tools>span{min-width:28px;font-size:9px}.workspace.reading .graph-tools .tool-divider{min-width:1px}.workspace.reading .node-subtitle{display:none}.workspace.reading .node-title{font-size:23px}.workspace.reading .graph-node.selected .node-box{stroke-width:3}.workspace.reading #graph{background:var(--surface)}
.workspace.reading>.detail-panel{grid-area:article;border:0;padding:14px 16px 40px 0;max-height:none;min-height:0;overflow:visible;min-width:0}.reading-meta{font-size:12px;color:var(--meta);margin-bottom:10px}.workspace.reading .detail-panel h2{font-size:28px;font-weight:650;line-height:1.5;margin-bottom:24px;letter-spacing:-.5px}.workspace.reading .panel-tabs{gap:28px;margin-bottom:28px}.workspace.reading .panel-tabs button{font-size:13px;padding:10px 0 12px}.workspace.reading .panel-tabs button>span{font-size:11px;color:var(--meta);margin-left:5px}.workspace.reading .intro{font-size:15px;line-height:2;margin:0 0 24px;color:var(--fg-2)}.workspace.reading .formula{margin:28px 0 36px;padding:28px 16px;font-size:21px;text-align:left;border-left:2px solid var(--border);border-radius:0;background:var(--surface)}.topic-methods h3{font-size:14px;font-weight:600;margin-bottom:12px}.reading-method{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0;text-align:left;width:100%;border-bottom:1px solid var(--border-soft)}.reading-method:hover{background:none}.reading-method strong{font-size:14px;font-weight:500;display:block;margin-bottom:6px}.reading-method>span>span{display:block;font-size:13px;line-height:1.8;color:var(--muted)}.reading-method>span:last-child{color:var(--meta)}.reading-method:hover strong{color:var(--accent)}.workspace.reading .panel-exercise{padding:20px 0}.workspace.reading .panel-exercise strong{font-size:15px}.workspace.reading .panel-note{margin-top:32px}.workspace.reading .detail-panel:focus{outline:none}
@media(min-width:1700px){.workspace.reading{grid-template-columns:minmax(0,1fr) 310px;gap:48px}.workspace.reading .graph-stage{height:280px}}
@media(max-width:1100px) and (min-width:851px){.workspace.reading{grid-template-columns:minmax(0,1fr) 230px;gap:22px}.workspace.reading .graph-stage{height:210px}.workspace.reading .detail-panel h2{font-size:24px}.workspace.reading .detail-panel{padding-right:0}.workspace.reading .intro{font-size:14px}}
@media(max-width:850px){.workspace.reading{grid-template-columns:minmax(0,1fr);grid-template-areas:'article' 'map';gap:24px}.workspace.reading>.graph-rail{position:static;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start}.workspace.reading .graph-stage{height:210px}.workspace.reading .related-panel{border-top:0;padding-top:10px}.workspace.reading>.detail-panel{padding:12px 0 0}.workspace.reading .detail-panel h2{font-size:25px}.workspace.reading .formula{font-size:18px}}
@media(max-width:480px){.workspace.reading>.graph-rail{grid-template-columns:1fr}.workspace.reading .graph-stage{height:220px}.workspace.reading .related-panel{padding-top:0}.workspace.reading .detail-panel h2{font-size:24px}.workspace.reading .intro{font-size:14px}.workspace.reading .formula{padding:24px 12px;overflow:auto}.reading-method strong{font-size:13px}.reading-method>span>span{font-size:12px}}
.exercise-preview{display:block;font-size:13px;line-height:1.9;color:var(--muted);margin-top:12px}.exercise-preview .katex{font-size:1em}#reading-title:focus{outline:none}.workspace.reading>.detail-panel{max-width:840px;justify-self:center;width:100%}
/* One subject label, one search field, both in the page header. */
.topbar{position:sticky;top:0;z-index:30;background:var(--bg);height:72px;margin-bottom:24px;justify-content:space-between}.page-heading{display:flex;align-items:center;gap:14px;min-width:0;white-space:nowrap}.subject-label{font-size:12px;color:var(--meta);padding-left:14px;border-left:1px solid var(--border)}.topbar #search-form{width:330px;flex:0 1 330px;min-width:180px;height:36px;gap:8px;padding:3px 5px 3px 10px;background:var(--surface);box-shadow:none;border-color:transparent}.topbar #search-form:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring);background:var(--bg)}.topbar .search-icon{width:16px;height:16px}.topbar #search{font-size:12px}.topbar #focus-search{flex:none;padding:3px;background:transparent;border-radius:3px;white-space:nowrap}.topbar #focus-search:hover{background:var(--border-soft)}.topbar #focus-search kbd{font-size:10px;margin:0;border:1px solid var(--border);padding:2px 4px}.results{position:fixed;top:64px;right:auto;left:auto;z-index:40;max-height:min(65vh,650px)}.workspace:not(.reading){min-height:calc(100vh - 155px)}.workspace:not(.reading) .graph-stage{height:calc(100vh - 255px)}
@media(max-width:700px){.topbar{height:64px;gap:12px;margin-bottom:16px}.page-heading{gap:8px}.subject-label{font-size:10px;padding-left:8px}.topbar h1{font-size:14px}.topbar #search-form{width:220px;flex-basis:220px;min-width:140px}.topbar #search{font-size:11px}.topbar #focus-search kbd{font-size:9px}.workspace:not(.reading) .graph-stage{height:400px}.workspace:not(.reading){min-height:0}}
@media(max-width:440px){.topbar{flex-wrap:wrap;height:auto;padding:12px 0;gap:12px}.page-heading{width:100%}.topbar #search-form{width:100%;flex-basis:100%;max-width:none;height:36px}.results{max-height:60vh}}

/* Worked teaching content and a single practice list in the reading rail. */
.lesson-steps{padding-left:24px;margin:24px 0 32px;line-height:1.95;font-size:14px}.lesson-steps li{padding-left:8px;margin:0 0 20px}.lesson-steps li::marker{color:var(--meta);font-size:12px}.lesson-steps strong{font-weight:600}.lesson-steps p{margin-top:6px;color:var(--muted)}.worked-example{border-top:1px solid var(--border);padding-top:28px;margin-top:32px}.worked-example h3{font-size:17px;font-weight:600;line-height:1.7;margin-bottom:14px}.example-stem{font-size:15px;line-height:2}.lesson-takeaway,.lesson-caution{font-size:13px;line-height:1.95;color:var(--muted)}.lesson-caution{padding:16px 0 16px 16px;border-left:2px solid var(--border);margin-top:28px}.lesson-takeaway{margin-bottom:28px}.sidebar-exercises{border-top:1px solid var(--border);margin-top:24px;padding-top:20px}.sidebar-exercises h3{display:flex;align-items:baseline;justify-content:space-between;margin:0}.sidebar-exercises h3>span{font-size:11px;font-weight:400;color:var(--meta)}.workspace.reading .sidebar-exercises .panel-exercise{padding:16px 0}.workspace.reading .sidebar-exercises .panel-exercise strong{font-size:13px;line-height:1.7}.sidebar-exercises .exercise-preview{font-size:12px;margin-top:8px;overflow-wrap:anywhere}.sidebar-exercises .katex{white-space:normal}.workspace.reading>.graph-rail{top:96px;max-height:calc(100dvh - 112px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}.worked-example .katex,.lesson-steps .katex{font-size:1.08em}
@media(max-width:850px){.workspace.reading>.graph-rail{max-height:none;overflow:visible}.lesson-steps{font-size:14px}}

/* Related topics and exercises are two independent, quiet bordered panels. */
.related-panel{display:flex;flex-direction:column;gap:16px;border:0;padding:16px 0 0}.related-topics,.sidebar-exercises{border:1px solid var(--border);border-radius:8px;background:var(--bg);padding:18px 16px;margin:0;min-width:0}.related-panel h3{margin:0 0 12px}.related-topics>button{padding:12px 0;min-height:44px}.related-topics>button:last-child,.sidebar-exercises .panel-exercise:last-child{border-bottom:0}.sidebar-exercises .panel-exercise{border:0}.sidebar-exercises .panel-exercise+.panel-exercise{margin-top:8px}.workspace.reading .sidebar-exercises .panel-exercise{padding:12px 0}.related-panel .empty-within{padding:8px 0}.related-panel .relation-caption{margin:0 0 4px}.workspace.reading .related-panel{padding-top:16px}.detail-panel,.graph-rail,.graph-card,.view{min-width:0}.intro,.lesson-steps,.lesson-takeaway,.lesson-caution,.example-stem,.result-card{overflow-wrap:anywhere}.katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:4px 0}.reading-method>span:first-child{min-width:0}.reading-method>span:last-child{flex-shrink:0}.panel-exercise .katex{white-space:normal}
@media(max-width:850px){.workspace.reading>.graph-rail{display:grid;grid-template-columns:1fr;gap:16px}.workspace.reading .related-panel{display:grid;grid-template-columns:1fr 1fr;align-items:start;padding:0;gap:16px}.workspace.reading .graph-stage{height:240px}.workspace.reading>.detail-panel{padding-bottom:8px}}
@media(max-width:700px){.app-sidebar{padding:14px 16px 0}.app-sidebar nav{gap:8px}.nav-link{min-height:44px;display:flex;align-items:center;white-space:nowrap}.nav-count{float:none}.topbar{margin-bottom:16px}.view{scroll-margin-top:116px}.chapter-topics button{min-height:44px}.result-card{padding:16px 8px}.filter-tabs button{min-height:40px}.text-button{min-height:36px}.graph-tools button,.workspace.reading .graph-tools>button{width:36px;height:36px;font-size:18px}.workspace.reading .graph-tools>span{font-size:10px}.workspace.reading .graph-toolbar{height:48px}.workspace.reading .graph-toolbar>.text-button{font-size:12px}.workspace.reading>.graph-rail{top:auto}.workspace.reading .intro{font-size:15px;line-height:1.95}.lesson-steps{padding-left:20px;font-size:15px;line-height:1.9}.lesson-steps li{padding-left:4px;margin-bottom:24px}.worked-example h3{font-size:17px}.lesson-caution,.lesson-takeaway{font-size:14px}.exercise-preview{line-height:1.9}.primary-button,.secondary-button,.icon-button{min-height:44px}.icon-button{min-width:44px}.choices{grid-template-columns:1fr}.choice{min-height:48px}.exercise-actions{flex-wrap:wrap}.exercise-bottom{flex-wrap:wrap}.modal-head{margin-bottom:12px}.solution-step{font-size:14px;gap:10px}.exercise-stem{font-size:15px}dialog{width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:20px 18px}.workspace:not(.reading) .graph-stage{height:360px}.workspace.reading .graph-stage{height:230px}.workspace.reading .formula{font-size:18px;padding:20px 12px}.topbar #search{font-size:16px}.topbar #search-form{height:42px}}
@media(max-width:540px){.workspace.reading .related-panel{grid-template-columns:1fr}.related-topics,.sidebar-exercises{padding:18px 16px}.workspace.reading .detail-panel h2{font-size:26px}.workspace.reading>.detail-panel{padding-right:0}.workspace.reading .sidebar-exercises .panel-exercise strong{font-size:14px}.sidebar-exercises .exercise-preview{font-size:13px}.related-topics>button{font-size:14px}.related-panel h3{font-size:14px}.tiny-meta{font-size:12px}.workspace.reading{gap:24px}.progress-summary{flex-wrap:wrap}}
@media(max-width:440px){.topbar{gap:8px;padding:10px 0}.page-heading{width:100%;justify-content:flex-start}.topbar #search-form{flex-basis:100%;min-width:0}.topbar #search{font-size:16px}.app-sidebar nav{gap:4px}.nav-link{font-size:12px}.subject-label{font-size:11px}.results{max-height:calc(100dvh - 150px)}.result-card h3{font-size:14px}}

/* Text and color both identify difficulty; badges remain legible without color. */
.difficulty-tag{display:inline-flex;align-items:center;justify-content:center;flex:none;line-height:1.5;padding:2px 7px;border:1px solid;border-radius:4px;font-size:11px;font-weight:500;white-space:nowrap;vertical-align:middle}.difficulty-basic{color:#32634a;background:#f1f8f3;border-color:#c8dfce}.difficulty-medium{color:#8a601a;background:#fff8eb;border-color:#ead6ab}.difficulty-advanced{color:#725098;background:#f7f2fc;border-color:#ddccec}.difficulty-neutral{color:var(--muted);background:var(--surface);border-color:var(--border)}.exercise-labels{align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap}.exercise-labels .arrow{margin-left:auto}.exercise-origin{color:var(--meta)}.exercise-meta{align-items:center;flex-wrap:wrap;line-height:1.8}.result-card>.tiny-meta{align-items:center;gap:8px;justify-content:flex-start}.result-card>.tiny-meta>span:last-child{margin-left:auto}.result-card>.tiny-meta>.difficulty-tag{display:inline-flex}.sidebar-exercises .tiny-meta .difficulty-tag{font-size:11px}

/* Method explanations stay inside the current exercise. */
.exercise-method{border:1px solid var(--border);border-radius:6px;margin:10px 0;background:var(--bg)}.exercise-method>summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;padding:12px 14px;min-height:44px;font-size:14px;font-weight:500}.exercise-method>summary::-webkit-details-marker{display:none}.exercise-method>summary>span{color:var(--meta);transition:transform .15s}.exercise-method[open]>summary>span{transform:rotate(180deg)}.exercise-method>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.inline-method{padding:4px 16px 20px;border-top:1px solid var(--border-soft)}.inline-method .intro{font-size:14px;line-height:1.95;margin:16px 0}.inline-method .lesson-steps{font-size:14px;margin:20px 0}.inline-method .worked-example h3{font-size:15px}.inline-method .example-stem{font-size:14px}.inline-method .panel-note{margin-top:20px}#toggle-reading-map{display:none}
@media(max-width:700px){.workspace.reading{display:flex;flex-direction:column;gap:24px}.workspace.reading>.graph-rail{display:contents}.workspace.reading .graph-card{order:-1;width:100%;flex:none}.workspace.reading>.detail-panel{order:0}.workspace.reading .related-panel{order:1;width:100%}.workspace.reading #toggle-reading-map{display:inline-flex;align-items:center;font-size:12px;white-space:nowrap;margin-left:auto}.workspace.reading .graph-toolbar{gap:8px;padding:0 10px;height:40px}.workspace.reading .graph-toolbar>.text-button{font-size:11px;min-height:36px}.workspace.reading .graph-stage{height:130px;transition:height .2s ease}.workspace.reading .mobile-expanded .graph-stage{height:280px}.workspace.reading .graph-tools{left:6px;bottom:6px}.workspace.reading .graph-tools>button{width:28px;height:28px;font-size:16px}.workspace.reading .graph-tools>span{font-size:9px;min-width:24px}.workspace.reading .graph-card:not(.mobile-expanded) .graph-tools{display:none}.workspace.reading>.detail-panel{max-width:none}.workspace.reading .related-panel{display:grid;grid-template-columns:1fr}.inline-method{padding:4px 12px 16px}.inline-method .lesson-steps{font-size:14px}.inline-method .worked-example{padding-top:20px;margin-top:24px}}

/* Knowledge-point methods expand in place, preserving the article and graph. */
.topic-method{border-bottom:1px solid var(--border-soft)}.topic-method>summary{list-style:none;cursor:pointer;border-bottom:0}.topic-method>summary::-webkit-details-marker{display:none}.topic-method>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.topic-method .method-chevron{transition:transform .15s;font-size:16px}.topic-method[open] .method-chevron{transform:rotate(180deg)}.topic-method>.inline-method{padding:0 0 24px;border-top:0}.topic-method>.inline-method>.lesson-caution:first-child{margin-top:0}.topic-method .inline-method .intro{font-size:14px;margin:8px 0 20px}.topic-method .inline-method .panel-note{margin-top:16px}
@media(max-width:700px){.topic-method>summary{min-height:64px;padding:16px 0}.topic-method .inline-method .intro{font-size:15px}.topic-method>.inline-method{padding-bottom:20px}}
