:root {
  --sidebar-width: 230px;
  --sidebar: #f6f8fa;
  --sidebar-text: #5c5c63;
  --sidebar-title: #4b4b50;
  --sidebar-muted: #6f6f75;
  --sidebar-hover: #edf0f5;
  --sidebar-active: #e8edf7;
  --sidebar-border: #e7e8ea;
  --background: #fff;
  --surface: #fff;
  --text: #505057;
  --heading: #2e2e33;
  --muted: #77777d;
  --border: #e7e7e9;
  --accent: #2a7ae2;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft Yahei", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --sidebar: #1e1e21;
  --sidebar-text: #aaaab0;
  --sidebar-title: #dedee2;
  --sidebar-muted: #929299;
  --sidebar-hover: #28282c;
  --sidebar-active: #2c3038;
  --sidebar-border: #303035;
  --background: #1b1b1e;
  --surface: #202024;
  --text: #bdbdc3;
  --heading: #e4e4e7;
  --muted: #96969e;
  --border: #34343a;
  --accent: #57a3ff;
  --card-shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
[data-font-size="small"] { font-size: 15px; }
[data-font-size="medium"] { font-size: 16px; }
[data-font-size="large"] { font-size: 17.5px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-system);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
button, input { font: inherit; }
.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; z-index: 100; top: .75rem; left: .75rem; padding: .5rem .8rem; background: var(--accent); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
}
.profile { padding: 3.1rem 1.5rem 2.45rem; text-align: center; }
.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 1.05rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--sidebar-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--sidebar-title);
  font-size: 1.55rem;
  font-weight: 600;
}
.avatar:hover { border-color: var(--muted); }
.site-title { display: block; color: var(--sidebar-title); font-size: 1.8rem; font-weight: 700; letter-spacing: -.025em; }
.profile p { margin: .45rem 0 0; color: var(--sidebar-muted); font-size: .88rem; font-style: italic; font-weight: 300; line-height: 1.45; }

