/* style.css — 徽菜菜谱大全 · 骨架与版式
   一切尺寸来自 03-ui/home-ui-desktop.png 的量稿预算（见 03-ui/compare-log.md）。
   设计宽 1440，内容栏 1440（左右各 40），变量全部来自 tokens.css。 */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* 稿上的菜品照偏暗暖、低饱和（量稿：照片区均值 rgb(139,129,115)），
   生成的素材更鲜艳，统一降饱和 + 提亮一档把气质对齐，不改素材本身。 */
.hero-media img,
.thumb img,
.notes-photo { filter: saturate(.62) brightness(1.1) contrast(.97); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

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

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

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

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

/* ---------------------------------------------------------------- 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--container);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand { display: flex; align-items: baseline; gap: 8px; flex: none; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}
.brand-sub {
  font-size: var(--fs-micro);
  letter-spacing: .18em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 22px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  white-space: nowrap;
}
.nav a { padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--green); border-bottom-color: var(--line-strong); }
.nav a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 49.26% 50.74%;
  align-items: stretch;
  height: 418px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.hero > * { min-height: 418px; max-height: 418px; }
.hero-media, .hero-media img { height: 418px; }

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 30px 28px 12px max(var(--gutter), calc((100vw - var(--container)) / 2));
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-micro);
  letter-spacing: .22em;
  color: var(--ink-4);
}
.eyebrow .rule { display: block; width: 34px; height: 1px; background: var(--line-strong); }

.hero h1 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: 1.26;
  letter-spacing: .01em;
  color: var(--ink);
  max-width: 660px;
}

.hero-lead {
  margin-top: 18px;
  max-width: 545px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: auto;
  width: min(100%, 640px);
  background: var(--green);
  border-radius: var(--r-sm);
}
.cta-link {
  flex: 1 1 0;
  padding: 10px 20px;
  text-align: center;
  color: var(--ink-invert);
  font-size: var(--fs-sm);
  letter-spacing: .03em;
}
.cta-link:hover { background: var(--green-hover); }
.cta-link:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.cta-link:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.cta-sep { width: 1px; height: 18px; background: var(--line-invert); }

.hero-stats {
  display: flex;
  align-items: center;
  width: min(100%, 640px);
  margin-top: 2px;
  padding: 3px 0;
  background: var(--bg-warm);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--ink-3);
}
.hero-stats li { flex: 1 1 0; padding: 0 14px; border-right: 1px solid var(--line); line-height: 1.4; }
.hero-stats li:last-child { border-right: 0; }

.hero-media { position: relative; margin: 0; overflow: hidden; }
.hero-media img {
  width: 100%;
  height: 418px;
  object-fit: cover;
  border-radius: var(--r-img) 0 0 var(--r-img);
}

/* ---------------------------------------------------------------- 分区 */
.section { padding: 20px 0 14px; }

/* 分区起止严格按 03-ui/compare-log.md 的分区预算落位：
   M2 520–830 / M3 844–1125 / M4 1150–1413 / M5-6 1448–1645 / M7-8 1671–1969 / 页脚 1976–2160 */
#flavor { margin-top: 14px; }
#featured { margin-top: 26px; }
#path { margin-top: 33px; }
#faq { margin-top: 26px; }
#categories { padding-bottom: 9px; }
#flavor { padding-bottom: 0; }
#featured { padding-bottom: 0; }

.section-head { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 12px; text-align: center; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--ink);
}
.section-title .en { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 12px; letter-spacing: .2em; color: var(--accent); font-weight: 500; }
.section-title .sep { color: var(--ink-4); font-weight: 400; }
.section-title.small { font-size: 19px; }

.section-lead { font-size: 13px; line-height: 1.5; color: var(--ink-3); }

.section-note {
  margin-top: 6px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-4);
}

