/* 星源手记 —— 主样式
   纸、墨、锈红。没有外部字体和框架。 */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --paper-3: #e7dccb;
  --ink: #1c1a17;
  --ink-2: #51493e;
  --muted: #877b6b;
  --faint: #b3a897;
  --line: rgba(28, 26, 23, 0.14);
  --line-strong: rgba(28, 26, 23, 0.3);
  --accent: #b4472e;
  --accent-2: #8d3423;
  --accent-soft: rgba(180, 71, 46, 0.1);
  --code-bg: #1a1714;
  --code-ink: #e9e1d3;
  --shadow: 0 18px 60px rgba(40, 32, 22, 0.12);
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "FandolSong", Georgia, serif;
  --sans: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --max: 1180px;
  --read: 720px;
}

[data-theme="dark"] {
  --paper: #15130f;
  --paper-2: #1e1a15;
  --paper-3: #28231c;
  --ink: #ece4d6;
  --ink-2: #c6baa8;
  --muted: #938775;
  --faint: #6d6355;
  --line: rgba(236, 228, 214, 0.13);
  --line-strong: rgba(236, 228, 214, 0.28);
  --accent: #e07050;
  --accent-2: #ee8a6c;
  --accent-soft: rgba(224, 112, 80, 0.12);
  --code-bg: #0d0c0a;
  --code-ink: #eee6d8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 38vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(180, 71, 46, 0.06), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

.icon {
  display: inline-block;
  vertical-align: -0.15em;
  flex: none;
}

.muted {
  color: var(--muted);
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
  display: inline-block;
  flex: none;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

[data-theme="dark"] .paper-grain {
  mix-blend-mode: screen;
  opacity: 0.035;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 10000;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

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

/* ───────── 顶栏 ───────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.header-inner {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(-2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-title {
  font-family: var(--serif);
  font-size: 1.03rem;
  letter-spacing: 0.1em;
  line-height: 1.2;
  font-weight: 600;
}

.brand-sub {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--muted);
  line-height: 1.4;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  font-size: 0.88rem;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  right: 0;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.theme-toggle .theme-icon {
  grid-area: 1 / 1;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

[data-theme="light"] .theme-moon {
  opacity: 0;
  transform: rotate(40deg);
}

[data-theme="dark"] .theme-sun {
  opacity: 0;
  transform: rotate(-40deg);
}

.menu-toggle {
  display: none;
}

/* ───────── 主区域 ───────── */

.site-main {
  min-height: 60vh;
}

.home-wrap,
.page-wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  padding: 92px 0 64px;
  max-width: 980px;
}

.hero-kicker,
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  margin: 28px 0 26px;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6.2vw, 5.4rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.hero-lede {
  max-width: 580px;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.9;
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-stat::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--faint);
}

.hero-link {
  margin-left: auto;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.hero-link:hover {
  color: var(--accent);
  gap: 13px;
}

/* ───────── 置顶 ───────── */

.featured {
  margin-bottom: 78px;
}

.feature-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.feature-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.feature-card {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 46px;
  align-items: center;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.feature-cover {
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 16 / 10;
}

.feature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
  filter: saturate(0.92);
}

.feature-card:hover .feature-img {
  transform: scale(1.035);
  filter: saturate(1.02);
}

.feature-copy h2 {
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.feature-card:hover .feature-copy h2 {
  color: var(--accent);
}

.feature-copy > p {
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}

/* ───────── 首页列表 ───────── */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 78px;
  padding-bottom: 60px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.section-link:hover,
.text-link:hover {
  color: var(--accent);
}

.post-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 178px;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.post-row:last-of-type {
  border-bottom: 0;
}

.row-num {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--faint);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 7px;
}

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px 1px;
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

a.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tag-sm {
  font-size: 0.62rem;
  padding: 1px 6px;
}

.row-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.row-title a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.2s ease, background-size 0.3s ease;
}

.row-title a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

.row-excerpt {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.row-cover {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 2px;
}

.row-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9);
  transition: transform 0.6s ease, filter 0.3s ease;
}

.row-cover:hover .row-cover-img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--paper-2), var(--paper-3));
  color: var(--faint);
  font-family: var(--serif);
  font-size: 2.4rem;
}

/* ───────── 侧栏 ───────── */

.sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
}

