.courses,.courses form,.courses label{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.courses{margin:0 0 22px;gap:20px}.courses select,.courses input,.courses button{font:inherit;color:inherit;padding:8px 12px;border:1px solid #b5c9b8;border-radius:6px;background:white;max-width:100%}.courses button{background:#e8f2e7;cursor:pointer}.courses select{max-width:min(65vw,360px)}
.step-demo{border:1px solid #cad9cc;border-radius:9px;padding:14px;margin:12px 0}.step-demo{background:#f3f7ef;white-space:normal}.step-demo svg,.legacy-plot svg{width:100%;height:auto}.step-demo label{display:block;margin:8px 0}.step-demo input[type=range]{display:block;width:100%}.step-demo input[type=checkbox]{width:auto}.step-demo button{margin:4px}.step-demo button{padding:6px 12px;cursor:pointer}.note-body{white-space:pre-wrap;overflow-wrap:anywhere}.note-body>section{margin:18px 0}

.draft-row{display:block;background:#fff;border:1px solid #d5e0d3;border-radius:12px;padding:22px;margin:8px 0}
.katex-display{overflow-x:auto;padding:5px}
.note-editor{margin:28px 0 52px;--rule:#d6ded3;--muted:#586d60}
.editor-bar,.editor-path,.editor-mode{display:flex;align-items:center}
.editor-bar{justify-content:space-between;gap:12px;margin-bottom:18px}
.editor-path{gap:12px;color:var(--muted);font-size:14px}
.editor-path h1{margin:0;font:600 15px/1.5 "Microsoft YaHei",sans-serif;letter-spacing:0;color:#193f32}
.editor-mode{background:#eaf0e6;padding:3px;border-radius:7px}
.note-editor button{font:inherit;cursor:pointer}
.editor-mode button{background:transparent;color:#42604c;border:0;border-radius:5px;padding:6px 18px;font-size:14px}
.editor-mode button[aria-pressed=true]{background:#20533e;color:white}
.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 222px;align-items:start;gap:28px}
.editor-paper{min-width:0;min-height:65vh;background:white;border:1px solid var(--rule);border-top:3px solid #40694f;border-radius:3px;padding:clamp(20px,4vw,56px);box-shadow:0 4px 18px #29463408}
#noteTitle,#previewTitle{display:block;width:100%;margin:0 0 18px;padding:0 0 20px;border:0;border-bottom:1px solid var(--rule);border-radius:0;background:transparent;color:inherit;font:600 clamp(27px,3vw,42px)/1.4 Georgia,SimSun,serif;overflow-wrap:anywhere}
#noteTitle::placeholder{color:#738578}
#blocks{display:grid;gap:18px}
.notebook-bar,.cell-bar,.cell-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.notebook-bar{justify-content:space-between;margin-bottom:18px;color:var(--muted);font-size:13px}
.notebook-bar button,.cell-editor button,#blocks>button{border:1px solid #bfcdbf;background:white;border-radius:5px;color:#28543c;padding:5px 10px;font-size:13px}
.notebook-bar button{background:#eaf2e6}
#blocks>button{justify-self:start}
.notebook-cell{min-width:0;border:1px solid #cdd9ce;background:white;border-radius:7px;overflow:hidden}
.notebook-cell:focus-within{border-color:#699378;box-shadow:inset 3px 0 #568268}
.cell-bar{background:#f0f5ee;border-bottom:1px solid #dce4d9;padding:6px 10px}
.cell-number{color:#56725e;font:12px Consolas,monospace}
.cell-type,.cell-editor select,.editor-inspector select{max-width:100%;font:inherit;color:inherit;background:white;border:1px solid #bfccbf;border-radius:4px;padding:6px}
.cell-type{font-size:13px;font-weight:600}
.cell-tools{margin-left:auto;gap:2px}
.cell-tools button{border:0;background:transparent;color:#36533e;border-radius:3px;min-width:28px;height:28px;line-height:1}
.cell-tools button:hover:enabled{background:#dfeadd}
.cell-tools button:disabled{opacity:.32;cursor:default}
.cell-editor{padding:14px;min-width:0}
.cell-editor textarea,.cell-editor input:not([type]),.cell-editor input[type=file]{max-width:100%;font:inherit;color:inherit}
.cell-editor textarea{display:block;width:100%;resize:vertical;border:0;background:transparent;padding:5px;line-height:1.7}
.cell-editor .code-input,.code-output{font:14px/1.7 Consolas,monospace;background:#f4f6f3;border-radius:4px;padding:12px;tab-size:4}
.cell-editor button{margin:6px 6px 0 0}
.cell-editor input:not([type]){border:1px solid #cdd9ce;padding:6px}
.cell-image{margin:12px 0}
.cell-image img,.cell-markdown img{display:block;max-width:100%;height:auto}
.cell-image figcaption{font-size:13px;color:#586d60;margin-top:6px}
.cell-editor [role=status]{display:block;font-size:13px;color:#75481d}
.cell-table,.cell-markdown{overflow-x:auto;white-space:normal}
.cell-table table,.cell-markdown table{border-collapse:collapse;width:100%;font-size:14px}
.cell-table :is(td,th),.cell-markdown :is(td,th){padding:7px;border:1px solid #cdd9ce;text-align:left}
.cell-table th,.cell-markdown th{background:#eff4ed}
.cell-table input:not([type]){min-width:6em;width:100%;border:0;background:transparent}
.code-output,.cell-markdown pre{overflow-x:auto;white-space:pre}
.cell-markdown>:first-child{margin-top:0}
.cell-markdown>:last-child{margin-bottom:0}
.editor-inspector label{display:block;font-size:13px;color:var(--muted)}
.note-editor :is(button,summary,a):hover{text-decoration:underline}
.note-editor :focus-visible{outline:2px solid #527d5d;outline-offset:2px}
.editor-inspector{padding:16px 0;border-top:2px solid #91a58f}
.editor-inspector h2{margin:0 0 20px;font-size:20px}
.editor-inspector label{margin:14px 0}
.editor-inspector select,.editor-inspector input{display:block;width:100%;margin-top:5px;accent-color:#20533e}
.editor-status{margin-top:22px;border-top:1px solid var(--rule);color:var(--muted);font-size:13px}
.editor-status a{color:#20533e;text-decoration:underline;text-underline-offset:3px}
.note-editor [hidden]{display:none}
@media(max-width:760px){
  .section{flex-wrap:wrap}
  .note-editor{margin-top:18px}
  .editor-path{gap:6px}
  .editor-layout{grid-template-columns:minmax(0,1fr);gap:22px}
  .editor-mode button{padding:6px 12px}
  .editor-paper{min-height:48vh;padding:14px}
  .cell-bar{padding:5px;gap:4px}
  .cell-tools button{min-width:24px}
  .cell-editor{padding:9px}
}

main:has(.note-editor){max-width:none;padding-inline:clamp(12px,3vw,76px)}
.note-editor{font-size:clamp(15px,.55vw + 9px,20px)}
.editor-layout{grid-template-columns:minmax(0,var(--paper-width,70%)) clamp(18px,2vw,36px) minmax(0,1fr);gap:0}
.editor-paper{padding:clamp(14px,3vw,70px)}
.editor-inspector{min-width:0}
.inspector-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px}
.inspector-heading h2{margin:0}
#resetLayout{color:#486250;background:none;border:0;text-decoration:underline;font-size:13px;padding:4px}
.layout-divider{position:relative;align-self:stretch;touch-action:none;cursor:col-resize;user-select:none}
.layout-divider::before,.layout-divider::after{content:"";position:absolute;left:50%;transform:translateX(-50%);border-radius:4px}
.layout-divider::before{width:1px;inset-block:0;background:#d9e2d7}
.layout-divider::after{width:5px;height:44px;top:clamp(40px,20vh,160px);background:#8fa58f}
.layout-divider:is(:hover,:focus-visible)::after{background:#315d43}
@media(max-width:760px){
  .editor-layout{grid-template-columns:minmax(0,1fr)}
  .editor-paper{height:var(--paper-height,auto);min-height:min(48vh,var(--paper-height,48vh));overflow:auto}
  .layout-divider{height:26px;cursor:row-resize}
  .layout-divider::before{width:100%;height:1px;top:50%}
  .layout-divider::after{width:44px;height:5px;top:50%;transform:translate(-50%,-50%)}
}

.format-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:16px;margin-top:28px}
.format-options a,.tex-source,.tex-preview{border:1px solid #cdd9ce;background:white;border-radius:7px;min-width:0}
.format-options a{display:grid;gap:8px;padding:24px}
.format-options strong{font:600 28px Georgia,serif}
.format-options span,.tex-meta{color:#556b5c;font-size:14px}
.format-options a:hover{background:#eef4eb}
.tex-meta,.tex-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.tex-meta{margin-bottom:14px}
.tex-editor input,.tex-editor select,#downloadTex{font:inherit;color:inherit;border:1px solid #c3d0c2;background:white;padding:6px 10px;border-radius:5px;max-width:100%}
#texTitle{flex:1 1 220px;font-size:20px}
.tex-source,.tex-preview{padding:0;display:flex;flex-direction:column;height:72dvh;min-height:0;overflow:hidden}
.tex-heading{min-height:44px;padding:6px 14px;background:#eef4eb;border-bottom:1px solid #cdd9ce}
.tex-heading h2,.tex-heading label{font:600 15px/1.5 Consolas,sans-serif}
#texSource,#texOutput{flex:1;min-height:0;width:100%;border:0}
#texSource{resize:none;padding:14px;font:15px/1.75 Consolas,monospace;color:#263d30;tab-size:2}
#texLog{font-size:13px;color:#813f24;margin:0;padding:8px;max-height:8em;overflow:auto}
#texLog:empty{display:none}
@media(max-width:760px){.tex-source{height:var(--paper-height,48dvh)}.tex-preview{height:56dvh}}
#projectFiles{margin:14px 0;padding:12px 16px;border:1px solid #ccd9cc;background:#f4f7f0;border-radius:6px}#projectFiles summary{cursor:pointer;font-weight:600}.project-tools{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:10px}.project-tools button,.tex-editor .editor-bar button{background:white;border:1px solid #becdbf;color:inherit;border-radius:4px;padding:5px 9px}.project-tools select{min-width:min(230px,100%)}#texLog{white-space:pre-wrap}#texLog a{text-decoration:underline}
.compiled-pdf{width:100%;height:65vh;border:0}.compile-log{max-height:13em;overflow:auto;white-space:pre-wrap;font:13px/1.6 Consolas,monospace}.compile-log:empty{display:none}.compile-log a{text-decoration:underline}.tex-source .tex-heading input{width:10em;font-size:13px}.tex-source .tex-heading button{font-size:13px;color:inherit;background:white;border:1px solid #bfccbf;border-radius:4px}

/* LaTeX project workbench */
body:has(.tex-editor)>header,body:has(.tex-editor)>footer{display:none}
main:has(.tex-editor){padding:0;max-width:none}
.tex-editor{margin:0;background:white;color:#243448;font:14px/1.5 "Microsoft YaHei",sans-serif}
.studio-top,.studio-status,.studio-body,.studio-tabs{display:flex;align-items:center}
.studio-top{min-height:50px;gap:16px;padding:6px 15px;border-bottom:1px solid #d3d9e0;position:relative;z-index:2}
.studio-top>a{color:#245f44;font-weight:600}
.studio-top #texTitle{min-width:0;text-align:center;background:transparent;border-color:transparent;font-size:16px;font-weight:600}
.studio-top #texTitle:hover{border-color:#c9d4cb}
.studio-status{gap:10px;font-size:12px;color:#536556}
.studio-menu summary,.file-commands summary,.studio-outline summary{cursor:pointer}
.studio-menu>div{position:absolute;background:white;border:1px solid #d7dce1;box-shadow:0 4px 14px #17253120;padding:7px;display:grid}
.tex-editor button{color:inherit}
.studio-menu button,.studio-side button{border:0;background:transparent;text-align:left;padding:7px 10px}
.studio-body{align-items:stretch;height:calc(100dvh - 52px);min-height:340px}
.studio-side{width:20%;min-width:150px;max-width:42%;resize:horizontal;overflow:auto;display:flex;flex-direction:column;border-right:5px solid #e2e6ec}
.studio-body>.editor-layout{flex:1;min-width:0;grid-template-columns:minmax(0,var(--paper-width,50%)) 9px minmax(0,1fr);align-items:stretch}
.studio-body .layout-divider{background:#e2e6ec}
.studio-body .layout-divider::after{height:30px;width:3px;top:48%}
.studio-side #projectFiles{position:relative;flex:1;overflow:auto;margin:0;border:0;background:white;border-radius:0;padding:10px 6px}
#projectFiles h2,.studio-outline summary{font:600 14px/1.6 "Microsoft YaHei",sans-serif;margin:0;padding:4px 8px}
.file-commands summary{position:absolute;right:10px;top:12px;color:#276b4a;font-size:13px}
.project-tree,#texOutline{display:grid;align-content:start;gap:2px;margin-top:8px}
.project-tree button,#texOutline button{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:4px;font-size:14px}
.project-tree button[aria-pressed=true]{color:#155738;background:#e5f1ea;font-weight:600}
.project-tree button:hover,#texOutline button:hover{background:#eff3f5}
.studio-outline{height:32%;overflow:auto;border-top:5px solid #e2e6ec;padding:8px}
.studio-outline:not([open]){height:auto}
#texOutline{color:#586679;font-size:12px}
.studio-body .tex-source,.studio-body .tex-preview{height:auto;box-shadow:none;border:0;border-radius:0}
.studio-tabs,.studio-body .tex-heading{background:#f4f5f7;min-height:38px;border-bottom:1px solid #d9dfe6;padding:4px 9px;gap:6px;justify-content:flex-start}
.studio-tabs label{background:white;border-top:2px solid #268657;border-radius:4px 4px 0 0;padding:4px 12px;font:14px Consolas,monospace;overflow-wrap:anywhere}
.studio-body .tex-source .tex-heading{background:white}
.studio-body #compileTex{border:0;border-radius:16px;background:#17804b;color:white;padding:5px 15px;font-weight:600}
.studio-body #resetLayout{margin-left:auto}
.studio-code{display:flex;flex:1;min-height:0;overflow:hidden}
.studio-code>div{position:relative;flex:1;min-width:0;overflow:hidden}
#texLines,#texColors,.studio-code #texSource{font:14px/24px Consolas,"Microsoft YaHei",monospace;letter-spacing:0;tab-size:2;white-space:pre;margin:0;padding:10px 8px}
#texLines{flex:none;overflow:hidden;text-align:right;color:#718091;background:#f5f6f8;border-right:1px solid #e2e6ec}
#texColors,.studio-code #texSource{position:absolute;top:0;left:0}
#texColors{pointer-events:none;color:#28394a}
.studio-code #texSource{width:100%;height:100%;background:transparent;color:transparent;caret-color:#14283a;border-radius:0;outline-offset:-2px}
.tex-comment{color:#387a71}.tex-command{color:#294db3}.tex-delimiter{color:#946039}
.studio-body .compiled-pdf{flex:1;min-height:0}
@media(forced-colors:active){#texColors{display:none}.studio-code #texSource{color:CanvasText}}
@media(max-width:760px){
 .studio-top{flex-wrap:wrap;gap:8px}.studio-top #texTitle{flex:1 1 120px}.studio-status{flex-wrap:wrap}
 .studio-body{display:block;height:auto}.studio-side{width:auto;max-width:none;min-width:0;resize:none;max-height:32vh;border-right:0;border-bottom:1px solid #d9dfe6}
 .studio-outline{height:auto;max-height:13vh}.studio-body>.editor-layout{grid-template-columns:minmax(0,1fr)}
 .studio-body .tex-source{height:var(--paper-height,50dvh)}.studio-body .tex-preview{height:62dvh}
 .studio-body .layout-divider::after{height:3px;width:36px}
}

/* Notebook uses the project workbench palette within its existing split layout. */
body:has(.notebook-editor){background:#f4f5f7}
.notebook-editor{--rule:#d9dfe6;--muted:#566577;--ink:#243448;--accent:#167646;--toolbar:#f4f5f7;color:var(--ink);font-family:"Microsoft YaHei",sans-serif}
.notebook-editor .editor-bar{padding:8px 12px;background:white;border:1px solid var(--rule);border-radius:5px}
.notebook-editor .editor-path a{color:#245f44;font-weight:600}
.notebook-editor .editor-path h1{color:var(--ink)}
.notebook-editor .editor-mode{background:#eceff2;border-radius:20px}
.notebook-editor .editor-mode button{border-radius:18px;color:var(--muted)}
.notebook-editor .editor-mode button[aria-pressed=true],.notebook-editor #addCell{background:var(--accent);border-color:var(--accent);color:white}
.notebook-editor #addCell{border-radius:18px}
.notebook-editor .editor-paper{border:1px solid var(--rule);border-radius:4px;box-shadow:none}
.notebook-editor :is(#noteTitle,#previewTitle){font-family:inherit;font-weight:600}
.notebook-editor #noteTitle::placeholder{color:#657386}
.notebook-editor .notebook-cell{border-color:var(--rule);border-radius:5px}
.notebook-editor .notebook-cell:focus-within{border-color:#70a98a;box-shadow:inset 3px 0 var(--accent)}
.notebook-editor .cell-bar{background:var(--toolbar);border-color:var(--rule)}
.notebook-editor .cell-number{color:var(--muted);font-variant-numeric:tabular-nums}
.notebook-editor :is(select,.cell-editor button,#blocks>button){border-color:#c9d1da;color:var(--ink)}
.notebook-editor .cell-tools button{color:#435367}
.notebook-editor .cell-tools button:hover:enabled{background:#e2e7ec}
.notebook-editor .cell-type{border-radius:4px;background:white}
.notebook-editor :is(.code-input,.code-output){background:#f5f6f8;color:#273b51}
.notebook-editor :is(.cell-table,.cell-markdown) :is(th,td){border-color:var(--rule)}
.notebook-editor :is(.cell-table,.cell-markdown) th,.notebook-editor .step-demo{background:var(--toolbar)}
.notebook-editor .step-demo{border-color:var(--rule)}
.notebook-editor .editor-inspector{background:white;border:1px solid var(--rule);border-radius:4px;padding:0 14px 14px}
.notebook-editor .inspector-heading{margin:0 -14px;padding:9px 14px;background:var(--toolbar);border-bottom:1px solid var(--rule)}
.notebook-editor .inspector-heading h2{font:600 15px/1.5 "Microsoft YaHei",sans-serif}
.notebook-editor .layout-divider::before{background:#d9dfe6}
.notebook-editor .layout-divider::after{background:#98a5b4}
.notebook-editor .layout-divider:is(:hover,:focus-visible)::after{background:var(--accent)}
.notebook-editor :focus-visible{outline-color:var(--accent)}
.notebook-editor input[type=range]{accent-color:var(--accent)}
