/* 独立于 src/style.css 的博客样式表：文件名不带内容 hash，方便被
   public/blog/**、public/en/blog/** 下的纯静态文章页面直接引用，
   不依赖 Vite 构建产物的 hash 文件名（见 nginx-pdfeditor.conf 里
   关于 /assets/ immutable 缓存的注释——这份 CSS 故意放在 /assets/
   之外，缓存策略见 nginx 配置里的 /blog.css 专项规则）。
   变量、按钮、header/footer 样式与 src/style.css 保持视觉一致。 */

@font-face {
  font-family: "LocalPDF Noto Sans SC";
  src: url("/fonts/NotoSansSC-Static.ttf") format("truetype");
  font-display: swap;
}

:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --bg: #ffffff;
  --panel: #f8fafc;
  --line: #e2e8f0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit;
  padding: 10px 20px; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { padding: 13px 32px; font-size: 16px; }
.btn-sm { padding: 7px 16px; font-size: 14px; }

/* ---------- header / footer（与首页一致） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  color: #fff; font-weight: 800; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 19px; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.header-nav a { color: var(--ink-soft); text-decoration: none; font-size: 15px; font-weight: 500; }
.header-nav a:hover { color: var(--ink); }
.lang-switch {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px !important; font-size: 13px !important; font-weight: 600 !important;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent) !important; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.site-footer a { color: var(--ink-soft); margin: 0 8px; }

/* ---------- 文章列表页 ---------- */
.blog-hero { padding: 48px 0 8px; }
.blog-hero h1 { font-size: 34px; letter-spacing: -.3px; margin-bottom: 10px; }
.blog-hero p { color: var(--ink-soft); font-size: 16px; }
.blog-section-title { font-size: 20px; margin: 44px 0 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.blog-list { padding: 0 0 72px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.blog-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; transition: all .15s;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c7d2fe; }
.blog-card h3 { font-size: 16.5px; color: var(--ink); margin-bottom: 6px; line-height: 1.4; }
.blog-card p { font-size: 13.5px; color: var(--ink-soft); }
@media (max-width: 720px) { .blog-list { grid-template-columns: 1fr; } }

/* ---------- 文章详情页 ---------- */
.article-header { padding: 40px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.article-header h1 { font-size: 32px; line-height: 1.3; letter-spacing: -.3px; margin-bottom: 12px; }
.article-meta { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 8px; }

.article-body { padding: 20px 0 56px; font-size: 16.5px; }
.article-body h2 { font-size: 22px; margin: 34px 0 14px; letter-spacing: -.2px; }
.article-body h3 { font-size: 18px; margin: 24px 0 10px; }
.article-body p { margin-bottom: 16px; color: #334155; }
.article-body ul, .article-body ol { margin: 0 0 16px 22px; color: #334155; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--ink); }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

.article-cta {
  margin: 40px 0; padding: 26px 28px; background: var(--accent-soft);
  border: 1px solid #c7d2fe; border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.article-cta p { margin: 0; font-weight: 600; color: var(--ink); font-size: 15.5px; }

.related { padding: 8px 0 60px; }
.related h2 { font-size: 19px; margin-bottom: 16px; }
.related-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 720px) { .related-list { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .article-header h1 { font-size: 26px; }
  .blog-hero h1 { font-size: 27px; }
  .header-nav a:not(.lang-switch) { display: none; }
}
