/* ==========================================================================
   components.css — 农产绿叶蔬菜类大全 · 复用组件
   首页 / 分类页 / 详情页共用；按钮、卡片、页头页脚同构
   ========================================================================== */

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background: var(--c-green-600);
  color: #fff;
  border: 1px solid var(--c-green-600);
}
.btn-primary:hover { background: var(--c-green-700); border-color: var(--c-green-700); }
.btn-ghost {
  background: transparent;
  color: var(--c-green-800);
  border: 1px solid rgba(38, 87, 43, 0.24);
}
.btn-ghost:hover { background: rgba(38, 87, 43, 0.06); border-color: rgba(38, 87, 43, 0.4); }

/* -------------------------------------------------------------- card bases */
.cat-item,
.feat-card,
.alias-item {
  transition: transform 0.24s var(--ease);
}
.cat-item:hover,
.feat-card:hover { transform: translateY(-2px); }

/* --------------------------------------------------------------- page-hero */
.page-hero {
  padding: 34px 0 26px;
  background:
    radial-gradient(110% 120% at 88% 0%, #f1f7e0 0%, rgba(241, 247, 224, 0) 62%),
    linear-gradient(170deg, var(--c-hero-bg-2) 0%, var(--c-surface) 78%);
  border-bottom: 1px solid var(--c-line-soft);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--c-ink-4);
}
.crumb a { color: var(--c-ink-3); }
.crumb a:hover { color: var(--c-green-700); }
.crumb span[aria-current] { color: var(--c-green-700); font-weight: 600; }

.page-hero h1 {
  margin-top: 12px;
  font-size: 32px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-green-900);
}
.page-hero .lead {
  margin-top: 10px;
  max-width: 740px;
  font-size: 13px;
  line-height: 1.86;
  color: var(--c-ink-2);
}
.page-hero .meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--c-ink-4);
}
.page-hero .meta-row b { color: var(--c-green-700); font-weight: 600; }

/* ------------------------------------------------------------ filter toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  padding: 12px 0;
  background: rgba(254, 254, 252, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-line-soft);
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 11px; color: var(--c-ink-4); letter-spacing: 0.04em; }
label.filter-label { cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-ink-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: rgba(38, 87, 43, 0.34); }
.chip[aria-pressed="true"] {
  background: var(--c-green-600);
  border-color: var(--c-green-600);
  color: #fff;
  font-weight: 600;
}
.toolbar-tail { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.sort-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-ink-2);
  font: inherit;
  font-size: 11.5px;
}
.clear-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  font: inherit;
  font-size: 11.5px;
  color: var(--c-green-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-count { font-size: 11.5px; color: var(--c-ink-4); }
.result-count b { color: var(--c-green-700); font-weight: 700; }

/* ------------------------------------------------------------- variety grid */
.grid-section { padding: 28px 0 34px; }
.variety-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 20px;
  align-items: stretch;
}
.variety-grid > li { display: flex; }
.variety-grid > li[hidden] { display: none; }
.variety-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), border-color 0.24s var(--ease);
}
.variety-card:hover {
  transform: translateY(-3px);
  border-color: rgba(38, 87, 43, 0.2);
  box-shadow: var(--sh-card);
}
.variety-thumb { display: block; background: var(--c-band); }
.variety-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.variety-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.variety-card h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--c-green-900);
  letter-spacing: -0.01em;
}
.variety-card p {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--c-ink-3);
  flex: 1;
}
.variety-tags { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: #eef4e2;
  color: var(--c-green-700);
  font-size: 10px;
  line-height: 1.6;
}
.tag-alt { background: #f6f1e2; color: #7a6a30; }
.empty-hint {
  display: none;
  padding: 34px 0;
  text-align: center;
  font-size: 13px;
  color: var(--c-ink-4);
}
.empty-hint.is-on { display: block; }

/* -------------------------------------------------------- related categories */
.related {
  padding: 26px 0 30px;
  background: var(--c-surface-3);
  border-top: 1px solid var(--c-line-soft);
}
.related-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.related-card {
  display: block;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.related-card:hover { border-color: rgba(38, 87, 43, 0.22); transform: translateY(-2px); }
.related-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-green-900);
}
.related-card p { margin-top: 3px; font-size: 11px; line-height: 1.7; color: var(--c-ink-4); }

