/* =========================================================
   星聚火 · 全局动画与质感引擎（共享）
   通过 /assets/site.css 统一接入所有页面
   设计原则：中性、零第三方依赖、尊重 prefers-reduced-motion
   ========================================================= */

/* ---------- 降级：用户偏好减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal], [data-reveal-group] > * { opacity: 1 !important; transform: none !important; }
}

/* ---------- 滚动揭示（单元素） ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1),
              transform .8s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal="fade"]  { transform: none; }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 滚动揭示（分组 stagger） ---------- */
[data-reveal-group] > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1),
              transform .6s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
[data-reveal-group].is-visible > * { opacity: 1; transform: none; }

/* ---------- Hero 首屏入场（无需 JS，加载即播） ---------- */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.hero-in > * { opacity: 0; animation: heroIn .95s cubic-bezier(.22,.61,.36,1) both; }
.hero-in > *:nth-child(1) { animation-delay: .05s; }
.hero-in > *:nth-child(2) { animation-delay: .18s; }
.hero-in > *:nth-child(3) { animation-delay: .34s; }
.hero-in > *:nth-child(4) { animation-delay: .50s; }
.hero-in > *:nth-child(5) { animation-delay: .66s; }
.hero-in > *:nth-child(6) { animation-delay: .80s; }

/* ---------- 顶部滚动进度条 ---------- */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold, #C9A66B), var(--gold-deep, #B08D4F));
  z-index: 300; transition: width .12s linear;
  box-shadow: 0 0 10px rgba(201,166,107,.65);
}

/* ---------- 返回顶部 ---------- */
#back-to-top {
  position: fixed; right: 26px; bottom: 26px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--olive, #4A5D3A); color: var(--cream, #F5F1E8);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--gold, #C9A66B);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
  transition: opacity .35s, transform .35s, background .25s, visibility .35s;
  z-index: 300; font-size: 20px; line-height: 1;
}
#back-to-top.show { opacity: 1; visibility: visible; transform: none; }
#back-to-top:hover { background: var(--gold, #C9A66B); color: var(--olive, #4A5D3A); transform: translateY(-3px); }

/* ---------- 光泽扫过（hover） ---------- */
.shine { position: relative; overflow: hidden; }
.shine::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg); transition: left .75s ease;
  pointer-events: none;
}
.shine:hover::after { left: 145%; }

/* ---------- 导航滚动加深 ---------- */
[data-nav].scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.20); }

/* ---------- 导航高亮（scrollspy） ---------- */
nav.links a.active { color: var(--gold, #C9A66B); }
nav.links a.active::after { width: 100%; }

/* ---------- 数字计数 ---------- */
.count-up { font-variant-numeric: tabular-nums; }

/* ---------- 通用悬浮抬升（可选增强类） ---------- */
.lift { transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s, border-color .3s; }
.lift:hover { transform: translateY(-6px); }
