/* =====================================================================
   animations.css —— 动效（克制）
   仅保留：页面进入 fade+slide、按钮轻反馈、徽章获得、图表首载。
   禁止：持续漂浮、大面积移动、炫光。
   ===================================================================== */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-in-right {
  from { opacity: 0.4; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer { to { background-position: -200% 0; } }

@keyframes ring-draw {
  from { stroke-dashoffset: var(--ring-len, 999); }
}

@keyframes award-pop {
  0% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  60% { opacity: 1; transform: scale(1.06) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes radar-in {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------------- 入场工具类 ---------------- */
.anim-fade { animation: fade-in var(--dur-slow) var(--ease) both; }
.anim-rise { animation: rise-in var(--dur-slow) var(--ease) both; }
.anim-scale { animation: scale-in var(--dur) var(--ease-spring) both; }

/* 视图中分组出场：由 JS 添加 .anim-rise 即可，无需交错漂浮 */

.radar-data { transform-box: fill-box; transform-origin: center; animation: radar-in 0.8s var(--ease-spring) both; }

/* 成长环：首载逐环绘制 */
.ring-arc { transition: stroke-dashoffset 0.9s var(--ease-spring); }

/* 徽章获得动画 */
.badge.earned .badge-medal { animation: award-pop 0.55s var(--ease-spring) both; }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
