/* TTS语音播放器样式 */

/* 语音控制容器 */
.voice-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
}

/* 播放按钮样式 */
.voice-play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.voice-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.voice-play-btn:active {
    transform: translateY(0);
}

.voice-play-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 语音就绪状态 */
.voice-play-btn.tts-ready {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    box-shadow: 0 2px 8px rgba(0, 200, 81, 0.3);
    animation: pulse-ready 2s infinite;
}

.voice-play-btn.tts-ready:hover {
    box-shadow: 0 4px 12px rgba(0, 200, 81, 0.4);
}

/* 语音错误状态 */
.voice-play-btn.tts-error {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

/* 就绪状态脉动动画 */
@keyframes pulse-ready {
    0% {
        box-shadow: 0 2px 8px rgba(0, 200, 81, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 200, 81, 0.6);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 200, 81, 0.3);
    }
}

/* 设置按钮样式 */
.voice-settings-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 18px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(240, 147, 251, 0.3);
}

.voice-settings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(240, 147, 251, 0.4);
}

/* 设置面板模态框 */
.tts-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

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

.tts-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tts-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tts-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.tts-modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.tts-modal-close:hover {
    opacity: 0.7;
}

.tts-modal-body {
    padding: 20px;
    background: white;
    color: #333;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.setting-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #667eea;
}

.tts-modal-footer {
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e1e5e9;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Toast 提示样式 */
.tts-toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    max-width: 300px;
    word-wrap: break-word;
}

.tts-toast-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.tts-toast-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
}

.tts-toast-info {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tts-modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .tts-modal-header {
        padding: 15px;
    }
    
    .tts-modal-body {
        padding: 15px;
    }
    
    .tts-modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .voice-container {
        justify-content: flex-start;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .tts-modal-content {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .tts-modal-body {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .setting-group label {
        color: #cbd5e0;
    }
    
    .setting-group select {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .setting-group select:focus {
        border-color: #667eea;
    }
    
    .setting-group input[type="range"] {
        background: #4a5568;
    }
    
    .tts-modal-footer {
        background: #2d3748;
        border-top-color: #4a5568;
    }
}

/* 动画效果增强 */
.voice-play-btn {
    position: relative;
    overflow: hidden;
}

.voice-play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.voice-play-btn:active::before {
    width: 100px;
    height: 100px;
}

/* 加载状态动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.voice-play-btn:disabled {
    animation: spin 1s linear infinite;
}

/* 可访问性支持 */
.voice-play-btn:focus,
.voice-settings-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.setting-group select:focus,
.setting-group input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .voice-play-btn,
    .voice-settings-btn {
        border: 2px solid #000;
    }
    
    .tts-modal-content {
        border: 2px solid #000;
    }
}