:root {
  color-scheme: light;
  --ink: #292724;
  --muted: #6d655e;
  --line: rgba(47, 42, 38, 0.58);
  --line-soft: rgba(47, 42, 38, 0.18);
  --paper: rgba(246, 241, 233, 0.76);
  --accent: #984d52;
  --accent-deep: #733a40;
  --scrollbar-thumb: rgba(109, 101, 94, 0.38);
  --scrollbar-thumb-hover: rgba(115, 58, 64, 0.56);
  --scrollbar-thumb-active: rgba(115, 58, 64, 0.72);
  --pink: #9f537f;
  --sidebar: clamp(13.5rem, 22vw, 18rem);
  --gutter: clamp(1.4rem, 4vw, 4.5rem);
  --rule-gap: clamp(0.65rem, 1vw, 0.9rem);
  --shadow: 0 24px 70px rgba(20, 17, 15, 0.28);
  --display: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, Georgia, "Times New Roman", serif;
  --kai: "LXGW WenKai", "FZKai-Z03", "Kaiti SC", STKaiti, KaiTi, var(--display);
  --hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Kaiti SC", STKaiti, KaiTi, cursive;
  --sans: "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Inter, ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Sarasa Mono SC", "Noto Sans Mono CJK SC", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (forced-colors: none) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }

  @supports selector(::-webkit-scrollbar) {
    * { scrollbar-width: auto; scrollbar-color: auto; }

    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track,
    ::-webkit-scrollbar-corner { background: transparent; }
    ::-webkit-scrollbar-button { display: none; }

    ::-webkit-scrollbar-thumb {
      min-height: 2rem;
      min-width: 2rem;
      background: var(--scrollbar-thumb);
      background-clip: padding-box;
      border: 1px solid transparent;
      border-radius: 999px;
    }

    ::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
    ::-webkit-scrollbar-thumb:active { background-color: var(--scrollbar-thumb-active); }
  }
}

:lang(zh),
:lang(zh-CN),
:lang(zh-Hans) {
  font-kerning: normal;
  line-break: strict;
  text-autospace: normal;
  word-break: normal;
}

body {
  position: relative;
  isolation: isolate;
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: #282522;
  font-size: 1rem;
  line-height: 1.8;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  background-image:
    radial-gradient(circle at 50% 24%, rgba(229, 202, 183, 0.12), transparent 54%),
    linear-gradient(rgba(34, 31, 29, 0.16), rgba(34, 31, 29, 0.24)),
    url("/assets/background.webp");
  background-position: center;
  background-size: cover;
  pointer-events: none;
  transform: translateZ(0);
}

a {
  color: var(--accent-deep);
  text-decoration-color: rgba(115, 58, 64, 0.38);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--pink); text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(159, 83, 127, 0.42);
  outline-offset: 4px;
}

img,
video,
audio { max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: white;
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.site-shell {
  position: relative;
  z-index: 1;
  width: min(94vw, 104rem);
  min-height: calc(100vh - 5rem);
  margin: 2.5rem auto;
  overflow: clip;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow);
}

.site-header {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  gap: var(--gutter);
  min-height: 8.4rem;
  margin: 0 clamp(1.25rem, 4vw, 4rem);
  padding: 2.15rem 0 1.1rem;
  border-bottom: 2px solid var(--line);
}

