/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* --- Tick Slider (带刻度的自定义滑块) --- */
.tick-slider {
  -webkit-appearance: none;
  background: transparent;
}

.tick-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 24px;
  cursor: pointer;
  background:
    repeating-linear-gradient(to right,
      #333,
      #333 2px,
      transparent 2px,
      transparent 10%);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.tick-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 8px;
  border-radius: 4px;
  background: #f43f5e;
  cursor: pointer;
  margin-top: 3px;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
  transform: translateY(0);
  transition: transform 0.1s;
  position: relative;
  z-index: 20;
}

.tick-slider:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

.tick-slider:focus {
  outline: none;
}

/* Toggle Button Styles */
.toggle-btn {
  @apply text-xs px-4 py-2 rounded-md text-textSub transition-all duration-300 relative z-10;
}

.toggle-btn.selected {
  @apply text-white bg-[#2a2a2a] font-bold shadow-sm;
}

/* Tag Pill */
.tag-pill {
  padding: 0.25rem 0.75rem;
  background-color: #1e1e1e;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid #2a2a2a;
  color: #a1a1a1;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
}

.tag-pill:hover {
  background-color: #374151;
  color: white;
  border-color: #4b5563;
}

/* --- 浮动播放器状态样式 --- */
#floatingPlayer.expanded {
  width: 700px !important;
  height: 80px !important;
  border-radius: 16px !important;
}

#floatingPlayer.expanded #playerCollapsedState {
  opacity: 0;
  pointer-events: none;
}

#floatingPlayer.expanded #playerExpandedState {
  opacity: 1;
  pointer-events: auto;
}

/* --- 动画 --- */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin 8s linear infinite;
}

@keyframes pulse-dance {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

.animate-pulse-dance {
  animation: pulse-dance 1.5s ease-in-out infinite;
}

@keyframes note-fly-1 {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
  }

  20% {
    opacity: 1;
    transform: translate(-30px, -15px) rotate(-10deg);
  }

  100% {
    opacity: 0;
    transform: translate(-60px, -30px);
  }
}

.animate-note-fly-1 {
  animation: note-fly-1 4s linear infinite 0.5s;
}

@keyframes note-fly-2 {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }

  30% {
    opacity: 1;
    transform: translate(30px, 15px);
  }

  100% {
    opacity: 0;
    transform: translate(60px, 30px);
  }
}

.animate-note-fly-2 {
  animation: note-fly-2 5s linear infinite 1.2s;
}

@keyframes note-fly-3 {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }

  50% {
    opacity: 1;
    transform: translate(-5px, 5px);
  }

  100% {
    opacity: 0;
  }
}

.animate-note-fly-3 {
  animation: note-fly-3 3s ease-out infinite 0.1s;
}

@keyframes float-up-down {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.animate-float-slow {
  animation: float-up-down 4s ease-in-out infinite;
}

/* --- 修复下拉框样式 (添加到文件最底部) --- */
#modelSelect {
  background-color: transparent;
  color: #a1a1a1;
  /* 默认灰色 */
  transition: color 0.3s;
}

#modelSelect:hover {
  color: #ffffff;
}

/* 关键：强制下拉选项为深色背景，防止出现白色方块 */
#modelSelect option {
  background-color: #121212;
  /* 与侧边栏颜色一致 */
  color: #ececec;
  padding: 8px;
}

/* Toggle Button Styles */
.toggle-btn {
  /* 使用标准 CSS 替代 @apply 以确保覆盖准确 */
  font-size: 0.75rem;
  /* text-xs */
  padding: 0.5rem 1rem;
  /* px-4 py-2 */
  border-radius: 0.375rem;
  /* rounded-md */
  color: #a1a1a1;
  /* text-textSub */
  transition: all 0.3s;
  position: relative;
  z-index: 10;
  border: 1px solid transparent;
  /* 预留边框位置防止跳动 */
}

.toggle-btn:hover {
  color: #ececec;
  background-color: rgba(255, 255, 255, 0.05);
}

.toggle-btn.selected {
  /* [修改] 选中样式：红框 + 红色文字/高亮 */
  color: #ececec;
  border-color: #f43f5e;
  /* primary color red */
  background-color: rgba(244, 63, 94, 0.1);
  /* 淡淡的红色背景 */
  font-weight: bold;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.1);
}

/* --- 确保底部按钮层级最高 --- */
aside .shrink-0.z-50 {
  position: relative;
  z-index: 50;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  /* 加一点阴影增加层次感 */
}

