:root {
  --bg: #f8fafc;
  --bg-soft: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --text: #111827;
  --text-soft: #4b5563;
  --muted: #6f7a8c;
  --line: #e4e9f2;
  --accent: #1d4ed8;
  --accent-2: #173ea8;
  --accent-soft: #edf3ff;
  --code-bg: #f4f7fb;
  --heat-0: #edf1f8;
  --heat-2: #b9cef2;
  --heat-3: #6c93dd;
  --heat-4: #1d4ed8;
  --shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 10px 24px rgba(17, 24, 39, 0.08);
  --radius: 10px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", STSong, "SimSun", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0d1420;
  --bg-soft: #121b2b;
  --surface: #141e30;
  --surface-2: #1a2538;
  --text: #e8edf7;
  --text-soft: #b4c0d4;
  --muted: #8492aa;
  --line: #263349;
  --accent: #7fa4f0;
  --accent-2: #5e86dc;
  --accent-soft: #1b2a45;
  --code-bg: #101827;
  --heat-0: #1b2536;
  --heat-2: #2c4470;
  --heat-3: #4a72b8;
  --heat-4: #8ab0f5;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.40);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1400px, 100% - 40px);
  margin-inline: auto;
}

.shell {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 132px;
  gap: 24px;
  align-items: start;
}

.main { min-width: 0; }

.rail {
  position: sticky;
  top: 92px;
  min-height: 320px;
  border-radius: 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.nav a {
  position: relative;
  padding: 7px 10px;
  color: var(--text-soft);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: transparent;
}

.nav-more {
  position: relative;
}

.nav-more summary {
  list-style: none;
  padding: 7px 10px;
  color: var(--text-soft);
  font-size: 13.5px;
  cursor: pointer;
}

.nav-more summary:hover,
.nav-more summary.active {
  color: var(--accent);
}

.nav-more summary::-webkit-details-marker { display: none; }

.nav-more[open] summary {
  color: var(--accent);
}

.nav-more__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 148px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-more__menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
}

.nav a.active::after {
  background: var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle.is-switching svg { animation: theme-icon 620ms cubic-bezier(.22, 1, .36, 1); }

@keyframes theme-icon {
  0% { transform: rotate(0deg) scale(1); opacity: 1; }
  45% { transform: rotate(80deg) scale(0.72); opacity: 0.45; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

.mobile-toggle { display: none; }

.mobile-nav {
  display: none;
  padding: 8px 0 18px;
  border-top: 1px solid var(--line);
}

.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  padding: 11px 6px;
  color: var(--text-soft);
  border-bottom: 1px dashed var(--line);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a.active, .mobile-more summary.active { color: var(--accent); font-weight: 600; }
.mobile-more summary {
  padding: 11px 6px;
  color: var(--text-soft);
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}
.mobile-more summary::-webkit-details-marker { display: none; }
.mobile-more a { padding-left: 22px; }

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  padding: 60px 0 40px;
}

.hero__aside {
  flex: 0 0 560px;
  min-width: 0;
}

.hero__main {
  min-width: 0;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.3rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.hero h1 .grad {
  color: var(--text);
}

.hero__lead {
  max-width: 640px;
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.95;
}

.hero__intro {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-2); color: #fff; }

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.hero__stat {
  padding: 0 18px;
  border-left: 1px solid var(--line);
}

.hero__stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.activity {
  position: relative;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.activity__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.activity__title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.activity__chart { display: block; }

.activity__scroll {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.activity__scroll::-webkit-scrollbar { display: none; }

.activity__months {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1;
}

.activity__months span { white-space: nowrap; }

.activity__grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, auto);
  gap: 3px;
}

.hm {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--heat-0);
}

.hm--blank { background: transparent; }
.hm--2 { background: var(--heat-2); }
.hm--3 { background: var(--heat-3); }
.hm--4 { background: var(--heat-4); }

.activity__grid .hm { transition: box-shadow 0.16s ease, background-color 0.16s ease; }

.activity__grid .hm:hover {
  z-index: 3;
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--accent);
}

.hm[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.hm[data-tip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.activity__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.activity__legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.activity__legend .hm {
  width: 9px;
  height: 9px;
  aspect-ratio: auto;
}

.hero__stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
}

.hero__stat span { color: var(--muted); font-size: 11.5px; letter-spacing: 0.1em; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
}

.section-head h2 {
  position: relative;
  margin: 0;
  padding-left: 13px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.section-head a { color: var(--muted); font-size: 13px; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: var(--shadow-lg);
}

.card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card__cover img { transform: scale(1.045); }

.card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }

.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.card__title {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.5;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  white-space: nowrap;
}

.chip--ghost { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip--top { border-color: var(--accent); background: var(--accent); color: #fff; }

.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-row {
  cursor: pointer;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-row:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: var(--shadow);
}

.post-row__cover {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
}

.post-row__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.55s ease; }
.post-row:hover .post-row__cover img { transform: scale(1.04); }

.post-row__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 4px 4px 4px 0; }

.post-row__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-row__desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-row__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: auto; color: var(--muted); font-size: 12.5px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 34px 0 8px; }
.pager a, .pager span {
  min-width: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  text-align: center;
  font-size: 13.5px;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .is-current { border-color: transparent; background: var(--accent); color: #fff; }
.pager .is-disabled { opacity: 0.4; }

.page-head { padding: 42px 0 10px; }
.page-head h1 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.8rem); }
.page-head p { margin: 0; color: var(--text-soft); max-width: 720px; }
.page-head__meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 13px; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 26px; color: var(--muted); font-size: 12.5px; }
.breadcrumb a:hover { color: var(--accent); }