.site-brand {
  align-self: end;
  justify-self: start;
  width: fit-content;
  padding: 0 0 0.12rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-family: var(--hand);
  font-size: clamp(1.55rem, 2.35vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding: 0 clamp(0.25rem, 2.5vw, 2.75rem) 0.45rem;
}

.site-nav a {
  position: relative;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { opacity: 1; transform: none; }

.content-frame {
  position: relative;
  min-height: clamp(34rem, 66vh, 51rem);
  margin: 0 clamp(1.25rem, 4vw, 4rem);
  border-bottom: 2px solid var(--line);
}

.content-frame::before {
  position: absolute;
  z-index: 1;
  top: var(--rule-gap);
  bottom: var(--rule-gap);
  left: var(--sidebar);
  width: 2px;
  content: "";
  background: var(--line);
  pointer-events: none;
}

.home-layout,
.index-layout,
.article-layout,
.about-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  column-gap: var(--gutter);
}

.profile-rail,
.toc-rail {
  position: relative;
  padding: 3rem clamp(1rem, 2vw, 1.75rem) 3rem 0;
}

.avatar {
  display: block;
  width: min(100%, 14rem);
  max-width: 100%;
  height: auto !important;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid rgba(48, 43, 39, 0.35);
  filter: saturate(0.84) contrast(1.02);
  box-shadow: 0 12px 28px rgba(35, 29, 26, 0.16);
}

.avatar--home { width: min(100%, 14rem); }

.home-layout { grid-template-rows: auto auto minmax(0, 1fr); }

.home-profile {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  padding-bottom: 1rem;
}

.home-content { display: contents; }

.home-signature {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  padding: 0 clamp(1rem, 2vw, 1.75rem) 1.15rem 0;
}

.home-tags {
  position: relative;
  grid-column: 1;
  grid-row: 3;
  align-self: start;
  padding: 1.15rem clamp(1rem, 2vw, 1.75rem) 2.5rem 0;
}

.home-tags::before {
  position: absolute;
  top: 0;
  right: var(--rule-gap);
  left: 0;
  height: 1px;
  content: "";
  background: var(--line-soft);
}

.home-recent {
  grid-column: 2;
  grid-row: 1 / span 3;
  padding: 3rem 0 4rem;
}

.home-tags h2,
.home-recent h2,
.profile-links > h1,
.profile-links > h2,
.series-tree h2,
.archive-nav h2,
.rail-label {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: none;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.tag-cloud a {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.45;
  text-decoration: none;
}

.tag-cloud a:hover { color: var(--accent-deep); border-color: rgba(152, 77, 82, 0.45); }

.recent-card,
.post-card {
  padding: 1.45rem 0 1.65rem;
  border-top: 1px solid var(--line-soft);
  contain-intrinsic-size: auto 10rem;
  content-visibility: auto;
}

.recent-card:first-of-type { border-top: 0; }

.post-card:first-of-type { border-top-color: var(--line); }

.recent-card h3,
.post-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 500;
  line-height: 1.25;
}

.recent-card h3 a,
.post-card h2 a { color: var(--ink); text-decoration: none; }

.recent-card p,
.post-card p {
  max-width: 66ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.card-date {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.reading-pane {
  min-width: 0;
  padding: 3rem 0 5rem;
}

.page-header,
.article-header,
.series-header,
.archive-header { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
}

.page-header h1,
.article-header h1,
.series-header h1,
.archive-header h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.25rem + 1.4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.article-header { padding-bottom: 1.45rem; border-bottom: 1px solid var(--line); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.shared-profile-rail {
  display: flex;
  flex-direction: column;
}

.shared-profile-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.profile-signature-source { display: none; }

.shared-profile-card .profile-signature-source { display: block; }

.rail-menu {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-soft);
}

.rail-menu .rail-link {
  display: block;
  margin: 0.35rem 0;
}

.rail-link {
  width: fit-content;
}

.rail-link,
.profile-links a,
.archive-nav a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.45;
  text-decoration: none;
}

.toc-rail { position: relative; }

.toc-rail > .rail-label { position: sticky; top: 2rem; }

.toc {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding-right: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.toc ul { margin: 0; padding-left: 1rem; }
.toc > ul { padding-left: 0; list-style: none; }
.toc li { margin: 0.55rem 0; }
.toc a { color: inherit; text-decoration: none; }
.toc a:hover { color: var(--accent-deep); }

.article-pane > section,
.about-pane > section,
.series-layout > section { min-width: 0; max-width: none; }

.reading-pane section h1,
.reading-pane h2,
.reading-pane h3,
.series-layout section h1,
.series-layout section h2,
.series-layout section h3,
.archive-section h2,
.archive-section h3 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.2;
}

.reading-pane section h1,
.reading-pane h2,
.series-layout section h1,
.series-layout section h2,
.archive-section > h2 {
  margin: 2.25rem 0 0.85rem;
  font-size: clamp(1.4rem, 1.12rem + 0.8vw, 1.8rem);
}

.reading-pane h3,
.series-layout section h3,
.archive-section h3 {
  margin: 1.75rem 0 0.7rem;
  font-size: clamp(1.18rem, 1.02rem + 0.45vw, 1.4rem);
}

.article-pane section h2 {
  margin: 1.85rem 0 0.75rem;
  font-size: clamp(1.2rem, 1.02rem + 0.6vw, 1.5rem);
}

.article-pane section h3 {
  margin: 1.5rem 0 0.65rem;
  font-size: clamp(1.1rem, 1rem + 0.3vw, 1.25rem);
}

.article-pane section h4 { font-size: 1em; font-weight: 600; }

.reading-pane p,
.reading-pane li,
.series-layout section p,
.series-layout section li { max-width: none; }

.reading-pane blockquote,
.series-layout blockquote {
  margin: 1.8rem 0;
  padding: 0.15rem 0 0.15rem 1.25rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
}

code {
  padding: 0.1em 0.28em;
  background: rgba(80, 65, 57, 0.08);
  border-radius: 0.2rem;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  color: #f3ece5;
  background: #302d2b;
  border-radius: 0.25rem;
}

pre code { padding: 0; background: transparent; }

figure { margin: 2.5rem 0; }

.article-pane { font-size: 1.0625rem; counter-reset: figure; }

figure.tex2ss-numbered-figure { counter-increment: figure; }

figure img {
  display: block;
  width: min(100%, 44rem);
  height: auto;
  border: 1px solid var(--line-soft);
}

figure img[src*="media/diagrams/"] {
  width: auto;
  max-width: min(100%, 44rem);
  padding: 0;
  background: transparent;
  border: 0;
}

figcaption { margin-top: 0.7rem; color: var(--muted); font-size: 0.83rem; }

.tex2ss-numbered-figure figcaption::before { content: "图 " counter(figure) ". "; }

.math.display {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-block: 0.2rem;
}

.math.display > mjx-container[display="true"] { min-width: min-content; }

.tex2ss-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin: 1.8rem 0;
  overflow-x: auto;
}

.tex2ss-equation-number { margin-left: auto; font-family: var(--display); }

.tex2ss-media { margin: 1.6rem 0; }
.tex2ss-media audio,
.tex2ss-media video { display: block; width: 100%; }

.series-layout,
.archive-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  column-gap: var(--gutter);
}

