/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --accent-primary: #60a5fa;
    --accent-primary-hover: #3b82f6;
    --accent-secondary: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Styles */
.header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transform: scale(1.1);
}

.theme-icon {
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-icon {
    transform: rotate(180deg);
}

/* Main Content */
.main {
    padding: 3rem 0;
    min-height: calc(100vh - 150px);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    background-color: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    color: var(--accent-primary);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.upload-area:hover .upload-icon {
    opacity: 1;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

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

.upload-hint {
    color: var(--accent-primary);
    margin: 0.5rem 0 0 0;
    font-size: 0.75rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

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

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

.upload-btn {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.upload-btn:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

/* Features Section */
.features-section {
    margin-bottom: 3rem;
}

.features-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 900px;
}

.feature-card {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    background-color: var(--accent-primary);
    color: white;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .upload-area {
        padding: 3rem 1.5rem;
    }

    .upload-title {
        font-size: 1.25rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .features-title {
        font-size: 1.5rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.8;
    pointer-events: none;
    position: relative;
}

.loading::before {
    content: '正在处理中...';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--accent-primary);
    z-index: 10;
    text-align: center;
    background-color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: pulse 1.5s infinite;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    z-index: 10;
}

.loading .upload-content {
    opacity: 0.4;
}

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

/* Success State */
.success {
    border-color: #10b981 !important;
}

.success .upload-icon {
    color: #10b981 !important;
}

/* Error State */
.error {
    border-color: #ef4444 !important;
}

.error .upload-icon {
    color: #ef4444 !important;
}