/* components.css — 三页共用的公共组件（导航已由 style.css 提供，这里放内页与通用件） */

/* ------------------------------------------------------------- 面包屑 */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.crumb a { color: var(--ink-muted); }
.crumb a:hover { color: var(--accent); }
.crumb span[aria-current="page"] { color: var(--ink-strong); font-weight: 700; }
.crumb .sep { color: #c0b49c; }

/* --------------------------------------------------------- 分类页页头 */
.page-hero {
  position: relative;
  padding: 26px 0 22px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--line-soft);
}

.page-hero::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 26px;
  bottom: 22px;
  width: 1px;
  background: rgba(90, 74, 40, 0.18);
}

.page-hero h1 {
  margin-top: 12px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink-strong);
}

.page-hero .page-lead {
  max-width: 780px;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.75;
  color: #4a4136;
}

/* --------------------------------------------------------- 筛选工具条 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px; color: var(--ink-muted); cursor: default; }

.chip {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: transparent;
  color: #4a4136;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover { border-color: var(--accent-soft); color: var(--accent); }

.chip[aria-pressed="true"] {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--bg);
  font-weight: 700;
}

.sort-group { margin-left: auto; }

.sort-select {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  appearance: none;
  color: #3a3228;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.count-note { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.count-note b { color: var(--ink-strong); font-weight: 800; }

/* ------------------------------------------------------------- 卡片网格 */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 24px;
  margin-top: 22px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  scroll-margin-top: 100px;
}

.recipe-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-warm);
}

.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.recipe-card:hover .recipe-thumb img { transform: scale(1.04); }

.recipe-tag {
  display: inline-block;
  margin-top: 11px;
  padding: 1px 7px;
  border-radius: 2px;
  background: var(--green-wash);
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.recipe-card h3 { margin-top: 7px; font-size: 16px; font-weight: 800; color: var(--ink-strong); line-height: 1.35; }
.recipe-card p { margin-top: 6px; font-size: 11.5px; line-height: 1.7; color: var(--ink-muted); }

.recipe-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 11px;
  color: #6a6152;
}

.recipe-specs .dot { color: #c0b49c; }
.recipe-specs .level-high { color: #a45a1c; font-weight: 700; }

/* -------------------------------------------------------------- 空状态 */
.empty-state {
  display: none;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

.empty-state.is-visible { display: block; }

.empty-state .btn { margin-top: 12px; }
.empty-state .btn-primary { background: var(--green-deep); color: var(--bg); }

/* --------------------------------------------------------- 长文说明区 */
.list-description {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.list-description-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 44px;
  align-items: start;
}

.list-description h2 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--ink-strong);
}

.list-description .ld-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.list-description p {
  font-size: 12.5px;
  line-height: 1.9;
  color: #463d31;
}

.list-description p + p { margin-top: 20px; }

/* ------------------------------------------------------ 其他分类入口 */
.related-taxonomy {
  margin: 34px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

.related-taxonomy h2 { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--ink-muted); }

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 12px;
}

.related-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-strong);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.related-links a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }
.related-links .kw-count { font-size: 10.5px; font-weight: 500; color: var(--ink-faint); }

/* --------------------------------------------------------- 详情页头部 */
.article-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding: 26px 0 0;
}

.article-head h1 {
  margin-top: 12px;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--ink-strong);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #4a4136;
}

.article-meta .meta-item { display: inline-flex; align-items: baseline; gap: 6px; }
.article-meta .meta-label { font-size: 10.5px; letter-spacing: 0.6px; color: var(--ink-faint); }
.article-meta .meta-value { font-weight: 800; color: var(--ink-strong); }

.article-disclaimer {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

/* -------------------------------------------------------------- 目录 */
.article-toc {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 14px 0 0;
  border-top: 2px solid var(--green-deep);
}

.toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0 8px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--ink-muted);
  cursor: pointer;
}

.toc-title:hover { color: var(--accent); }

.toc-list { display: flex; flex-direction: column; gap: 1px; }

.toc-list a {
  display: block;
  padding: 6px 8px 6px 10px;
  border-left: 2px solid transparent;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.toc-list a:hover { color: var(--accent); }

.toc-list a.is-active {
  border-left-color: var(--accent-soft);
  background: rgba(141, 151, 28, 0.08);
  color: var(--ink-strong);
  font-weight: 700;
}

/* -------------------------------------------------------------- 正文 */
.article-body { margin-top: 26px; }

.article-body h2 {
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 19px;
  line-height: 1.4;
  font-weight: 900;
  color: var(--ink-strong);
}

.article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.article-body p {
  font-size: 13.5px;
  line-height: 1.95;
  color: #3c342a;
}

.article-body p + p { margin-top: 12px; }

/* -------------------------------------------------------- 参数速览表 */
.spec-table-wrap {
  margin: 26px 0 0;
  padding: 18px 20px 20px;
  background: var(--bg-warm);
  border-radius: var(--radius);
}

.spec-table-title { font-size: 14px; font-weight: 800; color: var(--ink-strong); }
.spec-table-note { margin-top: 4px; font-size: 11.5px; color: #5f5443; }

.spec-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.spec-table th,
.spec-table td {
  padding: 7px 0;
  border-bottom: 1px solid rgba(90, 74, 40, 0.14);
  text-align: left;
  vertical-align: top;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }

.spec-table th {
  width: 108px;
  font-weight: 700;
  color: #5f5443;
  letter-spacing: 0.3px;
}

.spec-table td { color: var(--ink-strong); font-weight: 600; }

/* ---------------------------------------------------------- 相关条目 */
.related-entries {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.related-entries h2 { font-size: 17px; font-weight: 900; color: var(--ink-strong); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 16px;
}

.related-card { display: flex; flex-direction: column; min-width: 0; }

.related-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-warm);
}

.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.related-card:hover .related-thumb img { transform: scale(1.04); }

.related-card h3 { margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--ink-strong); }
.related-card p { margin-top: 5px; font-size: 11.5px; line-height: 1.68; color: var(--ink-muted); }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1080px) {
  .page-hero::after { display: none; }
  .article-wrap { grid-template-columns: 1fr; gap: 22px; }
  .article-toc { position: static; border-top-width: 1px; padding: 12px 14px; background: var(--bg-warm); border-radius: var(--radius); }
  .toc-title { cursor: pointer; padding-bottom: 0; }
  .toc-title .toc-hint { font-weight: 500; letter-spacing: 0; color: var(--ink-faint); font-size: 11px; }
  .toc-list { display: none; margin-top: 10px; }
  .article-toc.is-open .toc-list { display: flex; }
  .toc-list a { border-left: 0; padding: 7px 0; }
  .toc-list a.is-active { background: transparent; color: var(--accent); }
  .list-description-inner { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 18px; }
  .sort-group { margin-left: 0; }
}