.nav-list { display: grid; gap: .1rem; padding: 0 1.5rem; }
.nav-list a {
  min-height: 43px;
  padding: .65rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .8rem;
  border-radius: .55rem;
  color: var(--sidebar-text);
  font-size: .79rem;
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.nav-list a:hover { background: var(--sidebar-hover); color: var(--sidebar-title); }
.nav-list a.active { background: var(--sidebar-active); color: var(--sidebar-title); }
.nav-list a > svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-list a > span { line-height: 1; }

.sidebar-footer { margin-top: auto; padding: 1.45rem 1.5rem; display: flex; align-items: center; gap: .35rem; }
.icon-button { position: relative; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--sidebar-border); border-radius: 50%; background: var(--surface); color: var(--sidebar-muted); cursor: pointer; }
.icon-button:hover { color: var(--sidebar-title); border-color: var(--muted); }
.icon-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 20;
  padding: .34rem .52rem;
  border: 1px solid var(--sidebar-border);
  border-radius: .35rem;
  background: var(--heading);
  color: var(--background);
  font-family: var(--font-system);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .15s ease, transform .15s ease;
}
.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.sidebar-footer .icon-button:first-child::after { left: 0; transform: translateY(4px); }
.sidebar-footer .icon-button:first-child:hover::after,
.sidebar-footer .icon-button:first-child:focus-visible::after { transform: translateY(0); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button[href*="github"] svg { fill: currentColor; stroke: none; }
.font-glyph { font-family: var(--font-system); font-size: .68rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.language-glyph { font-family: var(--font-system); font-size: .67rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.moon { display: none; }
[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .moon { display: block; }

.page-shell { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  padding: 0 clamp(2rem, 3vw, 2.4rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--background);
}
.breadcrumb { min-width: 0; display: flex; align-items: center; gap: .45rem; overflow: hidden; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { min-width: 0; overflow: hidden; color: var(--heading); text-overflow: ellipsis; }
.menu-button { display: none; width: 38px; height: 38px; padding: .5rem; border: 0; background: transparent; color: var(--heading); cursor: pointer; }
.menu-button svg, .search svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search { width: 200px; height: 34px; margin-left: auto; padding: .25rem .85rem; display: flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 1.1rem; background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 15px; height: 15px; flex: none; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .9rem; }
.search input::placeholder { color: var(--muted); }

.home-main { width: 100%; max-width: none; margin: 0; padding: 27px 32px 3rem 38px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 34px; align-items: start; }
.home-column, .directory-column { min-width: 0; }
.home-intro { margin-bottom: 2.5rem; padding: .35rem 0 2.15rem; border-bottom: 1px solid var(--border); }
.home-intro h1 { margin: 0 0 1rem; color: var(--heading); font-size: clamp(2.15rem, 5vw, 3rem); font-weight: 600; letter-spacing: -.035em; }
.home-intro p { max-width: 680px; margin: 0; color: var(--text); font-size: 1.05rem; line-height: 1.75; }
.section-heading { margin: 0 0 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; color: var(--heading); font-size: 1.3rem; font-weight: 600; }
.section-heading a { flex: none; color: var(--muted); font-size: 1rem; font-weight: 600; }
.section-heading a:hover { color: var(--accent); }
.post-list { display: grid; gap: 18px; }
.post-column { display: grid; gap: 18px; scroll-margin-top: 1rem; }
.post-card { min-height: 150px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: var(--card-shadow); }
.post-card[hidden] { display: none; }
.post-card > a { min-height: 148px; padding: 24px 28px 22px; display: flex; flex-direction: column; color: var(--text); }
.post-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--border) 55%, var(--muted)); box-shadow: 0 4px 12px rgba(0, 0, 0, .07); transition: transform .15s ease, box-shadow .15s ease; }
.post-card h2 { margin: 0 0 .45rem; color: var(--heading); font-size: 1.42rem; font-weight: 400; line-height: 1.3; }
.post-title-row { margin: 0 0 .55rem; display: flex; align-items: baseline; gap: .7rem; }
.post-title-row h2 { min-width: 0; margin: 0; }
.post-title-row .subtype-badge { flex: none; padding: .2rem .62rem; font-size: .82rem; white-space: nowrap; transform: translateY(-3px); }
.post-card p { margin: 0 0 0.5rem; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.post-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: .65rem 1.75rem; color: var(--muted); font-size: .79rem; }
.post-meta span { display: inline-flex; align-items: center; gap: .45rem; }
.post-meta span::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background-color: currentColor;
  opacity: .72;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.post-meta span:first-child::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/g%3E%3C/svg%3E");
}
.post-meta span:last-child::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 6.5h6l2-2h9v15h-17zM3.5 9h17' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 6.5h6l2-2h9v15h-17zM3.5 9h17' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.subtype-badge { --subtype-color: var(--accent); padding: .17rem .55rem; border: 1px solid color-mix(in srgb, var(--subtype-color) 52%, var(--border)); border-radius: .35rem; background: color-mix(in srgb, var(--subtype-color) 10%, var(--surface)); color: var(--subtype-color); font-size: .8rem; font-weight: 600; line-height: 1.35; }
.subtype-paper-review { --subtype-color: oklch(42.4% .199 265.638); } /* Tailwind blue-800 */
.subtype-technical-primer { --subtype-color: oklch(43.7% .078 188.216); } /* Tailwind teal-800 */
.subtype-technical-report { --subtype-color: oklch(43.2% .232 292.759); } /* Tailwind violet-800 */
.subtype-research-note { --subtype-color: oklch(47.3% .137 46.201); } /* Tailwind amber-800 */
[data-theme="dark"] .subtype-paper-review { --subtype-color: oklch(80.9% .105 251.813); } /* Tailwind blue-300 */
[data-theme="dark"] .subtype-technical-primer { --subtype-color: oklch(85.5% .138 181.071); } /* Tailwind teal-300 */
[data-theme="dark"] .subtype-technical-report { --subtype-color: oklch(81.1% .111 293.571); } /* Tailwind violet-300 */
[data-theme="dark"] .subtype-research-note { --subtype-color: oklch(87.9% .169 91.605); } /* Tailwind amber-300 */
.empty-state { padding: 3rem 1rem; color: var(--muted); text-align: center; }

.home-rail { padding-top: .55rem; }
.home-rail section { margin-bottom: 4.65rem; padding-left: 16px; border-left: 1px solid var(--border); scroll-margin-top: 1rem; }
.home-rail h2 { margin: 0 0 .65rem; color: var(--heading); font-size: 1rem; font-weight: 600; }
.home-rail a { display: block; margin: .45rem 0; color: var(--muted); font-size: .88rem; }
.home-rail a:hover { color: var(--accent); }
.home-rail p { margin: .4rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.rail-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.rail-tags span { padding: .18rem .55rem; border: 1px solid var(--border); border-radius: .9rem; color: var(--muted); font-size: .72rem; }
.footer { margin-top: auto; padding: 2rem 2.4rem; color: var(--muted); font-size: .78rem; }
.footer p { margin: 0; }
.backdrop { display: none; }

/* Static Markdown reader */
.reader-breadcrumb { flex: 1; }
.reader-breadcrumb #document-name { max-width: min(65vw, 720px); }
.reader-main { width: 100%; max-width: none; margin: 0; padding: 27px 10px 3rem 38px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 16vw, 300px); column-gap: 24px; align-items: start; }
.markdown-body { width: 100%; max-width: 1000px; min-width: 0; justify-self: center; color: var(--text); overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--heading); line-height: 1.3; scroll-margin-top: 82px; }
.markdown-body h1 { margin: 0 0 1.5rem; font-size: clamp(1.9rem, 3.6vw, 2.5rem); font-weight: 600; letter-spacing: -.03em; }
.article-meta { margin: -.65rem 0 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; color: var(--muted); font-size: .82rem; }
.markdown-body h2 { margin: 3.25rem 0 1.1rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border); font-size: 1.55rem; }
.markdown-body h3 { margin: 2.4rem 0 .8rem; font-size: 1.25rem; }
.markdown-body p { margin: 0 0 1.15rem; line-height: 1.75; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1.25rem; padding-left: 1.6rem; }
.markdown-body li { margin: .3rem 0; }
.markdown-body blockquote { margin: 1.5rem 0; padding: .8rem 1.15rem; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--surface) 85%, var(--border)); color: var(--muted); }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body code { padding: .14rem .32rem; border-radius: .25rem; background: color-mix(in srgb, var(--surface) 80%, var(--border)); color: var(--heading); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .86em; }
.markdown-body pre { margin: 1.4rem 0; padding: 1rem 1.1rem; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: color-mix(in srgb, var(--surface) 80%, var(--border)); line-height: 1.55; }
.markdown-body pre code { padding: 0; background: transparent; font-size: .82rem; }
.markdown-body table { width: 100%; margin: 1.5rem 0; display: block; overflow-x: auto; border-collapse: collapse; font-size: .88rem; }
.markdown-body th, .markdown-body td { min-width: 8rem; padding: .65rem .75rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown-body th { background: color-mix(in srgb, var(--surface) 80%, var(--border)); color: var(--heading); font-weight: 600; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 6px; }
.markdown-body hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--border); }
.mermaid-diagram { --mermaid-inline-max-height: 560px; position: relative; margin: 1.6rem 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); text-align: center; }
.mermaid-diagram__viewport { max-height: var(--mermaid-inline-max-height); padding: 1rem; display: flex; justify-content: center; overflow: hidden; }
.mermaid-diagram__viewport > svg { display: block; width: auto; max-width: 100%; max-height: calc(var(--mermaid-inline-max-height) - 2rem); height: auto; margin: 0 auto; }
.mermaid-diagram.mermaid-error { padding: 1rem; color: #b54747; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .82rem; text-align: left; white-space: pre-wrap; }
.mermaid-expand-button, .mermaid-lightbox__close, .mermaid-lightbox__control { display: grid; place-items: center; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); cursor: pointer; }
.mermaid-expand-button { position: absolute; z-index: 2; top: .6rem; right: .6rem; width: 32px; height: 32px; border-radius: 5px; opacity: .78; }
.mermaid-expand-button:hover, .mermaid-expand-button:focus-visible, .mermaid-lightbox__close:hover, .mermaid-lightbox__close:focus-visible, .mermaid-lightbox__control:hover, .mermaid-lightbox__control:focus-visible { border-color: var(--muted); color: var(--heading); opacity: 1; outline: none; }
.mermaid-expand-button svg, .mermaid-lightbox__close svg, .mermaid-lightbox__control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.mermaid-lightbox-open { overflow: hidden; }
.mermaid-lightbox { position: fixed; z-index: 100; inset: 0; padding: 68px 24px 24px; display: flex; background: rgba(10, 10, 12, .82); backdrop-filter: blur(5px); }
.mermaid-lightbox[hidden] { display: none; }
.mermaid-lightbox__toolbar { position: fixed; z-index: 1; top: 18px; right: 70px; display: flex; }
.mermaid-lightbox__control { width: 38px; height: 38px; margin-left: -1px; background: var(--surface); }
.mermaid-lightbox__control:first-child { margin-left: 0; border-radius: 6px 0 0 6px; }
.mermaid-lightbox__control:last-child { border-radius: 0 6px 6px 0; }
.mermaid-lightbox__control:disabled { opacity: .35; cursor: not-allowed; }
.mermaid-lightbox__zoom-value { width: 62px; color: var(--heading); font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mermaid-lightbox__close { position: fixed; z-index: 1; top: 18px; right: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); }
.mermaid-lightbox__viewport { width: 100%; height: 100%; padding: 24px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.mermaid-lightbox__viewport svg { display: block; width: clamp(720px, 92vw, 1400px); max-width: none; height: auto; margin: auto; }
.markdown-body .katex { color: var(--heading); font-size: 1.06em; }
.markdown-body .katex-display { margin: 1.6rem 0; padding: .3rem 0; overflow-x: auto; overflow-y: hidden; }
.reader-toc { position: sticky; top: 90px; max-height: calc(100vh - 120px); padding-left: 12px; overflow-y: auto; }
.reader-toc > strong { display: block; margin-bottom: .8rem; color: var(--heading); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.reader-toc nav { display: grid; border-left: 1px solid var(--border); }
.reader-toc a { padding: .25rem 0 .25rem .85rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); font-size: .78rem; line-height: 1.45; transition: color .15s ease, border-color .15s ease; }
.reader-toc a:hover { color: var(--accent); }
.reader-toc a.active { color: var(--accent); border-left-color: var(--accent); }
.reader-toc .toc-h3 { padding-left: 1.55rem; font-size: .74rem; }
.reader-loading { padding: 4rem 0; color: var(--muted); }
.reader-error { padding: 2rem; border: 1px solid #e38b8b; border-radius: 6px; background: var(--surface); }
.reader-error h1 { font-size: 1.7rem; }
.post-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-navigation__link { min-width: 0; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.post-navigation__link--next { grid-column: 2; text-align: right; }
.post-navigation__link:hover, .post-navigation__link:focus-visible { border-color: var(--accent); color: var(--heading); box-shadow: 0 5px 18px var(--shadow); transform: translateY(-1px); outline: none; }
.post-navigation__label { display: flex; align-items: center; gap: .25rem; margin-bottom: .4rem; color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.post-navigation__link--next .post-navigation__label { justify-content: flex-end; }
.post-navigation__label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-navigation__title { display: -webkit-box; overflow: hidden; color: var(--heading); font-size: .94rem; font-weight: 600; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.reader-footer { width: min(100%, 1074px); margin: 0; }

/* Directory pages */
.directory-column > h1 { margin: 0 0 2.2rem; color: var(--heading); font-size: 2rem; font-weight: 600; letter-spacing: -.025em; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.category-card { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: var(--card-shadow); }
.category-card header { padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.category-card h2 { margin: 0; color: var(--heading); font-size: 1.12rem; font-weight: 600; }
.category-card header > span { min-width: 1.65rem; padding: .1rem .45rem; border-radius: 1rem; background: var(--sidebar-active); color: var(--muted); font-size: .74rem; text-align: center; }
.directory-report { padding: .72rem 1.15rem; display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border); color: var(--text); }
.directory-report:last-child { border-bottom: 0; }
.directory-report:hover { background: color-mix(in srgb, var(--surface) 82%, var(--sidebar-hover)); color: var(--accent); }
.directory-report span { min-width: 0; line-height: 1.35; }
.directory-report time { flex: none; color: var(--muted); font-size: .72rem; }
.archive-list { position: relative; padding-left: 6.5rem; }
.archive-list::before { content: ""; position: absolute; left: 4.65rem; top: 3.2rem; bottom: 1.4rem; border-left: 2px solid var(--border); }
.archive-year { position: relative; margin: 0 0 1.1rem -6.5rem; color: var(--heading); font-size: 1.65rem; font-weight: 400; }
.archive-row { position: relative; min-height: 3.75rem; display: grid; grid-template-columns: 4.2rem 1fr; gap: 1.5rem; align-items: center; color: var(--text); }
.archive-row::before { content: ""; position: absolute; left: -2.16rem; width: .5rem; height: .5rem; border: 2px solid var(--muted); border-radius: 50%; background: var(--background); }
.archive-row:hover { color: var(--accent); }
.archive-row time { display: flex; gap: .35rem; color: var(--muted); font-size: .82rem; }
.archive-row time span { width: 1.8rem; text-transform: uppercase; }
.archive-row > span { font-size: 1rem; }
.blog-index { display: grid; gap: 1rem; }
.blog-index > h1 { margin: 0; color: var(--heading); font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -.03em; }
.blog-index-intro { margin: 0 0 .5rem; color: var(--muted); font-size: 1.02rem; }
.blog-type-filter { margin: 0 0 .35rem; display: flex; align-items: center; gap: .8rem; }
.blog-type-filter__label { flex: none; color: var(--muted); font-size: .82rem; font-weight: 600; }
.blog-type-filter__options { min-width: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.blog-type-filter__button { padding: .3rem .7rem; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); color: var(--muted); font-size: .78rem; line-height: 1.25; cursor: pointer; }
.blog-type-filter__button span { min-width: 1.05rem; padding: 0 .3rem; border-radius: .7rem; background: var(--sidebar-hover); color: var(--muted); font-size: .68rem; text-align: center; }
.blog-type-filter__button:hover { border-color: var(--muted); color: var(--heading); }
.blog-type-filter__button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.blog-type-filter__button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); }
.blog-type-filter__button[aria-pressed="true"] span { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--accent); }

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-rail { display: none; }
  .post-column, .home-column, .directory-column, .blog-index { width: min(100%, 760px); margin-inline: auto; }
  .reader-main { padding-right: 32px; }
}

@media (max-width: 850px) {
  :root { --sidebar-width: 260px; }
  .sidebar { transform: translateX(-105%); transition: transform 180ms ease; }
  .sidebar.open { transform: translateX(0); }
  .page-shell { margin-left: 0; }
  .reader-main { grid-template-columns: minmax(0, 1fr); }
  .reader-toc { display: none; }
  .menu-button { display: grid; place-items: center; }
  .backdrop { position: fixed; z-index: 15; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0,0,0,.4); }
  .backdrop.show { display: block; }
}

@media (max-width: 580px) {
  .topbar { padding-inline: .8rem; border-bottom: 1px solid var(--border); }
  .breadcrumb { flex: 1; font-size: .82rem; }
  .search { width: min(180px, 52vw); }
  .home-main { padding: 18px 12px 2rem; }
  .blog-type-filter { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .post-column { gap: 12px; }
  .post-card { min-height: 0; }
  .post-card > a { min-height: 0; padding: 19px 20px; }
  .post-card h2 { font-size: 1.22rem; }
  .post-card p { font-size: .92rem; }
  .post-meta { gap: .5rem 2rem; }
  .reader-main { padding: 18px 12px 2rem; }
  .post-navigation { grid-template-columns: minmax(0, 1fr); }
  .post-navigation__link--next { grid-column: 1; }
  .mermaid-diagram { --mermaid-inline-max-height: 420px; }
  .mermaid-lightbox { padding: 58px 8px 8px; }
  .mermaid-lightbox__toolbar { top: 10px; right: 56px; }
  .mermaid-lightbox__control { width: 34px; height: 34px; }
  .mermaid-lightbox__zoom-value { width: 56px; }
  .mermaid-lightbox__close { top: 10px; right: 10px; }
  .mermaid-lightbox__viewport { padding: 12px; }
  .category-grid { grid-template-columns: 1fr; }
  .archive-list { padding-left: 3.8rem; }
  .archive-list::before { left: 2.7rem; }
  .archive-year { margin-left: -3.8rem; }
  .archive-row { grid-template-columns: 3.3rem 1fr; gap: .9rem; }
  .archive-row::before { left: -1.41rem; }
  .archive-row time { display: grid; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
