/* components.css — 内页专用组件（环节 6 落盘）
   颜色/字号/圆角一律 var(--…)，不写字面量。
   直接复用 style.css 的：.wrap .site-header .nav .nav-toggle .brand .search .btn
   .sec-head .sec-note .cat .dish-grid .dish .faq-list .site-footer .footer-*
   本文件只放内页新增区块：
     .crumb      面包屑
     .page-hero  列表页标题区
     .toolbar    筛选 + 排序条
     .list-grid .list-card   菜谱网格
     .related-cats           接下来看
     .list-seo               列表说明长文
     .article-layout         详情页两栏
     .article-head           菜谱头 + 参数条
     .toc        详情页目录
     .article-body           正文排版
     .related-dishes         同类做法
*/

/* ---------------------------------------------------------------- 面包屑 */
.crumb{
  padding: 18px 0 0;
  font-size: var(--fs-3);
  color: var(--muted-2);
}
.crumb ol{ display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; padding: 0; list-style: none; }
.crumb li{ display: flex; align-items: center; gap: 7px; }
.crumb li + li::before{
  content: ""; width: 4px; height: 4px;
  border-right: 1px solid var(--muted-2); border-bottom: 1px solid var(--muted-2);
  transform: rotate(-45deg);
}
.crumb a{ color: var(--muted); }
.crumb a:hover{ color: var(--red); }
.crumb [aria-current="page"]{ color: var(--ink); }

/* ------------------------------------------------------------ 列表页标题区 */
.page-hero{
  padding: 20px 0 20px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow{ margin-bottom: 8px; }
.page-hero h1{
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.28;
  color: var(--red-deep);
  letter-spacing: -.01em;
}
.page-lead{
  margin-top: 10px;
  max-width: 46em;
  font-size: var(--fs-8); line-height: 1.85; color: var(--body);
}
.page-stats{
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 6px 26px;
  font-size: var(--fs-5); color: var(--muted);
}
.page-stats span{ display: inline-flex; align-items: center; gap: 6px; }
.page-stats b{ font: 600 var(--fs-9)/1 var(--font-serif); color: var(--red-deep); }

/* ---------------------------------------------------------------- 筛选排序 */
.toolbar{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 18px;
  margin-top: 18px; padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.filter-set{ display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-set > .label{ font-size: var(--fs-3); color: var(--muted-2); margin-right: 2px; }
.chip{
  height: 28px; padding: 0 12px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--ink-invert);
  font: var(--fs-6)/1 var(--font-sans); color: var(--body);
  cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.chip:hover{ border-color: var(--red); color: var(--red-deep); }
.chip[aria-pressed="true"]{ background: var(--red); border-color: var(--red); color: var(--cream-on-red); }

.sort-set{ display: flex; align-items: center; gap: 7px; }
.sort-set .label{ font-size: var(--fs-3); color: var(--muted-2); cursor: pointer; }
.sort-set select{
  height: 28px; padding: 0 28px 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--ink-invert); color: var(--body);
  font: var(--fs-6)/1 var(--font-sans); cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--muted-2) 50%),
    linear-gradient(-45deg, transparent 49%, var(--muted-2) 50%);
  background-size: 5px 5px, 5px 5px;
  background-position: right 12px center, right 8px center;
  background-repeat: no-repeat;
}
.result-count{ margin: 10px 0 0; font-size: var(--fs-3); color: var(--muted-2); }
.result-count b{ color: var(--red-deep); }