.series-header { grid-column: 2; padding-top: 3rem; }

.series-header p:last-child,
.archive-header p:last-child { max-width: none; color: var(--muted); }

.series-tree {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 999;
  width: 100%;
  max-width: var(--sidebar);
  min-width: 0;
  min-height: 100%;
  padding: 3rem clamp(0.85rem, 1.5vw, 1.25rem) 4rem 0;
  overflow: hidden;
  font-family: var(--mono);
}

.series-layout > section:not(.series-tree),
.series-layout > p,
.series-layout > ul,
.series-layout > ol,
.series-layout > figure,
.series-layout > div:not(.series-tree) { grid-column: 2; }

.series-tree h2 {
  margin-bottom: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-tree ul {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding-left: 1rem;
  list-style: none;
}

.series-tree > ul { padding-left: 0; }

.series-tree ul ul {
  margin: 0.18rem 0 0.1rem 0.38rem;
  border-left: 1px solid var(--line-soft);
}

.series-tree li {
  position: relative;
  min-width: 0;
  margin: 0.2rem 0;
  padding-left: 1.45rem;
  line-height: 1.3;
}

.series-tree li::before {
  position: absolute;
  top: 0;
  left: 0;
  content: "├──";
  color: var(--line);
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: nowrap;
}

.series-tree li:last-child::before { content: "└──"; }

.series-tree a {
  display: block;
  max-width: 100%;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: clamp(0.7rem, 0.9vw, 0.79rem);
  line-height: 1.3;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.series-tree a:hover { color: var(--accent-deep); }

.archive-nav {
  position: relative;
}

.archive-nav ul { margin: 0; padding: 0; list-style: none; }
.archive-nav li { margin: 0.6rem 0; }

.archive-nav a {
  display: block;
  width: fit-content;
}

.archive-pane { min-width: 0; }

.archive-sections { padding-bottom: 0; }

.archive-section {
  padding: 0 0 2rem;
  border-top: 1px solid var(--line-soft);
}

.archive-series {
  padding-bottom: 3.5rem;
}

.series-card {
  margin: 0;
  padding: 1.35rem 0 1.55rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  contain-intrinsic-size: auto 11rem;
  content-visibility: auto;
}

.series-card:last-child { border-bottom: 0; }

.series-card h3 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.3rem, 2.1vw, 1.8rem);
}

