/* components.css — 种植农具大全 公共组件 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; font-family: var(--font-serif); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand-deep); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  transition: top .16s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- eyebrow / 小标签 ---------- */
.eyebrow {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover, .btn--accent:focus-visible { background: var(--brand-deep); }
.btn--ghost { background: transparent; color: var(--brand-deep); border-color: var(--brand-deep); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: rgba(40, 88, 51, .08); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- 页头 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: 67px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px;
  border-radius: 50%; border: 2px solid #fff; border-bottom-color: transparent;
  transform: rotate(-45deg);
}
.brand-name { font-family: var(--font-serif); font-size: 17px; font-weight: 700; letter-spacing: .02em; }

.site-nav { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.site-nav a {
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
  padding: 6px 0; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent); border-bottom-color: var(--accent-line); }
.nav-item { position: relative; }
.dropdown-menu {
  display: none; position: absolute; left: -14px; top: 100%; z-index: 45;
  min-width: 148px; max-height: 380px; overflow-y: auto;
  padding: 8px 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}
.nav-item:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 7px 16px; font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; border-bottom: 0;
}
.dropdown-menu a:hover, .dropdown-menu a:focus-visible { background: var(--bg-band); color: var(--accent); }
.nav-all {
  flex: none; height: 30px; padding: 0 16px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 12px; display: inline-flex; align-items: center;
}
.nav-all:hover { background: var(--brand-deep); }

.icon-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn svg { width: 15px; height: 15px; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:hover svg { color: var(--accent); }

.menu-btn {
  display: none; flex: none; width: 32px; height: 32px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; position: relative;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  position: absolute; left: 8px; width: 16px; height: 1.6px; background: var(--ink);
  content: "";
}
.menu-btn span { top: 15px; }
.menu-btn span::before { top: -5px; left: 0; }
.menu-btn span::after { top: 5px; left: 0; }

/* ---------- 通用段头 ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head h2 { font-size: 25px; line-height: 1.25; letter-spacing: .01em; }
.section-head--line { border-bottom: 1px solid var(--line-strong); padding-bottom: 12px; }
.section-lead { font-size: 12.5px; color: var(--ink-3); max-width: 520px; }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 0; }
.footer-strip {
  height: 70px; background: var(--highlight);
  display: flex; align-items: center;
}
.footer-strip p {
  font-family: var(--font-serif); font-size: 15px; color: #40431f; letter-spacing: .02em;
}
.footer-deep { background: var(--brand-deep); color: var(--ink-invert); padding: 36px 0 39px; }
.footer-deep .brand-name { color: #fff; font-size: 16px; }
.footer-deep .brand-mark { background: transparent; border: 1px solid rgba(255,255,255,.55); }
.footer-deep .brand-mark::after { border-color: #fff; border-bottom-color: transparent; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 26px 34px; }
.footer-col { flex: 1 1 180px; min-width: 170px; }
.footer-col.footer-brand { flex: 1.4 1 240px; }
.footer-brand p { margin-top: 12px; font-size: 12px; line-height: 1.8; color: rgba(244, 246, 239, .72); max-width: 320px; }
.footer-title { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 246, 239, .58); margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a, .footer-links span { font-size: 12.5px; color: rgba(244, 246, 239, .82); }
.footer-links a:hover { color: #fff; }
.footer-legal {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(244,246,239,.18);
  display: flex; justify-content: space-between; gap: 18px;
  font-size: 11.5px; color: rgba(244, 246, 239, .7);
}

/* ---------- 内页公用 ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-current] { color: var(--ink-2); }

.page-hero { background: var(--bg-band); padding: 34px 0 32px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: 32px; line-height: 1.3; margin: 12px 0 12px; }
.page-hero .lead { font-size: 13.5px; color: var(--ink-2); max-width: 780px; }
.page-hero .eyebrow { color: var(--accent); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-label { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 10px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.chip {
  height: 30px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; font-size: 12px; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.toolbar-count { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 20px; padding: 28px 0 8px; }
.list-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.list-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); }
.list-thumb {
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--bg-band); margin-bottom: 4px;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card h3 { font-size: 17px; }
.list-card p { font-size: 12.5px; color: var(--ink-2); }
.card-meta { display: flex; gap: 10px; margin-top: auto; padding-top: 10px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 10px; color: var(--ink-3); }
.card-tag { color: var(--accent); }

.list-empty { padding: 30px 0; font-size: 13px; color: var(--ink-3); }
.load-more-row { padding: 22px 0 6px; text-align: center; }
.page-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.page-num {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: #fff;
  font-size: 12px; color: var(--ink-2);
}
.page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-num.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.page-gap { min-width: 20px; text-align: center; font-size: 12px; color: var(--ink-3); }

.seo-section { padding: 44px 0 50px; border-top: 1px solid var(--line); background: var(--bg-band); }
.seo-section h2 { font-size: 21px; margin-bottom: 16px; }
.seo-copy { max-width: 900px; font-size: 13.5px; color: var(--ink-2); line-height: 1.95; }
.related-cats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.related-cats a {
  padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12.5px; background: #fff;
}
.related-cats a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 详情页 ---------- */
.article-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 46px; padding: 38px 0 56px; align-items: start; }
.toc { position: sticky; top: 88px; border-left: 1px solid var(--line-strong); padding-left: 18px; }
.toc h2 { font-size: 12px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 12px; }
.toc ol { display: flex; flex-direction: column; gap: 9px; }
.toc a { font-size: 12.5px; color: var(--ink-2); display: block; line-height: 1.5; }
.toc a:hover { color: var(--accent); }
.toc a.is-active { color: var(--accent); font-weight: 600; }
.article-head h1 { font-size: 33px; line-height: 1.28; }
.article-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-3); font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; }
.article-lead { margin-top: 16px; font-size: 14px; color: var(--ink-2); line-height: 1.85; border-left: 2px solid var(--accent); padding-left: 16px; }

