/* components.css — 跨页复用组件：页头 / 页脚 / 标题 / 按钮 / 卡片骨架 */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--dark);
  color: var(--ink-invert);
  font-size: 14px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ── 页头 ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--dark);
  color: var(--ink-invert);
  border-bottom: 1px solid var(--line-invert);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-invert);
  text-decoration: none;
  flex: none;
}
.brand-mark { width: 30px; height: 30px; color: var(--accent-soft); }
.brand-name {
  font-family: var(--font-serif);
  font-size: 23px;
  letter-spacing: .14em;
  font-weight: 600;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 26px;
  flex: 1;
}
.site-nav a {
  position: relative;
  padding: 6px 12px;
  color: var(--ink-invert-2);
  font-size: 14px;
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: color .18s ease;
}
.site-nav a + a { border-left: 1px solid var(--line-invert); }
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--ink-invert); }
.site-nav a[aria-current="page"] { color: var(--ink-invert); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 15px; right: 15px; bottom: -2px;
  height: 1px;
  background: var(--accent-soft);
}
.header-tools { display: flex; align-items: center; gap: 12px; flex: none; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  color: var(--ink-invert-2);
  border: 1px solid var(--line-invert);
  border-radius: var(--radius-sm);
  transition: color .18s ease, border-color .18s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--ink-invert); border-color: var(--accent-soft); }
.nav-toggle {
  display: none;
  width: 38px; height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--line-invert);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 1.4px;
  margin: 3.4px auto;
  background: var(--ink-invert);
  transition: transform .2s ease, opacity .2s ease;
}

/* ── 区块标题（两侧花纹线） ────────────────────────── */
.section-title {
  position: relative;
  margin: 0 0 26px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--ink);
}
.section-title span {
  position: relative;
  display: inline-block;
  padding: 0 34px;
}
.section-title span::before,
.section-title span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-soft));
}
.section-title span::before { left: -34px; }
.section-title span::after { right: -34px; transform: scaleX(-1); }
.section-title span > .ornament,
.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 7px; height: 7px;
  border: 1px solid var(--accent-soft);
  transform: translateX(-50%) rotate(45deg);
}

/* ── 按钮 ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 26px;
  font-size: 15px;
  letter-spacing: .08em;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-ghost {
  color: var(--ink-invert);
  border: 1px solid var(--accent-soft);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--accent-soft);
  color: var(--dark);
}
.btn-solid {
  background: var(--accent);
  color: #fff6e8;
  border: 1px solid var(--accent);
}
.btn-solid:hover, .btn-solid:focus-visible { background: var(--accent-2); border-color: var(--accent-2); }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-invert-2);
  font-size: 15px;
  letter-spacing: .08em;
  text-decoration: none;
  border-bottom: 1px solid var(--line-invert);
  padding-bottom: 3px;
  transition: color .18s ease, border-color .18s ease;
}
.link-arrow:hover, .link-arrow:focus-visible { color: var(--ink-invert); border-color: var(--accent-soft); }

/* ── 页脚 ─────────────────────────────────────────── */
.site-footer {
  min-height: 0;
  background: var(--dark);
  color: var(--ink-invert-2);
  display: block;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.6;
}
.footer-brand .brand-mark { width: 26px; height: 26px; color: var(--accent-soft); }
.footer-name {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: .14em;
  color: var(--ink-invert);
  padding-right: 14px;
  border-right: 1px solid var(--line-invert);
}
.footer-tagline { color: var(--ink-invert-2); }
.footer-note { color: rgba(216, 195, 166, .72); }
.footer-col { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.footer-col h2 { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--ink-invert-2); }
.footer-col a { font-size: 12px; color: rgba(216, 195, 166, .8); text-decoration: none; }
.footer-col a:hover { color: var(--ink-invert); }
.footer-icp { font-size: 11px; color: rgba(216, 195, 166, .65); }
.footer-brand .footer-name { border-right: 0; padding-right: 0; display: block; }
.footer-copy { margin: 0; padding: 12px 0 16px; border-top: 1px solid var(--line-invert); font-size: 11px; color: rgba(216, 195, 166, .65); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 12px;
}
.footer-nav a {
  color: rgba(216, 195, 166, .8);
  text-decoration: none;
  letter-spacing: .05em;
}
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--ink-invert); }

/* ── 内页：面包屑 / 页头 / 工具条 / 卡片 / 正文 / 表格 ───────── */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover, .crumb a:focus-visible { color: var(--accent-2); text-decoration: underline; }
.crumb span[aria-current] { color: var(--ink-2); }
.crumb .sep { color: var(--accent-soft); }

.page-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 26px 0 30px;
}
.page-hero .crumb { margin-bottom: 16px; }
.page-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-3xl);
  line-height: 1.3;
  letter-spacing: .1em;
  color: var(--ink);
}
.page-hero .page-lead {
  margin: 12px 0 0;
  max-width: 840px;
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--ink-3);
}
.page-hero .page-meta {
  margin: 14px 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  letter-spacing: .06em;
}
.page-hero .page-meta strong { color: var(--accent-2); font-weight: 600; }

