/* 语音输入模式样式 */

/* 语音模式切换按钮 */
.voice-mode-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.voice-mode-toggle .icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.voice-mode-toggle:hover .icon {
    color: var(--text-primary);
}

/* 语音模式激活状态 */
.voice-mode-toggle.active {
    background: #f0f7ff;
}

.voice-mode-toggle.active .icon {
    color: #3b82f6;
}

/* 图标切换 - 键盘模式显示小喇叭 */
.voice-mode-toggle:not(.active) .icon-voice {
    display: block !important;
}

.voice-mode-toggle:not(.active) .icon-keyboard {
    display: none !important;
}

/* 图标切换 - 语音模式显示键盘 */
.voice-mode-toggle.active .icon-voice {
    display: none !important;
}

.voice-mode-toggle.active .icon-keyboard {
    display: block !important;
}

/* 语音输入模式下的输入框容器 */
.input-outer-container.voice-mode {
    background: #f7f8fa;
    border-color: #3b82f6;
}

/* 按住说话按钮 */
.press-to-speak-btn {
    width: 100%;
    min-height: 40px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0 16px;
}

.press-to-speak-btn:active {
    transform: scale(0.98);
}

.press-to-speak-btn .icon-wrapper {
    width: 36px;
    height: 36px;
    background: #f0f7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.press-to-speak-btn .icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.press-to-speak-btn .text {
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
}

/* 按住状态 */
.press-to-speak-btn.pressing {
    background: #f0f7ff;
    border-color: #3b82f6;
    transform: scale(0.98);
}

.press-to-speak-btn.pressing .icon-wrapper {
    background: #3b82f6;
    animation: pulse 1.5s ease-in-out infinite;
}

.press-to-speak-btn.pressing .icon {
    color: white;
}

.press-to-speak-btn.pressing .text {
    color: #3b82f6;
}

/* 录音中的波形动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* 语音识别中的提示 */
.voice-recording-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #1f2937;
    padding: 40px 60px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.voice-recording-indicator .wave-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60px;
}

.voice-recording-indicator .wave-bar {
    width: 4px;
    background: #3b82f6;
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.voice-recording-indicator .wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.voice-recording-indicator .wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-recording-indicator .wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-recording-indicator .wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.voice-recording-indicator .wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 50px;
    }
}

.voice-recording-indicator .text {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.voice-recording-indicator .hint {
    font-size: 14px;
    color: #6b7280;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .voice-mode-toggle {
        width: 36px;
        height: 36px;
    }
    
    .voice-mode-toggle .icon {
        width: 18px;
        height: 18px;
    }
    
    .press-to-speak-btn {
        min-height: 40px;
        font-size: 15px;
    }
    
    .press-to-speak-btn .icon-wrapper {
        width: 32px;
        height: 32px;
    }
    
    .press-to-speak-btn .icon {
        width: 18px;
        height: 18px;
    }
    
    .press-to-speak-btn .text {
        font-size: 14px;
    }
    
    .voice-recording-indicator {
        padding: 30px 40px;
    }
    
    .voice-recording-indicator .text {
        font-size: 16px;
    }
}

/* 小屏幕优化 */
@media (max-width: 375px) {
    .voice-mode-toggle {
        width: 32px;
        height: 32px;
    }
    
    .voice-mode-toggle .icon {
        width: 16px;
        height: 16px;
    }
    
    .press-to-speak-btn {
        min-height: 35px;
        font-size: 14px;
    }
    
    .press-to-speak-btn .icon-wrapper {
        width: 28px;
        height: 28px;
    }
    
    .press-to-speak-btn .icon {
        width: 16px;
        height: 16px;
    }
}

/* 隐藏键盘输入模式下的元素 */
.input-outer-container.voice-mode .input-textarea-box {
    display: none;
}

/* 显示语音输入模式下的元素 */
.input-outer-container.voice-mode .press-to-speak-container {
    display: block;
}

.input-outer-container:not(.voice-mode) .press-to-speak-container {
    display: none;
}

/* 语音模式下的工具栏调整 */
.input-outer-container.voice-mode .input-bottom-toolbar {
    display: flex;
}

/* 语音模式下隐藏深度思考和加号按钮 */
.input-outer-container.voice-mode .deep-thinking-btn,
.input-outer-container.voice-mode #addBtn {
    display: none;
}
