@charset "UTF-8";
/* 楷体随站点提供，代码与日期保留等宽字体。 */
@font-face {
  font-family: "Lucas WenKai";
  src: url("/fonts/lucas-wenkai-screen.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #eeeee6;
  --text: #282e2a;
  --muted: #646b64;
  --accent: #45695d;
  --line: #dbdcd2;
  --reading: "Lucas WenKai", "LXGW WenKai", "Kaiti SC", "KaiTi", "STKaiti", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.7 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: #dce6dc; color: #25392e; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.small { font-size: 12px; }
.shell, .header-inner { width: min(100% - 80px, 1240px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; background: var(--accent); color: white; padding: 10px; }
.skip-link:focus { top: 12px; }
/* 页头与首页引言。 */
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand { font: 600 38px/1 Georgia, "Times New Roman", serif; letter-spacing: -2px; }
.brand-note { padding-left: 24px; border-left: 1px solid #aaaFA5; color: var(--muted); font: 18px/1 var(--reading); }
.header-inner nav { display: flex; align-items: center; gap: 35px; margin-left: auto; font-size: 14px; }
.header-inner nav a { position: relative; padding-block: 11px; }
.header-inner nav a[aria-current] { color: var(--accent); }
.header-inner nav a[aria-current]::after { content: ""; position: absolute; height: 2px; background: var(--accent); bottom: 0; left: 0; right: 0; }
.nav-search { display: flex; align-items: center; margin-left: 12px; }
.intro { display: grid; grid-template-columns: 1.45fr 1fr; align-items: center; gap: 20px; min-height: 280px; padding-block: 32px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 2.7px; margin: 0 0 18px; }
.intro h1 { font: 400 clamp(32px, 3.7vw, 49px)/1.5 var(--reading); margin: 0 0 13px; letter-spacing: -.03em; }
.intro-description { color: var(--muted); font: 18px/1.85 var(--reading); margin: 0; max-width: 620px; }
.intro-art { display: block; width: 100%; height: 230px; object-fit: contain; mix-blend-mode: darken; }
/* 文章列表采用留白与细线分隔。 */
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 32px; padding: 34px 0 64px; }
.article-section { min-width: 0; }
.section-heading, .section-title { display: flex; align-items: center; gap: 18px; }
.section-heading { justify-content: space-between; margin-bottom: 17px; }
.section-title h2 { font: 400 30px/1.5 var(--reading); margin: 0; white-space: nowrap; }
.section-title .small { white-space: nowrap; }
.search-box { display: flex; align-items: center; width: 218px; gap: 10px; border: 1px solid #cfd2c7; border-radius: 5px; padding: 7px 11px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-box svg { flex-shrink: 0; }
.search-box input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); outline: none; font-size: 12px; line-height: 24px; }
.search-box input::placeholder { color: var(--muted); }
kbd { font: 11px var(--mono); color: #747b72; }
.filters { display: flex; gap: 8px 22px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.filter { position: relative; border: 0; padding: 10px 1px; background: none; font-size: 12px; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.filter:hover, .filter.active { color: var(--accent); }
.filter.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }
.list-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; padding-top: 13px; }
.post-row { position: relative; padding: 24px 32px 23px 0; border-bottom: 1px solid var(--line); }
.post-row-copy { min-width: 0; }
.post-category { color: var(--accent); font-size: 12px; display: flex; align-items: center; gap: 13px; }
.featured-label { background: #e1e9df; border-radius: 2px; padding: 0 7px; font-size: 11px; }
.post-row h3 { font: 400 28px/1.45 var(--reading); margin: 8px 0 5px; overflow-wrap: anywhere; }
.post-arrow { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 24px/1 var(--reading); transition: transform .15s ease; }
.post-row:hover .post-arrow { color: var(--accent); transform: translate(3px,-50%); }
.post-summary { color: var(--muted); font: 17px/1.8 var(--reading); margin: 5px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta, .post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 11px; color: var(--muted); }
.post-tags { gap: 12px; }
.post-tags::before { content: "·"; }
.has-cover { display: grid; grid-template-columns: minmax(0,1fr) 180px; align-items: center; gap: 26px; padding-right: 40px; }
.post-thumbnail { display: block; }
.post-thumbnail img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 5px; }
.post-cover { max-width: 760px; margin: 28px 0 0; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 6px; }
.load-more { display: block; width: 100%; border: 1px solid var(--line); background: transparent; border-radius: 3px; color: var(--muted); padding: 13px; margin-top: 25px; font-size: 12px; }
.load-more:hover { background: var(--surface); color: var(--accent); border-color: #a7b6a8; }
.empty-state { text-align: center; color: var(--muted); padding: 45px 0; font-family: var(--reading); }
/* 知识书架。 */
.sidebar { border-left: 1px solid var(--line); padding-left: 30px; }
.aside-heading { font: 400 25px/1.5 var(--reading); margin: 0 0 17px; }
.folder-list { list-style: none; padding: 10px 0 0; margin: 0; border-top: 1px solid var(--line); }
.folder-list a { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: #4c574f; font-size: 13px; }
.folder-list a:hover { color: var(--accent); }
.folder-list svg { flex-shrink: 0; }
.folder-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.readme { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.readme p { font: 16px/1.9 var(--reading); color: var(--muted); margin: 8px 0; }
.readme>a { display: inline-block; font-size: 12px; border-bottom: 1px solid var(--accent); padding-bottom: 3px; margin-top: 12px; }
.site-stats { display: flex; gap: 30px; margin-top: 32px; }
.site-stats div { display: flex; flex-direction: column; }
.site-stats div+div { border-left: 1px solid var(--line); padding-left: 30px; }
.site-stats strong { font: 400 32px/1.3 Georgia, serif; }
.site-stats span { font: 14px/2 var(--reading); color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; padding-block: 24px; color: var(--muted); font-size: 11px; }
/* 独立页面与文章阅读区。 */
.page-heading { padding: 54px 0 35px; }
.page-heading h1 { font: 400 40px/1.5 var(--reading); margin: 12px 0; overflow-wrap: anywhere; }
.page-heading>p:last-child, .page-heading>a { font-size: 13px; }
.archive-year { color: var(--accent); font-size: 23px; font-weight: 400; margin: 34px 0 13px; }
.archive-row { display: grid; grid-template-columns: 70px minmax(0,1fr) 24px; align-items: baseline; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); font: 19px/1.6 var(--reading); overflow-wrap: anywhere; }
.archive-row time { font-size: 12px; }
.archive-row:last-child { margin-bottom: 70px; }
.taxonomy-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 40px; margin-bottom: 70px; }
.taxonomy-list>a { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); font: 21px/1.5 var(--reading); overflow-wrap: anywhere; }
.taxonomy-list .muted { font-size: 11px; flex-shrink: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 30px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.post-header { padding: 36px 0 32px; border-bottom: 1px solid var(--line); }
.post-header h1 { font: 400 42px/1.5 var(--reading); margin: 12px 0 20px; overflow-wrap: anywhere; }
.post-header .eyebrow { letter-spacing: 1px; color: var(--accent); }
.reading-layout { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 60px; padding: 36px 0 55px; }
.prose { min-width: 0; font: 18px/1.95 var(--reading); letter-spacing: .015em; overflow-wrap: anywhere; }
.prose>*:first-child { margin-top: 0; }
.prose p { margin: 1.2em 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-weight: 400; line-height: 1.5; margin: 1.8em 0 .8em; scroll-margin-top: 30px; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 27px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.prose h3 { font-size: 23px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.prose img, .prose video { max-width: 100%; height: auto; border-radius: 3px; }
.prose img { display: block; margin: 22px auto; }
.prose iframe { max-width: 100%; }
.prose blockquote { margin: 24px 0; border-left: 2px solid #859c89; padding: 2px 24px; color: #536452; background: var(--surface); }
.prose code { font: 13px/1.8 var(--mono); background: #e8ede3; color: #365a45; padding: 3px 5px; border-radius: 3px; }
.prose pre { overflow: auto; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; line-height: 1.8; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose figure.highlight { margin: 25px 0; background: #eeefe8; border: 1px solid var(--line); border-radius: 4px; overflow: auto; font: 12px/1.8 var(--mono); }
.prose figure.highlight table { margin: 0; border: 0; display: table; width: 100%; border-collapse: collapse; }
.prose figure.highlight td { border: 0; padding: 0; }
.prose figure.highlight pre { margin: 0; border: 0; background: transparent; border-radius: 0; padding: 16px 18px; }
.prose figure.highlight .gutter { width: 35px; color: #6d786b; border-right: 1px solid var(--line); user-select: none; }
.prose figure.highlight .gutter pre { padding-inline: 12px; }
.highlight .keyword, .highlight .selector-tag, .highlight .literal { color: #775477; }
.highlight .string, .highlight .attribute { color: #406647; }
.highlight .number, .highlight .built_in { color: #80572e; }
.highlight .comment { color: #6b7768; }
.highlight .title, .highlight .function { color: #35617a; }
.prose>table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 14px; text-align: left; }
.prose th { background: var(--surface); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 35px 0; }
.prose .exercise-answer { margin: 24px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.prose .exercise-answer summary { cursor: pointer; color: var(--accent); }
.prose .exercise-answer summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.prose .exercise-answer[open] summary { margin-bottom: 18px; }
.toc-inner { position: sticky; top: 30px; border-left: 1px solid var(--line); padding-left: 25px; max-height: calc(100vh - 65px); overflow: auto; }
.toc-inner .aside-heading { font-size: 22px; }
.toc-panel ol { list-style: none; padding-left: 12px; }
.toc-panel>.toc-inner>ol { padding: 0; }
.toc-panel li { margin: 9px 0; font-size: 12px; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.back-top { display: block; margin-top: 25px; color: var(--accent); font-size: 11px; }
.post-neighbors { border-top: 1px solid var(--line); padding: 25px 0 45px; display: flex; justify-content: space-between; gap: 30px; }
.post-neighbors a { display: flex; flex-direction: column; gap: 8px; max-width: 48%; font-family: var(--reading); overflow-wrap: anywhere; }
.about-content { max-width: 800px; min-height: 40vh; padding-bottom: 70px; }
/* 窄屏优先保留文章，分类仍可通过筛选和独立页面访问。 */
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) 230px; gap: 25px; }
  .sidebar { padding-left: 24px; }
  .has-cover { grid-template-columns: minmax(0,1fr) 130px; gap: 16px; }
  .section-title { gap: 10px; }
  .section-title h2 { font-size: 27px; }
  .search-box { width: 170px; }
  .reading-layout { grid-template-columns: minmax(0,1fr) 200px; gap: 35px; }
}
@media (max-width: 800px) {
  .shell, .header-inner { width: calc(100% - 48px); }
  .workspace, .reading-layout { grid-template-columns: minmax(0,1fr); gap: 25px; }
  .sidebar { display: none; }
  .intro { grid-template-columns: 1.4fr 1fr; gap: 10px; min-height: 245px; }
  .intro h1 { font-size: 32px; }
  .intro-description { font-size: 16px; }
  .intro-art { height: 185px; }
  .eyebrow { letter-spacing: 1.8px; font-size: 9px; }
  .toc-panel { grid-row: 1; }
  .toc-inner { position: static; max-height: 180px; }
  .header-inner nav { gap: 23px; }
  .brand-note { display: none; }
  .has-cover { grid-template-columns: minmax(0,1fr) 150px; }
}
@media (max-width: 560px) {
  .shell, .header-inner { width: calc(100% - 40px); }
  .header-inner { min-height: 74px; gap: 16px; }
  .brand { font-size: 29px; letter-spacing: -1.6px; }
  .header-inner nav { gap: 18px; font-size: 12px; }
  .nav-search { display: none; }
  .intro { position: relative; display: block; padding: 35px 0 26px; }
  .intro h1 { font-size: clamp(27px, 7.7vw, 39px); margin-bottom: 11px; }
  .intro-description { font-size: 16px; max-width: 360px; }
  .intro-art { height: 150px; width: 260px; max-width: 85%; margin: 13px auto -3px; }
  .eyebrow { margin-bottom: 15px; }
  .workspace { padding-top: 24px; padding-bottom: 40px; }
  .section-heading { flex-wrap: wrap; gap: 15px; margin-bottom: 10px; }
  .section-title { gap: 13px; }
  .section-title h2 { font-size: 27px; }
  .search-box { width: 100%; }
  .filters { gap: 2px 18px; }
  .filter { font-size: 11px; padding-block: 9px; }
  .list-meta { font-size: 9px; }
  .post-row { padding: 21px 22px 21px 0; }
  .post-row h3 { font-size: 24px; }
  .post-summary { font-size: 16px; }
  .post-meta { font-size: 10px; gap: 8px 12px; }
  .post-tags { font-size: 10px; }
  .has-cover { grid-template-columns: minmax(0,1fr) 96px; gap: 12px; }
  .post-arrow { font-size: 20px; }
  .post-category { font-size: 11px; }
  .site-footer { flex-direction: column; gap: 6px; font-size: 10px; }
  .page-heading { padding: 35px 0 24px; }
  .page-heading h1, .post-header h1 { font-size: 31px; }
  .post-header { padding-block: 28px; }
  .breadcrumb { font-size: 10px; padding-top: 24px; }
  .prose { font-size: 17px; }
  .prose h1 { font-size: 27px; }
  .prose h2 { font-size: 24px; }
  .prose h3 { font-size: 21px; }
  .prose ul, .prose ol { padding-left: 1.4em; }
  .reading-layout { padding-top: 26px; }
  .taxonomy-list { grid-template-columns: 1fr; }
  .archive-row { grid-template-columns: 44px minmax(0,1fr) 18px; gap: 12px; font-size: 17px; }
  .archive-row time { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
/* 文章中的实验入口与同源代码展示页。 */
.experiment-card { margin: 28px 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 5px; background: #f0f1e9; font-family: var(--sans); }
.prose .experiment-card h3 { margin: 0 0 14px; font: 400 22px/1.5 var(--reading); }
.experiment-source { min-width: 0; margin: 14px 0; }
.experiment-source summary { cursor: pointer; color: var(--accent); font: 13px/1.8 var(--sans); overflow-wrap: anywhere; }
.experiment-source summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.prose .experiment-source pre { max-width: 100%; margin: 12px 0; }
.experiment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font: 13px/1.8 var(--sans); }
.experiment-actions a, .experiment-actions button { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.experiment-actions button { border: 0; padding: 0; background: none; font: inherit; }
.experiment-actions .copy-status { color: var(--muted); font-size: 11px; }
.experiment-hint, .prose .experiment-hint { font: 12px/1.8 var(--sans); color: var(--muted); margin: 12px 0; }
.experiment-hint code { font: 12px var(--mono); overflow-wrap: anywhere; }
.experiment-command, .prose .experiment-command { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 var(--mono); }
.experiment-command code { padding: 0; background: none; color: var(--text); font: inherit; }
.code-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 35px; padding-bottom: 60px; }
.code-files nav { display: flex; flex-direction: column; gap: 9px; font: 12px/1.8 var(--mono); overflow-wrap: anywhere; }
.code-files a[aria-current] { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.code-download { display: inline-block; margin-top: 24px; color: var(--accent); font-size: 13px; }
.code-heading h1 { font-family: var(--mono); font-size: 29px; }
.code-content { min-width: 0; }
.source-code { margin-top: 20px; border: 1px solid var(--line); background: #eeefe8; border-radius: 4px; }
.source-code pre { margin: 0; padding: 22px; overflow: auto; tab-size: 4; font: 13px/1.9 var(--mono); }
.source-code code { font: inherit; }
@media (max-width: 800px) {
  .code-layout { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .code-files nav { flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }
  .code-heading h1 { font-size: 23px; }
  .experiment-card { padding: 17px; }
}
/* 合集书架与文章内的阅读顺序。 */
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; padding-bottom: 60px; }
.collection-card { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.collection-card:hover { border-color: var(--accent); }
.collection-card img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-bottom: 1px solid var(--line); }
.collection-card > div { padding: 22px; }
.collection-card h3 { font: 400 27px/1.5 var(--reading); margin: 10px 0; }
.collection-card p { color: var(--muted); font: 18px/1.8 var(--reading); margin: 0 0 18px; }
.collection-action, .series-badge { color: var(--accent); font-size: 12px; }
.series-badge { display: inline-block; margin: 4px 0; padding: 2px 9px; background: var(--surface); border-radius: 3px; }
.collection-reading { max-width: 900px; padding-bottom: 55px; }
.collection-chapters { padding-left: 30px; }
.collection-chapters li { padding: 22px 0 22px 10px; border-bottom: 1px solid var(--line); }
.collection-chapters li::marker { color: var(--muted); font-family: var(--mono); }
.collection-chapters a { display: block; }
.collection-chapters h2 { font: 400 26px/1.6 var(--reading); margin: 0 0 8px; }
.collection-chapters p { color: var(--muted); font: 18px/1.8 var(--reading); margin: 0 0 12px; }
.series-panel { padding: 22px 26px; margin-top: 26px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.series-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.series-panel-heading > a { font: 400 23px/1.6 var(--reading); color: var(--accent); }
.series-panel details { margin-top: 14px; }
.series-panel summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.series-panel ol { padding-left: 24px; font: 18px/1.9 var(--reading); }
.series-panel li { padding: 4px 0; }
.series-panel a[aria-current] { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.series-neighbors { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 26px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; font: 16px/1.8 var(--reading); }
.series-neighbors a { flex: 1 1 250px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .collection-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .header-inner { flex-wrap: wrap; gap: 10px; padding-block: 16px 8px; }
  .header-inner nav { width: 100%; justify-content: space-between; gap: 12px; }
  .header-inner .nav-search { margin-left: 0; }
  .series-panel { padding: 18px; }
  .collection-chapters h2 { font-size: 23px; }
}

/* 合集沿用文章分类，窄屏下入口可换行。 */
.collection-group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px; font: 400 28px/1.6 var(--reading); margin: 0 0 20px; }
.collection-group-title .small { font-family: var(--sans); }
.category-collections { margin-bottom: 28px; }
.collection-category-links, .collection-categories { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.breadcrumb { flex-wrap: wrap; overflow-wrap: anywhere; }
.series-panel + .post-cover { margin-top: 26px; }
