:root {
  --bg: #fdf6e3;
  --bg-alt: #fefcf5;
  --surface: #fefcf5;
  --accent: #2d6cdf;
  --accent-soft: rgba(45, 108, 223, 0.12);
  --text: #1b1d22;
  --text-dim: #3a3d44;
  --text-muted: #6c707b;
  --border: #d6cfb8;
  --shadow: rgba(30, 24, 12, 0.08);
  --radius: 16px;
  --grid-line: rgba(61, 52, 34, 0.06);
  --graph-paper: #fdf6e3;
  --graph-grid: rgba(61, 52, 34, 0.08);
  --graph-edge: rgba(45, 52, 67, 0.2);
  --graph-tag: #2d6cdf;
  --graph-page: #1f9d55;
  --graph-year: #9c7a4b;
  --graph-cluster: #d55672;
  --graph-subject: #3f6dd8;
  --graph-collection: #c25c2b;
  --graph-architecture: #1b8b83;
  --graph-series: #6a5b2e;
  --font-sans: "IBM Plex Sans", "Work Sans", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "Fira Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
  min-height: 100vh;
  overflow-x: hidden;
}

html.nav-open,
body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.2rem 6vw 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 60;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 40;
}

.nav-link {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.theme-toggle {
  position: fixed;
  right: 5vw;
  bottom: calc(1.5rem + var(--footer-offset, 0px) + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 12px 28px var(--shadow);
  z-index: 100;
}

.theme-toggle-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-direction: column;
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.theme-toggle-label {
  display: none;
}

@media (max-width: 640px) {
  .theme-toggle {
    right: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
  }
}

.page-main {
  flex: 1;
  padding: 5rem 6vw 5rem;
}

.hero {
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 2;
  pointer-events: none;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-right: clamp(0px, 32vw, 460px);
}

.hero-copy,
.hero-actions {
  pointer-events: none;
}

.hero-copy > *,
.hero-actions > * {
  pointer-events: auto;
}

.latest-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(280px, 32vw, 450px);
  padding: 0;
  pointer-events: auto;
}

.latest-title {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.latest-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--text);
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(254, 252, 245, 0.78);
  box-shadow: 0 12px 26px var(--shadow);
  backdrop-filter: blur(10px);
}

.latest-list a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.latest-list a::after {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-muted);
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin: 0 0 0.75rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.hero-intro {
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
}

.hero-actions {
  margin-top: 1.4rem;
}

.graph-panel {
  margin: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  padding: 0;
  box-shadow: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

.graph-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-color: var(--graph-paper);
  background-image:
    linear-gradient(0deg, var(--graph-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--graph-grid) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  border: none;
  overflow: hidden;
}

#graph-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.graph-controls {
  position: fixed;
  top: 50%;
  left: 1.4rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: auto;
  z-index: 10;
  align-items: flex-start;
  max-width: min(92vw, 740px);
}

.graph-controls.graph-controls--floating {
  z-index: 60;
}

.graph-controls__row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
  flex-wrap: nowrap;
  pointer-events: auto;
}

.graph-menu-container {
  display: inline-flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(254, 252, 245, 0.9);
  box-shadow: 0 14px 30px var(--shadow);
}

html.theme-dark .graph-menu-container {
  background: rgba(28, 33, 40, 0.92);
}

.graph-modes {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(254, 252, 245, 0.8);
  box-shadow: 0 12px 28px var(--shadow);
  backdrop-filter: blur(10px);
}

.graph-mode {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.graph-mode:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.graph-mode.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 12px 28px var(--shadow);
}

.graph-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  pointer-events: auto;
  position: relative;
}

.graph-search {
  min-width: 220px;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(254, 252, 245, 0.9);
  color: var(--text);
  box-shadow: 0 12px 28px var(--shadow);
  outline: none;
}

.graph-search:focus {
  border-color: var(--accent);
  box-shadow: 0 12px 28px var(--shadow), 0 0 0 2px var(--accent-soft);
}

