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

:root{
  /* 面 */
  --bg: #fdf9eb;
  --surface: #f7f4e4;
  --band: #f4f1e1;
  --mint: #e7ebd8;
  --mint-deep: #d9e2c9;

  /* 墨 */
  --ink: #11140f;
  --body: #3a3f37;
  --muted: #6c7168;
  --muted-2: #8b8f85;

  /* 品牌 */
  --green: #16532f;
  --green-deep: #0e4827;
  --green-soft: rgba(22,83,47,.10);
  --gold: #c08a2e;
  --gold-soft: rgba(192,138,46,.16);
  --cream: #f6f2e4;
  --line: rgba(17,20,15,.12);
  --line-soft: rgba(17,20,15,.07);

  /* 尺寸（对齐 03-ui/compare-log.md 的分区预算） */
  --wrap: 1392px;
  --header-h: 76px;
  --h-hero: 348px;
  --h-cat: 322px;
  --h-feat: 282px;
  --h-naan: 310px;
  --h-duo: 195px;
  --h-duos: 159px;
  --h-scope: 153px;
  --h-footer: 150px;

  --radius: 6px;
  --radius-lg: 10px;
  --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;
}

*,*::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;
}
[hidden]{ display: none !important; }

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

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: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--green); color: #fff; font-size: 14px;
  transition: top .16s ease;
}
.skip:focus{ top: 12px; }

