:root{color-scheme:light;--bg:#fafbf9;--surface:#f0f3ef;--text:#202c28;--muted:#596960;--line:#dbe2da;--accent:#176648;--accent-soft:#e3efe7;--code:#edf1ed;--shadow:0 6px 24px #142b1610;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;font-size:16px}

:root[data-theme=dark]{color-scheme:dark;--bg:#111816;--surface:#1a2420;--text:#e1e9e3;--muted:#a3b5a9;--line:#33423a;--accent:#8cd7b2;--accent-soft:#213e30;--code:#19251f;--shadow:0 6px 24px #0003}

@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#111816;--surface:#1a2420;--text:#e1e9e3;--muted:#a3b5a9;--line:#33423a;--accent:#8cd7b2;--accent-soft:#213e30;--code:#19251f;--shadow:0 6px 24px #0003}
}

*{box-sizing:border-box}
html{scroll-padding-top:6rem}
body{margin:0;background:var(--bg);color:var(--text);line-height:1.7;-webkit-font-smoothing:antialiased}
a{color:var(--accent);text-decoration-thickness:1px;text-underline-offset:4px}
a:hover{text-decoration:underline}
button,input{font:inherit}
button,.button{cursor:pointer}
button{color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:.45rem .8rem}
a,button,input,summary{-webkit-tap-highlight-color:transparent}
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible,pre:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
[hidden]{display:none!important}
h1,h2,h3,h4{line-height:1.4;letter-spacing:-.025em}
h1{font-size:clamp(2rem,4vw,3rem)}
h2{font-size:1.45rem}
h3{font-size:1.1rem}
p{margin:0 0 1.2rem}
img{max-width:100%;height:auto}
small{font-size:.8rem}
.shell{width:min(1120px,calc(100% - 64px));margin-inline:auto}
.muted,.meta{color:var(--muted)}
.meta{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;font-size:.82rem}
.eyebrow{font:600 .68rem/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.13em;color:var(--muted);margin-bottom:1.4rem}
.skip-link{position:fixed;z-index:20;top:-100px;left:1rem;background:var(--bg);padding:.6rem 1rem;border:2px solid var(--accent)}
.skip-link:focus{top:1rem}
.site-header{border-bottom:1px solid var(--line);background:var(--bg)}
.header-inner{display:flex;align-items:center;min-height:82px;gap:3rem}
.brand{display:flex;align-items:center;gap:.7rem;color:var(--text);font-weight:750;font-size:1.15rem;letter-spacing:-.04em;text-decoration:none;white-space:nowrap}
.brand-mark{background:var(--text);color:var(--bg);height:30px;width:30px;border-radius:5px;font:700 26px/30px monospace;text-align:center}
.brand-mark span{color:#6ca887}
.brand-cn{font-size:.88em;margin-left:.2rem}
.header-inner nav{display:flex;gap:1.6rem}
.header-inner nav a,.header-tools a{font-size:.87rem;text-decoration:none;color:var(--muted);padding:.5rem 0}
.header-inner nav a[aria-current],.header-inner nav a:hover{color:var(--accent)}
.header-tools{margin-left:auto;display:flex;gap:1rem;align-items:center}
#theme-toggle{min-width:42px;min-height:42px;background:transparent;font-size:1.1rem}
.search-link span{margin-left:.7rem}
.hero{display:grid;grid-template-columns:1fr 245px;gap:4rem;padding:5rem 0 4.4rem;border-bottom:1px solid var(--line)}
.hero h1{font-size:clamp(2.6rem,5vw,4.5rem);letter-spacing:-.065em;margin:0 0 1.35rem;line-height:1.15}
.hero h1 span{font-weight:650;letter-spacing:-.07em;margin-left:.1em}
.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-right:.5rem}
.hero-subtitle{font-size:.85rem;font-weight:550;color:var(--accent);margin-bottom:1.2rem}
.hero-description{font-size:1rem;color:var(--muted);max-width:35rem;line-height:1.9}
.hero-actions{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:1.8rem}
.button{display:inline-flex;align-items:center;justify-content:center;gap:1rem;padding:.65rem 1rem;border:1px solid var(--line);border-radius:5px;text-decoration:none;font-size:.85rem;font-weight:550;color:var(--text)}
.button.primary{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.button:hover{filter:brightness(.96);text-decoration:none}
.hero-note{border-left:1px solid var(--line);padding-left:1.75rem;align-self:center}
.hero-note ol{list-style:none;padding:0;margin:0}
.hero-note li{display:flex;align-items:center;gap:.65rem;padding:.68rem 0;border-bottom:1px solid var(--line);font-size:.85rem}
.hero-note li span{font:.7rem monospace;color:var(--muted)}
.hero-note li small{margin-left:auto;color:var(--muted);font-size:.68rem}
.hero-note p{font-size:.73rem;color:var(--muted);margin:1.1rem 0 0}
.home-section{padding:2.5rem 0}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.4rem}
.section-heading h2{font-size:1.1rem;margin:0;letter-spacing:0}
.section-heading h2 span{font:400 .7rem monospace;color:var(--muted);margin-right:.8rem}
.section-heading>a{font-size:.75rem;text-decoration:none}
.topics-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-top:1px solid var(--line);border-left:1px solid var(--line)}
.topic-entry{position:relative;display:block;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:1.35rem 1.3rem;text-decoration:none;color:var(--text)}
.topic-entry:hover{background:var(--surface);text-decoration:none}
.topic-number{font:.65rem monospace;color:var(--muted)}
.topic-entry h3{font-size:1rem;margin:.45rem 0}
.topic-entry h3 span{float:right;color:var(--muted);font-weight:400}
.topic-entry p{font-size:.78rem;color:var(--muted);margin:0}
.series-feature{display:flex;justify-content:space-between;align-items:center;gap:2rem;background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:1.8rem 2rem}
.series-feature .eyebrow{margin:0 0 .7rem;color:var(--accent)}
.series-feature h3{font-size:1.3rem;margin:0 0 .6rem}
.series-feature h3 a{color:var(--text);text-decoration:none}
.series-feature p:not(.eyebrow):not(.meta){max-width:680px;font-size:.85rem;color:var(--muted);margin-bottom:.8rem}
.series-feature .meta{margin:0}
.text-link{font-size:.82rem;text-decoration:none;white-space:nowrap}
.post-row{display:grid;grid-template-columns:110px 1fr 20px;gap:1.6rem;padding:1.6rem 0;border-top:1px solid var(--line)}
.post-date{padding-top:.15rem;display:flex;flex-direction:column;gap:.35rem;font:400 .73rem/1.6 ui-monospace,monospace;color:var(--muted)}
.post-date span{font-family:inherit;font-size:.68rem}
.post-row h3{margin:0 0 .65rem;font-size:1.1rem;line-height:1.65}
.post-row h3 a{color:var(--text);text-decoration:none}
.post-row h3 a:hover{color:var(--accent)}
.post-row p{font-size:.85rem;color:var(--muted);margin-bottom:.9rem;line-height:1.8}
.row-arrow{color:var(--muted);padding-top:.2rem}
.tags{display:flex;gap:.4rem;flex-wrap:wrap}
.tag{display:inline-flex;border:1px solid var(--line);background:var(--surface);color:var(--muted);font-size:.66rem;border-radius:4px;padding:.12rem .45rem;text-decoration:none;line-height:1.7}
.tag:hover{color:var(--accent);border-color:var(--accent);text-decoration:none}
.projects-grid{display:grid;grid-template-columns:1fr 1fr;gap:2.5rem;border-top:1px solid var(--line);padding-top:1.25rem}
.projects-grid article+article{border-left:1px solid var(--line);padding-left:2.5rem}
.projects-grid h3{margin:0 0 .65rem}
.projects-grid h3 a{color:var(--text);text-decoration:none}
.projects-grid h3 span{color:var(--muted);font-size:.8rem;margin-left:.4rem}
.projects-grid p{color:var(--muted);font-size:.85rem}
.site-footer{border-top:1px solid var(--line);margin-top:3rem;padding:2rem 0 2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:1.25rem}
.footer-name{font-size:.9rem;font-weight:700;color:var(--text);text-decoration:none}
.site-footer p{font-size:.75rem;color:var(--muted);margin:.5rem 0 0}
.footer-links{display:flex;gap:1.4rem}
.footer-links a{font-size:.75rem;color:var(--muted);text-decoration:none}
.site-footer>small{flex-basis:100%;color:var(--muted);font:400 .63rem/1.7 monospace}
.page-header{padding:3.5rem 0 2rem;border-bottom:1px solid var(--line);margin-bottom:2.5rem;max-width:850px}
.page-header h1{margin:0 0 1rem}
.page-header>p:last-child{max-width:720px;color:var(--muted);margin:0}
.page-content{max-width:850px;min-height:35vh}
.prose{font-size:1rem;line-height:1.95;overflow-wrap:anywhere}
.prose>h2{font-size:1.5rem;margin:2.5rem 0 1rem}
.prose>h3{font-size:1.16rem;margin:1.8rem 0 .9rem}
.prose ul,.prose ol{padding-left:1.5rem;margin-bottom:1.5rem}
.prose li+li{margin-top:.4rem}
.prose strong{font-weight:650}
.prose blockquote{border-left:3px solid var(--accent);margin:1.6rem 0;padding:.8rem 1.25rem;background:var(--surface);color:var(--muted)}
.prose blockquote p:last-child{margin-bottom:0}
.prose hr{border:0;border-top:1px solid var(--line);margin:2.4rem 0}
.prose table{border-collapse:collapse;display:block;max-width:100%;overflow-x:auto;font-size:.85rem;margin:1.5rem 0}
.prose td,.prose th{border:1px solid var(--line);padding:.65rem .8rem;text-align:left}
.prose th{background:var(--surface)}
code{font: .86em/1.7 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;background:var(--code);padding:.15em .35em;border-radius:3px}
pre{max-width:100%;overflow-x:auto;background:var(--code);padding:1.25rem;border:1px solid var(--line);border-radius:5px;line-height:1.7;tab-size:4}
pre code{font-size:.8rem;padding:0;border:0;background:none;white-space:pre;overflow-wrap:normal}
.highlight{position:relative}
.highlight pre{margin:1.4rem 0}
.highlight .highlight{margin:0}
.code-toolbar{display:flex;justify-content:space-between;align-items:center;background:var(--surface);border:1px solid var(--line);border-bottom:0;padding:.35rem .75rem;border-radius:5px 5px 0 0;margin-top:1.4rem;font:.65rem monospace;color:var(--muted)}
.code-toolbar+pre{margin-top:0;border-radius:0 0 5px 5px}
.copy-code{font-size:.7rem;padding:.22rem .6rem;background:var(--bg)}
.highlight .c,.highlight .c1,.highlight .cm{color:var(--muted);font-style:italic}
.highlight .k,.highlight .kn,.highlight .kd,.highlight .ow{color:var(--accent);font-weight:bold}
.highlight .s,.highlight .s1,.highlight .s2,.highlight .nb{color:var(--accent)}
.highlight .nf,.highlight .nc{font-weight:bold}
.post-header{max-width:850px;padding:2.5rem 0 2.25rem;border-bottom:1px solid var(--line);margin-bottom:2.5rem}
.breadcrumbs{display:flex;gap:.75rem;color:var(--muted);font-size:.75rem;margin-bottom:2rem}
.breadcrumbs a{color:var(--muted);text-decoration:none}
.post-header h1{font-size:clamp(1.8rem,3.5vw,2.7rem);margin:1rem 0;line-height:1.5;letter-spacing:-.04em}
.post-description{color:var(--muted);line-height:1.9;font-size:.95rem}
.article-grid{display:grid;grid-template-columns:minmax(0,760px) minmax(0,240px);gap:3.5rem;align-items:start}
.article-main{grid-column:1;grid-row:1;min-width:0}
.toc{grid-column:2;grid-row:1;position:sticky;top:2rem;border-left:1px solid var(--line);padding-left:1.1rem;max-height:calc(100vh - 4rem);overflow:auto;font-size:.74rem}
.toc summary{font-weight:650;cursor:pointer;padding:.4rem 0;color:var(--text)}
.toc nav a{display:block;color:var(--muted);text-decoration:none;line-height:1.65;padding:.35rem 0}
.toc nav a.toc-sub{padding-left:.7rem;font-size:.7rem}
.toc nav a[aria-current]{color:var(--accent);font-weight:650}
.article-section{border-top:1px solid var(--line);margin-top:2.5rem;padding-top:1.3rem}
.article-section h2{font-size:1.15rem;margin-top:0}
.article-section p,.article-section li{font-size:.88rem}
.series-context{background:var(--surface);padding:1.5rem;border:1px solid var(--line);border-radius:5px}
.series-context ol{padding-left:1.2rem}
.series-context li{margin-top:.7rem;color:var(--muted)}
.related-list{list-style:none;padding:0}
.related-list li{padding:.6rem 0}
.related-list p{color:var(--muted);font-size:.8rem;margin:.5rem 0}
.post-navigation{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;border-block:1px solid var(--line);padding:1.4rem 0;margin-top:2rem}
.post-navigation span{display:block;color:var(--muted);font-size:.72rem;margin-bottom:.5rem}
.post-navigation a{font-size:.85rem;text-decoration:none}
.post-navigation>div:last-child{text-align:right}
.article-actions{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:1.5rem 0;font-size:.8rem}
.article-actions button{font-size:.75rem}
.reading-progress{height:3px;position:fixed;top:0;left:0;right:0;z-index:10;pointer-events:none}
.reading-progress span{display:block;height:100%;width:100%;transform:scaleX(0);transform-origin:left;background:var(--accent)}
.back-to-top{position:fixed;right:1.2rem;bottom:1.2rem;background:var(--surface);color:var(--accent);border:1px solid var(--line);border-radius:5px;width:42px;height:42px;text-align:center;line-height:40px;box-shadow:var(--shadow);text-decoration:none}
.topic-path{display:flex;flex-wrap:wrap;gap:.75rem;margin:1.5rem 0}
.topic-path a{padding:.5rem .8rem;border:1px solid var(--line);border-radius:4px;font-size:.8rem;text-decoration:none}
.topic-path a[aria-current]{background:var(--accent-soft)}
.tag-group{border-top:1px solid var(--line);padding:1rem 0}
.tag-group h2{font-size:1.2rem}
.tag-group small{color:var(--muted);font-size:.75rem;font-weight:400}
.empty-state{padding:2rem;background:var(--surface);border:1px solid var(--line)}
#search-form label{display:block;font-weight:600;margin-bottom:.5rem}
.search-field{display:flex;gap:.6rem}
.search-field input{min-width:0;width:100%;background:var(--bg);border:1px solid var(--line);border-radius:5px;padding:.7rem;color:var(--text)}
.search-field button{white-space:nowrap;padding-inline:1.2rem}
#search-status{margin:1rem 0;color:var(--muted);font-size:.8rem}
.search-result{padding:1.2rem 0;border-top:1px solid var(--line)}
.search-result h2{font-size:1.15rem;margin:0 0 .6rem}
.search-result p{font-size:.85rem;color:var(--muted);margin:0}
.search-result small{color:var(--muted)}