.fact-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 26px 0 30px; overflow: hidden;
}
.fact-row div { background: var(--bg-band); padding: 14px 16px; }
.fact-row dt { font-size: 10px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; }
.fact-row dd { margin: 6px 0 0; font-size: 13px; color: var(--ink); }

.article-body h2 { font-size: 21px; margin: 34px 0 12px; padding-top: 4px; scroll-margin-top: 88px; }
.article-body p { font-size: 14px; line-height: 1.95; color: var(--ink-2); }

.related-items { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 26px; }
.related-items h2 { font-size: 17px; margin-bottom: 16px; }
.related-items ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-items li { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.related-items li a { font-size: 14px; font-weight: 600; color: var(--accent); }
.related-items li p { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

.prev-next { margin-top: 30px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 12.5px; }
.prev-next a { color: var(--ink-2); }
.prev-next a:hover { color: var(--accent); }

@media (max-width: 1200px) {
  .site-nav { gap: 11px; }
  .site-nav a { font-size: 11.5px; }
}

/* ================= 内页补充组件（分类页 / 详情页） ================= */
/* 分类页：细分方向 */
.subcats { padding: 26px 0 4px; }
.subcats-title { font-size: 17px; margin-bottom: 14px; }
.subcat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.subcat-card {
  display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 16px;
  align-items: center; padding: 14px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.subcat-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); }
.subcat-thumb { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-band); }
.subcat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.subcat-body h3 { font-size: 16px; }
.subcat-body p { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.72; }
.subcat-count { display: block; margin-top: 8px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 10px; color: var(--ink-3); }

/* 分类页：条目网格段头 */
.card-section { padding: 30px 0 6px; }
.card-section .section-head h2 { font-size: 22px; }
.card-section .section-lead { max-width: 420px; text-align: right; }
.list-card h3 a:hover { color: var(--accent); }
.list-card[hidden] { display: none; }
.list-empty[hidden], .load-more-row .btn[hidden] { display: none; }

/* 分类页：相关分类带标题 */
.related-title { font-size: 13px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); width: 100%; }
.related-cats { align-items: center; }

/* 详情页：面包屑与配图 */
.article-crumb { padding: 22px 0 0; }
.article-figure { margin: 22px 0 0; }
.article-figure img { width: 100%; aspect-ratio: 21 / 9; max-height: 400px; object-fit: cover; border-radius: var(--radius); }
.article-figure figcaption { margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.article-main { min-width: 0; order: 1; }
.article-layout .toc { order: -1; }
.article-back { margin-top: 26px; font-size: 12.5px; }
.article-back a { color: var(--accent); }
.article-back a:hover { text-decoration: underline; }
.pn-label { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 9.5px; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; margin-right: 6px; }
.prev-next a:last-child { text-align: right; }

@media (max-width: 1180px) {
  .subcat-grid { grid-template-columns: minmax(0, 1fr); }
  .article-layout .toc { order: -1; }
  .toc { border-left: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; }
  .toc h2 { margin-bottom: 0; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
  .toc h2::after { content: "+"; font-size: 14px; color: var(--accent); }
  .toc.is-collapsed h2::after { content: "+"; }
  .toc:not(.is-collapsed) h2::after { content: "−"; }
  .toc.is-collapsed ol { display: none; }
  .toc ol { margin-top: 10px; }
  .article-figure img { aspect-ratio: 2 / 1; }
}
@media (max-width: 720px) {
  .subcat-card { grid-template-columns: minmax(0, 1fr); }
  .card-section .section-lead { text-align: left; }
  .subcats-title { font-size: 16px; }
  .toolbar { gap: 8px 16px; }
  .toolbar-count { width: 100%; margin-left: 0; }
  .prev-next a:last-child { text-align: left; }
}
