/* 全局样式 */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 头部导航 */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 1.125rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border-light);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* 主容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 上传区域 */
.upload-section {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--bg-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.upload-icon {
    font-size: 2rem;
    color: white;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.upload-formats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.format-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.format-icon {
    font-size: 1rem;
}

.file-input {
    display: none;
}

/* 文件预览 */
.file-preview {
    margin-top: 2rem;
    display: none;
}

.file-preview.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.file-details h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 1.25rem;
}

.btn-close:hover {
    background: var(--border-light);
    color: var(--text-color);
}

/* 媒体播放器 */
.media-player {
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
}

/* 音频播放器 */
.audio-player {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.audio-visualizer {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    background-size: 200% 200%;
    animation: gradientBG 6s ease infinite;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.vinyl-disc {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    /* 使用锥形渐变模拟光盘反光效果，这样旋转时能明显看出转动 */
    background: conic-gradient(
        from 0deg, 
        #1e293b 0%, 
        #334155 10%, 
        #1e293b 20%, 
        #334155 30%, 
        #1e293b 40%, 
        #0f172a 60%, 
        #1e293b 80%, 
        #334155 90%, 
        #1e293b 100%
    );
    border: 3px solid #334155;
    position: relative;
    animation: rotate 3s linear infinite paused;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.vinyl-disc::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(
        transparent 0, 
        transparent 4px, 
        rgba(255,255,255,0.05) 5px, 
        transparent 6px
    );
    pointer-events: none;
}

.vinyl-disc.playing {
    animation-play-state: running;
}

.vinyl-center {
    width: 40px;
    height: 40px;
    background: #dc2626;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    border: 2px solid #ef4444;
}

/* 增加一个小圆点，让旋转更加明显 */
.vinyl-center::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.audio-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.audio-btn-secondary {
    width: 36px;
    height: 36px;
    background: var(--border-light);
    color: var(--text-secondary);
    font-size: 1rem;
}

.audio-btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.audio-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.audio-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.volume-slider {
    width: 80px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.volume-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
}

/* 视频播放器 */
.video-player {
    position: relative;
    background: #000;
}

.video-player video {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
}

/* 格式选择 */
.format-selector {
    margin: 1.5rem 0;
}

.format-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.format-option {
    position: relative;
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.format-option label {
    display: block;
    padding: 0.875rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.format-option input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.format-option label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.format-option input[type="radio"]:checked + label:hover {
    background: var(--primary-hover);
}

/* 按钮 */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

#convertBtn {
    display: flex;
    margin: 2rem auto 0;
    min-width: 200px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--border-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
    min-width: 320px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.loading-subtext {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.loading-progress {
    margin-top: 1.5rem;
}

/* 任务列表 */
.tasks-section {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.025em;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 10;
    opacity: 0;
}

.task-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.task-info {
    flex: 1;
}

.task-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.task-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.task-status {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-processing {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.status-completed {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.status-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
}

.task-progress {
    margin: 1rem 0;
}

.task-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid var(--border-color);
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
}

/* 语言选择器 */
.language-selector {
    position: relative;
}

.language-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    font-size: 0.875rem;
}

.language-btn:hover {
    background: var(--border-light);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    min-width: 160px;
    z-index: 10;
    overflow: hidden;
}

.language-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.language-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.language-option:hover {
    background: var(--border-light);
}

.language-option.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }
    
    .upload-section {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 3rem 1.5rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .format-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .upload-formats {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* 小程序推广 */
.mini-program-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.mini-program-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.mini-program-content p {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 500;
}

.qr-code {
    padding: 0.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}