/* 语音克隆页面特定样式 */

.voice-clone-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.voice-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.voice-section h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.qr-entry {
    border: 1px dashed #cbd5f5;
    border-radius: 10px;
    background: #f8fbff;
    padding: 16px;
    margin-bottom: 20px;
}

.qr-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.qr-body {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.qr-image {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    object-fit: contain;
}

.qr-text {
    color: #4b5563;
    font-size: 13px;
}

.qr-link {
    color: #2563eb;
    font-size: 12px;
    word-break: break-all;
}

/* 创建音色区域 */
.create-speaker-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 968px) {
    .create-speaker-section {
        grid-template-columns: 1fr;
    }
}

/* 上传区域样式 */
.upload-area.voice-upload {
    border: 2px dashed #4CAF50;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area.voice-upload:hover {
    border-color: #45a049;
    background: #f0f8f0;
}

.upload-area.voice-upload.drag-over {
    border-color: #2196F3;
    background: #e3f2fd;
}

.upload-placeholder {
    width: 100%;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-area p {
    margin: 10px 0;
    color: #666;
}

.upload-hint {
    font-size: 0.9em;
    color: #999;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
}

.file-name {
    flex: 1;
    color: #2e7d32;
    font-weight: 500;
}

.btn-remove-file {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.3s;
}

.btn-remove-file:hover {
    background: #d32f2f;
}

/* 音色配置表单 */
.speaker-config {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 训练进度 */
.training-progress-section {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.training-progress-section h4 {
    margin-top: 0;
    color: #f57c00;
}

.progress-info {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-text {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 0.95em;
}

.training-details {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-top: 15px;
    font-family: monospace;
    font-size: 0.9em;
}

.training-details div {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 音色列表 */
.speakers-list {
    overflow-x: auto;
}

.speaker-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr 2fr;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
}

.speaker-item:hover {
    background: #f5f5f5;
}

.speaker-id {
    font-weight: 500;
    color: #333;
}

.speaker-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
}

.speaker-status.status-success,
.speaker-status.status-active {
    background: #c8e6c9;
    color: #2e7d32;
}

.speaker-status.status-training {
    background: #fff9c4;
    color: #f57c00;
}

.speaker-status.status-failed {
    background: #ffcdd2;
    color: #c62828;
}

.speaker-status.status-unknown {
    background: #e0e0e0;
    color: #666;
}

.speaker-actions {
    display: flex;
    gap: 8px;
}

.speaker-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.btn-view-detail {
    background: #2196F3;
    color: white;
}

.btn-view-detail:hover {
    background: #1976D2;
}

.btn-delete-speaker {
    background: #f44336;
    color: white;
}

.btn-delete-speaker:hover {
    background: #d32f2f;
}

.btn-train {
    background: #FF9800;
    color: white;
}

.btn-train:hover {
    background: #F57C00;
}

/* 语音合成配置 */
.synthesis-config {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.text-counter {
    text-align: right;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* 合成结果 */
.synthesis-result-section {
    background: #e8f5e9;
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.synthesis-result-section h4 {
    margin-top: 0;
    color: #2e7d32;
}

.audio-player {
    margin: 15px 0;
}

.audio-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.audio-details {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9em;
}

/* 音色详情弹窗 */
.speaker-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.btn-close-modal:hover {
    color: #333;
}

.detail-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #4CAF50;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.detail-value {
    color: #333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f5f5f5;
    border-left: 3px solid #4CAF50;
    padding: 15px;
    border-radius: 4px;
}

.history-item h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.history-item p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* 返回按钮 */
.btn-back {
    background: #757575;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #616161;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .speaker-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .speaker-actions {
        flex-direction: column;
    }
    
    .speaker-actions button {
        width: 100%;
    }
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* 刷新按钮 */
.refresh-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #1976D2;
}

.refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
