/* 小云CEO - 语音气泡样式 */

/* 气泡容器 */
.voice-bubble {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  margin: 8px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.voice-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

/* 头像 */
.bubble-avatar {
  flex-shrink: 0;
}

.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.avatar-small.ceo {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  border: 2px solid #FFD700;
}

/* 气泡内容 */
.bubble-content {
  flex: 1;
  background: var(--bg-card);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  position: relative;
  max-width: 80%;
}

/* 文本气泡 */
.text-bubble .bubble-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* 语音气泡 */
.audio-bubble .bubble-content {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  min-width: 120px;
}

/* 音波动画 */
.audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.audio-wave span {
  display: block;
  width: 3px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.audio-wave span:nth-child(1) { animation-delay: 0s; }
.audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 20px; }
}

/* 播放状态 */
.audio-bubble.playing .audio-wave span {
  animation-play-state: running;
}

.audio-bubble.done .audio-wave span {
  animation-play-state: paused;
  height: 8px;
}

.audio-bubble.error .audio-wave span {
  background: var(--danger);
}

/* 时间戳 */
.bubble-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: right;
}

/* 聊天区域 */
#chatArea {
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* 用户消息 */
.voice-bubble.user {
  flex-direction: row-reverse;
}

.voice-bubble.user .bubble-content {
  background: var(--bg-surface);
  border-radius: 16px 16px 4px 16px;
}

.voice-bubble.user .bubble-time {
  text-align: left;
}

/* 打字指示器 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* 响应式 */
@media (max-width: 480px) {
  .bubble-content {
    max-width: 85%;
  }
  
  .voice-bubble {
    padding: 8px 12px;
  }
}
