/* ==========================================================================
   components.css — 三页共用组件的补充样式
   首页布局在 style.css；内页（分类页 / 详情页）组件在这里。
   颜色、字号、圆角一律引用 tokens.css 的变量。
   ========================================================================== */

/* ---------------------------------------------------------------- 面包屑 */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

.crumb a { color: var(--ink-muted); border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--green-soft); border-bottom-color: var(--accent); }
.crumb .sep { color: var(--ink-faint); }
.crumb [aria-current="page"] { color: var(--ink); font-weight: var(--fw-medium); }

/* --------------------------------------------------------------- 分类页头 */
.page-hero {
  padding: 28px 0 30px;
  background: linear-gradient(180deg, rgba(25, 64, 50, 0.05) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.page-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-top: 18px;
}

.page-hero h1 {
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -1px;
}

.page-lead {
  max-width: 760px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-muted);
}

.page-facts {
  display: flex;
  flex: none;
  gap: 30px;
  padding-bottom: 3px;
}

.page-facts div { text-align: right; }
.page-facts dt { font-size: 11.5px; color: var(--ink-faint); }
.page-facts dd {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: var(--fw-black);
  color: var(--green-soft);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ 筛选工具条 */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(247, 245, 239, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding-top: 9px;
  padding-bottom: 9px;
  flex-wrap: wrap;
}

.filter-label {
  flex: none;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-chip {
  height: 31px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover { border-color: var(--green-soft); color: var(--green-soft); }
.filter-chip[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green-soft);
  color: #fff;
}

.toolbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.toolbar-end label { font-size: 12.5px; color: var(--ink-muted); cursor: pointer; }

.sort-select {
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.result-count {
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------- 列表卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(25, 64, 50, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.entry-card[hidden] { display: none; }

.entry-link { display: flex; flex-direction: column; height: 100%; padding: 18px; }

.entry-tag {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-chip);
  color: var(--green-chip-ink);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.entry-title {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.2px;
}

.entry-summary {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-muted);
}

.entry-spec {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--green-chip-ink);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------- 列表说明 */
.list-description {
  padding: 26px 30px 28px;
  background: var(--bg-card);
  border: 1px solid rgba(25, 64, 50, 0.08);
  border-radius: var(--radius);
}

.list-description h2 { font-size: 21px; line-height: 1.4; }
.list-description p {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-body);
  max-width: 1040px;
}

/* --------------------------------------------------------------- 相关分类 */
.related-taxonomy { display: flex; flex-wrap: wrap; gap: 10px; }

.related-taxonomy a {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--ink-body);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.related-taxonomy a:hover { background: var(--green-soft); border-color: var(--green-soft); color: #fff; }

/* ------------------------------------------------------------------ 详情页 */
.article-head { padding: 26px 0 24px; background: linear-gradient(180deg, rgba(25, 64, 50, 0.05), var(--bg)); border-bottom: 1px solid var(--line); }
.article-head h1 { margin-top: 14px; font-size: 40px; line-height: 1.2; letter-spacing: -1px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--green-chip-ink);
  font-variant-numeric: tabular-nums;
}
.article-note { margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--ink-muted); max-width: 860px; }

.article-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  padding: 30px 0 20px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(25, 64, 50, 0.08);
  border-radius: var(--radius);
}

.toc h2 { font-size: 13px; letter-spacing: 0.08em; color: var(--ink-muted); }

.toc ol { margin-top: 10px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li + li { margin-top: 7px; }

.toc a {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-body);
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a::before { content: counter(toc, decimal-leading-zero) "  "; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--green-soft); border-left-color: var(--accent); }
.toc a.is-active { color: var(--green-soft); border-left-color: var(--green-soft); font-weight: var(--fw-medium); }

.article-body h2 {
  margin-top: 30px;
  padding-top: 2px;
  font-size: 22px;
  line-height: 1.45;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

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

.article-body p {
  margin-top: 11px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-body);
}

.article-body .article-lead {
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink);
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

/* ------------------------------------------------------------------ 规格表 */
.spec-table { margin-top: 16px; width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table caption { text-align: left; font-size: 12.5px; color: var(--ink-muted); padding-bottom: 10px; }
.spec-table th, .spec-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.spec-table th {
  width: 40%;
  background: rgba(25, 64, 50, 0.04);
  font-weight: var(--fw-medium);
  color: var(--ink);
}
.spec-table td { font-variant-numeric: tabular-nums; color: var(--ink-body); }
.spec-table tbody tr:hover { background: rgba(207, 148, 34, 0.06); }

/* --------------------------------------------------------------- 相关条目 */
.related-entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; }

.related-card {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid rgba(25, 64, 50, 0.08);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.related-card h3 { font-size: 14.5px; line-height: 1.45; }
.related-card p { margin-top: 6px; font-size: 12px; line-height: 1.7; color: var(--ink-muted); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .article-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 30px; }
}

@media (max-width: 980px) {
  .page-hero h1 { font-size: 32px; }
  .article-head h1 { font-size: 32px; }
  .page-hero-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .page-facts { gap: 26px; }
  .page-facts div { text-align: left; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 22px; }
  .toc { position: static; }
  .related-entries { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .page-hero { padding: 22px 0 24px; }
  .page-hero h1 { font-size: 27px; }
  .article-head h1 { font-size: 27px; }
  .card-grid { grid-template-columns: 1fr; }
  .list-description { padding: 20px 18px 22px; }
  .list-description h2 { font-size: 18px; }
  .toolbar-inner { gap: 10px; }
  .toolbar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .spec-table th { width: 46%; }
}

/* ------------------------------------------------------- 内页补充（环节 6） */
.article-body .article-heading { margin-bottom: 14px; }

.article-body .spec-title {
  margin-top: 30px;
  padding-top: 2px;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: var(--fw-semibold, 600);
  letter-spacing: -0.2px;
}

a.related-card { display: block; color: inherit; }
a.related-card h3 { color: var(--ink); }
a.related-card:hover h3 { color: var(--green-soft); }

.article-body h2[id], .article-body h3[id] { scroll-margin-top: calc(var(--header-h) + 20px); }

@media (max-width: 640px) {
  .article-body .spec-title { font-size: 18px; }
  .article-body p { font-size: 13.5px; line-height: 1.95; }
}

.list-description .desc-sub {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: var(--fw-semibold, 600);
}

/* --------------------------------------------------- 数据对接补充（site156） */
.filter-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.filter-chip[aria-current="page"] {
  background: var(--green-soft);
  border-color: var(--green-soft);
  color: #fff;
}

.entry-thumb {
  display: block;
  margin-bottom: 12px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-chip);
}

.entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-title,
.entry-summary {
  overflow-wrap: break-word;
  word-break: break-word;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}

.pager a,
.pager-current,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12.5px;
  color: var(--ink-body);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

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

.pager-current {
  background: var(--green-soft);
  border-color: var(--green-soft);
  color: #fff;
}

.pager-gap {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
}

.pager-info {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.article-body figure,
.article-figure {
  margin: 20px 0;
}

.article-body figure img,
.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .pager-info { margin-left: 0; width: 100%; }
  .article-body figure img,
  .article-figure img { aspect-ratio: 4 / 3; }
}

