/**
 * 音频生成模块样式
 */

/* 主容器 */
.audio-generation-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 标题 */
.audio-generation-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.audio-generation-container h2 {
    color: #444;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* 输入区域 */
.input-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #4a90d9;
}

/* 参数调节 */
.params-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.param-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-item label {
    width: 60px;
    color: #666;
    font-size: 14px;
}

.param-item input[type="range"] {
    flex: 1;
    margin: 0 15px;
    height: 6px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.param-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
}

.param-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.param-value {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #4a90d9;
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-download {
    background: #4a90d9;
    color: white;
    border: none;
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #3a7bc8;
}

/* 状态显示 */
.status-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 100px;
}

.task-status {
    text-align: center;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-succeeded {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 结果区域 */
.task-result {
    text-align: center;
}

.success-message {
    padding: 20px;
    background: #d4edda;
    border-radius: 6px;
    color: #155724;
}

.success-message p {
    margin: 0 0 10px 0;
}

.error-message {
    padding: 15px;
    background: #f8d7da;
    border-radius: 6px;
    color: #721c24;
}

/* 错误提示 */
.error-message-toast {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

/* 历史记录 */
.history-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.history-voice {
    font-weight: 500;
    color: #333;
    min-width: 100px;
}

.history-date {
    color: #999;
    font-size: 13px;
}

.history-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.history-duration {
    color: #666;
    font-size: 13px;
}

.history-actions {
    margin-left: 15px;
}

.error-msg {
    color: #dc3545;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .audio-generation-container {
        padding: 15px;
    }
    
    .param-item {
        flex-wrap: wrap;
    }
    
    .param-item label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .param-item input[type="range"] {
        margin: 0 10px 0 0;
    }
    
    .history-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-actions {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* 滚动条样式 */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
