@import "tailwindcss";
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));


/* 主题切换过渡动画 */
body {
  transition: background-color 300ms ease, color 300ms ease;
}

/* 主题切换时的特殊效果 */
body.theme-changing {
  transition: background-color 150ms ease, color 150ms ease;
}

/* 快速主题切换按钮增强 */
#quick-theme-toggle {
  transition: all 200ms ease;
  transform-origin: center;
}

#quick-theme-toggle:hover {
  transform: scale(1.05);
}

#quick-theme-toggle:active {
  transform: scale(0.95);
}

/* 平滑的图标过渡 */
[data-feather] {
  transition: transform 200ms ease;
}

/* 确保所有元素都有平滑的颜色过渡 */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* 视频和媒体元素不需要过渡 */
video, img, canvas, svg {
  transition: none !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-300 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-400 dark:bg-gray-500;
}

/* Radio 波形动画 */
@keyframes wave-bar {
  0%, 100% { transform: scaleY(0.3); }
  50%       { transform: scaleY(1); }
}
.audio-waveform {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.audio-waveform span {
  width: 5px;
  border-radius: 3px;
  background: currentColor;
  animation: wave-bar 1s ease-in-out infinite;
}
.audio-waveform span:nth-child(2) { animation-delay: 0.1s; }
.audio-waveform span:nth-child(3) { animation-delay: 0.2s; }
.audio-waveform span:nth-child(4) { animation-delay: 0.3s; }
.audio-waveform span:nth-child(5) { animation-delay: 0.4s; }
.audio-waveform.paused span { animation-play-state: paused; }

/* 焦点环优化 */
.focus-ring {
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800;
}

/* 通知和模态框的入场动画 */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 响应式设计优化 */
@media (max-width: 640px) {
  #quick-theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}