/* ===== 共享样式 — index.html / blog1.html / blog2.html ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fefeff;
  --bg-secondary: #f5f7fb;
  --bg-card: #ffffff;
  --border: #e0e6ef;
  --border-accent: #c8d6e5;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #8a94a3;
  --accent: #0066cc;
  --accent-light: #e6f0ff;
  --accent-mid: #4a90d9;
  --gold: #b8860b;
  --code-bg: #f7fafc;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== 导航栏 ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 64px;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav-logo {
  font-family: 'Cinzel', serif;
  font-size: 14px; letter-spacing: 3px; color: var(--text-primary);
  text-transform: uppercase; font-weight: 700;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 13px; letter-spacing: 0.5px; color: var(--text-secondary);
  text-decoration: none; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

/* ===== 语言切换 ===== */
.lang-switch { display: flex; gap: 6px; margin-left: 10px; }
.lang-btn {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
}
.lang-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== 通用区块布局 ===== */
.section-wrap { padding: 80px 64px; max-width: 1100px; margin: 0 auto; }
.section-header { margin-bottom: 48px; }
.section-label {
  font-size: 10px; letter-spacing: 5px; color: var(--accent);
  text-transform: uppercase; margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(22px, 3vw, 30px); font-weight: 700;
  color: var(--text-primary); letter-spacing: 1px;
}

/* ===== 渐入动画 ===== */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== 文章正文（博客页） ===== */
.article-content {
  font-size: 16px;
  line-height: 2;
  color: var(--text-secondary);
}
.article-content p { margin-bottom: 20px; }
.article-content img { max-width: 100%; border-radius: 6px; display: block; margin: 28px auto; }

/* ===== Markdown 正文排版 =====
   顶部的 * 重置把标题、列表、表格的边距全清零了，而此前没有全局元素样式 ——
   blog6 的表格和列表全靠内联 style 撑着。转 Markdown 后内联样式必然丢失，
   所以在下面把等价规则补回来（表头底色、单元格边框/内边距/字号都逐值对齐）。
   主题色走 --art-accent：career 蓝、life 金，由 .article-content 上的 data-section 切换。 */
.article-content { --art-accent: var(--accent); --art-accent-soft: var(--accent-light); }
.article-content[data-section="life"] { --art-accent: var(--gold); --art-accent-soft: rgba(184,134,11,0.08); }

/* 正文标题。转换时整体降一级语义（正文 h1→##，h2→###），所以这里只定义 h2 起 */
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text-primary); font-weight: 700; line-height: 1.4; margin: 40px 0 16px;
}
.article-content h2 { font-size: 22px; letter-spacing: .3px; }
.article-content h3 { font-size: 18px; }
.article-content h4 { font-size: 16px; }
.article-content > :first-child { margin-top: 0; }

.article-content a {
  color: var(--art-accent); text-decoration: none;
  border-bottom: 1px solid var(--art-accent-soft); transition: border-color .2s;
}
.article-content a:hover { border-bottom-color: var(--art-accent); }

.article-content strong { color: var(--text-primary); font-weight: 600; }

/* 字号 14px 与 padding-left 20px 对齐 blog6 原有的内联样式；
   line-height 不必写，.article-content 本身就是 2，li 会继承 */
.article-content ul,
.article-content ol { margin: 0 0 20px; padding-left: 20px; font-size: 14px; }
.article-content li { margin-bottom: 6px; }

/* 表格等价于 blog6 的内联样式：border-collapse + width:100% + 单元格 1px 边框、
   8px 12px 内边距、13px 字号；首行（GFM 放进 thead）沿用原来的 --accent-light 底色 */
.article-content table {
  border-collapse: collapse; width: 100%; margin: 0 0 20px; font-size: 13px;
}
.article-content th,
.article-content td { border: 1px solid var(--border); padding: 8px 12px; }
.article-content th { text-align: left; }
.article-content thead th { background: var(--art-accent-soft); }

.article-content code {
  font-family: 'JetBrains Mono', monospace; font-size: .88em;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px;
}
.article-content pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 16px; margin: 0 0 20px; overflow-x: auto; line-height: 1.7;
}
.article-content pre code { background: none; border: 0; padding: 0; font-size: 13px; }

.article-content blockquote {
  border-left: 3px solid var(--art-accent); padding: 2px 0 2px 16px;
  margin: 0 0 20px; color: var(--text-muted);
}
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* 长公式：body 上有 overflow-x:hidden，不单独给滚动条的话会被直接裁掉 */
.article-content .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* 正文未就绪时的提示（加载中／文章不存在／链接无效），由 js/post.js 写入 */
.article-content .article-status {
  color: var(--text-muted); font-size: 14px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 1px;
}

/* ===== 页脚 ===== */
footer {
  padding: 32px 64px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; background: var(--bg);
}
.footer-logo {
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 3px; color: var(--text-muted); text-transform: uppercase;
}
.footer-copy { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
  nav { padding: 14px 24px; }
  .nav-links { gap: 12px; }
  .section-wrap { padding: 60px 24px; }
  footer { padding: 24px; }
}
