/* components.css — 三页共用组件（首页 / 分类页 / 详情页） */

.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: -48px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-small);
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-header);
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark { display: inline-flex; color: var(--accent); }
.brand-name {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .5px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 42px;
  margin-left: 128px;
  font-size: 15.5px;
}
.main-nav a {
  position: relative;
  color: var(--ink-2);
  text-decoration: none;
  padding: 22px 0;
  transition: color .18s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.main-nav a[aria-current="page"]::after { background: var(--accent); }
.main-nav a:focus-visible,
.brand:focus-visible,
.footer-nav a:focus-visible,
.footer-brand-link:focus-visible,
.footer-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn::after {
  content: "→";
  font-size: 14px;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- 区块标题 ---------- */
.sec-head {
  display: flex;
  align-items: center;
  gap: 28px;
}
.sec-head h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .5px;
  color: var(--ink);
  margin: 0;
  flex: 0 0 auto;
}
.sec-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.sec-rule.short { flex: 0 0 36px; }
.more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--accent);
  text-decoration: none;
}
.more::after { content: "→"; }
.more:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 缩略图槽位 ---------- */
.thumb {
  overflow: hidden;
  border-radius: var(--radius-img);
  background: var(--panel);
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
  list-style: none;
  margin: 0;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb li { display: inline-flex; align-items: center; gap: 8px; }
.crumb li + li::before { content: "/"; color: var(--accent-soft); }
.crumb [aria-current="page"] { color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--footer);
  color: var(--footer-ink);
  padding: 30px 0 0;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
}
.footer-brand {
  flex: 1.6 1 250px;
  min-width: 210px;
}
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--footer-ink);
  text-decoration: none;
}
.footer-brand .brand-mark { color: var(--footer-ink); }
.footer-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
}
.footer-tagline {
  margin: 12px 0 0;
  font-size: var(--fs-small);
  line-height: 1.7;
  color: var(--footer-muted);
}
.footer-col {
  flex: 1 1 150px;
  min-width: 136px;
}
.footer-label {
  margin: 0 0 12px;
  font-size: var(--fs-micro);
  letter-spacing: .08em;
  color: var(--footer-muted);
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: var(--fs-small);
}
.footer-nav a,
.footer-list a {
  color: var(--footer-ink);
  text-decoration: none;
}
.footer-nav a:hover,
.footer-list a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: var(--fs-small);
  color: var(--footer-muted);
}
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(243, 236, 226, .18);
  font-size: 12.5px;
  color: var(--footer-muted);
}
.footer-bottom p { margin: 0; }
.footer-bottom .copyright { margin-left: auto; color: var(--footer-muted); }

/* ---------- 通用响应式 ---------- */
@media (max-width: 1180px) {
  .main-nav { gap: 24px; margin-left: 40px; }
  .footer-top { gap: 26px; }
}
@media (max-width: 900px) {
  .footer-brand { flex: 1 1 100%; }
  .footer-col { flex: 1 1 140px; }
  .footer-bottom { flex-wrap: wrap; gap: 8px; }
  .footer-bottom .copyright { margin-left: 0; }
}
