:root {
  --paper: #f3f1ec;
  --paper-deep: #e8e4db;
  --surface: #faf9f6;
  --ink: #1a1814;
  --ink-soft: #3f3b35;
  --muted: #6e6960;
  --faint: #9a948a;
  --line: #e0dcd3;
  --line-strong: #cfc9bd;
  --font: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
  --font-ui: var(--font);
  --font-serif: var(--font);
  --page: 1080px;
  --measure: 40rem;
  --header-h: 64px;
  --ease: 180ms ease;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  hanging-punctuation: first last;
  text-autospace: normal;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body > main { flex: 1 0 auto; }

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

a { color: inherit; }

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
}
.skip-link:focus { top: 12px; }

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  position: relative;
  max-width: var(--page);
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo {
  display: block;
  height: 26px;
  width: auto;
}

.nav-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: -10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  border-radius: 4px;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--ease), opacity var(--ease);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-link {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 0;
  transition: color var(--ease);
}

.site-link:hover { color: var(--ink); }

.site-link.is-active {
  color: var(--ink);
}

.site-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
}

/* ——— Layout ——— */
.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px) 96px;
}

.page-narrow {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 72px clamp(20px, 4vw, 32px) 120px;
}

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 32px) 120px;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.display {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  margin: 18px 0 0;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

/* ——— Hero ——— */
.hero {
  padding: 72px 0 56px;
  max-width: 38em;
}

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 5.6vw, 52px);
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lede {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

.page-head {
  padding: 64px 0 36px;
  max-width: 38em;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* ——— Buttons / text actions ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover { background: #2e2b26; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }

.text-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity var(--ease);
}

.text-more:hover { opacity: 0.55; }

.text-more .arrow {
  font-weight: 400;
}

/* ——— Lead (homepage featured) ——— */
.lead {
  padding: 48px 0 52px;
  border-top: 1px solid var(--line);
  max-width: 40em;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.lead-meta a {
  color: var(--muted);
  text-decoration: none;
}

.lead-meta a:hover { color: var(--ink); }

.lead-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.lead-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 4.2vw, 38px);
  letter-spacing: -0.022em;
  line-height: 1.28;
  text-wrap: balance;
}

.lead-title a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 240ms ease;
}

.lead:hover .lead-title a {
  background-size: 100% 1px;
}

.hero-title,
.page-head h1,
.lead-title,
.index-title,
.article-title {
  overflow-wrap: break-word;
}