@media(min-width:1600px){.shell{width:min(1160px,calc(100% - 80px))}
}

@media(max-width:960px){.header-inner{gap:1.5rem}
.hero{grid-template-columns:1fr;gap:2rem}
.hero-note{display:none}
.article-grid{display:flex;flex-direction:column;gap:1.5rem}
.toc{position:static;order:0;width:100%;border:1px solid var(--line);border-radius:5px;padding:.7rem 1rem;max-height:22rem}
.article-main{order:1;width:100%;max-width:760px}
.post-header{margin-bottom:1.5rem}
.topics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:600px){.shell{width:calc(100% - 36px)}
.header-inner{min-height:104px;flex-wrap:wrap;gap:0;padding-block:12px}
.brand{font-size:1.05rem}
.header-tools{gap:.8rem}
.header-inner nav{order:3;width:100%;justify-content:flex-start;gap:1.7rem;margin-top:.35rem}
.header-inner nav a{font-size:.8rem}
.hero{padding:3rem 0 2.8rem}
.hero .eyebrow{font-size:.6rem;letter-spacing:.07em}
.hero h1{font-size:2.8rem}
.hero-subtitle{font-size:.77rem;line-height:1.9;max-width:300px}
.hero-description{font-size:.9rem}
.hero-actions{gap:.6rem}
.button{font-size:.77rem;padding:.6rem .8rem;gap:.6rem}
.home-section{padding:1.8rem 0}
.section-heading{gap:.6rem}
.section-heading h2{font-size:1rem}
.section-heading h2 span{margin-right:.45rem}
.section-heading>a{font-size:.68rem}
.topic-entry{padding:1rem .8rem}
.topic-entry h3{font-size:.88rem}
.topic-entry h3 span{display:none}
.topic-entry p{font-size:.7rem;line-height:1.7}
.series-feature{padding:1.25rem;display:block}
.series-feature h3{font-size:1.15rem}
.series-feature .text-link{display:inline-block;margin-top:1rem}
.post-row{grid-template-columns:1fr;gap:.5rem;padding:1.3rem 0}
.post-date{flex-direction:row;gap:1rem;font-size:.7rem}
.post-row h3{font-size:1.03rem}
.post-row p{font-size:.8rem}
.row-arrow{display:none}
.tag{font-size:.63rem}
.projects-grid{grid-template-columns:1fr;gap:1.25rem}
.projects-grid article+article{border-left:0;border-top:1px solid var(--line);padding:1.25rem 0 0}
.site-footer{margin-top:2rem}
.footer-links{gap:1.25rem}
.page-header{padding:2.5rem 0 1.5rem;margin-bottom:1.5rem}
.page-header h1{font-size:1.85rem}
.page-header>p:last-child{font-size:.9rem}
.post-header{padding-top:1.5rem}
.post-header h1{font-size:1.85rem}
.post-description{font-size:.88rem}
.meta{font-size:.7rem;gap:.4rem}
.prose{font-size:.95rem;line-height:1.95}
.prose>h2{font-size:1.3rem}
.prose>h3{font-size:1.08rem}
.prose blockquote{padding:.8rem 1rem}
.post-navigation{gap:1rem}
.back-to-top{bottom:1rem;right:.6rem}
.search-field input{font-size:16px}
pre{padding:1rem}
.topic-path{gap:.5rem}
}

@media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}
}

@media print{.site-header,.site-footer,.toc,.reading-progress,.back-to-top,.article-actions,.copy-code{display:none!important}
.shell{width:100%}
.article-grid{display:block}
:root{--bg:#fff;--text:#000;--muted:#333;--line:#aaa}
.prose pre{white-space:pre-wrap}
.prose pre code{white-space:pre-wrap}
}

.prose div.highlighter-rouge{margin:1.5rem 0}
.prose div.highlighter-rouge .code-toolbar{margin-top:0}