/* ------------------------------------------------------------ 分类索引 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.cat-card { border-right: 1px solid var(--line); }
.cat-card:last-child { border-right: 0; }
.cat-card a { display: block; padding: 8px 9px 10px; height: 100%; }
.cat-card a:hover { background: var(--bg-soft); }
.cat-card .thumb { display: block; aspect-ratio: 2.05; overflow: hidden; border-radius: var(--r-img); }
.cat-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .num {
  display: block;
  margin: 6px 0 2px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-micro);
  letter-spacing: .16em;
  color: var(--accent);
}
.cat-card h3 { font-family: var(--font-serif); font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.cat-card p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------ 徽味来源 */
.flavor-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.flavor-item { padding: 9px 9px 7px; border-right: 1px solid var(--line); }
.flavor-item:last-child { border-right: 0; }
.flavor-item .thumb { display: block; aspect-ratio: 2.15; overflow: hidden; border-radius: var(--r-img); }
.flavor-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.flavor-item .num { display: block; margin: 6px 0 1px; font-size: var(--fs-micro); letter-spacing: .16em; color: var(--accent); }
.flavor-item h3 { font-family: var(--font-serif); font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.flavor-item p {
  margin-top: 4px;
  font-size: 10.8px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------------- 六道精讲 */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.dish-card a { display: block; }
.dish-card .thumb { display: block; aspect-ratio: 2.35; overflow: hidden; border-radius: var(--r-img); }
.dish-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.dish-card a:hover .thumb img { transform: scale(1.03); }
.dish-card h3 { margin-top: 6px; font-family: var(--font-serif); font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.dish-card p {
  margin-top: 3px;
  font-size: 10.8px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------- 上手顺序 / 技法 */
.band-split { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 0 4px; }
.split-wrap { display: grid; grid-template-columns: 54% 46%; gap: 0; }
.split-col { padding: 0; }
.split-left { padding-right: 30px; }
.split-right { padding-left: 30px; border-left: 1px solid var(--line); }
.split-col .section-title { margin-bottom: 4px; }
.split-col .section-lead { margin-bottom: 10px; }

.path-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.path-list li { padding-top: 4px; }
.path-step { display: block; font-size: var(--fs-micro); letter-spacing: .14em; color: var(--accent); }
.path-list h3 { margin-top: 6px; font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.path-list p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.path-warn {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
}

.tech-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tech-ico { width: 19px; height: 19px; color: var(--green); }
.tech-grid h3 { margin-top: 8px; font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--ink); }
.tech-grid p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tech-note { margin-top: 6px; font-size: 11px; line-height: 1.4; color: var(--ink-4); }

/* ------------------------------------------------------- FAQ / 收录说明 */
.faq-wrap { display: grid; grid-template-columns: 62% 38%; gap: 0; }
#faq { padding: 6px 0 0; margin-bottom: 0; }
.faq-col { padding-right: 40px; }
.notes-col { padding-left: 40px; border-left: 1px solid var(--line); position: relative; }
.faq-col .section-title, .notes-col .section-title { margin-bottom: 8px; }

.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.faq-list details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-list p { padding: 0 24px 6px 0; font-size: 11px; line-height: 1.5; color: var(--ink-3); }

.notes-list { counter-reset: notes; }
.notes-list li { position: relative; padding-left: 0; margin-bottom: 4px; }
.notes-list h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.notes-list h3::before {
  counter-increment: notes;
  content: "0" counter(notes);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-micro);
  letter-spacing: .12em;
  color: var(--accent);
}
.notes-list p {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notes-photo {
  width: 100%;
  max-width: 214px;
  margin: 0 0 0 auto;
  aspect-ratio: 2.42;
  object-fit: cover;
  border-radius: var(--r-img);
}

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: 6px;
  background: var(--green-deep);
  color: var(--ink-invert);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px 40px;
  padding-top: 28px;
  padding-bottom: 25px;
}
.footer-col { flex: 1 1 180px; min-width: 170px; }
.footer-brand { flex: 1 1 260px; min-width: 220px; }
.footer-logo { font-family: var(--font-serif); font-size: 23px; font-weight: 600; letter-spacing: .04em; line-height: 1.3; }
.footer-desc { margin-top: 6px; max-width: 560px; font-size: 12.5px; line-height: 1.7; color: var(--ink-invert-soft); }
.footer-title { margin-bottom: 8px; font-size: var(--fs-micro); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-invert-mute); }
.footer-nav { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-invert-nav); }
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-meta { font-size: 12.5px; line-height: 1.75; color: var(--ink-invert-soft); }
.footer-meta a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-copy {
  flex: 1 1 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-invert-soft);
  font-size: var(--fs-micro);
  color: var(--ink-invert-mute);
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .nav { gap: 14px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-card:nth-child(4n) { border-right: 0; }
  .cat-card { border-bottom: 1px solid var(--line); }
  .flavor-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flavor-item:nth-child(4n) { border-right: 0; }
  .flavor-item { border-bottom: 1px solid var(--line); }
  .dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-wrap { grid-template-columns: 1fr; }
  .split-left { padding-right: 0; padding-bottom: 22px; }
  .split-right { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .faq-wrap { grid-template-columns: 1fr; }
  .faq-col { padding-right: 0; }
  .notes-col { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
  .notes-photo { margin-left: 0; }
}

@media (max-width: 900px) {
  .header-inner { gap: 14px; }
  .nav {
    flex: 1 1 auto;
    min-width: 0;
    gap: 14px;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 26px 20px 20px; order: 1; }
  .hero-media { order: 2; }
  .hero-media img { min-height: 0; aspect-ratio: 16 / 10; border-radius: 0; }
  .hero h1 { font-size: 34px; }
  .hero-lead { font-size: 15px; }
  .hero-cta { flex-direction: column; background: none; gap: 8px; }
  .cta-link { width: 100%; background: var(--green); border-radius: var(--r-sm) !important; }
  .cta-sep { display: none; }
  .hero-stats { flex-wrap: wrap; gap: 6px 0; }
  .hero-stats li { flex: 1 1 45%; border-right: 0; padding: 2px 12px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-card:nth-child(2n) { border-right: 0; }
  .flavor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flavor-item:nth-child(2n) { border-right: 0; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-list { grid-template-columns: 1fr; gap: 14px; }
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 560px) {
  .section { padding: 22px 0 18px; }
  .section-title { font-size: 22px; }
  .dish-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}

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