/* 浮动麦克风按钮 */
.voice-btn {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--md3-primary, #0D9488);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--elevation-2, 0 2px 6px rgba(0,0,0,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.voice-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--elevation-3, 0 4px 12px rgba(0,0,0,0.2));
}

.voice-btn:active {
  transform: scale(0.95);
}

.voice-btn.recording {
  background: #EF4444;
  animation: pulse 1.5s infinite;
  transform: scale(1.1);
}

.voice-btn.processing {
  background: #6B7280;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1.1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

/* 语音填充高亮 */
.voice-filled {
  border-color: #10B981 !important;
  background-color: #F0FDF4 !important;
  transition: all 0.3s ease;
  animation: voiceHighlight 0.5s ease;
}

@keyframes voiceHighlight {
  0% {
    background-color: transparent;
    transform: scale(1);
  }
  50% {
    background-color: #D1FAE5;
    transform: scale(1.02);
  }
  100% {
    background-color: #F0FDF4;
    transform: scale(1);
  }
}

/* 结果弹窗 */
.voice-result-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-result-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--elevation-4, 0 8px 24px rgba(0,0,0,0.2));
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voice-result-content h3 {
  margin: 0 0 16px 0;
  color: var(--md3-on-surface, #1F2937);
  font-size: 18px;
  font-weight: 600;
}

.transcript-box, .fields-box {
  margin-bottom: 16px;
}

.transcript-box label, .fields-box label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--md3-on-surface-variant, #6B7280);
  font-size: 14px;
}

.transcript-box textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--md3-outline, #D1D5DB);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  background: #F9FAFB;
  color: var(--md3-on-surface, #1F2937);
}

.fields-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fields-box li {
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  border-left: 3px solid #10B981;
}

.fields-box li strong {
  color: var(--md3-primary, #0D9488);
  margin-right: 8px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions button {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-confirm {
  background: var(--md3-primary, #0D9488);
  color: white;
}

.btn-confirm:hover {
  background: #0B7F74;
}

.btn-retry {
  background: #F3F4F6;
  color: var(--md3-on-surface, #1F2937);
}

.btn-retry:hover {
  background: #E5E7EB;
}

/* Toast 提示 */
.voice-toast {
  position: fixed;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 3000;
  box-shadow: var(--elevation-3, 0 4px 12px rgba(0,0,0,0.2));
}

.voice-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
  .voice-btn {
    bottom: 80px;
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .voice-result-content {
    padding: 20px;
    max-width: 95%;
  }

  .voice-toast {
    bottom: 150px;
    font-size: 13px;
    padding: 10px 20px;
  }
}
