/* ==========================================================================
   粤菜菜谱大全 · components.css
   内页（分类页 / 详情页）与首页共用的组件；首页专用版式保留在 style.css
   ========================================================================== */

/* ---------------------------------------------------------------- 面包屑 */
.crumb{
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 22px var(--gutter) 0;
  font-size: 11.5px; color: var(--muted-2);
}
/* 详情页里面包屑在文章列内部，由 .article-layout 统一留白 */
.article-main > .crumb{ padding: 0 0 18px; }
.crumb a{ color: var(--muted); border-bottom: 1px solid transparent; }
.crumb a:hover{ color: var(--red); border-bottom-color: rgba(151,36,29,.4); }
.crumb li{ display: inline-flex; align-items: center; gap: 8px; }
.crumb li + li::before{ content: "/"; color: var(--line); }

/* ------------------------------------------------------------- page-hero */
.page-hero{
  padding: 26px var(--gutter) 0;
  background: var(--bg);
}
.page-hero .eyebrow{ margin-bottom: 9px; }
.page-hero h1{
  font-size: 38px; line-height: 1.3; letter-spacing: .01em;
  color: var(--ink);
}
.page-hero .lead{
  margin-top: 12px; max-width: 44em;
  font-size: 13.5px; line-height: 1.85; color: var(--muted);
}
.page-metrics{
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px 34px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.page-metrics li{ display: flex; align-items: baseline; gap: 8px; }
.page-metrics b{ font-size: 12.5px; font-weight: 600; color: var(--red-deep); }
.page-note{ margin-top: 10px; font-size: 11.5px; line-height: 1.7; color: var(--muted-2); }

/* --------------------------------------------------------- filter toolbar */
.toolbar{
  margin: 26px var(--gutter) 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.toolbar-group{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-label{ font-size: 11px; letter-spacing: .12em; color: var(--muted-2); }
.chip{
  border: 1px solid var(--line); background: transparent;
  border-radius: var(--pill); padding: 5px 14px;
  font: 400 12px/1.4 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(--ink-invert);
}
.toolbar-right{ margin-left: auto; display: flex; align-items: center; gap: 12px; }
.select{
  appearance: none;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: transparent; color: var(--body);
  font: 400 12px/1.4 var(--font-sans);
  padding: 6px 30px 6px 14px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 13px, calc(100% - 11px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.result-count{ font-size: 11.5px; color: var(--muted-2); }

/* --------------------------------------------------------------- 列表网格 */
.list-section{ padding: 26px var(--gutter) 0; }
.card-grid{
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 30px 22px;
}
.card{ display: flex; min-width: 0; }
.card > a{ display: flex; flex-direction: column; min-width: 0; }
.card[data-hidden="true"]{ display: none; }
.card .thumb{
  width: 100%; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: var(--radius); background: var(--cream-2);
}
.card .thumb img{
  width: 100%; height: 100%; object-fit: cover;
  transition: filter .25s ease;
}
.card:hover .thumb img{ filter: brightness(1.07) saturate(1.04); }
.card h3{ margin-top: 12px; font-size: 17px; line-height: 1.35; }
.card p{ margin-top: 7px; font-size: 12px; line-height: 1.75; color: var(--muted); }
.card-meta{
  margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 10.5px; color: var(--muted-2);
}
.tag{
  display: inline-flex; align-items: center; height: 20px; padding: 0 9px;
  border-radius: var(--pill); background: var(--red-soft);
  color: var(--red-deep); font-size: 10.5px; letter-spacing: .02em;
}
.card-meta .dot{ width: 3px; height: 3px; border-radius: 50%; background: var(--line); }
.empty-state{
  display: none;
  padding: 56px 0; text-align: center;
  font-size: 13px; color: var(--muted-2);
}
.empty-state[data-active="true"]{ display: block; }

/* --------------------------------------------------------- 列表说明长文 */
.list-description{
  margin: 44px var(--gutter) 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 78ch;
}
.list-description h2{ font-size: 20px; line-height: 1.5; }
.list-description p{ margin-top: 12px; font-size: 13px; line-height: 1.95; color: var(--body); }

/* --------------------------------------------------------- 相关分类入口 */
.related{
  margin: 44px var(--gutter) 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.related h2{ font-size: 19px; }
.related-grid{
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 20px;
}
.related-item{
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 2px solid var(--red);
  display: block;
  transition: background .18s ease;
}
.related-item:hover{ background: var(--cream); }
.related-item h3{ font-size: 14px; }
.related-item p{ margin-top: 5px; font-size: 11px; line-height: 1.7; color: var(--muted); }

/* ------------------------------------------------------------- 文章排版 */
.article-main{ min-width: 0; }
/* 详情页里的区块已经在 .article-layout 的 gutter 内，不再二次缩进（否则宽屏会把内容压成一条） */
.article-main .related-dishes{ margin-inline: 0; }

.article-layout{
  padding: 24px var(--gutter) 0;
  display: grid;
  /* 正文列 720（15px 正文 ≈ 一行 48 字，中文舒适区），侧栏 280，整体居中；宽屏不会把正文行拉长 */
  grid-template-columns: minmax(0, 720px) minmax(240px, 280px);
  gap: 0 40px;
  align-items: start;
  justify-content: center;
}
.article-head .eyebrow{ margin-bottom: 10px; }
.article-head h1{
  font-size: 30px; line-height: 1.44; letter-spacing: .01em;
}
.article-head .lead{
  margin-top: 12px; max-width: 46em;
  font-size: 13.5px; line-height: 1.88; color: var(--muted);
}
.spec{
  margin-top: 20px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.spec dt{ font-size: 10.5px; letter-spacing: .12em; color: var(--muted-2); }
.spec dd{ margin: 4px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink); }

.article{ margin-top: 26px; }
.article > p{
  font-size: 15px; line-height: 2; color: var(--body);
}
.article h2{
  margin-top: 32px;
  scroll-margin-top: 100px;
  font-size: 21px; line-height: 1.5;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.article h2 + p{ margin-top: 14px; }
.article p{ font-size: 15px; line-height: 2; color: var(--body); }
.article p + p{ margin-top: 14px; }
.article a{ color: var(--red-deep); border-bottom: 1px solid rgba(151,36,29,.35); }
.article a:hover{ border-bottom-color: var(--red); }
.article-figure{ margin: 22px 0; }
.article-figure img{
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-lg); object-fit: cover;
}

.sidebar{
  position: sticky; top: calc(var(--header-h) + 24px);
  display: grid; gap: 22px;
}
.side-card{
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.side-card h2{
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--red-deep);
}
.toc{ margin-top: 10px; display: grid; gap: 2px; counter-reset: toc; }
.toc a{
  display: block; padding: 6px 0 6px 10px;
  font-size: 12px; line-height: 1.6; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.toc a:hover{ color: var(--red-deep); }
.toc a.active{ color: var(--red-deep); border-left-color: var(--red); }
.side-params{ margin-top: 10px; display: grid; gap: 10px; }
.side-params dt{ font-size: 10.5px; letter-spacing: .1em; color: var(--muted-2); }
.side-params dd{ margin: 2px 0 0; font-size: 12.5px; color: var(--ink); }
.toc-toggle{ display: none; cursor: pointer; }

/* -------------------------------------------------------- 同类做法三卡 */
.related-dishes{
  margin: 46px var(--gutter) 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.related-dishes h2{ font-size: 19px; }
.related-dishes-grid{
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px 22px;
}
.related-dish{ display: block; }
.related-dish .thumb{
  aspect-ratio: 2.4 / 1; overflow: hidden; border-radius: var(--radius); background: var(--cream-2);
}
.related-dish .thumb img{ width: 100%; height: 100%; object-fit: cover; }
.related-dish h3{ margin-top: 10px; font-size: 15px; }
.related-dish p{ margin-top: 5px; font-size: 11.5px; line-height: 1.72; color: var(--muted); }

/* --------------------------------------------------------------- 分页条 */
.pager{
  margin: 40px var(--gutter) 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
.pager a, .pager span{
  min-width: 34px; height: 34px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--pill);
  font-size: 12px; color: var(--body);
}
.pager .current{ background: var(--red); border-color: var(--red); color: var(--ink-invert); }
.pager .disabled{ color: var(--muted-2); opacity: .55; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px){
  .card-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .article-layout{ grid-template-columns: minmax(0,1fr) minmax(0,300px); }
  .related-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
}

@media (max-width: 960px){
  .page-hero h1{ font-size: 30px; }
  .article-layout{ grid-template-columns: minmax(0,1fr); }
  .article-head h1{ font-size: 27px; }
  .sidebar{ position: static; }
  .side-params{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .toc-toggle{
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 6px 14px;
    border: 1px solid var(--line); border-radius: var(--pill);
    background: transparent; font: 400 12px/1.4 var(--font-sans); color: var(--body);
    cursor: pointer;
  }
  .toc{ display: none; }
  .toc.open{ display: grid; }
  .card-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .related-dishes-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .spec{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
}

@media (max-width: 620px){
  .page-hero h1{ font-size: 25px; }
  .page-hero{ padding-top: 24px; }
  .article-head h1{ font-size: 22px; }
  .card-grid{ grid-template-columns: minmax(0,1fr); gap: 26px; }
  .related-grid{ grid-template-columns: minmax(0,1fr); }
  .related-dishes-grid{ grid-template-columns: minmax(0,1fr); }
  .toolbar{ gap: 10px; }
  .toolbar-right{ margin-left: 0; width: 100%; justify-content: space-between; }
  .article p, .article > p{ font-size: 14px; line-height: 1.95; }
}