.graph-search-wrap {
  position: relative;
}

.graph-search--collapsible {
  min-width: 0;
  width: 46px;
  height: 46px;
  padding: 0.5rem;
  cursor: pointer;
  transition: width 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.graph-search--collapsible::placeholder {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.graph-search-wrap::before {
  content: "🔍";
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' stroke='%236e7380' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.65' y1='16.65' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
  pointer-events: none;
}

.graph-search-wrap:hover .graph-search--collapsible,
.graph-search--collapsible:focus {
  width: 240px;
  padding-left: 2.4rem;
  cursor: text;
}

.graph-search--collapsible:focus::placeholder,
.graph-search-wrap:hover .graph-search--collapsible::placeholder {
  opacity: 1;
}

.graph-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 12px 28px var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}

.graph-button:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.graph-mode-hint {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: rgba(254, 252, 245, 0.92);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  max-width: 280px;
  box-shadow: 0 14px 30px var(--shadow);
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 8;
}

.graph-mode-hint.is-hidden {
  display: none;
}

.graph-mode-hint.is-visible {
  display: block;
}

.graph-button.is-hidden {
  display: none;
}

.graph-year-select.is-hidden {
  display: none;
}

.graph-year-wrap {
  position: relative;
}

.graph-year-toggle {
  width: 46px;
  height: 46px;
  padding: 0.5rem;
  font-weight: 700;
}

.graph-year-menu {
  position: absolute;
  top: 50%;
  left: 110%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(254, 252, 245, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px var(--shadow);
  padding: 0.45rem;
  z-index: 15;
  min-width: 120px;
}

.graph-year-wrap.is-open .graph-year-menu {
  display: flex;
}

.graph-year-menu button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.graph-year-menu button:hover,
.graph-year-menu button:focus {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

html.theme-dark .graph-year-menu {
  background: rgba(28, 33, 40, 0.92);
}

.graph-mode-picker {
  position: relative;
}

.graph-mode-toggle {
  padding: 0.5rem;
}

.graph-square {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
}

.graph-mode-menu {
  position: absolute;
  top: 50%;
  left: 110%;
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(254, 252, 245, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px var(--shadow);
  padding: 0.45rem;
  z-index: 12;
  transform: translateY(-50%);
}

.graph-mode-picker:hover .graph-mode-menu,
.graph-mode-picker:focus-within .graph-mode-menu {
  display: flex;
}

html.theme-dark .graph-mode-menu {
  background: rgba(28, 33, 40, 0.92);
}

@media (max-width: 900px) {
  .graph-controls {
    left: 0.9rem;
  }
}

@media (max-width: 600px) {
  .graph-controls {
    display: none;
  }
}

@media (max-width: 2000px) {
  html {
    font-size: 0.8rem;
  }

  .latest-panel {
    width: clamp(240px, 26vw, 360px);
  }

  .page-main {
    padding: 4rem 5vw 4rem;
  }

  .hero {
    min-height: 55vh;
    margin-bottom: 2rem;
  }

  .latest-list {
    gap: 0.5rem;
  }

  .graph-controls {
    left: 1rem;
    gap: 0.6rem;
  }
  .graph-menu-container {
    padding: 0.4rem;
    gap: 0.55rem;
    border-radius: 14px;
    box-shadow: 0 10px 22px var(--shadow);
  }
  .graph-square,
  .graph-year-toggle,
  .graph-back {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0.45rem;
  }
  .graph-mode-menu,
  .graph-year-menu {
    left: 105%;
    min-width: 110px;
    box-shadow: 0 10px 22px var(--shadow);
  }
  .graph-search--collapsible {
    width: 40px;
    height: 40px;
    padding: 0.4rem;
  }
  .graph-search-wrap::before {
    font-size: 0.9rem;
  }
  .graph-mode-hint {
    bottom: 0.8rem;
  }

  .site-header {
    padding: 1.2rem 5vw 0.8rem;
  }

  .brand a {
    font-size: 1.05rem;
  }

  .site-nav {
    gap: 0.6rem;
  }

  .nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
  }

  .site-footer {
    padding: 0.9rem 5vw 1rem;
    font-size: 0.9rem;
  }
}

.graph-back {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0.5rem;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.theme-dark .graph-modes,
html.theme-dark .graph-search,
html.theme-dark .graph-button,
html.theme-dark .graph-mode-hint {
  background: rgba(28, 33, 40, 0.85);
}



.latest {
  margin: 2.5rem 0 3rem;
}

.post-grid,
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}

.post-card,
.list-card {
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover,
.list-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0.8rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.tag-chip.is-collection {
  border-color: var(--graph-collection);
  color: var(--graph-collection);
}

.tag-chip.is-architecture {
  border-color: var(--graph-architecture);
  color: var(--graph-architecture);
}

.tag-chip.is-series {
  border-color: var(--graph-series);
  color: var(--graph-series);
}

.list-header {
  margin-bottom: 2rem;
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.list-plain li {
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
}

.list-plain a {
  font-weight: 600;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.tree-list--nested {
  margin-top: 0.5rem;
  margin-left: 1.15rem;
  padding-left: 1rem;
  border-left: 1px dashed var(--border);
}

.tree-item {
  position: relative;
}

.tree-item::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.9rem;
  width: 0.7rem;
  height: 1px;
  background: var(--border);
}

.tree-folder {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.15rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 8px 18px var(--shadow);
}

.tree-folder::before {
  content: "▸";
  font-size: 0.8rem;
  color: var(--text-muted);
}

.series-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.series-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
}

.series-link {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.series-link::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.series-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.diff-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 24px var(--shadow);
  overflow: hidden;
  margin: 1rem 0;
}

.diff-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.diff-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
}

.diff-raw {
  display: none;
}

.diff-body {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-x: auto;
}

.diff-line {
  display: grid;
  grid-template-columns: 2.6rem 18px 1fr;
  gap: 0.45rem;
  padding: 0.1rem 0.75rem;
  width: max-content;
  min-width: 100%;
}

.diff-line-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  user-select: none;
}

.diff-prefix {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  user-select: none;
}

.diff-line code {
  line-height: 1.35;
  display: block;
  white-space: pre;
}

.diff-line--split {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.diff-line--split .diff-cell {
  display: grid;
  grid-template-columns: 2.6rem 18px 1fr;
  gap: 0.45rem;
  padding: 0.1rem 0.75rem;
  width: max-content;
  min-width: 100%;
}

.diff-line--split .diff-cell + .diff-cell {
  border-left: 1px solid var(--border);
}

.diff-add {
  background: rgba(55, 188, 115, 0.08);
}

.diff-del {
  background: rgba(214, 72, 72, 0.08);
}

.diff-word-add {
  background: rgba(55, 188, 115, 0.2);
  border-radius: 4px;
  padding: 0 0.08em;
}

.diff-word-del {
  background: rgba(214, 72, 72, 0.2);
  border-radius: 4px;
  padding: 0 0.08em;
}

.code-slider-block {
  margin: 1.2rem 0;
  position: relative;
}

.code-slider-render {
  position: relative;
}

.diff-slider {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 108, 223, 0.08), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(31, 157, 85, 0.08), transparent 55%),
    var(--surface);
  box-shadow: 0 16px 32px var(--shadow);
  overflow: hidden;
  --handle-pos: 50%;
}

.diff-slider {
  scrollbar-width: none;
}

.diff-slider::-webkit-scrollbar {
  display: none;
}

.diff-slider-layer {
  position: relative;
}

.diff-slider-layer--base {
  z-index: 1;
}

.diff-slider-layer--overlay {
  position: absolute;
  inset: 0;
  width: var(--handle-pos);
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.diff-slider--horizontal .diff-slider-layer--overlay {
  width: 100%;
  height: 100%;
  inset: 0;
  clip-path: inset(0 0 calc(100% - var(--handle-pos)) 0);
}

.diff-slider-label {
  position: absolute;
  top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.9;
  pointer-events: none;
  z-index: 4;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.diff-slider-layer--base .diff-slider-label {
  right: 1.1rem;
}

.diff-slider-layer--overlay .diff-slider-label {
  left: 1.1rem;
}

.diff-slider--horizontal .diff-slider-layer--base .diff-slider-label {
  top: auto;
  bottom: 0.65rem;
}

.diff-slider--horizontal .diff-slider-layer--overlay .diff-slider-label {
  top: 0.65rem;
}

.diff-slider-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  min-width: max-content;
}

.code-slider-block .diff-slider-code {
  padding: 3.2rem 1.1rem 1.2rem;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
}

.diff-slider--horizontal .diff-slider-code {
  padding-bottom: 2.6rem;
}

.code-slider-block .diff-slider-code::-webkit-scrollbar {
  display: none;
}

.diff-slider-layer--base .diff-slider-code {
  background: var(--surface);
}

.diff-slider-layer--overlay .diff-slider-code {
  background: var(--surface);
}

.code-slider-block .diff-line {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.6rem;
  padding: 0.12rem 0.7rem;
  border-radius: 8px;
  width: max-content;
  min-width: 100%;
}

.code-slider-block .diff-line:nth-child(2n) {
  background: rgba(45, 52, 67, 0.04);
}

.code-slider-block .diff-line code {
  display: block;
  white-space: pre;
}

.code-slider-block .diff-line-filler {
  visibility: hidden;
}

.diff-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--handle-pos);
  width: 2px;
  background: var(--accent);
  color: var(--accent);
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.diff-slider--horizontal .diff-slider-handle {
  left: 0;
  right: 0;
  top: var(--handle-pos);
  bottom: auto;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
  cursor: ns-resize;
}

.diff-slider-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 18px;
  transform: translateX(-50%);
  background: transparent;
}

