/* components.css — 全站公共组件（页头、按钮、徽标、指标条、面包屑、筛选条） */

/* ---------- 页头 ---------- */

.site-header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand-mark { width: 32px; height: 34px; flex: none; }

.site-nav { margin-left: auto; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 45px;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-size: var(--fs-5);
  color: #26334b;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--blue); }

.site-nav a[aria-current="page"] {
  color: var(--blue);
  font-weight: 600;
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: translateX(-50%);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle .bars { display: inline-flex; flex-direction: column; gap: 3px; }
.nav-toggle .bars i { display: block; width: 14px; height: 2px; background: currentColor; border-radius: 1px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 36px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-deep); }

.btn-ghost {
  background: rgba(255, 255, 255, .55);
  border-color: #b9cde9;
  color: var(--blue);
}
.btn-ghost:hover { background: var(--white); border-color: var(--blue); }

.btn-light { background: var(--white); color: var(--blue); }
.btn-light:hover { background: #eaf1fc; }

.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: var(--white); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); border-color: var(--white); }

/* ---------- 首屏指标条 ---------- */

.stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-5);
  color: #2f3d55;
}

.stat svg { width: 19px; height: 19px; flex: none; color: var(--blue); }

/* ---------- 分区图标（收录说明） ---------- */

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(32, 99, 196, .25);
  color: var(--white);
  flex: none;
}

/* ---------- 面包屑 ---------- */

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-2);
  color: var(--muted);
}

.crumb a { color: var(--blue); }
.crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumb li + li::before { content: "/"; margin-right: 8px; color: #a9b7ca; }
.crumb li { display: inline-flex; align-items: center; }

/* ---------- 移动端导航 ---------- */

@media (max-width: 1080px) {
  .site-nav ul { gap: 26px; }
  .site-nav a { font-size: var(--fs-2); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    margin: 0;
    padding: 8px 16px 16px;
    background: #eef3fc;
    border-top: 1px solid var(--line);
    box-shadow: 0 14px 22px rgba(31, 51, 81, .1);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 2px; }
  .site-nav li { width: 100%; }
  .site-nav a { display: block; padding: 11px 4px; font-size: var(--fs-4); border-bottom: 1px solid var(--line-soft); }
  .site-nav a[aria-current="page"]::after { display: none; }
  .header-inner { gap: 12px; }
  .brand { font-size: var(--fs-5); }
}

/* ---------- 内页：分类页 / 详情页 ---------- */

.page-band {
  background: linear-gradient(180deg, #e9effb 0%, #e6edfa 100%);
  padding: 0 0 34px;
}

.page-band .site-header { background: transparent; }

.page-hero h1 {
  margin-top: 14px;
  font-size: 40px;
  line-height: 1.2;
}

.page-hero .lead {
  margin-top: 14px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.75;
  color: #33405a;
}

.page-hero .count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .75);
  border: 1px solid #c9dbef;
  font-size: var(--fs-2);
  color: var(--blue);
}

/* 筛选条 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.toolbar-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.toolbar-label { font-size: var(--fs-2); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--fs-2);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.chip:hover { border-color: #b6cbe8; color: var(--blue); }

.chip[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.select {
  height: 34px;
  cursor: pointer;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--fs-2);
}

.select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.filter-status {
  font-size: var(--fs-2);
  color: var(--muted);
}

.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: auto; padding-top: 10px; }

.tags span {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
}

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-4);
}

.list-desc {
  max-width: 900px;
  padding: 34px 0 8px;
}

.list-desc h2 { font-size: var(--fs-8); }

.list-desc p {
  margin-top: 12px;
  font-size: var(--fs-4);
  line-height: 1.9;
  color: var(--ink-body);
}

/* 详情页 */
.article-head { max-width: 900px; }

.article-head h1 {
  margin-top: 14px;
  font-size: 40px;
  line-height: 1.25;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: var(--fs-2);
  color: var(--muted);
}

.article-meta .pill {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 600;
}

.article-meta .pill:hover { background: #cfe0f8; }

.article-source {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-2);
  line-height: 1.8;
  color: var(--muted);
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.toc-title {
  font-size: var(--fs-6);
  font-weight: 700;
  color: var(--ink);
}

.toc ol { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }

.toc a {
  display: block;
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--ink-soft);
  padding-left: 10px;
  border-left: 2px solid transparent;
}

.toc a:hover { color: var(--blue); }
.toc a[aria-current="true"] { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

.article { max-width: 780px; }

.article h2 {
  margin-top: 38px;
  font-size: var(--fs-9);
  line-height: 1.4;
}

.article h2:first-child { margin-top: 0; }

.article p {
  margin-top: 14px;
  font-size: var(--fs-4);
  line-height: 1.95;
  color: var(--ink-body);
}

.related { padding-top: 8px; padding-bottom: 56px; }

.related h2 { font-size: var(--fs-7); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
  max-width: 1000px;
}

.related-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}

.related-card:hover { border-color: #b6cbe8; transform: translateY(-2px); }

.related-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--tile);
}

.related-card h3 { font-size: var(--fs-3); line-height: 1.4; }

.cat-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.cat-links a {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--fs-3);
  color: var(--ink-soft);
}

.cat-links a:hover { border-color: #b6cbe8; color: var(--blue); }

@media (max-width: 1080px) {
  .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; order: -1; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .related-grid { grid-template-columns: 1fr; }
  .page-hero h1, .article-head h1 { font-size: 32px; }
}

@media (max-width: 900px) {
  .page-band { padding: 18px 0 24px; }
  .page-hero h1, .article-head h1 { font-size: 28px; }
  .page-hero .lead { font-size: 15px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .list-desc { padding: 24px 0 4px; }
  .article-layout { padding-top: 24px; padding-bottom: 36px; }
  .article p { font-size: 15px; line-height: 1.9; }
}
