/* ===== 全局样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: 
        url('https://images.unsplash.com/photo-1676594037920-a12bab344687?q=80&w=2728&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') center center/cover no-repeat,
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 30px;
    box-sizing: border-box;
}

/* 添加半透明遮罩层以提高可读性 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* ===== 主容器 ===== */
.container {
    width: 100%;
    max-width: 920px; /* 从800px增加到920px，两边各增加60px */
    min-height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== 顶部标题区 (8vh) ===== */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 20px;
    text-align: center;
    flex-shrink: 0;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ===== 语言切换器下拉菜单 ===== */
.language-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-current {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: space-between;
    font-weight: 500;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.lang-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 4px;
}

.lang-options.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
}

.lang-option.active {
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
    font-weight: 600;
}

.lang-flag {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.lang-name {
    flex: 1;
    font-size: 0.9rem;
}

.check-mark {
    color: #10b981;
    font-weight: bold;
    font-size: 0.9rem;
}

.header {
    position: relative;
}

/* ===== 主要内容区 (84vh) ===== */
.main-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
}

/* ===== 文件上传区域 ===== */
.upload-section {
    flex-shrink: 0;
}

.upload-zone {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #4f46e5;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.upload-zone h3 {
    color: #374151;
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.upload-hint {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.browse-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    min-width: 160px;
}

.browse-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* ===== 文件列表 ===== */
.file-list {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    display: none;
}

.file-list.show {
    display: block;
}

.file-list h4 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 1.1rem;
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item.error {
    border-left-color: #ef4444;
}

.file-status {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.file-size {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-error {
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
}

.remove-file {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-file:hover {
    background: #dc2626;
}

/* ===== 质量选择区域 ===== */
.quality-section {
    flex-shrink: 0;
}

.quality-section h3 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 1.2rem;
}

.quality-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.quality-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1;
    min-width: 160px;
}

.quality-option input[type="radio"] {
    display: none;
}

.quality-btn {
    display: block;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-weight: 400;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 6px;
}

.quality-option input[type="radio"]:checked + .quality-btn {
    background: #e0e7ff;
    color: #4f46e5;
    border-color: #c7d2fe;
    font-weight: 500;
}

.quality-option small {
    color: #6b7280;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.4;
}

/* ===== 转换进度区域 ===== */
.progress-section {
    flex-shrink: 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.progress-section h3 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 1.2rem;
}

.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 600;
}

.current-file,
.time-estimate {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #6b7280;
}

.current-file span:first-child,
.time-estimate span:first-child {
    font-weight: 600;
    color: #374151;
}

/* ===== 操作按钮区域 ===== */
.action-section {
    flex-shrink: 0;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #10b981;
    color: white;
    padding: 16px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    min-width: 200px;
}

.btn-primary:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #047857;
    transform: translateY(-2px);
}

/* ===== 转换结果区域 ===== */
.result-section {
    flex-shrink: 0;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
}

.result-section h3 {
    margin-bottom: 16px;
    color: #0c4a6e;
    font-size: 1.2rem;
}

.result-summary {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #374151;
}

.result-summary .divider {
    margin: 0 8px;
    color: #d1d5db;
}

.result-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #10b981;
}

.result-item.failed {
    border-left-color: #ef4444;
}

.result-status {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.result-info {
    flex: 1;
}

.result-filename {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.result-details {
    font-size: 0.875rem;
    color: #6b7280;
}

.download-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #0284c7;
}

.download-actions {
    display: flex;
    justify-content: center;
}

/* ===== 底部状态栏 (8vh) ===== */
.footer {
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 16px 30px;
    flex-shrink: 0;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6b7280;
    justify-content: center;
    flex-wrap: wrap;
}

.status-bar .divider {
    color: #d1d5db;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0;
        background-attachment: scroll;
    }
    
    .container {
        min-height: 100vh;
        border-radius: 0;
        max-width: none;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border: none;
    }
    
    .main-content {
        padding: 20px;
        gap: 20px;
    }
    
    .quality-options {
        flex-direction: column;
    }
    
    .quality-option {
        min-width: auto;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .download-actions {
        flex-direction: column;
    }
    
    .status-bar {
        font-size: 0.75rem;
        text-align: center;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    /* 移动端语言切换器 */
    .language-switch {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 15px;
    }
    
    .lang-current {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 120px;
    }
    
    .lang-options {
        min-width: 160px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .lang-options.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .lang-option {
        padding: 10px 14px;
    }
    
    .lang-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .upload-zone {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .header {
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
        gap: 15px;
    }
}

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

.file-item,
.result-item {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== 滚动条样式 ===== */
.file-items::-webkit-scrollbar,
.result-items::-webkit-scrollbar {
    width: 6px;
}

.file-items::-webkit-scrollbar-track,
.result-items::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.file-items::-webkit-scrollbar-thumb,
.result-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.file-items::-webkit-scrollbar-thumb:hover,
.result-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast::before {
    content: '✅';
    font-size: 1.2rem;
}