.diff-slider--horizontal .diff-slider-handle::before {
  top: 50%;
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  height: 18px;
  transform: translateY(-50%);
}

.diff-slider-handle::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 12px;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(
    to bottom,
    currentColor 0 2px,
    transparent 2px 10px
  );
  opacity: 0.35;
  pointer-events: none;
}

.diff-slider--horizontal .diff-slider-handle::after {
  top: 50%;
  bottom: auto;
  left: 10px;
  right: 10px;
  width: auto;
  height: 12px;
  transform: translateY(-50%);
  background-image: repeating-linear-gradient(
    to right,
    currentColor 0 2px,
    transparent 2px 10px
  );
}

.diff-slider-toggle {
  position: absolute;
  top: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 0.1rem 0.5rem 0.2rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 6;
}

.diff-slider-toggle:hover {
  color: var(--text);
}

html.theme-dark .diff-block {
  background: var(--bg-alt);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

html.theme-dark .diff-word-add {
  background: rgba(63, 185, 80, 0.28);
}

html.theme-dark .diff-word-del {
  background: rgba(240, 70, 70, 0.28);
}

html.theme-dark .diff-slider {
  background:
    radial-gradient(circle at 20% 0%, rgba(88, 166, 255, 0.18), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(63, 185, 80, 0.18), transparent 55%),
    var(--surface);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

html.theme-dark .diff-slider-label {
  background: rgba(14, 18, 23, 0.9);
}

html.theme-dark .diff-slider-layer--base .diff-slider-code {
  background: var(--surface);
}

html.theme-dark .diff-slider-layer--overlay .diff-slider-code {
  background: var(--surface);
}

html.theme-dark .code-slider-block .diff-line:nth-child(2n) {
  background: rgba(240, 246, 252, 0.04);
}

html.theme-dark .post-content .highlight .line:nth-child(2n),
html.theme-dark .post-content .highlight .ln:nth-child(2n),
html.theme-dark .post-content .highlight .lnt:nth-child(2n) {
  background: rgba(240, 246, 252, 0.04);
}

@media (max-width: 820px) {
  .diff-line {
    grid-template-columns: 2.1rem 14px 1fr;
  }

  .diff-line--split {
    grid-template-columns: 1fr;
  }

  .diff-line--split .diff-cell {
    grid-template-columns: 2.1rem 14px 1fr;
  }

  .diff-line--split .diff-cell + .diff-cell {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .code-slider-block .diff-slider-code {
    padding: 2.7rem 0.8rem 1rem;
    font-size: 0.88rem;
  }

  .diff-slider-label {
    top: 0.55rem;
  }

  .diff-slider--horizontal .diff-slider-layer--base .diff-slider-label {
    bottom: 0.55rem;
  }

  .diff-slider-toggle {
    top: 0.55rem;
  }

}

.collections-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 1.6rem;
  padding: 1.4rem 0;
}

.collections-shell--board .collections-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.35rem;
}

.collections-hero p {
  color: var(--text-muted);
  max-width: 780px;
}

.collections-kicker {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.collections-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: start;
}

.kanban-column {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 28px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1rem 1.1rem;
  min-height: 280px;
}

.kanban-column--series {
  background: linear-gradient(135deg, rgba(45, 108, 223, 0.08), rgba(45, 108, 223, 0.02)), var(--surface);
}

.kanban-column__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border);
}