@media (max-width: 640px) {
  .page-hero { padding: 20px 0 18px; }
  .page-hero h1 { font-size: 30px; }
  .page-hero .page-lead { font-size: 12.5px; }
  .article-head h1 { font-size: 30px; }
  .recipe-grid { grid-template-columns: 1fr; gap: 20px; }
  .toolbar { gap: 10px 12px; }
  .chip { height: 28px; padding: 0 11px; font-size: 11.5px; }
  .related-grid { grid-template-columns: 1fr; }
  .spec-table th { width: 84px; }
  .article-body h2 { font-size: 17.5px; }
}

/* ---------------------------------------------------- 详情页补充组件 */
.article-meta .dot { color: #c0b49c; }

.article-lead {
  margin: 0 0 6px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent-soft);
  background: rgba(141, 151, 28, 0.07);
  font-size: 12.5px !important;
  line-height: 1.8 !important;
  color: #4a4136 !important;
}

.article-figure {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.article-figure figcaption {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.recipe-section { padding-bottom: 4px; }

@media (max-width: 1080px) {
  .article-toc .toc-hint { display: inline; }
}

@media (min-width: 1081px) {
  .article-toc .toc-hint { display: none; }
}

@media (max-width: 640px) {
  .article-figure img { aspect-ratio: 4 / 3; }
}

.list-head { margin-top: 26px; align-items: baseline; }
.list-head h2 { font-size: 20px; padding-left: 0; }
.list-head h2::before { display: none; }

/* --------------------------------------------------------- 可访问性跳转 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 9px 16px;
  background: var(--green-deep);
  color: var(--bg);
  font-size: 12.5px;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ 页脚备案 */
.footer-icp {
  font-size: 11.5px;
  color: #97a389;
  white-space: nowrap;
}

/* -------------------------------------------------------------- 分页条 */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: #4a4136;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pager-num:hover { border-color: var(--accent-soft); color: var(--accent); }

.pager-num.is-current {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--bg);
  cursor: default;
}

.pager-gap {
  padding: 0 2px;
  color: var(--ink-faint);
  font-size: 12px;
}

.pager-prev, .pager-next { padding: 0 14px; font-weight: 600; }
.pager-next { margin-left: auto; }

/* -------------------------------------------------------- 正文内插图 */
.article-body figure { margin: 20px 0 4px; }

.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-warm);
}

/* -------------------------------------------------------- 卡片文字截断 */
.recipe-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.recipe-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
}

.article-toc .toc-list a,
.related-card h3,
.related-card p { word-break: break-word; }

@media (max-width: 640px) {
  .pager { gap: 6px; margin-top: 24px; }
  .pager-num { min-width: 30px; height: 30px; padding: 0 9px; font-size: 11.5px; }
  .pager-prev, .pager-next { flex-basis: 100%; margin-left: 0; justify-content: center; }
}

/* ------------------------------------------- 页脚四栏（品牌 / 方向 / 方向 / 关于） */
.site-footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 26px 34px;
  padding-top: 4px;
}

.footer-col { flex: 1 1 180px; min-width: 170px; }

.footer-brand.footer-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  flex: 1.4 1 250px;
}

.footer-line {
  flex-basis: 100%;
  font-size: 11.5px;
  line-height: 1.72;
  color: #a9b39c;
}

.footer-title {
  flex-basis: 100%;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #f2f4ea;
}

.footer-nav.footer-col {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px 16px;
  margin-top: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.footer-nav.footer-col .footer-title { margin-bottom: 1px; }

.footer-meta { font-size: 11.5px; line-height: 1.75; color: #b0bba3; }
.footer-meta .footer-title { margin-bottom: 7px; }
.footer-meta .footer-note { margin: 0 0 7px; font-size: 11.5px; }
.footer-meta .footer-icp { display: block; margin-bottom: 4px; }
.footer-meta .copyright { display: block; }

@media (max-width: 900px) {
  .site-footer .footer-inner { flex-direction: column; gap: 20px; }
  .footer-col { flex: 1 1 auto; min-width: 0; }
  .footer-brand.footer-col { flex: 1 1 auto; }
}
