:root {
 color-scheme: light;
 --desktop: #f7f5ef;
 --face: #eeece4;
 --paper: #fffef9;
 --ink: #252c27;
 --teal: #315644;
 --edge: #d7d8ce;
 --muted: #686e64;
 --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
 --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
 font-family: var(--font);
 color: var(--ink);
 background: var(--desktop);
 font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; font: 15px/1.65 var(--font); color: var(--ink); background: var(--desktop); }
a { color: var(--teal); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, a, input, summary { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, img:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
img { max-width: 100%; }
svg.pixel-icon { width: 24px; height: 24px; flex-shrink: 0; shape-rendering: crispEdges; vertical-align: middle; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 30; background: var(--paper); padding: 10px 16px; }
.skip:focus { top: 10px; }

/* The shared masthead is a navigation strip, not a window title bar. */
.desktop-bar { max-width: 1256px; margin: 0 auto; display: flex; align-items: center; gap: 48px; min-height: 86px; border-bottom: 1px solid var(--edge); }
.desktop-brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 23px; font-weight: 700; white-space: nowrap; }
.desktop-brand:hover { text-decoration: none; }
.desktop-brand img { width: 30px; height: 30px; }
.desktop-menu { display: flex; align-items: stretch; gap: 30px; align-self: stretch; }
.desktop-menu a { display: flex; align-items: center; padding: 3px 1px 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.desktop-menu a:hover, .desktop-menu a[aria-current=page] { color: var(--teal); text-decoration: none; border-bottom-color: var(--teal); }
.site-id { margin-left: auto; color: var(--muted); font: 12px var(--mono); }
.desktop { max-width: 1256px; margin: 0 auto; padding: 28px 0 56px; min-height: calc(100vh - 174px); }
.pathbar { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-size: 12px; color: var(--muted); }
.pathbar a { color: var(--muted); }
.pathbar span:not(:last-child) { color: #b6baaf; }
.site-footer { max-width: 1256px; margin: 0 auto; padding: 24px 0; border-top: 1px solid var(--edge); display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; }
.site-footer > :last-child { margin-left: auto; }
.footer-mark { font-size: 16px; color: var(--ink); font-weight: 700; }

/* Keep the existing columns and rows; let rules and spacing group the content. */
.window, .inset { min-width: 0; }
.window { background: transparent; }
.window-title { display: flex; align-items: center; gap: 10px; padding: 0 0 16px; border-bottom: 1px solid var(--edge); color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.5; }
.window-title > span:has(svg) { display: none; }
.window-title h1, .window-title h2 { margin: 0; font: inherit; }
.window-caption { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.window-body { padding: 22px 0 0; }
.desktop-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,1fr); gap: 42px 56px; }
.desktop-grid .wide { grid-column: 1/-1; }
.home-intro .window-body { padding-top: 0; }
.welcome-line { display: flex; align-items: flex-start; gap: 18px; padding: 0 0 28px; }
.welcome-line > .pixel-icon { width: 34px; height: 34px; margin-top: 5px; }
.welcome-line h1 { margin: 0 0 12px; font-size: 30px; line-height: 1.3; font-weight: 650; letter-spacing: -.5px; }
.welcome-line p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.manual-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--edge); }
.manual-list li { border-bottom: 1px solid var(--edge); }
.manual-list a { display: flex; align-items: center; gap: 14px; padding: 16px 2px; color: var(--ink); }
.manual-list a:hover { background: var(--face); text-decoration: none; }
.manual-list svg { width: 21px; height: 21px; }
.manual-list strong { font-size: 15px; font-weight: 600; }
.manual-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.manual-list .arrow { margin-left: auto; padding-right: 12px; color: #748373; }
.statusbar { display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; color: var(--muted); font-size: 11px; }
.statusbar span:first-child { font-family: var(--mono); }
.journal-row { padding: 0 0 24px; }
.journal-row + .journal-row { border-top: 1px solid var(--edge); padding-top: 24px; }
.journal-row h3 { margin: 10px 0; font-size: 19px; line-height: 1.65; font-weight: 600; }
.journal-row h3 a { color: var(--ink); }
.journal-row p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.meta time { font-family: var(--mono); font-size: 11px; }
.meta .badge { border-left: 1px solid var(--edge); padding-left: 12px; color: var(--teal); }
.journal-bottom { padding-top: 4px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(6,1fr); border: 1px solid var(--edge); }
.shortcut { padding: 23px 8px; text-align: center; color: var(--ink); background: #f1f0e8; }
.shortcut + .shortcut { border-left: 1px solid var(--edge); }
.shortcut:hover { background: var(--paper); text-decoration: none; }
.shortcut svg { display: block; margin: 0 auto 13px; width: 29px; height: 29px; }
.shortcut span { display: block; font-size: 13px; }
.section-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

.retro-button, .el-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; min-height: 38px; border: 1px solid #bfc6b9; border-radius: 3px; background: transparent; color: var(--teal); line-height: 1.4; font-weight: 500; cursor: pointer; text-decoration: none !important; box-shadow: none; }
.retro-button:hover, .el-button:hover { background: #e9ede4; color: #233e30; border-color: #8c9f89; }
.retro-button:active, .el-button:active { background: #dfe6d9; }
.retro-button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.retro-button:disabled { opacity: .55; cursor: default; }
.window-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.search-field { height: 40px; width: 100%; min-width: 0; padding: 7px 11px; background: var(--paper); border: 1px solid #c2c8bb; border-radius: 3px; color: var(--ink); }

.blog-layout { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 60px; align-items: start; }
.page-heading { margin-bottom: 28px; }
.page-heading h1, .page-heading h2 { font-size: 27px; line-height: 1.5; font-weight: 600; margin: 0 0 10px; }
.page-heading p { font-size: 14px; margin: 0; color: var(--muted); }
.blog-filter { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.blog-filter label { white-space: nowrap; font-size: 13px; }
.blog-filter .search-field { max-width: 360px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-row .retro-button { font-size: 12px; padding: 4px 12px; min-height: 32px; border-color: var(--edge); }
.filter-row .selected { background: var(--teal); color: #fff; border-color: var(--teal); }
.blog-list-item { padding: 26px 0; border-top: 1px solid var(--edge); }
.blog-list-item h2 { font-size: 24px; line-height: 1.6; margin: 12px 0; font-weight: 600; }
.blog-list-item h2 a { color: var(--ink); }
.blog-list-item p { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.sidebar-links { list-style: none; margin: 0; padding: 0; }
.sidebar-links a { display: block; border-bottom: 1px solid var(--edge); padding: 13px 0; font-size: 13px; }
.sidebar-copy { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 22px 0; }
.empty-result { padding: 40px 0; color: var(--muted); }

/* Long-form pages stay quiet, with one sticky table of contents. */
.reading-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 44px; align-items: start; }
.reading-layout .toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding: 0 18px 0 0; border-right: 1px solid var(--edge); scrollbar-width: thin; }
.toc details > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); padding: 8px 0 16px; }
.toc nav { padding: 0 0 12px; }
.toc a { display: block; padding: 7px 7px 7px 0; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.toc a:hover { color: var(--teal); background: var(--face); text-decoration: none; }
.toc .toc-l3 { padding-left: 14px; font-size: 11px; }
.reading-window .window-body { padding: 0; }
.article-paper { background: var(--paper); padding: 36px 42px; border: 1px solid #e2e2d7; }
.article-head { padding-bottom: 25px; margin-bottom: 30px; border-bottom: 1px solid var(--edge); }
.article-head h1, .doc h1 { display: block; margin: 0 0 20px; font-size: 30px; font-weight: 650; line-height: 1.5; letter-spacing: -.4px; overflow-wrap: anywhere; }
.article-nav { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-top: 22px; margin-top: 36px; border-top: 1px solid var(--edge); font-size: 13px; }
.article-content, .doc { font-size: 16px; line-height: 1.95; min-width: 0; overflow-wrap: anywhere; }
.article-content h2, .doc h2 { font-size: 22px; line-height: 1.6; font-weight: 650; margin: 42px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--edge); }
.article-content h3, .doc h3 { font-size: 19px; line-height: 1.6; font-weight: 600; margin: 32px 0 14px; }
.article-content h4, .doc h4 { font-size: 16px; font-weight: 600; margin: 26px 0 12px; }
.article-content h5 { font-size: 16px; margin: 24px 0 12px; }
.article-content p, .doc p { margin: 16px 0; }
.article-content ul, .article-content ol, .doc ul, .doc ol { padding-left: 24px; }
.article-content li + li, .doc li + li { margin-top: 5px; }
.article-content pre, .doc pre { font: 13px/1.75 var(--mono); white-space: pre; overflow: auto; max-width: 100%; padding: 20px; background: #eef0e9; color: #293b2e; border: 1px solid #d9dfd2; border-radius: 2px; tab-size: 4; overflow-wrap: normal; margin: 20px 0; }
.article-content code, .doc code { font-family: var(--mono); font-size: .88em; background: #eef0e9; padding: 2px 4px; color: #2c4c39; border-radius: 2px; }
.article-content pre code, .doc pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.article-content blockquote, .doc blockquote, .doc .note { margin: 22px 0; padding: 9px 18px; background: #f0f2e9; border-left: 2px solid #819276; }
.article-content img, .doc img { display: block; max-width: 100%; height: auto; margin: 24px auto; border: 1px solid var(--edge); cursor: zoom-in; }
.doc figure { margin: 26px 0; }
.doc figcaption { text-align: center; color: var(--muted); font-size: 12px; }
.doc table, .article-content table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.doc th, .doc td, .article-content th, .article-content td { border: 1px solid #d8ddd0; padding: 11px 14px; text-align: left; min-width: 100px; }
.doc th, .article-content th { background: #edf0e6; font-weight: 600; }
.doc th { white-space: nowrap; }
.doc .backtop { display: inline-block; margin-top: 22px; }
.doc-nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; padding-bottom: 14px; border-bottom: 1px solid var(--edge); }
.doc-nav a { border: 0; padding: 5px 0; min-height: 30px; background: none; font-size: 13px; color: var(--muted); border-radius: 0; }
.doc-nav a:hover, .doc-nav a.active { background: none; color: var(--teal); text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 9px; }
.article-content [id], .doc [id] { scroll-margin-top: 24px; }
.doc .muted { color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--edge); margin: 28px 0; }
.doc .notice { border-left: 2px solid #a09057; background: #f7f2df; padding: 12px 18px; }
.doc details { margin: 22px 0; padding: 14px 16px; border: 1px solid var(--edge); background: #f7f8f2; }
.doc details > summary { color: var(--teal); font-size: 14px; font-weight: 500; cursor: pointer; }
.doc details p { font-size: 14px; }
.tag-example { margin: 24px 0; padding: 4px 18px 12px; border-left: 2px solid #bbc8ae; background: #f5f6ef; }
.tag-example h4 { font-size: 13px; color: var(--teal); margin: 14px 0 7px; }
.tag-example pre { margin: 8px 0 15px; }
.tag-example .example-note { font-size: 13px; margin: 8px 0; color: var(--muted); }
.code-window { margin: 22px 0; min-width: 0; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border: 1px solid #d9dfd2; border-bottom: 0; border-radius: 2px 2px 0 0; background: #e8ece2; color: #65725e; font: 10px var(--mono); }
.code-bar .retro-button { min-height: 27px; padding: 4px 8px; border-color: transparent; font-size: 11px; }
.code-window pre { margin: 0; max-height: 620px; border-radius: 0 0 2px 2px; }
.article-content h3:has(>img) { border: 0; }
.lightbox { position: fixed; inset: 0; background: #17231eed; display: none; z-index: 100; padding: 60px 24px 24px; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; right: 24px; top: 14px; color: white; border-color: #7b8b7d; }
.lightbox button:hover { background: #3f5344; }
.lightbox-note { position: absolute; left: 24px; top: 21px; color: #e8eee6; font-size: 12px; }
.error-window { max-width: 600px; margin: 65px auto; }
.error-window h1 { font-size: 56px; font-weight: 500; margin: 0 0 12px; color: var(--teal); }
.error-window p { margin: 0 0 28px; }

@media (max-width: 1340px) {
 .desktop, .desktop-bar, .site-footer { margin-left: 32px; margin-right: 32px; }
}
@media (max-width: 980px) {
 .desktop-grid { grid-template-columns: minmax(0,1.2fr) minmax(260px,1fr); gap: 36px; }
 .welcome-line > .pixel-icon { display: none; }
 .reading-layout { grid-template-columns: 180px minmax(0,1fr); gap: 24px; }
 .article-paper { padding: 28px; }
 .blog-layout { grid-template-columns: minmax(0,1fr) 190px; gap: 36px; }
}
@media (max-width: 760px) {
 .desktop-grid { grid-template-columns: 1fr; gap: 36px; }
 .desktop-grid .wide { grid-column: auto; }
 .desktop-bar { gap: 28px; }
 .desktop-menu { gap: 20px; }
 .reading-layout { display: block; }
 .reading-layout .toc { position: static; max-height: none; margin-bottom: 24px; padding: 0; border: 0; border-bottom: 1px solid var(--edge); }
 .toc nav { max-height: 250px; overflow: auto; }
 .toc details > summary { padding: 10px 0; }
 .blog-layout { grid-template-columns: 1fr; }
 .blog-sidebar { display: none; }
}
@media (max-width: 540px) {
 .desktop, .desktop-bar, .site-footer { margin-left: 20px; margin-right: 20px; }
 .desktop { padding-top: 20px; padding-bottom: 36px; }
 .desktop-bar { flex-wrap: wrap; gap: 0 22px; padding-top: 20px; min-height: 109px; }
 .desktop-brand { font-size: 21px; }
 .desktop-brand img { width: 27px; height: 27px; }
 .desktop-menu { order: 3; flex-basis: 100%; align-self: auto; height: 49px; gap: 28px; }
 .desktop-menu a { font-size: 13px; }
 .site-id { font-size: 11px; }
 .pathbar { font-size: 11px; margin-bottom: 27px; flex-wrap: wrap; gap: 8px; }
 .welcome-line h1 { font-size: 27px; }
 .welcome-line p { font-size: 13px; }
 .manual-list a { padding: 15px 0; gap: 12px; }
 .manual-list small { font-size: 11px; }
 .journal-row h3 { font-size: 19px; }
 .shortcut-grid { grid-template-columns: repeat(3,1fr); }
 .shortcut { padding: 19px 5px; }
 .shortcut:nth-child(4) { border-left: 0; }
 .shortcut:nth-child(n+4) { border-top: 1px solid var(--edge); }
 .shortcut span { font-size: 12px; }
 .site-footer { gap: 12px; font-size: 10px; padding: 21px 0; flex-wrap: wrap; }
 .site-footer > :last-child { margin-left: auto; }
 .doc-nav { gap: 10px 18px; margin-bottom: 18px; padding-bottom: 12px; }
 .doc-nav a { font-size: 12px; }
 .article-paper { padding: 24px 17px; }
 .article-head h1, .doc h1 { font-size: 25px; }
 .article-content, .doc { font-size: 15px; line-height: 1.9; }
 .article-content h2, .doc h2 { font-size: 20px; margin-top: 34px; }
 .article-content h3, .doc h3 { font-size: 18px; }
 .article-content pre, .doc pre { font-size: 12px; padding: 14px; }
 .tag-example { padding: 3px 10px 10px; }
 .doc details { padding: 12px; }
 .blog-list-item h2 { font-size: 21px; }
 .page-heading h2 { font-size: 24px; }
 .lightbox { padding: 60px 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 *, *::before, *::after { animation: none !important; transition: none !important; }
}
