/* =================== 基础样式 =================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    min-height: 100vh;
    color: #ffffff;
}

/* =================== 顶部导航 =================== */
.header {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    background: linear-gradient(135deg, #00d4ff 0%, #00bcd4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

.logo i {
    font-size: 2rem;
    color: #00d4ff;
}

/* =================== 主容器 =================== */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

/* =================== 左侧边栏 =================== */
.sidebar-left {
    background: rgba(0, 212, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.template-section {
    margin-bottom: 2rem;
}

.template-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #00d4ff;
    font-size: 1.1rem;
    font-weight: 600;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.template-item {
    background: rgba(0, 212, 255, 0.05);
    border: 2px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.template-item:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

.template-item.selected {
    border-color: #00d4ff;
    background: linear-gradient(135deg, #00d4ff 0%, #00bcd4 100%);
    color: white;
}

.template-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.template-item .placeholder {
    width: 100%;
    height: 80px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.template-item .placeholder i {
    font-size: 2rem;
    color: #00bcd4;
}

.template-item h4 {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.template-item p {
    font-size: 0.75rem;
    opacity: 0.8;
    color: #b0b0b0;
}

.template-item.selected h4,
.template-item.selected p {
    color: white;
}

/* =================== 声音控制 =================== */
.voice-controls {
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 212, 255, 0.02);
}

.voice-content {
    padding: 1rem;
}

.voice-list {
    display: block;
}

.voice-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 212, 255, 0.03);
}

.voice-item:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.voice-item.selected {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.2);
}

.voice-avatar {
    width: 40px;
    height: 40px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
}

.voice-info h5 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.voice-info p {
    font-size: 0.75rem;
    color: #b0b0b0;
}

.voice-actions {
    margin-left: auto;
}

.play-btn {
    background: #00d4ff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.play-btn:hover {
    background: #00bcd4;
    transform: scale(1.1);
}

/* =================== 中间内容区域 =================== */
.content-center {
    background: rgba(0, 212, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.preview-header h2 {
    color: #00d4ff;
    font-size: 1.5rem;
    font-weight: 600;
}

.preview-controls {
    display: flex;
    gap: 0.75rem;
}

.preview-content {
    background: rgba(0, 212, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-placeholder {
    text-align: center;
    color: #a0a0a0;
}

.preview-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #00d4ff;
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: 1.1rem;
    color: #a0a0a0;
}

.preview-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =================== 视频结果区域调整 =================== */
.video-result-section {
    background: rgba(0, 212, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
    margin-top: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

.video-result-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #00d4ff;
    font-size: 1.2rem;
}

.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.video-item {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.video-item:hover {
    border-color: #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.video-item video {
    width: 100%;
    max-height: 240px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #000;
}

.video-info {
    margin-bottom: 0.75rem;
}

.video-info .video-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.video-actions .btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 自定义滚动条样式 */
.video-result-section::-webkit-scrollbar {
    width: 8px;
}

.video-result-section::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
}

.video-result-section::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

.video-result-section::-webkit-scrollbar-thumb:hover {
    background: #00bcd4;
}

/* =================== 生成配置样式 =================== */
.generation-config {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.generation-config h3 {
    margin: 0 0 1rem 0;
    color: #00d4ff;
    font-size: 1rem;
}

.config-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.config-row label {
    min-width: 70px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
}

.config-row select,
.config-row input[type="color"] {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(0, 212, 255, 0.05);
    color: #ffffff;
}

.config-row select option {
    background: #1a1a1a;
    color: #ffffff;
}

/* =================== 背景图片预览样式 =================== */
.background-image-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.background-image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.background-image-preview img:hover {
    border-color: #00d4ff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.background-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.background-info small {
    color: #a0a0a0;
    font-size: 11px;
    line-height: 1.2;
}

/* =================== 右侧边栏调整 =================== */
.sidebar-right {
    background: rgba(0, 212, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.text-input-section h4 {
    color: #00d4ff;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.voice-settings {
    background: rgba(0, 212, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    min-width: 50px;
    font-size: 0.9rem;
    color: #ffffff;
}

.control-group input[type="range"] {
    flex: 1;
    accent-color: #00d4ff;
}

.control-group span {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 500;
    color: #00d4ff;
}

.final-text {
    margin-bottom: 1rem;
}

.final-text textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    background: rgba(0, 212, 255, 0.03);
    color: #ffffff;
}

.final-text textarea::placeholder {
    color: #a0a0a0;
}

.final-text textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.generate-actions {
    margin-bottom: 1rem;
}

.generate-actions .btn-large {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.selection-info {
    background: rgba(0, 212, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.selection-info h4 {
    margin-bottom: 0.75rem;
    color: #ffffff;
    font-size: 0.9rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.info-item label {
    font-weight: 500;
    color: #a0a0a0;
    font-size: 0.85rem;
}

.info-item span {
    color: #ffffff;
    font-size: 0.85rem;
}

/* =================== 按钮样式 =================== */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #00bcd4 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
}

.btn-secondary {
    background: rgba(0, 212, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.btn-success {
    background: linear-gradient(135deg, #00d4ff 0%, #00bcd4 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
}

.btn-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.btn-large {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* =================== 按钮禁用状态 =================== */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* =================== 模态框样式 =================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(10, 10, 10, 0.95);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.modal-header h3 {
    color: #00d4ff;
    margin: 0;
}

.close {
    color: #a0a0a0;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #00d4ff;
}

.modal-body {
    padding: 1.5rem;
    color: #ffffff;
}

/* =================== 标签页样式 =================== */
.task-tabs,
.upload-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.task-tabs .tab-btn,
.upload-tabs .tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    color: #a0a0a0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.task-tabs .tab-btn.active,
.upload-tabs .tab-btn.active {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
}

.task-tabs .tab-btn:hover,
.upload-tabs .tab-btn:hover {
    color: #ffffff;
}

/* =================== 任务列表样式 =================== */
.task-list {
    max-height: 400px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.task-info {
    flex: 1;
}

.task-info h5 {
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.task-info p {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-success {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* =================== 上传区域样式 =================== */
.upload-content {
    display: none;
}

.upload-content.active {
    display: block;
}

.upload-area {
    border: 2px dashed rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 212, 255, 0.02);
}

.upload-area:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: #00d4ff;
    margin-bottom: 1rem;
    display: block;
}

.upload-area p {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.upload-area small {
    color: #a0a0a0;
}

.upload-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.03);
    color: #ffffff;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.form-group select option {
    background: #1a1a1a;
    color: #ffffff;
}

/* =================== 加载指示器 =================== */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.3);
    border-top: 4px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-indicator p {
    margin-top: 1rem;
    color: #ffffff;
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================== 音频播放器 =================== */
.audio-player {
    background: rgba(0, 212, 255, 0.03);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

/* =================== 响应式设计 =================== */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 280px 1fr 320px;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar-left,
    .sidebar-right {
        order: 2;
    }
    
    .content-center {
        order: 1;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}