/* ============================================================
   内页组件（分类页 / 详情页）— 只放三页共享的内页结构
   依赖 tokens.css；首页专用样式仍在 style.css
   ============================================================ */

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0 0;
  font-size: var(--fs-1);
  color: var(--ink-muted);
}
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--accent-strong); text-decoration: underline; }
.crumb .sep { color: #c3bcaa; }
.crumb [aria-current="page"] { color: var(--accent-strong); font-weight: 600; }

/* ---------- 内页头部 ---------- */
.page-hero { padding: 10px 0 22px; }
.page-hero h1 {
  margin-top: 8px;
  font-size: var(--fs-9);
  line-height: 1.15;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: .01em;
}
.page-hero .lead {
  margin-top: 12px;
  max-width: 900px;
  font-size: var(--fs-4);
  line-height: 1.75;
  color: var(--ink-soft);
}
.page-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: var(--fs-3);
  color: var(--ink-soft);
}
.page-hero .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
}
.page-hero .meta b { color: var(--accent-strong); font-weight: 700; }

/* ---------- 筛选工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-label { font-size: var(--fs-2); color: var(--ink-muted); margin-right: 2px; }
.chip {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-2);
  line-height: 1.4;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-invert);
  font-weight: 700;
}
.chip.is-active:hover { color: var(--ink-invert); }
.select-wrap { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2); color: var(--ink-soft); }
.select-wrap label { cursor: pointer; }
.select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface) url("../images/chevron.svg") no-repeat right 10px center / 11px 7px;
  padding: 7px 30px 7px 11px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-2);
  color: var(--ink);
  cursor: pointer;
}
.result-count { font-size: var(--fs-2); color: var(--ink-muted); }
.result-count b { color: var(--accent-strong); }

/* ---------- 列表卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.list-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.list-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #d6cebb; }
.list-thumb { aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.list-thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); padding: 6px; }
.list-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.list-tag {
  align-self: flex-start;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-wash);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}
.list-title {
  margin-top: 9px;
  font-size: var(--fs-5);
  font-weight: 800;
  line-height: 1.35;
  color: var(--accent-deep);
}
.list-summary {
  margin-top: 7px;
  font-size: var(--fs-2);
  line-height: 1.65;
  color: var(--ink-soft);
}
.list-more {
  margin-top: auto;
  padding-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-2);
  font-weight: 700;
  color: var(--accent);
}
.list-more svg { width: 14px; height: 14px; }
.empty-state {
  padding: 44px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-soft);
  font-size: var(--fs-3);
}

/* ---------- 列表说明长文 ---------- */
.list-desc {
  margin-top: 26px;
  padding: 24px 26px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.list-desc h2 {
  font-size: var(--fs-6);
  font-weight: 800;
  color: var(--accent-deep);
}
.list-desc p {
  margin-top: 10px;
  font-size: var(--fs-3);
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ---------- 分页（有真实多页时才用） ---------- */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.pager a,
.pager span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-2);
  color: var(--ink-soft);
}
.pager [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ---------- 详情页布局 ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
  margin-top: 8px;
}
.article-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  padding: 6px 0 20px;
}
.article-head h1 {
  font-size: var(--fs-9);
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent-deep);
}
.article-head .lead {
  margin-top: 12px;
  font-size: var(--fs-4);
  line-height: 1.75;
  color: var(--ink-soft);
}
.article-figure {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 4 / 3;
}
.article-figure img { width: 100%; height: 100%; object-fit: cover; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: var(--fs-2);
}
.spec-table caption {
  text-align: left;
  font-size: var(--fs-2);
  font-weight: 700;
  color: var(--ink-muted);
  padding: 0 0 8px;
}
.spec-table th,
.spec-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { width: 34%; background: var(--bg-soft); font-weight: 700; color: var(--accent-deep); }
.spec-table td { color: var(--ink-soft); }

.toc {
  position: sticky;
  top: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.toc h2 { font-size: var(--fs-3); font-weight: 800; color: var(--accent-deep); }
.toc ol { margin-top: 10px; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--ink-soft);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: #a9b6ac;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.toc a:hover { background: var(--bg-soft); color: var(--accent-strong); }
.toc a.is-current { background: var(--accent-wash); color: var(--accent-strong); font-weight: 700; }
.toc a.is-current::before { color: var(--accent); }

.article-body {
  margin-top: 26px;
  padding: 26px 30px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.article-body h2 {
  margin-top: 26px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  font-size: var(--fs-6);
  font-weight: 800;
  line-height: 1.4;
  color: var(--accent-deep);
  scroll-margin-top: 20px;
}
.article-body h2:first-child { margin-top: 0; }
.article-body p {
  margin-top: 10px;
  font-size: var(--fs-4);
  line-height: 1.95;
  color: #37423b;
}
.article-body .article-lead {
  font-size: var(--fs-4);
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 12px 16px;
}

.related { margin-top: 30px; margin-bottom: 34px; }
.related h2 { font-size: var(--fs-6); font-weight: 800; color: var(--accent-deep); }
.related-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color .16s ease, transform .16s ease;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card h3 { font-size: var(--fs-3); font-weight: 800; color: var(--accent-deep); }
.related-card p { margin-top: 4px; font-size: var(--fs-1); line-height: 1.6; color: var(--ink-soft); }

/* ---------- 内页响应式 ---------- */
@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; }
  .article-head { grid-template-columns: minmax(0, 1fr) 300px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .page-hero h1 { font-size: 36px; }
  .detail-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .toc ol { grid-template-columns: repeat(2, 1fr); }
  .article-head { grid-template-columns: 1fr; }
  .article-head .article-figure { order: -1; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .crumb { padding-top: 12px; }
  .page-hero { padding-bottom: 16px; }
  .page-hero h1 { font-size: 29px; }
  .page-hero .lead { font-size: 15px; }
  .toolbar { padding: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .list-desc { padding: 18px; }
  .article-body { padding: 18px; }
  .article-body p { font-size: 15.5px; }
  .toc ol { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .spec-table th, .spec-table td { padding: 8px 10px; }
}

/* ---------- 内页补充 ---------- */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-1);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}
.list-caption {
  margin: 0 0 12px;
  font-size: var(--fs-2);
  color: var(--ink-muted);
}
.list-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
