/* ============================================================
   withU 全站 UI 动效 — 基于 Motion.Lab 动效库
   (https://motionlab.uanx.online · github.com/yangxu128/Motion.Lab)
   覆盖前台 / 后台 / 观影站三区，低干扰通用效果：
   hover-lift / hover-glow / button-press / fade-in-up /
   gradient-shift / scroll-reveal
   所有规则限定在 .withu-motion 作用域内，避免影响既有布局
   ============================================================ */

/* --- hover-lift：悬停上浮（卡片、按钮、列表项通用） --- */
.withu-motion .withu-motion-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.withu-motion .withu-motion-lift:hover {
  transform: translateY(calc(var(--motion-lift, 6px) * -1));
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

/* --- hover-glow：悬停发光（图标按钮、入口） --- */
.withu-motion .withu-motion-glow {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.withu-motion .withu-motion-glow:hover {
  box-shadow: 0 0 var(--motion-glow, 24px) rgba(255, 143, 163, 0.55);
  transform: translateY(-2px);
}

/* --- button-press：按下缩放反馈 --- */
.withu-motion .withu-motion-press:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

/* --- fade-in-up：入场动画（页面主要区块加载时） --- */
.withu-motion .withu-motion-enter {
  animation: withuFadeInUp var(--motion-duration, 0.7s) ease-out both;
}
@keyframes withuFadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- gradient-shift：渐变流动（装饰条、封面覆盖层） --- */
.withu-motion .withu-motion-gradient {
  background: linear-gradient(270deg, #ff8fa3, #ffc3a0, #a0c4ff, #ff8fa3);
  background-size: 800% 800%;
  animation: withuGradientShift var(--motion-grad-duration, 8s) ease infinite;
}
@keyframes withuGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- scroll-reveal：滚动揭示（进入视口上滑淡入，由 JS 添加 .withu-motion-in） --- */
.withu-motion .withu-motion-scroll {
  opacity: 0;
  transform: translateY(var(--motion-distance, 32px));
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.withu-motion .withu-motion-scroll.withu-motion-in {
  opacity: 1;
  transform: translateY(0);
}

/* --- 尊重系统减弱动效偏好 --- */
@media (prefers-reduced-motion: reduce) {
  .withu-motion .withu-motion-lift,
  .withu-motion .withu-motion-glow,
  .withu-motion .withu-motion-press,
  .withu-motion .withu-motion-gradient,
  .withu-motion .withu-motion-scroll {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