.side-block {
  padding: 23px 0;
  border-top: 1px solid var(--line);
}

.side-block:first-child {
  border-top-color: var(--line-strong);
}

.side-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 14px;
}

.now-list {
  list-style: none;
  display: grid;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--ink-2);
}

.now-list li {
  position: relative;
  padding-left: 15px;
}

.now-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 8px;
}

.tag-cloud-item {
  font-size: 0.78rem;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
  padding: 1px 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tag-cloud-item sup {
  font-size: 0.58em;
  color: var(--faint);
  margin-left: 2px;
  vertical-align: 1px;
}

.tag-cloud-item:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-cloud-item.weight-3,
.tag-cloud-item.weight-4 {
  font-family: var(--serif);
  font-size: 0.94rem;
}

.tag-cloud-item.weight-4 {
  font-size: 1.06rem;
}

.side-subscribe p,
.side-about p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--accent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ───────── 分页 ───────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}

.page-btn.is-disabled {
  color: var(--faint);
  opacity: 0.5;
}

.page-btn:hover:not(.is-disabled) {
  color: var(--accent);
}

.page-nums {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-num.is-current {
  background: var(--ink);
  color: var(--paper);
}

.page-num:hover:not(.is-current) {
  color: var(--accent);
}

.page-gap {
  color: var(--faint);
  padding: 0 2px;
}

/* ───────── 页头 / 归档 / 标签 ───────── */

.page-wrap {
  padding: 76px 0 100px;
}

.page-head {
  max-width: 780px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 42px;
}

.page-head h1 {
  margin: 18px 0 12px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-lede {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.85;
}

.archive-year {
  margin-bottom: 46px;
}

.archive-year-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.archive-year-title span {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.archive-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.archive-item time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.archive-main h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.5;
}

.archive-main h3 a:hover {
  color: var(--accent);
}

.archive-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.archive-sub .tag {
  font-size: 0.62rem;
}

.tag-page-cloud {
  padding: 10px 0 42px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.tag-page-cloud .tag-cloud {
  gap: 14px 22px;
}

.tag-page-cloud .tag-cloud-item {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.tag-page-cloud .tag-cloud-item.weight-4 {
  font-size: 2rem;
}

.tag-page-cloud .tag-cloud-item.weight-3 {
  font-size: 1.55rem;
}

.tag-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 40px;
}

.tag-index-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.tag-index-name {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.tag-index-item:hover .tag-index-name {
  color: var(--accent);
}

.tag-index-count {
  font-size: 0.7rem;
  color: var(--muted);
  align-self: center;
}

.tag-index-latest {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-hash {
  color: var(--accent);
  font-weight: 400;
}

.post-list-tag {
  max-width: 900px;
}

.back-link {
  margin-top: 34px;
  font-size: 0.8rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

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

/* ───────── 文章 ───────── */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.08s linear;
}

.post-layout {
  width: min(1030px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, var(--read)) 200px;
  gap: 76px;
  justify-content: center;
  padding: 76px 0 0;
}

.post-header {
  padding-bottom: 4px;
}

.post-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--muted);
}

.post-kicker .row-tags {
  margin: 0;
}

.post-title {
  margin: 20px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.6vw, 3.7rem);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.post-dek {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.85;
  margin-bottom: 28px;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.byline-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.byline-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.byline-text b {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 600;
}

.byline-text .post-meta {
  margin: 0;
  font-size: 0.68rem;
}

.post-meta-inline {
  display: flex;
  flex-wrap: wrap;
}

.share-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.post-cover {
  margin: 36px 0 44px;
  overflow: hidden;
  background: var(--paper-2);
}

.post-cover-img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-body {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.98;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.post-body > *:first-child {
  margin-top: 0;
}

.post-body p {
  margin: 1.25em 0;
}

.post-body > p:first-of-type::first-letter {
  float: left;
  font-size: 3.35em;
  line-height: 0.86;
  padding: 0.04em 0.12em 0 0;
  color: var(--accent);
  font-weight: 600;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  position: relative;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  scroll-margin-top: 100px;
}

.post-body h2 {
  font-size: 1.55rem;
  margin: 2.5em 0 0.75em;
}

.post-body h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

.post-body h3 {
  font-size: 1.2rem;
  margin: 2em 0 0.6em;
}

.post-body h4 {
  font-size: 1.02rem;
  margin: 1.8em 0 0.5em;
}

.header-anchor {
  position: absolute;
  left: -1.25em;
  top: 0;
  color: var(--accent);
  opacity: 0;
  font-family: var(--sans);
  font-size: 0.7em;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.post-body h2:hover .header-anchor,
.post-body h3:hover .header-anchor,
.post-body h4:hover .header-anchor {
  opacity: 0.6;
}

.post-body a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}

.post-body a:hover {
  text-decoration-color: var(--accent);
}

.post-body strong {
  font-weight: 700;
}

.post-body em {
  font-style: italic;
}

.post-body del {
  color: var(--muted);
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
}

.post-body blockquote p {
  margin: 0.5em 0;
}

.post-body ul,
.post-body ol {
  margin: 1.1em 0;
  padding-left: 1.4em;
}

.post-body li {
  margin: 0.4em 0;
  padding-left: 0.2em;
}

.post-body li::marker {
  color: var(--accent);
}

.post-body hr {
  border: 0;
  height: 2em;
  margin: 2.2em 0;
  position: relative;
}

.post-body hr::before {
  content: "· · ·";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  letter-spacing: 0.4em;
  font-family: var(--sans);
  font-size: 0.8rem;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.post-body .code-wrap {
  position: relative;
  margin: 1.6em 0;
}

.post-body pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 22px 22px;
  overflow-x: auto;
  border-radius: 3px;
  font-size: 0.82rem;
  line-height: 1.75;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

.post-body pre::after {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.code-wrap:hover .code-copy {
  opacity: 1;
}

.code-copy:hover {
  color: #fff;
}

.post-body .table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.7;
}

.post-body th,
.post-body td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-body th {
  background: var(--paper-2);
  font-weight: 600;
  white-space: nowrap;
}

.post-body figure {
  margin: 1.8em 0;
}

.post-body figure img {
  display: block;
  width: 100%;
  border-radius: 2px;
}

.post-body figcaption {
  margin-top: 8px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
}

.post-end {
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
  text-align: center;
}

.end-mark {
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.post-end-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.post-updated {
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--faint);
}

.back-top {
  margin-top: 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.back-top:hover {
  color: var(--accent);
}

.post-toc {
  position: sticky;
  top: 104px;
  align-self: start;
  padding-top: 8px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

.toc-title {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-toc nav {
  display: grid;
  gap: 7px;
}

.toc-link {
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -22px;
  padding-left: 20px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-link:hover {
  color: var(--ink);
}

.toc-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-depth-3 {
  padding-left: 30px;
  font-size: 0.7rem;
}

.post-nav {
  width: min(1030px, calc(100% - 48px));
  margin: 72px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px;
  background: var(--paper);
  transition: background-color 0.2s ease;
}

.post-nav-item:hover {
  background: var(--paper-2);
}

.post-nav-next {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.post-nav-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.5;
}

.post-nav-item:hover .post-nav-title {
  color: var(--accent);
}

.post-nav-item.is-empty {
  background: var(--paper);
}

/* ───────── 评论 ───────── */

.comments {
  width: min(var(--read), calc(100% - 48px));
  margin: 74px auto 100px;
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.comments-head h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.comment-count {
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--accent);
  margin-left: 4px;
}

.comments-head p {
  font-size: 0.72rem;
  color: var(--muted);
}

.comment-list {
  display: grid;
}

.comment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--accent);
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-name {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 600;
}

.comment-name a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.comment-head time {
  font-size: 0.66rem;
  color: var(--faint);
  font-family: var(--mono);
}

.comment-text {
  margin-top: 5px;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.comment-empty {
  padding: 26px 0;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.comment-form {
  margin-top: 32px;
  padding: 26px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.comment-form label,
.field {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.comment-form input,
.comment-form textarea,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 11px;
  border-radius: 2px;
  font-size: 0.86rem;
  line-height: 1.6;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}

.comment-form textarea,
.field textarea {
  resize: vertical;
  min-height: 84px;
}

.optional {
  font-size: 0.64rem;
  color: var(--faint);
  font-weight: 400;
}

.comment-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.comment-note {
  font-size: 0.68rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 9px 20px;
  border-radius: 2px;
  font-size: 0.8rem;
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line-strong);
}

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

.btn-danger {
  background: transparent;
  color: #a33b2a;
  border-color: rgba(163, 59, 42, 0.35);
}

.btn-danger:hover {
  background: #a33b2a;
  border-color: #a33b2a;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.72rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.64rem;
}

.btn-wide {
  width: 100%;
}

.form-status {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--muted);
}

.form-status.is-error {
  color: #a33b2a;
}

.form-status.is-ok {
  color: #3e6b4f;
}

/* ───────── 关于 ───────── */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 80px;
}

.about-body {
  font-size: 1.06rem;
}

.about-side {
  align-self: start;
}

.about-card {
  padding: 28px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.about-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.2rem;
  margin-bottom: 18px;
}

.about-card h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.about-card p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
}

.about-links {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--ink-2);
}

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

.about-updated {
  margin-top: 12px;
  font-size: 0.68rem;
  color: var(--faint);
  text-align: right;
}

/* ───────── 搜索 ───────── */

.search-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-radius: 3px;
  overflow: hidden;
}

.search-dialog::backdrop {
  background: rgba(20, 16, 12, 0.45);
  backdrop-filter: blur(3px);
}

.search-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.search-head input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--ink);
  padding: 4px 0;
}

.search-head input:focus {
  outline: none;
}

.search-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  display: grid;
  place-items: center;
}

.search-results {
  padding: 10px;
  overflow-y: auto;
  max-height: 52vh;
}

.search-hint {
  padding: 20px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.9;
}

.search-item {
  display: block;
  padding: 12px 14px;
  border-radius: 2px;
}

.search-item:hover,
.search-item.is-active {
  background: var(--paper-2);
}

.search-item-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.5;
}

.search-item-meta {
  margin-top: 3px;
  font-size: 0.66rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-item mark {
  background: var(--accent-soft);
  color: var(--accent);
}

.search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  color: var(--muted);
}

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

kbd {
  display: inline-block;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  background: var(--paper-2);
  border-radius: 3px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--ink-2);
}

.search-page-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--muted);
}

