/* ===== CSS Variables ===== */
        :root {
            /* Primary Color Palette */
            --primary-50: #eff6ff;
            --primary-100: #dbeafe;
            --primary-200: #bfdbfe;
            --primary-300: #93c5fd;
            --primary-400: #60a5fa;
            --primary-500: #3b82f6;
            --primary-600: #1a56db;
            --primary-700: #1e40af;
            --primary-800: #1e3a8a;
            --primary-900: #1e3a70;

            --primary: var(--primary-600);
            --primary-hover: var(--primary-700);
            --primary-subtle: var(--primary-50);
            --primary-ring: rgba(26,86,219,0.12);

            /* Background & Surface */
            --bg: #f8fafc;
            --sidebar-bg: #0f172a;
            --sidebar-text: #94a3b8;
            --sidebar-active-bg: #1e293b;
            --sidebar-width: 280px;
            --card-bg: #ffffff;

            /* Text Colors */
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;

            /* Border & Divider */
            --border: #e2e8f0;
            --border-light: #f1f5f9;

            /* Shadows - Premium Multi-layer */
            --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
            --shadow-md: 0 4px 8px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
            --shadow-lg: 0 12px 24px rgba(0,0,0,0.12), 0 6px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
            --shadow-xl: 0 20px 40px rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
            --shadow-2xl: 0 30px 60px rgba(0,0,0,0.2), 0 15px 30px rgba(0,0,0,0.12);

            /* Glassmorphism */
            --glass-bg: rgba(255, 255, 255, 0.7);
            --glass-border: rgba(255, 255, 255, 0.18);
            --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

            /* Transitions */
            --transition-fast: 0.15s ease;
            --transition: 0.2s ease;
            --transition-slow: 0.3s ease;

            /* Border Radius */
            --radius-sm: 6px;
            --radius: 8px;
            --radius-lg: 12px;
            --radius-xl: 16px;

            /* Spacing - Enhanced */
            --spacing-xs: 4px;
            --spacing-sm: 8px;
            --spacing-md: 16px;
            --spacing-lg: 24px;
            --spacing-xl: 32px;
            --spacing-2xl: 48px;

            /* Layout rhythm */
            --content-max-width: 1120px;
            --card-pad-y: 30px;
            --card-pad-x: 34px;
            --field-min-height: 44px;

            /* Glow Effects */
            --glow-primary: 0 0 20px rgba(59, 130, 246, 0.15);
            --glow-primary-strong: 0 0 30px rgba(59, 130, 246, 0.25), 0 0 60px rgba(59, 130, 246, 0.1);

            /* Component-specific */
            --label-color: #475569;
            --input-border: #cbd5e1;
            --input-bg: #ffffff;
            --upload-bg: #f8fafc;
            --upload-border: #cbd5e1;
            --upload-hover-bg: var(--primary-50);
            --upload-hover-border: var(--primary);
            --upload-dragover-bg: var(--primary-100);
            --upload-hint: #94a3b8;
            --error-bg: #fef2f2;
            --error-border: #fecaca;
            --error-text: #991b1b;
            --success-bg: #f0fdf4;
            --success-border: #bbf7d0;
            --success-text: #166534;
            --cmt-hover: #f8fafc;
            --cmt-reply-bg: #f0f7ff;
            --toast-success: #22c55e;
            --toast-error: #ef4444;
            --spinner-border: #e2e8f0;
        }

        /* ===== Reset & Base ===== */
        *, *::before, *::after { box-sizing: border-box; }
        #root,
        [data-react-frontstage] {
            width: 100%;
            min-height: 100vh;
        }
        body {
            font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
            margin: 0;
            display: flex;
            min-height: 100vh;
            position: relative;
            background:
                radial-gradient(ellipse 800px 600px at 20% 40%, rgba(59,130,246,0.08) 0%, transparent 50%),
                radial-gradient(ellipse 600px 800px at 80% 60%, rgba(139,92,246,0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(59,130,246,0.02) 0%, transparent 100%),
                var(--bg);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* ===== Lucide Icons Styling ===== */
        [data-lucide] {
            display: inline-block;
            vertical-align: middle;
            flex-shrink: 0;
        }
        .menu-icon {
            display: inline-block;
            width: 16px;
            height: 16px;
            margin-right: 10px;
            flex-shrink: 0;
            stroke-width: 2;
        }
        .section-icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 8px;
            stroke-width: 2;
        }
        .btn-icon {
            display: inline-block;
            width: 16px;
            height: 16px;
            margin-right: 6px;
            stroke-width: 2;
        }
        .panel-icon {
            display: inline-block;
            width: 18px;
            height: 18px;
            stroke-width: 2;
        }
        .check-icon {
            display: inline-block;
            width: 18px;
            height: 18px;
            stroke-width: 2;
        }
        .copy-icon {
            display: inline-block;
            width: 14px;
            height: 14px;
            stroke-width: 2;
        }
        .upload-icon {
            display: inline-block;
            width: 16px;
            height: 16px;
            margin-right: 6px;
            stroke-width: 2;
        }
        .alert-icon {
            display: inline-block;
            width: 18px;
            height: 18px;
            stroke-width: 2;
        }

        /* ===== Sidebar ===== */
        .sidebar {
            width: var(--sidebar-width);
            background: linear-gradient(180deg, #020617 0%, #0a0f1e 100%);
            display: flex;
            flex-direction: column;
            padding: 20px 0 0 0;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 100;
            transition: transform var(--transition);
            box-shadow: 4px 0 24px rgba(0,0,0,0.3);
            border-right: 1px solid rgba(59,130,246,0.1);
        }
        .sidebar-menu {
            overflow-y: auto;
            flex: 1 1 0%;
            min-height: 0;
            padding-bottom: 20px;
            scrollbar-width: thin;
            scrollbar-color: #334155 transparent;
        }
        .sidebar-menu::-webkit-scrollbar { width: 5px; }
        .sidebar-menu::-webkit-scrollbar-track { background: transparent; }
        .sidebar-menu::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
        .sidebar-menu::-webkit-scrollbar-thumb:hover { background: #475569; }
        .sidebar-header {
            padding: 0 20px 20px;
            border-bottom: 1px solid rgba(59,130,246,0.15);
            margin-bottom: 10px;
            font-weight: 700;
            color: #f1f5f9;
            font-size: 17px;
            display: flex;
            align-items: center;
            gap: 10px;
            letter-spacing: -0.01em;
            position: relative;
        }
        .sidebar-header::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 20px;
            right: 20px;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
        }
        .sidebar-header svg {
            flex-shrink: 0;
            stroke: #f1f5f9;
        }
        .sidebar-version {
            font-size: 9px;
            font-weight: 400;
            color: rgba(255,255,255,0.25);
            margin-left: auto;
            white-space: nowrap;
            letter-spacing: 0.8px;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 3px;
            padding: 1px 5px;
            line-height: 1.5;
        }
        .menu-item {
            padding: 11px 20px;
            cursor: pointer;
            color: var(--sidebar-text);
            transition: background-color 0.18s ease, color 0.18s ease, border-left-color 0.18s ease, box-shadow 0.18s ease;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            font-size: 14px;
            font-weight: 600;
            line-height: 1.5;
            min-height: 42px;
            flex-shrink: 0;
            position: relative;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
            outline: none;
            border-left: 3px solid transparent;
            transform: none;
        }
        .menu-item:hover,
        .menu-item:focus-visible {
            background: rgba(255,255,255,0.06);
            color: #e2e8f0;
            transform: none;
        }
        .menu-item.active {
            background: linear-gradient(90deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%);
            color: #f1f5f9;
            border-left-color: var(--primary);
            box-shadow: inset 0 0 20px rgba(59,130,246,0.1);
        }
        .menu-item.disabled {
            color: rgba(255,255,255,0.25);
            cursor: not-allowed;
        }
        .badge {
            margin-left: auto;
            font-size: 10px;
            background: rgba(255,255,255,0.1);
            color: var(--sidebar-text);
            padding: 2px 8px;
            border-radius: 10px;
            white-space: nowrap;
        }

        /* ===== Mobile Menu Toggle ===== */
        .menu-toggle {
            display: none;
            position: fixed;
            top: 10px;
            left: 10px;
            z-index: 200;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            padding: 10px 14px;
            font-size: 20px;
            cursor: pointer;
        }
        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            z-index: 99;
        }
        .menu-group-label {
            padding: 20px 20px 6px;
            font-size: 10px;
            font-weight: 600;
            line-height: 1.2;
            min-height: 38px;
            flex-shrink: 0;
            color: rgba(255,255,255,0.3);
            text-transform: uppercase;
            letter-spacing: 1px;
            cursor: default;
            user-select: none;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            background: transparent;
            transform: none;
        }
        .menu-group-label:first-of-type {
            padding-top: 16px;
        }
        .menu-item.sub {
            padding-left: 20px;
            font-size: 13px;
        }

        /* ===== Skeleton Loading ===== */
        .skeleton {
            background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
            border-radius: 6px;
            height: 20px;
            margin: 6px 0;
        }
        @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
        .skeleton-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px 16px;
            padding: 10px 0;
        }
        .skeleton-row {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .skeleton-label {
            width: 60px;
            height: 14px;
            flex-shrink: 0;
        }
        .skeleton-value {
            flex: 1;
            height: 18px;
        }

        /* ===== Main Content ===== */
        .main-content {
            flex: 1;
            margin-left: var(--sidebar-width);
            overflow-y: auto;
            padding: 40px;
            min-height: 100vh;
            padding-bottom: 32px;
        }
        .view-section {
            display: none;
            width: 100%;
            max-width: min(var(--content-max-width), calc(100vw - var(--sidebar-width) - 80px));
            margin: 0 auto;
            animation: none;
        }
        .view-section.active {
            display: block;
            opacity: 1;
            animation: viewIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            animation-fill-mode: both;
        }
        .view-section.active.gate-view-section {
            animation: none;
        }
        .sdwan-poc-view {
            max-width: 1480px;
        }
        .sdwan-poc-shell {
            min-height: calc(100vh - 120px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-xl);
            background: var(--glass-bg);
            box-shadow: var(--shadow-md);
            overflow: hidden;
        }
        .sdwan-poc-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 18px 22px;
            border-bottom: 1px solid var(--border);
        }
        .sdwan-poc-header h2 {
            margin: 0;
            font-size: 20px;
        }
        .sdwan-poc-header p {
            margin: 5px 0 0;
            color: var(--text-secondary);
            font-size: 13px;
        }
        .sdwan-poc-frame {
            display: block;
            width: 100%;
            height: calc(100vh - 194px);
            min-height: 760px;
            border: 0;
            background: #07101f;
        }
        @keyframes viewIn {
            from {
                opacity: 0;
                transform: translateY(20px);
                filter: blur(4px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
                filter: blur(0);
            }
        }

        /* ===== Card - Premium Glassmorphism ===== */
        .card {
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: var(--card-pad-y) var(--card-pad-x);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-md);
            margin-bottom: 28px;
            animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            animation-fill-mode: both;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            border: 1px solid var(--glass-border);
            position: relative;
            overflow: hidden;
            will-change: transform;
        }
        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .card:hover {
            box-shadow: var(--shadow-lg);
            border-color: rgba(59,130,246,0.2);
            transform: translateY(-4px);
        }
        .card:hover::before {
            opacity: 1;
        }
        @media (hover: hover) {
            .card:hover {
                transform: translateY(-4px);
            }
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(16px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        h2 {
            margin: 0 0 24px;
            color: var(--text-primary);
            font-size: 22px;
            font-weight: 700;
            text-align: left;
            border-left: 4px solid var(--primary);
            padding-left: 16px;
            display: flex;
            align-items: center;
            line-height: 1.3;
            letter-spacing: -0.02em;
            position: relative;
        }
        h2::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 100%;
            background: linear-gradient(180deg, var(--primary) 0%, rgba(59,130,246,0.3) 100%);
            border-radius: 2px;
        }

        /* ===== Form ===== */
        .input-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px 20px;
            margin-bottom: 20px;
        }
        .topology-input-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
            align-items: end;
        }
        .input-group {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }
        .topology-input-grid .input-group {
            min-width: 0;
            flex-direction: column;
            align-items: stretch;
            margin-bottom: 0;
        }
        label {
            width: 96px;
            flex-shrink: 0;
            font-weight: bold;
            color: var(--label-color);
            font-size: 13px;
        }
        .topology-input-grid label {
            width: auto;
            margin-bottom: 6px;
            font-size: 12px;
            white-space: nowrap;
        }
        input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select {
            flex: 1;
            padding: 11px 14px;
            min-height: var(--field-min-height);
            border: 1.5px solid var(--input-border);
            border-radius: var(--radius);
            outline: none;
            font-size: 14px;
            background: var(--input-bg);
            color: var(--text-primary);
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .topology-input-grid input {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }
        input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, textarea:hover, select:hover {
            border-color: var(--primary-400);
            transform: translateY(-1px);
        }
        input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, textarea:focus, select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--primary-ring), var(--glow-primary);
            transform: translateY(-1px);
        }

        /* ===== Buttons ===== */
        button {
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-weight: 600;
            transition: all var(--transition-fast);
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        button:disabled { opacity: 0.5; cursor: not-allowed; }
        button:active:not(:disabled) { transform: scale(0.97); }
        .btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
            color: white;
            box-shadow: var(--shadow-sm), 0 1px 0 rgba(255,255,255,0.1) inset;
            padding: 11px 24px;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }
        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s ease;
            z-index: -1;
            pointer-events: none;
        }
        .btn-primary:hover::before {
            left: 100%;
        }
        .btn-primary:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }
        .btn-primary:hover:not(:disabled) {
            background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg), var(--glow-primary), 0 1px 0 rgba(255,255,255,0.15) inset;
        }
        .btn-primary:active:not(:disabled) {
            transform: scale(0.98) translateY(0);
            box-shadow: var(--shadow-sm);
        }
        .btn {
            padding: 10px 24px;
            box-shadow: var(--shadow-xs);
        }
        .btn-outline {
            background: rgba(255,255,255,0.5);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            color: var(--primary);
            text-decoration: none;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            border: 1.5px solid var(--primary-200);
            cursor: pointer;
            padding: 11px 24px;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
            z-index: 1;
        }
        .btn-outline::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
            opacity: 0;
            transition: opacity 0.25s ease;
            z-index: -1;
            pointer-events: none;
        }
        .btn-outline:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }
        .btn-outline:hover:not(:disabled) {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md), var(--glow-primary);
        }
        .btn-outline:hover:not(:disabled)::before {
            opacity: 1;
        }
        .btn-outline:active:not(:disabled) {
            transform: scale(0.98) translateY(0);
        }

        /* ===== Button Group (generate + download) ===== */
        .btn-group {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-top: 15px;
            flex-wrap: wrap;
        }
        .btn-group .btn-primary,
        .btn-group .btn-outline {
            padding: 10px 24px;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
        }
        .btn-group .action-bar {
            display: none;
            flex-direction: row;
            gap: 10px;
        }

        /* ===== Result ===== */
        .result-container { margin-top: 30px; text-align: center; }
        .result-container img {
            max-width: 100%;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-xl);
            border: 1px solid var(--glass-border);
            background: var(--card-bg);
            display: none;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .result-container.has-result img {
            display: block;
        }
        .result-container img:hover {
            transform: scale(1.02);
            box-shadow: var(--shadow-2xl);
        }
        .result-placeholder {
            min-height: 280px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            color: var(--text-secondary);
            font-size: 14px;
            border: 2px dashed var(--border);
            border-radius: var(--radius-lg);
            background: linear-gradient(135deg, var(--bg) 0%, rgba(248,250,252,0.5) 100%);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .result-placeholder:hover {
            border-color: var(--primary-300);
            background: linear-gradient(135deg, var(--bg) 0%, var(--primary-50) 100%);
        }
        .result-container.has-result .result-placeholder { display: none; }

        /* ===== Loading Spinner ===== */
        .spinner {
            display: none;
            width: 40px;
            height: 40px;
            border: 4px solid var(--spinner-border);
            border-top-color: var(--primary);
            border-right-color: var(--primary-400);
            border-radius: 50%;
            animation: spin 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
            margin: 20px auto;
            box-shadow: 0 0 20px rgba(59,130,246,0.2);
        }
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* ===== Toast ===== */
        .toast {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 14px 28px;
            border-radius: var(--radius-lg);
            color: white;
            font-weight: 600;
            z-index: 999;
            animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.4s ease 2.6s forwards;
            font-size: 14px;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            background: rgba(0,0,0,0.9);
            box-shadow: var(--shadow-xl);
            border-left: 4px solid transparent;
        }
        .toast.success {
            border-left-color: var(--toast-success);
            box-shadow: var(--shadow-xl), 0 0 20px rgba(34,197,94,0.3);
        }
        .toast.error {
            border-left-color: var(--toast-error);
            box-shadow: var(--shadow-xl), 0 0 20px rgba(239,68,68,0.3);
        }
        @keyframes slideIn {
            from {
                transform: translateX(120%) scale(0.9);
                opacity: 0;
            }
            to {
                transform: translateX(0) scale(1);
                opacity: 1;
            }
        }
        @keyframes fadeOut {
            to {
                opacity: 0;
                transform: translateY(-12px) scale(0.95);
            }
        }

        /* ===== Error Alert ===== */
        .error-alert {
            display: none;
            background: linear-gradient(135deg, var(--error-bg) 0%, rgba(254,242,242,0.8) 100%);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1.5px solid var(--error-border);
            color: var(--error-text);
            padding: 14px 18px;
            border-radius: var(--radius-lg);
            margin-top: 16px;
            font-size: 14px;
            text-align: left;
            word-break: break-all;
            box-shadow: 0 4px 12px rgba(220,38,38,0.15);
        }

        /* ===== Comments ===== */
        .cmt-item {
            border-bottom: 1px solid var(--border);
            padding: 16px 14px;
            border-radius: var(--radius-lg);
            margin-bottom: 6px;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
        }
        .cmt-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--cmt-hover);
            opacity: 0;
            border-radius: var(--radius-lg);
            transition: opacity 0.25s ease;
        }
        .cmt-item:hover::before {
            opacity: 1;
        }
        .cmt-item:hover {
            transform: translateX(4px);
        }
        .cmt-item > * {
            position: relative;
            z-index: 1;
        }
        .cmt-user { font-weight: 600; color: var(--primary); font-size: 14px; }
        .cmt-time { font-size: 11px; color: var(--text-secondary); margin-left: 10px; }
        .cmt-ip { font-size: 11px; color: #94a3b8; margin-left: 10px; font-family: 'Consolas', 'Monaco', monospace; }
        .cmt-content { margin-top: 5px; color: var(--text-primary); font-size: 14px; line-height: 1.6; }
        .cmt-reply {
            margin-top: 8px;
            padding: 8px 12px;
            background: var(--cmt-reply-bg);
            border-left: 3px solid var(--primary);
            border-radius: 4px;
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .cmt-reply-label {
            font-weight: 600;
            color: var(--primary);
            font-size: 12px;
            display: block;
            margin-bottom: 2px;
        }

        /* ===== Footer ===== */
        .footer-beian {
            margin-left: var(--sidebar-width);
            background: rgba(255,255,255,0.8);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            padding: 12px 0;
            text-align: center;
            font-size: 12px;
            color: var(--text-secondary);
            border-top: 1px solid var(--glass-border);
            position: relative;
            z-index: 1;
            box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
        }
        .footer-beian span { font-family: 'Consolas', 'Monaco', monospace; font-size: 11px; }
        .footer-beian a {
            color: var(--text-secondary);
            text-decoration: none;
            margin: 0 10px;
            transition: color 0.15s ease;
        }
        .footer-beian a:hover { color: var(--primary); text-decoration: underline; }
        .beian-icon {
            vertical-align: middle;
            margin-right: 3px;
            position: relative;
            top: -1px;
        }

        /* ===== Empty State ===== */
        #view-empty { text-align: center; padding: 100px; color: #888; }

        /* ===== Report Form ===== */
        .report-section-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--primary);
            margin: 20px 0 12px;
            padding-bottom: 6px;
            border-bottom: 1px solid var(--border);
        }
        .report-section-title:first-of-type { margin-top: 0; }
        .report-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px 20px;
        }
        .report-field {
            display: flex;
            flex-direction: column;
        }
        .smart-screenshot-card {
            margin-bottom: 16px;
            padding: 16px;
            border: 1.5px solid transparent;
            border-radius: var(--radius);
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--upload-bg) 68%) padding-box,
                linear-gradient(90deg, #22d3ee, #60a5fa, #a78bfa, #f472b6, #facc15, #34d399, #22d3ee) border-box;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08), 0 0 18px rgba(96, 165, 250, 0.12);
            cursor: pointer;
            outline: none;
            transition: box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
        }
        .smart-screenshot-card:hover,
        .smart-screenshot-card:focus-within,
        .smart-screenshot-card.dragover {
            box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12), 0 0 26px rgba(244, 114, 182, 0.18);
            filter: saturate(1.05);
        }
        .smart-screenshot-card.dragover {
            transform: translateY(-1px);
        }
        .smart-screenshot-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .smart-screenshot-head strong {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-primary);
            font-size: 14px;
        }
        .smart-screenshot-head p {
            margin: 4px 0 0;
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.5;
        }
        .smart-hidden-input {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }
        .smart-drop-hint {
            margin-top: 12px;
            min-height: 42px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: 1.5px dashed rgba(37, 99, 235, 0.46);
            border-radius: var(--radius-sm);
            background: rgba(255, 255, 255, 0.62);
            color: var(--primary);
            font-size: 12px;
            font-weight: 700;
            text-align: center;
        }
        .smart-screenshot-card.dragover .smart-drop-hint {
            background: rgba(37, 99, 235, 0.12);
            border-color: rgba(37, 99, 235, 0.90);
        }
        .smart-screenshot-error {
            margin-top: 12px;
            padding: 9px 10px;
            border-radius: var(--radius-sm);
            background: var(--error-bg);
            color: var(--error-text);
            font-size: 12px;
        }
        .smart-screenshot-results {
            margin-top: 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .smart-screenshot-row {
            display: grid;
            grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 170px) 58px minmax(150px, 1fr) 42px;
            align-items: center;
            gap: 8px;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--card-bg);
            cursor: default;
        }
        .smart-screenshot-row-head {
            min-height: 34px;
            padding: 8px 10px;
            border-color: rgba(37, 99, 235, 0.18);
            background: rgba(37, 99, 235, 0.08);
            color: var(--primary);
            font-size: 12px;
            font-weight: 800;
        }
        .smart-file-name,
        .smart-reason {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .smart-file-name {
            color: var(--text-primary);
            font-weight: 700;
        }
        .smart-screenshot-row select {
            min-height: 34px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--input-bg);
            color: var(--text-primary);
            padding: 0 8px;
            font-size: 12px;
        }
        .smart-confidence {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 26px;
            border-radius: 999px;
            background: var(--primary-subtle);
            color: var(--primary);
            font-size: 12px;
            font-weight: 700;
        }
        .smart-delete-btn {
            width: 34px;
            height: 34px;
            min-height: 34px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--card-bg);
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0;
            transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
        }
        .smart-delete-btn:hover,
        .smart-delete-btn:focus-visible {
            color: var(--error-text);
            border-color: rgba(220, 38, 38, 0.35);
            background: var(--error-bg);
        }
        .smart-apply-btn {
            align-self: flex-start;
            margin-top: 4px;
        }
        .report-field label {
            width: auto;
            font-weight: 600;
            color: var(--text-primary);
            font-size: 13px;
            margin-bottom: 4px;
        }
        .report-field label .req { color: #dc2626; }
        .report-field input,
        .report-field textarea {
            padding: 9px 12px;
            border: 1.5px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
            background: var(--card-bg);
            color: var(--text-primary);
        }
        .report-field input:focus,
        .report-field textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-ring);
        }
        .report-date-picker {
            position: relative;
        }
        .report-date-picker label {
            cursor: pointer;
        }
        .report-date-trigger {
            width: 100%;
            min-height: 44px;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 12px;
            border: 1.5px solid var(--border);
            border-radius: 6px;
            background: var(--card-bg);
            color: var(--text-primary);
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        }
        .report-date-trigger:hover,
        .report-date-trigger:focus-visible,
        .report-date-trigger[aria-expanded="true"] {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-ring);
            outline: none;
        }
        .report-date-trigger:active {
            transform: translateY(1px);
        }
        .report-date-icon {
            width: 18px;
            height: 18px;
            color: var(--primary);
            flex-shrink: 0;
        }
        .report-date-text {
            flex: 1;
            min-width: 0;
            font-size: 14px;
            font-weight: 600;
        }
        .report-date-caret {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
        }
        .report-calendar-popover {
            position: fixed;
            left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 300;
            width: min(420px, calc(100vw - var(--sidebar-width) - 64px));
            max-height: calc(100vh - 96px);
            overflow-y: auto;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--card-bg);
            box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18), 0 8px 18px rgba(15, 23, 42, 0.08);
        }
        .report-calendar-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 14px;
        }
        .report-calendar-head strong {
            font-size: 16px;
            color: var(--text-primary);
        }
        .report-calendar-nav {
            width: 38px;
            height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg);
            color: var(--text-primary);
            font-size: 24px;
            line-height: 1;
            cursor: pointer;
        }
        .report-calendar-nav:hover,
        .report-calendar-nav:focus-visible {
            border-color: var(--primary);
            color: var(--primary);
            outline: none;
        }
        .report-calendar-weekdays,
        .report-calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, minmax(0, 1fr));
            gap: 6px;
        }
        .report-calendar-weekdays {
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
            text-align: center;
        }
        .report-calendar-day {
            height: 40px;
            border: 1px solid transparent;
            border-radius: 6px;
            background: transparent;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
        }
        .report-calendar-day:hover,
        .report-calendar-day:focus-visible {
            border-color: var(--primary);
            background: var(--primary-subtle);
            color: var(--primary);
            outline: none;
        }
        .report-calendar-day.is-muted {
            color: var(--text-tertiary);
            opacity: 0.7;
        }
        .report-calendar-day.is-today {
            border-color: rgba(26, 86, 219, 0.28);
        }
        .report-calendar-day.is-selected {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
            box-shadow: 0 8px 18px rgba(26, 86, 219, 0.22);
        }
        .report-calendar-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 14px;
        }
        .report-calendar-actions .btn-outline {
            min-height: 34px;
            padding: 7px 12px;
            font-size: 13px;
        }
        .view-section[aria-label="UAT生成器"] .card {
            margin-bottom: 96px;
        }
        .report-upload-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px 20px;
        }
        .report-upload-item {
            display: flex;
            flex-direction: column;
            padding: 12px;
            border: 1px dashed var(--border);
            border-radius: 8px;
            transition: border-color 0.15s ease, background 0.15s ease;
        }
        .report-upload-item:hover {
            border-color: var(--primary);
            background: var(--primary-subtle);
        }
        .report-upload-item label {
            font-weight: 600;
            font-size: 13px;
            color: var(--text-primary);
            margin-bottom: 4px;
            white-space: nowrap;
        }
        .upload-links {
            display: inline-flex;
            flex-wrap: wrap;
            gap: 4px 8px;
        }
        .upload-links a {
            font-size: 11px;
            color: var(--primary);
            text-decoration: none;
            border: 1px solid var(--primary);
            border-radius: 4px;
            padding: 0 6px;
            line-height: 1.8;
            transition: background 0.15s;
            white-space: nowrap;
        }
        .upload-links a:hover {
            background: var(--primary-subtle);
        }
        .file-input-wrap {
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: var(--upload-bg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            border: 2px dashed var(--upload-border);
            border-radius: var(--radius-lg);
            padding: 20px;
            text-align: center;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .file-input-wrap::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, var(--primary-50), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }
        .file-input-wrap input[type="file"] {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }
        .file-input-wrap:hover {
            background: var(--upload-hover-bg);
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md), var(--glow-primary);
        }
        .file-input-wrap:hover::before {
            opacity: 1;
        }
        .file-input-wrap.dragover {
            background: var(--upload-dragover-bg);
            border-color: var(--primary);
            transform: scale(1.02);
            box-shadow: var(--shadow-lg), var(--glow-primary-strong);
        }
        .file-input-wrap.dragover::before {
            opacity: 1;
        }
        .file-input-wrap.has-file {
            border-color: var(--primary);
            background: var(--primary-subtle);
        }
        .file-hint {
            position: relative;
            z-index: 1;
            display: block;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .drag-hint {
            display: block;
            position: relative;
            z-index: 1;
            font-size: 11px;
            color: var(--upload-hint);
            margin-top: 4px;
        }
        .file-input-wrap.has-file .drag-hint {
            color: var(--primary);
            font-weight: 600;
        }
        @media (max-width: 768px) {
            .report-grid,
            .report-upload-grid {
                grid-template-columns: 1fr;
            }
            .report-calendar-popover {
                position: fixed;
                left: 16px;
                right: 16px;
                top: 72px;
                transform: none;
                width: auto;
                max-height: calc(100vh - 112px);
                padding: 14px;
            }
            .report-calendar-day {
                height: 38px;
            }
        }

        /* ===== Invoice Renamer ===== */
        .invoice-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
            gap: 20px;
            align-items: stretch;
        }
        .invoice-panel,
        .invoice-result-card {
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 18px;
            background: var(--card-bg);
        }
        .invoice-dropzone {
            margin-top: 16px;
            min-height: 220px;
            border: 2px dashed var(--upload-border);
            border-radius: var(--radius);
            background: var(--upload-bg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-align: center;
            cursor: pointer;
            transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
            outline: none;
        }
        .invoice-dropzone:hover,
        .invoice-dropzone:focus-visible,
        .invoice-dropzone.dragover {
            border-color: var(--primary);
            background: var(--upload-hover-bg);
            box-shadow: 0 0 0 3px var(--primary-ring);
        }
        .invoice-dropzone.has-files {
            border-color: var(--primary);
            background: var(--primary-subtle);
        }
        .invoice-dropzone input[type="file"] {
            display: none;
        }
        .invoice-drop-icon {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            background: var(--primary-subtle);
        }
        .invoice-drop-icon svg {
            width: 26px;
            height: 26px;
        }
        .invoice-drop-title {
            color: var(--text-primary);
            font-weight: 700;
            font-size: 15px;
            max-width: 90%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .invoice-drop-subtitle {
            color: var(--text-secondary);
            font-size: 12px;
            max-width: 90%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .invoice-error {
            display: none;
            margin-top: 12px;
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--error-border);
            background: var(--error-bg);
            color: var(--error-text);
            font-size: 13px;
        }
        .invoice-error.active {
            display: block;
        }
        .invoice-result-card {
            min-height: 312px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .invoice-result-empty {
            min-height: 230px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            color: var(--text-secondary);
            text-align: center;
            font-size: 14px;
        }
        .invoice-result-empty svg {
            width: 36px;
            height: 36px;
            color: var(--text-tertiary);
        }
        .invoice-result-header {
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 16px;
        }
        .invoice-result-list {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .invoice-result-item {
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            background: var(--card-bg);
        }
        .invoice-item-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }
        .invoice-item-name {
            min-width: 0;
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 700;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .invoice-result-status {
            flex: 0 0 auto;
            border-radius: 999px;
            padding: 4px 9px;
            background: var(--upload-bg);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
        }
        .invoice-result-status.is-loading {
            background: rgba(37, 99, 235, 0.12);
            color: var(--primary);
        }
        .invoice-result-status.is-done {
            background: rgba(22, 163, 74, 0.12);
            color: #16a34a;
        }
        .invoice-result-status.is-error {
            background: var(--error-bg);
            color: var(--error-text);
        }
        .invoice-result-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            align-items: stretch;
        }
        .invoice-meta {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 9px 12px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            background: var(--upload-bg);
        }
        .invoice-meta-label {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
        }
        .invoice-meta-value {
            color: var(--text-primary);
            font-size: 16px;
            font-weight: 700;
            margin-top: 3px;
        }
        .invoice-checkbox-box {
            min-height: 42px;
            border: 1.5px solid var(--border);
            border-radius: 6px;
            padding: 9px 12px;
            display: flex;
            align-items: center;
            gap: 9px;
            background: var(--card-bg);
            color: var(--text-primary);
            cursor: pointer;
            user-select: none;
            font-size: 14px;
            font-weight: 600;
        }
        .invoice-checkbox-box input {
            flex: 0 0 auto;
            width: 16px;
            height: 16px;
            accent-color: var(--primary);
            cursor: pointer;
        }
        .invoice-filename-box {
            margin: 18px 0;
            padding: 12px;
            border-radius: var(--radius);
            background: #0f172a;
            color: #cbd5e1;
            overflow: hidden;
        }
        .invoice-filename-box span {
            display: block;
            font-size: 12px;
            margin-bottom: 5px;
            color: #94a3b8;
        }
        .invoice-filename-box strong {
            display: block;
            color: #86efac;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 13px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .invoice-item-error {
            margin: -6px 0 12px;
            padding: 9px 10px;
            border-radius: var(--radius-sm);
            background: var(--error-bg);
            color: var(--error-text);
            font-size: 12px;
        }
        .invoice-result-actions {
            display: flex;
            justify-content: flex-start;
        }
        @media (max-width: 900px) {
            .invoice-layout,
            .invoice-result-grid {
                grid-template-columns: 1fr;
            }
        }

        /* ===== Mobile Sticky Header (hidden on desktop) ===== */
        .mobile-header { display: none; }

        /* ===== Responsive ===== */
        @media (max-width: 768px) {
            /* ---- Hide old floating menu toggle, use sticky header instead ---- */
            .menu-toggle { display: none; }

            /* ---- Mobile Sticky Header ---- */
            .mobile-header {
                display: flex;
                align-items: center;
                position: sticky;
                top: max(8px, env(safe-area-inset-top));
                z-index: 120;
                width: calc(100% - 24px);
                min-height: 52px;
                margin: 10px auto 12px;
                padding: 7px 10px;
                background: rgba(255,255,255,0.88);
                backdrop-filter: blur(16px);
                -webkit-backdrop-filter: blur(16px);
                border: 1px solid rgba(226,232,240,0.85);
                border-radius: 14px;
                box-shadow: 0 8px 22px rgba(15,23,42,0.08);
                transition: opacity var(--transition), transform var(--transition);
            }
            html.dark .mobile-header {
                background: rgba(15,23,42,0.88);
                border-color: rgba(51,65,85,0.85);
                box-shadow: 0 10px 26px rgba(0,0,0,0.28);
            }
            html.dark .mobile-header .mobile-header-btn {
                color: #f1f5f9;
            }
            .mobile-header-btn {
                background: var(--primary);
                color: white;
                border: none;
                border-radius: 10px;
                width: 42px;
                height: 38px;
                padding: 0;
                font-size: 19px;
                cursor: pointer;
                margin-right: 11px;
                flex-shrink: 0;
                line-height: 1;
                box-shadow: 0 6px 14px rgba(26,86,219,0.28);
            }
            .mobile-header-btn:active {
                transform: scale(0.95);
            }
            .mobile-header-title {
                font-size: 17px;
                font-weight: 700;
                color: var(--text-primary);
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                letter-spacing: 0;
            }

            /* ---- Sidebar ---- */
            .sidebar {
                width: min(84vw, 320px);
                z-index: 240;
                padding-top: max(16px, env(safe-area-inset-top));
                transform: translateX(-100%);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .sidebar-overlay {
                z-index: 220;
                background: rgba(2,6,23,0.46);
                backdrop-filter: blur(2px);
                -webkit-backdrop-filter: blur(2px);
            }
            .sidebar-overlay.active { display: block; }
            body.sidebar-open .mobile-header {
                opacity: 0;
                pointer-events: none;
                transform: translateY(-8px);
            }
            body.sidebar-open {
                overflow: hidden;
            }

            /* ---- Main Content ---- */
            .main-content {
                margin-left: 0;
                padding: 0 14px 110px;
            }
            .view-section {
                max-width: 100%;
                min-width: 0;
                margin: 0;
            }

            /* ---- Form Inputs ---- */
            .input-grid {
                grid-template-columns: 1fr;
            }
            .topology-input-grid {
                grid-template-columns: 1fr;
            }
            .input-group {
                flex-direction: column;
                align-items: stretch;
            }
            .input-group label {
                width: auto;
                margin-bottom: 4px;
            }

            /* ---- Cards ---- */
            .card {
                width: 100%;
                min-width: 0;
                padding: 20px 18px;
            }

            /* ---- Buttons ---- */
            .btn-group {
                gap: 8px;
            }
            .btn-group .btn-primary,
            .btn-group .btn-outline {
                padding: 8px 18px;
                font-size: 13px;
            }

            /* ---- 双IP容器：移动端垂直堆叠 ---- */
            .dual-ip-container {
                display: flex;
                flex-direction: column;
                gap: 20px;
                margin-top: 24px;
            }

            /* ---- 单IP模式也垂直显示 ---- */
            .dual-ip-container.single-mode {
                display: flex;
                flex-direction: column;
                max-width: 100%;
            }

            /* ---- IP面板：移动端优化 ---- */
            .ip-panel {
                width: 100%;
                border-radius: var(--radius-lg);
                overflow: hidden;
            }

            .ip-panel-header {
                padding: 14px 18px;
                font-size: 14px;
                gap: 10px;
            }

            .ip-panel-icon {
                font-size: 18px;
            }

            .ip-panel-badge {
                font-size: 11px;
                padding: 3px 10px;
            }

            /* ---- IP 查询结果：移动端垂直卡片优化 ---- */
            .ip-grid {
                display: flex;
                flex-direction: column;
                gap: 0;
                background: transparent;
                border-radius: 0;
            }

            .ip-item {
                display: flex;
                flex-direction: column;
                padding: 16px 18px;
                background: var(--card-bg);
                border: none;
                border-bottom: 1px solid var(--border);
                text-align: left;
                gap: 6px;
                animation: none;
            }

            .ip-item:nth-child(odd) {
                border-right: none;
            }

            .ip-item:last-child {
                border-bottom: none;
            }

            .ip-label {
                width: auto;
                font-size: 11px;
                color: var(--text-secondary);
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                margin-bottom: 0;
                text-align: left;
                white-space: normal;
                word-wrap: break-word;
                overflow-wrap: break-word;
                line-height: 1.4;
            }

            .ip-value {
                font-size: 15px;
                font-weight: 600;
                color: var(--text-primary);
                text-align: left;
                white-space: normal;
                word-wrap: break-word;
                overflow-wrap: break-word;
                word-break: break-word;
                line-height: 1.5;
            }

            .ip-type-badge {
                font-size: 12px;
                padding: 4px 10px;
                display: inline-block;
                margin-top: 2px;
            }

            /* ---- 移动端暗色模式IP项适配 ---- */
            html.dark .ip-item {
                background: var(--card-bg);
                border-bottom-color: rgba(51, 65, 85, 0.5);
            }

            html.dark .ip-grid {
                background: transparent;
            }

            /* ---- IP 查询输入框 ---- */
            .ip-lookup-form input {
                min-width: 0;
                width: 100%;
            }
            .ip-history-wrap {
                width: 100%;
            }

            /* ---- 文件上传组件：横向紧凑布局 ---- */
            .file-input-wrap {
                display: flex;
                align-items: center;
                gap: 8px;
                padding: 10px 14px;
                text-align: left;
                cursor: pointer;
            }
            .file-input-wrap input[type="file"] {
                position: absolute;
                width: 1px;
                height: 1px;
                opacity: 0;
                pointer-events: none;
            }
            .file-input-wrap::before {
                display: none;
            }
            .drag-hint {
                display: inline;
                font-size: 12px;
                color: var(--primary);
                margin-top: 0;
                white-space: normal;
            }
            .file-hint {
                display: block;
                min-width: 0;
                flex: 1;
            }

            /* ---- Footer ---- */
            .footer-beian {
                margin-left: 0;
                padding: 12px 15px;
                font-size: 12px;
                letter-spacing: 0.5px;
            }
            .footer-beian a {
                display: inline-block;
                margin: 2px 5px;
            }
            .footer-beian span {
                font-size: 12px;
                letter-spacing: 1.5px;
            }

            /* ---- 留言板 ---- */
            .cmt-item {
                padding: 12px 10px;
            }
            .cmt-user {
                font-size: 13px;
            }
            .cmt-content {
                font-size: 13px;
            }

            /* ===== UAT 生成器专项 ===== */

            /* ---- UAT 表单字段 ---- */
            .report-field {
                margin-bottom: 6px;
            }
            .report-field label {
                font-size: 12px;
                margin-bottom: 3px;
            }
            .report-field input,
            .report-field textarea,
            .report-field select {
                font-size: 13px;
                padding: 8px 10px;
            }
            .sdwan-poc-shell {
                min-height: calc(100vh - 92px);
                border-radius: 14px;
            }
            .sdwan-poc-header {
                padding: 14px 16px;
            }
            .sdwan-poc-header h2 {
                font-size: 17px;
            }
            .sdwan-poc-frame {
                height: calc(100vh - 160px);
                min-height: 680px;
            }

            /* ---- UAT 区域标题 ---- */
            .report-section-title {
                font-size: 13px;
                margin: 16px 0 10px;
                padding-bottom: 4px;
            }
            .smart-screenshot-head {
                align-items: stretch;
                flex-direction: column;
            }
            .smart-apply-btn {
                width: 100%;
            }
            .smart-screenshot-row {
                grid-template-columns: 1fr;
                align-items: stretch;
            }
            .smart-reason {
                white-space: normal;
                line-height: 1.5;
            }

            /* ---- UAT 上传项紧凑布局 ---- */
            .report-upload-item {
                padding: 8px 10px;
            }
            .report-upload-item label {
                font-size: 12px;
                margin-bottom: 2px;
            }
            .report-upload-item > div[style*="display:flex"] {
                flex-wrap: nowrap !important;
                overflow-x: auto;
                gap: 4px;
            }

            /* ---- UAT 上传链接缩小 ---- */
            .upload-links a {
                font-size: 10px;
                padding: 0 5px;
                line-height: 1.6;
            }
            .upload-links {
                gap: 3px 6px;
            }

            /* ---- UAT 用途文本域 ---- */
            #rpt_purpose {
                font-size: 13px;
                padding: 8px 10px;
            }

            /* ---- UAT 底部按钮全宽 ---- */
            #view-report .btn-group {
                margin-top: 16px;
                flex-direction: column;
            }
            #view-report .btn-group .btn-primary {
                width: 100%;
                padding: 12px 20px;
                font-size: 15px;
            }
        }

        @media (max-width: 480px) {
            .card { padding: 15px; }
            h2 { font-size: 16px; }
            .btn-row { flex-direction: column; align-items: stretch; }
        }

        /* ===== 双IP容器（PC端） ===== */
        @media (min-width: 769px) {
            .dual-ip-container {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 16px;
                margin-top: 20px;
            }
            .dual-ip-container.single-mode {
                grid-template-columns: 1fr;
                max-width: 600px;
                margin: 0 auto;
            }
        }

        /* ===== DNS检查卡片悬停动效 ===== */
        .dns-check-card {
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform;
        }
        .dns-check-card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        /* ===== IPv6检查卡片悬停动效 ===== */
        .ipv6-check-card {
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform;
        }
        .ipv6-check-card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        /* ===== 测速卡片悬停动效 ===== */
        .speedtest-card {
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform;
        }
        .speedtest-card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        /* ===== IP面板卡片 ===== */
        .ip-panel {
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-md);
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform;
        }
        .ip-panel:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }
        .ip-panel-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 18px;
            font-weight: 700;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            position: relative;
            overflow: hidden;
        }
        .ip-panel-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
        }
        .ip-panel-domestic .ip-panel-header {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            color: #1e40af;
        }
        .ip-panel-foreign .ip-panel-header {
            background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
            color: #065f46;
        }
        .ip-panel-single .ip-panel-header {
            background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
            color: #854d0e;
        }
        .ip-panel-icon {
            font-size: 16px;
        }
        .ip-panel-title {
            flex: 1;
        }
        .ip-panel-badge {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 10px;
            white-space: nowrap;
        }
        .ip-panel-domestic .ip-panel-badge {
            background: rgba(26,86,219,0.1);
            color: #1e40af;
        }
        .ip-panel-foreign .ip-panel-badge {
            background: rgba(22,163,74,0.1);
            color: #065f46;
        }
        .ip-panel .ip-result {
            margin-top: 0;
            border: none;
            border-radius: 0;
            display: block;
        }
        .ip-panel .ip-grid {
            border-radius: 0;
        }
        .ip-panel-reveal {
            animation: panelReveal 0.4s ease-out;
        }
        @keyframes panelReveal {
            from { opacity: 0; transform: translateX(20px); }
            to   { opacity: 1; transform: translateX(0); }
        }
        .ip-panel .ip-item:last-child,
        .ip-panel .ip-item:nth-last-child(2) {
            border-bottom: none;
        }

        /* ===== 国际IP获取失败提示 ===== */
        .ip-foreign-error {
            margin-top: 12px;
            padding: 10px 14px;
            background: #fefce8;
            border: 1px solid #fde68a;
            border-radius: 8px;
            font-size: 13px;
            color: #92400e;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .ip-foreign-error-icon {
            font-size: 16px;
            flex-shrink: 0;
        }

        /* ===== IP 查询结果卡片（双列网格布局） ===== */
        .ip-result {
            margin-top: 20px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            display: none;
        }
        .ip-result.active { display: block; }
        .ip-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }
        .ip-item {
            display: flex;
            align-items: center;
            padding: 11px 16px;
            border-bottom: 1px solid var(--border);
            font-size: 14px;
        }
        .ip-item:nth-child(odd) { border-right: 1px solid var(--border); }
        .ip-item:nth-last-child(-n+2) { border-bottom: none; }
        .ip-label {
            color: var(--text-secondary);
            font-size: 12px;
            width: 70px;
            flex-shrink: 0;
            font-weight: 500;
        }
        .ip-value {
            color: var(--text-primary);
            word-break: break-all;
            font-weight: 500;
        }
        .ip-item {
            animation: fadeInItem 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
        }
        .ip-item:nth-child(1) { animation-delay: 0.04s; }
        .ip-item:nth-child(2) { animation-delay: 0.08s; }
        .ip-item:nth-child(3) { animation-delay: 0.12s; }
        .ip-item:nth-child(4) { animation-delay: 0.16s; }
        .ip-item:nth-child(5) { animation-delay: 0.20s; }
        .ip-item:nth-child(6) { animation-delay: 0.24s; }
        .ip-item:nth-child(7) { animation-delay: 0.28s; }
        .ip-item:nth-child(8) { animation-delay: 0.32s; }
        .ip-item:nth-child(9) { animation-delay: 0.36s; }
        .ip-item:nth-child(10) { animation-delay: 0.40s; }
        .ip-item:nth-child(11) { animation-delay: 0.44s; }
        .ip-item:nth-child(12) { animation-delay: 0.48s; }
        @keyframes fadeInItem {
            from {
                opacity: 0;
                transform: translateY(10px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        .ip-type-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 14px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.02em;
        }
        .ip-type-badge {
            box-shadow: 0 2px 4px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
        }
        .ip-type-hosting {
            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
            color: #dc2626;
            border: 1px solid rgba(220,38,38,0.2);
        }
        .ip-type-isp {
            background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
            color: #16a34a;
            border: 1px solid rgba(22,163,74,0.2);
        }
        .ip-type-business {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            color: #2563eb;
            border: 1px solid rgba(37,99,235,0.2);
        }
        .ip-type-unknown {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            color: #64748b;
            border: 1px solid rgba(148,163,184,0.2);
        }
        .ip-lookup-form {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }
        .ip-lookup-form input {
            min-width: 200px;
            padding: 11px 16px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius);
            font-size: 14px;
            outline: none;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            font-family: 'Consolas', 'Monaco', monospace;
            background: rgba(248,250,252,0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        .ip-lookup-form input:hover {
            border-color: var(--primary-400);
            transform: translateY(-1px);
        }
        .ip-lookup-form input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--primary-ring), var(--glow-primary);
            transform: translateY(-1px);
        }
        .ip-lookup-form .btn-primary {
            padding: 10px 24px;
            font-size: 14px;
            white-space: nowrap;
        }
        .ip-loading {
            display: none;
            margin-top: 20px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 14px;
        }
        .ip-loading.active { display: block; }
        .ip-error {
            display: none;
            margin-top: 20px;
            background: var(--error-bg);
            border: 1px solid var(--error-border);
            color: var(--error-text);
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 14px;
        }
        .ip-error.active { display: block; }
        .ip-intro {
            color: var(--text-secondary);
            font-size: 13px;
            margin: -8px 0 20px;
            line-height: 1.6;
        }

        /* ===== IP Copy Button ===== */
        .ip-copy-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 13px;
            padding: 2px 6px;
            border-radius: 4px;
            opacity: 0;
            transition: opacity 0.15s ease, background 0.15s ease;
            vertical-align: middle;
        }
        .ip-item:hover .ip-copy-btn {
            opacity: 0.7;
        }
        .ip-copy-btn:hover {
            opacity: 1 !important;
            background: var(--primary-subtle);
        }
        .ip-copy-btn.copied {
            opacity: 1;
            color: #16a34a;
        }

        /* ===== IP History Dropdown ===== */
        .ip-history-wrap {
            position: relative;
            flex: 1;
            min-width: 200px;
        }
        .ip-history-wrap input {
            width: 100%;
            box-sizing: border-box;
        }
        .ip-history-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 0 0 8px 8px;
            box-shadow: var(--shadow-lg);
            z-index: 50;
            max-height: 200px;
            overflow-y: auto;
        }
        .ip-history-dropdown.active { display: block; }
        .ip-history-item {
            padding: 8px 14px;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 13px;
            cursor: pointer;
            color: var(--text-primary);
            transition: background 0.1s ease;
            border-bottom: 1px solid var(--border);
        }
        .ip-history-item:last-child { border-bottom: none; }
        .ip-history-item:hover { background: var(--primary-subtle); }
        .ip-history-item .clear-btn {
            float: right;
            color: var(--text-secondary);
            font-size: 11px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 2px 6px;
        }
        .ip-history-item .clear-btn:hover { color: #dc2626; }

        /* ===== Empty State ===== */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-secondary);
        }
        .empty-state svg {
            width: 48px;
            height: 48px;
            stroke: var(--text-secondary);
            opacity: 0.4;
            margin-bottom: 12px;
        }
        .empty-state p {
            font-size: 14px;
            margin: 0;
        }

        /* ===== Dark Mode - Enhanced ===== */
        html.dark {
            --bg: #0a0f1e;
            --card-bg: rgba(30, 41, 59, 0.6);
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --border: #334155;
            --sidebar-bg: #020617;
            --sidebar-text: #64748b;
            --sidebar-active-bg: #1e293b;
            --primary-subtle: rgba(59,130,246,0.15);
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
            --shadow-md: 0 4px 16px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
            --shadow-lg: 0 12px 32px rgba(0,0,0,0.6), 0 6px 16px rgba(0,0,0,0.4);
            --label-color: #94a3b8;
            --input-border: #475569;
            --input-bg: rgba(30, 41, 59, 0.8);
            --upload-bg: rgba(30, 41, 59, 0.6);
            --upload-border: #334155;
            --upload-hover-bg: rgba(59,130,246,0.1);
            --upload-dragover-bg: rgba(59,130,246,0.15);
            --upload-hint: #64748b;
            --error-bg: rgba(59,17,17,0.6);
            --error-border: #581c1c;
            --error-text: #fca5a5;
            --cmt-hover: rgba(30,41,59,0.5);
            --cmt-reply-bg: rgba(30,41,59,0.6);
            --spinner-border: #475569;
            --glass-bg: rgba(30, 41, 59, 0.4);
            --glass-border: rgba(148, 163, 184, 0.1);
            --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            --glow-primary: 0 0 24px rgba(59, 130, 246, 0.2);
            --glow-primary-strong: 0 0 40px rgba(59, 130, 246, 0.3), 0 0 80px rgba(59, 130, 246, 0.15);
        }
        html.dark body {
            background:
                radial-gradient(ellipse 800px 600px at 20% 40%, rgba(59,130,246,0.15) 0%, transparent 50%),
                radial-gradient(ellipse 600px 800px at 80% 60%, rgba(139,92,246,0.12) 0%, transparent 50%),
                radial-gradient(circle 400px at 50% 100%, rgba(16,185,129,0.08) 0%, transparent 50%),
                var(--bg);
        }
        html.dark input,
        html.dark textarea {
            background: #1e293b;
            color: #f1f5f9;
            border-color: #334155;
        }
        html.dark input:hover,
        html.dark textarea:hover {
            border-color: #475569;
        }
        html.dark input:focus,
        html.dark textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
        }
        html.dark .cmt-item:hover { background: var(--cmt-hover); }
        html.dark .cmt-reply { background: var(--cmt-reply-bg); }
        html.dark .ip-item { background: var(--card-bg); border-color: #1e293b; }
        html.dark .ip-lookup-form input {
            background: rgba(30,41,59,0.6);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        html.dark .file-input-wrap input[type="file"]::file-selector-button {
            background: #1e293b;
            color: #f1f5f9;
            border-color: #334155;
        }
        html.dark .file-input-wrap input[type="file"]::file-selector-button:hover {
            background: #334155;
        }
        html.dark .footer-beian {
            background: rgba(10,15,30,0.8);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: 0 -4px 16px rgba(0,0,0,0.6);
        }
        html.dark .ip-panel { background: var(--card-bg); border-color: #334155; }
        html.dark .ip-panel-header { border-bottom-color: #334155; }
        html.dark .ip-panel {
            background: var(--glass-bg);
            border-color: var(--glass-border);
        }
        html.dark .ip-panel-domestic .ip-panel-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(30,58,95,0.6) 100%);
            color: #93c5fd;
        }
        html.dark .ip-panel-domestic .ip-panel-header::before {
            background: linear-gradient(90deg, transparent, rgba(147,197,253,0.3), transparent);
        }
        html.dark .ip-panel-foreign .ip-panel-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(20,83,45,0.6) 100%);
            color: #6ee7b7;
        }
        html.dark .ip-panel-foreign .ip-panel-header::before {
            background: linear-gradient(90deg, transparent, rgba(110,231,183,0.3), transparent);
        }
        html.dark .ip-panel-single .ip-panel-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(113,63,18,0.6) 100%);
            color: #fde68a;
        }
        html.dark .ip-panel-single .ip-panel-header::before {
            background: linear-gradient(90deg, transparent, rgba(253,230,138,0.3), transparent);
        }
        html.dark .ip-panel-domestic .ip-panel-badge { background: rgba(147,197,253,0.15); color: #93c5fd; }
        html.dark .ip-panel-foreign .ip-panel-badge { background: rgba(110,231,183,0.15); color: #6ee7b7; }
        html.dark .ip-foreign-error { background: #422006; border-color: #78350f; color: #fde68a; }
        html.dark .ip-grid { background: #0f172a; }
        html.dark .ip-item:nth-child(odd) { border-right-color: #1e293b; }
        html.dark .ip-item { border-bottom-color: #1e293b; }
        html.dark .report-field input,
        html.dark .report-field textarea,
        html.dark .report-field select { background: #1e293b; color: #f1f5f9; border-color: #334155; }
        html.dark .report-date-trigger,
        html.dark .report-calendar-popover {
            background: #1e293b;
            color: #f1f5f9;
            border-color: #334155;
        }
        html.dark .report-calendar-nav {
            background: #0f172a;
            border-color: #334155;
            color: #f1f5f9;
        }
        html.dark .report-calendar-day {
            color: #e2e8f0;
        }
        html.dark .report-calendar-day.is-muted {
            color: #64748b;
        }
        html.dark .report-calendar-day:hover,
        html.dark .report-calendar-day:focus-visible {
            background: rgba(96, 165, 250, 0.16);
        }
        html.dark .report-calendar-day.is-selected {
            color: #fff;
        }
        html.dark .smart-screenshot-card {
            background:
                linear-gradient(180deg, rgba(15, 23, 42, 0.90), var(--upload-bg) 68%) padding-box,
                linear-gradient(90deg, #22d3ee, #60a5fa, #a78bfa, #f472b6, #facc15, #34d399, #22d3ee) border-box;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24), 0 0 18px rgba(96, 165, 250, 0.16);
        }
        html.dark .smart-screenshot-card:hover,
        html.dark .smart-screenshot-card:focus-within,
        html.dark .smart-screenshot-card.dragover {
            box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32), 0 0 26px rgba(34, 211, 238, 0.22);
        }
        html.dark .smart-drop-hint { background: rgba(15, 23, 42, 0.58); }
        html.dark .smart-screenshot-row-head { background: rgba(59, 130, 246, 0.14); }
        html.dark .skeleton { background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%); background-size: 200% 100%; }

        /* ===== Theme Toggle ===== */
        .theme-toggle {
            margin-top: auto !important;
            font-size: 13px !important;
            opacity: 0.8;
            padding: 12px 25px;
            border-top: 1px solid rgba(255,255,255,0.08);
        }
        .theme-toggle:hover { opacity: 1; }
        .theme-toggle:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px var(--primary-ring);
        }

        /* ===== Scrollbar ===== */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
        html.dark ::-webkit-scrollbar-thumb { background: #475569; }
        html.dark         ::-webkit-scrollbar-thumb:hover { background: #64748b; }

        /* ===== Changelog ===== */
        .changelog-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .changelog-entry {
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            background: var(--card-bg);
            overflow: hidden;
            box-shadow: var(--shadow-xs);
        }
        .changelog-entry-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 16px;
            background: linear-gradient(135deg, var(--primary-50), rgba(255,255,255,0.55));
            border-bottom: 1px solid var(--border);
        }
        .changelog-version {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 4px 10px;
            background: var(--primary);
            color: white;
            font-size: 13px;
            font-weight: 800;
            letter-spacing: 0;
            line-height: 1.2;
        }
        .changelog-date {
            color: var(--text-secondary);
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
        }
        .changelog-changes {
            margin: 0;
            padding: 14px 18px 16px 34px;
            color: var(--text-primary);
        }
        .changelog-changes li {
            margin-bottom: 8px;
            font-size: 13px;
            line-height: 1.65;
        }
        .changelog-changes li:last-child {
            margin-bottom: 0;
        }
        html.dark .changelog-entry-header {
            background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(15,23,42,0.75));
        }
        #changelog-container table {
            width: 100%;
            border-collapse: collapse;
        }
        #changelog-container th {
            text-align: left;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            padding: 0 12px 8px;
            border-bottom: 1px solid var(--border);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        #changelog-container td {
            padding: 12px;
            vertical-align: top;
            border-bottom: 1px solid var(--border);
            color: var(--text-primary);
        }
        #changelog-container tr:last-child td { border-bottom: none; }
        #changelog-container .spinner { margin: 40px auto; }

        /* ===== 更新日志验证弹窗 ===== */
        .changelog-gate-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 300;
            display: none;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            animation: gateOverlayFade 0.16s ease-out;
        }
        .changelog-gate-dialog {
            background: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            padding: 32px 28px;
            text-align: center;
            max-width: 360px;
            width: 90%;
            animation: gateDialogIn 0.16s ease-out;
        }
        @keyframes gateOverlayFade {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes gateDialogIn {
            from {
                opacity: 0;
                transform: scale(0.98);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }
        .changelog-gate-icon { font-size: 32px; margin-bottom: 8px; }
        .changelog-gate-dialog h3 { margin: 0 0 8px; font-size: 16px; color: var(--text-primary); }
        .changelog-gate-question { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }
        .changelog-gate-dialog input {
            width: 100%;
            padding: 10px 14px;
            border: 1.5px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            text-align: center;
            outline: none;
            margin-bottom: 8px;
            background: var(--input-bg);
            color: var(--text-primary);
        }
        .changelog-gate-dialog input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-ring);
        }
        .changelog-gate-error {
            color: #dc2626;
            font-size: 13px;
            margin-bottom: 8px;
        }
        .changelog-gate-buttons {
            margin-top: 12px;
            display: flex;
            justify-content: center;
            gap: 10px;
        }
        .changelog-gate-buttons .btn-primary,
        .changelog-gate-buttons .btn-outline {
            padding: 10px 36px;
            font-size: 14px;
        }

        /* ===== DNS 海外解析检查器 ===== */
        .dns-check-card {
            margin-top: 16px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        .dns-check-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 18px;
            font-weight: 700;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
            color: #854d0e;
            position: relative;
        }
        .dns-check-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
        }
        .dns-check-body {
            padding: 14px 16px;
        }
        .dns-check-target {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
            font-size: 13px;
        }
        .dns-check-label { color: var(--text-secondary); }
        .dns-check-value { font-family: 'Consolas', 'Monaco', monospace; color: var(--primary); font-weight: 600; }
        .dns-check-loading {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .dns-spinner {
            width: 14px;
            height: 14px;
            border: 2px solid var(--spinner-border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            display: inline-block;
            flex-shrink: 0;
        }
        .dns-check-result {
            display: none;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 600;
        }
        .dns-ok { color: #16a34a; }
        .dns-fail { color: #dc2626; }

        html.dark .dns-check-card {
            background: var(--glass-bg);
            border-color: var(--glass-border);
        }
        html.dark .dns-check-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(113,63,18,0.6) 100%);
            color: #fde68a;
        }
        html.dark .dns-check-header::before {
            background: linear-gradient(90deg, transparent, rgba(253,230,138,0.3), transparent);
        }

        /* ===== IPv6 出口信息卡片 ===== */
        .ipv6-check-card {
            margin-top: 16px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        .ipv6-check-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 18px;
            font-weight: 700;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            background: linear-gradient(135deg, #f5f3ff 0%, #e9d5ff 100%);
            color: #6b21a8;
            position: relative;
        }
        .ipv6-check-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
        }
        .ipv6-check-body {
            padding: 0;
        }
        .ipv6-check-body .ip-grid {
            border-radius: 0;
        }
        .ipv6-check-body .ip-item:nth-child(odd) { border-right-color: #f0f0f0; }
        .ipv6-check-body .ip-item:nth-last-child(-n+2) { border-bottom: none; }

        html.dark .ipv6-check-card {
            background: var(--glass-bg);
            border-color: var(--glass-border);
        }
        html.dark .ipv6-check-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(59,7,100,0.6) 100%);
            color: #c4b5fd;
        }
        html.dark .ipv6-check-header::before {
            background: linear-gradient(90deg, transparent, rgba(196,181,253,0.3), transparent);
        }
        html.dark .ipv6-check-body .ip-item:nth-child(odd) { border-right-color: #1e293b; }

        /* ===== Cloudflare 网速测试 ===== */
        .speedtest-card {
            margin-top: 16px;
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        .speedtest-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 18px;
            font-weight: 700;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            color: #1e40af;
            position: relative;
        }
        .speedtest-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
        }
        .speedtest-badge {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 10px;
            white-space: nowrap;
            margin-left: auto;
            background: rgba(55,48,163,0.1);
            color: #3730a3;
        }
        .speedtest-body {
            padding: 14px 16px;
        }
        .speedtest-note {
            font-size: 12px;
            color: var(--text-secondary);
            margin: 0 0 14px;
            line-height: 1.5;
        }
        .speedtest-controls {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .speedtest-sizes {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .speedtest-sizes label {
            width: auto;
            font-size: 12px;
            color: var(--text-secondary);
            margin-right: 2px;
        }
        .speedtest-sizes select {
            padding: 4px 8px;
            border: 1px solid var(--border);
            border-radius: 4px;
            font-size: 12px;
            background: var(--input-bg);
            color: var(--text-primary);
            outline: none;
        }
        .speedtest-sizes select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary-ring);
        }
        .speedtest-progress {
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 14px;
        }
        .speedtest-progress-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 3px;
            transition: width 0.3s ease;
            width: 0%;
        }
        .speedtest-metrics {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            margin-bottom: 14px;
        }
        .st-metric {
            text-align: center;
            padding: 8px 4px;
        }
        .st-metric-label {
            display: block;
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 2px;
        }
        .st-metric-value {
            display: block;
            font-size: 22px;
            font-family: 'Consolas', 'Monaco', monospace;
            font-weight: 300;
            color: var(--primary);
            line-height: 1.2;
        }
        .st-metric-unit {
            font-size: 11px;
            color: var(--text-secondary);
        }
        .speedtest-charts {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 14px;
        }
        .st-chart-wrapper {
            position: relative;
            height: 110px;
        }
        .speedtest-result {
            padding: 10px 14px;
            background: #f0fdf4;
            border: 1px solid #bbf7d0;
            border-radius: 6px;
            font-size: 12px;
            color: #166534;
            word-break: break-all;
        }

        /* --- 暗色模式 --- */
        html.dark .speedtest-card {
            background: var(--glass-bg);
            border-color: var(--glass-border);
        }
        html.dark .speedtest-header {
            background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(49,46,129,0.6) 100%);
            color: #a5b4fc;
        }
        html.dark .speedtest-header::before {
            background: linear-gradient(90deg, transparent, rgba(165,180,252,0.3), transparent);
        }
        html.dark .speedtest-badge {
            background: rgba(165,180,252,0.15);
            color: #a5b4fc;
        }
        html.dark .speedtest-progress { background: #334155; }
        html.dark .speedtest-result {
            background: #14532d;
            border-color: #166534;
            color: #86efac;
        }
        html.dark .speedtest-sizes select {
            background: #1e293b;
            color: #f1f5f9;
            border-color: #334155;
        }

        /* --- 移动端 --- */
        @media (max-width: 768px) {
            .speedtest-metrics {
                grid-template-columns: repeat(2, 1fr);
            }
            .speedtest-charts {
                grid-template-columns: 1fr;
            }
            .st-metric-value {
                font-size: 18px;
            }
            .st-chart-wrapper {
                height: 100px;
            }
        }

        /* ===== Software Downloads ===== */
        .software-download-card {
            max-width: 1120px;
            margin: 0 auto;
        }
        .software-loading,
        .software-empty {
            min-height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            color: var(--text-secondary);
            border: 1px dashed var(--border);
            border-radius: var(--radius-lg);
            background: var(--upload-bg);
            font-size: 14px;
        }
        .software-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 16px;
        }
        .software-item {
            min-height: 220px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            padding: 18px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--card-bg);
            box-shadow: var(--shadow-xs);
            transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
        }
        .software-item:hover {
            transform: translateY(-2px);
            border-color: var(--primary-200);
            box-shadow: var(--shadow-md);
        }
        .software-item-head {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }
        .software-icon {
            width: 42px;
            height: 42px;
            flex: 0 0 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            color: var(--primary);
            background: var(--primary-subtle);
        }
        .software-icon svg {
            width: 22px;
            height: 22px;
        }
        .software-title-wrap {
            min-width: 0;
        }
        .software-title-wrap h3 {
            margin: 0;
            color: var(--text-primary);
            font-size: 16px;
            line-height: 1.45;
        }
        .software-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 8px;
        }
        .software-meta span {
            display: inline-flex;
            align-items: center;
            min-height: 22px;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: var(--upload-bg);
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.3;
        }
        .software-description {
            flex: 1;
            margin: 0;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.65;
        }
        .software-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: auto;
        }
        .software-actions .btn-primary,
        .software-actions .btn-outline {
            min-height: 38px;
            text-decoration: none;
        }
        .software-actions button[disabled] {
            opacity: 0.55;
            cursor: not-allowed;
        }
        html.dark .software-item {
            border-color: var(--glass-border);
            background: var(--card-bg);
        }
        html.dark .software-meta span,
        html.dark .software-loading,
        html.dark .software-empty {
            border-color: #334155;
            background: rgba(30, 41, 59, 0.6);
        }
        @media (max-width: 768px) {
            .software-grid {
                grid-template-columns: 1fr;
            }
            .software-item {
                min-height: 0;
                padding: 16px;
            }
            .software-actions .btn-primary,
            .software-actions .btn-outline {
                width: 100%;
            }
        }

        /* ===== 全球延迟测试 & 封锁测试 ===== */
        .pingtest-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .pingtest-controls select,
        .pingtest-controls input {
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 14px;
            background: var(--input-bg);
            color: var(--text-primary);
            outline: none;
        }
        .pingtest-controls select:focus,
        .pingtest-controls input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary-ring);
        }
        .pingtest-status {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 14px;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .pingtest-error {
            margin-bottom: 14px;
            padding: 8px 12px;
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: 6px;
            font-size: 13px;
            color: #dc2626;
        }
        .pingtest-table-wrap {
            overflow-x: auto;
        }
        .pingtest-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .pingtest-table th {
            padding: 6px 10px;
            text-align: left;
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-secondary);
            border-bottom: 2px solid var(--border);
            white-space: nowrap;
        }
        .pingtest-table td {
            padding: 6px 10px;
            border-bottom: 1px solid var(--border);
            font-family: 'Consolas', 'Monaco', monospace;
            white-space: nowrap;
        }
        .pingtest-table td:first-child { font-family: inherit; }
        .pingtest-table tbody tr:hover { background: var(--hover-bg); }
        .pt-green { color: #16a34a; font-weight: 600; }
        .pt-yellow { color: #d97706; font-weight: 600; }
        .pt-loss { color: #dc2626; font-weight: 600; }

        /* Dark mode */
        html.dark .pingtest-error { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
        html.dark .pt-green { color: #4ade80; }
        html.dark .pt-yellow { color: #fbbf24; }
        html.dark .pt-loss { color: #f87171; }
        html.dark .pingtest-table tbody tr:hover { background: #1e293b; }

        }
