/* ============================================================
   components.css · 内页组件（分类页 / 详情页）
   颜色/字号/圆角/行高一律取 tokens.css 的 var()，不写字面量。
   首页专用组件（hero / cat-index / featured / steps / scene）留在 style.css；
   本文件只放内页新增区块，三页都 <link> 它，避免内页写出第二套样式。
   ============================================================ */

/* ---------- 内页标题区 ---------- */
.page-hero {
  padding: 46px 0 40px;
  background: var(--bg-band);
}

.page-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 40px;
  align-items: end;
}

.page-hero h1 {
  font-size: var(--fs-12);
  letter-spacing: .02em;
}

.page-hero__lead {
  font-size: var(--fs-4);
  line-height: 1.9;
  color: var(--lead-2);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.breadcrumb a:hover { color: var(--accent); }

/* 筛选条 */
.filter-bar {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: var(--filter-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.1) blur(6px);
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.chip {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--body);
  font-size: var(--fs-3);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.chip:hover { border-color: var(--accent-soft); color: var(--accent); }

.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.filter-bar__count {
  margin-left: auto;
  font-size: var(--fs-3);
  color: var(--muted);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.sort select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--body);
  font: inherit;
}

/* 筛选空状态 */
.card-grid__empty {
  padding: 26px 0 40px;
  font-size: var(--fs-4);
  color: var(--muted);
}

/* 列表卡片 */
/* hidden 属性必须真正隐藏（组件用了 display:flex/grid，会覆盖默认行为） */
[hidden] { display: none !important; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 22px;
  padding: 36px 0 8px;
}

.lcard {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}

.lcard:hover { border-color: var(--accent-soft); transform: translateY(-2px); }

.lcard__tag {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-band);
  color: var(--accent);
  font-size: var(--fs-1);
  letter-spacing: .06em;
}

.lcard h3 {
  margin-top: 14px;
  font-size: var(--fs-6);
  line-height: 1.5;
}

.lcard p {
  margin-top: 12px;
  font-size: var(--fs-3);
  line-height: 1.78;
  color: var(--muted);
}

.lcard__more {
  margin-top: 16px;
  font-size: var(--fs-3);
  color: var(--accent);
}

.list-description {
  padding: 34px 0 56px;
}

.list-description__inner {
  max-width: 940px;
}

.list-description h2 {
  font-size: var(--fs-10);
  margin-bottom: 16px;
}

.list-description p {
  font-size: var(--fs-5);
  line-height: 1.95;
  color: var(--prose);
  margin-bottom: 14px;
}

/* 详情页 */
.article-head {
  padding: 46px 0 34px;
  border-bottom: 1px solid var(--line);
}

.article-head__inner { max-width: 820px; }

.article-head h1 {
  font-size: var(--fs-13);
  line-height: 1.3;
}

.article-head__lead {
  margin-top: 18px;
  font-size: var(--fs-6);
  line-height: 1.9;
  color: var(--lead-2);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.toc {
  max-width: 820px;
  margin: 34px auto 0;
  padding: 20px 24px;
  background: var(--bg-note);
  border-radius: var(--radius);
}

.toc__title {
  font-size: var(--fs-4);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  margin-top: 12px;
  counter-reset: toc;
}

.toc li { counter-increment: toc; font-size: var(--fs-4); line-height: 1.7; }

.toc li::before {
  content: counter(toc, decimal-leading-zero) "  ";
  color: var(--accent-soft);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-3);
}

.toc a:hover { color: var(--accent); }

.article-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 0 20px;
}

.article-body h2 {
  margin: 38px 0 14px;
  font-size: var(--fs-14);
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.45;
}

.article-body h2:first-child { margin-top: 0; }

.article-body p {
  font-size: var(--fs-5);
  line-height: 2;
  color: var(--prose-2);
  margin-bottom: 18px;
}

.related {
  padding: 8px 0 60px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

.related h2 {
  margin: 34px 0 22px;
  font-size: var(--fs-10);
}

.related__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.related__card {
  display: block;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color .2s ease;
}

.related__card:hover { border-color: var(--accent-soft); }

.related__card span {
  display: block;
  font-size: var(--fs-1);
  color: var(--accent);
  letter-spacing: .08em;
}

.related__card strong {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-5);
  line-height: 1.55;
  color: var(--ink);
}


/* ============================================================
   内页响应式（首页断点在 style.css）
   ============================================================ */
@media (max-width: 1200px) {
  .article-head h1 { font-size: var(--fs-15); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .page-hero__inner { grid-template-columns: 1fr; gap: 14px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc ol { grid-template-columns: 1fr; }
  .article-body h2 { font-size: var(--fs-10); }
  .article-body p { font-size: var(--fs-4); }
}

@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
  .article-head h1 { font-size: var(--fs-11); }
  .page-hero h1 { font-size: var(--fs-11); }
  .related__grid { grid-template-columns: 1fr; }
  .pager { gap: 6px; }
  .pager-num { min-width: 34px; height: 34px; padding: 0 10px; }
}

/* ============================================================
   列表卡片缩略图 / 分页 / 正文配图（数据对接补充）
   ============================================================ */
.lcard__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--thumb-bg, #e8eef4);
}

.lcard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.94);
  transition: transform .35s ease;
}

.lcard:hover .lcard__thumb img { transform: scale(1.04); }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 0 46px;
}

.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: var(--fs-4);
  line-height: 1;
  transition: border-color .2s ease, color .2s ease;
}

a.pager-num:hover { border-color: var(--accent-soft); color: var(--accent); }

.pager-num.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.pager-num.is-disabled {
  color: var(--muted);
  opacity: .55;
  cursor: not-allowed;
}

.pager-gap {
  padding: 0 2px;
  color: var(--muted);
  font-size: var(--fs-4);
}

.article-figure {
  margin: 26px 0 30px;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--thumb-bg, #e8eef4);
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
}