/* --- 确保选中状态样式正确 (红框) --- */
.toggle-btn.selected {
  color: #ececec !important;
  border: 1px solid #f43f5e !important;
  /* 强制红色边框 */
  background-color: rgba(244, 63, 94, 0.15) !important;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.2);
}

/* 确保底部按钮层级最高 */
aside .shrink-0.z-50 {
  position: relative;
  z-index: 50;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   独立加载按钮样式 - 流光旋转 + 雷达扩散
   ============================================ */

/* 加载按钮容器 */
.glow-loading-btn {
  position: relative;
  width: 120px;
  height: 120px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 雷达扩散动画层 (在最底层) */
.glow-loading-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: radar-pulse 2s ease-out infinite;
  z-index: 1;
}

/* 旋转流光背景层 */
.glow-loading-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: conic-gradient(from 0deg,
      transparent 0%,
      rgba(59, 130, 246, 0.1) 25%,
      rgba(96, 165, 250, 0.4) 50%,
      rgba(147, 197, 253, 0.8) 75%,
      rgba(59, 130, 246, 1) 85%,
      rgba(59, 130, 246, 0.3) 95%,
      transparent 100%);
  border-radius: 50%;
  animation: glow-spin 2s linear infinite;
  filter: blur(8px);
  z-index: 2;
}

/* 内部遮罩层 - 创造流光环效果 */
.glow-loading-inner-mask {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  height: 75%;
  background: #1a1a1a;
  border-radius: 50%;
  z-index: 3;
}

/* 中心图标容器 */
.glow-loading-icon {
  position: relative;
  width: 50px;
  height: 50px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: icon-float 3s ease-in-out infinite;
}

/* 图标图片 */
.glow-loading-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
}

/* 旋转动画 */
@keyframes glow-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 雷达扩散动画 */
@keyframes radar-pulse {
  0% {
    width: 60%;
    height: 60%;
    opacity: 0.8;
  }

  50% {
    width: 100%;
    height: 100%;
    opacity: 0.4;
  }

  100% {
    width: 140%;
    height: 140%;
    opacity: 0;
  }
}

/* 图标悬浮动画 */
@keyframes icon-float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-5px) scale(1.05);
  }
}

/* 悬停效果 */
.glow-loading-btn:hover::after {
  animation: glow-spin 1s linear infinite;
  filter: blur(10px);
}

.glow-loading-btn:hover .glow-loading-icon {
  animation: icon-float 1.5s ease-in-out infinite;
}

/* 禁用状态 */
.glow-loading-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.glow-loading-btn:disabled::after {
  animation-play-state: paused;
}

/* 变体 - 小尺寸 */
.glow-loading-btn.size-small {
  width: 80px;
  height: 80px;
}

.glow-loading-btn.size-small .glow-loading-icon {
  width: 35px;
  height: 35px;
}

/* 变体 - 大尺寸 */
.glow-loading-btn.size-large {
  width: 160px;
  height: 160px;
}

.glow-loading-btn.size-large .glow-loading-icon {
  width: 70px;
  height: 70px;
}

/* ============================================
   API 状态灯样式
   ============================================ */

/* 状态灯按钮 */
.api-status-light {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: #ff9800; /* 默认橙色 */
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
  flex-shrink: 0;
}

/* 橙色状态 - 默认/未检测 */
.api-status-light.idle,
.api-status-light.has-data,
.api-status-light.offline {
  background: #ff9800;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

/* 绿色状态 - 连接成功 */
.api-status-light.success {
  background: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* 红色状态 - 连接失败 */
.api-status-light.error {
  background: #f44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* 悬停效果 */
.api-status-light:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* 点击效果 */
.api-status-light:active {
  transform: scale(0.95);
}

/* 脉动动画 - 用于加载状态 */
@keyframes status-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.api-status-light.loading {
  animation: status-pulse 1.5s ease-in-out infinite;
}

/* API 控制栏样式 */
.api-control-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 模型选择器样式 */
.api-model-select {
  background-color: transparent;
  color: #a1a1a1;
  transition: color 0.3s;
  outline: none;
}

.api-model-select:hover {
  color: #ffffff;
}

.api-model-select:focus {
  border-color: #f43f5e;
  color: #ffffff;
}

/* 下拉选项样式 */
.api-model-select option {
  background-color: #121212;
  color: #ececec;
  padding: 8px;
}

.api-model-select optgroup {
  background-color: #0a0a0a;
  color: #f43f5e;
  font-weight: bold;
}

/* 确认按钮样式 */
.btn-confirm-api {
  transition: all 0.2s ease;
}

.btn-confirm-api:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.btn-confirm-api:active {
  transform: translateY(0);
}