/* components.css — 全站共享组件：页头、页脚、标题组、卡片、按钮、表格 */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------------------------------------------------------------- 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 240, 226, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #8c3a32, var(--accent) 70%);
  box-shadow: inset 0 0 0 2px rgba(217, 195, 154, 0.65), 0 4px 10px rgba(60, 32, 20, 0.22);
  color: var(--gold-soft);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  font-size: 14px;
}
.site-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--accent); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  margin-inline: auto;
  background: var(--accent);
  content: "";
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -5px; left: 0; }
.nav-toggle span::after { position: absolute; top: 5px; left: 0; }

/* ---------------------------------------------------------------- 标题组 */
.section { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.section-head .mark {
  width: 8px;
  height: 26px;
  align-self: center;
  background: var(--accent);
  border-radius: 2px;
  flex: none;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: var(--accent);
}
.section-head p {
  margin: 0;
  color: var(--ink-mute);
  font-size: 13px;
}
.section-head .head-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}
.section-head .head-link:hover { border-color: var(--gold); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fdf3e6; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost { border-color: var(--line-strong); color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}
.card-text {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-mute);
}

/* ---------------------------------------------------------------- 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}
.data-table th,
.data-table td {
  padding: 5px 14px;
  line-height: 1.5;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  background: var(--accent);
  color: #f7e9d8;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-bottom: none;
}
.data-table tbody tr:nth-child(even) { background: #f7e9d8; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td:first-child {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.table-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--ink-mute);
}

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
  margin-top: 0;
  background: var(--accent);
  color: #f2dfcd;
  padding: 30px 0 18px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px 36px;
  padding-bottom: 20px;
}
.footer-grid > * { flex: 1 1 190px; min-width: 170px; }
.footer-brand-col { flex: 1.4 1 280px; }
.footer-col .footer-links { flex-direction: column; align-items: flex-start; gap: 7px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand .brand-mark { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(217, 195, 154, 0.5); }
.footer-brand strong { font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.05em; }
.site-footer p { margin: 0; font-size: 12.5px; line-height: 1.9; color: rgba(242, 223, 205, 0.78); max-width: 34em; }
.site-footer h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 12.5px; }
.footer-links a { color: rgba(242, 223, 205, 0.82); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid rgba(217, 195, 154, 0.28);
  font-size: 11.5px;
  color: rgba(242, 223, 205, 0.62);
}

/* ---------------------------------------------------------------- 通用小件 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }

@media (max-width: 1023px) {
  .header-inner { height: auto; flex-wrap: wrap; gap: 4px 18px; padding-top: 10px; padding-bottom: 8px; }
  .site-nav {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin-left: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .site-nav a { width: auto; padding: 4px 0; font-size: 14px; }
  .nav-toggle { display: none !important; }
  .footer-grid { flex-direction: column; gap: 24px; }
  .footer-grid > * { flex: 1 1 auto; width: 100%; min-width: 0; }
}

@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .section-head { flex-wrap: wrap; gap: 8px 12px; }
  .section-head h2 { font-size: 21px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- 面包屑 */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-3);
  color: var(--ink-mute);
}
.crumb a { color: var(--ink-mute); }
.crumb a:hover { color: var(--accent); }
.crumb a + a::before { content: "/"; margin-right: 8px; color: var(--gold-soft); }
.crumb [aria-current="page"] { color: var(--accent); }

/* ------------------------------------------------------------ 筛选与排序 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 22px 0 26px;
}
.toolbar .group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .label { font-size: var(--fs-2); letter-spacing: .12em; color: var(--ink-mute); }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--fs-3);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg-soft); }
.select {
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  font-size: var(--fs-3);
  color: var(--ink-soft);
  cursor: pointer;
}
.select:hover { border-color: var(--line-strong); }

/* -------------------------------------------------------------- 列表卡 */
.list-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-card .thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-deep);
}
.list-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.list-card:hover .thumb img { transform: scale(1.03); }
.list-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.list-card .meta { display: flex; align-items: center; gap: 10px; font-size: var(--fs-1); letter-spacing: .08em; color: var(--ink-mute); }
.list-card h3 { margin: 0; font-size: var(--fs-8); font-weight: 600; line-height: 1.55; color: var(--ink); }
.list-card p { margin: 0; font-size: var(--fs-3); line-height: 1.75; color: var(--ink-mute); }
.list-card .go { margin-top: auto; padding-top: 6px; font-size: var(--fs-2); color: var(--gold); }
.list-count { margin: 0 0 14px; font-size: var(--fs-3); color: var(--ink-mute); }
.list-empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  font-size: var(--fs-4);
  color: var(--ink-mute);
}
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 26px 0 4px; font-size: var(--fs-3); color: var(--ink-soft); }
.pagination a, .pagination .current { min-width: 32px; padding: 5px 10px; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--ink-soft); text-decoration: none; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--bg-soft); }

