/* ============================================================================
   base.css —— reset + 排版 + 通用工具类
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}
ul, ol { list-style: none; }
img, video, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
table { border-collapse: collapse; width: 100%; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---------- 链接 ---------- */
a { color: inherit; text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand); }

/* ---------- 标题 ---------- */
h1, h2, h3, h4 { color: var(--text-strong); font-weight: 700; line-height: 1.35; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}
/* 纯文字页用窄栏：正文一行的字数控制在读起来不累的范围 */
.container-narrow { max-width: var(--container-narrow); }
.site-main {
  position: relative;
  z-index: 10;
  flex: 1;
  padding-bottom: var(--gap-xl);
}

/* ---------- 常用工具类 ---------- */
.dim      { color: var(--text-dim); }
.center   { text-align: center; }
.mt       { margin-top: var(--gap); }
.mt-lg    { margin-top: var(--gap-lg); }
.mb       { margin-bottom: var(--gap); }
.flex     { display: flex; }
.flex-1   { flex: 1; }
.hide-sm  { }
.num      { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- 背景层（首屏） ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-image, .bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 视频叠在兜底图之上（视频没加载出来时是透明的，会露出下面那张图） */
.bg-video {
  z-index: 1;
  filter: brightness(1.12) contrast(1.05) saturate(1.08);
}
/* 背景蒙层：中段压暗保证文字可读，上下留出背景 */
.bg-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, .18) 0%,
    rgba(0, 0, 0, .32) 40%,
    rgba(0, 0, 0, .48) 68%,
    var(--bg) 100%);
}
:root[data-theme="light"] .bg-mask {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .18) 0%,
    rgba(255, 255, 255, .32) 40%,
    rgba(255, 255, 255, .48) 68%,
    var(--bg) 100%);
}

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  color: var(--text-dim);
  font-size: 13px;
  padding: var(--gap-lg) 0 var(--gap);
}
.crumb em { font-style: normal; color: var(--text); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ---------- 焦点可见（键盘可达性） ---------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- 尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 767px) {
  body { font-size: 13.5px; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .hide-sm { display: none !important; }
  .site-main { padding-bottom: var(--gap-lg); }
}
