:root{
 --bg:#f5f5f7;--surface:#fff;--sidebar:#f2f2f5;--field:#fff;--text:#202124;--muted:#85858d;--border:#e3e3e8;--accent:#007aff;--accent-soft:#e5efff;--code:#f4f4f7;--code-text:#30303a;--shadow:0 3px 18px #25252f05;--side-width:224px;
 color-scheme:light;font:16px/1.6 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;background:var(--bg);color:var(--text)
}
:root[data-theme=dark]{--bg:#161617;--surface:#202023;--sidebar:#1c1c1f;--field:#28282c;--text:#f2f2f7;--muted:#a0a0aa;--border:#36363c;--accent:#409cff;--accent-soft:#23354c;--code:#18181c;--code-text:#e0e0e8;--shadow:0 3px 18px #0000000c;color-scheme:dark}
:root[data-theme=warm]{--bg:#f5f2ee;--surface:#fffdf9;--sidebar:#eeebe6;--field:#fffdf9;--text:#37352e;--muted:#908b80;--border:#e6e1d9;--accent:#795d3f;--accent-soft:#eee5d9;--code:#f2ede5;--code-text:#494335;color-scheme:light}
@media(prefers-color-scheme:dark){:root[data-theme=system]{--bg:#161617;--surface:#202023;--sidebar:#1c1c1f;--field:#28282c;--text:#f2f2f7;--muted:#a0a0aa;--border:#36363c;--accent:#409cff;--accent-soft:#23354c;--code:#18181c;--code-text:#e0e0e8;--shadow:0 3px 18px #0000000c;color-scheme:dark}}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.5;cursor:default}a{color:inherit;text-decoration:none}button,input,a,textarea,select{-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,a:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}[hidden]{display:none!important}svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}h1,h2,h3,p{margin-top:0}h1{font-size:30px;font-weight:650;letter-spacing:-.9px;line-height:1.3;margin:0}h2{font-size:21px;letter-spacing:-.4px;font-weight:600}h3{font-size:17px;font-weight:550}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--side-width);display:flex;flex-direction:column;background:var(--sidebar);border-right:1px solid var(--border);padding:34px 16px 21px;z-index:30}.brand{display:flex;align-items:center;gap:11px;padding:0 12px;font-size:23px;font-weight:650;letter-spacing:-.7px;margin-bottom:43px}.brand-icon{width:35px;height:35px;display:grid;place-items:center;border-radius:10px;background:var(--accent);color:#fff}.brand-icon svg{width:20px;height:20px}.side-nav{display:flex;flex-direction:column;gap:6px}.nav-link{display:flex;align-items:center;gap:12px;width:100%;padding:11px 13px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:14px;text-align:left;min-height:44px}.nav-link svg{width:19px;height:19px}.nav-link:hover{background:var(--border)}.nav-link.active{background:var(--accent-soft);color:var(--accent);font-weight:550}.sidebar-footer{margin-top:auto;padding:20px 10px 0}.theme-label{display:flex;align-items:center;gap:11px;color:var(--muted);margin-bottom:18px}.theme-label>span{display:flex}.theme-label svg{width:17px;height:17px}.theme-label select{min-width:0;width:100%;border:0;background:transparent;font-size:14px;color:var(--muted);padding:5px 0}.account-row{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--border);padding-top:16px;gap:12px;font-size:14px;color:var(--muted)}.main-shell{margin-left:var(--side-width)}.topbar{display:flex;align-items:center;gap:12px;min-height:72px;padding:14px 36px;border-bottom:1px solid var(--border);background:var(--surface)}.topbar-title{font-size:14px;color:var(--muted)}.topbar>[data-workbench-toggle]{margin-left:auto}.content{max-width:1120px;padding:39px 36px 60px;margin:auto}.page-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:28px}.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:8px 15px;border:1px solid transparent;border-radius:9px;font-size:14px;font-weight:500;line-height:1.5;white-space:nowrap}.button svg{width:17px;height:17px}.primary{background:var(--accent);color:#fff}.primary:hover{filter:brightness(.96)}.secondary{background:var(--surface);border-color:var(--border);color:var(--text)}.secondary:hover{background:var(--bg)}.icon-button{width:34px;height:34px;display:inline-grid;place-items:center;border:0;border-radius:7px;padding:0;background:transparent;color:var(--muted);flex-shrink:0}.icon-button:hover{background:var(--border);color:var(--text)}.icon-button svg{width:18px;height:18px}.small{min-height:34px;padding:6px 11px;font-size:13px;border-radius:7px}.menu-button,.nav-scrim{display:none}.search-field{display:flex;align-items:center;gap:10px;background:var(--field);border:1px solid var(--border);border-radius:11px;padding:12px 15px;max-width:390px;margin-bottom:25px;color:var(--muted)}.search-field svg{width:18px;height:18px}.search-field input{padding:0;border:0;background:none;color:var(--text);outline:0;font-size:14px;width:100%;min-width:0}.search-field input::placeholder{color:var(--muted)}.material-list{display:flex;flex-direction:column;gap:11px}.material-card{display:flex;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:13px;box-shadow:var(--shadow);overflow:hidden}.material-card:hover{border-color:var(--muted)}.material-link{display:flex;align-items:center;gap:16px;min-height:82px;padding:18px 22px;flex:1;min-width:0}.material-icon{height:39px;width:39px;border-radius:11px;background:var(--bg);color:var(--accent);display:grid;place-items:center;flex-shrink:0}.material-link h2{font-size:16px;line-height:1.5;font-weight:550;letter-spacing:-.15px;margin:0}.material-type{font-size:13px;color:var(--muted);margin-left:auto;padding-left:15px;white-space:nowrap}.card-actions{display:flex;gap:3px;margin:0 15px 0 0;flex-shrink:0}.card-actions .icon-button{height:38px;width:34px}.empty-state{text-align:center;color:var(--muted);font-size:15px;padding:45px 10px}
.article-heading{align-items:flex-start}.article-heading h1{max-width:780px}.lesson-body{border:1px solid var(--border);border-radius:15px;padding:31px 36px;background:var(--surface);box-shadow:var(--shadow);line-height:1.85;font-size:16px}.lesson-body h2{font-size:22px;line-height:1.5;margin:32px 0 14px}.lesson-body h2:first-child{margin-top:0}.lesson-body h3{margin:27px 0 10px}.lesson-body p{margin:12px 0}.lesson-body li{margin:6px 0}.lesson-body code{font: .9em/1.6 "SFMono-Regular",Consolas,monospace;background:var(--code);color:var(--code-text);padding:3px 5px;border-radius:4px}.lesson-body pre,.activity-item pre{position:relative;background:var(--code);color:var(--code-text);border:1px solid var(--border);border-radius:10px;overflow:auto;padding:48px 19px 19px;font:14px/1.8 "SFMono-Regular",Consolas,monospace;margin:20px 0}.lesson-body pre code{padding:0;background:none;font:inherit;color:inherit}.code-actions{position:absolute;top:7px;right:9px;display:flex;gap:3px;align-items:center}.code-actions .icon-button{height:28px;width:28px}.snippet-run{display:flex;align-items:center;gap:5px;font:12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--muted);background:none;border:0;padding:5px}.snippet-run svg{width:13px;height:13px}.lesson-body blockquote,.callout{border-left:3px solid var(--accent);margin:22px 0;background:var(--bg);padding:12px 17px;border-radius:0 8px 8px 0;color:var(--muted);font-size:15px}.lesson-body table{width:100%;border-collapse:collapse;display:block;overflow:auto;font-size:15px;margin:20px 0}.lesson-body td,.lesson-body th{padding:11px 14px;text-align:left;border-bottom:1px solid var(--border)}.lesson-body th{background:var(--bg);font-weight:550}.lesson-body details{border:1px solid var(--border);border-radius:9px;padding:12px 16px;margin:20px 0;font-size:15px}.lesson-body summary{cursor:pointer;font-weight:500;color:var(--muted)}.lesson-body details[open] summary{margin-bottom:12px}
dialog{background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:18px;box-shadow:0 18px 60px #0000001c;padding:0;max-height:90dvh}dialog::backdrop{background:#00000044;backdrop-filter:blur(4px)}.editor-dialog{width:min(820px,calc(100% - 28px))}.dialog-header,.dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:20px 25px}.dialog-header{border-bottom:1px solid var(--border)}.dialog-header h2{font-size:20px;margin:0;font-weight:600;letter-spacing:-.5px}.dialog-footer{border-top:1px solid var(--border)}.editor-fields{padding:24px 25px}.segmented{display:flex;gap:3px;background:var(--bg);padding:4px;border-radius:9px;width:fit-content;margin-bottom:22px}.segmented button{border:0;background:none;border-radius:6px;padding:7px 16px;font-size:14px;color:var(--muted)}.segmented button.active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px #00000010}.form-row{display:flex;gap:16px;margin-bottom:20px}.editor-fields label,.login-card label{display:flex;flex-direction:column;gap:8px;font-size:14px;color:var(--muted);flex:1;min-width:0}.section-field{max-width:190px}.editor-fields input:not([type=checkbox]):not([type=radio]),.editor-fields select,.login-card input{height:43px;width:100%;padding:0 11px;background:var(--field);color:var(--text);border:1px solid var(--border);border-radius:8px;font-size:15px;min-width:0}.code-tabs{display:flex;gap:20px;margin-bottom:10px}.code-tab{background:none;border:0;border-bottom:2px solid transparent;color:var(--muted);padding:3px 0 7px;font-size:14px}.code-tab.active{border-color:var(--accent);color:var(--accent)}.code-input{width:100%;min-height:250px;resize:vertical;tab-size:4;padding:16px;border:1px solid var(--border);border-radius:9px;background:var(--code);color:var(--code-text);font:14px/1.8 "SFMono-Regular",Consolas,monospace}.form-error{font-size:14px;color:#d05046;margin:14px 0 0}.question-editor{padding:19px;border:1px solid var(--border);border-radius:12px;margin-bottom:18px;background:var(--bg)}.question-editor-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.question-editor-heading h3{margin:0;font-size:15px}.question-text{width:100%;min-height:70px;resize:vertical;border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--field);color:var(--text);font-size:15px;margin-bottom:12px}.question-editor select{margin-bottom:13px}.option-editor{display:flex;align-items:center;gap:9px;margin:8px 0}.option-editor input[type=radio],.option-editor input[type=checkbox]{width:17px;height:17px;accent-color:var(--accent);flex-shrink:0}.question-editor details{margin-top:13px}.question-editor summary{cursor:pointer;color:var(--muted);font-size:14px}.question-code{min-height:130px;margin:12px 0}.text-button{background:none;border:0;color:var(--accent);padding:4px 0;font-size:13px}
.quiz{display:flex;flex-direction:column;gap:28px}.quiz-question{border:0;padding:0;margin:0;min-width:0}.quiz-question legend{font-size:16px;font-weight:550;padding:0;margin-bottom:13px;white-space:pre-wrap}.quiz-option{display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:9px;background:var(--bg);padding:11px 13px;margin:8px 0;cursor:pointer;font-size:15px;white-space:pre-wrap}.quiz-option input{height:17px;width:17px;accent-color:var(--accent);flex-shrink:0}.quiz-option.correct{border-color:#5b9c76;background:#37905c10}.quiz-option.wrong{border-color:#c77a6f;background:#c8695510}.quiz-feedback,.task-answer{padding:10px 13px;border-radius:8px;background:var(--bg);color:var(--muted);font-size:14px;margin-top:12px}.question-hint{font-size:13px;color:var(--muted);margin:0 0 10px!important}.quiz-result{padding:14px;border:1px solid var(--border);border-radius:9px;font-size:16px;font-weight:550;background:var(--bg)}.quiz-actions{display:flex;gap:11px}.output-input{width:100%;padding:10px 12px;background:var(--field);color:var(--text);border:1px solid var(--border);border-radius:8px;font:15px "SFMono-Regular",Consolas,monospace}
.workbench{position:fixed;left:calc(var(--side-width) + 22px);right:22px;bottom:18px;height:390px;z-index:25;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 9px 35px #00000012;overflow:hidden}.has-workbench .content{padding-bottom:440px}.workbench-bar{display:flex;align-items:center;gap:12px;min-height:53px;padding:9px 13px;border-bottom:1px solid var(--border)}.workbench-title{font-size:14px;font-weight:600}.runtime-status{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workbench-actions{margin-left:auto;display:flex;align-items:center;gap:7px}.workbench-panes{display:grid;grid-template-columns:1fr 1fr;flex:1;min-height:0}.code-pane,.result-pane{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.code-pane{border-right:1px solid var(--border)}.pane-title{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted);padding:7px 13px;border-bottom:1px solid var(--border);height:34px;flex-shrink:0;background:var(--bg)}.pane-title .text-button{font-size:12px}.ace-host{flex:1;min-height:0}.plain-editor{flex:1;min-height:0;width:100%;border:0;resize:none;outline:0;background:var(--surface);color:var(--text);font:15px/1.7 "SFMono-Regular",Consolas,monospace;tab-size:4;padding:14px}.output-area{flex:1;overflow:auto;padding:12px 14px;min-height:0;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-overflow-scrolling:touch}.output-chunk{margin:0;display:inline;font:14px/1.7 "SFMono-Regular",Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.output-error{color:#dc6c62}.output-input{color:var(--accent)}.python-plot{display:block;max-width:100%;height:auto;border-radius:6px;margin:12px 0;background:white}.stdin-form{display:flex;gap:8px;align-items:center;padding:9px;border-top:1px solid var(--border);flex-shrink:0}.stdin-form input{width:100%;min-width:0;background:var(--field);border:1px solid var(--border);border-radius:7px;padding:7px 9px;font-size:14px;color:var(--text)}.stdin-preset{font-size:12px;color:var(--muted);border-top:1px solid var(--border);padding:8px 12px;flex-shrink:0;max-height:100px;overflow:auto}.stdin-preset summary{cursor:pointer}.stdin-preset textarea{width:100%;background:var(--field);border:1px solid var(--border);border-radius:5px;color:var(--text);padding:5px;font:13px Consolas,monospace;margin-top:5px;min-height:45px}
.activity-dialog{width:min(820px,calc(100% - 28px))}.activity-content{padding:20px 25px}.activity-item{border-bottom:1px solid var(--border);padding:16px 0}.activity-meta{color:var(--muted);font-size:12px;margin-bottom:7px}.activity-item h3{font-size:15px;line-height:1.5;margin-bottom:8px}.activity-item details{font-size:14px}.activity-item summary{cursor:pointer;color:var(--accent)}.activity-item pre{padding:14px;font-size:13px;white-space:pre-wrap}.attempt-question{font-size:14px;padding:10px 0;border-bottom:1px solid var(--border)}.attempt-question p{margin-bottom:7px}.answer-ok{color:#4d9c6d}.answer-wrong{color:#d47365}.toast{position:fixed;bottom:25px;left:calc(50% + var(--side-width)/2);transform:translateX(-50%);background:var(--text);color:var(--surface);padding:11px 18px;border-radius:10px;box-shadow:0 5px 20px #00000010;z-index:70;font-size:14px;max-width:min(500px,80vw)}.login-page{min-height:100dvh;display:grid;place-items:center;padding:25px}.login-card{width:100%;max-width:380px;padding:34px;background:var(--surface);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow)}.login-mark{display:grid;place-items:center;height:48px;width:48px;border-radius:14px;background:var(--accent);color:white;font:22px Consolas,monospace;margin-bottom:22px}.login-card h1{font-size:28px;margin-bottom:25px}.login-card label{margin-bottom:18px}.login-card .button{width:100%;margin-top:6px;min-height:44px}.login-card .form-error{margin:0 0 14px}
@media(max-width:1100px){:root{--side-width:204px}.sidebar{padding-left:12px;padding-right:12px}.content{padding:32px 27px 55px}.topbar{padding:13px 27px}.material-link{padding:17px 18px}.material-type{display:none}.workbench{left:calc(var(--side-width) + 16px);right:16px}.lesson-body{padding:27px}.brand{font-size:22px}.card-actions{margin-right:11px}}
@media(max-width:850px) and (min-width:701px){:root{--side-width:184px}.sidebar{padding-left:9px;padding-right:9px}.brand{padding-left:9px;font-size:21px;gap:8px}.nav-link{gap:9px;padding:10px;font-size:14px}.content{padding:28px 21px 50px}.topbar{padding:12px 21px}.article-heading{flex-direction:column}.article-heading h1{font-size:27px}.workbench{height:430px}.runtime-status{max-width:110px}.workbench-bar{gap:8px;padding:9px}.workbench-actions{gap:4px}.workbench .small{padding:6px 8px}}
@media(max-width:700px){:root{--side-width:0px}.sidebar{width:252px;transform:translateX(-100%);transition:transform .18s;padding:30px 16px calc(22px + env(safe-area-inset-bottom))}.sidebar.open{transform:translateX(0)}.nav-scrim:not([hidden]){display:block;position:fixed;inset:0;background:#00000044;z-index:29;border:0}.main-shell{margin-left:0}.menu-button{display:grid;margin-left:-6px}.topbar{min-height:62px;padding:10px 20px;padding-top:max(10px,env(safe-area-inset-top))}.topbar-title{font-size:14px}.topbar>.button{min-height:36px;font-size:13px;padding:7px 11px}.content{padding:27px 20px 45px}.page-header{margin-bottom:22px}.page-header h1{font-size:27px}.page-header .button{padding:8px 12px}.search-field{max-width:none;padding:11px 13px;margin-bottom:20px}.material-link{padding:15px 14px;gap:12px;min-height:78px}.material-link h2{font-size:15px}.material-icon{width:35px;height:35px;border-radius:10px}.material-icon svg{height:18px;width:18px}.card-actions{margin-right:7px;gap:0;flex-direction:column}.card-actions .icon-button{height:30px;width:29px}.article-heading{flex-direction:column;gap:15px}.article-heading h1{font-size:28px}.lesson-body{padding:24px 20px;font-size:16px;border-radius:13px}.lesson-body h2{font-size:21px}.lesson-body pre{font-size:13px;margin-left:-7px;margin-right:-7px;padding-left:13px;padding-right:13px}.lesson-body table{font-size:14px}.dialog-header,.dialog-footer{padding:17px 19px}.editor-fields{padding:19px}.form-row{flex-direction:column;gap:14px}.section-field{max-width:none}.code-input{font-size:13px;min-height:220px}.question-editor{padding:14px}.question-code{min-height:120px}.option-editor{gap:7px}.quiz-option{font-size:14px}.workbench{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));height:min(640px,calc(var(--visible-height,100dvh)*.74));border-radius:13px}.workbench-bar{padding:8px 9px;gap:7px;min-height:49px;flex-wrap:wrap}.workbench-title{font-size:13px}.runtime-status{max-width:100px;font-size:11px}.workbench-actions{gap:4px}.workbench .small{padding:6px 8px;font-size:12px}.workbench-actions .icon-button{height:30px;width:27px}.workbench-panes{grid-template-columns:1fr;grid-template-rows:minmax(0,1.15fr) minmax(0,1fr)}.code-pane{border-right:0;border-bottom:1px solid var(--border)}.plain-editor{font-size:14px}.output-chunk{font-size:13px}.has-workbench .content{padding-bottom:80dvh}.toast{left:50%;max-width:calc(100% - 30px);bottom:max(23px,env(safe-area-inset-bottom));font-size:13px}.login-card{padding:29px}.activity-content{padding:16px 19px}.activity-meta{font-size:12px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@media(max-width:700px){input,select,textarea,.editor-fields input:not([type=checkbox]):not([type=radio]),.editor-fields select,.login-card input,.question-text,.stdin-form input,.code-input{font-size:16px}.card-actions{flex-direction:row}.card-actions .icon-button{width:40px;height:44px}.button{min-height:44px}.theme-label select{min-height:44px}.account-row .icon-button{height:44px;width:44px}}
