/* ==========================================================================
   琼菜菜谱大全 · style.css
   设计基线：03-ui/home-ui-desktop.png（1024×1536 → 设计 1440×2160）
   分区预算（design px）见 03-ui/compare-log.md：
     header 0–73 / hero 73–500 / M2 500–845 / M3 845–1105 /
     M4 1105–1400 / quad 1472–1790 / scope 1790–1920 / footer 1920–2160
   ========================================================================== */

/* 设计变量统一在 css/tokens.css（:root），本文件只引用 var()，不再重复定义。 */


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

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

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

body{
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 15px/1.7 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img{ display: block; max-width: 100%; height: auto; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; }

.skip-link{
  position: absolute; left: 12px; top: -48px; z-index: 60;
  background: var(--green); color: var(--ink-invert); padding: 10px 18px; border-radius: var(--pill);
}
.skip-link:focus{ top: 12px; }

.wrap{
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

:where(a, button, summary, input):focus-visible{
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- header */
.site-header{
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--band);
  border-bottom: 1px solid rgba(36,53,42,.06);
}
.header-inner{
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}
.brand{ display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark{
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: var(--band);
}
.brand-mark svg{ width: 18px; height: 18px; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.1; }
.brand-name{ font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .03em; }
.brand-kicker{ font-size: 10px; letter-spacing: .2em; color: var(--muted-2); margin-top: 2px; }

.nav{ display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav > a,
.nav .nav-item > a{
  display: block;
  padding: 6px 10px; border-radius: var(--pill);
  font-size: 13px; color: var(--body); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav > a:hover,
.nav .nav-item > a:hover{ background: var(--green-soft); color: var(--green-deep); }
.nav a[aria-current="page"]{ color: var(--green-deep); font-weight: 600; }

/* 主导航下拉：hover 显示（不加 :focus-within，避免点击后不消失） */
.nav .nav-item{ position: relative; }
.nav .dropdown-menu{
  display: none;
  position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 168px; max-height: 360px; overflow-y: auto;
  margin: 0; padding: 8px; list-style: none;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.nav .nav-item:hover .dropdown-menu{ display: block; }
.nav .dropdown-menu a{
  display: block; padding: 7px 10px; border-radius: var(--r-2);
  font-size: 13px; color: var(--body); white-space: nowrap;
}
.nav .dropdown-menu a:hover{ background: var(--green-soft); color: var(--green-deep); }

/* ------------------------------------------------------------------ hero
   hero 总高 427：文案块 45→316，按钮 332→372，数据条 422→495             */
.hero{
  position: relative;
  height: 427px;
  background: var(--hero-grad);
  overflow: hidden;
}
.hero__inner{ position: relative; z-index: 2; }
.hero__copy{ padding-top: 45px; max-width: 620px; }
.eyebrow{
  margin: 0 0 15px;
  font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--olive); font-weight: 600;
}
.hero h1{
  margin: 0 0 17px;
  font-family: var(--font-serif); font-weight: 700;
  font-size: 32px; line-height: 1.34; letter-spacing: .012em;
  color: var(--green-deep);
}
.hero__lead{
  margin: 0;
  max-width: 590px;
  font-size: 13.5px; line-height: 1.95; color: var(--hero-ink);
}
.hero__media{
  position: absolute; top: 0;
  right: max(0px, calc((100% - 1440px) / 2));
  width: 53.5%; height: 350px;
  object-fit: cover;
  -webkit-mask-image: var(--hero-fade);
  mask-image: var(--hero-fade);
}

/* 按钮 + 数据条：两者在 hero 底部同一行（设计 y 429–495） */
.strip{ position: relative; z-index: 3; margin-top: -71px; }
.strip__inner{ display: flex; align-items: flex-start; gap: 46px; }
.strip__actions{ display: flex; flex-direction: column; gap: 9px; flex: none; width: 196px; }
.btn{
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 20px; border-radius: var(--pill);
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.btn--solid{ background: var(--green); color: var(--ink-invert); }
.btn--solid:hover{ background: var(--green-deep); }
.btn--ghost{ border-color: rgba(36,53,42,.32); color: var(--green-deep); background: rgba(255,255,255,.4); }
.btn--ghost:hover{ background: rgba(255,255,255,.75); }
.btn::after{ content: "→"; font-size: 12px; }

.strip__stats{
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0 22px;
  margin: 0; flex: 1 1 auto;
}
.stat{ margin: 0; }
.stat dt{
  font-family: var(--font-serif); font-size: 14px; font-weight: 700; color: var(--green-deep);
  padding-bottom: 5px; border-bottom: 1px solid rgba(36,53,42,.18);
  margin-bottom: 6px; line-height: 1.3;
}
.stat dd{ margin: 0; font-size: 11px; line-height: 1.65; color: var(--muted); }

/* ---------------------------------------------------------------- 区块通用 */
.section{ position: relative; }
.section--cats{ padding-top: 26px; }
.section--cats .sec-head{ margin-bottom: 35px; }
.section--flavor{ padding-top: 24px; }
.section--flavor .sec-head{ margin-bottom: 9px; }
.section--featured{ padding-top: 37px; }
.section--featured .sec-head{ margin-bottom: 8px; }
.section--quad{ padding-top: 30px; }
.section--quad .sec-head{ margin-bottom: 11px; }
.section--scope{ padding: 0; }
.sec-head{ margin: 0 0 38px; }
.sec-line{ display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-eyebrow{
  margin: 0;
  font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--olive); font-weight: 600;
}
.sec-title{
  margin: 0;
  font-family: var(--font-serif); font-weight: 700;
  font-size: 25px; line-height: 1.25; color: var(--ink);
  letter-spacing: .02em;
}
.sec-title--sm{ font-size: 19px; }
.sec-sub{ margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.sec-sub--sm{ margin-top: 5px; font-size: 12px; }
.sec-note{
  margin: 11px 0 0;
  font-size: 11.5px; color: var(--muted-2);
}
.sec-note--right{ text-align: right; }

/* ------------------------------------------------------------------- footer */
.site-footer{
  background: var(--green);
  color: var(--ink-invert);
  padding: 30px 0 26px;
}
.footer-inner{
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-start; gap: 22px 36px;
}
.footer__col{ flex: 1 1 180px; min-width: 170px; }
.footer__brand{ flex: 1 1 260px; min-width: 220px; }
.footer__name{
  font-family: var(--font-serif); font-size: 19px; font-weight: 700; color: var(--ink-invert);
  display: block;
}
.footer__tagline{
  margin: 10px 0 0; max-width: 320px;
  font-size: var(--fs-5); line-height: 1.85; color: var(--on-dark);
}
.footer__title{
  margin: 0 0 10px; font-size: var(--fs-6); font-weight: 600; color: var(--ink-invert);
  letter-spacing: .04em;
}
.footer__nav{ display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; align-content: start; }
.footer__topics{ display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.footer__topics a{ color: var(--on-dark); }
.footer__nav a{ color: var(--on-dark); }
.footer__nav a:hover,
.footer__topics a:hover{ color: var(--ink-invert); text-decoration: underline; text-underline-offset: 3px; }
.footer__about{ font-size: var(--fs-4); }
.footer__note{
  margin: 0; line-height: 1.75; color: var(--on-dark);
}
.footer__icp{ margin: 8px 0 0; color: var(--on-dark); }
.footer__copy{
  margin: 9px 0 0; color: var(--on-dark-faint);
}

/* --------------------------------------------------------------- 响应式 */
@media (max-width: 1240px){
  .nav a{ padding: 6px 7px; font-size: 12.5px; }
  .hero h1{ font-size: 29px; }
}

@media (max-width: 1024px){
  .site-header{ position: static; height: auto; }
  .header-inner{ height: auto; padding: 12px 0; flex-wrap: wrap; }
  .nav{ flex-wrap: wrap; }
  .nav a{ padding: 8px 10px; font-size: 13.5px; }
  .hero{ height: auto; display: flex; flex-direction: column; }
  .hero__copy{ order: -1; padding-top: 30px; max-width: none; }
  .hero__media{ position: relative; width: 100%; height: 300px; right: auto;
    -webkit-mask-image: none; mask-image: none; }
  .strip{ margin-top: 0; padding-top: 24px; }
  .strip__stats{ margin-top: 22px; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
  .site-footer{ padding-bottom: 24px; }
  .footer-inner{ flex-direction: column; row-gap: 20px; }
  .footer__col, .footer__brand{ flex: 1 1 auto; min-width: 0; width: 100%; }
  .footer__tagline{ max-width: none; }
}

@media (max-width: 720px){
  .wrap{ width: min(var(--wrap), calc(100% - 32px)); }
  .brand-name{ font-size: 16px; }
  .hero h1{ font-size: 25px; line-height: 1.42; }
  .hero__lead{ font-size: 13px; }
  .hero__media{ height: 220px; }
  .strip__actions .btn{ flex: 1 1 auto; justify-content: center; }
  .sec-title{ font-size: 21px; }
  .sec-head{ margin-bottom: 14px; }
  .sec-note--right{ text-align: left; }
}

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