.article-head { padding: 18px 0 26px; }
.article-head h1 { margin: 0 0 18px; font-family: var(--serif); font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.25; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; color: var(--muted); font-size: 13px; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.article-meta .author { color: var(--text); font-weight: 600; }

.article-cover { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-cover img { width: 100%; max-height: 460px; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 40px; align-items: start; }
.article-side { position: sticky; top: 92px; }

.prose { color: var(--text-soft); font-size: 16.5px; line-height: 1.95; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); font-family: var(--serif); line-height: 1.4; scroll-margin-top: 90px; }
.prose h2 { margin: 2.1em 0 0.7em; font-size: 1.55em; }
.prose h3 { margin: 1.8em 0 0.6em; font-size: 1.26em; }
.prose h4 { margin: 1.6em 0 0.5em; font-size: 1.1em; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
  color: var(--text-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { margin: 1.4em auto; border-radius: 14px; box-shadow: var(--shadow); }
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px dashed var(--line); }

.prose code {
  padding: 0.16em 0.42em;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88em;
}

.prose pre {
  position: relative;
  margin: 1.5em 0;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--code-bg);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

.prose pre code { padding: 0; background: transparent; font-size: inherit; }

.prose table { width: 100%; margin: 1.5em 0; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 13px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; }

.prose .shiki { background: var(--code-bg) !important; }
html[data-theme="dark"] .prose .shiki,
html[data-theme="dark"] .prose .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
}

.toc { border-left: 1px solid var(--line); padding-left: 16px; font-size: 13px; }
.toc__title { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; }
.toc a { display: block; padding: 4px 0; color: var(--muted); line-height: 1.5; }
.toc a:hover, .toc a.is-active { color: var(--accent); }

.author-box {
  display: flex;
  gap: 16px;
  margin: 42px 0 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.author-box__avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-size: 22px;
}

.author-box__name { margin: 0 0 4px; font-weight: 650; }
.author-box__desc { margin: 0; color: var(--text-soft); font-size: 13.5px; line-height: 1.75; }
.author-box__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--accent); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 30px 0; }
.post-nav a {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav span { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: 0.12em; }
.post-nav strong { display: block; margin-top: 6px; font-size: 14px; line-height: 1.5; font-weight: 600; }
.post-nav a.is-next { text-align: right; }

.related { margin-top: 30px; }
.related h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 14px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row a {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12.5px;
  transition: all 0.2s ease;
}
.chip-row a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }


.search-box {
  display: flex;
  gap: 10px;
  margin: 20px 0 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-box button {
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.search-hint { color: var(--muted); font-size: 13px; }

.empty {
  padding: 54px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.site-footer {
  margin-top: 74px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, var(--bg));
}

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px; padding: 40px 0 28px; }
.footer-col h3 { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.footer-col a { display: block; padding: 5px 0; color: var(--text-soft); font-size: 13.5px; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.footer-bottom a:hover { color: var(--accent); }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.12s linear;
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-in { opacity: 1; transform: none; }

.error-page { padding: 90px 0 40px; text-align: center; }
.error-page__code { margin: 0; font-family: var(--serif); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--accent); }
.error-page h1 { margin: 12px 0 10px; font-family: var(--serif); font-size: 1.6rem; }
.error-page p { margin: 0 auto 24px; max-width: 480px; color: var(--muted); }

.stat-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }

@view-transition { navigation: auto; }

@media (max-width: 1360px) {
  .wrap { width: min(1180px, 100% - 40px); }
  .shell { grid-template-columns: 112px minmax(0, 1fr) 112px; gap: 20px; }
}

@media (max-width: 1279px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .wrap { width: min(1080px, 100% - 40px); }
}

@media (max-width: 1024px) {
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: none; }
}

@media (max-width: 1439px) {
  .hero { flex-direction: column; align-items: stretch; gap: 32px; }
  .hero__aside { flex: 0 0 auto; width: 100%; max-width: 720px; }
}

@media (max-width: 560px) {
  .activity__scroll { overflow-x: auto; scrollbar-width: none; }
  .activity__scroll::-webkit-scrollbar { display: none; }
  .hero__stat { padding: 0 12px; }
  .hero__stat strong { font-size: 26px; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .hero { flex-direction: column; align-items: stretch; gap: 30px; }
  .hero__aside { flex: 0 0 auto; width: 100%; }
  .hero__stats { margin-top: 0; }
  .mobile-toggle { display: inline-flex; }
  .header-inner { height: 62px; justify-content: flex-end; }
}

@media (max-width: 768px) {
  body { font-size: 15.5px; }
  .wrap { width: calc(100% - 32px); }
  .hero { padding: 40px 0 24px; }
  .hero__lead { font-size: 15.5px; }
  .hero__stats { gap: 22px; margin-top: 0; }
  .hero__stat strong { font-size: 22px; }
  .featured-grid, .related-grid { grid-template-columns: minmax(0, 1fr); }
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .post-row__cover { aspect-ratio: 16 / 9; }
  .post-row__body { padding: 2px 4px 6px; }
  .post-row__title { font-size: 16.5px; }
  .article-head { padding-top: 10px; }
  .article-head h1 { font-size: 1.75rem; }
  .article-meta { gap: 8px 12px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav a.is-next { text-align: left; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 34px; }
  .footer-bottom { justify-content: flex-start; }
  .author-box { padding: 16px; }
  .prose { font-size: 16px; }
  .prose pre { padding: 14px; font-size: 12.5px; }
}

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

@media print {
  .site-header, .site-footer, .rail, .article-side, .progress-bar, .post-nav, .related { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { width: 100%; }
}

.prose pre .code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.prose pre:hover .code-copy { opacity: 1; }
.prose pre .code-copy:hover { color: var(--accent); }
