:root {
  color-scheme: light dark;
  --bg: #fcfcfb;
  --fg: #191917;
  --muted: #6d6d68;
  --line: #e6e6e0;
  --accent: #2d6a4f;
  --code-bg: #f2f2ee;
  --code-fg: #2b2b28;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --max: 43rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --fg: #e7e7e3;
    --muted: #8e8f89;
    --line: #282a2f;
    --accent: #79b894;
    --code-bg: #1c1e22;
    --code-fg: #d9d9d4;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 106, 79, .3);
}

a:hover { border-bottom-color: var(--accent); }

/* ── 页头 ── */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 34px 0 24px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

header.site .brand {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--fg);
  border: 0;
}

header.site h1 { margin: 0; font: inherit; }

header.site nav { display: flex; gap: 16px; font-size: .9rem; }
header.site nav a { border: 0; color: var(--muted); }
header.site nav a:hover { color: var(--accent); }

/* ── 文章列表 ── */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-list li {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.post-list li:last-child { border-bottom: 0; }

.post-list a.title {
  display: inline-block;
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--fg);
  border: 0;
  line-height: 1.45;
}

.post-list a.title:hover { color: var(--accent); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 8px;
  font-size: .82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.summary { margin: 0; font-size: .94rem; color: var(--muted); }

/* ── 正文 ── */
article.post header { margin-bottom: 38px; }

article.post h1 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.35;
  letter-spacing: -.01em;
  font-weight: 700;
}

.body { font-size: 1.02rem; }
.body > *:first-child { margin-top: 0; }
.body p { margin: 0 0 1.15em; }

.body h2 {
  margin: 2.2em 0 .7em;
  padding-bottom: .3em;
  font-size: 1.24rem;
  border-bottom: 1px solid var(--line);
}

.body h3 { margin: 1.9em 0 .5em; font-size: 1.06rem; }
.body h4 { margin: 1.6em 0 .4em; font-size: 1rem; color: var(--muted); }

.body ul, .body ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.body li { margin: .3em 0; }

.body blockquote {
  margin: 1.4em 0;
  padding: .2em 0 .2em 1.1em;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.body blockquote p { margin: .4em 0; }

.body code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: .15em .38em;
  border-radius: 4px;
}

.body pre {
  margin: 0 0 1.3em;
  padding: 15px 17px;
  background: var(--code-bg);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
}

.body pre code { padding: 0; background: none; font-size: .84em; }

.body img { max-width: 100%; height: auto; margin: .6em 0; border-radius: 8px; }

.table-wrap { overflow-x: auto; margin: 0 0 1.3em; }

.body table { width: 100%; border-collapse: collapse; font-size: .93rem; }

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

.body th { font-weight: 600; color: var(--muted); font-size: .85rem; }

.body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }

.body a { word-break: break-word; }

/* ── 页脚 ── */
footer.site {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  header.site { padding-top: 24px; margin-bottom: 34px; }
  .wrap { padding: 0 18px 72px; }
  article.post h1 { font-size: 1.5rem; }
}
