:root {
  color-scheme: light dark;
  --canvas: #ffffff;
  --foreground: #202124;
  --body: #414441;
  --prose: #353735;
  --muted: rgba(32, 33, 36, 0.58);
  --faint: rgba(32, 33, 36, 0.38);
  --focus: rgba(32, 33, 36, 0.62);
  --ghost: rgba(32, 33, 36, 0.14);
  --selection: rgba(56, 118, 255, 0.18);
  --measure: 680px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-family: var(--font-ui);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #181918;
    --foreground: #f1f2ef;
    --body: #c6c8c4;
    --prose: #d9dbd7;
    --muted: rgba(241, 242, 239, 0.62);
    --faint: rgba(241, 242, 239, 0.4);
    --focus: rgba(241, 242, 239, 0.72);
    --ghost: rgba(241, 242, 239, 0.14);
    --selection: rgba(113, 155, 255, 0.28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--foreground); }
::selection { background: var(--selection); }
a { color: inherit; text-decoration: none; }
a:focus-visible, input:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 5px;
}

.shell { width: min(calc(100% - 48px), var(--measure)); margin-inline: auto; }
.view { padding: 70px 0 116px; }
.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;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
.home-view .page-header { margin-bottom: 92px; }
.index-view .page-header { margin-bottom: 48px; }
.home-title {
  margin: 0;
  font-size: 28px;
  font-weight: 720;
  line-height: 1.1;
}

.global-nav {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  margin-top: 76px;
  margin-left: -10px;
}
.page-header .global-nav {
  flex: none;
  justify-content: flex-end;
  margin: -10px -10px 0 0;
}
.icon-link {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
}
.icon-link:hover, .icon-link[aria-current="page"] { color: var(--foreground); }
.icon-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .global-nav, .empty-home-nav, .pagination, .search-form { display: none; }
  .view { padding-top: 0; }
}
@media (max-width: 720px) {
  .page-header { flex-direction: column-reverse; gap: 34px; }
  .page-header .global-nav { align-self: flex-end; }
}
.topic-stream { display: grid; gap: 76px; }
.topic-title, .article-title, .page-title, .year-title, .category-link { text-wrap: balance; }
.topic-title {
  margin: 0 0 15px;
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.026em;
  line-height: 1.34;
}
.home-view.is-empty {
  position: relative;
  min-height: 100svh;
  padding: 70px 0 54px;
}
.home-view.is-empty .page-header { display: block; margin: 0; }
.empty-home-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 510;
  line-height: 1.4;
}
.empty-home-nav a:hover, .empty-home-nav a[aria-current="page"] { color: var(--foreground); }
.empty-publish-state {
  position: absolute;
  top: 48%;
  left: 0;
  min-height: 160px;
  transform: translateY(-50%);
}
.empty-publish-activity {
  color: var(--ghost);
  font-family: "SF Pro Display", var(--font-ui);
  font-size: clamp(68px, 9.4vw, 144px);
  font-weight: 480;
  letter-spacing: normal;
  line-height: 1.02;
  white-space: nowrap;
}
.topic-title a:hover, .continuation:hover, .index-title:hover, .category-link:hover,
.tag-link:hover, .meta a:hover, .search-results a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.topic-segment { color: var(--body); font-size: 17px; line-height: 1.8; text-wrap: pretty; }
.topic-segment > * { margin: 0; }
.topic-segment > :last-child { display: inline; }
.continuation { display: inline; margin-left: 0.14em; color: var(--foreground); font-weight: 620; }

.pagination {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin-top: 92px;
}
.pagination + .global-nav { margin-top: 46px; }
.page-arrow { display: grid; width: 44px; height: 44px; place-items: center; font-size: 25px; line-height: 1; }
.page-arrow:hover { transform: translateX(var(--arrow-shift, 0)); }
.page-arrow.is-left { --arrow-shift: -3px; }
.page-arrow.is-right { --arrow-shift: 3px; margin-left: auto; }

