/* ============================================================
   style.css — 首页 / 分类页 / 详情页 版面（婴儿洗护用品大全）
   区块高度按 03-ui/home-ui-desktop.png 的分区预算落位（1440 宽，见 03-ui/compare-log.md）
   ============================================================ */

/* ============================== 首页 ============================== */

/* ---------- M0 header ---------- */
.site-header { background: var(--bg); }

/* ---------- M1 hero ---------- */
.hero {
  position: relative;
  height: var(--h-hero);
  overflow: hidden;
  background: var(--hero-grad);
  color: var(--ink);
}
.hero-media {
  position: absolute;
  top: 0;
  bottom: 0;
  right: max(0px, calc((100% - 1440px) / 2));
  width: 43.3%;
  overflow: hidden;
  border-radius: 0 0 0 26px;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 46%; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #d9eafd 0%, rgba(217, 234, 253, 0.78) 9%, rgba(224, 239, 254, 0.24) 22%, rgba(236, 246, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 60%);
}
.hero-inner { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; }
.hero-copy { width: min(760px, 56%); padding-bottom: 4px; }
.hero h1 {
  font-size: 56px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.hero-lead {
  max-width: 560px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
}
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.hero-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.hero-link svg { width: 17px; height: 17px; color: var(--blue-500); }
.hero-link:hover { color: var(--blue-600); }
.hero-stats {
  display: flex;
  gap: 22px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-3);
}
.hero-stats li { display: inline-flex; align-items: baseline; gap: 5px; }
.hero-stats li + li { position: relative; padding-left: 22px; }
.hero-stats li + li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 13px;
  transform: translateY(-50%);
  background: var(--line-strong);
}
.hero-stats b { font-size: 20px; font-weight: 700; color: var(--blue-500); }

/* ---------- M2 categories ---------- */
.categories { padding: 27px 0 32px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.category-card { display: block; min-width: 0; }
.category-card .thumb { aspect-ratio: 2 / 1; border-radius: 12px; }
.category-card h3 { margin: 11px 0 4px; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.category-card p { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }

/* ---------- M3 items ---------- */
.items { padding: 56px 0 61px; }
.items .section-head { margin-bottom: 24px; }
.item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 42px;
}
.item-card { min-width: 0; }
.item-card a {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 78px;
}
.item-card .thumb { width: 78px; aspect-ratio: 4 / 3; border-radius: 10px; }
.item-card h3 { font-size: 15.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.item-card p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.62;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- M4 wash path ---------- */
/* 通栏色带：.band 标记「整幅出血的色带区块」—— 左缘贴视口边，内容仍由内部 .container 对齐。
   宽屏巡检（screens.mjs 的 misaligned-left）据此跳过，因为色带的左缘不是容器左缘。 */
.band { width: 100%; }
.wash-path { padding: 21px 0 25px; background: var(--bg-blue); }
.wash-path .section-title { font-size: 27px; }
.step-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px; margin-top: 17px; counter-reset: step; }
.step { position: relative; min-width: 0; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--blue-500);
}
.step h3 { margin-top: 10px; font-size: 16px; font-weight: 600; color: var(--ink); }
.step p { margin-top: 6px; font-size: 12.5px; line-height: 1.68; color: var(--ink-2); }

/* ---------- M5 basics ---------- */
.basics { padding: 39px 0 44px; background: var(--bg-cream); }
.basics .section-title { font-size: 27px; }
.basics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px; margin-top: 26px; }
.basic-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; min-width: 0; }
.basic-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fff;
  color: var(--blue-500);
  box-shadow: 0 6px 14px rgba(20, 60, 120, 0.07);
}
.basic-icon svg { width: 21px; height: 21px; }
.basic-card h3 { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.basic-card p { font-size: 12.5px; line-height: 1.68; color: var(--ink-2); }
.basic-card > div { min-width: 0; }

/* ---------- M6 scope ---------- */
.scope { padding: 5px 0 6px; }
.scope-inner { display: grid; grid-template-columns: minmax(0, 1fr) 232px; align-items: center; gap: 56px; }
.scope-copy { max-width: 820px; }
.scope-copy .section-title { font-size: 27px; }
.scope-copy p { margin-top: 11px; font-size: 14px; line-height: 1.82; color: var(--ink-2); }
.scope-art { height: 112px; border-radius: 18px 0 0 18px; overflow: hidden; }
.scope-art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 42%; }