/* -------------------------------------------------------------- 菜谱网格 */
.list-grid{
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px 14px;
}
.list-card{
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.list-card:hover{ box-shadow: var(--shadow); transform: translateY(-2px); }
.list-card img{
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  background: var(--cream-2);
}
.list-card .body{ padding: 11px 13px 13px; display: flex; flex-direction: column; flex: 1; }
.list-card h2{ font-size: var(--fs-9); line-height: 1.35; }
.list-card p{ margin-top: 5px; font-size: var(--fs-3); line-height: 1.7; color: var(--muted); flex: 1; }
.meta-row{
  margin-top: 9px; padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  font-size: var(--fs-1); color: var(--muted-2);
}
.meta-row span{ display: inline-flex; align-items: center; gap: 4px; }
.meta-row span + span::before{ content: "·"; margin-right: 4px; color: var(--line); }
.tag{
  display: inline-block;
  padding: 2px 8px; border-radius: var(--pill);
  background: var(--red-soft); color: var(--red-deep);
  font-size: var(--fs-1); line-height: 1.6;
}
[data-hidden="true"]{ display: none; }

/* ------------------------------------------------------------ 接下来看 */
.related-cats{ margin-top: 28px; }
.related-cats h2{ font-size: var(--fs-10); }
.related-cat-grid{
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
}
.related-cat{
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: border-color .18s ease, background .18s ease;
}
.related-cat:hover{ border-color: var(--red); background: var(--ink-invert); }
.related-cat b{ font: 600 var(--fs-9)/1.3 var(--font-serif); color: var(--ink); }
.related-cat span{ font-size: var(--fs-3); line-height: 1.6; color: var(--muted); }

/* ------------------------------------------------------------ 列表说明长文 */
.list-seo{
  margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.list-seo h2{ font-size: var(--fs-10); }
.list-seo p{
  margin-top: 10px;
  max-width: 62em;
  font-size: var(--fs-9); line-height: 2; color: var(--body);
}

/* ------------------------------------------------------------- 分页（备用） */
.pager{ margin-top: 22px; display: flex; justify-content: center; gap: 6px; }
.pager a, .pager span{
  min-width: 32px; height: 32px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: var(--fs-6); color: var(--body); background: var(--ink-invert);
}
.pager [aria-current="page"]{ background: var(--red); border-color: var(--red); color: var(--cream-on-red); }

/* ============================================================== 详情页 */
.article-layout{
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 246px;
  gap: 38px;
  align-items: start;
}

.article-head .eyebrow{ margin-bottom: 9px; }
.article-head h1{
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1.32;
  color: var(--red-deep);
  letter-spacing: -.01em;
}
.article-lead{
  margin-top: 11px;
  font-size: var(--fs-9); line-height: 1.9; color: var(--body);
  max-width: 40em;
}
.article-figure{ margin: 16px 0 0; }
.article-figure img{
  width: 100%; aspect-ratio: 2.7 / 1; object-fit: cover;
  border-radius: var(--radius); background: var(--cream-2);
}
.article-figure figcaption{
  margin-top: 6px; font-size: var(--fs-1); line-height: 1.6; color: var(--muted-2);
}
.keyfact{
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.keyfact > div{ background: var(--surface); padding: 10px 13px; }
.keyfact dt{ font-size: var(--fs-1); letter-spacing: .1em; color: var(--muted-2); }
.keyfact dd{ margin: 3px 0 0; font: 600 var(--fs-8)/1.4 var(--font-sans); color: var(--ink); }

/* 侧栏：目录 */
.article-aside{
  position: sticky; top: calc(var(--header-h) + 16px);
  display: flex; flex-direction: column; gap: 14px;
}
.toc{
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.toc h2{ font-size: var(--fs-6); letter-spacing: .04em; }
.toc ol{ margin-top: 8px; display: grid; gap: 1px; list-style: none; counter-reset: toc; }
.toc a{
  display: block; padding: 6px 0 6px 20px; position: relative;
  font-size: var(--fs-5); line-height: 1.5; color: var(--muted);
  border-left: 1px solid var(--line);
  transition: color .18s ease, border-color .18s ease;
}
.toc a::before{
  counter-increment: toc; content: counter(toc, decimal-leading-zero);
  position: absolute; left: 8px; font-size: var(--fs-1); color: var(--muted-2);
}
.toc a:hover{ color: var(--red-deep); border-left-color: var(--red); }
.toc a.is-current{ color: var(--red-deep); border-left-color: var(--red); font-weight: 600; }
.toc-toggle{ display: none; }

/* 正文 */
.article-body{ max-width: 46em; }
.article-body h2{
  margin-top: 30px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-11); line-height: 1.5;
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.article-body h2:first-of-type{ margin-top: 22px; }
.article-body p{
  margin-top: 11px;
  font-size: var(--fs-9); line-height: 2.05; color: var(--body);
}
.article-body a{
  color: var(--red-deep);
  border-bottom: 1px solid var(--red-soft);
}
.article-body a:hover{ border-bottom-color: var(--red); }

/* 同类做法 */
.related-dishes{ margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.related-dishes h2{ font-size: var(--fs-10); }
.related-grid{
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px;
}
.related-card{
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.related-card:hover{ border-color: var(--red); box-shadow: var(--shadow); }
.related-card img{ width: 100%; aspect-ratio: 2.6 / 1; object-fit: cover; background: var(--cream-2); }
.related-card .body{ padding: 9px 12px 11px; }
.related-card b{ font: 600 var(--fs-9)/1.35 var(--font-serif); color: var(--ink); }
.related-card span{ display: block; margin-top: 3px; font-size: var(--fs-3); line-height: 1.7; color: var(--muted); }

/* ----------------------------------------------------------- 响应式 */
@media (max-width: 1180px){
  .list-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .article-layout{ grid-template-columns: minmax(0,1fr) 224px; gap: 28px; }
  .related-cat-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1000px){
  .article-layout{ grid-template-columns: minmax(0,1fr); }
  .article-aside{ position: static; order: -1; }
  .toc{ display: none; }
  .toc[data-open="true"]{ display: block; }
  .toc-toggle{
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 38px; padding: 0 14px; margin-top: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    font: 600 var(--fs-6)/1 var(--font-sans); color: var(--ink); cursor: pointer;
  }
  .toc-toggle::after{ content: "+"; color: var(--red); font-size: var(--fs-9); }
  .toc-toggle[aria-expanded="true"]::after{ content: "−"; }
  .list-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .related-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .keyfact{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px){
  .crumb{ padding-top: 14px; }
  .page-hero h1{ font-size: 25px; }
  .page-lead{ font-size: var(--fs-7); }
  .toolbar{ padding: 9px 11px; }
  .chip{ height: 26px; padding: 0 10px; font-size: var(--fs-5); }
  .list-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 10px; }
  .list-card h2{ font-size: var(--fs-7); }
  .list-card p{ font-size: var(--fs-1); }
  .related-cat-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .article-head h1{ font-size: 24px; }
  .article-body p{ font-size: var(--fs-7); line-height: 1.98; }
  .related-grid{ grid-template-columns: minmax(0,1fr); }
}

/* 指针反馈 */
.toc-toggle{ cursor: pointer; }
.list-card > a,
.list-card article > a{ display: block; }
.list-card > a:focus-visible,
.list-card article > a:focus-visible{ outline: 2px solid var(--red); outline-offset: -2px; }
