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

:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e3;
  --accent: #2b6cb0;
  --code-bg: #f4f4f2;
  --max: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #e8e8e6;
    --muted: #8f8f8f;
    --line: #2a2a2e;
    --accent: #7fb0e0;
    --code-bg: #202024;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  padding: 0 1.25rem;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局 ---------- */
.wrap { max-width: var(--max); margin: 0 auto; }

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

header.site .brand {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -.01em;
}

header.site nav { display: flex; gap: 1.25rem; }

header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  transition: color .15s;
}

header.site nav a:hover,
header.site nav a.active { color: var(--accent); }

main { padding-bottom: 4rem; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 3rem;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ---------- 排版 ---------- */
h1 { font-size: 1.85rem; line-height: 1.3; letter-spacing: -.02em; margin-bottom: .75rem; }
h2 { font-size: 1.3rem; margin: 2.25rem 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 1.75rem 0 .5rem; }

p { margin-bottom: 1.1rem; }

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

ul, ol { margin: 0 0 1.1rem 1.4rem; }
li { margin-bottom: .4rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

blockquote {
  border-left: 3px solid var(--line);
  padding-left: 1rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

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

pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: .85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; font-size: inherit; }

img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---------- 首页 ---------- */
.intro { margin-bottom: 3rem; }

.intro h1 { font-size: 2rem; }

.intro .sub {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 34rem;
}

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

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

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

.post-list time {
  color: var(--muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 5.5rem;
}

.post-list a { flex: 1; }

/* ---------- 文章页 ---------- */
.post-meta {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.back { font-size: .9rem; }

/* ---------- 关于页 ---------- */
.facts {
  list-style: none;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--line);
}

.facts li {
  display: flex;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  font-size: .95rem;
}

.facts .k {
  color: var(--muted);
  width: 6rem;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  html { font-size: 16px; }
  header.site { padding-top: 1.5rem; }
  .post-list li { flex-direction: column; gap: .15rem; }
  .post-list time { width: auto; }
  .facts li { flex-direction: column; gap: .1rem; }
  .facts .k { width: auto; }
}
