/* ---------- 主题变量 ---------- */
:root {
  --bg: #fcfcfa;
  --fg: #1a1a1c;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e7e5e4;
  --code-bg: #f4f4f5;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --fg: #e8e8ea;
    --muted: #98a1b3;
    --accent: #8ab4ff;
    --border: #24272f;
    --code-bg: #171a21;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.site-header,
main,
.site-footer {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- 页头 ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--fg);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.brand:hover { color: var(--accent); text-decoration: none; }

.site-nav a {
  color: var(--muted);
  margin-left: 1.25rem;
  font-size: .95rem;
}
.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- 首页 ---------- */
.hero { padding: 3.25rem 0 2rem; }

.hero h1 {
  margin: 0 0 .6rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.hero p { margin: 0; color: var(--muted); max-width: 34rem; }

.section-title {
  margin: 1rem 0 .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 文章列表 ---------- */
.post-list { margin-bottom: 2rem; }

.post-item {
  padding: 1.6rem 0;
  border-top: 1px solid var(--border);
}
.post-list .section-title + .post-item { border-top: 0; padding-top: .4rem; }

.post-item h3 {
  margin: .35rem 0 .4rem;
  font-size: 1.24rem;
  line-height: 1.4;
}
.post-item h3 a { color: var(--fg); }
.post-item h3 a:hover { color: var(--accent); text-decoration: none; }

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 3rem;
  padding-block: 1.75rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer p { margin: 0; }

/* ---------- 文章正文 ---------- */
.post-header { padding: 2.75rem 0 1.5rem; }

.post-header h1 {
  margin: 0 0 .9rem;
  font-size: clamp(1.7rem, 4.5vw, 2.2rem);
  line-height: 1.3;
  letter-spacing: -.015em;
}

.content { padding-bottom: 1rem; }

.content h2 {
  margin: 2.4em 0 .7em;
  font-size: 1.35rem;
  line-height: 1.4;
}
.content h3 { margin: 2em 0 .6em; font-size: 1.12rem; }

.content p { margin: 0 0 1.15em; }

.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.15em; }
.content li { margin-bottom: .35em; }

.content blockquote {
  margin: 1.5em 0;
  padding: .25em 0 .25em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.content code {
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.content pre {
  margin: 1.4em 0;
  padding: 1rem 1.15rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
}
.content pre code { background: none; padding: 0; font-size: .85em; }

.content img { max-width: 100%; height: auto; border-radius: 10px; }

.content hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--border); }

.content table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: .92rem;
}
.content th, .content td {
  padding: .5em .7em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.content th { font-weight: 600; }

/* ---------- 标签 ---------- */
.tags { display: inline-flex; flex-wrap: wrap; gap: .35rem; }

.tag {
  padding: .1rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--muted);
}
.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- 文章页脚 ---------- */
.post-footer {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .95rem;
}

/* ---------- 其他 ---------- */
.page-header { padding: 2.75rem 0 1rem; }
.page-header h1 { margin: 0 0 .5rem; font-size: 2rem; letter-spacing: -.02em; }
.intro { color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 16px; }
  .hero { padding-top: 2.25rem; }
  .site-header { padding-block: 1.2rem; }
  .site-nav a { margin-left: .9rem; }
}
