/* 自定义Tailwind工具类 */
@layer utilities {
  /* 背景渐变动画 */
  .bg-gradient-animate {
    background: linear-gradient(135deg, #0F172A, #1E293B, #4C1D95, #0F172A);
    background-size: 400% 400%;
    animation: gradient 25s ease infinite;
  }
  /* 卡片悬浮效果 */
  .card-hover {
    @apply transition-all duration-300 hover:scale-[1.01] hover:shadow-xl hover:shadow-purple/20;
  }
  /* 漂浮动画 */
  .float-animation {
    animation: float 6s ease-in-out infinite;
  }
  .float-delay-1 { animation-delay: 0.5s; }
  .float-delay-2 { animation-delay: 1s; }
  .float-delay-3 { animation-delay: 1.5s; }
  .float-delay-4 { animation-delay: 2s; }
  .float-delay-5 { animation-delay: 2.5s; }
  /* AI分析加载动画 */
  .ai-loader {
    animation: pulse 1.5s infinite;
  }
  /* 选中指标高亮 */
  .selected-indicator {
    @apply bg-purple/20 border-purple text-purple text-purple;
  }
  /* Toast提示动画 */
  .toast-fade {
    animation: fadeInOut 2.5s ease forwards;
  }
  /* 点击反馈 */
  .indicator-tag {
    @apply cursor-pointer active:scale-95 transition-transform;
  }
}

/* 渐变背景动画 */
@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* 漂浮动画 */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}
/* 加载脉冲 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* Toast淡入淡出动画 */
@keyframes fadeInOut {
  0% { transform: translateY(-20px); opacity: 0; }
  20% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-20px); opacity: 0; }
}
/* 粒子背景 */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.1;
}
/* 拖拽区域样式 */
.drag-area {
  min-height: 120px;
  border: 2px dashed rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
}
.drag-area.active {
  border-color: rgba(139, 92, 246, 0.8);
  background-color: rgba(139, 92, 246, 0.05);
}
/* 指标标签样式 */
.indicator-tag {
  cursor: grab;
  transition: all 0.2s ease;
}
.indicator-tag:active {
  cursor: grabbing;
}

/* 音频开关动画 */
#audioToggle i {
  transition: all 0.2s ease;
}
#audioToggle:active i {
  transform: scale(0.9);
}
/* 定时任务脉冲动画 */
.timer-pulse {
  animation: timerPulse 2s ease-in-out infinite;
}
@keyframes timerPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(139, 92, 246, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

#timerTaskBtn i {
  animation: spin 2s linear infinite;
}
#timerTaskBtn:not(.running) i {
  animation: none;
}