/* --------------------------------------------------------- list description */
.list-description {
  padding: 34px 0 42px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line-soft);
}
.list-description .prose { max-width: 760px; }
.list-description h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-green-900);
  letter-spacing: -0.015em;
}
.list-description p {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.92;
  color: var(--c-ink-2);
}

/* ------------------------------------------------------------- article head */
.article-head {
  padding: 26px 0 24px;
  background:
    radial-gradient(110% 130% at 84% 0%, #eff6db 0%, rgba(239, 246, 219, 0) 60%),
    linear-gradient(170deg, var(--c-hero-bg-2) 0%, var(--c-surface) 82%);
  border-bottom: 1px solid var(--c-line-soft);
}
.article-head h1 {
  margin-top: 10px;
  max-width: 900px;
  font-size: 33px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.026em;
  color: var(--c-green-900);
}
.article-head .lead {
  margin-top: 11px;
  max-width: 760px;
  font-size: 13.5px;
  line-height: 1.86;
  color: var(--c-ink-2);
}
.article-head .meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--c-ink-4);
}
/* ------------------------------------------------------------ article layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 250px;
  gap: 56px;
  align-items: start;
  padding: 34px 0 44px;
}
.article-toc {
  position: sticky;
  top: 24px;
  padding: 16px 16px 18px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-md);
}
.article-toc h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-ink-4);
  text-transform: uppercase;
}
.article-toc ol { margin-top: 9px; display: flex; flex-direction: column; gap: 1px; counter-reset: toc; }
.article-toc li { counter-increment: toc; }
.article-toc a {
  display: block;
  padding: 5px 0 5px 20px;
  position: relative;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-ink-3);
  border-left: 1px solid var(--c-line);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 7px;
  font: 600 9.5px/1.9 var(--f-num);
  color: var(--c-green-300);
}
.article-toc a:hover { color: var(--c-green-700); }
.article-toc a.is-active {
  color: var(--c-green-800);
  font-weight: 600;
  border-left-color: var(--c-green-500);
}
.article-body h2 {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line-soft);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--c-green-900);
  scroll-margin-top: 20px;
}
.article-body h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.article-body p {
  margin-top: 11px;
  font-size: 13.5px;
  line-height: 1.94;
  color: var(--c-ink-2);
}

/* --------------------------------------------------------- related varieties */
.related-vars {
  padding: 26px 0 34px;
  background: var(--c-surface-3);
  border-top: 1px solid var(--c-line-soft);
}
.related-vars .row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}

/* -------------------------------------------------------------------- pager */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line-soft);
}
.pager-num,
.pager-step,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font: 600 12px/1 var(--f-num);
  color: var(--c-ink-2);
}
.pager-num:hover,
.pager-step:hover { border-color: var(--c-green-500); color: var(--c-green-700); }
.pager-num.is-current {
  border-color: var(--c-green-600);
  background: var(--c-green-700);
  color: var(--c-on-dark);
}
.pager-step { padding: 0 12px; font-family: var(--f-sans); }
.pager-step.is-disabled { color: var(--c-ink-4); background: var(--c-surface-2); pointer-events: none; }
.pager-gap { border: 0; background: none; color: var(--c-ink-4); }

/* --------------------------------------------------------- article body media */
.article-body figure {
  margin: 22px 0 0;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-band);
}
.article-body figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .variety-grid { grid-template-columns: repeat(3, 1fr); }
  .related-cols { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 24px; padding-bottom: 34px; }
  .article-toc { position: static; }
  .article-toc ol { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .article-toc a {
    padding: 4px 10px 4px 24px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-pill);
  }
  .article-toc a::before { left: 8px; }
  .article-toc a.is-active { border-color: var(--c-green-500); background: #eef4e2; }
  .page-hero h1, .article-head h1 { font-size: 28px; }
  .related-vars .row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .toolbar { position: static; }
  .toolbar-inner { gap: 10px; }
  .toolbar-tail { margin-left: 0; width: 100%; justify-content: space-between; }
  .variety-grid { grid-template-columns: 1fr; }
  .related-cols { grid-template-columns: 1fr; }
  .page-hero h1, .article-head h1 { font-size: 23px; }
  .btn { height: 34px; padding: 0 14px; }
  .article-body p { font-size: 14.5px; line-height: 1.9; }
}

/* --------------------------------------------------------------- utilities */
.lead-note { margin: 6px 0 14px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
