/* ==========================================================================
   川菜菜谱大全 · style.css
   设计基线：03-ui/home-ui-desktop.png（1024×1536 → 1440×2160）
   分区预算见 03-ui/compare-log.md，勿随手改区块高度
   ========================================================================== */

:root{
  /* 面 */
  --bg: #fdf5ec;
  --surface: #fcf4ec;
  --cream: #faeee3;
  --cream-2: #f7e8d9;
  --hero-a: #f9e7d5;
  --hero-b: #eed3bc;

  /* 墨 */
  --ink: #2c211a;
  --body: #4b3d34;
  --muted: #6b5b4e;
  --muted-2: #8d7a6a;

  /* 强调 */
  --red: #a41c1c;
  --red-deep: #8c100c;
  --red-ink: #98110b;
  --red-soft: rgba(164,28,28,.10);
  --line: rgba(44,33,26,.14);
  --line-soft: rgba(44,33,26,.08);

  /* 尺寸 */
  --wrap: 1350px;
  --header-h: 74px;
  --radius: 10px;
  --radius-lg: 14px;
  --pill: 999px;

  --font-serif: 'Songti SC',SimSun,'Noto Serif SC',Georgia,serif;
  --font-sans: 'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  --shadow: 0 20px 44px -34px rgba(44,33,26,.55);
}

*,*::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%; }

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