.kanban-title {
  font-weight: 700;
}

.kanban-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.kanban-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.kanban-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.2rem 0.15rem;
  border-bottom: 1px dashed var(--border);
}

.kanban-item:last-child {
  border-bottom: none;
}

.kanban-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

html.theme-dark .kanban-column {
  background: var(--bg-alt);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

html.theme-dark .kanban-column--series {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.03)), var(--bg-alt);
}

.series-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.series-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: var(--surface);
  box-shadow: 0 12px 22px var(--shadow);
}

.series-card__title {
  font-weight: 700;
}

.series-card__count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

html.theme-dark .series-card {
  background: var(--bg-alt);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
}

.post {
  max-width: 860px;
  margin: 0 auto;
}

.post-header h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 0.4rem;
}

.post-content {
  line-height: 1.75;
  color: var(--text-dim);
}

.post-content h2,
.post-content h3 {
  color: var(--text);
}

.post-content pre {
  overflow: auto;
  font-family: var(--font-mono);
  scrollbar-width: none;
}

.post-content pre::-webkit-scrollbar {
  display: none;
}

.post-content pre:not(.chroma) {
  background: var(--surface);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.post-content .highlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  scrollbar-width: none;
}

.post-content .highlight::-webkit-scrollbar {
  display: none;
}