.series-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.series-card p {
  max-width: 62ch;
  margin: 0.4rem 0;
  color: var(--muted);
}

.series-posts { margin: 0.8rem 0 0; }

.series-posts > p { margin: 0; }

.series-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  color: var(--accent-deep);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}

.series-toggle::before {
  width: 0.9em;
  content: "▸";
  color: var(--muted);
  font-size: 0.78rem;
}

.series-posts.is-open .series-toggle::before { content: "▾"; }

.series-toggle-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.series-toggle:focus-visible {
  outline: 3px solid rgba(159, 83, 127, 0.42);
  outline-offset: 4px;
}

.series-post-list { display: none; }

.series-posts.is-open .series-post-list,
.series-post-list:target { display: block; }

.series-post-list[hidden] { display: none; }

.series-post-list ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.series-card li { margin: 0.45rem 0; }

.series-count {
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: none;
}

.archive-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  font-size: 0.9rem;
}

.archive-secondary .archive-section > h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.archive-list,
.archive-list ul { padding-left: 1.1rem; }
.archive-list li { margin: 0.6rem 0; }

.archive-date {
  margin-left: 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.about-profile { display: flex; flex-direction: column; gap: 1.15rem; }

.signature {
  min-height: 1.75em;
  margin: 0;
  color: var(--muted);
  font-family: var(--kai);
  font-size: 0.92rem;
  font-style: normal;
  letter-spacing: 0.025em;
}

.profile-links { padding-top: 1.15rem; border-top: 1px solid var(--line-soft); }

.profile-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-links li { margin: 0.35rem 0; }

.profile-links a {
  display: block;
  width: fit-content;
  margin: 0.35rem 0;
}

.about-pane { max-width: none; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 4rem) 1.45rem;
  color: rgba(52, 47, 43, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 800px) {
  .site-shell {
    width: min(100% - 1.2rem, 48rem);
    min-height: calc(100vh - 1.2rem);
    margin: 0.6rem auto;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    min-height: auto;
    padding-top: 1.4rem;
  }

  .site-brand { padding: 0 0 0.12rem; }

  .site-nav {
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0 0.35rem;
  }

  .content-frame,
  .home-layout,
  .index-layout,
  .article-layout,
  .about-layout,
  .series-layout,
  .archive-layout { display: block; }

  .content-frame { min-height: 0; }

  .profile-rail,
  .toc-rail,
  .series-tree {
    min-height: 0;
    padding: 1.5rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-frame::before { display: none; }

  .home-content { display: block; }

  .home-tags,
  .home-recent,
  .series-header {
    padding: 1.75rem 0 2.5rem;
    border-right: 0;
  }

  .home-profile {
    min-height: 0;
    padding-bottom: 1rem;
    border-bottom: 0;
  }

  .home-signature { padding: 0 0 1.15rem; }

  .avatar--home,
  .about-profile .avatar,
  .shared-profile-card .avatar { width: 8rem; }

  .toc-rail { max-height: 16rem; overflow: auto; }
  .toc-rail > .rail-label,
  .toc { position: static; }
  .reading-pane { padding: 2rem 0 3.5rem; }

  .site-footer { flex-direction: column; }

  .archive-secondary { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* The author's existing visual language. */
:root { --paper: rgba(246, 241, 233, 0.90); }
.reading-pane .post-card h2 { margin: 0 0 .4rem; font-size: clamp(1.25rem, 2vw, 1.7rem); }
.post-card { padding-block: 1.25rem; }
.profile-rail { min-width: 0; }
.shared-profile-card .avatar { aspect-ratio: auto; }
.row-tags { font-size: .78rem; }
.more-link { margin-top: 2rem; }
.toc { top: 2rem; }
.toc .rail-label { margin-bottom: 1rem; }
.toc-level-3 { padding-left: .7rem; }
.toc-level-4 { padding-left: 1.4rem; }
.tex-content:empty { display: none; }
.tex-content { overflow-wrap: break-word; }
.tex-content p { margin: 0 0 1.15em; }
.tex-content p.indent { text-indent: 0; }
.tex-content .titlemark { color: var(--muted); margin-right: .35em; }
.tex-content [class*="lmbx"], .tex-content .paragraphHead { font-weight: 700; }
.tex-content [class*="lmri"], .tex-content [class*="lmti"] { font-style: italic; }
.tex-content [class*="lmtt"] { font-family: var(--mono); }
.tex-content .small-caps { font-variant: small-caps; }
.tex-content .underline { text-decoration: underline; }
.tex-content .center, .tex-content .centerline { text-align: center; }
.tex-content .flushright, .tex-content .rightline { text-align: right; }
.tex-content table { display: block; overflow-x: auto; border-collapse: collapse; }
.tex-content td, .tex-content th { padding: .35rem .6rem; }
.tex-content .tabular .hline { border-top: 1px solid var(--line); }
.tex-content .newtheorem { margin-block: 1.5em; }
.tex-content .newtheorem .head { font-weight: bold; }
.tex-content .footnotes { font-size: .88em; border-top: 1px solid var(--line-soft); padding-top: 1rem; }
.tex-content .footnote-mark { font-size: .8em; vertical-align: super; }
.tex-content .footnote-text { font-size: .88em; }
.mathjax-block, .mathjax-env { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: .4rem; margin-block: 1.1rem; }
mjx-container[display="true"] { margin: .5em 0 !important; }
.tex-content figure img { margin-inline: auto; }
.tex-content figcaption { text-align: center; }
.media-block audio, .media-block video { display: block; width: 100%; }
.media-block video { max-height: 75vh; background: #292724; }
.article-pagination { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line-soft); margin-top: 3rem; padding-top: 1.5rem; font-size: .84rem; color: var(--muted); }
.article-pagination > span { max-width: 48%; }
.article-pagination > span:last-child { text-align: right; }
.is-series { font-family: var(--mono); }
.tree ul { margin: .3rem 0; padding-left: .8rem; list-style: none; }
.tree > ul { padding-left: 0; }
.tree ul ul { border-left: 1px solid var(--line-soft); margin-left: .3rem; }
.tree li { min-width: 0; padding-left: 1rem; position: relative; margin-block: .4rem; }
.tree li::before { content: '├'; position: absolute; left: 0; color: var(--muted); }
.tree li:last-child::before { content: '└'; }
.tree a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; text-decoration: none; color: var(--muted); }
.tree a:hover, .tree a[aria-current] { color: var(--accent); }
details { margin-block: .8rem; }
summary { cursor: pointer; color: var(--accent-deep); font-size: .9rem; padding-block: .3rem; }
summary:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
details:target { outline: 1px solid var(--accent); outline-offset: .5rem; }
.chapter-index { border-top: 1px solid var(--line-soft); margin-top: 2.5rem; }
[id] { scroll-margin-top: 1.5rem; }
@media (max-width: 800px) {
  .profile-rail .avatar { width: 7rem; }
  .profile-rail:has(.toc) { max-height: 13rem; overflow: auto; }
  .toc { max-height: none; }
  .tree { max-height: 15rem; overflow: auto; }
  .article-pagination { gap: 1rem; }
}
@media print {
  body { background: white; }
  body::before, .site-nav, .profile-rail, .skip-link { display: none; }
  .site-shell { margin: 0; width: 100%; border: 0; box-shadow: none; background: white; }
  .content-frame { display: block; margin: 0; }
  .content-frame::before { display: none; }
  .reading-pane { padding: 1rem 0; }
}
