:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --border: #2a2a4a;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    animation: fadeInDown 0.6s ease-out;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: gradientShift 3s ease infinite;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.model-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary-light);
}

.model-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.main {
    padding: 20px 0 60px;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: clamp(14px, 3vw, 18px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    max-width: 600px;
    margin: 0 auto 32px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.upload-placeholder {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(10px);
}

.upload-placeholder:hover,
.upload-placeholder.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    transition: all 0.3s ease;
}

.upload-placeholder:hover .upload-icon,
.upload-placeholder.dragover .upload-icon {
    transform: scale(1.1);
    color: var(--primary);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

.upload-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.options {
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.option-group {
    margin-bottom: 16px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.option-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 24px;
}

.option-buttons {
    display: flex;
    gap: 10px;
}

.option-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

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

.checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.action-btn {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 32px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

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

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

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.result-area {
    max-width: 900px;
    margin: 0 auto 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    animation: fadeInUp 0.6s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.result-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 12px;
}

.download-btn,
.reset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

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

.download-btn svg,
.reset-btn svg {
    width: 16px;
    height: 16px;
}

.result-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.compare-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 0 10px;
}

.compare-arrow svg {
    width: 24px;
    height: 24px;
}

.compare-item {
    text-align: center;
}

.compare-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.result-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: var(--shadow-sm);
}

.result-info {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.info-item {
    font-size: 13px;
    color: var(--text-muted);
}

.info-item span {
    color: var(--primary-light);
    font-weight: 500;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 60px auto 0;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.feature-card {
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

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

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 13px;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes gradientShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(30deg);
    }
}

@media (max-width: 768px) {
    .app {
        padding: 0 16px;
    }

    .header {
        padding: 16px 0;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 16px;
    }

    .model-badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .hero {
        margin-bottom: 30px;
    }

    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .upload-placeholder {
        padding: 32px 16px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }

    .upload-icon svg {
        width: 24px;
        height: 24px;
    }

    .upload-text {
        font-size: 16px;
    }

    .result-compare {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .compare-arrow {
        transform: rotate(90deg);
        padding: 10px 0;
    }

    .result-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .download-btn,
    .reset-btn {
        flex: 1;
        min-width: 140px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 40px;
    }

    .feature-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .upload-placeholder {
        padding: 24px 12px;
    }

    .action-btn {
        padding: 14px 24px;
        font-size: 16px;
    }

    .result-area {
        padding: 16px;
    }

    .result-img {
        max-height: 300px;
    }
}