:root {
    --primary-color: #007AFF;
    --secondary-color: #5AC8FA;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --background: #FFFFFF;
    --background-secondary: #F5F5F7;
    --border-color: #D2D2D7;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

main {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 20px;
}

/* 上傳區域 */
.upload-section {
    margin-bottom: 40px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.02);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
    transform: scale(1.02);
}

.upload-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.file-info {
    font-size: 14px !important;
    color: var(--text-secondary);
    margin-top: 8px;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 16px;
}

/* 檔案列表 */
.file-list {
    margin: 20px 0;
    padding: 20px;
    background: var(--background-secondary);
    border-radius: var(--radius);
}

.file-list h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.file-list ul {
    list-style: none;
}

.file-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-name {
    font-size: 14px;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 按鈕 */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0051D5;
    transform: translateY(-1px);
}

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

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #2FB94C;
    transform: translateY(-1px);
}

/* 進度區域 */
.progress-section {
    margin-bottom: 40px;
}

.progress-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--background-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
}

.current-file p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.current-file span {
    color: var(--text-primary);
    font-weight: 500;
}

/* 結果區域 */
.result-section {
    margin-bottom: 20px;
}

.result-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.result-summary {
    background: var(--background-secondary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.success-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 8px;
    color: var(--success-color);
}

.failed-info {
    margin-top: 16px;
}

.failed-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--error-color);
}

.failed-list {
    list-style: none;
}

.failed-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.failed-list li:last-child {
    border-bottom: none;
}

.failed-filename {
    color: var(--text-primary);
    font-weight: 500;
}

.failed-reason {
    color: var(--error-color);
    font-size: 12px;
}

.download-section {
    text-align: center;
    padding: 20px;
    background: rgba(52, 199, 89, 0.05);
    border-radius: var(--radius);
}

/* 頁腳 */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    main {
        padding: 24px;
    }
    
    .upload-zone {
        padding: 40px 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .progress-container {
        flex-direction: column;
        align-items: stretch;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 狀態指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.status-success {
    color: var(--success-color);
}

.status-error {
    color: var(--error-color);
}

.status-warning {
    color: var(--warning-color);
}