/* ---------- 基础 ---------- */
:root {
  --text: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --accent: #3b6ef5;
  --code-bg: #f6f8fa;
  --maxw: 760px;
}

* { box-sizing: border-box; }

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

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

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

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

/* ---------- 顶栏 ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: .2px;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); font-size: 14.5px; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- 首页 ---------- */
main { padding: 32px 0 64px; min-height: 55vh; }

.hero { padding: 12px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.3px; }
.slogan { margin: 0; color: var(--muted); font-size: 15px; }

.post-list { display: block; }

.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.post-item:last-child { border-bottom: 0; }

.post-title {
  display: inline-block;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.post-title:hover { color: var(--accent); text-decoration: none; }

.post-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.post-meta .tags::before { content: "#"; margin-right: 1px; opacity: .5; }

.post-summary {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 14.5px;
}

.page-title { font-size: 26px; margin: 4px 0 8px; }
.page-intro { color: var(--muted); margin-bottom: 8px; }

.empty {
  padding: 40px 20px;
  background: var(--bg-soft);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 文章 ---------- */
.post { max-width: 100%; }
.post-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.post-header h1 { font-size: 28px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.3px; }

.content { font-size: 16.5px; }
.content > *:first-child { margin-top: 0; }

.content h1, .content h2, .content h3, .content h4 {
  line-height: 1.35;
  margin: 1.8em 0 .7em;
  font-weight: 650;
}
.content h1 { font-size: 26px; }
.content h2 {
  font-size: 22px;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--line);
}
.content h3 { font-size: 18.5px; }
.content h4 { font-size: 16.5px; }

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

.content ul, .content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.content li { margin: .3em 0; }

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 1em 0;
  display: block;
}

.content blockquote {
  margin: 1.2em 0;
  padding: .6em 1em;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  color: #374151;
  border-radius: 0 6px 6px 0;
}
.content blockquote p:last-child { margin-bottom: 0; }

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

.content pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 1.2em 0;
}
.content pre code {
  background: none;
  padding: 0;
  font-size: 13.5px;
  border-radius: 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}
.content th, .content td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.content th { background: var(--bg-soft); font-weight: 600; }

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

/* ---------- 上下篇 ---------- */
.post-nav {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.post-nav a { max-width: 48%; }
.post-nav .next { margin-left: auto; text-align: right; }

/* ---------- 分页 ---------- */
.pager {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 70px 0; }
.notfound h1 { font-size: 64px; margin: 0 0 8px; color: var(--line); letter-spacing: 2px; }
.notfound p { color: var(--muted); margin: 6px 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0 40px;
  background: var(--bg-soft);
}
.site-footer p { margin: 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .header-inner { height: 54px; }
  .nav { gap: 14px; }
  .hero h1 { font-size: 25px; }
  .post-header h1 { font-size: 23px; }
  .content { font-size: 16px; }
  .content h2 { font-size: 20px; }
  .post-nav { flex-direction: column; }
  .post-nav a, .post-nav .next { max-width: 100%; text-align: left; margin-left: 0; }
}
