/* style.css — 香皂首页版式：分区高度按 03-ui 视觉稿预算落位 */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  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-5);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
}

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--moss);
  color: var(--white);
  border-radius: 4px;
  font-size: var(--fs-3);
}
.skip-link:focus { top: 8px; }

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

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(248, 245, 233, .96);
  border-bottom: 1px solid rgba(228, 224, 209, .8);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 34px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex: 0 0 auto;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}

.brand-sub {
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: var(--fs-3);
  letter-spacing: .08em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  gap: 12px;
  margin-left: 36px;
  font-size: var(--fs-4);
  color: var(--ink);
  white-space: nowrap;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.site-nav a:hover { color: var(--moss); border-color: var(--moss); }
.site-nav a.is-active { border-color: var(--moss); font-weight: 600; }

.nav-item { position: relative; }
.nav-item > a { display: block; }

.nav-drop {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 60;
  min-width: 168px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 30px rgba(46, 54, 40, .12);
  transform: translateX(-50%);
}
.nav-item.has-drop:hover .nav-drop { display: block; }
.nav-drop a {
  display: block;
  padding: 8px 12px;
  border-bottom: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: var(--fs-3);
  white-space: nowrap;
}
.nav-drop a:hover { background: var(--sage); color: var(--moss); border-bottom: 0; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 36px;
  margin-left: auto;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 3px 0;
  background: var(--ink);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
  background: var(--paper);
}

.hero-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 640px;
  max-width: 58%;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--paper) 0%, rgba(248, 245, 233, .72) 16%, rgba(248, 245, 233, 0) 48%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
}

.hero-copy {
  width: 700px;
  max-width: 56%;
  padding-top: 44px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--fs-7);
  letter-spacing: .09em;
}

.hero h1 {
  font-size: var(--fs-13);
  line-height: 1.24;
  letter-spacing: .005em;
}

.hero-lede {
  max-width: 640px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: var(--fs-5);
  line-height: 1.68;
}
.hero-lede + .hero-lede { margin-top: 0; }

/* ---------- 分类 ---------- */
.cats {
  height: var(--cats-h);
  padding: 18px 0 0;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 202px;
  gap: 10px 12px;
}

/* ---------- 工序 ---------- */
.process {
  height: var(--process-h);
  padding: 0 var(--gutter);
}
.process-inner {
  height: 100%;
  max-width: none;
  padding: 44px 38px 26px;
  background: var(--sage);
  border-radius: var(--r-panel);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-bottom: 36px;
}
.section-head h2 { font-size: var(--fs-11); }
.section-head p { color: var(--muted); font-size: var(--fs-4); }

/* ---------- 精选阅读 ---------- */
.featured {
  height: var(--featured-h);
  padding: 46px 0 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: 340px repeat(3, minmax(0, 1fr));
  gap: 12px;
  height: 156px;
}

.featured-intro {
  padding: 10px 20px 0 0;
}
.featured-intro h2 { font-size: var(--fs-11); }
.featured-intro p { margin-top: 12px; color: var(--muted); font-size: var(--fs-4); }

/* ---------- 准备清单 + 皂化价 ---------- */
.combo {
  height: var(--combo-h);
  padding: 0 var(--gutter);
}
.combo-inner {
  display: grid;
  grid-template-columns: 640px minmax(0, 1fr);
  gap: 44px;
  height: 100%;
  max-width: none;
  padding: 36px 38px 30px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  height: var(--cta-h);
  margin-top: 23px;
  overflow: hidden;
  background: var(--moss-dark);
}
.cta-leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 210px;
  height: 100%;
  background: url("../images/cta-leaf.png") 0 50% / cover no-repeat;
}
.cta-leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(52, 79, 48, .12) 0%, rgba(52, 79, 48, .55) 62%, var(--moss-dark) 100%);
}
.cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-left: 210px;
  padding-right: 40px;
}
.cta-copy h2 {
  color: var(--white);
  font-size: var(--fs-12);
  letter-spacing: .02em;
}
.cta-copy p {
  margin-top: 4px;
  color: rgba(255, 254, 249, .82);
  font-size: var(--fs-4);
}

