/* 语音消息样式 */

.voice-waveform {
    display: none;
    width: 80px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    margin-right: 8px;
}

.recording-time {
    display: none;
    color: #ff4444;
    font-size: 0.9em;
}

.recording .voice-waveform,
.recording .recording-time {
    display: block;
}


/* 更新后的语音消息样式 */
.voice-message {
    max-width: 25%; /* 原宽度1/4 */
    margin-left: auto; /* 靠右对齐 */
    padding: 10px 16px;
    background: linear-gradient(135deg, #07c160, #05a050); /* 与用户消息一致 */
    border-radius: 20px;
    color: white;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
}

.voice-message:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
    background: linear-gradient(135deg, #06b057, #049048);
}

.voice-icon {
    width: 20px;
    height: 20px;
    fill: rgba(255,255,255,0.9);
    margin-left: 8px; /* 图标换到右侧 */
    flex-shrink: 0;
}

.voice-duration {
    font-size: 0.85em;
    margin-right: auto; /* 时间显示在左侧 */
    opacity: 0.9;
}

/* 录音状态指示器 */
.recording .voice-waveform div {
    background: rgba(255,255,255,0.8);
    animation: wave 0.8s infinite;
}

@keyframes wave {
    0% { height: 30%; }
    50% { height: 80%; }
    100% { height: 30%; }
}

/* 播放状态指示 */
.voice-message.playing .voice-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 移动端优化 */
@media (max-width: 480px) {
    .voice-message {
        max-width: 50%;
        padding: 8px 12px;
    }
    
    .voice-icon {
        width: 18px;
        height: 18px;
    }
}










/* CSS样式添加 */
/* 新增/替换的CSS样式 */
.voice-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.voice-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.mic-icon {
    width: 24px;
    height: 24px;
    fill: #fff;
    transition: transform 0.2s ease;
}

.voice-btn.recording {
    background: #ff4444;
    animation: mic-pulse 1.5s infinite;
}

.voice-btn.recording .mic-icon {
    transform: scale(1.1);
}

@keyframes mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(255, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

.recording-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.recording-duration {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-family: monospace;
    color: #fff;
    background: rgba(0,0,0,0.8);
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.voice-btn.recording .recording-indicator,
.voice-btn.recording .recording-duration {
    opacity: 1;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    .voice-btn {
        background: #1976D2;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    .voice-btn:hover {
        background: #1565C0;
    }
    .voice-btn.recording {
        background: #ff4444;
    }
    .recording-duration {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }
}

}









//语音转文字

.transcript-box {
    margin-top: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border-left: 3px solid #07c160;
}

.transcript-box p {
    margin: 8px 0 0 0;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
}

.transcribe-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.transcribe-btn:hover {
    background: rgba(255,255,255,0.2);
}