.eyebrow{
  font-size: 11.5px; font-weight: 600; letter-spacing: .16em; line-height: 1.3;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow-light{ color: #d9c79a; }

/* ------------------------------------------------------------------ M0 页头 */
.site-header{
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(253,249,235,.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}
.header-inner{
  height: 100%;
  display: flex; align-items: center; gap: 22px;
}
.brand{ display: flex; flex-direction: column; line-height: 1.1; flex: none; }
.brand-name{ font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.brand-kicker{ font-size: 10.5px; letter-spacing: .26em; color: var(--green); text-transform: uppercase; }

.nav{
  display: flex; align-items: center; gap: 4px;
  margin-left: 150px; font-size: 14.5px; color: var(--body);
  flex: 1; min-width: 0; justify-content: space-between;
}
.nav a{
  padding: 7px 9px; border-radius: 6px; white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.nav a:hover{ color: var(--green); background: var(--green-soft); }
.nav a[aria-current="page"]{ color: var(--green); font-weight: 600; }
.nav a:focus-visible{ outline: 2px solid var(--green); outline-offset: 2px; }

/* ------------------------------------------------------------------ M1 hero */
.hero{
  position: relative;
  height: var(--h-hero);
  display: grid; grid-template-columns: 55.4% 44.6%;
  overflow: hidden;
  background: var(--green);
}
.hero-panel{
  position: relative; z-index: 2;
  background: var(--green);
  color: #f2efe2;
  padding: 4px 0 0 clamp(16px, calc((100vw - var(--wrap))/2), 400px);
  padding-right: 30px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.hero-panel{
  position: relative; z-index: 2;
  background: var(--green);
  color: #f2efe2;
  padding: 4px 0 0 clamp(16px, calc((100vw - var(--wrap))/2), 400px);
  padding-right: 30px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.hero-panel > *{ max-width: calc(1440px * 0.55 - 60px); }
/* 稿上左侧五行节奏：眉标 80–124 / 标题 170–214 / 导语 249–307 / 按钮 326–364 / 数据 370–408 */
.hero .eyebrow{ height: 45px; align-items: flex-start; padding-top: 8px; }
.hero h1{
  font-size: 40px; line-height: 1.12; color: #fdfbf2;
  letter-spacing: .01em; margin-top: 45px;
  height: 45px; white-space: nowrap;
}
.hero-lead{
  margin-top: 34px;
  font-size: 14px; line-height: 1.71; color: #d5ddcd;
  width: 660px; max-width: 100%;
}
.hero-actions{ display: flex; gap: 12px; margin-top: 29px; }
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 22px; border-radius: var(--pill);
  font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-gold{ background: var(--gold); color: #21170a; }
.btn-gold:hover{ background: #d19936; transform: translateY(-1px); }
.btn-outline{ border: 1px solid rgba(246,242,228,.5); color: #f2efe2; }
.btn-outline:hover{ background: rgba(246,242,228,.12); border-color: rgba(246,242,228,.8); }
.btn:focus-visible{ outline: 2px solid #fdfbf2; outline-offset: 3px; }

.hero-stats{
  display: grid; grid-template-columns: repeat(4, auto); gap: 0 26px;
  margin-top: 6px; height: 38px;
}
.hero-stats dt{
  font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: #fdfbf2;
  white-space: nowrap; line-height: 1.35;
}
.hero-stats dd{ font-size: 11px; line-height: 1.3; color: #b9c6ae; max-width: 140px; }

.hero-media{
  position: absolute; inset: 0 0 0 auto; margin: 0;
  width: 44.6%; overflow: hidden;
  right: max(0px, calc((100% - 100vw) / 2));
}
.hero-media img{ width: 100%; height: 100%; object-fit: cover; object-position: 52% 56%; filter: brightness(1.12) saturate(.9) contrast(.96); }
.hero-media figcaption{
  position: absolute; left: 22px; bottom: 16px; right: 22px;
  font-size: 11.5px; line-height: 1.5; color: #f4efe0;
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
}

/* -------------------------------------------------------------- 分区通用 */
.section{ position: relative; }
.sec-head{ display: flex; flex-direction: column; gap: 4px; padding-top: 0; }
.sec-head h2{ font-size: 23px; line-height: 1.22; letter-spacing: .01em; }
.sub-head{ display: flex; flex-direction: column; gap: 4px; }
.sub-head h2{ font-size: 18px; line-height: 1.3; }

/* ------------------------------------------------------- M2 分类索引 */
.categories{ height: var(--h-cat); padding-top: 9px; }
.cat-grid{
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 14px;
  margin-top: 12px; padding-inline: 15px;
}
.cat a{ display: flex; flex-direction: column; gap: 13px; height: 100%; }
.cat-thumb{
  display: block; height: 100px; overflow: hidden; border-radius: var(--radius);
  background: var(--band);
}
.cat-thumb img{ width: 100%; height: 100%; object-fit: cover; filter: brightness(1.06) saturate(.92); transition: transform .35s ease; }
.cat a:hover .cat-thumb img{ transform: scale(1.045); }
.cat-head{ display: flex; align-items: baseline; gap: 6px; height: 22px; }
.cat-num{
  font-family: var(--font-serif); font-size: 11px; font-weight: 700; color: var(--gold);
  letter-spacing: .04em;
}
.cat-name{ font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--ink); }
.cat-desc{ font-size: 11.5px; line-height: 1.56; color: var(--muted); }
.cat a:focus-visible{ outline: 2px solid var(--green); outline-offset: 4px; border-radius: var(--radius); }
.cat-note{
  margin-top: 9px; text-align: center;
  font-size: 11.5px; line-height: 1.4; color: var(--muted-2);
  background: var(--band); border-radius: var(--pill);
  padding: 2px 16px; width: fit-content; margin-inline: auto;
}

/* ------------------------------------------------------- M3 精讲菜谱 */
/* 分区间距按稿量：M2→M3 12、M3→M4 20、M4→M5 40、M5→M7 36、M7→M9 27、M9→页脚 30 */
.featured{ height: var(--h-feat); margin-top: 12px; }
.feat-grid{
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px;
  margin-top: 19px;
}
.feat a{ display: flex; flex-direction: column; gap: 13px; }
.feat-thumb{
  display: block; height: 118px; overflow: hidden; border-radius: var(--radius);
  background: var(--band);
}
.feat-thumb img{ width: 100%; height: 100%; object-fit: cover; filter: brightness(1.05) saturate(.93); transition: transform .35s ease; }
.feat a:hover .feat-thumb img{ transform: scale(1.05); }
.feat h3{ font-size: 14px; line-height: 1.3; }
.feat p{ font-size: 11.5px; line-height: 1.56; color: var(--muted); }
.feat a:focus-visible{ outline: 2px solid var(--green); outline-offset: 4px; border-radius: var(--radius); }

/* ------------------------------------------------------- M4 烤箱烤馕 */
.naan{ height: var(--h-naan); margin-top: 20px; }
.naan-inner{
  height: 100%; display: grid;
  grid-template-columns: 274px 1fr 330px;
  grid-template-rows: auto 1fr;
  gap: 0 30px;
  background: var(--mint);
  border-radius: var(--radius-lg);
  padding: 16px 22px 14px;
  margin-top: 0;
}
.naan-media{ grid-row: 1 / span 2; margin: 0; height: 100%; overflow: hidden; border-radius: var(--radius); }
.naan-media img{ width: 100%; height: 100%; object-fit: cover; filter: brightness(1.05) saturate(.92); }
.naan-copy{ grid-column: 2; }
.naan-copy h2{ font-size: 19px; line-height: 1.32; margin-top: 4px; }
.naan-steps{
  grid-column: 2; display: flex; flex-direction: column; gap: 7px; margin-top: 8px;
  counter-reset: naanstep;
}
.naan-steps li{ font-size: 12px; line-height: 1.5; color: var(--body); }
.naan-steps strong{ color: var(--ink); font-family: var(--font-serif); font-size: 12.5px; }
.naan-steps span{ display: block; color: var(--muted); }
.naan-note{
  grid-column: 3; grid-row: 1 / span 2;
  font-size: 12.5px; line-height: 2.05; color: var(--muted);
  border-left: 1px solid rgba(17,20,15,.14);
  padding: 34px 0 0 22px; align-self: start; max-width: 330px;
}

/* ------------------------------------------------- M5 上手顺序 + M6 香料 */
.duo{ height: var(--h-duo); margin-top: 40px; }
.duo-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 40px; height: 100%; }
.path, .pantry{
  display: grid; grid-template-columns: 173px 1fr; grid-template-rows: auto 1fr;
  gap: 0 22px; align-content: start; padding-top: 8px;
}
.sub-head{ grid-column: 1 / -1; }
.sub-head h2{ max-width: 500px; }
.path-media, .pantry-media{
  margin: 0; margin-top: 10px; height: 122px; overflow: hidden; border-radius: var(--radius);
}
.path-media img, .pantry-media img{ width: 100%; height: 100%; object-fit: cover; filter: brightness(1.05) saturate(.92); }
.path-copy, .pantry-copy{
  grid-column: 2; margin-top: 14px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; line-height: 1.55; color: var(--muted);
}
.path-copy strong, .pantry-copy strong{
  color: var(--ink); font-family: var(--font-serif); font-size: 12.5px;
}
.path-warn{ color: var(--gold); }
.pantry-note{ color: var(--muted-2); }

/* --------------------------------------------- M7 手上功夫 + M8 常见问题 */
.duoS{ height: var(--h-duos); margin-top: 36px; }
.technique .sub-head, .faq .sub-head{ gap: 5px; }
.tech-grid{
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-top: 16px;
}
.tech-grid dt{
  font-family: var(--font-serif); font-size: 13px; font-weight: 700; color: var(--ink);
  margin-bottom: 2px;
}
.tech-grid dd{ font-size: 12px; line-height: 1.55; color: var(--muted); }

.faq-list{ margin-top: 12px; display: flex; flex-direction: column; }
.faq-list details{ border-top: 1px solid var(--line-soft); }
.faq-list details:last-child{ border-bottom: 1px solid var(--line-soft); }
.faq-list summary{
  list-style: none; cursor: pointer; padding: 8px 18px 8px 0; position: relative;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  transition: color .15s ease;
}
.faq-list summary::-webkit-details-marker{ display: none; }
.faq-list summary::after{
  content: "+"; position: absolute; right: 2px; top: 6px;
  font-size: 15px; color: var(--gold); font-weight: 400;
}
.faq-list details[open] summary::after{ content: "–"; }
.faq-list summary:hover{ color: var(--green); }
.faq-list summary:focus-visible{ outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.faq-list p{ font-size: 12px; line-height: 1.6; color: var(--muted); padding: 0 18px 9px 0; }

/* ------------------------------------------------------- M9 收录说明 */
.scope{ height: var(--h-scope); background: var(--mint); margin-top: 27px; }
.scope-grid{
  display: grid; grid-template-columns: 300px 1fr; gap: 0 30px;
  height: 100%; align-content: center; padding-top: 6px;
}
.scope h2{ font-size: 19px; }
.scope-list{
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 34px;
  font-size: 12px; line-height: 1.6; color: var(--muted);
}
.scope-list li:last-child{ grid-column: 2; }
.scope-list span{ color: var(--ink); font-family: var(--font-serif); }

/* ------------------------------------------------------- M10 页脚 */
.site-footer{
  min-height: var(--h-footer); margin-top: 30px; padding: 20px 0;
  background: var(--green); color: var(--cream);
  display: grid; align-content: center;
}
.footer-inner{
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 18px 40px;
}
.footer-col{ flex: 1 1 170px; min-width: 150px; }
.footer-brand{ flex: 1 1 280px; min-width: 240px; }
.footer-logo{ font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #fff; }
.footer-tagline{ font-size: 12px; line-height: 1.5; color: #b9c6ae; margin-top: 4px; }
.footer-title{
  font-size: 11px; font-weight: 600; letter-spacing: .16em; line-height: 1.4;
  text-transform: uppercase; color: #9fb096; margin-bottom: 8px;
}
.footer-nav{
  display: grid; grid-template-columns: repeat(2, auto);
  justify-content: start; gap: 4px 18px;
  font-size: 12.5px;
}
.footer-nav a{ color: #dfe7d5; transition: color .15s ease; }
.footer-nav a:hover{ color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-nav a:focus-visible{ outline: 2px solid #f6f2e4; outline-offset: 3px; border-radius: 3px; }
.footer-meta{ font-size: 12px; line-height: 1.7; color: #b9c6ae; }
.footer-meta a{ color: #dfe7d5; }
.footer-meta a:hover{ color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- 响应式 */
@media (max-width: 1380px){
  .hero h1{ font-size: 36px; }
  .hero-lead{ width: 100%; }
}

@media (max-width: 1180px){
  :root{ --h-cat: auto; --h-feat: auto; --h-naan: auto; --h-duo: auto; --h-duos: auto; --h-scope: auto; }
  .nav{ margin-left: 24px; gap: 0; font-size: 13.5px; }
  .nav a{ padding: 7px 6px; }
  .featured, .naan, .duo, .duoS, .scope{ margin-top: 24px; }
  .site-footer{ margin-top: 24px; }
  .cat-grid{ grid-template-columns: repeat(4, 1fr); }
  .feat-grid{ grid-template-columns: repeat(3, 1fr); }
  .naan-inner{ grid-template-columns: 220px 1fr; }
  .naan-note{ grid-column: 1 / -1; grid-row: auto; border-left: 0; border-top: 1px solid rgba(17,20,15,.14); padding: 10px 0 0; }
  .duo-grid{ gap: 24px; }
  .path, .pantry{ grid-template-columns: 120px 1fr; gap: 0 16px; }
  .path-media, .pantry-media{ height: 100px; }
}

@media (max-width: 900px){
  .header-inner{ gap: 14px; }
  .nav{
    flex: 1 1 auto; min-width: 0;
    gap: 14px; margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .nav::-webkit-scrollbar{ display: none; }
  .nav a{ flex: none; }
  .hero{ height: auto; grid-template-columns: 1fr; }
  .hero-panel{ padding: 26px 24px 20px; }
  .hero h1{ font-size: 29px; height: auto; white-space: normal; margin-top: 14px; }
  .hero .eyebrow{ height: auto; }
  .hero-lead{ margin-top: 12px; line-height: 1.6; }
  .hero-actions{ margin-top: 16px; }
  .hero-stats{ margin-top: 20px; height: auto; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
  .hero-media{ position: relative; inset: auto; width: 100%; height: 250px; right: auto; }
  .hero-media figcaption{ position: static; padding: 10px 24px 0; color: var(--muted); text-shadow: none; }
  .cat-grid{ grid-template-columns: repeat(2, 1fr); }
  .feat-grid{ grid-template-columns: repeat(2, 1fr); }
  .naan-inner{ grid-template-columns: 1fr; padding: 16px; }
  .naan-media{ height: 200px; grid-row: auto; }
  .duo-grid{ grid-template-columns: 1fr; }
  .tech-grid{ grid-template-columns: 1fr; }
  .scope-grid{ grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .scope-list{ grid-template-columns: 1fr; }
  .scope-list li:last-child{ grid-column: auto; }
  .scope{ height: auto; }
  .site-footer{ min-height: 0; padding: 26px 0 20px; }
  .footer-inner{ flex-direction: column; gap: 18px; }
}

@media (max-width: 560px){
  .wrap{ width: min(var(--wrap), 100% - 32px); }
  .cat-grid{ grid-template-columns: 1fr 1fr; gap: 12px; }
  .cat-thumb{ height: 86px; }
  .feat-grid{ grid-template-columns: 1fr 1fr; gap: 12px; }
  .feat-thumb{ height: 92px; }
  .hero-actions{ flex-wrap: wrap; }
  .hero-stats{ grid-template-columns: 1fr 1fr; }
  .duoS{ margin-top: 24px; }
}

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