:root{--bg:#ffffff;--bg-soft:#f5f5f7;--bg-sidebar:#fbfbfd;--text:#1d1d1f;--text-soft:#6e6e73;--border:#d2d2d7;--accent:#0071e3;--accent-soft:#eaf3fe;--link:#0066cc;--swift-a:#f88a36;--swift-b:#f05138;--code-bg:#f5f5f7;--codebar-bg:#ececf0;--note-bg:#fff8e6;--note-border:#e0c56e;--ok:#248a3d;--err:#d70015;--glass:rgba(251, 251, 253, .8);--shadow-card:0 4px 16px rgba(0, 0, 0, .06);--shadow-lift:0 8px 28px rgba(0, 0, 0, .12);--topbar-h:3.25rem;--sidebar-w:18rem;--radius-card:18px;--radius-block:12px}@media(prefers-color-scheme:dark){:root{--bg:#000000;--bg-soft:#1d1d1f;--bg-sidebar:#101012;--text:#f5f5f7;--text-soft:#86868b;--border:#3a3a3c;--accent:#0071e3;--accent-soft:#0c2b4d;--link:#2997ff;--code-bg:#1d1d1f;--codebar-bg:#2a2a2c;--note-bg:#2a2417;--note-border:#7a6a34;--ok:#32d74b;--err:#ff453a;--glass:rgba(22, 22, 23, .8);--shadow-card:0 4px 16px rgba(0, 0, 0, .5);--shadow-lift:0 8px 28px rgba(0, 0, 0, .6)}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--topbar-h) + 1rem)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,sf pro jp,sf pro text,hiragino sans,noto sans jp,segoe ui,sans-serif;font-size:1.0625rem;line-height:1.9;color:var(--text);background:var(--bg)}a{color:var(--link);text-decoration:none}a:hover{text-decoration:underline}::selection{background:rgba(0,113,227,.25)}.topbar{position:fixed;top:0;left:0;right:0;height:var(--topbar-h);display:flex;align-items:center;gap:.75rem;padding:0 1rem;background:var(--glass);-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);border-bottom:1px solid var(--border);z-index:20}.topbar-title{display:flex;align-items:center;gap:.5rem;font-weight:600;font-size:1.05rem;letter-spacing:-.01em;color:var(--text)}.topbar-title:hover{text-decoration:none;opacity:.8}.logo-mark{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:34%;background:linear-gradient(135deg,var(--swift-a),var(--swift-b));color:#fff;font-weight:800;font-size:.95rem;font-family:-apple-system,BlinkMacSystemFont,sf pro display,sans-serif}.topbar-sub{color:var(--text-soft);font-size:.875rem}.sidebar-toggle-input{display:none}.sidebar-toggle-btn{display:none;flex-direction:column;justify-content:center;gap:4px;width:2rem;height:2rem;cursor:pointer}.sidebar-toggle-btn span{display:block;height:2px;background:var(--text);border-radius:1px}.wrapper{display:flex;padding-top:var(--topbar-h);min-height:100vh}.sidebar{position:fixed;top:var(--topbar-h);bottom:0;left:0;width:var(--sidebar-w);overflow-y:auto;background:var(--bg-sidebar);border-right:1px solid var(--border);padding:1rem .75rem 3rem;font-size:.9375rem}.content{flex:1;margin-left:var(--sidebar-w);padding:2rem 1.5rem 5rem;min-width:0}.chapter,.part-index,.home{max-width:46rem;margin:0 auto}.sidebar a{color:var(--text);display:block;border-radius:8px;padding:.3rem .6rem}.sidebar a:hover{background:var(--bg-soft);text-decoration:none}.sidebar a.active{background:var(--accent-soft);color:var(--accent);font-weight:600}.sidebar-home{font-weight:600;margin-bottom:.5rem}.sidebar-part{margin-bottom:.35rem}.sidebar-part-title{font-weight:600;letter-spacing:-.01em}.sidebar-part ul{list-style:none;margin:0;padding-left:.9rem;display:none}.sidebar-part.open ul{display:block}.sidebar-part ul a{color:var(--text-soft);position:relative;padding-right:1.5rem}.sidebar-part ul a.active,.sidebar-part ul a:hover{color:var(--accent)}.sidebar a[data-done]::after,.chapter-list a[data-done]::after{content:"✓";position:absolute;right:.6rem;top:50%;transform:translateY(-50%);color:var(--ok);font-weight:700}.chapter-list a[data-done]::after{right:1rem}.part-label{display:inline-block;font-size:.8125rem;font-weight:700;background:linear-gradient(135deg,var(--swift-a),var(--swift-b));-webkit-background-clip:text;background-clip:text;color:transparent;letter-spacing:.04em;margin-right:.35rem}.chapter h1,.part-index h1{font-size:2.1rem;line-height:1.35;letter-spacing:-.02em;font-weight:700;margin:.5rem 0 1rem}.chapter h2{font-size:1.5rem;letter-spacing:-.015em;margin-top:2.75rem}.chapter h3{font-size:1.2rem;letter-spacing:-.01em;margin-top:2rem}.breadcrumb{font-size:.875rem;color:var(--text-soft)}.chapter-lead{color:var(--text-soft);font-size:1.125rem;margin:.5rem 0 2rem}.chapter img{max-width:100%;border-radius:var(--radius-block)}.chapter math[display=block]{display:block;margin:1.25rem 0;overflow-x:auto;max-width:100%;font-size:1.05em}.chapter table,.part-index table{border-collapse:collapse;width:100%;margin:1.25rem 0;font-size:.95rem;display:block;overflow-x:auto;border-radius:var(--radius-block)}.chapter th,.chapter td{border:1px solid var(--border);padding:.45rem .7rem;text-align:left;line-height:1.6}.chapter th{background:var(--bg-soft)}.chapter blockquote{margin:1.25rem 0;padding:.7rem 1rem;background:var(--note-bg);border-left:3px solid var(--note-border);border-radius:0 var(--radius-block)var(--radius-block)0}.chapter blockquote p{margin:.25rem 0}.chapter hr{border:none;border-top:1px solid var(--border);margin:2.5rem 0}code{font-family:ui-monospace,sf mono,SFMono-Regular,Menlo,Consolas,noto sans mono,monospace;font-size:.875em}:not(pre)>code{background:var(--bg-soft);border-radius:6px;padding:.1em .4em}.codeblock{margin:1.4rem 0;border-radius:var(--radius-block);overflow:hidden;background:var(--code-bg);box-shadow:inset 0 0 0 1px var(--border)}.codeblock-bar{display:flex;align-items:center;justify-content:space-between;padding:.3rem .75rem;background:var(--codebar-bg);font-size:.8125rem;color:var(--text-soft)}.codeblock-actions{display:flex;gap:.5rem}.codeblock-actions button{font:inherit;font-size:.8125rem;font-weight:500;color:var(--text-soft);background:0 0;border:1px solid var(--border);border-radius:980px;padding:.1rem .7rem;cursor:pointer}.codeblock-actions button:hover{color:var(--accent);border-color:var(--accent)}.codeblock-actions button:disabled{opacity:.6;cursor:default}.codeblock pre{margin:0;padding:.9rem 1rem;overflow-x:auto;line-height:1.6;font-size:.9375rem;background:0 0}.codeblock .highlight{margin:0}.editor-pane{display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:var(--code-bg);box-shadow:var(--shadow-card),inset 0 0 0 1px var(--border);margin-top:2.5rem;height:70vh}.editor-toolbar{flex:none;display:flex;align-items:center;justify-content:space-between;padding:.45rem .75rem;background:var(--codebar-bg);font-size:.875rem;color:var(--text-soft)}.editor-title{font-weight:600;letter-spacing:-.01em}.editor-actions{display:flex;gap:.5rem}.editor-actions button,.editor-output-bar button{font:inherit;font-size:.8125rem;font-weight:500;color:var(--text-soft);background:0 0;border:1px solid var(--border);border-radius:980px;padding:.15rem .75rem;cursor:pointer}.editor-actions button:hover,.editor-output-bar button:hover{color:var(--accent);border-color:var(--accent)}.editor-actions #ed-run{color:#fff;background:var(--accent);border-color:var(--accent);font-weight:600}.editor-actions #ed-run:hover{color:#fff;filter:brightness(1.08)}.editor-actions #ed-run:disabled{opacity:.6}.editor-actions #ed-judge{color:#fff;background:linear-gradient(135deg,var(--swift-a),var(--swift-b));border-color:transparent;font-weight:600}.editor-actions #ed-judge:hover{color:#fff;filter:brightness(1.08)}.editor-actions #ed-judge:disabled{opacity:.6}.editor-input{position:relative;flex:1 1 60%;min-height:8rem;overflow:hidden;background:var(--code-bg)}#ed-code,.editor-hl{position:absolute;inset:0;margin:0;border:0;padding:.9rem 1rem;box-sizing:border-box;font-family:ui-monospace,sf mono,SFMono-Regular,Menlo,Consolas,noto sans mono,monospace;font-size:.9375rem;line-height:1.6;tab-size:4;white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word}#ed-code{z-index:1;resize:none;outline:none;overflow:auto;background:0 0;color:transparent;caret-color:var(--text)}#ed-code::selection{background:rgba(41,151,255,.35)}.editor-hl{z-index:0;overflow:hidden;pointer-events:none;color:var(--text);background:0 0}.editor-hl code{font:inherit;background:0 0}#ed-hl{background:0 0}.editor-stdin{flex:none;border-top:1px solid var(--border);background:var(--code-bg)}.editor-stdin summary{cursor:pointer;padding:.3rem .75rem;font-size:.8125rem;color:var(--text-soft);user-select:none}.editor-stdin[open] summary{border-bottom:1px dashed var(--border)}#ed-stdin{display:block;width:100%;height:5.5rem;margin:0;border:0;padding:.6rem 1rem;resize:none;outline:none;background:0 0;color:var(--text);font-family:ui-monospace,sf mono,SFMono-Regular,Menlo,Consolas,noto sans mono,monospace;font-size:.9375rem;line-height:1.6}.editor-output-bar{flex:none;display:flex;align-items:center;justify-content:space-between;padding:.3rem .75rem;font-size:.8125rem;color:var(--text-soft);border-top:1px solid var(--border);background:var(--codebar-bg)}#ed-status.busy::before{content:"\23f3 "}#ed-status.ok{color:var(--ok)}#ed-status.err{color:var(--err)}#ed-output{flex:1 1 32%;min-height:4rem;margin:0;padding:.7rem 1rem;overflow:auto;font-family:ui-monospace,sf mono,SFMono-Regular,Menlo,Consolas,noto sans mono,monospace;font-size:.9375rem;line-height:1.6;white-space:pre-wrap;word-break:break-all;background:var(--bg-soft)}.judge-case{display:flex;gap:.6rem;align-items:baseline;padding:.15rem 0}.judge-case .jc-name{color:var(--text-soft)}.judge-case .jc-ac{color:var(--ok);font-weight:700}.judge-case .jc-wa{color:var(--err);font-weight:700}.judge-diff{margin:.2rem 0 .6rem;padding:.5rem .75rem;border-radius:8px;background:var(--code-bg);box-shadow:inset 0 0 0 1px var(--border);font-size:.875rem}.judge-diff b{font-weight:600;color:var(--text-soft)}.judge-all-ac{margin-top:.4rem;font-weight:700;color:var(--ok)}.codeblock-actions .cb-load{color:#fff;background:var(--accent);border-color:var(--accent)}.codeblock-actions .cb-load:hover{color:#fff;filter:brightness(1.08)}@media(min-width:1200px){.chapter-wrap.with-editor{display:grid;grid-template-columns:minmax(0,1fr)minmax(24rem,44%);gap:2rem;max-width:100rem;margin:0 auto}.chapter-wrap.with-editor .chapter{max-width:46rem;width:100%;margin:0 auto}.chapter-wrap.with-editor .editor-pane{margin-top:0;position:sticky;top:calc(var(--topbar-h) + 1.5rem);height:calc(100vh - var(--topbar-h) - 3rem)}}.toc{border-radius:var(--radius-block);padding:.5rem .9rem;margin:1.25rem 0;font-size:.9375rem;background:var(--bg-soft)}.toc summary{cursor:pointer;color:var(--text-soft)}.toc ul{margin:.4rem 0;padding-left:1.2rem}.answer{border-radius:var(--radius-block);padding:.6rem 1rem;margin:1.25rem 0;background:var(--bg-soft);box-shadow:inset 3px 0 0 var(--swift-b)}.answer>summary{cursor:pointer;color:var(--text-soft);font-size:.9375rem;list-style-position:outside}.answer[open]>summary{margin-bottom:.5rem}.answer>:last-child{margin-bottom:0}.prevnext{display:flex;justify-content:space-between;gap:1rem;margin-top:3.5rem;padding-top:1.25rem;border-top:1px solid var(--border)}.prevnext a{display:flex;flex-direction:column;max-width:48%;padding:.6rem 1rem;border-radius:var(--radius-block);background:var(--bg-soft)}.prevnext a:hover{text-decoration:none;box-shadow:var(--shadow-card)}.prevnext .next{margin-left:auto;text-align:right}.pn-label{font-size:.8125rem;color:var(--text-soft)}.pn-title{font-weight:600;letter-spacing:-.01em}.part-label-big{font-weight:700;letter-spacing:.05em;background:linear-gradient(135deg,var(--swift-a),var(--swift-b));-webkit-background-clip:text;background-clip:text;color:transparent;margin:0}.chapter-list{list-style:none;counter-reset:chapter;padding:0}.chapter-list li{counter-increment:chapter}.chapter-list a{display:flex;flex-direction:column;padding:.8rem 2.6rem .8rem 3.2rem;margin:.5rem 0;border-radius:var(--radius-block);background:var(--bg-soft);position:relative;color:var(--text)}.chapter-list a::before{content:counter(chapter);position:absolute;left:1rem;top:50%;transform:translateY(-50%);width:1.7rem;height:1.7rem;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--bg);color:var(--text);font-weight:700;font-size:.85rem;box-shadow:var(--shadow-card)}.chapter-list a:hover{text-decoration:none;box-shadow:var(--shadow-card)}.chapter-list-title{font-weight:600;letter-spacing:-.01em}.chapter-list-desc{font-size:.9375rem;color:var(--text-soft)}.hero{text-align:center;padding:3.5rem 0 2rem}.hero-eyebrow{font-size:1rem;font-weight:600;letter-spacing:.02em;background:linear-gradient(135deg,var(--swift-a),var(--swift-b));-webkit-background-clip:text;background-clip:text;color:transparent;margin:0 0 .25rem}.hero h1{font-size:clamp(2.4rem,6vw,3.4rem);line-height:1.15;letter-spacing:-.03em;font-weight:700;margin:.25rem 0 1rem}.hero-gradient{color:var(--text)}.hero-lead{font-size:1.25rem;line-height:1.8;color:var(--text-soft)}.hero-actions{display:flex;gap:.75rem;justify-content:center;margin-top:1.75rem}.btn-primary,.btn-secondary{display:inline-block;padding:.6rem 1.5rem;border-radius:980px;font-weight:500;font-size:1.0625rem}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{filter:brightness(1.08);text-decoration:none}.btn-secondary{color:var(--accent);background:var(--bg-soft)}.btn-secondary:hover{text-decoration:none;filter:brightness(.97)}.curriculum-map h2{font-size:1.8rem;letter-spacing:-.02em;text-align:center;margin:2.5rem 0 1.25rem}.part-cards{list-style:none;padding:0}.part-cards a{display:flex;flex-direction:column;padding:1.1rem 1.4rem;margin:.7rem 0;border-radius:var(--radius-card);background:var(--bg-soft);color:var(--text);transition:transform .18s ease,box-shadow .18s ease}.part-cards a:hover{text-decoration:none;transform:translateY(-2px);box-shadow:var(--shadow-lift)}.part-card-title{font-size:1.2rem;font-weight:700;letter-spacing:-.015em}.part-card-desc{color:var(--text-soft);font-size:.95rem}.part-card-count{color:var(--text-soft);font-size:.8125rem;margin-top:.3rem}@media(max-width:860px){.sidebar-toggle-btn{display:flex}.topbar-sub{display:none}.sidebar{transform:translateX(-100%);transition:transform .2s ease;z-index:15;width:min(20rem,85vw)}.sidebar-toggle-input:checked~.wrapper .sidebar{transform:translateX(0)}.content{margin-left:0;padding:1.25rem 1rem 4rem}.prevnext{flex-direction:column}.prevnext a{max-width:none}.prevnext .next{margin-left:0}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}.reading-time{color:var(--text-soft);font-size:.875rem;margin:-.5rem 0 0}.chapter p{margin:1.1rem 0}