/* 颜鹏飞个人博客 · 极简样式 */
:root {
  --color-bg: #ffffff;
  --color-fg: #1f2937;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-code-bg: #f3f4f6;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 760px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; }
code, pre { font-family: var(--font-mono); }
pre { background: var(--color-code-bg); padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.9rem; }
code { background: var(--color-code-bg); padding: 0.1em 0.4em; border-radius: 3px; font-size: 0.9em; }
pre code { background: none; padding: 0; }
blockquote { margin: 1rem 0; padding: 0 1rem; border-left: 3px solid var(--color-border); color: var(--color-muted); }
img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

.site-header { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-title { font-size: 1.2rem; font-weight: 700; color: var(--color-fg); }
.site-title:hover { text-decoration: none; }
.site-header nav a { margin-left: 1.25rem; color: var(--color-muted); font-size: 0.95rem; }
.site-header nav a:hover { color: var(--color-link); text-decoration: none; }

main { padding: 2rem 1.25rem 4rem; min-height: 60vh; max-width: var(--max-width); margin: 0 auto; }
main .container { max-width: var(--max-width); margin: 0 auto; }

.post-list { list-style: none; }
.post-list li { padding: 1rem 0; border-bottom: 1px solid var(--color-border); }
.post-list li a { font-size: 1.1rem; font-weight: 600; }
.post-list li time { display: block; margin-top: 0.25rem; font-size: 0.85rem; color: var(--color-muted); }
.post-excerpt { margin-top: 0.35rem; font-size: 0.92rem; color: var(--color-muted); line-height: 1.55; }

.post header { margin-bottom: 2rem; }
.post header time { color: var(--color-muted); font-size: 0.9rem; }
.post-body { line-height: 1.8; }
.post-body p { margin: 1rem 0; }
.post-body ul, .post-body ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.post-body li { margin: 0.25rem 0; }
.wechat-link { margin-top: 3rem; padding: 1rem; background: var(--color-code-bg); border-radius: 6px; font-size: 0.95rem; }

.site-footer { border-top: 1px solid var(--color-border); padding: 1.5rem 1rem; color: var(--color-muted); font-size: 0.85rem; }
.site-footer .container { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-link); }
.footer-filing { font-size: 0.78rem; }
.footer-filing a { margin: 0 0.25rem; }

/* ── 版本信息（文章页 + 列表页）── */
.post-version-info { margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: var(--color-code-bg); border-radius: 4px; font-size: 0.85rem; color: var(--color-muted); }
.post-version-info p { margin: 0.15rem 0; }
.post-meta { font-size: 0.82rem; color: var(--color-muted); margin-top: 0.3rem; }
.post-meta span { margin-right: 0.3rem; }

/* ── 修订记录表格 ── */
.post-revisions { margin-top: 3rem; }
.post-revisions h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.post-revisions table { width: 100%; border-collapse: collapse; font-size: 0.88rem; table-layout: auto; }
.post-revisions th, .post-revisions td { padding: 0.5rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.post-revisions th:first-child, .post-revisions td:first-child,
.post-revisions th:nth-child(2), .post-revisions td:nth-child(2) { white-space: nowrap; }
.post-revisions th { color: var(--color-muted); font-weight: 600; }

/* ── 文章内目录 TOC ── */
.post-toc { margin: 1.5rem 0; padding: 1rem 1.2rem; background: var(--color-code-bg); border-radius: 6px; font-size: 0.9rem; }
.post-toc summary { font-weight: 600; cursor: pointer; margin-bottom: 0.6rem; color: var(--color-fg); }
.post-toc ul { list-style: none; padding-left: 0; }
.post-toc li { margin: 0.3rem 0; }
.post-toc li li { padding-left: 1.2rem; }
.post-toc a { color: var(--color-muted); }
.post-toc a:hover { color: var(--color-link); }

/* ── 上一篇/下一篇导航 ── */
.post-nav { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); font-size: 0.95rem; }
.post-nav a { color: var(--color-link); max-width: 48%; }

/* ── 排版增强 ── */
.post-body kbd { padding: 0.15em 0.4em; font-size: 0.85em; background: var(--color-code-bg); border: 1px solid var(--color-border); border-radius: 3px; box-shadow: 0 1px 0 var(--color-border); font-family: var(--font-mono); }
.post-body mark { background: #fef08a; padding: 0.1em 0.3em; border-radius: 2px; }
.post-body sup { font-size: 0.8em; vertical-align: super; }
.post-body .footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--color-border); font-size: 0.85rem; color: var(--color-muted); }
.post-body .footnotes ol { padding-left: 1.2rem; }
.post-body .footnotes li { margin: 0.3rem 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.post-body th, .post-body td { padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); text-align: left; }
.post-body th { background: var(--color-code-bg); font-weight: 600; }

/* ── 图片点击放大 ── */
.post-body img { cursor: zoom-in; transition: transform 0.2s ease; }
.post-body img:active { cursor: zoom-out; transform: scale(1.05); }

/* ── Mermaid 图表 ── */
.mermaid { text-align: center; margin: 1.5rem 0; }
.mermaid svg { max-width: 100%; height: auto; }

/* ── 深色模式 ── */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a2e;
    --color-fg: #e0e0e0;
    --color-muted: #9ca3af;
    --color-border: #374151;
    --color-link: #60a5fa;
    --color-link-hover: #93bbfd;
    --color-code-bg: #1e293b;
  }
  .post-body mark { background: #854d0e; color: #fef9c3; }
  .mermaid svg { background: #1e293b; border-radius: 6px; padding: 1rem; }
}

/* ── 移动端适配 ── */
@media (max-width: 640px) {
  html { font-size: 15px; }
  .site-header .container { flex-wrap: wrap; gap: 0.5rem; }
  .site-header nav { width: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .site-header nav a { margin-left: 0; margin-right: 0.75rem; font-size: 0.9rem; }
  .site-footer .container { flex-direction: column; text-align: center; }
  main { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 400px) {
  .site-title { font-size: 1.1rem; }
  .site-header nav a { font-size: 0.82rem; margin-right: 0.5rem; }
  .footer-filing { font-size: 0.72rem; }
}
