/* ============================================================
   components.css · 跨页面复用的组件
   依赖 tokens.css；页面布局在 style.css
   ============================================================ */

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-4);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
picture { display: block; }

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

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

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

/* ---------- 页头 ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 60;
  height: 88px;
  background: var(--navy);
  color: var(--on-dark);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-7);
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav a {
  font-size: var(--fs-4);
  color: var(--on-dark);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: var(--fs-4);
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(240, 128, 26, .28);
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost {
  border-color: rgba(255, 255, 255, .62);
  color: #fff;
}
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }
.btn--outline {
  border-color: var(--blue-line);
  color: var(--blue);
  background: #fff;
}
.btn--outline:hover { background: var(--blue-soft); }
.btn svg { width: 16px; height: 16px; }

/* ---------- 区块标题 ---------- */
.section { padding: var(--section-y) 0; }
.section-title {
  position: relative;
  padding-left: 16px;
  margin-bottom: 18px;
  font-size: var(--fs-10);
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---------- 图文卡通用 ---------- */
.thumb {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
a:hover .thumb img, article:hover .thumb img { transform: scale(1.035); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--footer);
  color: var(--on-dark-muted);
  font-size: var(--fs-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.2fr 1fr;
  gap: 44px;
  padding-top: 42px;
  padding-bottom: 30px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: var(--fs-6);
  font-weight: 800;
}
.footer-brand svg { width: 24px; height: 24px; }
.footer-about { margin-top: 7px; line-height: 1.7; max-width: 460px; }
.footer-h {
  color: #fff;
  font-size: var(--fs-3);
  font-weight: 700;
  margin-bottom: 5px;
}
.footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.footer-cats a:hover { color: #fff; }
.footer-bottom {
  padding-bottom: 22px;
  font-size: var(--fs-1);
  color: rgba(201, 211, 224, .72);
}

/* ---------- 列表说明 / 正文通用 ---------- */
.list-description,
.article-body { color: var(--ink-2); }
.list-description p + p,
.article-body p + p { margin-top: 14px; }

/* ---------- 移动端 ---------- */
@media (max-width: 1100px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: var(--fs-3); }
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .site-header { height: 72px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 24px 18px;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 18px 30px rgba(8, 20, 34, .28);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 12px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: var(--fs-5);
  }
  .site-nav a[aria-current="page"] { color: var(--accent); }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 30px;
  }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 600px) {
  :root { --section-y: 22px; --gutter: 18px; }
  .section-title { font-size: var(--fs-9); margin-bottom: 14px; }
  .footer-cats { gap: 6px 14px; }
}
