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

:root {
  --bg: #fdfcfa;
  --text: #1f2328;
  --muted: #78716c;
  --line: #e7e5e4;
  --accent: #b45309;
  --code-bg: #f4f2ef;
  --max: 680px;
  --pad: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --text: #e5e5e5;
    --muted: #a3a3a3;
    --line: #2a2a2a;
    --accent: #f0a868;
    --code-bg: #1e1e1e;
  }
}

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

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; border-radius: 8px; }

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

/* ---------- 顶栏 ---------- */

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px var(--pad) 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.logo { font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.logo:hover { color: var(--accent); }

.site-header nav { display: flex; gap: 20px; font-size: 15px; color: var(--muted); }
.site-header nav a { transition: color .15s; }
.site-header nav a:hover { color: var(--accent); }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 80px;
}

/* ---------- 首页 ---------- */

.intro { padding: 64px 0 48px; border-bottom: 1px solid var(--line); }
.intro h1 { font-size: 32px; line-height: 1.5; margin: 0 0 16px; font-weight: 600; letter-spacing: -.01em; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }

.section-title {
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 500;
  margin: 48px 0 4px;
}

.post { display: block; padding: 26px 0; border-bottom: 1px solid var(--line); }
.post time { display: block; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.post h3 { font-size: 21px; margin: 6px 0 8px; font-weight: 600; transition: color .15s; }
.post p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.post:hover h3 { color: var(--accent); }

/* ---------- 文章页 ---------- */

.article-header { padding: 56px 0 32px; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: 30px; line-height: 1.45; margin: 0 0 12px; font-weight: 600; letter-spacing: -.01em; }
.article-header .meta { font-size: 14px; color: var(--muted); }

.prose { padding-top: 32px; }
.prose p { margin: 0 0 1.4em; }
.prose h2 { font-size: 21px; margin: 2.2em 0 .7em; font-weight: 600; }
.prose h3 { font-size: 18px; margin: 1.8em 0 .5em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }

.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

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

.prose pre {
  background: var(--code-bg);
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.65;
  margin: 0 0 1.6em;
}

.prose pre code { background: none; padding: 0; font-size: .85em; }

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

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

.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; }

.back { display: inline-block; margin-top: 48px; font-size: 15px; color: var(--muted); }
.back:hover { color: var(--accent); }

/* ---------- 关于页 ---------- */

.about-list { list-style: none; padding: 0; margin: 0 0 1.6em; }
.about-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.about-list span { display: inline-block; min-width: 88px; color: var(--muted); }

/* ---------- 页脚 ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--pad) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer a { transition: color .15s; }
.site-footer a:hover { color: var(--accent); }

/* ---------- 404 ---------- */

.center-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.center-page .big { font-size: 64px; font-weight: 600; letter-spacing: -.03em; margin: 0; color: var(--muted); }
.center-page p { color: var(--muted); margin: 0; }

/* ---------- 窄屏 ---------- */

@media (max-width: 560px) {
  :root { --pad: 20px; }
  body { font-size: 16.5px; }
  .site-header { padding-top: 28px; }
  .intro { padding: 40px 0 36px; }
  .intro h1 { font-size: 26px; }
  .article-header { padding: 40px 0 26px; }
  .article-header h1 { font-size: 24px; }
}