.post-content .highlight pre {
  background: transparent;
  border: 0;
  padding: 0.85rem 0.95rem;
  margin: 0;
}

.post-content .highlight pre code {
  display: block;
  line-height: 1.6;
}

.post-content .highlight code .line {
  display: block;
  padding: 0.08rem 0.3rem 0.08rem 0.1rem;
  border-radius: 6px;
  width: max-content;
  min-width: 100%;
}

.post-content .highlight code .cl {
  display: inline-block;
}

.post-content .highlight .line,
.post-content .highlight .ln,
.post-content .highlight .lnt {
  display: block;
  line-height: 1.6;
}

.post-content .highlight .ln {
  display: inline-block;
  min-width: 2.6rem;
  padding-right: 0.6rem;
  color: var(--text-muted);
  text-align: right;
  user-select: none;
}

.post-content .highlight .line:nth-child(2n),
.post-content .highlight .ln:nth-child(2n),
.post-content .highlight .lnt:nth-child(2n) {
  background: rgba(45, 52, 67, 0.04);
  border-radius: 6px;
}

.code-block--collapsible {
  position: relative;
}

.code-block--collapsible pre {
  margin: 0;
}

.code-block--collapsible .diff-slider {
  margin: 0;
}

.code-block--collapsible.code-block--collapsed pre {
  max-height: calc(var(--code-line-height, 1.6em) * var(--code-lines-collapsed, 12));
  overflow: hidden;
}

