/* ===========================================================
   内页组件（分类页 / 详情页）
   仅使用 tokens.css 的变量；首页专用样式在 style.css，不在此文件
   =========================================================== */

/* ---- 面包屑 ---- */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 22px 0 0;
  font-size: var(--fs-5);
  color: var(--ink-3);
}
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.crumb li { display: inline-flex; align-items: center; gap: 8px; }
.crumb li + li::before { content: "/"; color: var(--line-amber); }
.crumb [aria-current="page"] { color: var(--ink); }

/* ---- 分类页头部 ---- */
.page-hero {
  padding: 18px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.page-hero h1 {
  font-size: var(--fs-17);
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.2;
}
.page-hero .page-lead {
  margin-top: 12px;
  max-width: 720px;
  font-size: var(--fs-11);
  line-height: 1.9;
  color: var(--ink-2);
}
.page-hero .kw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.kw-row li {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--fs-5);
  color: var(--ink-2);
}

/* ---- 筛选与排序工具条 ---- */
.toolbar {
  position: sticky;
  top: 77px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.toolbar-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: inherit;
  font-size: var(--fs-6);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.chip-btn:hover { background: var(--hover-tint); }
.chip-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.toolbar select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-s);
  background: var(--surface);
  font: inherit;
  font-size: var(--fs-6);
  color: var(--ink);
  cursor: pointer;
}
.result-count { font-size: var(--fs-6); color: var(--ink-3); }
.sort-label { font-size: var(--fs-6); color: var(--ink-3); }

/* ---- 分类页卡片网格 ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 26px 0 0;
}
.entry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: var(--line); }
.entry-card[hidden] { display: none; }
.entry-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--card-bg);
}
.entry-media img { width: 100%; height: 100%; object-fit: cover; }
.entry-tag {
  position: absolute;
  top: 10px; left: 10px;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-s);
  background: rgba(34, 28, 23, .72);
  color: var(--ink-invert);
  font-size: var(--fs-2);
  letter-spacing: .5px;
}
.entry-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
.entry-body h2 { font-size: var(--fs-10); font-weight: 800; line-height: 1.45; }
.entry-body p { font-size: var(--fs-6); line-height: 1.75; color: var(--ink-2); }
.entry-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--fs-5);
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
}

/* ---- 分类说明 / SEO 正文块 ---- */
.list-description {
  padding: 34px 0 8px;
  max-width: 860px;
}
.list-description h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-14);
  font-weight: 800;
  margin-bottom: 12px;
}
.list-description h2::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 3px;
  background: var(--accent-strong);
}
.list-description p {
  font-size: var(--fs-7);
  line-height: 2;
  color: var(--ink-2);
}
.list-description p + p { margin-top: 12px; }

/* ---- 其他品类入口 ---- */
.cat-more-title { margin-top: 34px; }
.cat-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 26px;
  padding: 26px 0 0;
}
.cat-links li {
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}
.cat-links a { font-size: var(--fs-7); font-weight: 700; }
.cat-links a:hover { color: var(--accent-ink); }
.cat-links span { display: block; font-size: var(--fs-5); color: var(--ink-2); margin-top: 2px; }

/* ---- 分页 ---- */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 28px 0 0;
}
.pager button,
.pager a {
  min-width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-s);
  background: var(--surface);
  font: inherit; font-size: var(--fs-6);
  color: var(--ink-2);
  cursor: pointer;
}
.pager [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.pager [disabled] { opacity: .45; cursor: not-allowed; }

/* ---- 详情页布局 ---- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 280px;
  justify-content: space-between;
  gap: 32px;
  align-items: start;
}
.article-head { padding-top: 20px; }
.article-head h1 {
  font-size: 38px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: .4px;
}
.article-head .article-lead {
  margin-top: 14px;
  font-size: var(--fs-11);
  line-height: 1.9;
  color: var(--ink-2);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: var(--fs-5);
  color: var(--ink-3);
}
.article-figure {
  margin: 22px 0 0;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--card-bg);
}
.article-figure img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; }
.article-figure figcaption { padding: 8px 2px 0; font-size: var(--fs-3); color: var(--ink-3); }

/* ---- 文章正文排版 ---- */
.article { padding-top: 26px; }
.article > p {
  font-size: var(--fs-10);
  line-height: 2;
  color: var(--ink);
}
.article > p + p { margin-top: 14px; }
.article h2 {
  margin: 34px 0 10px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
  scroll-margin-top: 96px;
}
.article h2::before {
  content: "";
  display: inline-block;
  width: 4px; height: 16px;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--accent-strong);
  vertical-align: -2px;
}
.article p { font-size: var(--fs-10); line-height: 2; color: var(--ink-2); }
.article p + p { margin-top: 12px; }
.article strong { color: var(--ink); font-weight: 700; }

/* ---- 详情页规格表 ---- */
.spec-table {
  width: 100%;
  margin: 18px 0 6px;
  border-collapse: collapse;
  font-size: var(--fs-7);
}
.spec-table caption {
  text-align: left;
  font-size: var(--fs-6);
  color: var(--ink-3);
  padding-bottom: 8px;
}
.spec-table th, .spec-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.spec-table thead th { background: var(--note-bg); font-weight: 700; color: var(--ink); }
.spec-table tbody th { font-weight: 700; }
.spec-table tbody tr:nth-child(odd) td { background: rgba(251, 241, 228, .5); }

/* ---- 目录 ---- */
.toc {
  position: sticky;
  top: 100px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
}
.toc h2 { font-size: var(--fs-8); font-weight: 800; margin-bottom: 10px; }
.toc ol { counter-reset: toc; display: flex; flex-direction: column; gap: 8px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 8px;
  font-size: var(--fs-6);
  color: var(--ink-2);
  line-height: 1.6;
}
.toc a::before {
  content: counter(toc);
  flex: none;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--accent-ink);
  font-size: var(--fs-2);
  font-weight: 700;
  margin-top: 2px;
}
.toc a:hover { color: var(--accent-ink); }
.toc a.is-active { color: var(--ink); font-weight: 700; }

/* ---- 相关条目 ---- */
.related { padding: 40px 0 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 14px;
}
.related-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  transition: box-shadow .18s ease, transform .18s ease;
}
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.related-media {
  flex: none;
  width: 132px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--card-bg);
}
.related-media img { width: 100%; height: 100%; object-fit: cover; }
.related-body h3 { font-size: var(--fs-8); font-weight: 700; line-height: 1.5; }
.related-body p { margin-top: 4px; font-size: var(--fs-5); color: var(--ink-2); line-height: 1.7; }

/* ---- 内页响应式 ---- */
@media (max-width: 1180px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-head h1 { font-size: 32px; }
  .toolbar { top: 67px; }
}

@media (max-width: 900px) {
  .page-hero h1 { font-size: 32px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; order: -1; }
  .cat-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .page-hero { padding: 12px 0 20px; }
  .page-hero h1 { font-size: 27px; }
  .page-hero .page-lead { font-size: var(--fs-7); }
  .card-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .toolbar { top: 67px; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .toolbar-group { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .toolbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .article-head h1 { font-size: 26px; }
  .article h2 { font-size: 18px; }
  .article > p, .article p { font-size: var(--fs-7); line-height: 1.95; }
  .list-description { padding-top: 26px; }
  .cat-links { grid-template-columns: minmax(0, 1fr); }
  .related-card { flex-direction: column; }
  .related-media { width: 100%; }
  .spec-table { display: block; overflow-x: auto; white-space: nowrap; }
}
