/* components.css — 内页（category.html / detail.html）专用组件
   颜色 / 字号 / 圆角一律取 tokens.css 与 style.css 的变量，不再写字面量。
   首页共享：.site-header / .site-nav / .brand / .site-footer / .container / .section-head / .section-sub
*/

/* ------------------------------------------------------------- 面包屑 */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}

.crumb a { color: var(--ink-muted); border-bottom: 1px solid transparent; }
.crumb a:hover { color: var(--green-deep); border-bottom-color: var(--accent); }
.crumb .sep { color: #b3b8a9; }
.crumb [aria-current="page"] { color: var(--ink-strong); font-weight: 700; }

/* --------------------------------------------------------- 页面标题区 */
.page-hero {
  padding: 26px 0 30px;
  background: var(--bg-band);
  border-bottom: 1px solid var(--line);
}

.page-hero-inner {
  display: grid;
  grid-template-columns: 1fr 372px;
  gap: 48px;
  align-items: end;
  margin-top: 18px;
}

.page-hero h1 {
  font-size: 42px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--ink-strong);
}

.page-lead {
  max-width: 640px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--ink-muted);
}

.page-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.page-facts > div { padding: 12px 14px; background: var(--bg-card); }
.page-facts dt { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.4px; }
.page-facts dd {
  margin: 4px 0 0;
  font-size: 21px;
  font-weight: 800;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- 筛选 / 排序 */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

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

.filter-label { flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink-strong); }

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

.filter-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.filter-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-chip[aria-pressed="true"],
.filter-chip[aria-current="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }

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

.sort-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-muted); }

.sort-field select {
  height: 30px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sort-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-label { cursor: default; }

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

/* ------------------------------------------------------------ 营位网格 */
.list-section { padding: 30px 0 8px; }

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.list-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(38, 56, 36, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.list-card[hidden] { display: none; }
.list-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(38, 56, 36, 0.12); }

.list-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #dfe2d2; }
.list-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.list-card:hover .list-media img { transform: scale(1.03); }

.list-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(40, 74, 46, 0.88);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.list-body { display: flex; flex-direction: column; flex: 1; padding: 13px 15px 15px; }
.list-body h2 { font-size: 16px; font-weight: 800; color: var(--ink-strong); line-height: 1.35; }
.list-body p { flex: 1; margin-top: 6px; font-size: 12px; line-height: 1.68; color: var(--ink-muted); }

.list-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #5b6455;
}

.list-spec .dot { color: #b3b8a9; }

.empty-state {
  display: none;
  padding: 46px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-muted);
}

.empty-state.is-visible { display: block; }
.empty-state p { margin-bottom: 12px; font-size: 14px; }
.empty-state .filter-chip { height: 32px; }

/* -------------------------------------------------------- 分类说明长文 */
.list-desc { padding: 34px 0 30px; margin-top: 30px; border-top: 1px solid var(--line); }

.list-desc-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-areas:
    "head body"
    "note body";
  gap: 12px 52px;
  align-items: start;
}

.list-desc h2 {
  position: relative;
  grid-area: head;
  padding-left: 38px;
  font-size: 24px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--ink-strong);
}

.list-desc h2::before {
  content: "06";
  position: absolute;
  left: 0;
  top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 24px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.list-desc-body { grid-area: body; }
.list-desc-body p { font-size: 13px; line-height: 1.85; color: var(--ink); }
.list-desc-body p + p { margin-top: 14px; }

.list-desc .desc-lead {
  grid-area: note;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-faint);
}

/* --------------------------------------------------------- 其他场景 */
.related-tax { padding: 24px 0 34px; border-top: 1px solid var(--line); }

.related-tax ul { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.related-tax .tax-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.related-tax .tax-link:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--bg-card); }
.related-tax .tax-link .count { font-size: 10.5px; color: var(--ink-faint); }

/* --------------------------------------------------------- 详情页头部 */
.article-head { padding: 24px 0 0; }

.article-head h1 {
  margin-top: 14px;
  font-size: 40px;
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--ink-strong);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-muted);
}

