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

:root{
  /* 面 */
  --bg: #eee6d1;
  --bg-hero: #eee4ce;
  --bg-soft: #f3ecdb;
  --bg-craft: #f3ecdb;
  --bg-warm: #f0e7d4;
  --panel: #e5d7b8;
  --green: #2e4735;
  --green-deep: #27402f;
  --green-2: #314c38;

  /* 墨 */
  --ink: #16140f;
  --ink-green: #233b2b;
  --body: #34322a;
  --muted: #5a5649;
  --cream: #f6efe0;
  --line: rgba(22,20,15,.14);
  --line-soft: rgba(22,20,15,.07);

  /* 尺寸 */
  --wrap: 1356px;
  --header-h: 69px;
  --radius: 7px;
  --radius-lg: 10px;

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

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

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

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

img{ display: block; max-width: 100%; height: auto; }
a{ color: inherit; text-decoration: none; }
ul,ol,dl,dd,dt{ margin: 0; padding: 0; list-style: none; }
button{ font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

.skip{
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--green); color: var(--cream); padding: 10px 16px;
}
.skip:focus{ left: 12px; top: 12px; }

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

/* ---------- header（稿高 69） ---------- */

.site-header{
  position: sticky; top: 0; z-index: 40;
  background: var(--green);
  color: var(--cream);
  height: var(--header-h);
}
.header-inner{ display: flex; align-items: center; gap: 24px; height: 100%; }
.brand{ display: flex; align-items: baseline; gap: 9px; flex: none; }
.brand-name{
  font-family: var(--font-serif); font-size: 16px; font-weight: 700;
  letter-spacing: .01em; color: var(--cream); white-space: nowrap;
}
.brand-kicker{
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(246,239,224,.55);
}
.main-nav{ display: flex; align-items: center; gap: 20px; margin-left: 6px; }
.main-nav a{
  font-size: 12.5px; color: rgba(246,239,224,.85);
  padding: 5px 0; border-bottom: 1px solid transparent; white-space: nowrap;
  transition: color .18s ease, border-color .18s ease;
}
.main-nav a:hover{ color: #fff; border-bottom-color: rgba(246,239,224,.5); }
.main-nav a[aria-current="page"]{ color: #fff; border-bottom-color: var(--cream); }

.search{ margin-left: auto; flex: none; }
.search-open{
  display: flex; align-items: center; gap: 7px;
  height: 27px; padding: 0 14px; min-width: 176px;
  border: 1px solid rgba(246,239,224,.32); border-radius: 999px;
  color: rgba(246,239,224,.7); font-size: 11.5px; white-space: nowrap;
  transition: border-color .18s ease, color .18s ease;
}
.search-open svg{ width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.search-open:hover{ border-color: rgba(246,239,224,.7); color: #fff; }
.search-input{
  display: none; width: 176px; height: 27px; padding: 0 12px;
  border: 1px solid rgba(246,239,224,.5); border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--cream); font-size: 11.5px;
}
.search-input::placeholder{ color: rgba(246,239,224,.55); }
.search.is-open .search-open{ display: none; }
.search.is-open .search-input{ display: block; }

.nav-toggle{ display: none; }

/* ---------- hero（69 → 443，稿高 374） ---------- */

.hero{
  position: relative;
  background: var(--bg-hero);
  height: 416px;
  overflow: visible;
}
.hero-photo{
  position: absolute; top: 0; right: 0;
  width: 532px; height: 416px;
}
.hero-photo img{ width: 100%; height: 100%; object-fit: cover; }
.hero-inner{ position: relative; z-index: 1; padding: 40px 0 0; }
.hero .kicker{ color: var(--ink-green); opacity: .72; }
.hero h1{
  color: var(--ink-green);
  font-size: 66px; line-height: 1.22; letter-spacing: 0;
  margin: 12px 0 0; max-width: 720px;
}
.hero .lede{
  margin: 14px 0 0; max-width: 640px;
  font-size: 16px; line-height: 1.9; color: #35422f;
}

.kicker{
  margin: 0; font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted);
}
.kicker-center{ text-align: center; }
.kicker-light{ color: rgba(246,239,224,.6); }

.hero-bar{
  display: flex; align-items: center;
  margin-top: 26px; padding: 0 18px; height: 42px;
  background: var(--green); color: var(--cream);
  border-radius: 2px; width: fit-content; max-width: 100%;
}
.hero-cta{
  font-size: 12px; color: var(--cream);
  padding: 3px 0; border-bottom: 1px solid transparent; white-space: nowrap;
}
.hero-cta:hover{ border-bottom-color: rgba(246,239,224,.6); }
.hero-cta + .hero-cta{ margin-left: 16px; padding-left: 16px; border-left: 1px solid rgba(246,239,224,.24); }
.hero-stats{ display: flex; align-items: center; margin-left: 20px; padding-left: 20px; border-left: 1px solid rgba(246,239,224,.24); }
.hero-stats .stat{ font-size: 11px; color: rgba(246,239,224,.76); white-space: nowrap; }
.hero-stats .stat + .stat{ margin-left: 12px; }
.hero-stats b{ font-family: var(--font-serif); font-size: 13px; color: #fff; margin-right: 2px; }

/* ---------- 分区基线 ---------- */

.sec{ padding: 0; }
.sec-title{ font-size: 19px; line-height: 1.45; letter-spacing: .01em; margin-top: 9px; }
.sec-title.center{ text-align: center; }
.sec-note{ margin: 16px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.sec-note.center{ text-align: center; }

/* ---------- 分类（443 → 869） ---------- */

.sec-cat{ background: var(--bg); padding-top: 15px; padding-bottom: 29px; }
.cat-grid{
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 18px; margin-top: 22px;
}
.cat-card img{
  width: 100%; aspect-ratio: 1.53 / 1; object-fit: cover;
  border-radius: var(--radius);
}
.cat-no{ display: inline-block; margin-top: 7px; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); }
.cat-card h3{ font-size: 16px; line-height: 1.35; margin-top: 1px; }
.cat-card h3 a:hover,
.dish h3 a:hover{ color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.cat-card p{ margin: 6px 0 0; font-size: 11px; line-height: 1.68; color: var(--body); }

/* ---------- 两条主线（869 → 1222） ---------- */

.sec-craft{ background: var(--bg-soft); padding-top: 24px; padding-bottom: 17px; }
.craft-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 26px; }
.craft-card{ display: grid; grid-template-columns: 268px 1fr; gap: 18px; align-items: stretch; height: 204px; }
.craft-card img{ width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.craft-body h3{ font-size: 17px; line-height: 1.35; }
.craft-list{ margin-top: 6px; }
.craft-list dt{ font-family: var(--font-serif); font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.craft-list dd{ font-size: 11px; line-height: 1.55; color: var(--body); margin-bottom: 3px; }
.craft-list dd:last-child{ margin-bottom: 0; }

/* ---------- 精讲菜谱（1222 → 1503） ---------- */

.sec-featured{ padding-top: 12px; padding-bottom: 9px; }
.dish-grid{ display: grid; grid-template-columns: repeat(8, 1fr); gap: 15px; margin-top: 14px; }
.dish img{ width: 100%; aspect-ratio: 1.30 / 1; object-fit: cover; border-radius: 5px; }
.dish h3{ font-size: 12.5px; line-height: 1.3; margin-top: 6px; }
.dish p{ margin: 4px 0 0; font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.dish-meta{ display: block; margin-top: 4px; font-size: 9.5px; letter-spacing: .03em; color: var(--green-2); opacity: .85; }

/* ---------- 上手顺序（1503 → 1710） ---------- */

.sec-path{ background: var(--bg-warm); padding-top: 14px; padding-bottom: 22px; }
.path-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 10px; }
.path-step{ padding-top: 9px; border-top: 1px solid var(--line); }
.path-step::before{
  content: attr(data-no); display: block;
  font-family: var(--font-serif); font-size: 11px; color: var(--muted); letter-spacing: .08em;
  line-height: 1.7;
}
.path-step h3{ font-size: 14px; line-height: 1.45; margin-top: 2px; }
.path-step p{ margin: 4px 0 0; font-size: 11px; line-height: 1.6; color: var(--body); }
.path-warn{ margin: 10px 0 0; text-align: center; font-size: 11px; line-height: 1.6; color: #4a3a20; }

/* ---------- 四栏（1710 → 1953，稿上四栏等高 243） ---------- */

.sec-four{ padding: 15px 0 29px; }
.four-grid{
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
  align-items: stretch;
}
.four-col{
  padding: 13px 14px 13px; border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column; height: 214px;
}
.four-col.is-dark{ background: var(--green); color: rgba(246,239,224,.8); }
.four-col.is-dark h2{ color: var(--cream); }
.four-col.is-dark .kicker{ color: rgba(246,239,224,.52); }
.four-head h2{ font-size: 12.5px; line-height: 1.4; margin-top: 4px; }
.four-head.is-strip{
  margin: -13px -14px 9px; padding: 9px 14px 8px;
  background: var(--green);
}
.four-head.is-strip h2{ color: var(--cream); }
.four-head.is-strip .kicker{ color: rgba(246,239,224,.52); }

.mini-list{
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 4px;
}
.mini-list dt{ font-family: var(--font-serif); font-size: 10px; font-weight: 700; color: inherit; line-height: 1.35; }
.mini-list dd{ font-size: 9px; line-height: 1.42; color: inherit; margin: 0 0 4px; }
.mini-list dd:last-child{ margin-bottom: 0; }
.four-col.is-dark .mini-list dt{ color: var(--cream); }
.mini-note{
  margin: 0; padding: 0; font-size: 9px; line-height: 1.4;
  color: rgba(246,239,224,.6);
}
.four-photo{
  width: 100%; flex: 1 1 auto; min-height: 96px; object-fit: cover;
  border-radius: 4px; margin: 7px 0 0;
}
.four-photo + .mini-note{ margin: 7px 0 0; padding: 0; border: 0; }

.faq-list{ margin-top: 2px; }
.faq{ border-bottom: 1px solid var(--line-soft); }
.faq-q{
  display: block; width: 100%; text-align: left; padding: 8px 14px 8px 0;
  font-size: 10.5px; line-height: 1.45; color: var(--ink); position: relative;
}
.faq-q::after{ content: "+"; position: absolute; right: 0; top: 7px; font-size: 12px; color: var(--muted); }
.faq-q[aria-expanded="true"]::after{ content: "–"; }
.faq-a{ display: none; padding: 0 0 8px; }
.faq-a p{ margin: 0; font-size: 10px; line-height: 1.6; color: var(--body); }
.faq.is-open .faq-a{ display: block; }

.scope-list{ margin-top: 2px; }
.scope-list li{ font-size: 10px; line-height: 1.6; color: var(--body); padding-bottom: 6px; }
.scope-list li + li{ border-top: 1px solid var(--line-soft); padding-top: 6px; }

/* ---------- 页脚（1953 → 2160） ---------- */

.site-footer{ background: var(--green); color: rgba(246,239,224,.7); padding: 63px 0 54px; }
.footer-inner{ display: grid; grid-template-columns: 380px 1fr 260px; gap: 8px 30px; align-items: start; }
.footer-brand{ display: flex; flex-direction: column; gap: 4px; }
.footer-name{ font-family: var(--font-serif); font-size: 15px; color: var(--cream); }
.footer-tag{ font-size: 11px; line-height: 1.6; color: rgba(246,239,224,.55); }
.footer-nav{ display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 2px; }
.footer-nav a{ font-size: 11.5px; color: rgba(246,239,224,.8); }
.footer-nav a:hover{ color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-note{ margin: 0; font-size: 10.5px; line-height: 1.6; color: rgba(246,239,224,.5); text-align: right; }
.footer-copy{ grid-column: 1 / -1; margin: 16px 0 0; font-size: 10.5px; color: rgba(246,239,224,.4); }

/* ---------- 站内过滤提示 ---------- */

.filter-note{ display: none; margin: 14px 0 -4px; font-size: 12.5px; color: var(--green); }
.filter-note.is-on{ display: block; }
.is-hidden{ display: none !important; }
[hidden]{ display: none !important; }

/* ---------- responsive ---------- */

@media (max-width: 1240px){
  .main-nav{ gap: 14px; }
  .main-nav a{ font-size: 12px; }
  .hero h1{ font-size: 40px; }
  .cat-grid{ grid-template-columns: repeat(4, 1fr); }
  .dish-grid{ grid-template-columns: repeat(4, 1fr); }
  .four-grid{ grid-template-columns: repeat(2, 1fr); }
  .craft-card{ grid-template-columns: 220px 1fr; }
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .footer-note{ text-align: left; grid-column: 1 / -1; }
}

@media (max-width: 960px){
  .hero{ height: auto; }
  .hero-photo{ position: static; width: 100%; height: 240px; }
  .hero-inner{ padding: 28px 0 30px; }
  .hero h1{ font-size: 38px; max-width: none; }
  .hero-bar{ flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 6px 0; }
  .hero-stats{ margin-left: 0; padding-left: 0; border-left: 0; flex-wrap: wrap; }
  .craft-grid{ grid-template-columns: 1fr; gap: 24px; }
  .path-grid{ grid-template-columns: 1fr; gap: 16px; }
  .footer-inner{ grid-template-columns: 1fr; }
  .four-col h2{ font-size: 14px; }
  .mini-list dd, .faq-q, .scope-list li{ font-size: 12px; }
}

@media (max-width: 860px){
  .wrap{ width: min(100% - 40px, var(--wrap)); }
  .main-nav{
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--green); padding: 6px 20px 14px;
  }
  .main-nav a{ width: 100%; padding: 10px 0; font-size: 13px; border-bottom: 1px solid rgba(246,239,224,.14); }
  .header-inner.is-open .main-nav{ display: flex; }
  .nav-toggle{
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 32px; height: 28px; margin-left: auto; padding: 0 5px;
  }
  .nav-toggle span{ display: block; height: 1.5px; background: var(--cream); }
  .search{ margin-left: 8px; }
  .search-open{ min-width: 32px; padding: 0 9px; }
  .search-hint{ display: none; }
  .sec-cat{ padding-top: 34px; }
  .sec-title{ font-size: 17px; }
  .hero h1{ font-size: 29px; }
  .hero .lede{ font-size: 13px; }
  .cat-grid{ grid-template-columns: repeat(2, 1fr); }
  .dish-grid{ grid-template-columns: repeat(2, 1fr); }
  .four-grid{ grid-template-columns: 1fr; }
  .craft-card{ grid-template-columns: 1fr; }
  .craft-card img{ aspect-ratio: 2 / 1; }
  .four-col h2{ font-size: 15px; }
  .mini-list dd, .faq-q, .scope-list li{ font-size: 12.5px; }
  .footer-copy{ margin-top: 10px; }
}

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