/* ---------- 页脚 ---------- */
.site-footer {
  min-height: var(--footer-h);
  background: var(--footer-bg);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: 44px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1 1 320px;
  min-width: 280px;
}
.footer-brand .brand-name { font-size: var(--fs-12); }
.footer-brand p {
  max-width: 360px;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: var(--fs-4);
  line-height: 1.6;
}
.footer-col {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px 22px;
  flex: 0 0 auto;
  font-size: var(--fs-4);
  align-content: start;
}
.footer-col h2 {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-3);
  font-weight: 500;
}
.footer-col a { color: var(--ink); }
.footer-col a:hover { color: var(--moss); }
.footer-col {
  margin-left: 24px;
}
.footer-col-topics { grid-template-columns: auto; }
.footer-col-last {
  grid-template-columns: auto;
  margin-left: 24px;
}
.footer-bottom {
  margin-top: auto;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-3);
  text-align: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .site-nav { gap: 18px; margin-left: 30px; font-size: var(--fs-3); }
  .brand-sub { display: none; }
  .hero-copy { max-width: 62%; }
  .cats-grid { grid-auto-rows: minmax(190px, auto); }
  .combo-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .featured-grid { grid-template-columns: 260px repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  :root {
    --hero-h: auto;
    --cats-h: auto;
    --process-h: auto;
    --featured-h: auto;
    --combo-h: auto;
    --cta-h: auto;
    --footer-h: auto;
  }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 10px 20px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(46, 54, 40, .1);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .site-nav a.is-active { border-bottom-color: var(--moss); }
  .nav-item.has-drop .nav-drop {
    display: block;
    position: static;
    max-height: none;
    margin: 0;
    padding: 0 0 6px 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  .nav-drop a { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-3); }

  .hero { padding-bottom: 26px; }
  .hero-media { width: 100%; max-width: none; opacity: .45; }
  .hero-inner { padding-top: 34px; padding-bottom: 8px; }
  .hero-copy { width: 100%; max-width: 100%; padding-top: 0; }
  .hero h1 { font-size: var(--fs-10); }
  .hero-lede { max-width: 620px; }

  .cats { padding: 24px 0 8px; }
  .cats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .cat-card { min-height: 210px; }

  .process { padding: 8px var(--gutter) 0; }
  .process-inner { padding: 26px 24px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .steps::before { display: none; }

  .featured { padding: 34px 0 8px; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; }
  .featured-intro { grid-column: 1 / -1; padding: 0 0 4px; }

  .combo { padding: 10px var(--gutter) 0; }
  .combo-inner { grid-template-columns: 1fr; height: auto; padding: 28px 24px; }

  .cta { margin-top: 18px; }
  .cta-inner { padding: 24px 24px 24px 150px; }
  .cta-leaf { width: 150px; }
  .cta-copy h2 { font-size: var(--fs-10); }
  .cta-inner { gap: 18px; }

  .footer-inner { padding: 28px 20px 18px; }
  .footer-top { flex-wrap: wrap; gap: 22px; }
  .footer-brand { flex: 1 1 100%; }
  .footer-col-last { margin-left: 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .brand-name { font-size: var(--fs-10); }
  .hero h1 { font-size: var(--fs-9); }
  .hero-lede { font-size: var(--fs-4); }
  .hero-facts { padding: 12px 14px; font-size: var(--fs-2); }
  .cats-grid { grid-template-columns: 1fr; }
  .cat-card { min-height: 0; padding: 14px; gap: 14px; }
  .cat-thumb { flex: 0 0 120px; width: 120px; height: 120px; }
  .cat-body h2 { font-size: var(--fs-9); }
  .cat-body p { font-size: 13px; }
  .cat-tags { font-size: var(--fs-1); }
  .footer-col a { padding: 4px 0; }
  .hero-facts a { display: inline-block; min-height: 30px; line-height: 30px; }
  .section-head { display: block; margin-bottom: 18px; }
  .section-head p { margin-top: 4px; }
  .steps { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .read-card { min-height: 150px; }
  .combo-inner { gap: 30px; }
  .cta-inner { flex-direction: column; align-items: flex-start; padding: 24px; }
  .cta-leaf { width: 100%; opacity: .3; }
  .cta-leaf::after { background: linear-gradient(90deg, rgba(52,79,48,.55), var(--moss-dark)); }
  .cta-copy h2 { font-size: var(--fs-8); }
  .footer-col, .footer-col-last { grid-template-columns: repeat(2, auto); margin-left: 0; }
  .footer-bottom { text-align: left; }
}

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