.code-slider-block.code-block--collapsed .diff-slider {
  max-height: calc(var(--code-line-height, 1.6em) * var(--code-lines-collapsed, 12));
  overflow: hidden;
}

.code-block-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.2rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--surface));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.code-block--collapsed .code-block-fade {
  opacity: 1;
}

.code-block-toggle {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
}

.code-block-toggle:hover {
  color: var(--text);
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2rem 0;
}

.post-content figure {
  margin: 1.2rem 0;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-dim);
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.post-content blockquote > :first-child {
  margin-top: 0;
}

.post-content blockquote > :last-child {
  margin-bottom: 0;
}

.spoiler {
  display: inline-block;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: transparent;
  text-shadow: 0 0 8px var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.95em;
  line-height: 1.4;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: color 0.2s ease, text-shadow 0.2s ease, border-color 0.2s ease;
}

.spoiler:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.spoiler.spoiler--revealed {
  color: var(--text);
  text-shadow: none;
}

.site-footer {
  padding: 1.2rem 6vw 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  position: relative;
  z-index: 10;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

html.theme-dark {
  --bg: #16181d;
  --bg-alt: #1c2128;
  --surface: #1c2128;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --text-muted: #6e7681;
  --border: #30363d;
  --shadow: rgba(0, 0, 0, 0.4);
  --grid-line: rgba(240, 246, 252, 0.04);
  --graph-paper: #16181d;
  --graph-grid: rgba(240, 246, 252, 0.06);
  --graph-edge: rgba(240, 246, 252, 0.15);
  --graph-tag: #58a6ff;
  --graph-page: #3fb950;
  --graph-year: #d29922;
  --graph-cluster: #f470a7;
  --graph-subject: #7db7ff;
  --graph-collection: #e07a3a;
  --graph-architecture: #2bb1a7;
  --graph-series: #b89a3f;
}

html.theme-dark body {
  background-color: #16181d;
  background-image:
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

html.theme-dark .latest-panel {
  background: transparent;
}

html.theme-dark .latest-list a {
  background: rgba(28, 33, 40, 0.8);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-collapsed .site-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.nav-collapsed .site-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(78vw, 320px);
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 5rem 1.4rem 1.6rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 30px var(--shadow);
  transform: translate3d(100%, 0, 0);
  will-change: transform;
  transition: transform 0.25s ease;
  z-index: 45;
}

.nav-collapsed .site-nav.is-open {
  transform: translateX(0);
}

.nav-collapsed .nav-link {
  font-size: 1rem;
}

.nav-collapsed .nav-toggle {
  display: inline-flex;
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero {
    min-height: auto;
    padding-right: 0;
  }

  .latest-panel {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 1.2rem;
  }
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 1rem;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 5rem 1.4rem 1.6rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 30px var(--shadow);
    transform: translate3d(100%, 0, 0);
    will-change: transform;
    transition: transform 0.25s ease;
    z-index: 45;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .graph-panel {
    display: none;
  }

  .hero {
    margin-bottom: 2rem;
  }

  .site-header,
  .page-main {
    padding-left: 5vw;
    padding-right: 5vw;
  }
}

.highlight {
    line-height: 1.0;
}

/* Chroma Syntax Highlighting */

/* Base wrapper resets */
.chroma {
  color: var(--text);
  background-color: transparent;
  display: block;
}

/* Error */
.chroma .err { color: #a61717; background-color: #e3d2d2; }
html.theme-dark .chroma .err { color: #f85149; background-color: #3e1f1f; }

/* Line Table */
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
.chroma .hl { display: block; width: 100%; background-color: #ffffcc; }
html.theme-dark .chroma .hl { background-color: #363325; }
.chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #6e7681; user-select: none; }
.chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #6e7681; user-select: none; }

/* Keywords */
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: #d73a49; font-weight: 600; }
html.theme-dark .chroma .k, html.theme-dark .chroma .kc, html.theme-dark .chroma .kd, html.theme-dark .chroma .kn, html.theme-dark .chroma .kp, html.theme-dark .chroma .kr, html.theme-dark .chroma .kt { color: #ff7b72; }

/* Names (Default) */
.chroma .n { color: #24292e; }
html.theme-dark .chroma .n { color: #c9d1d9; }

/* Functions */
.chroma .nf, .chroma .fm { color: #6f42c1; }
html.theme-dark .chroma .nf, html.theme-dark .chroma .fm { color: #d2a8ff; }

/* Classes / Types */
.chroma .nc { color: #005cc5; font-weight: 600; }
html.theme-dark .chroma .nc { color: #f0883e; font-weight: 600; }

/* Strings */
.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl, .chroma .sd, .chroma .s2, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .s1, .chroma .ss { color: #032f62; }
html.theme-dark .chroma .s, html.theme-dark .chroma .sa, html.theme-dark .chroma .sb, html.theme-dark .chroma .sc, html.theme-dark .chroma .dl, html.theme-dark .chroma .sd, html.theme-dark .chroma .s2, html.theme-dark .chroma .se, html.theme-dark .chroma .sh, html.theme-dark .chroma .si, html.theme-dark .chroma .sx, html.theme-dark .chroma .sr, html.theme-dark .chroma .s1, html.theme-dark .chroma .ss { color: #a5d6ff; }

/* Comments */
.chroma .c, .chroma .ch, .chroma .cm, .chroma .cp, .chroma .cpf, .chroma .c1, .chroma .cs { color: #6a737d; font-style: italic; }
html.theme-dark .chroma .c, html.theme-dark .chroma .ch, html.theme-dark .chroma .cm, html.theme-dark .chroma .cp, html.theme-dark .chroma .cpf, html.theme-dark .chroma .c1, html.theme-dark .chroma .cs { color: #8b949e; }

/* Numbers */
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo { color: #005cc5; }
html.theme-dark .chroma .m, html.theme-dark .chroma .mb, html.theme-dark .chroma .mf, html.theme-dark .chroma .mh, html.theme-dark .chroma .mi, html.theme-dark .chroma .il, html.theme-dark .chroma .mo { color: #79c0ff; }

/* Operators */
.chroma .o, .chroma .ow { color: #d73a49; font-weight: 600; }
html.theme-dark .chroma .o, html.theme-dark .chroma .ow { color: #ff7b72; }

/* Tags (HTML/XML) */
.chroma .nt { color: #22863a; }
html.theme-dark .chroma .nt { color: #7ee787; }

/* Attributes */
.chroma .na { color: #6f42c1; }
html.theme-dark .chroma .na { color: #79c0ff; }

/* Variables */
.chroma .nv, .chroma .vc, .chroma .vg, .chroma .vi { color: #24292e; }
html.theme-dark .chroma .nv, html.theme-dark .chroma .vc, html.theme-dark .chroma .vg, html.theme-dark .chroma .vi { color: #79c0ff; }

/* Constants */
.chroma .no { color: #005cc5; }
html.theme-dark .chroma .no { color: #79c0ff; }

/* Tables */
table {
  margin-left: auto;
  margin-right: auto;
}

/* Mermaid */
.mermaid {
  display: flex;
  justify-content: center;
  max-width: 60%;
  margin: 1.5rem auto;
}

.mermaid svg {
  max-width: 70% !important;
  height: auto !important;
}
