.bar {
  flex-shrink: 0;
  position: relative;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 12px 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.voiceArea {
  flex: 1;
  min-height: 48px;
  border: none;
  background: transparent;
  font-size: 32px;
  line-height: 48px;
  color: #1c1d1f;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;

  &:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
}

.voicePressing {
  color: #5471f6;
  background: rgba(84, 113, 246, 0.08);
  border-radius: 8px;
}

.voiceRecording {
  color: #5471f6;
  background: rgba(84, 113, 246, 0.08);
  border-radius: 8px;
  animation: voicePulse 1.2s ease-in-out infinite;
}

.voiceRecognizing {
  color: #8c8d91;
  cursor: wait;
}

.voiceError {
  color: #e53935;
  font-size: 26px;
}

@keyframes voicePulse {
  0%,
  100% {
    background: rgba(84, 113, 246, 0.06);
  }
  50% {
    background: rgba(84, 113, 246, 0.16);
  }
}

.textInput {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 8px;
  border: none;
  background: transparent;
  font-size: 32px;
  line-height: 48px;
  color: #1c1d1f;
  outline: none;
  -webkit-appearance: none;

  &::placeholder {
    color: #8c8d91;
  }
}

.stopBtn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.65;
  }
}

.modeToggle {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.65;
  }
}

/* ---------- 录音中动态波形覆盖区域 ---------- */

.voiceOverlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 8px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px 24px;
  animation: overlaySlideUp 0.2s ease-out;
  pointer-events: none;
}

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

.voiceOverlayListening {
  font-size: 28px;
  color: #1c1d1f;
  text-align: center;
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
  word-break: break-all;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}

.voiceOverlayHint {
  font-size: 24px;
  color: #5471f6;
  text-align: center;
}

.waveformContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 80px;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #5471f6 0%, #7B61FF 100%);
  border-radius: 40px;
  padding: 0 32px;
}

.waveformBar {
  display: inline-block;
  width: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  animation: waveformBounce 0.6s ease-in-out infinite alternate;
}

@keyframes waveformBounce {
  0% {
    height: 12px;
  }
  100% {
    height: 40px;
  }
}
