/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 顶部状态栏 */
.status-header {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.system-status {
    display: flex;
    gap: 24px;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    color: #8a8a8a;
    font-size: 14px;
}

.status-value {
    color: #4fc3f7;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-idle {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.badge-loading {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.badge-ready {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.badge-error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* 按钮样式 */
.btn-small {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #000;
    font-weight: 600;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

/* 主容器布局 */
.app-container {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1920px;
    margin: 0 auto;
}

.control-panel {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.output-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 控制区域样式 */
.control-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.control-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 18px;
}

.control-section h2 i {
    color: #667eea;
}

/* 上传区域 */
.upload-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-card {
    background: rgba(40, 40, 60, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-header h3 {
    color: #ffffff;
    font-size: 16px;
}

.upload-area {
    position: relative;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    margin: 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-icon {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-text {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.upload-hint {
    color: #8a8a8a;
    font-size: 14px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 文件预览 */
.file-preview, .image-grid {
    padding: 16px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 进度条样式 */
.load-progress, .process-progress {
    margin-top: 20px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-detail {
    margin-top: 8px;
    font-size: 13px;
    color: #8a8a8a;
    min-height: 20px;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #8a8a8a;
}

/* 参数控件 */
.param-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.param-value {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #ffffff;
}

/* 文本输入框样式 */
.text-input, .number-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus, .number-input:focus {
    border-color: #667eea;
}

.text-input::placeholder {
    color: #8a8a8a;
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input {
    -moz-appearance: textfield;
}

/* 复选框标签样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.param-row {
    display: flex;
    gap: 20px;
}

.param-row .half {
    flex: 1;
}

/* 操作按钮组 */
.action-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.process-controls {
    display: flex;
    gap: 12px;
}

/* 输出区域 */
.output-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.output-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-top: 16px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-placeholder i {
    color: #667eea;
    margin-bottom: 16px;
    opacity: 0.5;
}

.output-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    display: none;
}

.output-controls.show {
    display: flex;
}

/* 存储信息 */
.storage-info {
    background: rgba(40, 40, 60, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.storage-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: #8a8a8a;
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-value {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
}

.storage-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.history-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #8a8a8a;
}

.empty-history i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* 调试面板 */
.debug-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.debug-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.debug-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.log-filter select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.debug-console {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 300px;
    margin-bottom: 20px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
}

.log-time {
    color: #8a8a8a;
    min-width: 70px;
}

.log-level {
    font-weight: 600;
    min-width: 60px;
}

.log-level.info { color: #4fc3f7; }
.log-level.warn { color: #ffc107; }
.log-level.error { color: #f44336; }
.log-level.debug { color: #ba68c8; }

.log-message {
    flex: 1;
    word-break: break-word;
}

.system-info {
    background: rgba(40, 40, 60, 0.6);
    border-radius: 12px;
    padding: 20px;
}

.system-info h4 {
    margin-bottom: 16px;
    color: #ffffff;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.info-label {
    color: #8a8a8a;
}

.info-value {
    color: #ffffff;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }
    
    .control-panel {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .control-section, .output-section {
        padding: 16px;
    }
    
    .storage-stats, .info-grid {
        grid-template-columns: 1fr;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

/* 动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 任务概览样式 */
.task-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.task-item {
    background: rgba(40, 40, 60, 0.6);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.task-item.full-width {
    grid-column: 1 / -1;
}

.task-label {
    color: #8a8a8a;
    font-size: 13px;
    margin-bottom: 4px;
}

.task-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-large-value {
    color: #667eea;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.task-hint {
    color: #8a8a8a;
    font-size: 12px;
}

/* 上传状态样式 */
.upload-status {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.dimension-text {
    color: #4fc3f7;
    font-size: 13px;
}

.requirement-text {
    color: #ffc107;
    font-size: 13px;
}

.selection-text {
    color: #43e97b;
    font-size: 13px;
}

/* 预览区域样式 */
.preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preview-card {
    background: rgba(40, 40, 60, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-card:last-child {
    grid-column: 1 / -1;
}

.preview-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-header h4 {
    color: #ffffff;
    font-size: 15px;
    margin: 0;
}

.preview-controls {
    display: flex;
    gap: 8px;
}

.image-preview-container,
.video-preview-container,
.bgm-preview-container {
    padding: 16px;
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-preview {
    color: #8a8a8a;
    font-size: 14px;
}

.empty-preview i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 50px auto;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 播放器样式 */
.track-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#current-track {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 4px;
}

#track-progress {
    color: #8a8a8a;
    font-size: 13px;
}

/* 调整布局 */
@media (max-width: 1400px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .preview-card:last-child {
        grid-column: auto;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* 视频列表样式 */
.video-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-list-header {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
    padding-left: 2px;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(30, 30, 46, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.video-item:hover {
    background: rgba(40, 40, 60, 0.8);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.video-icon {
    color: #667eea;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.video-details {
    flex: 1;
    min-width: 0;
}

.video-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.video-size {
    color: #8a8a8a;
    font-size: 12px;
}

.video-actions {
    display: flex;
    gap: 4px;
}

.video-main-preview {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.preview-info {
    margin-top: 8px;
    text-align: center;
    color: #8a8a8a;
    font-size: 13px;
}

/* 音频列表样式 */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
    padding-left: 2px;
}

.audio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(30, 46, 40, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(67, 233, 123, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.audio-item:hover {
    background: rgba(40, 60, 50, 0.8);
    border-color: rgba(67, 233, 123, 0.5);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.2);
    transform: translateY(-1px);
}

.audio-item .fa-file-audio {
    color: #43e97b;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.audio-details {
    flex: 1;
    min-width: 0;
}

.audio-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.audio-size {
    color: #8a8a8a;
    font-size: 12px;
}

/* 预览列表中的按钮样式 */
.video-actions .btn-small,
.audio-actions .btn-small {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.video-actions .btn-small:hover,
.audio-actions .btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.video-actions .btn-small i,
.audio-actions .btn-small i {
    font-size: 12px;
}

/* 删除按钮特殊样式 */
.video-actions .btn-danger,
.audio-actions .btn-danger {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.3);
    color: #ff8a80;
}

.video-actions .btn-danger:hover,
.audio-actions .btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
}

/* 图片操作样式 */
.image-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.image-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: #ffffff;
    font-size: 13px;
}

.image-actions {
    margin-top: 8px;
}

/* 页脚样式 */
.footer {
    margin-top: 40px;
    padding: 30px 0;
    background: rgba(20, 20, 30, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: #8a8a8a;
    font-size: 14px;
    line-height: 1.6;
}

.footer-content p {
    margin: 10px 0;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}