/* Blog — readable, Medium-inspired */
@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
  --blog-bg: #f6f4ff;
  --blog-paper: #ffffff;
  --blog-ink: #0f172a;
  --blog-muted: #64748b;
  --blog-accent: #4f46e5;
  --blog-border: #e8e5e1;
  --blog-radius: 16px;
  --font-display: "Newsreader", Georgia, serif;
  --font-ui: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body.blog-ui {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.65;
  color: var(--blog-ink);
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(79, 70, 229, 0.07), transparent 50%),
    var(--blog-bg);
  min-height: 100vh;
}

.blog-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 22px 80px;
}

.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 40px;
  border-bottom: 1px solid var(--blog-border);
  margin-bottom: 48px;
}

.blog-nav a.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--blog-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.blog-nav .links a {
  color: var(--blog-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-left: 20px;
}
.blog-nav .links a:hover { color: var(--blog-ink); }

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.15;
}

.blog-hero p.lead {
  margin: 0;
  color: var(--blog-muted);
  font-size: 1.05rem;
}

.home-cta {
  display: inline-block;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--blog-accent), #6366f1);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
  transition: transform 0.12s, filter 0.15s;
}
.home-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
}

.post-list li {
  margin: 0 0 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--blog-border);
}

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

.post-list a.title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--blog-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: block;
}

.post-list a.title:hover { color: var(--blog-accent); }

.post-list .meta {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--blog-muted);
}

.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 14px;
}

.article-header .meta {
  font-size: 0.92rem;
  color: var(--blog-muted);
}

.article-body {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Markdown 渲染后（与 SEO 纯文本 meta 独立；列表仍用结构化 HTML） */
.article-body.is-md-rendered {
  white-space: normal;
}
.article-body.is-md-rendered h2,
.article-body.is-md-rendered h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 1.4em 0 0.6em;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.article-body.is-md-rendered h2 { font-size: 1.45rem; }
.article-body.is-md-rendered h3 { font-size: 1.2rem; }
.article-body.is-md-rendered p { margin: 0 0 1em; }
.article-body.is-md-rendered ul,
.article-body.is-md-rendered ol { margin: 0 0 1em 1.2em; padding: 0; }
.article-body.is-md-rendered li { margin: 0.35em 0; }
.article-body.is-md-rendered a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body.is-md-rendered pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.55;
}
.article-body.is-md-rendered code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.15em 0.35em;
  border-radius: 6px;
}
.article-body.is-md-rendered pre code {
  background: transparent;
  padding: 0;
}
.article-body.is-md-rendered blockquote {
  margin: 1em 0;
  padding: 0 0 0 1em;
  border-left: 4px solid var(--blog-accent);
  color: var(--blog-muted);
  font-style: italic;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--blog-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.back-link:hover { color: var(--blog-accent); }

.alert {
  padding: 14px 18px;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.95rem;
}

.ad-slot {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--blog-border);
  font-size: 0.85rem;
  color: var(--blog-muted);
}

@media (max-width: 600px) {
  body.blog-ui { font-size: 17px; }
  .blog-shell { padding: 0 16px 64px; }
  .blog-nav { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 28px; margin-bottom: 32px; }
  .blog-nav .links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .blog-nav .links a { margin-left: 0; }
  .blog-hero h1 { font-size: 1.85rem; }
  .article-header h1 { font-size: 1.75rem; }
  .article-body { font-size: 1.05rem; }
}
