/* components.css — 跨页共享组件：页头、页脚、按钮、卡片、区块标题、徽标 */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border: 0;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn::after {
  content: "→";
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(10, 110, 214, 0.28); }
.btn--primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn--light { background: #fff; color: var(--accent); box-shadow: 0 6px 16px rgba(6, 30, 60, 0.18); }
.btn--light:hover { background: #fff; color: var(--accent-strong); }

.link-arrow { font-weight: 700; }

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 26px; flex: none; }
.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 30px; }
.nav__list a {
  position: relative;
  display: block;
  padding: 24px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.nav__list a:hover { color: var(--accent); }
.nav__list a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.nav__list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 3px;
  transform: translateX(-50%);
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}
.nav__list a.nav__cta { font-weight: 700; }
.site-logo-text { display: inline-block; max-width: 15em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* ---------- 导航下拉 ---------- */
.nav__list > li { position: relative; }
.nav__list .caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: 2px;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.55;
}
.nav__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 50;
  min-width: 196px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(16, 52, 92, 0.16);
}
.nav__list > li.has-menu:hover > .nav__menu { display: block; }
.nav__menu a {
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nav__menu a:hover { background: var(--accent-soft); color: var(--accent-strong); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 2px;
}

/* ---------- 区块标题 ---------- */
.section-head { margin-bottom: 14px; }
.section-head__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
}
.section-head__title::before {
  content: "";
  width: 4px;
  height: 26px;
  background: var(--accent);
  border-radius: 2px;
  flex: none;
}
.section-head__lead {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ---------- 分类卡 ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
}
.category-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.category-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 12px 26px rgba(16, 52, 92, 0.14); }
.category-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.category-card__body { flex: 1; padding: 20px 10px 18px; text-align: center; }
.category-card__name { font-size: 19px; font-weight: 700; letter-spacing: 0.01em; }
.category-card__desc { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.7; }

/* ---------- 信息标签 ---------- */
.meta-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ---------- 页脚 ---------- */
.site-footer { background: var(--footer-bg); color: #c6d5e6; }
.site-footer__inner {
  display: grid;
  grid-template-columns: 210px 1fr 300px;
  align-items: center;
  gap: 28px;
  padding: 16px 0 15px;
}
.site-footer .brand { color: #fff; font-size: 22px; }
.site-footer .brand:hover { color: #fff; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer__nav a { color: #d6e3f0; font-size: 14px; }
.site-footer__nav a:hover { color: #fff; }
.site-footer__about { border-left: 1px solid rgba(255, 255, 255, 0.18); padding-left: 24px; }
.site-footer__about h3 { color: #fff; font-size: 16px; font-weight: 700; }
.site-footer__about p { margin-top: 5px; font-size: 12px; line-height: 1.65; color: #b8c9dc; }
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 0 7px;
  font-size: 12px;
  color: #9db2c9;
}

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 13.5px; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.breadcrumb li::after { content: "/"; margin-left: 8px; color: #b9cadb; }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 40px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  color: var(--muted);
}
.empty-state[hidden] { display: none; }

/* ---------- 动效收敛 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 1380px) {
  .site-header__inner { flex-wrap: wrap; height: auto; padding: 12px 0 0; }
  .nav { flex: 1 1 100%; margin-left: 0; }
  .nav__list { flex-wrap: wrap; gap: 4px 22px; }
  .nav__list a { padding: 10px 0; }
  .nav__list a[aria-current="page"]::after { display: none; }
}

@media (max-width: 1080px) {
  .nav__list { gap: 4px 18px; }
  .nav__list a { font-size: 15px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 18px; }
  .site-footer__about { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.18); padding-top: 14px; }
}

@media (max-width: 860px) {
  .site-header__inner { flex-wrap: nowrap; height: 62px; padding: 0; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 62px;
    display: none;
    padding: 8px var(--gutter) 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(16, 52, 92, 0.12);
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav__list a[aria-current="page"]::after { display: none; }
  .nav__menu {
    position: static;
    display: block;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0 0 6px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav__menu a { padding: 9px 0 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
  .nav__list .caret { display: none; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .brand { font-size: 20px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .category-card__name { font-size: 16px; }
}