.search-page-box input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  padding: 4px 0;
}

.search-page-box input:focus {
  outline: none;
}

.search-page-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.search-page-results {
  padding: 8px 0;
}

.search-page-results .search-item {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.search-page-results .search-item-title {
  font-size: 1.15rem;
}

.search-empty {
  padding: 30px 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ───────── 404 ───────── */

.notfound {
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
  padding: 16vh 0 18vh;
}

.notfound h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 600;
  margin: 20px 0 16px;
  line-height: 1.2;
}

.notfound > p:not(.kicker) {
  color: var(--muted);
  font-size: 0.95rem;
}

.notfound-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

/* ───────── 页脚 ───────── */

.site-footer {
  border-top: 1px solid var(--line-strong);
  padding: 58px 0 26px;
  margin-top: 40px;
}

.footer-grid {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 60px;
}

.brand-footer {
  margin-bottom: 16px;
}

.footer-brand > p {
  max-width: 380px;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
}

.footer-note {
  margin-top: 14px !important;
  font-family: var(--serif);
  font-size: 0.86rem !important;
  color: var(--ink-2) !important;
}

.footer-col h3 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 14px;
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 5px 0;
  font-size: 0.8rem;
  color: var(--ink-2);
}

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

.footer-bottom {
  width: min(var(--max), calc(100% - 48px));
  margin: 46px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.68rem;
  color: var(--faint);
}

