/* 多人配音功能样式 */

/* 多人配音段落容器 */
.multi-voice-segment {
    position: relative;
    margin: 10px 0;
    padding: 15px 20px 15px 45px;
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.multi-voice-segment:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* 不同主题的背景色 */
.multi-voice-segment.theme-1 {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left-color: #2196f3;
}

.multi-voice-segment.theme-2 {
    background: linear-gradient(135deg, #f3e5f5 0%, #fce4ec 100%);
    border-left-color: #e91e63;
}

.multi-voice-segment.theme-3 {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    border-left-color: #4caf50;
}

.multi-voice-segment.theme-4 {
    background: linear-gradient(135deg, #fff3e0 0%, #fef7e0 100%);
    border-left-color: #ff9800;
}

.multi-voice-segment.theme-5 {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1f5fe 100%);
    border-left-color: #9c27b0;
}

.multi-voice-segment.theme-6 {
    background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e8 100%);
    border-left-color: #009688;
}

/* 音色名字标签 */
.voice-tag-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.voice-name-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.voice-preview-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.voice-preview-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.voice-preview-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-preview-btn.playing {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    animation: pulse 1.5s infinite;
}

.voice-preview-btn.playing:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 0 8px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

.voice-preview-btn.loading {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    pointer-events: none;
}

.voice-preview-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* 删除按钮 */
.multi-voice-delete {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.multi-voice-delete:hover {
    opacity: 1;
    background: #cc0000;
    transform: scale(1.1);
}

.multi-voice-delete i {
    font-size: 10px;
}

/* 文本内容区域 */
.multi-voice-content {
    margin-top: 8px;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.multi-voice-content[contenteditable="true"] {
    outline: none;
    border: 1px dashed transparent;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.multi-voice-content[contenteditable="true"]:focus {
    border-color: #2196f3;
    background: rgba(255, 255, 255, 0.8);
}

/* 参数控制区域 */
.multi-voice-params {
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 情绪控制样式 */
.emotion-control {
    flex: 1;
    min-width: 200px;
}

.emotion-selects {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.emotion-selects select {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 12px;
}

.emotion-selects select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.emotion-selects select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.param-control {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-control label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.param-value {
    font-weight: 600;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    min-width: 30px;
    text-align: center;
}

.param-control input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.param-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2196f3;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.param-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #1976d2;
    transform: scale(1.1);
}

.param-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2196f3;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.param-control input[type="range"]::-moz-range-thumb:hover {
    background: #1976d2;
    transform: scale(1.1);
}

/* 选中文本高亮样式 */
.text-selection-highlight {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 2px;
    padding: 1px 2px;
}

/* 多人配音按钮激活状态 */
.tool-btn.multi-voice-active {
    background: #2196f3;
    color: white;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* 文本编辑器增强样式 */
.text-editor.multi-voice-mode {
    border: 2px solid #2196f3;
    border-radius: 8px;
}

.text-editor.multi-voice-mode .editor-content {
    padding: 10px;
}

/* 提示信息 */
.multi-voice-hint {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.multi-voice-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
}

.multi-voice-segment:hover .multi-voice-hint {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .multi-voice-segment {
        padding: 12px 15px 12px 35px;
        margin: 8px 0;
    }
    
    .multi-voice-delete {
        width: 20px;
        height: 20px;
        top: 6px;
        left: 6px;
        font-size: 10px;
    }
    
    .voice-name-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .multi-voice-content {
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.multi-voice-segment.new {
    animation: slideInFromLeft 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.multi-voice-segment.removing {
    animation: fadeOut 0.2s ease-out;
}

/* 空状态提示 */
.multi-voice-empty-hint {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 10px 0;
    background: #f9f9f9;
}

.multi-voice-empty-hint i {
    font-size: 24px;
    color: #ccc;
    margin-bottom: 8px;
}

/* 克隆音色参数控制样式 */
.clone-model-control,
.clone-tone-mode-control,
.clone-speed-control {
    margin-bottom: 8px;
}

.clone-model-control label,
.clone-tone-mode-control label,
.clone-speed-control label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.clone-model-select,
.clone-tone-mode-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    color: #333;
}

.clone-speed-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.clone-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.clone-speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.clone-speed-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 情绪参数控制样式 */
.clone-emotion-params {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.clone-emotion-params label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.emotion-sliders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.emotion-slider-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.emotion-label {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.emotion-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.emotion-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.emotion-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.emotion-value {
    font-size: 11px;
    color: #667eea;
    font-weight: 500;
    text-align: right;
}
