:root {
  --paper: #fbfbfd;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --body-ink: #2b2b2e;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.13);
  --accent: #0071e3;
  --accent-strong: #0066cc;
  --accent-soft: #eaf4ff;
  --radius: 16px;
  --wrap: 1080px;
  --measure: 720px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  z-index: 50;
}

.skip-link:focus {
  left: 24px;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(160deg, #2b2b2e, #1d1d1f);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.site-nav a:hover {
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink);
}

.site-nav a[aria-current='page'] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 500;
}

/* ---------- 首页 ---------- */

.hero {
  padding: 72px 0 44px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 0;
  max-width: 20em;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 36em;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.hero-meta li {
  position: relative;
  padding-left: 0;
}

.hero-meta li + li::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.posts {
  padding: 48px 0 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-count {
  font-size: 13px;
  color: var(--faint);
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-item {
  border-bottom: 1px solid var(--line);
}

.post-link {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 32px;
  padding: 26px 12px 28px;
  margin-inline: -12px;
  border-radius: 12px;
  transition: background-color 0.18s ease;
}

.post-link:hover {
  background: rgba(0, 0, 0, 0.028);
}

.post-date {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 5px;
  white-space: nowrap;
}

.post-body {
  display: block;
  min-width: 0;
}

.post-title {
  display: block;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.18s ease;
}

.post-link:hover .post-title {
  color: var(--accent-strong);
}

.post-summary {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--faint);
}

.post-tags > span:not(.post-read) {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--muted);
}

.post-read {
  margin-left: 2px;
}

/* ---------- 文章页 ---------- */

.article {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 40px 0 72px;
}

.back-link {
  display: inline-block;
  margin-bottom: 34px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.18s ease;
}

.back-link:hover {
  color: var(--accent-strong);
}

.article-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.article-head h1 {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 36px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.prose {
  font-size: 17.5px;
  line-height: 1.95;
  color: var(--body-ink);
  padding-top: 12px;
}

.prose > * {
  max-width: 100%;
}

.prose p {
  margin: 1.15em 0;
}

.prose > p:first-child {
  margin-top: 1.6em;
  color: var(--ink);
}

.prose h2 {
  margin: 2.1em 0 0.7em;
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--ink);
}

.prose h3 {
  margin: 1.7em 0 0.6em;
  font-size: 18.5px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.45em 0;
}

.prose li::marker {
  color: var(--faint);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: normal;
}

.prose blockquote p {
  margin: 0.5em 0;
}

.prose a {
  color: var(--accent-strong);
  border-bottom: 1px solid rgba(0, 102, 204, 0.28);
  transition: border-color 0.18s ease;
}

.prose a:hover {
  border-bottom-color: var(--accent-strong);
}

.prose strong {
  font-weight: 600;
  color: var(--ink);
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.prose pre {
  margin: 1.6em 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #1d1d1f;
  color: #f5f5f7;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.prose hr {
  margin: 2.4em auto;
  width: 40%;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.article-end {
  margin-top: 3em;
  text-align: center;
  color: var(--faint);
  letter-spacing: 0.4em;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pager-link:hover {
  border-color: rgba(0, 113, 227, 0.32);
  transform: translateY(-1px);
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

.pager-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.pager-title {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- 404 ---------- */

.not-found {
  padding: 120px 0 140px;
  max-width: 34em;
}

.not-found h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  transition: background-color 0.18s ease;
}

.button:hover {
  background: var(--accent-strong);
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 32px;
}

.footer-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.footer-note,
.footer-right p {
  margin: 0;
  line-height: 1.8;
}

.footer-right {
  text-align: right;
}

.footer-icp {
  margin-top: 6px;
}

.footer-icp a {
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.footer-icp a:hover {
  color: var(--accent-strong);
  border-bottom-color: rgba(0, 102, 204, 0.4);
}

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  .wrap {
    padding-inline: 20px;
  }

  .hero {
    padding: 52px 0 40px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .post-link {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 22px 10px 24px;
    margin-inline: -10px;
  }

  .post-date {
    padding-top: 0;
  }

  .post-title {
    font-size: 18.5px;
  }

  .article {
    padding: 28px 0 56px;
  }

  .prose {
    font-size: 17px;
    line-height: 1.9;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-next {
    text-align: left;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-right {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }

  .pager-link:hover {
    transform: none;
  }
}