.article-meta .dot { color: #b3b8a9; }

.article-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.article-figure { margin: 18px 0 0; overflow: hidden; border-radius: var(--radius); aspect-ratio: 16 / 7; background: #cfd5c2; }
.article-figure img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------- 详情页正文 */
.article-layout {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 44px;
  align-items: start;
  padding: 26px 0 20px;
}

.toc { position: sticky; top: calc(var(--header-h) + 18px); }

.toc-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.toc-title-btn {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.toc ol { margin-top: 12px; counter-reset: toc; }
.toc li { counter-increment: toc; }

.toc a {
  display: flex;
  gap: 8px;
  padding: 6px 0 6px 10px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font-size: 10.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.toc a:hover { color: var(--accent-dark); border-left-color: var(--accent); }
.toc a[aria-current="true"] { color: var(--green-deep); border-left-color: var(--green-deep); font-weight: 700; }
.toc a[aria-current="true"]::before { color: var(--green-deep); }

.article-lede {
  padding: 16px 18px;
  background: var(--green-wash);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.8;
  color: #35402f;
}

.article-body { margin-top: 20px; }

.article-body h2 {
  margin: 26px 0 10px;
  padding-top: 6px;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: var(--ink-strong);
  scroll-margin-top: 0;
}

.article-body h2:first-of-type { margin-top: 6px; }
.article-body p { font-size: 14px; line-height: 1.92; color: #39432f; }
.article-body p + p { margin-top: 12px; }

.article-body figure.article-inline {
  margin: 18px 0 4px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #dfe2d2;
}

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

/* ------------------------------------------------------------ 规格表 */
.spec-block { margin-top: 26px; }

.spec-hint { margin-top: 6px; font-size: 11.5px; color: var(--ink-faint); }

.spec-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 12.5px;
}

.spec-table th,
.spec-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-table);
  text-align: left;
}

.spec-table th { width: 40%; font-weight: 700; color: var(--ink-strong); background: #f7f6ee; }
.spec-table td { color: #3d4739; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- 相关条目 */
.related { padding: 26px 0 34px; border-top: 1px solid var(--line); }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 16px; }

.related-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(38, 56, 36, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.related-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(38, 56, 36, 0.12); }

.related-thumb { flex: none; width: 96px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: #dfe2d2; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }

.related-card h3 { font-size: 14px; font-weight: 800; color: var(--ink-strong); line-height: 1.35; }
.related-card p { margin-top: 4px; font-size: 11.5px; line-height: 1.6; color: var(--ink-muted); }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .page-hero-inner { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .page-facts { max-width: 480px; }
  .list-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 200px 1fr; gap: 30px; }
  .list-desc-grid { grid-template-columns: 240px 1fr; gap: 12px 34px; }
}

@media (max-width: 980px) {
  .list-desc-grid { grid-template-columns: 1fr; grid-template-areas: "head" "body" "note"; gap: 12px; }
  .article-layout { grid-template-columns: 1fr; gap: 18px; }
  .toc { position: static; }
  .toc-title { display: none; }
  .toc-title-btn { display: flex; }
  .toc ol { display: none; margin-top: 10px; }
  .toc.is-open ol { display: block; }
  .related-grid { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 34px; }
  .article-head h1 { font-size: 32px; }
}

@media (max-width: 640px) {
  .page-hero { padding: 20px 0 22px; }
  .page-hero-inner { margin-top: 14px; }
  .page-hero h1 { font-size: 27px; }
  .page-lead { font-size: 12.5px; }
  .page-facts { grid-template-columns: 1fr 1fr 1fr; }
  .page-facts dd { font-size: 18px; }
  .toolbar { position: static; }
  .toolbar-inner { gap: 9px 10px; }
  .filter-chip { height: 28px; padding: 0 11px; font-size: 11.5px; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .list-grid { grid-template-columns: 1fr; gap: 14px; }
  .list-desc h2 { font-size: 20px; padding-left: 38px; }
  .list-desc-body p { font-size: 12.5px; }
  .article-head h1 { font-size: 25px; }
  .article-layout { padding-top: 18px; }
  .article-lede { font-size: 13px; padding: 13px 14px; }
  .article-body h2 { font-size: 18px; }
  .article-body p { font-size: 13px; line-height: 1.86; }
  .spec-table { font-size: 11.5px; }
  .spec-table th { width: 44%; }
  .related-thumb { width: 80px; }
}

/* ------------------------------------------------------------ 导航下拉（动态分类） */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a { display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  min-width: 176px;
  max-height: 360px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fdfdfa;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 14px 28px rgba(32, 48, 32, .14);
  z-index: 70;
}
.dropdown-menu li { list-style: none; }
.dropdown-menu a {
  display: block;
  padding: 7px 16px;
  font-size: 12.5px;
  color: #414b3f;
  border-bottom: none;
  white-space: nowrap;
}
.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: var(--green-wash);
  color: var(--accent-dark);
  border-bottom-color: transparent;
}
.nav-item:hover .dropdown-menu { display: block; }

/* ------------------------------------------------------------ 页脚四栏 */
.footer-cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 22px 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.footer-col { flex: 1 1 170px; min-width: 150px; }
.footer-col-brand { flex: 1 1 300px; min-width: 240px; }
.footer-col .footer-tag { margin-top: 6px; padding-left: 0; border-left: none; }
.footer-cats { list-style: none; margin: 7px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; line-height: 1.5; }
.footer-cats a { color: #c9d2c2; }
.footer-cats a:hover { color: #9ecb6a; }
.footer-cols .footer-label { margin: 0 0 2px; }

@media (max-width: 980px) {
  .site-nav.is-open .nav-item { flex-direction: column; align-items: stretch; width: 100%; }
  .site-nav.is-open .dropdown-menu {
    position: static;
    display: block;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0 0 4px 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .site-nav.is-open .dropdown-menu a { padding: 6px 0; font-size: 12.5px; color: #5c6a58; }
}

@media (max-width: 640px) {
  .footer-cols { flex-direction: column; gap: 16px; }
  .footer-col,
  .footer-col-brand { flex: none; }
}

/* ------------------------------------------------------------ 分页导航 */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pager-step,
.pager-num,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--bg-card);
  color: var(--ink-muted);
  font-size: var(--fs-5);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pager-step { padding: 0 13px; font-weight: 700; color: var(--ink); }
.pager-num:hover,
.pager-step:hover { border-color: var(--accent); color: var(--accent-dark); }
.pager-num:focus-visible,
.pager-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

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

.pager-step.is-disabled {
  color: var(--ink-faint);
  background: transparent;
  border-color: var(--line);
  cursor: default;
}

@media (max-width: 640px) {
  .pager { gap: 5px; margin-top: 20px; }
  .pager-step,
  .pager-num { min-width: 29px; height: 29px; padding: 0 8px; font-size: var(--fs-4); }
  .pager-step { padding: 0 10px; }
}
