/* ─────────────────────────────────────────────
   一个很素的博客样式
   改颜色就改下面这一块变量，别的都能不动
   ───────────────────────────────────────────── */

:root {
  --bg: #f5f5f2;
  --card: #ffffff;
  --text: #23252a;
  --text-soft: #4a4e57;
  --muted: #84888f;
  --line: #e6e6e0;
  --accent: #2e9e6b;
  --accent-soft: #ecf7f1;
  --shadow: 0 1px 2px rgba(30, 35, 30, .04), 0 8px 24px -12px rgba(30, 35, 30, .12);
  --radius: 12px;
  --wrap: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #17181b;
  --card: #1e2024;
  --text: #e7e8ea;
  --text-soft: #c2c5cb;
  --muted: #8d939c;
  --line: #2b2e33;
  --accent: #5fd39b;
  --accent-soft: #1a2b23;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

/* ── 顶栏 ─────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14.5px;
}

.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { color: var(--text); font-weight: 500; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { fill: none; stroke: currentColor; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }

main { flex: 1 0 auto; padding-bottom: 72px; }

/* ── 页头 ─────────────────────────────── */

.hero { padding: 56px 0 32px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
.hero.small { padding: 44px 0 24px; }
.hero.small h1 { font-size: 1.4rem; }

/* ── 文章卡片 ─────────────────────────── */

.post-list { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

.card-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.card-meta time { font-variant-numeric: tabular-nums; }
.sep { color: var(--line); }

.card h2 {
  margin: 0 0 6px;
  font-size: 1.14rem;
  font-weight: 620;
  line-height: 1.5;
}
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }

.summary {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

.more { font-size: 13.5px; color: var(--muted); }
.more:hover { color: var(--accent); }

.tag {
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
}
.tag:hover { color: var(--accent); text-decoration: none; }

/* ── 空状态 ───────────────────────────── */

.empty {
  text-align: center;
  padding: 12vh 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-title { font-size: 1.1rem; color: var(--text-soft); margin: 0 0 8px; }
.empty-hint { font-size: 14px; margin: 0; line-height: 2; }

/* ── 文章页 ───────────────────────────── */

.post { padding-top: 48px; }

.post-header { margin-bottom: 34px; }
.post-header h1 {
  margin: 0 0 10px;
  font-size: 1.72rem;
  font-weight: 650;
  line-height: 1.42;
  letter-spacing: -.01em;
}
.post-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* ── 正文排版 ─────────────────────────── */

.prose { font-size: 16px; line-height: 1.85; color: var(--text-soft); }
.prose > *:first-child { margin-top: 0; }

.prose h2, .prose h3, .prose h4 {
  color: var(--text);
  font-weight: 620;
  line-height: 1.45;
  margin: 2em 0 .7em;
  scroll-margin-top: 72px;
}
.prose h2 { font-size: 1.32rem; }
.prose h3 { font-size: 1.14rem; }
.prose h4 { font-size: 1rem; }

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

.prose a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--accent); }

.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }

.prose blockquote {
  margin: 1.4em 0;
  padding: .2em 0 .2em 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
}

.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--accent-soft);
  color: var(--text);
  padding: .15em .4em;
  border-radius: 5px;
}

.prose pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; font-size: 13.5px; }

.prose img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.4em auto; }

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 14.5px;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--accent-soft); color: var(--text); font-weight: 600; }

/* ── 归档 ─────────────────────────────── */

.archive-year { margin-bottom: 34px; }
.archive-year .year {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 1.06rem;
  font-weight: 620;
  color: var(--text);
}
.archive-year .count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0 8px;
  line-height: 20px;
}

.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
}
.archive-list li:last-child { border-bottom: none; }
.archive-list time {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
.archive-list a { color: var(--text-soft); font-size: 15px; }
.archive-list a:hover { color: var(--accent); text-decoration: none; }

/* ── 标签云 ───────────────────────────── */

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-soft);
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: border-color .18s, color .18s;
}
.tag-pill:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tag-pill span { font-size: 11.5px; color: var(--muted); }

/* ── 页脚 ─────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .wrap { display: flex; align-items: center; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .dot { color: var(--line); }

/* ── 窄屏 ─────────────────────────────── */

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .hero { padding: 40px 0 26px; }
  .hero h1 { font-size: 1.6rem; }
  .post { padding-top: 34px; }
  .post-header h1 { font-size: 1.4rem; }
  .card { padding: 17px 17px 15px; }
  .nav { gap: 14px; font-size: 14px; }
  .brand span:last-child { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