.article-title { margin: 0; font-size: 26px; font-weight: 680; letter-spacing: -0.034em; line-height: 1.24; }
.prose { margin-top: 38px; color: var(--prose); font-size: 17px; line-height: 1.8; text-wrap: pretty; }
.prose > * { margin: 0 0 1.52em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin: 2.85em 0 0.78em;
  color: var(--foreground);
  font-weight: 670;
  letter-spacing: -0.024em;
  line-height: 1.38;
}
.prose h2 { font-size: 20px; }
.prose h3 { font-size: 18px; }
.prose blockquote { margin-inline: 0; color: var(--body); font-size: 18px; line-height: 1.76; }
.prose pre { overflow-x: auto; font-family: var(--font-mono); font-size: 0.88em; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 5px 14px 5px 0; text-align: left; }
.prose img, .prose video { max-width: 100%; height: auto; }

.meta {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 7px;
  margin-top: 82px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.meta-key { min-width: 62px; color: var(--faint); }
.meta-values { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.article-footer .global-nav { margin-top: 54px; }

.page-title { margin: 0; font-size: 25px; font-weight: 680; letter-spacing: -0.034em; line-height: 1.25; }
.year-groups { display: grid; gap: 58px; }
.year-group { display: grid; gap: 22px; }
.year-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.3; }
.index-list, .category-list, .search-results { display: grid; gap: 17px; margin: 0; padding: 0; list-style: none; }
.index-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: baseline; gap: 18px; }
.index-date { color: var(--faint); font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.index-title { font-size: 16px; font-weight: 520; line-height: 1.5; }
.category-list { gap: 25px; }
.category-link { font-size: 20px; font-weight: 590; letter-spacing: -0.022em; line-height: 1.4; }
.tag-cloud { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px 25px; }
.tag-link { color: var(--body); font-size: 17px; line-height: 1.4; }
.tag-link[data-count="1"] { color: var(--muted); font-size: 15px; }
.tag-link[data-count="3"] { color: var(--foreground); font-size: 20px; font-weight: 590; }

.search-form { margin: 0 0 52px; }
.search-field {
  width: 100%;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 22px;
}
.search-field::placeholder { color: var(--faint); }
.search-field::-webkit-search-cancel-button { opacity: 0.45; }
.search-help, .search-empty { margin: 9px 0 0; color: var(--faint); font-size: 12px; }
.search-results { gap: 21px; }
.search-results a { font-size: 17px; font-weight: 540; line-height: 1.45; }

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 32px), var(--measure)); }
  .view { padding: 48px 0 88px; }
  .home-view .page-header { margin-bottom: 72px; }
  .home-title { font-size: 25px; }
  .home-view.is-empty { padding: 48px 0 40px; }
  .topic-stream { gap: 62px; }
  .topic-title { margin-bottom: 12px; font-size: 19px; }
  .empty-home-nav { gap: 10px 18px; margin-top: 18px; font-size: 13px; }
  .empty-publish-state { top: 47%; min-height: 84px; }
  .empty-publish-activity { font-size: clamp(58px, 18vw, 88px); }
  .topic-segment { font-size: 16.5px; line-height: 1.8; }
  .pagination { margin-top: 70px; }
  .article-title, .page-title { font-size: 24px; }
  .prose { margin-top: 32px; font-size: 16.5px; line-height: 1.8; }
  .year-groups { gap: 48px; }
  .index-row { grid-template-columns: 48px minmax(0, 1fr); gap: 13px; }
  .index-date { font-size: 11px; }
  .index-title { font-size: 15.5px; }
  .tag-cloud { gap: 16px 21px; }
  .search-field { font-size: 20px; }
  .icon-link { width: 44px; height: 44px; }
  .global-nav { gap: 0; margin-left: -13px; }
  .page-header .global-nav { margin-right: -13px; }
}