/* 公共组件：页头、页脚、按钮、区块标题、卡片、筛选条、目录 */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; }

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; letter-spacing: 0.01em; }

.container { width: min(var(--container), calc(100% - 64px)); margin-inline: auto; }

.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;
  background: var(--deep); color: var(--on-deep); padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── 页头 ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(249, 247, 244, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(77, 53, 32, 0.08); }

.header-inner { display: flex; align-items: center; gap: 26px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand svg { width: 26px; height: 26px; color: var(--deep); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-serif); font-size: 17px; letter-spacing: 0.02em; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 0.18em; }

.nav {
  display: flex; align-items: center; gap: 18px; margin-left: auto;
  font-size: 13.5px; color: var(--ink-2);
  min-width: 0; overflow-x: auto; overflow-y: visible;
  scrollbar-width: none; -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-item { position: relative; flex: none; }
.nav a { padding: 4px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.nav a:hover, .nav a:focus-visible { color: var(--deep); border-bottom-color: var(--tan); }
.nav .nav-link { display: block; }

.nav-item .dropdown {
  display: none; position: absolute; left: 50%; top: 100%; z-index: 60;
  min-width: 148px; margin: 6px 0 0; padding: 8px 0;
  transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(77, 53, 32, 0.12);
  max-height: 360px; overflow-y: auto;
}
.nav-item .dropdown::before {
  content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
.nav-item:hover .dropdown { display: block; }
.nav-item .dropdown a {
  display: block; padding: 7px 16px; border-bottom: 0;
  font-size: 13px; color: var(--ink-2);
}
.nav-item .dropdown a:hover, .nav-item .dropdown a:focus-visible { background: var(--paper-2); color: var(--deep); }

.header-cta {
  margin-left: 8px; padding: 7px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--deep); white-space: nowrap;
  flex: none;
}
.header-cta:hover { background: var(--paper-2); }

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 5px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--tan); color: #33251a; }
.btn-primary:hover { background: #bd976d; }
.btn-ghost { border-color: var(--line-strong); color: var(--deep); background: transparent; }
.btn-ghost:hover { background: var(--paper-2); }
.btn .arrow { font-size: 13px; }

/* ── 区块标题 ───────────────────────────────────────── */
.section { padding: var(--section-pad) 0; }
.section-head { margin-bottom: 18px; padding-left: 15px; position: relative; }
.section-head::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 4px; height: 26px;
  background: var(--accent-2); border-radius: 2px;
}
.section-head h2 { margin: 0; font-size: 29px; line-height: 1.25; }
.section-head p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }

/* ── 卡片 ───────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* ── 筛选条 ─────────────────────────────────────────── */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  background: rgba(249, 247, 244, 0.97); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.toolbar-inner { display: flex; align-items: center; gap: 18px; min-height: 80px; flex-wrap: wrap; padding: 12px 0; }
.toolbar-label { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
label.toolbar-label { cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--accent); color: var(--accent-2); }
.chip[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }

.toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sort-select {
  font-family: inherit; font-size: 13px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 30px 7px 10px; cursor: pointer;
}
.result-count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ── 页脚 ───────────────────────────────────────────── */
.site-footer { background: var(--deep); color: var(--on-deep); margin-top: 26px; padding: 22px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 32px; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; min-width: 170px; }
.footer-brand svg { width: 28px; height: 28px; color: var(--on-deep); flex: none; }
.footer-brand strong { display: block; font-family: var(--font-serif); font-size: 16px; }
.footer-brand small { display: block; font-size: 10.5px; letter-spacing: 0.16em; color: #c9b49b; }
.footer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 12.5px; color: #e8dccd; flex: 2 1 320px; min-width: 240px; }
.footer-links .footer-label { color: #b79f84; letter-spacing: 0.12em; font-size: 11px; margin-right: 2px; }
.footer-links .footer-label:not(:first-child) { margin-left: 8px; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { font-size: 11.5px; line-height: 1.7; color: #c9b49b; text-align: right; flex: 1 1 180px; min-width: 170px; }
.footer-legal p { margin: 0; }

/* ── 面包屑 ─────────────────────────────────────────── */
.breadcrumb { font-size: 12.5px; color: var(--muted); margin: 0; }
.breadcrumb a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb .sep { margin: 0 6px; color: var(--line-strong); }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1180px) {
  .header-inner { gap: 14px; }
  .brand-text small { display: none; }
  .nav { gap: 14px; font-size: 13px; margin-left: auto; }
  .nav-item .dropdown { display: none !important; }
  .header-cta { margin-left: 0; padding: 6px 11px; font-size: 12.5px; }
}

@media (max-width: 900px) {
  .footer-inner { flex-direction: column; gap: 16px; }
  .footer-brand, .footer-links, .footer-legal { flex: none; width: 100%; min-width: 0; }
  .footer-legal { text-align: left; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 36px); }
  .section { padding: 24px 0; }
  .section-head h2 { font-size: 23px; }
  .section-head p { font-size: 13px; }
  .brand-text strong { font-size: 15px; }
  .nav { gap: 12px; font-size: 12.5px; }
  .header-cta { display: none; }
  .toolbar-inner { gap: 10px; padding: 10px 0; }
  .toolbar-right { margin-left: 0; width: 100%; }
  .sort-select { flex: 1; }
  .btn { padding: 10px 16px; font-size: 13px; }
}