img{ display: block; max-width: 100%; height: auto; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3{ margin: 0; font-family: var(--font-serif); color: var(--ink); font-weight: 700; }
p{ margin: 0; }
ul,ol,dl,dd{ margin: 0; padding: 0; list-style: none; }
button{ font: inherit; color: inherit; }

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

.skip{
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--red); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus{ left: 0; }

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

/* ------------------------------------------------------------------ header */
.site-header{
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(250,238,227,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner{
  height: 100%;
  display: flex; align-items: center; gap: 24px;
}
.brand{ display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand-name{ font-family: var(--font-serif); font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.brand-kicker{ font-size: 10.5px; letter-spacing: .22em; color: var(--red); text-transform: uppercase; }

.nav{ display: flex; align-items: center; gap: 22px; margin-left: 12px; }
.nav a{
  font-size: 13.5px; color: var(--body); padding: 6px 0; position: relative; white-space: nowrap;
}
.nav a::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav a:hover::after,
.nav a[aria-current="page"]::after{ transform: scaleX(1); }
.nav a[aria-current="page"]{ color: var(--red-ink); }

.search{
  margin-left: auto; flex: none;
  display: flex; align-items: center; gap: 8px;
  width: 190px; height: 36px; padding: 0 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--pill);
}
.search svg{ width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted-2); stroke-width: 1.6; }
.search input{
  border: 0; background: none; outline: none; width: 100%;
  font: 12.5px/1 var(--font-sans); color: var(--ink);
}
.search input::placeholder{ color: var(--muted-2); }

.nav-toggle{
  display: none; margin-left: auto;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span{ display: block; width: 16px; height: 1.5px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-5.5px) rotate(-45deg); }

/* -------------------------------------------------------------------- hero */
.hero{
  position: relative;
  height: 349px;
  background: linear-gradient(104deg, var(--hero-a) 0%, var(--hero-b) 100%);
  overflow: hidden;
}
.hero-inner{
  display: grid;
  grid-template-columns: minmax(0,0.94fr) minmax(0,1.06fr);
  align-items: stretch;
  height: 100%;
}
.hero-copy{
  padding: 14px 34px 12px max(24px, calc((100vw - var(--wrap)) / 2));
  display: flex; flex-direction: column; justify-content: center;
}
.eyebrow{
  font: 500 11px/1.4 var(--font-sans);
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--red);
}
.hero-copy .eyebrow{ margin-bottom: 9px; }
.hero-copy h1{
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.32;
  letter-spacing: -.01em;
  color: var(--red-ink);
  max-width: 15em;
}
.hero-lead{
  margin-top: 11px;
  max-width: 34em;
  font-size: 13px; line-height: 1.8; color: var(--body);
}
.hero-actions{ margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 22px; border-radius: var(--pill);
  font-size: 13px; letter-spacing: .02em;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-solid{ background: var(--red); color: #fff; }
.btn-solid:hover{ background: var(--red-deep); }
.btn-ghost{ background: rgba(255,255,255,.6); color: var(--red-ink); border: 1px solid rgba(164,28,28,.32); }
.btn-ghost:hover{ background: #fff; border-color: var(--red); }

.hero-stats{
  margin-top: 13px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  border-top: 1px solid rgba(44,33,26,.14);
  padding-top: 12px;
}
.hero-stats dt{ font-size: 12.5px; font-weight: 600; color: var(--red-ink); }
.hero-stats dd{ margin: 2px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }

.hero-media{
  position: relative; margin: 0; height: 100%;
  overflow: hidden;
}
.hero-media img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 58% 48%;
}
.hero-media::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(249,231,213,.95) 0%, rgba(249,231,213,.30) 16%, rgba(249,231,213,0) 40%);
  pointer-events: none;
}
.hero-media figcaption{
  position: absolute; left: 26%; right: 5%; bottom: 16px;
  font-size: 11px; line-height: 1.6; color: rgba(255,244,232,.86);
  text-shadow: 0 1px 8px rgba(30,10,4,.7);
}

/* ----------------------------------------------------------------- section */
.section{
  background: var(--bg);
  padding-inline: max(24px, calc((100vw - var(--wrap)) / 2));
}
/* 区块自己承担居中留白，内部 wrap 不再二次限宽，避免 h2 与容器左缘错位 */
.section > .wrap{ width: 100%; max-width: none; margin-inline: 0; }
.categories{ padding: 2px 0 35px; margin-top: 17px; }
.flavors{ padding: 8px 0 68px; margin-top: 18px; }
.pair{ margin-top: 35px; }
.pair-second{ margin-top: 0; }
.pair-third{ margin-top: 0; }
.pair-col{ min-height: 0; }

.sec-head{ text-align: center; }
.sec-head.left{ text-align: left; }
.sec-head h2{
  margin-top: 8px;
  font-size: clamp(19px, 1.62vw, 23px);
  line-height: 1.45;
  letter-spacing: -.005em;
}
.sec-note{
  margin-top: 14px; text-align: center;
  font-size: 11.5px; color: var(--muted-2);
}
.sec-note.left{ text-align: left; margin-top: 12px; }

/* -------------------------------------------------------------- categories */
.cat-grid{
  margin-top: 30px;
  display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 16px;
}
.cat{ }
.cat img{
  width: 100%; aspect-ratio: 8 / 5; object-fit: cover;
  border-radius: var(--radius); background: var(--cream-2);
}
.cat-head{ display: flex; align-items: baseline; gap: 7px; margin-top: 12px; }
.cat-num{
  font: 600 10px/1 var(--font-sans); letter-spacing: .1em; color: var(--red);
}
.cat h3{ font-size: 15.5px; line-height: 1.3; }
.cat p{ margin-top: 11px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

/* ----------------------------------------------------------------- flavors */
.flavor-grid{
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(9, minmax(0,1fr)); gap: 14px;
}
.flavor-grid li{ padding-top: 10px; border-top: 1px solid var(--line); }
.flavor-grid h3{ font-size: 16px; letter-spacing: .02em; }
.flavor-grid p{ margin-top: 9px; font-size: 11.5px; line-height: 1.85; color: var(--muted); }

/* -------------------------------------------------------------------- pair */
.pair-grid{
  display: grid; grid-template-columns: minmax(0,1.02fr) minmax(0,1fr);
  gap: 40px;
  align-items: start;
}
.pair-col{ min-width: 0; }

/* featured */
.dish-grid{
  margin-top: 10px;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px 16px;
}
.dish{ display: block; }
.dish img{
  width: 100%; aspect-ratio: 3.06 / 1; object-fit: cover;
  border-radius: 8px; background: var(--cream-2);
  transition: filter .25s ease;
}
.dish:hover img{ filter: brightness(1.06) saturate(1.05); }
.dish h3{ margin-top: 6px; font-size: 13px; }
.dish p{ margin-top: 2px; font-size: 10px; line-height: 1.6; color: var(--muted); }

/* path */
.path-list{ margin-top: 8px; display: grid; gap: 5px; }
.path-list li{
  padding: 3px 14px 3px;
  background: var(--surface);
  border-left: 2px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.path-step{ font-size: 10px; letter-spacing: .16em; color: var(--red); }
.path-list h3{ margin-top: 1px; font-size: 13.5px; }
.path-list p{ margin-top: 2px; font-size: 10px; line-height: 1.62; color: var(--muted); }
.path-warn{
  margin-top: 9px; padding: 7px 14px;
  background: var(--red-soft); border-radius: var(--radius);
  font-size: 11px; line-height: 1.7; color: var(--red-ink);
}

/* pantry */
.shelf-grid{
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
}
.shelf-grid li{ padding-top: 8px; border-top: 1px solid var(--line); }
.shelf-grid p{ margin-top: 4px; font-size: 10.5px; line-height: 1.66; color: var(--muted); }
.shelf-grid h3{ font-size: 13px; }

/* technique */
.tech-grid{
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
}
.tech-grid img{
  width: 100%; aspect-ratio: 1.86 / 1; object-fit: cover;
  border-radius: 8px; background: var(--cream-2);
}
.tech-grid h3{ margin-top: 6px; font-size: 13px; }

/* faq + scope */
.faq-list{ margin-top: 6px; }
.faq-list details{
  border-bottom: 1px solid var(--line-soft);
}
.faq-list summary{
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 2px;
  font: 600 12px/1.5 var(--font-sans); color: var(--ink);
}
.faq-list summary::-webkit-details-marker{ display: none; }
.faq-list summary::after{
  content: "+"; flex: none;
  font: 400 15px/1 var(--font-sans); color: var(--red);
  transition: transform .2s ease;
}
.faq-list details[open] summary::after{ transform: rotate(45deg); }
.faq-list p{ padding: 0 2px 9px; font-size: 11px; line-height: 1.72; color: var(--muted); }

.scope-list{ margin-top: 9px; display: grid; gap: 3px; }
.scope-list h3{ font-size: 12.5px; }
.scope-list p{ margin-top: 2px; font-size: 10.5px; line-height: 1.66; color: var(--muted); }

/* ------------------------------------------------------------------ footer */
.site-footer{
  margin-top: 26px;
  background: var(--red);
  color: rgba(255,246,238,.92);
  padding: 52px 0 48px;
}
.footer-inner{
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr);
  gap: 32px;
  align-items: start;
}
.footer-logo{ font-family: var(--font-serif); font-size: 17px; font-weight: 700; color: #fff; }
.footer-line{ margin-top: 6px; font-size: 11.5px; line-height: 1.7; color: rgba(255,240,230,.78); }
.footer-nav{ display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12.5px; padding-top: 4px; }
.footer-nav a{ color: rgba(255,246,238,.92); border-bottom: 1px solid rgba(255,246,238,0); transition: border-color .2s ease; }
.footer-nav a:hover{ border-bottom-color: rgba(255,246,238,.7); }
.footer-meta{ font-size: 11px; line-height: 1.8; color: rgba(255,240,230,.72); text-align: right; }

/* 搜索筛选的空状态 */
.search-empty{
  display: none;
  margin-top: 16px; text-align: center;
  font-size: 12px; color: var(--muted);
}
.search-empty[data-active="true"]{ display: block; }
[data-filtered="out"]{ display: none; }
[data-filtered-empty="true"]{ display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px){
  .nav{ gap: 16px; }
  .nav a{ font-size: 13px; }
  .cat-grid{ grid-template-columns: repeat(4, minmax(0,1fr)); }
  .flavor-grid{ grid-template-columns: repeat(5, minmax(0,1fr)); }
  .shelf-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tech-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pair-grid{ gap: 30px; }
}

@media (max-width: 980px){
  .nav-toggle{ display: flex; }
  .search{ display: none; }
  .nav{
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 6px 24px 12px;
    display: none;
  }
  .nav[data-open="true"]{ display: flex; }
  .nav a{ padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a::after{ display: none; }

  .hero-inner{ grid-template-columns: minmax(0,1fr); }
  .hero-copy{ padding: 28px 24px 24px; }
  .hero-media{ order: -1; min-height: 260px; }
  .hero-media img{ min-height: 260px; }
  .hero-media::after{
    background: linear-gradient(180deg, rgba(251,237,224,0) 40%, rgba(251,237,224,.9) 100%);
  }
  .hero-media figcaption{ left: 24px; right: 24px; bottom: 12px; }
  .pair-grid{ grid-template-columns: minmax(0,1fr); gap: 28px; }
  .dish-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .footer-inner{ grid-template-columns: minmax(0,1fr); gap: 18px; }
  .footer-meta{ text-align: left; }
}

@media (max-width: 720px){
  body{ font-size: 14.5px; }
  .wrap{ width: calc(100% - 32px); }
  h1,.hero-copy h1{ font-size: 26px; }
  .cat-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
  .flavor-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dish-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shelf-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tech-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-stats{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 12px; }
  .btn{ height: 38px; padding: 0 16px; font-size: 12.5px; }
  .sec-head h2{ font-size: 18px; }
  .faq-list summary{ font-size: 12.5px; }
}

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