/* ---------- 基础 ---------- */
:root {
  --paper: #faf8f4;
  --ink: #201f1c;
  --muted: #6f6b62;
  --line: #e7e2d8;
  --accent: #33604f;
  --accent-soft: #e9f0ec;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 660px;
}

[data-theme="dark"] {
  --paper: #161514;
  --ink: #e8e4dc;
  --muted: #9b968c;
  --line: #2d2b27;
  --accent: #85b8a1;
  --accent-soft: #1e2a25;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}

.brand {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .04em;
  margin-right: auto;
}

.brand span { color: var(--accent); }

.nav { display: flex; gap: 22px; }

.nav a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.theme-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.theme-btn svg { width: 15px; height: 15px; display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- 首页 ---------- */
.hero { padding: 76px 0 60px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}

.hero h1 {
  font-size: clamp(29px, 5vw, 38px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -.01em;
  margin: 0;
}

.hero .lede {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.9;
  max-width: 30em;
  margin: 24px 0 0;
}

/* ---------- 文章列表 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-head h2 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--muted);
  margin: 0;
}

.section-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.posts { padding-bottom: 20px; }

.post-item {
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--line);
}

.post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.post-item h3 {
  font-size: 19.5px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0 0 8px;
  letter-spacing: -.005em;
}

.post-item h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.post-item p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
}

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; }

.tags li {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 3px 8px;
  line-height: 1.5;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 26px 0 64px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
}

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

/* ---------- 文章页 ---------- */
.article { padding: 56px 0 20px; }

.article header { margin-bottom: 34px; }

.article h1 {
  font-size: clamp(26px, 4.4vw, 33px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -.01em;
  margin: 14px 0 18px;
}

.back {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.prose p { margin: 0 0 22px; font-size: 16.5px; line-height: 1.95; }

.prose h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 38px 0 14px;
  line-height: 1.5;
}

.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 8px; font-size: 16.5px; }

.prose blockquote {
  margin: 26px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.prose code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 22px;
}

.prose pre code { background: none; padding: 0; color: var(--ink); font-size: 13px; line-height: 1.7; }

.prose hr { border: none; border-top: 1px solid var(--line); margin: 38px 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 22px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.pager a { color: var(--muted); }
.pager a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .hero { padding: 52px 0 44px; }
  .site-header .wrap { gap: 16px; height: 58px; }
  .nav { gap: 16px; }
  .post-item { padding: 26px 0 22px; }
  .site-footer { padding-bottom: 48px; }
}
