:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --code-bg: #f3f4f6;
  --max: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #181b20;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --border: #2a2f36;
    --accent: #6ea8fe;
    --code-bg: #20242a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* 顶部导航 */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.nav a { color: var(--muted); margin-left: 20px; font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

main { flex: 1; padding: 48px 0 64px; }

/* 首页简介 */
.hero h1 { font-size: 2rem; margin: 0 0 8px; line-height: 1.3; }
.hero p { color: var(--muted); margin: 0 0 40px; }

.section-title {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

/* 文章列表 */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-item h2 { font-size: 1.2rem; margin: 0 0 6px; line-height: 1.4; }
.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--accent); text-decoration: none; }
.post-item p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }

.meta { font-size: 0.85rem; color: var(--muted); }
.tag {
  display: inline-block;
  padding: 0 8px;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
}

/* 文章正文 */
.article h1 { font-size: 1.9rem; line-height: 1.35; margin: 0 0 8px; }
.article .meta { margin-bottom: 32px; }
.article h2 { font-size: 1.35rem; margin: 36px 0 12px; }
.article h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.article p, .article li { font-size: 1.02rem; }
.article blockquote {
  margin: 20px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; padding: 0; font-size: 0.88rem; }

.back { display: inline-block; margin-top: 40px; }

/* 页脚备案 */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 600px) {
  main { padding: 32px 0 48px; }
  .hero h1 { font-size: 1.6rem; }
  .article h1 { font-size: 1.5rem; }
}
