/* ==================== 语音通话 ==================== */

.chat-room-actions .chat-voice-call-btn {
  color: #059669;
}

.chat-room-actions .chat-voice-call-btn:hover {
  border-color: #10b981;
  color: #047857;
  background: rgba(16, 185, 129, 0.1);
}

.voice-call-panel {
  position: fixed;
  left: auto;
  top: auto;
  right: 24px;
  bottom: 24px;
  z-index: 2147482600;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.voice-call-card {
  width: min(342px, calc(100vw - 24px));
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}

.voice-call-card.incoming {
  border-color: rgba(16, 185, 129, 0.45);
}

.voice-call-drag {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
}

.voice-call-drag:active {
  cursor: grabbing;
}

.voice-call-drag-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-secondary, #64748b);
}

.voice-call-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  font-weight: 900;
}

.voice-call-icon-btn:hover {
  background: #e2e8f0;
}

.voice-call-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.voice-call-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  color: white;
  font-size: 1rem;
  font-weight: 800;
}

.voice-call-main {
  min-width: 0;
  flex: 1;
}

.voice-call-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.voice-call-status {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
}

.voice-call-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.voice-call-action {
  height: 34px;
  min-width: 54px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  color: white;
}

.voice-call-action.accept {
  background: #10b981;
}

.voice-call-action.mute {
  background: #475569;
}

.voice-call-action.speaker {
  background: #2563eb;
}

.voice-call-action.speaker.on {
  background: #0f766e;
}

.voice-call-action.mute.muted {
  background: #0ea5e9;
}

.voice-call-action.end {
  background: #ef4444;
}

.voice-call-bubble {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #0f172a;
  color: white;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
  cursor: grab;
  pointer-events: auto;
}

.voice-call-bubble:active {
  cursor: grabbing;
}

.voice-call-bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  font-size: 0.86rem;
  font-weight: 900;
}

.voice-call-bubble-status {
  max-width: 58px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.68rem;
  font-weight: 800;
}

html.low-effects .voice-call-card,
html.desktop-mac .voice-call-card {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

@media (max-width: 768px) {
  .voice-call-panel {
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }

  .voice-call-card {
    width: min(330px, calc(100vw - 24px));
    border-radius: 14px;
  }

  .voice-call-action {
    min-width: 50px;
    padding: 0 10px;
  }
}
