/* ═══════════════ 悬浮球 — API 快捷切换 ═══════════════ */

.floating-ball {
  position: fixed;
  right: 16px;
  bottom: 120px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8FAFBF, #6d8d9f);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.1);
  user-select: none;
  touch-action: none;
  transition: opacity 0.2s, transform 0.2s, width 0.2s, height 0.2s, font-size 0.2s;
  overflow: hidden;
  letter-spacing: 0.5px;
}
.floating-ball::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3) 0%, transparent 60%);
  pointer-events: none;
}
.floating-ball:active {
  transform: scale(0.92);
}
.floating-ball.dragging {
  opacity: 0.85;
  transform: scale(1.05);
  transition: none;
}

/* 最小化状态 */
.floating-ball.minimized {
  width: 32px;
  height: 32px;
  font-size: 9px;
  opacity: 0.7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.floating-ball.minimized:hover,
.floating-ball.minimized:active {
  opacity: 1;
}

/* ═══════════════ 菜单面板 ═══════════════ */

.floating-ball-menu {
  position: fixed;
  bottom: 180px;
  right: 16px;
  width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  background: #2a3040;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 9998;
  padding: 8px 0;
  display: none;
  animation: fbMenuIn 0.2s ease-out;
}
.floating-ball-menu.show {
  display: block;
}
@keyframes fbMenuIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-ball-menu-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #c4c9d0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.floating-ball-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.floating-ball-menu-item:hover,
.floating-ball-menu-item:active {
  background: var(--hover-bg, rgba(255,255,255,0.06));
}

.floating-ball-menu-item .fb-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.floating-ball-menu-item.active .fb-active-dot {
  opacity: 1;
}
.floating-ball-menu-item .fb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floating-ball-menu-item .fb-model {
  font-size: 11px;
  color: #b0b8c0;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-ball-menu-divider {
  height: 1px;
  margin: 6px 12px;
  background: var(--border, rgba(255,255,255,0.08));
}

.floating-ball-menu-footer {
  padding: 4px 16px 8px;
}
.floating-ball-menu-footer button {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: transparent;
  color: #b0b8d0;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.floating-ball-menu-footer button:hover {
  background: var(--hover-bg, rgba(255,255,255,0.06));
}

/* 菜单遮罩（点击外部关闭） */
.floating-ball-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9997;
  /* 透明，只用于捕获点击 */
}

/* ═══════════════ 轻量 Toast ═══════════════ */

.floating-ball-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: #2a3040;
  color: #f0f0f0;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.floating-ball-toast.show {
  opacity: 1;
}

/* ═══════════════ 响应式 ═══════════════ */

@media (max-width: 480px) {
  .floating-ball {
    right: 10px;
    bottom: 100px;
    width: 44px;
    height: 44px;
    font-size: 11px;
  }
  .floating-ball.minimized {
    width: 28px;
    height: 28px;
    font-size: 8px;
  }
  .floating-ball-menu {
    right: 8px;
    bottom: 160px;
    width: 260px;
  }
}
