/* ============================================================
 * 灵音托管引擎自动化工作台 - FAB 悬浮按钮组件 (comp-fab-float-button.css)
 * 抽取自原 index.html，含主按钮 + 抽屉子按钮 + 呼吸灯动画
 * 使用：.fab-drag-container / .fab-main-btn / .fab-item
 * ============================================================ */

/* ===== FAB 外层拖拽容器 ===== */
.fab-drag-container {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1000 !important;
  cursor: move;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto !important;
}

/* 拖拽后使用 right 定位 */
.fab-drag-container.fab-dragged {
  left: auto !important;
  transform: none !important;
}

/* ===== FAB 抽屉面板 ===== */
.fab-drawer {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  min-width: 180px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fab-drawer.open {
  display: flex;
}

/* FAB 抽屉滚动条 */
.fab-drawer::-webkit-scrollbar {
  width: 3px;
}
.fab-drawer::-webkit-scrollbar-track {
  background: transparent;
}
.fab-drawer::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* ===== FAB 子按钮统一样式 ===== */
.fab-item {
  width: auto;
  height: auto;
  min-width: 46px;
  min-height: 46px;
  border-radius: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  padding: 8px 14px 8px 12px;
}

.fab-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
  border-color: var(--accent-cyan);
}

.fab-item:active {
  transform: scale(0.95);
}

/* FAB 子按钮标签 */
.fab-item-label {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  font-weight: 500;
}

.fab-item:hover .fab-item-label {
  color: var(--accent-cyan);
}

/* ===== FAB 主麦克风大按钮 ===== */
.fab-main-btn {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #00c0ff, #0078ff) !important;
  border: none !important;
  color: #fff !important;
  font-size: 22px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.45) !important;
  position: relative !important;
  overflow: hidden !important;
  animation: breathePulse 3s ease-in-out infinite !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.fab-main-btn:hover {
  transform: scale(1.16);
  box-shadow: 0 8px 36px rgba(59, 130, 246, 0.65);
}

.fab-main-btn:active {
  transform: scale(0.93);
}

/* ===== FAB 状态变体 ===== */

/* 监听状态 - 青色呼吸 */
.fab-main-btn.jarvis-listening {
  box-shadow:
    0 0 40px rgba(6, 182, 212, 0.8),
    0 0 80px rgba(6, 182, 212, 0.3);
  animation: jarvisListeningPulse 0.8s ease-in-out infinite;
}

/* 说话状态 - 绿色呼吸 */
.fab-main-btn.jarvis-speaking {
  box-shadow:
    0 0 40px rgba(34, 197, 94, 0.6),
    0 0 80px rgba(34, 197, 94, 0.2);
  animation: speakPulse 1.2s ease-in-out infinite;
}

/* 玻璃态变体 */
.fab-main-btn.glass-bg {
  background: rgba(59, 130, 246, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== FAB 动画定义 ===== */
@keyframes breathePulse {
  0%, 100% {
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 4px 36px rgba(59, 130, 246, 0.7), 0 0 60px rgba(59, 130, 246, 0.15);
  }
}

@keyframes jarvisListeningPulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
  }
  50% {
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.9), 0 0 100px rgba(6, 182, 212, 0.3);
  }
}

@keyframes speakPulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.7);
  }
}

/* ===== FAB 移动端适配 ===== */
@media (max-width: 480px) {
  .fab-drag-container {
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
  }

  .fab-drawer {
    padding: 10px;
    gap: 6px;
    min-width: 160px;
  }

  .fab-item {
    min-width: 40px;
    min-height: 40px;
    padding: 6px 10px 6px 8px;
    gap: 4px;
    border-radius: 10px;
  }

  .fab-item-label {
    font-size: 12px;
  }

  .fab-main-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}
