/* components.css — 家用咖啡内页组件（分类页 / 详情页）
   颜色、字号、圆角一律使用 tokens.css 的变量；布局沿用 style.css 的 .wrap / .site-header / .site-footer。
   这里只放内页新增区块：面包屑、列表头、筛选工具条、列表网格、分页、列表说明、正文排版、目录、相关条目。 */

/* ------------------------------------------------------------ 面包屑 */
.crumb {
  padding: 18px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumb li { display: inline-flex; align-items: center; gap: 6px; }
.crumb li + li::before {
  content: "›";
  color: var(--muted-alt);
  margin-right: 2px;
}
.crumb a { color: var(--ink-2); border-bottom: 1px solid transparent; }
.crumb a:hover { border-bottom-color: var(--line); }
.crumb [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------------- 列表页头 */
.page-hero {
  padding: 22px 0 30px;
  border-bottom: 1px solid var(--line-soft);
}
.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.page-hero .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.page-hero h1 {
  margin-top: 8px;
  font-size: var(--fs-8);
  color: var(--ink);
}
.page-hero .lead {
  margin-top: 14px;
  font-size: var(--fs-3);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 640px;
}
.page-hero-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--sand);
}
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------- 筛选工具条 */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.filter-toolbar .toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent-2); color: var(--accent); }
.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cream);
}
.filter-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filter-sort label { font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.filter-sort select {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}

/* ---------------------------------------------------------- 列表网格 */
.grid-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 0 16px;
}
.grid-count { font-size: 13px; font-weight: 700; color: var(--ink); }
.grid-hint { font-size: 12px; color: var(--muted); }

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 10px;
}
.list-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.list-card[hidden] { display: none; }
.list-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); background: var(--surface-alt); }
.list-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sand);
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.list-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(108, 60, 20, 0.08);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}
.list-card h2 { margin-top: 9px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.list-card h2 a:hover { color: var(--accent); }
.list-summary { margin-top: 7px; font-size: 12px; line-height: 1.75; color: var(--muted); }
.list-more {
  margin-top: auto;
  padding-top: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.list-more::after { content: " →"; }
.empty-state {
  display: none;
  padding: 34px 0 40px;
  font-size: 13px;
  color: var(--muted);
}
.empty-state.is-visible { display: block; }

/* ------------------------------------------------------------- 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.pager .page-current {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--cream);
  font-weight: 700;
}

/* --------------------------------------------------------- 列表说明 */
.list-seo {
  margin: 26px 0 0;
  padding: 28px 30px;
  background: var(--bg-warm);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.list-seo h2 { font-size: var(--fs-5); color: var(--ink); }
.list-seo-cols {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 44px;
}
.list-seo-cols p {
  font-size: var(--fs-3);
  line-height: 1.95;
  color: var(--ink-2);
}

.related-cats {
  padding: 30px 0 40px;
}
.related-cats h2 { font-size: var(--fs-5); color: var(--ink); }
.related-cats ul {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.related-cats a {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.related-cats a:hover { background: var(--surface-alt); box-shadow: var(--shadow-card); }
.related-cats strong { display: block; font-size: 15px; color: var(--ink); }
.related-cats span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------- 详情页头 */
.article-head {
  padding: 22px 0 8px;
  max-width: 900px;
}
.article-head .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}
.article-head h1 {
  margin-top: 10px;
  font-size: 40px;
  line-height: 1.3;
  color: var(--ink);
}
.article-head .lead {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-2);
}

/* ------------------------------------------------------- 详情两栏 */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px) 268px;
  justify-content: space-between;
  gap: 48px;
  align-items: start;
  padding: 26px 0 44px;
}

/* ------------------------------------------------------------- 目录 */
.toc {
  position: sticky;
  top: 86px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  order: 2;
}
.toc-title { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.toc-toggle {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.toc.is-collapsed ol { display: none; }
.toc ol { margin-top: 10px; display: grid; gap: 8px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: 22px;
  position: relative;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--muted-alt);
  font-size: 11px;
}
.toc a:hover { color: var(--accent); }
.toc a.is-active { color: var(--accent); font-weight: 700; }
.toc a.is-active::before { color: var(--accent); }

/* --------------------------------------------------------- 正文排版 */
.article { order: 1; }
.article h2 {
  font-size: 24px;
  margin-top: 34px;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.article h2:first-child { margin-top: 0; }
.article p {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink-2);
}
.article a { color: var(--accent); border-bottom: 1px solid rgba(108, 60, 20, 0.3); }
.article a:hover { border-bottom-color: var(--accent); }
.article-note {
  margin-top: 26px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* --------------------------------------------------------- 相关条目 */
.related {
  padding: 26px 0 40px;
  border-top: 1px solid var(--line-soft);
}
.related h2 { font-size: var(--fs-5); color: var(--ink); }
.related-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.related-list a {
  display: block;
  padding: 15px 17px;
  background: var(--surface);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.related-list a:hover { background: var(--surface-alt); color: var(--accent); }

/* 内页页脚：没有「收录说明」模块，品牌与分类导航左右并排 */
.closing-grid--simple {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  grid-template-areas: "brand nav";
  padding-top: 34px;
  padding-bottom: 34px;
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 232px; gap: 32px; }
}
@media (max-width: 980px) {
  .page-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .page-hero-media { aspect-ratio: 16 / 7; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; gap: 20px; padding-bottom: 30px; }
  .toc { position: static; order: 0; }
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
  }
  .toc-toggle::after { content: "＋"; font-weight: 400; }
  .toc-toggle[aria-expanded="true"]::after { content: "－"; }
  .toc.is-open ol { display: grid; }
  .related-list { grid-template-columns: 1fr; }
  .list-seo-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .closing-grid--simple { grid-template-columns: 1fr; grid-template-areas: "brand" "nav"; }
  .page-hero h1, .article-head h1 { font-size: var(--fs-6); }
  .page-hero-media { aspect-ratio: 16 / 9; }
  .list-grid { grid-template-columns: 1fr; }
  .related-cats ul { grid-template-columns: 1fr; }
  .filter-toolbar { gap: 10px; }
  .filter-sort { margin-left: 0; }
  .list-seo { padding: 22px 18px; }
  .article h2 { font-size: 20px; }
  .article p { font-size: 15.5px; line-height: 1.9; }
}
