/* ============================================================
   components.css — 跨页复用组件（婴儿洗护用品大全）
   ============================================================ */

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
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: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--blue-200); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; border-radius: 4px; }

.container {
  width: min(var(--container), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 99;
  padding: 10px 16px;
  background: var(--blue-500);
  color: #fff;
  border-radius: var(--r-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(150deg, #dcebfb, #eef6ff);
  color: var(--blue-600);
  flex: none;
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-text { font-size: 19px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 30;
  height: var(--h-header);
  background: var(--bg);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 100%; }
.main-nav { display: flex; align-items: center; gap: 30px; margin-right: 96px; font-size: 14.5px; color: var(--ink-2); }
.main-nav a { position: relative; padding: 6px 0; white-space: nowrap; transition: color 0.18s; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--blue-500); color: #fff; box-shadow: 0 10px 24px rgba(74, 134, 201, 0.28); }
.btn-accent:hover { background: var(--blue-600); }
.btn-white { background: #fff; color: var(--blue-600); }
.btn-white:hover { background: #f2f8ff; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: rgba(10, 32, 78, 0.04); }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.66); color: #fff; background: transparent; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.14); }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: 13.5px; }

/* ---------- section heading ---------- */
.section-title { display: flex; align-items: center; gap: 11px; font-size: 28px; font-weight: 700; line-height: 1.28; letter-spacing: 0.01em; color: var(--ink); }
.section-title svg { width: 26px; height: 26px; color: var(--blue-500); flex: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.section-more { font-size: 14px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.section-more:hover { color: var(--blue-600); }
.section-more svg { width: 14px; height: 14px; }

/* ---------- cards ---------- */
.thumb { display: block; overflow: hidden; border-radius: var(--r-md); background: var(--blue-100); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
a:hover .thumb img { transform: scale(1.04); }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-footer); padding: 11px 0 10px; border-top: 1px solid var(--line); }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.95fr);
  grid-template-areas:
    "brand nav about"
    "copyright copyright copyright";
  gap: 12px 44px;
  align-items: start;
}
.footer-brand { grid-area: brand; }
.footer-brand .logo-text { font-size: 18px; }
.footer-note { margin-top: 8px; max-width: 360px; font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.footer-nav { grid-area: nav; }
.footer-about { grid-area: about; }
.site-footer h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-3); }
.footer-nav ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 14px; margin-top: 9px; font-size: 13.5px; color: var(--ink-2); }
.footer-about p { margin-top: 8px; font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.footer-nav a:hover { color: var(--blue-600); }
.copyright { grid-area: copyright; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ---------- utilities ---------- */
.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;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   内页公共组件：面包屑 / 标题带 / 筛选条 / 列表说明 / 相关条目
   ============================================================ */

/* ---------- 面包屑 ---------- */
.crumb { padding: 20px 0 0; font-size: 12.5px; color: var(--ink-3); }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.crumb li { display: inline-flex; align-items: center; gap: 7px; }
.crumb li + li::before { content: "/"; color: var(--line-strong); }
.crumb a:hover { color: var(--ink); }
.crumb [aria-current="page"] { color: var(--ink-2); }

/* ---------- 内页标题带 ---------- */
.page-hero {
  margin-top: 18px;
  padding: 40px 44px;
  background:
    radial-gradient(760px 300px at 92% 6%, rgba(214, 233, 253, 0.9), transparent 72%),
    linear-gradient(104deg, #eef6ff 0%, #f7fbff 62%, #fdfcfe 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.page-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 44px; }
.page-hero h1 { font-size: 46px; line-height: 1.2; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }
.page-lead { max-width: 700px; margin-top: 14px; font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.page-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.page-tags span { padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 12.5px; color: var(--ink-2); background: rgba(255, 255, 255, 0.7); }
.page-count { flex: none; display: flex; align-items: baseline; gap: 6px; padding-bottom: 8px; color: var(--ink-3); font-size: 13px; }
.page-count b { font-size: 46px; line-height: 1; font-weight: 700; color: var(--blue-500); }

/* ---------- 筛选与排序 ---------- */
.toolbar { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 13px 0; }
.toolbar-label { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 13px;
  color: var(--ink-2);
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.chip:hover { border-color: var(--blue-500); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.toolbar-right label { cursor: pointer; }
.select {
  min-height: 36px;
  padding: 0 32px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.result-count { font-size: 13px; color: var(--ink-3); }

/* ---------- 列表说明 ---------- */
.list-description { padding: 36px 0 40px; border-top: 1px solid var(--line); }
.list-description-inner { max-width: 840px; }
.list-description h2 { font-size: 25px; font-weight: 700; color: var(--ink); }
.list-description p { margin-top: 13px; font-size: 14.5px; line-height: 1.95; color: var(--ink-2); }

/* ---------- 相关条目 / 上下篇 ---------- */
.next-read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 16px; padding: 0 0 46px; }
.next-card { display: block; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
.next-card:hover { border-color: var(--blue-300); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.next-card span { font-size: 12px; letter-spacing: 0.1em; color: var(--ink-3); }
.next-card h3 { margin: 6px 0 5px; font-size: 20px; font-weight: 700; color: var(--ink); }
.next-card p { font-size: 13px; line-height: 1.65; color: var(--ink-2); }

/* ============================================================
   详情页组件：文章头 / 目录 / 正文 / 相关条目
   ============================================================ */
.article-head { padding: 24px 0 26px; border-bottom: 1px solid var(--line); }
.article-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: end; }
.article-head h1 { font-size: 46px; line-height: 1.2; font-weight: 700; color: var(--ink); }
.article-lead { max-width: 720px; margin-top: 13px; font-size: 15.5px; line-height: 1.9; color: var(--ink-2); }
.article-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); }
.article-meta div { padding: 13px 15px; background: #fff; }
.article-meta dt { font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-3); }
.article-meta dd { margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 256px; gap: 56px; padding: 30px 0 46px; align-items: start; }
.article-toc { position: sticky; top: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-blue); }
.article-toc h2 { font-size: 12px; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 600; }
.article-toc ol { counter-reset: toc; margin-top: 10px; display: grid; gap: 2px; }
.article-toc li { counter-increment: toc; }
.article-toc a { display: flex; gap: 9px; padding: 6px 0; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid transparent; }
.article-toc a::before { content: counter(toc, decimal-leading-zero); font-size: 11px; color: var(--ink-3); line-height: 1.95; }
.article-toc a:hover { color: var(--ink); }
.article-toc a.is-active { color: var(--blue-600); font-weight: 600; }
.article-toc a.is-active::before { color: var(--blue-500); }

.article-body { max-width: 720px; }
.article-body .article-intro { max-width: 660px; font-size: 15.5px; line-height: 1.95; color: var(--ink-2); }
.article-hero { margin: 22px 0 6px; overflow: hidden; border-radius: var(--r-lg); }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-hero figcaption { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.article-body section { padding-top: 30px; }
.article-body h2 { font-size: 27px; line-height: 1.35; font-weight: 700; color: var(--ink); scroll-margin-top: 24px; }
.article-body h2 + p { margin-top: 12px; }
.article-body p { font-size: 15.5px; line-height: 1.95; color: #33405a; }
.article-body p + p { margin-top: 12px; }

.related { padding: 34px 0 46px; border-top: 1px solid var(--line); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.related-card { display: flex; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; transition: border-color 0.18s, box-shadow 0.18s; }
.related-card:hover { border-color: var(--blue-300); box-shadow: var(--shadow-sm); }
.related-card .thumb { width: 76px; flex: none; aspect-ratio: 1 / 1; border-radius: 10px; }
.related-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.related-card p { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

/* ---------- 数据化：导航下拉（theme1935） ---------- */
.main-nav .nav-item { position: relative; }
.main-nav .nav-item > a { display: inline-block; }
.main-nav .dropdown-menu {
  display: none;
  position: absolute;
  left: -14px;
  top: calc(100% + 10px);
  z-index: 40;
  min-width: 148px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(28, 52, 84, 0.14);
}
.main-nav .dropdown-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.main-nav .dropdown-menu a::after { display: none; }
.main-nav .dropdown-menu a:hover { background: var(--bg-blue); color: var(--blue-700); }
.main-nav .nav-item:hover > .dropdown-menu { display: block; }
.main-nav .nav-item > a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* 正文分节配图 */
.article-body section figure { margin: 16px 0 2px; overflow: hidden; border-radius: var(--r-md); }
.article-body section figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

/* ---------- 列表页：chip 用 a 承载 / 分页 ---------- */
a.chip { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; }
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--ink-2);
  background: #fff;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
a.pager-num:hover { border-color: var(--blue-500); color: var(--ink); }
.pager-num.is-current { background: var(--blue-500); border-color: var(--blue-500); color: #fff; font-weight: 600; }
.pager-dots { padding: 0 4px; font-size: 13.5px; color: var(--ink-3); }
