/* ==========================================================================
   婴儿益智类玩具大全 · 首页样式
   基线：03-ui/home-ui-desktop.png（1024×1536 → 归一 1440×2160，设计宽 1440）
   分区预算（1440 css px，量自视觉稿逐行剖面 — 详见 03-ui/compare-log.md）：
     header        0–62       高  62   奶油通栏：左站名，右 7 项分类导航
     hero         62–571      高 509   左文案（badge + h1 + 导语 + 三条标签）+ 右实拍
     cats        571–950      高 379   区块标题 + 7 列分类（编号/名称/图/说明）
     band A      950–1390     高 440   左「月龄地图」四卡 / 右「编辑精选」六条
     band B     1390–1720     高 330   左「陪玩三步」/ 右「安全四条红线」
     band C     1720–1975     高 255   左「常见问题」/ 右「收录说明」
     footer     1975–2160     高 185   强调黄通栏三栏 + 版权行
   内容栏 1328（左右各 56）；变量见 tokens.css。
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

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

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.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;
}

/* ---------------------------------------------------------------- header
   预算 62：奶油底 + 细下边线，内容左缘 56、右缘 1384（与正文同栏）。 */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(254, 250, 245, .94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-stuck { box-shadow: 0 12px 24px -22px rgba(94, 70, 45, .6); }

.header-inner {
  height: var(--header-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 22px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.brand__mark { display: inline-flex; color: var(--accent-deep); }
.brand__text { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.site-nav a {
  font-size: var(--fs-sm);
  color: var(--muted);
  padding-block: 6px;
  border-bottom: 1.5px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); border-bottom-color: var(--accent-deep); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 36px; height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--ink); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 16px; height: 1.6px; background: currentColor;
  margin-inline: auto; content: "";
}
.nav-toggle__bars::before { margin-top: -5px; }
.nav-toggle__bars::after { margin-top: 4px; }

.mobile-nav {
  position: absolute; inset-inline: 0; top: var(--header-h);
  display: grid; gap: 1px;
  background: var(--cream-100);
  border-bottom: 1px solid var(--line);
  padding: 6px var(--gutter) 14px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding-block: 11px; font-size: var(--fs-sm); color: var(--ink-soft); border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ hero
   预算 509（62 → 571）：左侧文案栏 660 宽，右侧实拍自 ~700 出血到视口右缘。 */
.hero { position: relative; overflow: hidden; background: var(--cream-100); }
.hero-blob {
  position: absolute; z-index: 0;
  right: -120px; top: -140px;
  width: 720px; height: 720px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: .55;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: 509px;
}
.hero-copy { position: relative; z-index: 2; padding-top: 62px; max-width: 520px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 15px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em;
}
.hero-title {
  margin-top: 27px;
  font-size: var(--fs-display);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hero-lede {
  margin-top: 20px;
  max-width: 470px;
  font-size: var(--fs-lede);
  line-height: 1.85;
  color: var(--ink-soft);
}
.hero-chips { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-chips li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .6);
  font-size: var(--fs-sm); color: var(--ink-soft);
}
.hero-chips li::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-deep); flex: none;
}
.hero-media {
  position: absolute; z-index: 1;
  top: 0; bottom: 0;
  right: max(0px, calc((100% - 1440px) / 2));
  width: 940px;
  overflow: hidden;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 58% 46%; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(253, 246, 239, .95) 0%, rgba(253, 246, 239, .55) 14%, rgba(253, 246, 239, 0) 40%);
}

/* ------------------------------------------------------------- 通用区块头
   稿上每个区块标题是加粗黑字，副标题在标题右侧或下方一行小字。 */
.sec-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px;
}
.sec-title {
  position: relative;
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.sec-sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------------------ cats
   预算 379（571 → 950）：标题行 + 7 列分类（编号/名称在卡内上方，图 4:3，说明在卡下）。 */
.cats {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--gutter) 44px;
}
.cat-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 13px;
}
.cat-card { display: flex; flex-direction: column; }
.cat-card__num {
  font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .18em;
  color: var(--muted-2);
}
.cat-card__name {
  margin-top: 0;
  font-size: 14.5px; font-weight: 700; line-height: 1.3;
  color: var(--ink);
}
.cat-card__thumb {
  display: block; margin-top: 10px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--cream-200);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-s);
}
.cat-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.cat-card:hover .cat-card__thumb img, .cat-card:focus-visible .cat-card__thumb img { transform: scale(1.04); }
.cat-card__desc {
  display: block; margin-top: 11px;
  font-size: 11.5px; line-height: 1.78; color: var(--muted);
}
.cats-note {
  margin-top: 26px;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--cream-100);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-xs); line-height: 1.7; color: var(--muted);
}

/* --------------------------------------------------------------- 两栏带
   A/B/C 三段都是「左主右副」的两栏结构，左栏更宽（约 1.06 : 1）。
   稿面三段的起点分别是 y950 / y1390 / y1720，段间留白由 padding-top 控制。 */
.band {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 64px var(--gutter) 0;
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  gap: 52px;
  align-items: start;
}
.band--tight { padding-top: 109px; }
.band--last { padding-top: 8px; }

/* -------------------------------------------------------------- age map */
.age-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.age-card {
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 13px 13px;
  display: flex; flex-direction: column;
}
.age-card__img { margin-top: auto; padding-top: 12px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.age-card__range {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  color: var(--accent-deep);
}
.age-card__title { margin-top: 5px; font-size: 14.5px; font-weight: 700; line-height: 1.38; color: var(--ink); }
.age-card__desc { margin-top: 6px; font-size: 11px; line-height: 1.66; color: var(--muted); }

/* ----------------------------------------------------------------- picks */
.pick-list { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, transform .18s ease;
}
.pick:hover, .pick:focus-within { border-color: var(--accent-deep); transform: translateY(-1px); }
.pick__img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; background: var(--cream-200); }
.pick__name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.pick__desc { margin-top: 3px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }

/* ------------------------------------------------------------ play steps */
.step-list { margin-top: 20px; display: grid; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 15px;
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step__num {
  font-size: 22px; font-weight: 800; line-height: 1;
  color: var(--accent);
  letter-spacing: .04em;
}
.step__title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.step__desc { margin-top: 4px; font-size: 11px; line-height: 1.66; color: var(--muted); }

/* -------------------------------------------------------------- safety */
.safety-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.safety-item {
  padding: 11px 13px 13px;
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent-deep);
}
.safety-item__label {
  font-size: 13.5px; font-weight: 800; color: var(--ink);
  letter-spacing: .04em;
}
.safety-item__desc { margin-top: 6px; font-size: 10.5px; line-height: 1.66; color: var(--muted); }
.safety-link { margin-top: 13px; font-size: var(--fs-sm); color: var(--accent-deep); font-weight: 700; }
.safety-link a { border-bottom: 1px solid currentColor; }
.safety-link a:hover, .safety-link a:focus-visible { color: var(--ink); }

/* ------------------------------------------------------------------ faq */
.faq-list { margin-top: 18px; display: grid; gap: 6px; }
.faq-item {
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 16px;
}
.faq-item__q {
  cursor: pointer;
  padding: 9px 26px 9px 0;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  position: relative;
  list-style: none;
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::after {
  content: "+";
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 18px; font-weight: 400; color: var(--accent-deep);
}
.faq-item[open] .faq-item__q::after { content: "–"; }
.faq-item__a {
  padding: 0 0 11px;
  font-size: 10.5px; line-height: 1.65; color: var(--muted);
}
.faq-item__q:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------- scope */
.scope-list { margin-top: 20px; display: grid; gap: 0; }
.scope-list__t {
  padding-top: 11px;
  font-size: 13px; font-weight: 800; color: var(--ink);
}
.scope-list__d {
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line-strong);
  font-size: 11px; line-height: 1.72; color: var(--muted);
}
.scope-list__d:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- footer
   预算 185（1975 → 2160）：强调黄通栏，三栏 + 底部版权行。 */
.site-footer { background: var(--accent); color: var(--on-accent); }
.footer-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 10px var(--gutter) 11px;
  display: grid;
  grid-template-columns: 1.15fr .85fr 1.35fr;
  gap: 22px;
  position: relative;
}
.footer-brand__name { font-size: 15px; font-weight: 800; color: var(--accent-ink); }
.footer-brand__desc { margin-top: 7px; font-size: 11px; line-height: 1.66; color: #6d4a22; }
.footer-col__head { font-size: var(--fs-xs); font-weight: 800; color: var(--accent-ink); letter-spacing: .08em; }
.footer-links { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.footer-links a { font-size: 11px; color: #6d4a22; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { margin-top: 8px; font-size: 11px; line-height: 1.66; color: #6d4a22; }
.footer-copy {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(138, 59, 6, .22);
  font-size: 11px;
  color: #7a5327;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 12px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .band { grid-template-columns: 1fr; gap: 40px; }
  .age-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-media { width: 46vw; }
}

@media (max-width: 1024px) {
  :root { --gutter: 32px; }
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .hero-inner { min-height: 0; padding-block: 40px 44px; display: grid; gap: 28px; }
  .hero-copy { padding-top: 0; max-width: 640px; }
  .hero-media { position: relative; inset: auto; width: 100%; height: 300px; border-radius: var(--radius-lg); }
  .hero-media::after { background: linear-gradient(180deg, rgba(253, 246, 239, .5), rgba(253, 246, 239, 0) 30%); }
  .hero-blob { display: none; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --gutter: 20px; --fs-display: 34px; --fs-h2: 21px; }
  .hero-media { height: 220px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .age-grid, .safety-grid, .pick-list { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 8px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------- 数据驱动补齐样式 */
.skip-link{position:absolute;left:-9999px;top:0;z-index:100}
.skip-link:focus{left:8px;top:8px;background:#fff;padding:8px 14px;border-radius:6px}

.site-nav { flex-wrap: wrap; row-gap: 0; }
.site-nav a { white-space: nowrap; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-inner > .footer-brand,
.footer-inner > .footer-col { flex: 1 1 180px; min-width: 170px; }
.footer-copy { flex: 1 1 100%; }
@media (max-width: 760px) {
  .footer-inner { flex-direction: column; }
}

/* 首页分类内容模块：沿用分类卡缩略图，四列并排 */
.cat-grid--articles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cat-grid--articles .list-card { min-width: 0; }
.cat-grid--articles .cat-card__thumb { aspect-ratio: 16 / 10; }
.cat-grid--articles .cat-card__thumb a { display: block; width: 100%; height: 100%; }
.cat-grid--articles .cat-card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cat-grid--articles .list-card__title {
  margin-top: 10px; font-size: 14px; line-height: 1.5; font-weight: 700; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.cat-grid--articles .list-card__title a:hover { color: var(--accent-deep); }
.cat-grid--articles .list-card__desc {
  margin-top: 7px; font-size: 11.5px; line-height: 1.7; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.cat-item__sub { color: var(--accent-deep); font-weight: 700; }
@media (max-width: 1180px) { .cat-grid--articles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cat-grid--articles { grid-template-columns: 1fr; } }

/* 文章详情：正文内嵌配图 */
.article-figure { margin: 22px 0 6px; }
.article-figure img { width: 100%; max-width: 100%; height: auto; border-radius: var(--radius); object-fit: cover; }
