/* ============================================================
   文章详情页专属样式 (post.css)
   承载 post.html 的页面级覆盖：
   - 文章头 .post-header / .post-meta-full / .avatar
   - 正文 .post-content（p/h2/h3/strong/a/ul/li/blockquote/pre/code）
   - 代码卡片 .code-card / .code-head / .copy-btn（chrome 由 markdown.Render 服务端烘焙，样式见 code.css，点击由 code.js 委托）
   - 文末 .post-foot / .post-nav 上一篇下一篇
   - 侧栏目录 .toc（post.js 构建；宽屏 fixed 显示）
   共享 token / .container-narrow 由 style.css 提供。
   ============================================================ */

.post-header { padding: 56px 0 8px; text-align: center; }
.post-header .badge-pill { margin-bottom: 22px; }
.post-header h1 {
  font-size: clamp(30px, 4.5vw, 46px); font-weight: 600;
  color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 20px;
}
.post-meta-full {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 600; color: var(--muted-soft);
}
.post-meta-full .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.post-meta-full .dot { width: 3px; height: 3px; background: var(--muted-soft); border-radius: 50%; }

/* 正文排版：文章页 .post-content 与编辑器预览 .ed-preview 共用（所见即所得） */
.post-content, .ed-preview { padding: 40px 0 16px; }
.post-content p, .ed-preview p { font-size: 17px; line-height: 1.85; color: var(--body-strong); margin-bottom: 22px; }
.post-content h2, .ed-preview h2 { font-size: 26px; font-weight: 600; color: var(--ink); margin: 40px 0 16px; letter-spacing: -0.01em; }
.post-content h3, .ed-preview h3 { font-size: 20px; font-weight: 600; color: var(--ink); margin: 28px 0 12px; }
.post-content strong, .ed-preview strong { color: var(--ink); font-weight: 600; }
.post-content a, .ed-preview a { color: var(--primary); font-weight: 600; text-decoration: none; }
.post-content a:hover, .ed-preview a:hover { text-decoration: underline; }
.post-content ul, .ed-preview ul { margin: 0 0 22px; padding-left: 22px; }
.post-content ol, .ed-preview ol { margin: 0 0 22px; padding-left: 22px; }
.post-content li, .ed-preview li { font-size: 17px; line-height: 1.8; color: var(--body-strong); margin-bottom: 8px; }
.post-content blockquote, .ed-preview blockquote {
  display: inline-block; max-width: 92%;
  margin: 4px 0 4px 2px; padding: 0 0 0 12px;
  border-left: 2px solid var(--muted-soft);
  color: var(--muted); font-size: 0.95em; line-height: 1.6;
}
/* 紧贴上一段（拉近距离，像跟在上一行后面） */
.post-content p + blockquote, .ed-preview p + blockquote { margin-top: -14px; }
.post-content blockquote p, .ed-preview blockquote p { margin: 0; }
.post-content blockquote p + p, .ed-preview blockquote p + p { margin-top: 8px; }
/* 多空行折成的间距占位（markdown.go 的 expandBlankLines 注入） */
.post-content .md-gap, .ed-preview .md-gap { display: block; height: 16px; }
/* 行内 code（post.css 此前漏了） */
.post-content code, .ed-preview code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--surface-card); color: var(--primary-active);
  padding: 2px 6px; border-radius: var(--r-sm);
}
.post-content pre code, .ed-preview pre code { background: none; color: inherit; padding: 0; font-size: 14px; }
/* GFM 表格 */
.post-content table, .ed-preview table {
  border-collapse: collapse; width: 100%; margin: 28px 0;
  font-size: 15px; display: block; overflow-x: auto;
}
.post-content th, .ed-preview th {
  text-align: left; padding: 10px 14px;
  border: 1px solid var(--hairline); background: var(--surface-card);
  font-weight: 600; color: var(--ink);
}
.post-content td, .ed-preview td { padding: 10px 14px; border: 1px solid var(--hairline); color: var(--body-strong); }
/* 分隔线：居中品牌星芒 */
.post-content hr, .ed-preview hr {
  border: none; height: 16px; margin: 36px 0; background-color: transparent;
  background-image: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M8 0 l1.8 5.4 l5.4 1.8 l-5.4 1.8 l-1.8 5.4 l-1.8 -5.4 l-5.4 -1.8 l5.4 -1.8 z' fill='%23cc785c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

/* 目录导航（右侧栏） */
.post-layout { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 1000px; }
.toc { position: fixed; top: 96px; right: 32px; width: 240px; font-size: 14px; display: none; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
.toc-title { font-size: 18px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 14px; }
.toc-title i { margin-right: 5px; }
.toc ul { list-style: none; border-left: 2px solid var(--hairline); padding-left: 18px; margin: 0; }
.toc li { margin-bottom: 10px; }
.toc li:last-child { margin-bottom: 0; }
.toc li.toc-sub { padding-left: 14px; }
.toc a { color: var(--muted); font-weight: 600; line-height: 1.4; transition: color .15s ease; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--primary); }
@media (min-width: 1480px) {
  .toc { display: block; }
  /* 两栏：左 .post-main（标题+正文） + 右 TOC；TOC sticky 到底时，其左侧竖线正好接到页脚分割线 */
  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    column-gap: 40px;
    width: 100%;
    max-width: none;
    margin: 0;
    align-items: start;
    padding-bottom: 0; /* 让 grid 内容区底贴着分割线，TOC 竖线才能接到分割线 */
  }
  .post-main { grid-column: 1; min-width: 0; }
  .toc {
    grid-column: 2;
    position: sticky;
    top: 96px;
    align-self: start;
    width: auto;
    right: auto;
  }
  /* 竖线（ul 的 border-left）向下多延伸半行接到分割线；最后一个目录项距分割线留半行 */
  .toc ul { padding-bottom: 10px; }
  .container-narrow { width: 88%; min-width: 1000px; max-width: none; }
  /* 文末到页脚分割线的留白 ≈ 左侧边距 */
  .post-content { padding-bottom: calc((100vw - 368px) * 0.06); }
}
/* 锚点跳转避开吸顶导航（64px） */
.post-content h1, .post-content h2, .post-content h3 { scroll-margin-top: 80px; }
