       :root {
            --bg: #f8fafc;
            --surface: #ffffff;
            --surface-alt: #f1f5f9;
            --border: #e2e8f0;
            --border-active: #6366f1;
            --text: #1e293b;
            --text-secondary: #64748b;
            --text-muted: #94a3b8;
            --primary: #6366f1;
            --primary-hover: #4f46e5;
            --primary-light: #eef2ff;
            --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
            --success: #10b981;
            --success-light: #ecfdf5;
            --warning: #f59e0b;
            --warning-light: #fffbeb;
            --danger: #ef4444;
            --danger-light: #fef2f2;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
            --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
            --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
            --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
            --radius-sm: 8px;
            --radius: 12px;
            --radius-lg: 16px;
            --radius-xl: 20px;
            --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
        }

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

        html {
            scroll-behavior: smooth;
            font-size: 16px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
            background-color: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-image:
                radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 60%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 90%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
        }

        /* Header */
        .header {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 0 24px;
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(12px);
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: var(--shadow-sm);
        }
        .header-inner {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 60px;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 700;
            font-size: 1.2rem;
            color: var(--text);
            text-decoration: none;
            letter-spacing: -0.01em;
        }
        .header-badge {
            font-size: 0.8rem;
            color: var(--text-secondary);
            background: var(--surface-alt);
            padding: 4px 12px;
            border-radius: 20px;
            font-weight: 500;
            letter-spacing: 0.01em;
        }

        /* Main */
        .main {
            flex: 1;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px 24px 40px;
            width: 100%;
        }

        /* Hero section */
        .hero {
            text-align: center;
            padding: 20px 0 10px;
        }
        .hero h1 {
            font-size: 2rem;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: var(--text);
            margin-bottom: 8px;
            line-height: 1.2;
        }
        .hero h1 .gradient-text {
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .hero p {
            font-size: 1.05rem;
            color: var(--text-secondary);
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.5;
        }

        /* Tool container */
        .tool-container {
            display: grid;
            grid-template-columns: 1fr 380px;
            gap: 20px;
            margin-top: 24px;
            align-items: start;
        }
        @media (max-width: 900px) {
            .tool-container {
                grid-template-columns: 1fr;
            }
        }

        /* Card */
        .card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            padding: 24px;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border);
            transition: all var(--transition);
        }
        .card-header {
            font-weight: 700;
            font-size: 1rem;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text);
            letter-spacing: -0.01em;
        }
        .card-header .icon-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary);
            flex-shrink: 0;
        }

        /* Upload area */
        .upload-zone {
            border: 2px dashed var(--border);
            border-radius: var(--radius-lg);
            padding: 40px 24px;
            text-align: center;
            cursor: pointer;
            transition: all var(--transition);
            background: var(--surface-alt);
            position: relative;
            overflow: hidden;
            min-height: 260px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }
        .upload-zone:hover,
        .upload-zone.drag-over {
            border-color: var(--border-active);
            background: var(--primary-light);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.06);
        }
        .upload-zone.drag-over {
            border-color: var(--primary);
            background: #eef2ff;
            box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.08);
            transform: scale(1.01);
        }
        .upload-zone h3 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text);
            letter-spacing: -0.01em;
        }
        .upload-zone p {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin: 0;
        }
        .upload-formats {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: center;
            font-size: 0.78rem;
            color: var(--text-muted);
        }
        .upload-formats span {
            background: var(--surface);
            padding: 3px 10px;
            border-radius: 20px;
            border: 1px solid var(--border);
            white-space: nowrap;
            font-family: var(--font-mono);
            font-size: 0.75rem;
            letter-spacing: 0.02em;
        }
        .upload-input {
            display: none;
        }

        /* Image preview in upload zone */
        .upload-preview-thumb {
            max-width: 140px;
            max-height: 140px;
            border-radius: var(--radius);
            object-fit: contain;
            box-shadow: var(--shadow);
            display: none;
            border: 3px solid #fff;
            background: #fff;
        }
        .upload-zone.has-image h3,
        .upload-zone.has-image .upload-formats {
            display: none;
        }
        .upload-zone.has-image .upload-preview-thumb {
            display: block;
        }
        .upload-zone.has-image p {
            margin-top: 4px;
        }
        .upload-zone.has-image {
            padding: 24px;
            min-height: auto;
        }

        /* Settings */
        .setting-group {
            margin-bottom: 18px;
        }
        .setting-group:last-child {
            margin-bottom: 0;
        }
        .setting-label {
            display: block;
            font-weight: 600;
            font-size: 0.88rem;
            color: var(--text);
            margin-bottom: 8px;
            letter-spacing: -0.01em;
        }
        .setting-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .setting-option {
            padding: 8px 14px;
            border-radius: 20px;
            border: 1.5px solid var(--border);
            background: var(--surface);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all var(--transition);
            color: var(--text-secondary);
            white-space: nowrap;
            user-select: none;
            letter-spacing: -0.01em;
        }
        .setting-option:hover {
            border-color: #c7cdfa;
            background: #fafafe;
            color: var(--text);
        }
        .setting-option.active {
            border-color: var(--primary);
            background: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
        }
        .custom-size-input {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
        }
        .custom-size-input input {
            width: 90px;
            padding: 8px 12px;
            border-radius: 20px;
            border: 1.5px solid var(--border);
            font-size: 0.85rem;
            text-align: center;
            font-family: var(--font-mono);
            transition: all var(--transition);
            background: var(--surface);
            color: var(--text);
        }
        .custom-size-input input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
        }
        .custom-size-input span {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        .custom-size-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* Crop mode */
        .crop-options {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .crop-option {
            flex: 1;
            min-width: 70px;
            text-align: center;
            padding: 10px 8px;
            border-radius: var(--radius-sm);
            border: 1.5px solid var(--border);
            background: var(--surface);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all var(--transition);
            color: var(--text-secondary);
            user-select: none;
        }
        .crop-option:hover {
            border-color: #c7cdfa;
            color: var(--text);
        }
        .crop-option.active {
            border-color: var(--primary);
            background: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 24px;
            border-radius: 25px;
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all var(--transition);
            border: none;
            letter-spacing: -0.01em;
            white-space: nowrap;
            text-decoration: none;
            user-select: none;
        }
        .btn-primary {
            background: var(--primary-gradient);
            color: #fff;
            box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
            width: 100%;
            font-size: 1rem;
            padding: 14px 24px;
            border-radius: 28px;
        }
        .btn-primary:hover {
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
            transform: translateY(-1px);
        }
        .btn-primary:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }
        .btn-primary:disabled {
            background: #cbd5e1;
            box-shadow: none;
            cursor: not-allowed;
            transform: none;
            color: #94a3b8;
        }
        .btn-secondary {
            background: var(--surface);
            color: var(--text);
            border: 1.5px solid var(--border);
        }
        .btn-secondary:hover {
            background: var(--surface-alt);
            border-color: #c7cdfa;
        }
        .btn-sm {
            padding: 6px 14px;
            font-size: 0.8rem;
            border-radius: 20px;
        }

        /* Preview section */
        .preview-section {
            margin-top: 24px;
        }
        .preview-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            justify-content: center;
            padding: 16px 0;
        }
        .preview-item {
            text-align: center;
            background: var(--surface-alt);
            border-radius: var(--radius);
            padding: 16px 12px;
            border: 1px solid var(--border);
            transition: all var(--transition);
            min-width: 90px;
        }
        .preview-item:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }
        .preview-item img {
            display: block;
            margin: 0 auto;
            border-radius: 4px;
            image-rendering: auto;
            background: repeating-conic-gradient(#e8ecf1 0% 25%, #fff 0% 50%) 50% / 16px 16px;
        }
        .preview-item .size-label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-top: 8px;
            font-family: var(--font-mono);
            font-weight: 500;
        }
        .preview-item .size-kb {
            font-size: 0.7rem;
            color: var(--text-muted);
        }
        .preview-empty {
            text-align: center;
            color: var(--text-muted);
            padding: 40px 20px;
            font-size: 0.9rem;
        }
        .preview-empty .empty-icon {
            font-size: 3rem;
            display: block;
            margin-bottom: 8px;
            opacity: 0.6;
        }

        /* File info bar */
        .file-info-bar {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            padding: 10px 16px;
            background: var(--success-light);
            border-radius: var(--radius-sm);
            margin-top: 12px;
            font-size: 0.85rem;
            color: #065f46;
            border: 1px solid #a7f3d0;
            display: none;
        }
        .file-info-bar.show {
            display: flex;
        }
        .file-info-bar .info-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            flex-shrink: 0;
            animation: pulse-dot 2s infinite;
        }
        @keyframes pulse-dot {
            0%,
            100% {
                opacity: 1;
            }
            50% {
                opacity: 0.4;
            }
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: #1e293b;
            color: #fff;
            padding: 12px 24px;
            border-radius: 25px;
            font-size: 0.9rem;
            font-weight: 500;
            z-index: 1000;
            pointer-events: none;
            transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-xl);
            white-space: nowrap;
        }
        .toast.show {
            transform: translateX(-50%) translateY(0);
        }
        .toast.error {
            background: #dc2626;
        }

        /* SEO Content */
        .seo-section {
            margin-top: 48px;
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
            padding: 0 24px;
        }
        .seo-section h2 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 16px;
            letter-spacing: -0.02em;
            color: var(--text);
        }
        .seo-section h3 {
            font-size: 1.15rem;
            font-weight: 600;
            margin: 20px 0 8px;
            color: var(--text);
            letter-spacing: -0.01em;
        }
        .seo-section p {
            color: var(--text-secondary);
            margin-bottom: 12px;
            line-height: 1.7;
            font-size: 0.95rem;
        }
        .seo-section ul {
            color: var(--text-secondary);
            margin-bottom: 12px;
            padding-left: 20px;
            font-size: 0.95rem;
            line-height: 1.7;
        }
        .seo-section ul li {
            margin-bottom: 4px;
        }
        .seo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }
        .seo-card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            padding: 20px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            transition: all var(--transition);
        }
        .seo-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }
        .seo-card h4 {
            font-weight: 600;
            margin-bottom: 6px;
            color: var(--text);
            letter-spacing: -0.01em;
        }
        .seo-card p {
            font-size: 0.88rem;
            color: var(--text-secondary);
            margin: 0;
            line-height: 1.5;
        }

        /* Footer */
        .footer {
            background: var(--surface);
            border-top: 1px solid var(--border);
            text-align: center;
            padding: 20px 24px;
            color: var(--text-muted);
            font-size: 0.85rem;
            margin-top: 40px;
        }
        .footer a {
            color: var(--text-secondary);
            text-decoration: underline;
            text-underline-offset: 3px;
            transition: color var(--transition);
        }
        .footer a:hover {
            color: var(--primary);
        }

        /* Loading spinner */
        .spinner {
            display: inline-block;
            width: 18px;
            height: 18px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            flex-shrink: 0;
        }
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .hero h1 {
                font-size: 1.5rem;
            }
            .hero p {
                font-size: 0.9rem;
            }
            .upload-zone {
                padding: 28px 16px;
                min-height: 200px;
            }
            .card {
                padding: 16px;
                border-radius: var(--radius);
            }
            .preview-grid {
                gap: 8px;
            }
            .preview-item {
                padding: 10px 8px;
                min-width: 70px;
            }
            .seo-section {
                padding: 0 16px;
            }
            .header-inner {
                height: 50px;
            }
            .logo {
                font-size: 1rem;
            }
            .btn-primary {
                padding: 12px 20px;
                font-size: 0.9rem;
            }
        }
        @media (max-width: 480px) {
            .setting-options {
                gap: 4px;
            }
            .setting-option {
                padding: 6px 10px;
                font-size: 0.78rem;
            }
            .crop-options {
                flex-direction: column;
                gap: 4px;
            }
        }