/* ============================================================
   cfj-admin · motion.css —— 动效层的 CSS 侧（与 js/motion.js 同一参数表）
   ────────────────────────────────────────────────────────────
   来源：上游 scaffold-master（MIT）动效参数表；缓动名 → cubic-bezier 对照
         与 motion.js 的 EASE/DUR 一一对应，两处必须同步改（有测试钉住名字）。
   边界：本文件【只新增，不覆盖】既有组件样式 —— 后台在 fad8fdd「VI 深色改版」里
         已有完整玻璃体系（tokens.css 的 --glass-* / --ease-spring），
         重画组件属视觉改版决策，不在"移植动画"这一步里夹带。
   ============================================================ */

:root {
  /* 与 motion.js EASE 表同源 */
  --motion-reveal: cubic-bezier(0.16, 1, 0.3, 1);        /* expo.out */
  --motion-glide:  cubic-bezier(0.22, 1, 0.36, 1);       /* power4.out */
  --motion-exit:   cubic-bezier(0.5, 0, 0.75, 0);        /* power2.in */
  --motion-swap:   cubic-bezier(0.645, 0.045, 0.355, 1); /* power2.inOut */
  --motion-settle: cubic-bezier(0.34, 1.4, 0.64, 1);     /* back.out(1.6) */

  /* 与 motion.js DUR 表同源（毫秒） */
  --motion-dur-press: 140ms;
  --motion-dur-release: 460ms;
  --motion-dur-hover-in: 340ms;
  --motion-dur-hover-out: 420ms;
  --motion-dur-slide: 520ms;
  --motion-dur-page-out: 180ms;
  --motion-dur-page-in: 620ms;
  --motion-dur-overlay-in: 420ms;
  --motion-dur-overlay-out: 200ms;
}

/* 指针跟随光斑：【选择性启用】—— 只对标了 .motion-glow 的元素加，
   不给 .card/.nav-item 全局挂 ::before，避免覆盖既有背景/圆角/层叠上下文。
   需要时给节点加 class 即可，不需要改 JS。 */
.motion-glow { position: relative; }
.motion-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-dur-hover-in) var(--motion-glide);
  background: radial-gradient(
    180px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    color-mix(in srgb, var(--accent, #4d7cff) 18%, transparent),
    transparent 70%
  );
}
.motion-glow:hover::before { opacity: 1; }

/* 🔒 无障碍总闸：系统「减弱动效」时，CSS 侧一并归零。
   （JS 侧 motion.js prefersReducedMotion() 已跳过 WAAPI 补间，这里覆盖纯 CSS 过渡。） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .motion-glow::before { transition: none; }
}