/* 工具条 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.filter-label {
  margin-right: 4px;
  font-size: var(--fs-sm);
  letter-spacing: .08em;
  color: var(--ink-3);
}
.chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { border-color: var(--accent-soft); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff6e8;
}
.chip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.sort-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-group .filter-label { cursor: pointer; }
.sort-group select {
  height: 30px;
  padding: 0 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.sort-group select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.result-count {
  margin: 18px 0 14px;
  font-size: var(--fs-sm);
  letter-spacing: .06em;
  color: var(--ink-3);
}

/* 条目卡 */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
}
.entry-card {
  display: block;
  background: var(--paper-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease;
}
.entry-card[hidden] { display: none; }
.entry-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: var(--ink);
}
.entry-media { position: relative; }
.entry-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(.92);
}
.entry-tag {
  position: absolute;
  left: 10px; top: 10px;
  padding: 3px 9px;
  background: rgba(39, 27, 18, .78);
  color: var(--ink-invert);
  font-size: 11px;
  letter-spacing: .08em;
  border-radius: var(--radius-sm);
}
.entry-card h3 {
  margin: 12px 16px 6px;
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: .12em;
}
.entry-card p {
  margin: 0;
  padding: 0 16px 16px;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--ink-3);
}
.entry-card:hover, .entry-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
}
.entry-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 空状态 */
.empty-state {
  margin: 10px 0 0;
  padding: 40px 20px;
  text-align: center;
  background: var(--paper-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-3);
}
.empty-state p { margin: 0 0 16px; font-size: var(--fs-base); }

/* 列表说明 */
.list-note { padding: 38px 0 10px; border-top: 1px solid var(--line); margin-top: 38px; }
.list-note h2 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink);
}
.list-note p {
  margin: 0;
  max-width: 780px;
  font-size: var(--fs-base);
  line-height: 2;
  color: var(--ink-2);
}

/* 相邻分类 */
.related-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-base);
}
.related-cats .label { color: var(--ink-3); font-size: var(--fs-sm); letter-spacing: .08em; }
.related-cats a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.related-cats a:hover, .related-cats a:focus-visible { color: var(--accent-2); border-color: var(--accent-soft); }

/* 详情页布局 */
.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  gap: 56px;
  justify-content: center;
  padding: 34px 0 56px;
  align-items: start;
}
.article { min-width: 0; }
.article-intro {
  margin: 0 0 26px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1.95;
  color: var(--ink-2);
}
.article h2 {
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 20px);
  margin: 40px 0 14px;
  padding-left: 14px;
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink);
}
.article h2::before {
  content: "";
  position: absolute;
  left: 0; top: .35em; bottom: .3em;
  width: 3px;
  background: var(--accent-soft);
}
.article h2:first-of-type { margin-top: 0; }
.article figure { margin: 20px 0; }
.article figure img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 26px 0 6px; font-size: var(--fs-sm); color: var(--ink-mute); }
.pagination a, .pagination .current { min-width: 32px; padding: 5px 10px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; background: var(--paper-2); }
.pagination a:hover { border-color: var(--accent-soft); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff6e8; }
.article p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 2;
  color: var(--ink-2);
}
.article-body-wrap { border-top: 1px solid var(--line); padding-top: 28px; }

/* 目录 */
.article-toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.article-toc h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ink);
}
.article-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.article-toc li { counter-increment: toc; border-top: 1px solid var(--line); }
.article-toc li:first-child { border-top: 0; }
.article-toc a {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  text-decoration: none;
}
.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent-soft);
  font-family: var(--font-serif);
  font-size: 12px;
}
.article-toc a:hover, .article-toc a:focus-visible,
.article-toc a.is-active { color: var(--accent-2); }
.article-toc a:focus-visible { outline: 1px solid var(--accent-2); outline-offset: 2px; }

/* 形制表 */
.spec-table {
  width: 100%;
  margin: 4px 0 10px;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.spec-table caption {
  text-align: left;
  padding-bottom: 10px;
  color: var(--ink-3);
  font-size: var(--fs-sm);
}
.spec-table th, .spec-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}
.spec-table th {
  width: 130px;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: .08em;
  background: var(--paper-2);
}
.spec-table td { color: var(--ink-2); line-height: 1.85; }

/* 相关条目 */
.related-list { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.related-list h2 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink);
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s ease;
}
.related-card img { width: 62px; height: 62px; object-fit: cover; border-radius: var(--radius-sm); }
.related-card span { font-family: var(--font-serif); font-size: var(--fs-md); letter-spacing: .1em; }
.related-card:hover, .related-card:focus-visible { border-color: var(--accent-soft); }
.related-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: var(--fs-base);
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.related-back:hover, .related-back:focus-visible { color: var(--accent-2); }

@media (max-width: 1080px) {
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
  .article-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; justify-content: stretch; }
}
@media (max-width: 820px) {
  .entry-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .article-layout { grid-template-columns: 1fr; gap: 26px; padding-top: 26px; }
  .article-toc { position: static; order: -1; }
  .page-hero h1 { font-size: 26px; }
  .related-grid { grid-template-columns: 1fr; }
  .toolbar { gap: 10px 16px; }
  .sort-group { margin-left: 0; }
}
@media (max-width: 520px) {
  .entry-grid { grid-template-columns: 1fr; }
  .article p { font-size: 15.5px; }
}
.spec-note {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
