/* ==========================================================================
   VueIC · 动效层
   统一「先隐藏、再由 JS 揭示」的状态定义 + 关键帧 + 减少动效降级
   ========================================================================== */

/* ---- 揭示状态 ------------------------------------------------------------- */
/* 仅当 JS 可用（<html class="js">）时才预置隐藏状态，避免 JS 失效后内容不可见 */
.js [data-reveal],
.js [data-reveal-lines] .line {
  will-change: opacity, transform;
}
.js:not(.motion-ready) [data-reveal],
.js:not(.motion-ready) [data-reveal-lines]:not(.is-split) {
  opacity: 0;
}
.js:not(.motion-ready) [data-reveal-lines].is-split:not(.is-revealed) .line { opacity: 0; }
.js.motion-ready [data-reveal],
.js.motion-ready [data-reveal-lines] .line { opacity: 1; }
[data-reveal-lines].is-revealed .line { opacity: 1; }

/* GSAP 不可用时的 CSS 过渡揭示 */
.reveal-css {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--dur-reveal) var(--ease-out-quart),
              transform var(--dur-reveal) var(--ease-out-quart);
}
.reveal-css.is-revealed { opacity: 1; transform: none; }

/* 兜底：任何情况下超过 3 秒未揭示的内容强制显示（见 main.js） */
.reveal-forced { opacity: 1 !important; transform: none !important; }

/* ---- 关键帧 --------------------------------------------------------------- */
@keyframes sk-shimmer {
  from { background-position: 120% 0; }
  to   { background-position: -120% 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

@keyframes core-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.14); opacity: 0.86; }
}

@keyframes slow-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes scroll-cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(250%); }
  100% { transform: translateY(250%); }
}

@keyframes flask-breath {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.92; }
  50%      { transform: translateY(-3px) scale(1.03); opacity: 1; }
}
[data-breath] svg { animation: flask-breath 4.2s var(--ease-in-out) infinite; }

@keyframes dust-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-26px, -20px, 0); }
}

/* ---- 减少动效偏好 --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero__scroll-line::after,
  .fcv-nodes .fcv-core,
  .featured-card__visual svg,
  [data-breath] svg,
  .contact-empty,
  .lab-banner__dust,
  .sk {
    animation: none !important;
  }
  .sk { background: var(--surface); }
  .js:not(.motion-ready) [data-reveal],
  .js:not(.motion-ready) [data-reveal-lines] .line,
  .reveal-css {
    opacity: 1;
    transform: none;
  }
  .featured-card,
  .research-card,
  .pain-card,
  .contact-card,
  .btn-lab,
  .btn { transition-duration: 1ms; }
}

/* ---- 打印 ---------------------------------------------------------------- */
@media print {
  .site-header, .chapter-rail, #cursor-canvas, .hero__canvas, .mobile-nav { display: none !important; }
  body { background: #fff; color: #000; }
}
