/**
 * AI音色克隆网站 - 主样式表
 * Voice Clone Website - Main Stylesheet
 */

/* 基础样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0;
}

/* 上传区域 */
.upload-zone {
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.upload-zone.dragover {
    border-color: var(--success-color);
    background-color: #f0fff4;
}

.upload-content i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 音频预览 */
.audio-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.audio-preview audio {
    border-radius: 8px;
}

/* 文本输入 */
textarea.form-control {
    border-radius: 8px;
    resize: vertical;
    min-height: 150px;
}

textarea.form-control:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* 语音设置 */
.voice-settings {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.form-range::-webkit-slider-thumb {
    background-color: var(--primary-color);
}

.form-range::-webkit-slider-thumb:hover {
    background-color: #0b5ed7;
}

/* 生成按钮 */
#generateBtn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#generateBtn:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

#generateBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 结果区域 */
.result-section {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.25rem;
}

.result-audio audio {
    border-radius: 8px;
    width: 100%;
}

.result-info {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

/* 历史记录 */
.history-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background-color: white;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: #e9ecef;
}

.history-item .play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.history-item .history-info {
    flex-grow: 1;
    margin-left: 0.75rem;
    overflow: hidden;
}

.history-item .history-text {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item .history-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* 步骤说明 */
.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

/* 加载动画 */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.15em;
}

/* 工具提示 */
.tooltip {
    font-size: 0.85rem;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 767.98px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 1.5rem;
    }
    
    .voice-settings {
        padding: 0.75rem;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* 通知样式 */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-header {
    border-radius: 8px 8px 0 0;
}

/* 页面加载动画 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 表单验证样式 */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    font-size: 0.85rem;
    color: var(--danger-color);
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    top: 50%;
    left: 50%;
    margin-top: -0.75rem;
    margin-left: -0.75rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 页脚 */
footer {
    margin-top: auto;
}

footer h5, footer h6 {
    font-weight: 600;
}

footer a {
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: white !important;
}
