/* components.css — 内页复用的公共组件（列表页 / 详情页）
   首页专用样式留在 style.css；这里只放三页共享的通用件。 */

.eyebrow-gap { margin-top: 12px; }
.page-meta-gap { margin-top: 12px; }

/* ── 面包屑 ─────────────────────────────────────────────────── */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-1);
  color: var(--muted);
  padding: 14px 0 0;
}
.crumb a { color: var(--muted); border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.crumb span[aria-current] { color: var(--ink-soft); }
.crumb .sep { color: var(--line); }

/* ── 内页 hero ──────────────────────────────────────────────── */
.page-hero {
  background: var(--bg);
  padding: 18px 0 26px;
  border-bottom: 1px solid var(--line-soft);
}
.page-hero h1 {
  font-size: var(--fs-7);
  line-height: 1.32;
  color: var(--accent-strong);
  margin: 6px 0 8px;
  max-width: 780px;
}
.page-hero .lede {
  font-size: var(--fs-3);
  line-height: 1.76;
  color: var(--ink-soft);
  max-width: 820px;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: var(--fs-1);
  color: var(--muted);
}
.page-meta li { display: flex; align-items: center; gap: 5px; }
.page-meta li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
}

/* ── 筛选工具条 ─────────────────────────────────────────────── */
.toolbar {
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: 14px 18px;
  margin: 22px 0 20px;
}
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.toolbar-row + .toolbar-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.toolbar-label {
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: inherit;
  font-size: var(--fs-1);
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--accent-soft); color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf1;
}
.chip:focus-visible, .toolbar select:focus-visible, .btn-reset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toolbar select {
  font-family: inherit;
  font-size: var(--fs-1);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 6px 10px;
  cursor: pointer;
}
.btn-reset {
  font-family: inherit;
  font-size: var(--fs-1);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  margin-left: auto;
}
.btn-reset:hover { color: var(--accent); border-color: var(--accent-soft); }
.result-count { font-size: var(--fs-1); color: var(--muted); }
.result-count b { color: var(--accent); font-size: var(--fs-3); }

/* ── 卡片网格 ───────────────────────────────────────────────── */
.variety-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 24px;
  padding-bottom: 8px;
}
.variety-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.variety-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.variety-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-gold-soft); }
.variety-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.variety-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.variety-card h3 { font-size: var(--fs-4); color: var(--accent-strong); }
.variety-card p { font-size: var(--fs-2); line-height: 1.72; color: var(--ink-soft); }
.variety-card .card-link {
  margin-top: auto;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-top: 8px;
}
.variety-card .card-link::after { content: "→"; transition: transform .18s ease; }
.variety-card:hover .card-link::after { transform: translateX(3px); }

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--r-3);
  padding: 38px 20px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-3);
}
.empty-state button {
  margin-top: 12px;
  font-family: inherit;
  font-size: var(--fs-2);
  color: #fdfaf1;
  background: var(--accent);
  border: 0;
  border-radius: var(--r-pill);
  padding: 7px 18px;
  cursor: pointer;
}

/* ── 分页 ───────────────────────────────────────────────────── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 24px 0 0;
  font-size: var(--fs-2);
}
.pagination a,
.pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--ink-soft);
  background: var(--bg-elevated);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf1;
  font-weight: 700;
}
.pagination .dots { color: var(--muted); padding: 0 2px; }
.pagination .pager-total {
  margin-left: auto;
  font-size: var(--fs-1);
  color: var(--muted);
}

/* ── 相关分类横排卡 ─────────────────────────────────────────── */
.related { padding: 30px 0 6px; }
.related-head { margin-bottom: 14px; }
.related-head h2 { font-size: var(--fs-6); color: var(--accent-strong); margin-top: 2px; }
.related-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.related-card {
  border-top: 2px solid var(--bg-gold);
  padding-top: 8px;
  display: block;
}
.related-card strong { display: block; font-size: var(--fs-3); color: var(--accent-strong); margin-bottom: 3px; }
.related-card span { font-size: var(--fs-1); line-height: 1.68; color: var(--muted); }
.related-card:hover strong { color: var(--accent); }

/* ── 列表说明长文 ───────────────────────────────────────────── */
.list-description {
  background: var(--bg-mint);
  border-radius: var(--r-3);
  padding: 26px 30px;
  margin: 30px 0 0;
}
.list-description h2 { font-size: var(--fs-5); color: var(--accent-strong); margin-bottom: 10px; }
.list-description p {
  font-size: var(--fs-2);
  line-height: 1.92;
  color: var(--ink-soft);
  max-width: 78ch;
}
.list-description p + p { margin-top: 12px; }

