/* 字母猿官网 · CSS 分文件（由 .tools/split-css.js 生成）
 * 核心变量与通用样式在 style.css；本文件只放对应页面的区块样式。
 */

/* ============================================================
   知识库（文章）—— 前台
   沿用全站设计变量与字号音阶，不引入新的字号档位
   ============================================================ */

/* 分类筛选 */
.post-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.post-filter {
  font-size: var(--fs-14); font-weight: 600; color: var(--ink-2);
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; transition: .2s;
}
.post-filter:hover { border-color: var(--brand); color: var(--brand); }
.post-filter.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 文章卡片 */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .3s, box-shadow .3s;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.post-card-link { display: flex; flex-direction: column; height: 100%; padding: 30px 28px; }
.post-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.post-cat {
  font-size: var(--fs-12); font-weight: 700; letter-spacing: .04em;
  color: var(--brand); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 6px;
}
.post-date { font-size: var(--fs-12); color: var(--muted); }
.post-card-title { font-size: var(--fs-20); line-height: 1.5; color: var(--ink); }
.post-card-summary { margin-top: 14px; font-size: var(--fs-14); line-height: 1.8; color: var(--muted); flex: 1; }
.post-card-foot {
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-13); color: var(--muted);
}
.post-more { color: var(--brand); font-weight: 600; }
.post-card:hover .post-more { text-decoration: underline; text-underline-offset: 3px; }

.post-empty { padding: 56px 0; text-align: center; color: var(--muted); font-size: var(--fs-15); }
.post-empty a { color: var(--brand); font-weight: 600; }

/* 分页 */
.post-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 46px; }
.post-page {
  font-size: var(--fs-14); font-weight: 600; color: var(--ink-2);
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.post-page:hover { border-color: var(--brand); color: var(--brand); }
.post-page.is-cur { border: none; background: none; color: var(--muted); font-weight: 500; }

/* 详情页头 */
.post-head { padding: 70px 0 42px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.post-head h1 { font-size: clamp(28px, 3.4vw, 42px); max-width: 860px; }
.post-head-meta {
  margin-top: 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: var(--fs-13); color: var(--muted);
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags i {
  font-style: normal; font-size: var(--fs-12); padding: 4px 10px;
  border-radius: 6px; background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.post-cover { margin-top: 40px; }
.post-cover img { width: 100%; border-radius: var(--r-lg); display: block; }

/* 正文排版 */
.post-content { max-width: 760px; margin: 0 auto; padding: 52px 0 12px; font-size: var(--fs-16); color: var(--ink-2); }
.post-content > *:first-child { margin-top: 0; }
.post-content h2 { font-size: clamp(22px, 2.4vw, 28px); color: var(--ink); margin: 44px 0 18px; }
.post-content h3 { font-size: var(--fs-20); color: var(--ink); margin: 34px 0 14px; }
.post-content h4 { font-size: var(--fs-18); color: var(--ink); margin: 28px 0 12px; }
.post-content p { margin-bottom: 20px; line-height: 1.95; }
.post-content strong { color: var(--ink); font-weight: 700; }
.post-content ul, .post-content ol { margin: 0 0 20px; padding-left: 24px; }
.post-content li { margin-bottom: 10px; line-height: 1.9; }
.post-content ul li { list-style: none; position: relative; }
.post-content ul li::before {
  content: ""; position: absolute; left: -17px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: .5;
}
.post-content ol { list-style: decimal; }
.post-content blockquote {
  margin: 26px 0; padding: 18px 24px; border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 0 12px 12px 0;
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.post-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 24px 0; display: block; }
.post-content code {
  font-family: var(--mono); font-size: .92em; background: var(--bg-soft);
  padding: 2px 6px; border-radius: 5px; color: var(--ink);
}
.post-content pre {
  background: var(--navy); color: #D6E4FF; padding: 20px 22px; border-radius: 12px;
  overflow-x: auto; margin: 24px 0; font-size: var(--fs-14); line-height: 1.7;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: var(--fs-14); }
.post-content th, .post-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.post-content th { background: var(--bg-soft); font-weight: 700; color: var(--ink); }

/* 文末转化 */
.post-cta {
  max-width: 900px; margin: 44px auto 0; padding: 40px 44px;
  background: var(--navy); border-radius: var(--r-lg); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.post-cta::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(460px 260px at 88% 0%, rgba(31, 91, 255, .34), transparent 62%);
}
.post-cta > * { position: relative; }
.post-cta h3 { color: #fff; font-size: var(--fs-22); }
.post-cta p { margin-top: 10px; color: rgba(255, 255, 255, .74); font-size: var(--fs-14); line-height: 1.8; max-width: 460px; }
.post-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.post-cta .btn--ghost { border-color: rgba(255, 255, 255, .3); color: #fff; background: transparent; }
.post-cta .btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* 相关文章 */
.post-related { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }
.post-related-title { font-size: var(--fs-22); margin-bottom: 28px; }

/* ---------- 分类枢纽（2026-10-19 内链优化） ---------- */
.post-cats { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }
.post-cats-title { font-size: var(--fs-22); margin-bottom: 22px; }
.post-cats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.post-cats-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.post-cats-item:hover {
  border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px);
}
.post-cats-name { font-weight: 600; color: var(--ink); font-size: var(--fs-14); }
.post-cats-count { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }

/* ---------- 列表页结果计数 ---------- */
.post-result-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; }
.post-result-count { font-size: var(--fs-13); color: var(--muted); }

/* ---------- 文章页「同主题延伸阅读」（簇内互链） ---------- */
.post-samecat { margin-top: 56px; padding: 28px 32px; background: var(--bg-soft); border-radius: var(--r); }
.post-samecat .post-related-title { font-size: var(--fs-16); margin-bottom: 16px; }
.post-samecat-list { list-style: none; padding: 0; margin: 0; }
.post-samecat-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.post-samecat-list li:last-child { border-bottom: 0; }
.post-samecat-list a {
  color: var(--ink); font-size: var(--fs-14); line-height: 1.6; transition: color .2s;
}
.post-samecat-list a:hover { color: var(--brand); }
.post-samecat-list span { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }

/* ---------- 文章卡片封面（有图才渲染） ---------- */
.post-card-cover {
  aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-sm); margin-bottom: 14px;
  background: var(--bg-soft);
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 640px) {
  .post-samecat { padding: 22px 20px; }
  .post-cats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