.lead-excerpt {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ——— Index list ——— */
.index-section {
  padding-top: 40px;
}

.section-label {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.index {
  border-top: 1px solid var(--line);
}

.index-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 24px 32px;
  padding: 28px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background var(--ease);
}

.index-item:hover .index-title {
  background-size: 100% 1px;
}

.index-date {
  padding-top: 6px;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.index-main { min-width: 0; }

.index-title {
  display: inline;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.35;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 96%;
  transition: background-size 240ms ease;
}

.index-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 42em;
}

.index-kicker {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.empty {
  padding: 48px 0 24px;
  color: var(--muted);
  font-size: 16px;
}

/* ——— Article ——— */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 40px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.article-back:hover { color: var(--ink); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.article-meta a {
  color: var(--muted);
  text-decoration: none;
}

.article-meta a:hover { color: var(--ink); }

.article-title {
  margin: 0 0 40px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -0.028em;
  line-height: 1.22;
  text-wrap: balance;
}

.article-end {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.engage {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.inspired-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.inspired-btn:hover { border-color: var(--ink); color: var(--ink); }
.inspired-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.inspired-count {
  min-width: 1.2em;
  color: inherit;
  opacity: 0.7;
}

.comments { margin-top: 40px; }

.comments-title {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.comment {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.comment-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--faint);
}

.comment-name { color: var(--ink); font-weight: 600; }
.comment-name.is-author::after {
  content: "作者";
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.comment-body {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
  white-space: pre-wrap;
}

.comment-reply {
  margin: 14px 0 0 16px;
  padding: 12px 0 0;
  border-top: 1px dashed var(--line);
}

.comment-empty {
  margin: 0 0 20px;
  color: var(--faint);
  font-size: 14px;
}

.comment-form { margin-top: 8px; }
.comment-form-lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.comment-hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.comment-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.comment-input:focus { outline: none; border-color: var(--ink); }
.comment-textarea { resize: vertical; min-height: 110px; }

.comment-form-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.comment-msg { margin: 0; font-size: 13px; color: var(--muted); }
.comment-msg.is-error { color: #9a3b2f; }

.comment-submit {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.comment-submit:disabled { opacity: 0.5; cursor: default; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pager-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.pager-item-next { text-align: right; }

.pager-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.pager-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.pager-item:hover .pager-title { opacity: 0.55; }

/* ——— About ——— */
.about-body {
  margin-top: 36px;
}

.about-body.prose { font-size: 17.5px; }

/* ——— 404 ——— */
.not-found {
  padding: 96px 0 48px;
}

.not-found-code {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(56px, 12vw, 88px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.not-found p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.not-found .btn { margin-top: 28px; }

/* ——— Prose ——— */
.prose {
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 17.5px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}

.prose > *:first-child { margin-top: 0; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}

.prose h1 { font-size: 1.55em; margin: 1.6em 0 0.5em; }
.prose h2 { font-size: 1.32em; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.12em; margin: 1.6em 0 0.45em; }

.prose p { margin: 0 0 1.15em; }

.prose a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 96%;
}

.prose a:hover { opacity: 0.6; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--paper-deep);
  padding: 0.12em 0.38em;
  border-radius: 3px;
  letter-spacing: 0;
}

.prose pre {
  background: #161411;
  color: #f3f0ea;
  padding: 18px 20px;
  border-radius: 6px;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.86em;
  line-height: 1.65;
  margin: 1.4em 0;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: inherit;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 20px;
  border-left: 1.5px solid var(--ink);
  color: var(--muted);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin: 0 0 1.15em;
}

.prose li { margin: 0.28em 0; }

.prose li::marker { color: var(--faint); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.4em auto;
  max-width: 4rem;
}

.prose img {
  display: block;
  margin: 1.6em auto;
  border-radius: 12px;
}
.prose img[data-align="left"] {
  margin-left: 0;
  margin-right: auto;
}
.prose img[data-align="right"] {
  margin-left: auto;
  margin-right: 0;
}
.prose img[data-radius="0"] { border-radius: 0; }
.prose img[data-radius="4"] { border-radius: 4px; }
.prose img[data-radius="8"] { border-radius: 8px; }
.prose img[data-radius="12"] { border-radius: 12px; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  margin: 1.4em 0;
}

.prose th,
.prose td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.86em;
  letter-spacing: 0.04em;
}

/* ——— Footer ——— */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 45%, var(--paper));
}

.site-footer-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 40px) 56px;
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 32px 48px;
  align-items: start;
}

.site-footer .site-logo { height: 22px; opacity: 0.78; }

.footer-tagline {
  margin: 12px 0 0;
  max-width: 22em;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 2px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
}

.footer-nav a:hover { color: var(--ink); }

.footer-copy {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ——— Responsive ——— */
@media (max-width: 800px) {
  .index-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 22px 0;
  }

  .index-date { padding-top: 0; }

  .index-title { font-size: 20px; }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-copy { text-align: left; }

  .pager { grid-template-columns: 1fr; gap: 20px; }

  .pager-item-next { text-align: left; }

  .comment-fields { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--paper);
  }

  .nav-burger { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .nav-checkbox:checked ~ .site-nav { display: flex; }

  .nav-checkbox:checked + .nav-burger span:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .nav-checkbox:checked + .nav-burger span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  .site-link {
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
  }

  .site-link.is-active::after { display: none; }

  .hero { padding: 48px 0 40px; }

  .page-head { padding: 44px 0 28px; }

  .lead { padding: 36px 0 40px; }

  .article { padding-top: 36px; }

  .article-title { margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .nav-burger,
  .article-back,
  .pager,
  .skip-link { display: none !important; }

  body { background: #fff; color: #000; }

  .article, .page-narrow { max-width: none; padding: 0; }
}