/* ── 详情页 ─────────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 52px;
  align-items: start;
  padding: 26px 0 10px;
}
.article-head {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 20px;
  margin-bottom: 22px;
}
.article-head h1 {
  font-size: var(--fs-7);
  line-height: 1.34;
  color: var(--accent-strong);
  margin: 6px 0 8px;
}
.article-head .lede { font-size: var(--fs-3); line-height: 1.78; color: var(--ink-soft); max-width: 74ch; }

.fact-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  overflow: hidden;
  margin-top: 18px;
}
.fact-bar div { background: var(--bg-elevated); padding: 10px 14px; }
.fact-bar dt { font-size: var(--fs-1); color: var(--muted); margin-bottom: 2px; }
.fact-bar dd { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--accent-strong); }

.body-figure { margin: 20px 0 4px; }
.body-figure img { width: 100%; height: auto; border-radius: var(--r-3); display: block; }

.article { max-width: 100%; }
.article section + section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.article h2 {
  font-size: var(--fs-5);
  color: var(--accent-strong);
  margin-bottom: 10px;
  scroll-margin-top: 20px;
}
.article p {
  font-size: var(--fs-3);
  line-height: 1.94;
  color: var(--ink-soft);
  max-width: 74ch;
}
.article p + p { margin-top: 12px; }
.article a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.article a:hover { border-bottom-color: var(--accent); }

/* 目录 */
.toc {
  position: sticky;
  top: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: 16px 18px;
}
.toc-title { font-size: var(--fs-1); font-weight: 700; letter-spacing: 0.1em; color: var(--accent-soft); margin-bottom: 8px; }
.toc ol { counter-reset: toc; display: grid; gap: 2px; }
.toc a {
  display: block;
  font-size: var(--fs-2);
  color: var(--ink-soft);
  padding: 5px 0 5px 20px;
  position: relative;
  border-left: 2px solid transparent;
}
.toc a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-size: var(--fs-1);
  color: var(--accent-soft);
}
.toc a:hover, .toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc-toggle { display: none; cursor: pointer; }

/* 兄弟品种 */
.sibling { padding: 30px 0 6px; }
.sibling-head { margin-bottom: 14px; }
.sibling-head h2 { font-size: var(--fs-6); color: var(--accent-strong); margin-top: 2px; }
.sibling-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sibling-card { display: block; border: 1px solid var(--line-soft); border-radius: var(--r-3); overflow: hidden; background: var(--bg-elevated); }
.sibling-card .thumb { aspect-ratio: 16 / 10; background: var(--bg-gold-soft); overflow: hidden; }
.sibling-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sibling-card .body { padding: 10px 14px 12px; }
.sibling-card strong { display: block; font-size: var(--fs-3); color: var(--accent-strong); }
.sibling-card span { font-size: var(--fs-1); line-height: 1.66; color: var(--muted); }
.sibling-card:hover strong { color: var(--accent); }

/* ── 面包屑/页面容器通用 ────────────────────────────────────── */
.inner-main { background: var(--bg); }

@media (max-width: 1199px) {
  .variety-grid { grid-template-columns: repeat(2, 1fr); }
  .related-cols { grid-template-columns: repeat(3, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 22px; }
  .article-layout > aside { order: -1; }
  .toc { position: static; }
  .toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: var(--fs-2);
    font-weight: 700;
    color: var(--accent-strong);
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 6px 14px;
    margin-bottom: 8px;
  }
  .toc-toggle::after { content: "▾"; font-size: 9px; color: var(--accent-soft); }
  .toc.is-collapsed { display: none; }
  .sibling-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .page-hero { padding: 12px 0 20px; }
  .page-hero h1 { font-size: var(--fs-6); }
  .toolbar { padding: 12px 14px; }
  .chip-group { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; max-width: 100%; }
  .btn-reset { margin-left: 0; }
  .variety-grid { grid-template-columns: 1fr; }
  .related-cols { grid-template-columns: 1fr 1fr; }
  .fact-bar { grid-template-columns: 1fr 1fr; }
  .article-head h1 { font-size: var(--fs-6); }
  .list-description { padding: 20px; }
  .toc ol { grid-template-columns: 1fr 1fr; }
  .sibling-cols { grid-template-columns: 1fr; }
  .pagination .pager-total { margin-left: 0; width: 100%; }
}