/* ------------------------------------------------------------ 详情页正文 */
.article { display: grid; grid-template-columns: minmax(0, 720px) 232px; gap: 72px; justify-content: center; align-items: start; }
.article-body { min-width: 0; max-width: 720px; }
.article-body h2 {
  margin: 38px 0 12px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--accent);
  scroll-margin-top: 96px;
}
.article-body p { margin: 0 0 16px; font-size: var(--fs-7); line-height: 1.95; color: var(--ink-soft); }
.article-body figure { margin: 20px 0; }
.article-body figure img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--r-card); }
.article-body a { color: var(--accent); border-bottom: 1px solid var(--gold-soft); }
.article-body a:hover { border-color: var(--accent); }
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: var(--fs-3);
}
.toc h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  color: var(--accent);
}
.toc ol { margin: 0; padding-left: 18px; display: grid; gap: 7px; color: var(--ink-mute); }
.toc a:hover { color: var(--accent); }
.toc a.is-active { color: var(--accent); font-weight: 600; }
.toc-toggle { display: none; }

@media (max-width: 1023px) {
  .article { grid-template-columns: 1fr; gap: 24px; }
  .article-body { max-width: none; }
  .toc { position: static; order: -1; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
}
@media (max-width: 640px) {
  .toolbar { gap: 10px; }
  .select { margin-left: 0; width: 100%; }
  .article-body h2 { font-size: 19px; margin-top: 28px; }
  .toc ol { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------- 内页页头区 */
.page-hero {
  padding: 34px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.page-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.25;
  letter-spacing: .02em;
  color: var(--accent);
}
.page-lead {
  margin: 14px 0 0;
  max-width: 760px;
  font-size: var(--fs-7);
  line-height: 1.9;
  color: var(--ink-soft);
}
.page-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-3);
  color: var(--ink-mute);
}
.page-stats li { display: inline-flex; align-items: baseline; gap: 6px; }
.page-stats b { font-family: var(--font-serif); font-size: var(--fs-9); color: var(--accent); }

/* ------------------------------------------------------------ 列表网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.card-grid > li { display: flex; }
.card-grid > li[hidden] { display: none; }
.card-grid > li > .list-card { width: 100%; }

/* ---------------------------------------------------------- 分类说明区 */
.list-desc {
  margin: 44px 0 0;
  padding: 26px 28px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  border-left: 3px solid var(--gold);
}
.list-desc h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: var(--fs-9);
  color: var(--accent);
}
.list-desc p { margin: 0; font-size: var(--fs-4); line-height: 2; color: var(--ink-soft); }

/* ------------------------------------------------------------ 交叉链接 */
.cross-links { margin-top: 48px; }
.cross-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.cross-card { padding: 18px 20px; display: block; }
.cross-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  color: var(--accent);
}
.cross-card p { margin: 0; font-size: var(--fs-3); line-height: 1.7; color: var(--ink-mute); }

/* ------------------------------------------------------------ 文章头部 */
.article-head { padding: 34px 0 18px; max-width: 900px; }
.article-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 2.8vw, 38px);
  line-height: 1.32;
  color: var(--accent);
}
.article-lead {
  margin: 16px 0 0;
  font-size: var(--fs-8);
  line-height: 1.9;
  color: var(--ink-soft);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-3);
  color: var(--ink-mute);
}
.article-meta a { color: var(--accent); border-bottom: 1px solid var(--gold-soft); }

.article .toc { grid-column: 2; grid-row: 1; }
.article .article-body { grid-column: 1; grid-row: 1; }

@media (max-width: 1023px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cross-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article .toc, .article .article-body { grid-column: 1; grid-row: auto; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .cross-grid { grid-template-columns: 1fr; }
  .list-desc { padding: 20px; }
  .page-hero { padding: 26px 0 20px; }
  .article-head { padding: 26px 0 12px; }
}

.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;
}
.site-footer .footer-note { margin-top: 12px; }
.list-link { display: block; height: 100%; }
