﻿        :root {
            --bg-dark: #05070a;
            --panel-bg: rgba(13, 17, 23, 0.7);
            --accent-primary: #00f2ff;
            --accent-secondary: #7000ff;
            --accent-success: #00ff88;
            --text-main: #f0f6fc;
            --text-dim: #8b949e;
            --border-color: rgba(255, 255, 255, 0.08);
            --glass-blur: blur(16px);
            --shadow-glow: 0 0 20px rgba(0, 242, 255, 0.15);
            --header-progress-track: rgba(80, 183, 218, 0.12);
            --header-progress-start: #45a9c9;
            --header-progress-mid: #67c2df;
            --header-progress-end: #9ad8ef;
            --header-progress-glow: rgba(80, 183, 218, 0.28);
            --header-progress-sheen: rgba(171, 226, 246, 0.30);
            --header-progress-sheen-soft: rgba(95, 190, 224, 0.14);
            --header-progress-detail-color: rgba(240, 246, 252, 0.78);
            --header-progress-detail-strong: #ffffff;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
            -webkit-font-smoothing: antialiased;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            overflow: hidden;
            height: 100vh;
            display: flex;
            flex-direction: column;
            user-select: none;
        }

        /* --- Header --- */
        header {
            position: relative;
            height: 64px;
            padding: 0 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(5, 7, 10, 0.9);
            border-bottom: 1px solid var(--border-color);
            backdrop-filter: var(--glass-blur);
            z-index: 1000;
        }

        .header-progress {
            --header-progress-value: 0;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            z-index: 5;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.16s ease;
        }

        .header-progress.visible {
            opacity: 1;
        }

        .header-progress-track {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            overflow: hidden;
            background: var(--header-progress-track);
        }

        .header-progress-bar {
            position: relative;
            width: 100%;
            height: 100%;
            transform: scaleX(var(--header-progress-value));
            transform-origin: left center;
            background: linear-gradient(90deg, var(--header-progress-start), var(--header-progress-mid), var(--header-progress-end));
            box-shadow: 0 0 18px var(--header-progress-glow);
            transition: transform 0.24s cubic-bezier(0.2, 0.85, 0.24, 1), background 0.16s ease;
            will-change: transform;
        }

        .header-progress-bar::after {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(
                90deg,
                transparent 0%,
                var(--header-progress-sheen-soft) 36%,
                var(--header-progress-sheen) 52%,
                var(--header-progress-sheen-soft) 68%,
                transparent 100%
            );
            background-size: 220% 100%;
            filter: blur(0.8px);
            opacity: 0.72;
            animation: headerProgressSweep 1.55s cubic-bezier(0.42, 0, 0.2, 1) infinite;
        }

        .header-progress.waiting .header-progress-bar::after {
            opacity: 0.86;
            animation: headerProgressSweep 1.22s cubic-bezier(0.42, 0, 0.2, 1) infinite;
        }

        .header-progress.finishing .header-progress-bar {
            transition-duration: 0.16s;
        }

        .header-progress.error .header-progress-bar {
            background: linear-gradient(90deg, #ff4444, #ffaa00);
        }

        .header-progress-detail {
            position: absolute;
            top: calc(100% + 6px);
            right: 24px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            max-width: min(560px, calc(100vw - 48px));
            color: var(--header-progress-detail-color);
            font-size: 0.68rem;
            font-weight: 760;
            line-height: 1.25;
            letter-spacing: 0;
            text-align: right;
            text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
            opacity: 0;
            transform: translateY(-3px);
            transition: opacity 0.18s ease, transform 0.18s ease;
        }

        .header-progress.visible .header-progress-detail {
            opacity: 1;
            transform: translateY(0);
        }

        #header-progress-text {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #header-progress-percent {
            flex: 0 0 auto;
            color: var(--header-progress-detail-strong);
            font-family: "JetBrains Mono", monospace;
            font-size: 0.66rem;
            font-weight: 850;
        }

        @keyframes headerProgressSweep {
            from { background-position: 140% 0; }
            to { background-position: -140% 0; }
        }

        @media (prefers-reduced-motion: reduce) {
            .header-progress,
            .header-progress-bar {
                transition: none;
            }
            .header-progress-bar::after {
                animation: none;
            }
        }

        @media (max-width: 760px) {
            .header-progress-detail {
                right: 12px;
                left: 12px;
                top: calc(100% + 4px);
                max-width: none;
                font-size: 0.64rem;
            }
        }

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

        .logo-icon {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-glow);
        }

        .logo-text {
            font-weight: 700;
            font-size: 1.25rem;
            letter-spacing: 0;
            background: linear-gradient(to right, #fff, #8b949e);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .logo-text span {
            color: var(--accent-primary);
            -webkit-text-fill-color: var(--accent-primary);
        }

        .toolbar {
            display: flex;
            gap: 12px;
            background: rgba(255, 255, 255, 0.03);
            padding: 6px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            position: relative;
        }

        .tool-btn {
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-dim);
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }

        .tool-btn.compact {
            padding: 7px 10px;
            gap: 6px;
            font-size: 0.82rem;
        }

        .tool-btn:hover {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.05);
        }

        .tool-btn.active {
            background: rgba(0, 242, 255, 0.1);
            color: var(--accent-primary);
            border-color: rgba(0, 242, 255, 0.3);
            box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.1);
        }

        .tool-btn:disabled {
            opacity: 0.62;
            cursor: not-allowed;
            filter: saturate(0.82);
        }

        .copy-action-button {
            position: relative;
            overflow: hidden;
        }

        .copy-action-button.is-copying,
        .copy-action-button.copy-done {
            opacity: 1 !important;
        }

        .copy-action-button.is-copying {
            pointer-events: none;
        }

        .tool-btn.is-preparing,
        .tool-btn.is-preparing:disabled {
            opacity: 0.82;
            cursor: progress;
            pointer-events: none;
        }

        .tool-btn.is-preparing .copy-spinner {
            width: 14px;
            height: 14px;
            margin-right: 6px;
        }

        body.is-processing #status-bar {
            border-color: rgba(0, 242, 255, 0.32);
            box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 242, 255, 0.08) inset;
        }

        body.is-processing #status-bar::after {
            content: "";
            position: absolute;
            left: 12px;
            right: 12px;
            bottom: 5px;
            height: 2px;
            border-radius: 999px;
            background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
            animation: statusBusySweep 1.25s linear infinite;
            opacity: 0.72;
        }

        @keyframes statusBusySweep {
            from { transform: translateX(-32%); }
            to { transform: translateX(32%); }
        }

        .copy-action-button.copy-done {
            color: var(--accent-success) !important;
        }

        .copy-spinner {
            width: 15px;
            height: 15px;
            border-radius: 999px;
            border: 2px solid currentColor;
            border-right-color: transparent;
            display: inline-block;
            animation: copySpin 0.72s linear infinite;
            flex: 0 0 auto;
        }

        .copy-done-mark {
            width: 16px;
            height: 16px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.82rem;
            font-weight: 900;
            flex: 0 0 auto;
        }

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

        .btn-upload {
            background: var(--accent-primary);
            color: var(--bg-dark);
            border: none;
            padding: 8px 20px;
            font-weight: 700;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-upload:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 15px rgba(0, 242, 255, 0.4);
            background: #00ddec;
        }



        .header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-left: 12px;
        }

        .producer-badge,
        .guide-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 34px;
            padding: 0 10px;
            border-radius: 999px;
            border: 1px solid var(--border-color);
            background: rgba(255, 255, 255, 0.035);
            color: var(--text-dim);
            text-decoration: none;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            white-space: nowrap;
            transition: all 0.2s ease;
        }

        .producer-badge:hover,
        .guide-link:hover {
            color: var(--text-main);
            border-color: rgba(0, 242, 255, 0.25);
            background: rgba(0, 242, 255, 0.08);
        }

        .build-version-badge {
            position: fixed;
            left: 12px;
            top: 72px;
            z-index: 2350;
            pointer-events: none;
            padding: 3px 7px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 999px;
            background: rgba(5, 7, 10, 0.48);
            color: rgba(240, 246, 252, 0.46);
            font-family: "JetBrains Mono", monospace;
            font-size: 10px;
            line-height: 1;
            letter-spacing: 0;
            backdrop-filter: blur(8px);
        }

        body[data-dev-mode="0"] .build-version-badge,
        body[data-dev-mode="0"] .background-analysis-status {
            display: none !important;
        }

        .background-analysis-status {
            position: fixed;
            left: 12px;
            top: 92px;
            z-index: 2350;
            pointer-events: none;
            padding: 4px 8px;
            border: 1px solid rgba(0, 242, 255, 0.12);
            border-radius: 999px;
            background: rgba(5, 7, 10, 0.58);
            color: rgba(240, 246, 252, 0.62);
            font-family: "JetBrains Mono", monospace;
            font-size: 10px;
            line-height: 1;
            letter-spacing: 0;
            backdrop-filter: blur(8px);
            opacity: 0;
            transform: translateY(-2px);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .background-analysis-status.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .background-analysis-status.running,
        .background-analysis-status.alignment {
            color: rgba(0, 242, 255, 0.82);
            border-color: rgba(0, 242, 255, 0.22);
        }

        .background-analysis-status.done {
            color: rgba(0, 255, 136, 0.72);
            border-color: rgba(0, 255, 136, 0.18);
        }

        .language-control {
            position: relative;
            height: 34px;
            min-width: 118px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 24px 0 10px;
            border-radius: 999px;
            border: 1px solid var(--border-color);
            background: rgba(255, 255, 255, 0.035);
            color: var(--text-dim);
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .language-control:hover,
        .language-control:focus-within {
            color: var(--text-main);
            border-color: rgba(0, 242, 255, 0.25);
            background: rgba(0, 242, 255, 0.08);
        }

        .language-flag {
            width: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            line-height: 1;
            pointer-events: none;
        }

        .language-current {
            color: inherit;
            font-size: 0.72rem;
            font-weight: 700;
            pointer-events: none;
        }

        .language-chevron {
            position: absolute;
            right: 9px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-dim);
            font-size: 0.66rem;
            opacity: 0.72;
            pointer-events: none;
        }

        .language-control select {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
            border: 0;
            appearance: none;
            -webkit-appearance: none;
        }

        .language-switch {
            display: inline-flex;
        }


        /* Release visual polish and mobile comfort */
        html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
        button, a, input, select, label { touch-action: manipulation; }
        .logo-icon { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.96); }
        .logo-mark-img { width: 24px; height: 24px; display: block; border-radius: 7px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0,0,0,0.32)); }
        .logo-icon::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(120deg, transparent 35%, rgba(0,242,255,0.32) 50%, transparent 65%); transform: translateX(-120%) rotate(12deg); animation: logoSweep 6.5s ease-in-out infinite; pointer-events: none; }
        @keyframes logoSweep { 0%, 68% { transform: translateX(-120%) rotate(12deg); opacity: 0; } 76% { opacity: 1; } 92%, 100% { transform: translateX(120%) rotate(12deg); opacity: 0; } }
        @keyframes softFloatIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
        @keyframes quietPulse { 0%, 100% { box-shadow: 0 0 0 rgba(0,242,255,0); } 50% { box-shadow: 0 0 24px rgba(0,242,255,0.12); } }
        .empty-upload-card { animation: softFloatIn 0.34s ease both; }
        body:not(.no-image) .side-stack, .filter-panel.visible, .auto-panel.visible, .alignment-preview-panel.visible { animation: softFloatIn 0.34s ease both; }
        .tool-btn:hover, .btn-upload:hover, .guide-link:hover, .producer-badge:hover, .empty-upload-btn:hover, .mini-btn:hover { transform: translateY(-1px); }
        .tool-btn.active, .image-thumb.active, .preset-btn.active { animation: quietPulse 3.8s ease-in-out infinite; }
        .app-toast.visible { animation: softFloatIn 0.22s ease both; }
        button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, label.language-control:focus-within { outline: 2px solid rgba(0, 242, 255, 0.55); outline-offset: 2px; }
        input[type="range"] { accent-color: var(--accent-primary); }
        .side-stack, .filter-panel, .auto-panel, .alignment-preview-panel, .floating-panel { border-color: rgba(0, 242, 255, 0.12); box-shadow: 0 18px 48px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.018); }
        .filter-panel, .auto-panel, .alignment-preview-panel { z-index: 2100; }
        .notification-center { z-index: 2400; }
        @media (hover: none) { .tool-btn:hover, .btn-upload:hover, .guide-link:hover, .producer-badge:hover, .empty-upload-btn:hover, .mini-btn:hover { transform: none; } }

        @media (max-width: 1180px) {
            .producer-badge { display: none; }
            .guide-link { padding: 0 9px; }
        }

        @media (max-width: 980px) {
            header { gap: 10px; padding: 0 12px; }
            .logo-text { font-size: 1rem; }
            .header-actions { gap: 6px; margin-left: 4px; }
            .guide-link, .producer-badge { display: inline-flex; height: 32px; padding: 0 8px; font-size: 0.68rem; }
            .language-control { min-width: 108px; height: 32px; padding: 0; }
            .language-control select { position: static; opacity: 1; width: 100%; height: 100%; padding: 0 22px 0 9px; color: var(--text-dim); background: transparent; }
            .language-flag, .language-current { display: none; }
        }
        #file-input { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
