/**
 * 语音UI样式
 */

.voice-ui {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* 录音区域 */
.voice-record-section {
  text-align: center;
}

.voice-btn {
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.voice-record-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.voice-record-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.voice-record-btn:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.voice-btn-text {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
  user-select: none;
}

/* 录音状态 */
.voice-recording-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 波形动画 */
.voice-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 30px;
}

.wave-bar {
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
  animation-delay: 0s;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0%, 100% {
    height: 5px;
  }
  50% {
    height: 25px;
  }
}

.voice-duration {
  font-size: 18px;
  font-weight: 600;
  color: #667eea;
  font-family: 'Courier New', monospace;
  min-width: 50px;
}

.voice-cancel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-cancel-btn:hover {
  background: #ff3838;
  transform: scale(1.05);
}

/* 播放区域 */
.voice-play-section {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.voice-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.voice-play-btn:hover {
  background: #5568d3;
  transform: scale(1.05);
}

.voice-progress-bar {
  flex: 1;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.voice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  transition: width 0.1s linear;
  width: 0;
}

.voice-time-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
  font-family: 'Courier New', monospace;
}

.voice-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

.voice-speed-btn,
.voice-volume-btn {
  padding: 6px 12px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #333;
  font-size: 12px;
  min-width: 50px;
}

.voice-speed-btn:hover,
.voice-volume-btn:hover {
  background: #e0e0e0;
}

/* 错误提示 */
.voice-error {
  display: none;
  padding: 10px;
  background: #ffe5e5;
  color: #d32f2f;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .voice-record-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .voice-waveform {
    height: 25px;
  }

  .wave-bar {
    width: 3px;
  }

  .voice-duration {
    font-size: 16px;
  }

  .voice-controls {
    flex-wrap: wrap;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .voice-ui {
    background: #2d2d2d;
  }

  .voice-recording-status,
  .voice-play-section {
    background: #3a3a3a;
    color: #e0e0e0;
  }

  .voice-progress-bar {
    background: #4a4a4a;
  }

  .voice-time-info {
    color: #b0b0b0;
  }

  .voice-speed-btn,
  .voice-volume-btn {
    background: #4a4a4a;
    color: #e0e0e0;
  }

  .voice-speed-btn:hover,
  .voice-volume-btn:hover {
    background: #5a5a5a;
  }

  .voice-btn-text {
    color: #b0b0b0;
  }
}
