/* base.css — 全站统一基础样式（单一权威源，所有页面引用）
 * 优先级：放在head开头 → 页面自定义样式在后覆盖
 * 包含：reset + CSS变量 + typography + topbar + ICP footer
 */

/* ========== Reset（最小化，只处理跨浏览器差异） ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif; line-height: 1.7; color: var(--text, #1f2937); background: var(--bg, #ffffff); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ========== CSS变量（默认值，页面可自定义覆盖） ========== */
:root {
  --primary: #4f46e5;
  --primary-orange: #f97316;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --border: #e5e7eb;
  --radius: 12px;
  --max-width: 1100px;
}

/* ========== Topbar（统一顶部导航条，与首页风格一致） ========== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 20px;
}
.topbar-inner {
  max-width: var(--max-width, 1100px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #fff;
}
.topbar-logo {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary, #4f46e5);
  text-decoration: none;
  white-space: nowrap;
}
.topbar-logo span { color: var(--primary-orange, #f97316); }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 24px;
  padding: 6px 12px;
  flex: 1 1 auto;
  min-width: 220px;
}
.topbar-search input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: .9rem;
  color: var(--text, #1f2937);
  min-width: 0;
}
.topbar-search button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: .95rem;
  color: var(--text-light, #6b7280);
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-soft, #f3f4f6);
  border-radius: 18px;
  text-decoration: none;
  color: #374151;
  font-size: .8rem;
  white-space: nowrap;
  transition: all .2s;
  border: 1px solid var(--border, #e5e7eb);
}
.cat-chip:hover {
  background: var(--primary, #4f46e5);
  color: #fff;
  border-color: var(--primary, #4f46e5);
}
.cat-chip-icon { font-size: .9rem; }
.cat-chip-count {
  background: rgba(0,0,0,.08);
  padding: 0 7px;
  border-radius: 10px;
  font-size: .68rem;
}
.cat-chip:hover .cat-chip-count { background: rgba(255,255,255,.25); }

/* ========== ICP Footer（合规备案号样式） ========== */
footer {
  text-align: center;
  padding: 16px;
  color: #999;
  font-size: 13px;
  border-top: 1px solid var(--border, #eee);
  margin-top: 40px;
}
footer a {
  color: #999;
  text-decoration: none;
}
footer a:hover { color: var(--text-light, #6b7280); }