.footer-tech {
  letter-spacing: 0.08em;
}

.to-top {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.to-top:hover {
  color: var(--accent);
}

/* ───────── 图片灯箱 ───────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(12, 10, 8, 0.92);
  display: grid;
  place-items: center;
  padding: 4vw;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px;
}

.lightbox p {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
}

/* ───────── 登录 ───────── */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrap {
  width: min(400px, 100%);
}

.login-brand {
  margin-bottom: 24px;
}

.login-card {
  padding: 34px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 12px 0 6px;
}

.login-lede {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.login-card .field {
  margin-bottom: 16px;
}

.login-foot {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

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

.form-error {
  padding: 8px 10px;
  border: 1px solid rgba(163, 59, 42, 0.3);
  background: rgba(163, 59, 42, 0.06);
  color: #a33b2a;
  font-size: 0.76rem;
  margin-bottom: 16px;
}

/* ───────── 响应式 ───────── */

@media (max-width: 1080px) {
  .home-grid {
    gap: 48px;
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .post-layout {
    gap: 46px;
    grid-template-columns: minmax(0, var(--read)) 180px;
  }

  .footer-grid {
    gap: 40px;
  }
}

@media (max-width: 880px) {
  .feature-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .feature-cover {
    aspect-ratio: 16 / 9;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
    padding-bottom: 30px;
  }

  .side-block:first-child,
  .side-block:nth-child(2) {
    border-top-color: var(--line-strong);
  }

  .post-layout {
    display: block;
  }

  .post-toc {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-side {
    max-width: 360px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .header-inner {
    width: calc(100% - 32px);
    height: 66px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-sub {
    font-size: 7px;
  }

  .menu-toggle {
    display: grid;
  }

  .main-nav {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 8px 16px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.2s ease;
    box-shadow: 0 20px 40px rgba(30, 24, 16, 0.08);
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 13px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
  }

  .nav-link:last-child {
    border-bottom: 0;
  }

  .nav-link::after {
    display: none;
  }

  .home-wrap,
  .page-wrap,
  .post-layout,
  .post-nav,
  .comments,
  .footer-grid,
  .footer-bottom {
    width: calc(100% - 36px);
  }

  .hero {
    padding: 58px 0 42px;
  }

  .hero-title {
    font-size: clamp(2.35rem, 10.5vw, 3.4rem);
    margin: 22px 0 20px;
  }

  .hero-lede {
    font-size: 0.94rem;
  }

  .hero-foot {
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 32px;
  }

  .hero-link {
    margin-left: 0;
    flex-basis: 100%;
    padding-top: 8px;
  }

  .featured {
    margin-bottom: 50px;
  }

  .feature-card {
    padding: 18px 0 24px;
  }

  .feature-copy h2 {
    font-size: 1.65rem;
  }

  .feature-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 16px;
    padding: 24px 0;
  }

  .row-num {
    display: none;
  }

  .row-title {
    font-size: 1.3rem;
  }

  .row-excerpt {
    -webkit-line-clamp: 3;
    font-size: 0.84rem;
  }

  .row-cover {
    aspect-ratio: 1 / 1;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .page-wrap {
    padding: 52px 0 70px;
  }

  .page-head {
    padding-bottom: 26px;
    margin-bottom: 30px;
  }

  .archive-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .tag-index {
    grid-template-columns: 1fr;
  }

  .post-layout {
    padding-top: 52px;
  }

  .post-title {
    font-size: clamp(2rem, 8.5vw, 2.8rem);
  }

  .post-dek {
    font-size: 0.98rem;
  }

  .post-body {
    font-size: 1.02rem;
    line-height: 1.92;
  }

  .post-body > p:first-of-type::first-letter {
    font-size: 2.8em;
  }

  .post-body h2 {
    font-size: 1.36rem;
  }

  .post-body h3 {
    font-size: 1.12rem;
  }

  .post-cover {
    margin: 26px 0 32px;
  }

  .post-nav {
    margin-top: 48px;
    grid-template-columns: 1fr;
  }

  .post-nav-item.is-empty {
    display: none;
  }

  .post-nav-next {
    text-align: left;
    align-items: flex-start;
  }

  .comments {
    margin-top: 50px;
  }

  .comments-head {
    display: block;
  }

  .comments-head p {
    margin-top: 6px;
  }

  .comment-form {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .comment-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .footer-tech {
    order: 3;
    flex-basis: 100%;
  }

  .to-top {
    margin-left: 0;
  }

  .search-dialog {
    width: calc(100vw - 20px);
    max-height: 84vh;
  }

  .search-results {
    max-height: 58vh;
  }

  .notfound {
    width: calc(100% - 36px);
    padding: 12vh 0 14vh;
  }

  .notfound-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .post-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-cover {
    display: none;
  }

  .post-kicker {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .share-btn {
    margin-left: 0;
    margin-top: 8px;
  }

  .post-byline {
    flex-wrap: wrap;
  }

  .share-btn {
    margin-left: auto;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .post-toc,
  .post-nav,
  .comments,
  .reading-progress,
  .share-btn,
  .back-top,
  .paper-grain {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .post-layout {
    display: block;
    width: 100%;
    padding: 0;
  }

  .post-body {
    font-size: 11pt;
    line-height: 1.7;
  }
}
