/* components.css — 三页共用的组件（页头、页脚、面包屑、标签、按钮、卡片骨架）。
   首页专用版式在 style.css，内页在 inner.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;
}
.wrap { width: min(var(--content), calc(100% - 80px)); margin-inline: auto; }

/* ------------------------------------------------------------ 页头 */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--brand); color: var(--ink-invert);
  border-bottom: 1px solid rgba(240, 215, 147, 0.16);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; flex: none;
}
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; align-items: baseline; gap: 12px; }
.brand-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 22px; letter-spacing: 0.02em; color: #f7f2e4;
}
.brand-sub {
  font-size: var(--fs-10); letter-spacing: 0.14em;
  color: rgba(246, 242, 230, 0.62); white-space: nowrap;
}
.site-nav {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  border-left: 1px solid rgba(246, 242, 230, 0.18); padding-left: 22px;
}
.site-nav a {
  color: rgba(246, 242, 230, 0.78); text-decoration: none;
  font-size: var(--fs-8); padding: 8px 10px; border-radius: 6px;
  white-space: nowrap; transition: color .18s, background .18s;
}
.site-nav a:hover { color: #fff; background: rgba(246, 242, 230, 0.08); }
.site-nav a[aria-current="page"] {
  color: #f7f2e4; background: rgba(240, 215, 147, 0.14);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-toggle {
  display: none; margin-left: auto; align-items: center; gap: 8px;
  background: transparent; color: #f7f2e4; border: 1px solid rgba(246, 242, 230, 0.4);
  border-radius: 999px; padding: 9px 16px; font-size: var(--fs-8);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; cursor: pointer;
}
.nav-toggle:hover { background: rgba(246, 242, 230, 0.1); }

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px;
  font-size: var(--fs-7); font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: transform .16s, background .16s, color .16s;
}
.btn-primary { background: var(--accent); color: #26310f; }
.btn-primary:hover { background: #f6e3b4; transform: translateY(-1px); }
.btn-ghost { border-color: rgba(246, 242, 230, 0.5); color: #f7f2e4; }
.btn-ghost:hover { background: rgba(246, 242, 230, 0.1); }
.btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ 标签 */
.tag {
  display: inline-block; font-size: 13px; line-height: 1.7; font-weight: 600;
  color: #f4ecd4; background: #2f4a2b;
  border-radius: 999px; padding: 1px 11px; white-space: nowrap;
}
.tag-plain {
  background: none; padding: 0; border-radius: 0;
  color: var(--accent-deep); font-size: var(--fs-10); letter-spacing: 0.02em;
}

/* ------------------------------------------------------------ 面包屑 */
.breadcrumb { font-size: var(--fs-9); color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb .sep { color: var(--line-2); }
.breadcrumb [aria-current="page"] { color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------ 区块栏头 */
.col-head {
  display: flex; align-items: flex-end; gap: 24px;
  margin-bottom: 26px;
}
.col-head h2 {
  position: relative; margin: 0; padding-left: 16px;
  font-size: 40px; line-height: 1.2; font-weight: 700;
}
.col-head h2::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 4px; background: var(--accent); border-radius: 2px;
}
.col-lede { margin: 0; font-size: 15px; color: var(--ink-soft); max-width: 780px; }
.col-count {
  margin-left: auto; flex: none;
  background: var(--accent-soft); color: #2f4726;
  font-size: 13px; padding: 6px 16px; border-radius: 999px;
}

/* ------------------------------------------------------------ 缩略图 */
.thumb {
  display: block; overflow: hidden; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: #d9d3c5;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ------------------------------------------------------------ 页脚 */
.site-footer {
  background: var(--brand); color: rgba(246, 242, 230, 0.78);
  padding: 30px 0 20px;
}
.site-footer .wrap { display: grid; grid-template-columns: 320px 1fr; gap: 48px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .brand-mark { width: 40px; height: 40px; }
.footer-name { font-family: var(--font-serif); font-size: 22px; color: #f7f2e4; font-weight: 700; }
.footer-tag { margin: 6px 0 0; font-size: var(--fs-10); color: rgba(246, 242, 230, 0.55); line-height: 1.8; }
.footer-cols { display: flex; flex-direction: column; gap: 10px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.footer-label { font-size: var(--fs-9); color: #f0d793; min-width: 64px; }
.footer-row a { color: rgba(246, 242, 230, 0.8); text-decoration: none; font-size: var(--fs-9); }
.footer-row a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-legal {
  grid-column: 1 / -1; margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid rgba(246, 242, 230, 0.14);
  font-size: var(--fs-10); color: rgba(246, 242, 230, 0.5);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-legal p { margin: 0; max-width: 900px; }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .wrap { width: calc(100% - 56px); }
  .brand-sub { display: none; }
  .site-nav { gap: 2px; padding-left: 14px; }
  .site-nav a { padding: 8px 7px; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--brand); border-left: 0; padding: 8px 24px 18px;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid rgba(246, 242, 230, 0.1); border-radius: 0; }
  .nav-toggle { display: inline-flex; }
  .site-header .wrap { gap: 12px; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 26px; }
  .footer-legal { margin-top: 4px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  .brand-name { font-size: 19px; }
  .col-head { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .col-head h2 { font-size: 22px; }
  .col-count { margin-left: 0; }
  .btn { padding: 12px 20px; }
}
