/**
 * TTS语音播放器样式
 */

/* TTS播放器模态窗口 */
.tts-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.tts-player-dialog {
    background: #fff;
    border-radius: 16px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.2s ease;
}

.tts-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border-radius: 16px 16px 0 0;
}

.tts-player-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.tts-player-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tts-player-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tts-player-body {
    padding: 24px;
}

/* 模型选择 */
.tts-model-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tts-model-option {
    flex: 1;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
}

.tts-model-option:hover {
    border-color: #0891b2;
}

.tts-model-option.active {
    border-color: #0891b2;
    background: #ecfeff;
}

.tts-model-option .model-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.tts-model-option .model-desc {
    font-size: 12px;
    color: #64748b;
}

.tts-model-option .model-cost {
    font-size: 13px;
    font-weight: 600;
    color: #0891b2;
    margin-top: 6px;
}

/* 费用信息 */
.tts-cost-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.tts-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    padding: 4px 0;
}

.tts-cost-row .cost-value {
    font-weight: 600;
    color: #1e293b;
}

.tts-cost-row.total {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 10px;
    font-size: 15px;
}

.tts-cost-row.total .cost-value {
    color: #0891b2;
    font-size: 18px;
}

/* 音色选择 */
.tts-voice-section {
    margin-bottom: 20px;
}

.tts-voice-section label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.tts-voice-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
}

/* 操作按钮 */
.tts-actions {
    display: flex;
    gap: 12px;
}

.tts-btn-synthesize {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tts-btn-synthesize:hover {
    opacity: 0.9;
}

.tts-btn-synthesize:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 播放器区域 */
.tts-audio-player {
    margin-top: 20px;
    padding: 16px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 10px;
}

.tts-audio-player audio {
    width: 100%;
    margin-top: 8px;
}

.tts-audio-label {
    font-size: 13px;
    color: #0d9488;
    font-weight: 500;
    margin-bottom: 8px;
}

/* 进度提示 */
.tts-progress {
    margin-top: 16px;
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.tts-progress .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #0891b2;
    border-radius: 50%;
    animation: ttsSpinner 0.8s linear infinite;
}

.tts-progress .progress-text {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}

@keyframes ttsSpinner {
    to { transform: rotate(360deg); }
}

/* 错误提示 */
.tts-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    color: #dc2626;
}

/* 积分不足提示 */
.tts-points-warning {
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 16px;
}

/* ========== 深色模式适配 ========== */
body.dark-mode .tts-player-dialog { background: #16213e; }