/* ---------- M7 cta ---------- */
.cta-band { padding: 0 0 2px; }
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 31px 38px;
  border-radius: 18px;
  background: linear-gradient(96deg, #4a86c9 0%, #4f8ccd 48%, #5b96d3 100%);
  color: #fff;
  overflow: hidden;
}
.cta-copy h2 { font-size: 27px; line-height: 1.3; font-weight: 700; color: #fff; }
.cta-copy p { margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: rgba(255, 255, 255, 0.9); }
.cta-actions { display: flex; align-items: center; gap: 12px; flex: none; }

/* ---------- 首页响应式 ---------- */
@media (max-width: 1260px) {
  .main-nav { gap: 22px; font-size: 13.5px; margin-right: 40px; }
  .hero h1 { font-size: 46px; }
  .hero-copy { width: min(680px, 62%); }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 24px; }
  .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step-grid, .basics-grid { gap: 24px; }
  .scope-inner { grid-template-columns: minmax(0, 1fr) 200px; gap: 32px; }
}

@media (max-width: 980px) {
  .hero { height: auto; min-height: 430px; }
  .hero-media { width: 48%; }
  .hero-copy { width: 68%; padding: 36px 0; }
  .hero h1 { font-size: 38px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-grid, .basics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  .scope-inner { grid-template-columns: minmax(0, 1fr); }
  .scope-art { display: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "brand brand" "nav about" "copyright copyright"; }
}

@media (max-width: 820px) {
  :root { --h-header: 64px; }
  .site-header { height: var(--h-header); }
  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--h-header);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding: 8px 24px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero { min-height: 0; }
  .hero-media { position: relative; inset: auto; width: auto; height: 260px; border-radius: 0; }
  .hero-media::after { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.75)); }
  .hero-inner { height: auto; }
  .hero-copy { width: 100%; padding: 26px 0 30px; }
  .hero h1 { font-size: 32px; }
  .hero-lead { font-size: 15px; }
  .hero-actions { flex-wrap: wrap; gap: 14px 16px; margin-top: 20px; }
  .hero-stats { flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
  .hero-stats li + li { padding-left: 18px; }
  .categories { padding: 24px 0 20px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .items { padding-bottom: 30px; }
  .items .section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
  .item-grid { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .wash-path, .basics, .scope { padding: 26px 0; }
  .step-grid, .basics-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cta-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px; }
  .cta-copy h2 { font-size: 22px; }
  .input-none { display: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "nav" "about" "copyright"; }
}

@media (max-width: 520px) {
  :root { --gutter: 18px; }
  .section-title { font-size: 22px; }
  .hero h1 { font-size: 28px; }
  .hero-media { height: 210px; }
  .hero-stats { font-size: 12px; }
  .hero-stats b { font-size: 17px; }
  .category-grid { gap: 12px; }
  .category-card h3 { font-size: 15px; }
  .item-card a { grid-template-columns: 66px minmax(0, 1fr); gap: 12px; }
  .item-card .thumb { width: 66px; }
  .footer-nav ul { grid-template-columns: minmax(0, 1fr); }
  .cta-actions { flex-wrap: wrap; }
}

/* ============================== 分类页 ============================== */
.list-section { padding: 26px 0 30px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.list-wrapper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 18px; }
.list-wrapper .item-card a { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
.list-wrapper .item-card .thumb { width: 96px; }
.list-wrapper .item-card p { -webkit-line-clamp: 3; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-row span { padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-blue); font-size: 11.5px; color: var(--blue-700); }
.tag-row span:last-child { background: var(--bg-cream); color: #8a6a33; }
.list-empty { padding: 30px 0; border: 1px dashed var(--line-strong); border-radius: var(--r-md); text-align: center; font-size: 14px; color: var(--ink-3); }

/* ============================== 详情页 ============================== */
.article-head .page-tags span { border-color: var(--line-strong); color: var(--ink-2); }
.article-hero { margin: 20px 0 4px; }

@media (max-width: 1260px) {
  .list-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr) 226px; gap: 34px; }
}

@media (max-width: 980px) {
  .article-head-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-meta { max-width: 520px; }
}

@media (max-width: 820px) {
  .page-hero { padding: 28px 24px; }
  .page-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-hero h1 { font-size: 32px; }
  .page-count b { font-size: 32px; }
  .toolbar-right { margin-left: 0; width: 100%; }
  .list-wrapper { grid-template-columns: minmax(0, 1fr); }
  .list-description-inner { max-width: none; }
  .next-read { grid-template-columns: minmax(0, 1fr); }
  .article-head h1 { font-size: 32px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-toc { position: static; order: -1; }
  .article-body h2 { font-size: 23px; }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .list-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .list-wrapper .item-card a { grid-template-columns: 84px minmax(0, 1fr); }
  .list-wrapper .item-card .thumb { width: 84px; }
  .article-meta { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 数据化覆盖：移动端导航（≤820px 下拉改为常显列表） ---------- */
@media (max-width: 820px) {
  .main-nav .nav-item { width: 100%; }
  .main-nav .dropdown-menu {
    display: block;
    position: static;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0 0 6px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .main-nav .dropdown-menu a { padding: 7px 0; border-bottom: none; font-size: 13px; color: var(--ink-3); }
  .main-nav .nav-item > a { border-bottom: 1px solid var(--line); }
}
