 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg: #F9FAFB;
            --card: white;
            --text: #111827;
            --text-light: #6B7280;
            --border: #E5E7EB;
            --primary: #3B82F6;
            --primary-dark: #2563EB;
            --success: #10B981;
            --danger: #EF4444;
            --warning: #F59E0B;
            --radius: 0.75rem;
            --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.06);
        }

        body.dark {
            --bg: #0F172A;
            --card: #1E293B;
            --text: #F1F5F9;
            --text-light: #94A3B8;
            --border: #334155;
        }

        body {
            background: var(--bg);
            color: var(--text);
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
            padding: 2rem 1.5rem;
            transition: background 0.2s, color 0.2s;
        }

        .container { max-width: 1400px; margin: 0 auto; }
        .card {
            background: var(--card);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            border: 1px solid var(--border);
        }
        .flex {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            align-items: center;
            justify-content: space-between;
        }
        .flex-center {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }
        .grid-3 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1rem;
        }
        .grid-4 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.75rem;
        }
        .upload-area {
            border: 2px dashed var(--border);
            border-radius: var(--radius);
            padding: 2.5rem 2rem;
            text-align: center;
            cursor: pointer;
            transition: 0.2s;
            background: var(--card);
        }
        .upload-area:hover {
            border-color: var(--primary);
            background: rgba(59,130,246,0.02);
        }
        .upload-area.drag-over {
            border-color: var(--primary);
            background: rgba(59,130,246,0.05);
        }
        .btn {
            padding: 0.5rem 1.25rem;
            border-radius: 2rem;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        .btn-primary {
            background: var(--primary);
            color: white;
        }
        .btn-primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
        }
        .btn-success {
            background: var(--success);
            color: white;
        }
        .btn-danger {
            background: var(--danger);
            color: white;
        }
        .btn-secondary {
            background: var(--bg);
            color: var(--text);
            border: 1px solid var(--border);
        }
        .btn-secondary:hover {
            background: var(--border);
        }
        .badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 2rem;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .badge-good { background: rgba(16,185,129,0.15); color: var(--success); }
        .badge-avg { background: rgba(245,158,11,0.15); color: var(--warning); }
        .badge-poor { background: rgba(239,68,68,0.15); color: var(--danger); }
        .preview-card {
            background: var(--bg);
            border-radius: var(--radius);
            padding: 1rem;
            border: 1px solid var(--border);
            text-align: center;
        }
        .preview-card img {
            max-width: 100%;
            max-height: 220px;
            object-fit: contain;
            border-radius: 0.5rem;
        }
        .slider-group {
            margin-bottom: 1rem;
        }
        .slider-group label {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }
        .slider-group input[type="range"] {
            width: 100%;
            accent-color: var(--primary);
            background: var(--border);
            border-radius: 0.5rem;
            height: 6px;
            cursor: pointer;
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }
        .stat-card {
            background: var(--bg);
            border-radius: var(--radius);
            padding: 0.75rem;
            text-align: center;
            border: 1px solid var(--border);
        }
        .stat-value {
            font-size: 1.4rem;
            font-weight: 800;
        }
        .stat-label {
            font-size: 0.75rem;
            color: var(--text-light);
        }
        .batch-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
            flex-wrap: wrap;
        }
        .batch-thumb {
            width: 60px;
            height: 60px;
            object-fit: cover;
            border-radius: 0.5rem;
            background: var(--bg);
        }
        .batch-info {
            flex: 1;
            min-width: 150px;
        }
        .batch-info .file-name {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 200px;
        }
        .batch-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .toast {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            background: var(--text);
            color: white;
            padding: 0.75rem 1.25rem;
            border-radius: 2rem;
            opacity: 0;
            transition: 0.2s;
            z-index: 1000;
        }
        .toast.show { opacity: 1; }
        .compare-container {
            position: relative;
            overflow: hidden;
            border-radius: 0.5rem;
            margin: 0.5rem 0;
        }
        .compare-container img {
            display: block;
            width: 100%;
            height: auto;
        }
        .compare-slider {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            width: 4px;
            background: white;
            cursor: ew-resize;
            box-shadow: 0 0 0 2px var(--primary);
            transform: translateX(-50%);
        }
        .compare-label {
            position: absolute;
            top: 0.5rem;
            padding: 0.2rem 0.6rem;
            border-radius: 0.3rem;
            font-size: 0.7rem;
            font-weight: 600;
            color: white;
        }
        .compare-label-original { left: 0.5rem; background: rgba(0,0,0,0.6); }
        .compare-label-edited { right: 0.5rem; background: rgba(59,130,246,0.8); }
        @media (max-width: 768px) {
            body { padding: 1rem; }
            .grid-2 { grid-template-columns: 1fr; }
            .batch-item { flex-direction: column; align-items: stretch; }
            .batch-thumb { width: 100%; height: auto; max-height: 120px; }
        }