:root {
  color-scheme: light;
  --paper: #fcf9f4;
  --rail: #f6f0e7;
  --ink: #2b2722;
  --muted: #665e55;
  --line: #e3dace;
  --focus: #795b42;
  --accent: #a57d5b;
  --code: #f1ede6;
  --heading: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --body: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
[data-theme="leaf"] { --paper: #fbfcf8; --rail: #f5f7f1; --ink: #252821; --muted: #556051; --line: #dfe5d8; --focus: #4d692c; --accent: #a8c872; --code: #f0f2eb; }
[data-theme="blue"] { --paper: #fafbfc; --rail: #f2f5f8; --ink: #222831; --muted: #4f5d6b; --line: #d8e0e8; --focus: #42657d; --accent: #7096ad; --code: #edf1f5; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.65; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .24em; }
a:hover { color: var(--focus); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
button { cursor: pointer; padding: .42rem .7rem; }
button:disabled { cursor: default; opacity: .6; }
input, select, textarea { width: 100%; min-width: 0; padding: .55rem .7rem; }
textarea { resize: vertical; }
h1, h2, h3, .wordmark { font-family: var(--heading); line-height: 1.23; }
h1 { font-size: clamp(2rem, 4vw, 3.16rem); letter-spacing: -.025em; margin: 0 0 1rem; overflow-wrap: anywhere; }
h2 { margin: 0 0 .8rem; font-size: 1.5rem; }
h3 { margin: 0 0 .7rem; }
.masthead { max-width: 1580px; margin: 0 auto; border-bottom: 1px solid var(--line); padding: 1.1rem clamp(1rem, 2.5vw, 2.5rem); display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.wordmark { font-weight: 700; font-size: clamp(1.25rem, 3vw, 1.85rem); text-decoration: none; white-space: nowrap; }
.masthead nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .88rem; }
.masthead nav a, .plain { text-decoration: none; }
.plain { background: none; border: 0; padding: 0; }
.columns { display: grid; max-width: 1580px; min-height: calc(100vh - 75px); margin: auto; grid-template-columns: minmax(12rem, 19%) minmax(0, 1fr) minmax(13rem, 22%); }
.rail { background: var(--rail); padding: clamp(1rem, 2.2vw, 2rem); min-width: 0; overflow-wrap: anywhere; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.rail-details > summary { display: none; }
.rail-section + .rail-section, .all-articles + .rail-section { margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.rail-section h2 { font-size: 1.25rem; }
.all-articles { display: block; font-weight: 620; text-decoration: none; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.left .plain-list a { text-decoration: none; }
[aria-current="page"], [aria-current="location"] { font-weight: 650; }
[aria-current="page"]::after, [aria-current="location"]::after { content: ""; width: .42em; height: .42em; margin-left: .42em; vertical-align: .12em; border-radius: 50%; background: var(--accent); display: inline-block; }
.outline li[data-level="3"] { padding-left: .8rem; }
.outline li[data-level="4"], .outline li[data-level="5"], .outline li[data-level="6"] { padding-left: 1.3rem; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .55rem; margin: .8rem 0 0; }
.tags > * { border: 1px solid var(--line); border-radius: 5px; max-width: 100%; overflow-wrap: anywhere; text-decoration: none; padding: .15rem .53rem; font-size: .86rem; }
.tags > a:hover, .tags > [aria-current="page"] { border-color: var(--accent); }
.center { padding: clamp(1.3rem, 3vw, 3rem); min-width: 0; }
.center > article, .article-end { max-width: 51rem; margin-inline: auto; }
.muted, time { color: var(--muted); font-size: .9rem; }
.article-list { margin-top: 1.75rem; }
.article-row { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.article-row:first-child { padding-top: .25rem; }
.article-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; align-items: baseline; }
.article-heading h2 { margin: 0; overflow-wrap: anywhere; }
.article-heading a { text-decoration: none; }
.article-row > p { margin: .55rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.article-header { margin-bottom: 1.6rem; }
.prose { font-size: clamp(1.02rem, 1.25vw, 1.12rem); line-height: 1.8; overflow-wrap: anywhere; }
.prose :is(h2, h3, h4, h5, h6) { margin-top: 1.75em; scroll-margin-top: 1rem; }
.prose img { max-width: 100%; height: auto; }
.prose pre { background: var(--code); padding: .9rem 1rem; border-radius: 5px; overflow: auto; }
.prose code { font-family: ui-monospace, monospace; font-size: .88em; background: var(--code); }
.code-wrap { position: relative; }
.code-wrap button { position: absolute; top: .42rem; right: .5rem; font-size: .78rem; }
.code-wrap pre { padding-right: 4rem; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .65rem; }
blockquote { margin: 1rem 0; border-left: 2px solid var(--line); padding-left: .9rem; }
.search-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.search-field input, .search-field button { border: 0; }
.search-field button { display: grid; place-items: center; }
.sort-form { display: flex; align-items: center; gap: .4rem; }
.sort-form button { flex: none; }
.quiet-link { display: inline-block; margin-top: .7rem; color: var(--muted); }
.simple-page { width: min(calc(100% - 2rem), 42rem); margin: 3rem auto; }
.stack { display: grid; gap: .8rem; justify-items: start; margin: 1rem 0; }
.stack label { display: grid; gap: .25rem; width: 100%; }
.primary { background: var(--ink); color: var(--paper); }
.article-end { border-top: 1px solid var(--line); margin-block: 2.3rem; padding-top: 1.2rem; }
.comment { border-bottom: 1px solid var(--line); padding-block: .7rem; }
.emoji { display: flex; flex-wrap: wrap; gap: .35rem; }
.emoji button { padding: .16rem .45rem; }
.pagination { display: flex; justify-content: center; gap: 1rem; margin: 1.8rem 0; }
.export-list { display: grid; gap: .45rem; }
.export-list label { display: block; }
.export-list input { width: auto; }
.empty { margin-top: 2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 940px) {
  .columns { grid-template-columns: minmax(10rem, 22%) minmax(0, 1fr); }
  .right { border-top: 1px solid var(--line); grid-column: 2; }
  .left { grid-row: span 2; }
}
@media (max-width: 640px) {
  .columns { display: flex; flex-direction: column; }
  .rail { padding-block: .65rem; border-left: 0; border-right: 0; }
  .left { border-bottom: 1px solid var(--line); }
  .rail-details > summary { display: list-item; cursor: pointer; }
  .rail-details[open] > summary { margin-bottom: .85rem; }
  .masthead { padding-block: .65rem; }
  .masthead nav { gap: .25rem .65rem; }
}
