        /* ==================== CSS Variables ==================== */
        :root {
            --bg: #09090b;
            --bg-card: #111115;
            --bg-card-hover: #18181d;
            --bg-input: #0a0a0e;
            --border: #27272a;
            --text: #f4f4f5;
            --text-muted: #a1a1aa;
            --text-dim: #71717a;
            --accent: #ef4444;
            --accent-hover: #dc2626;
            --accent-glow: rgba(239, 68, 68, 0.25);
            --accent-soft: rgba(239, 68, 68, 0.12);
            --green: #22c55e;
            --green-soft: rgba(34, 197, 94, 0.12);
            --amber: #f59e0b;
            --amber-soft: rgba(245, 158, 11, 0.12);
            --blue: #3b82f6;
            --blue-soft: rgba(59, 130, 246, 0.12);
            --red-soft: rgba(239, 68, 68, 0.12);
            --radius: 10px;
            --radius-lg: 14px;
        }

        /* Light Theme */
        [data-theme="light"] {
            --bg: #f5f5f7;
            --bg-card: #ffffff;
            --bg-card-hover: #f0f0f2;
            --bg-input: #f9f9fa;
            --border: #e5e5e8;
            --text: #1a1a1e;
            --text-muted: #6b6b76;
            --text-dim: #9999a3;
            --accent: #e53e3e;
            --accent-hover: #c53030;
            --accent-glow: rgba(229, 62, 62, 0.15);
            --accent-soft: rgba(229, 62, 62, 0.08);
            --green: #16a34a;
            --green-soft: rgba(22, 163, 74, 0.08);
            --amber: #d97706;
            --amber-soft: rgba(217, 119, 6, 0.08);
            --blue: #2563eb;
            --blue-soft: rgba(37, 99, 235, 0.08);
            --red-soft: rgba(229, 62, 62, 0.08);
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
        }

        /* ==================== Layout ==================== */
        .layout {
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        /* ==================== Sidebar ==================== */
        .sidebar {
            width: 230px;
            flex-shrink: 0;
            background: var(--bg-card);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            z-index: 20;
        }

        .sidebar-logo {
            padding: 20px 20px 12px;
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: var(--text);
        }
        .sidebar-logo-text {
            display: flex;
            flex-direction: column;
            line-height: 1.2;
        }
        .sidebar-logo-cn {
            font-weight: 700;
            font-size: 15px;
            letter-spacing: -0.01em;
        }
        .sidebar-logo-en {
            font-size: 10px;
            font-weight: 400;
            letter-spacing: 0.02em;
            color: var(--text-dim);
        }
        .sidebar-header {
            display: flex; align-items: center;
        }
        .sidebar-divider { margin: 0 10px; border-top: 1px solid var(--border); }
        .sidebar-logo img {
            width: 28px; height: 28px; border-radius: 7px;
            flex-shrink: 0;
        }
        .sidebar-logo .logo-dot {
            width: 28px; height: 28px; border-radius: 7px;
            background: var(--accent);
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-size: 14px; font-weight: 800;
            flex-shrink: 0;
        }

        .sidebar-nav {
            flex: 1;
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .sidebar-nav a {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 12px; border-radius: 8px;
            font-size: 13px; font-weight: 500;
            color: var(--text-muted); text-decoration: none;
            transition: all 0.15s;
            cursor: pointer;
        }
        .sidebar-nav a:hover {
            color: var(--text);
            background: var(--bg-card-hover);
        }
        .sidebar-nav a.active {
            color: var(--accent);
            background: var(--accent-soft);
        }
        .sidebar-nav a svg {
            width: 18px; height: 18px;
            flex-shrink: 0;
        }
        .sidebar-nav a.nav-logout { display: none; }

        .sidebar-footer {
            padding: 12px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .sidebar-footer .user-info {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 4px;
        }
        .sidebar-footer .user-avatar-sm {
            width: 32px; height: 32px; border-radius: 50%;
            background: var(--accent-soft); color: var(--accent);
            display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 700;
            flex-shrink: 0;
        }
        .sidebar-footer .user-detail {
            flex: 1; min-width: 0;
        }
        .sidebar-footer .user-name {
            font-size: 13px; font-weight: 600; color: var(--text);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .sidebar-footer .user-email {
            font-size: 11px; color: var(--text-dim);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .sidebar-footer .user-info { cursor: pointer; transition: opacity 0.15s; }
        .sidebar-footer .user-info:hover { opacity: 0.8; }

        .theme-toggle {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 4px; border-radius: 8px;
            cursor: pointer; font-size: 12px; color: var(--text-muted);
            border: none; background: none; font-family: inherit;
            transition: all 0.15s; width: 100%; text-align: left;
        }
        .theme-toggle:hover { color: var(--text); background: var(--bg-card-hover); }
        .theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }

        .sidebar-logout {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 4px; border-radius: 8px;
            cursor: pointer; font-size: 12px; color: var(--text-dim);
            border: none; background: none; font-family: inherit;
            transition: all 0.15s; width: 100%; text-align: left;
        }
        .sidebar-logout:hover { color: var(--accent); background: var(--red-soft); }
        .sidebar-logout svg { width: 16px; height: 16px; flex-shrink: 0; }

        /* ==================== Main Content ==================== */
        .main {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .main-header {
            position: sticky; top: 0; z-index: 10;
            background: rgba(9,9,11,0.78);
            backdrop-filter: blur(16px) saturate(1.5);
            -webkit-backdrop-filter: blur(16px) saturate(1.5);
            border-bottom: 1px solid var(--border);
            padding: 0 28px;
            display: flex; align-items: center;
            justify-content: space-between;
            height: 52px;
            flex-shrink: 0;
        }
        [data-theme="light"] .main-header {
            background: rgba(245,245,247,0.82);
        }

        .main-header h1 {
            font-size: 15px; font-weight: 700;
            letter-spacing: -0.01em;
        }
        .main-header .header-right {
            display: flex; align-items: center; gap: 12px;
            font-size: 12px; color: var(--text-dim);
        }
        .header-theme-btn {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 10px; border-radius: 6px;
            cursor: pointer; font-size: 12px; color: var(--text-muted);
            border: 1px solid var(--border); background: var(--bg-card);
            font-family: inherit; transition: all 0.15s;
        }
        .header-theme-btn:hover { color: var(--text); border-color: var(--border-light); }
        .header-theme-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

        /* ── 通知铃铛 ── */
        .notif-wrap { position: relative; }
        .header-notif-btn {
            display: flex; align-items: center; justify-content: center;
            padding: 6px 8px; border-radius: 6px;
            cursor: pointer; color: var(--text-muted);
            border: 1px solid var(--border); background: var(--bg-card);
            font-family: inherit; transition: all 0.15s; position: relative;
        }
        .header-notif-btn:hover { color: var(--text); border-color: var(--border-light); }
        .header-notif-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
        .notif-badge {
            position: absolute; top: -4px; right: -4px;
            min-width: 16px; height: 16px; line-height: 16px;
            padding: 0 4px; border-radius: 999px;
            background: var(--accent); color: #fff;
            font-size: 10px; font-weight: 700; text-align: center;
        }
        /* 通知弹窗 */
        .notif-panel {
            position: absolute; top: 42px; right: 0;
            width: 360px; max-height: 420px;
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.3);
            z-index: 200; display: flex; flex-direction: column; overflow: hidden;
        }
        .notif-panel-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 18px; border-bottom: 1px solid var(--border);
        }
        .notif-panel-title { font-size: 14px; font-weight: 600; }
        .notif-mark-all {
            font-size: 11px; color: var(--blue); background: none; border: none;
            cursor: pointer; font-family: inherit; padding: 2px 6px; border-radius: 4px;
        }
        .notif-mark-all:hover { background: rgba(59,130,246,0.1); }
        .notif-list { flex: 1; overflow-y: auto; }
        .notif-item {
            display: flex; gap: 10px; padding: 14px 18px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            cursor: pointer; transition: background 0.1s;
        }
        .notif-item:hover { background: var(--bg-card-hover); }
        .notif-item.unread { background: rgba(239,68,68,0.04); }
        .notif-item .notif-dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: var(--accent); flex-shrink: 0; margin-top: 6px;
        }
        .notif-item.read .notif-dot { visibility: hidden; }
        .notif-item .notif-body { flex: 1; min-width: 0; }
        .notif-item .notif-title {
            font-size: 13px; font-weight: 500; color: var(--text);
            margin-bottom: 3px; line-height: 1.3;
        }
        .notif-item .notif-content {
            font-size: 12px; color: var(--text-dim);
            line-height: 1.5; white-space: pre-wrap; word-break: break-word;
        }
        .notif-item .notif-time {
            font-size: 11px; color: var(--text-dim); margin-top: 4px;
        }
        .notif-empty {
            padding: 40px; text-align: center;
            font-size: 13px; color: var(--text-dim);
        }

        @media (max-width: 500px) {
            .notif-panel {
                position: fixed; top: 56px; left: 8px; right: 8px; width: auto;
                max-height: 60vh; border-radius: var(--radius);
            }
        }

        .main-body {
            flex: 1;
            padding: 28px;
        }

        /* ==================== Auth Page (login/register) ==================== */
        .auth-overlay {
            display: none;
            position: fixed; inset: 0; z-index: 200;
            background: var(--bg);
            align-items: center; justify-content: center;
            padding: 24px 16px;
        }
        .auth-overlay.active { display: flex; }

        /* Loading splash */
        .loading-overlay {
            display: none;
            position: fixed; inset: 0; z-index: 300;
            background: var(--bg);
            align-items: center; justify-content: center;
            flex-direction: column; gap: 20px;
        }
        .loading-overlay.active { display: flex; }
        .loading-spinner {
            width: 40px; height: 40px;
            border: 3px solid var(--border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .loading-text {
            font-size: 14px; color: var(--text-dim);
            letter-spacing: 0.02em;
        }

        .auth-card {
            width: 100%; max-width: 420px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 28px 28px;
        }
        .auth-logo {
            display: flex; align-items: center; justify-content: center; gap: 10px;
            margin-bottom: 18px;
        }
        .auth-logo img {
            width: 40px; height: 40px; border-radius: 10px;
        }
        .auth-logo span {
            font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
            color: var(--text);
        }
        .auth-theme-btn {
            display: flex; align-items: center; justify-content: center; gap: 6px;
            margin: 16px auto 0;
            padding: 6px 12px; border-radius: 8px;
            border: 1px solid var(--border); background: var(--bg-card);
            color: var(--text-muted); cursor: pointer;
            font-size: 12px; font-family: inherit;
            transition: all 0.15s;
        }
        .auth-theme-btn:hover { color: var(--text); border-color: var(--text-dim); }
        .auth-theme-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

        .auth-card h1 {
            text-align: center; font-size: 20px; font-weight: 700;
            letter-spacing: -0.02em; margin-bottom: 4px;
        }
        .auth-card .subtitle {
            text-align: center; font-size: 12px; color: var(--text-dim);
            margin-bottom: 18px;
        }
        .form-group { margin-bottom: 12px; }
        .form-group label {
            display: block; font-size: 11px; font-weight: 600;
            color: var(--text-dim); margin-bottom: 4px;
            text-transform: uppercase; letter-spacing: 0.04em;
        }
        .form-group input {
            width: 100%; padding: 10px 14px;
            border-radius: 8px; border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text);
            font-size: 14px; font-family: inherit;
            outline: none; transition: border-color 0.2s;
        }
        .form-group input:focus { border-color: var(--accent); }
        .form-group input::placeholder { color: var(--text-dim); }
        .field-error {
            font-size: 11px; color: var(--accent);
            margin-top: 2px; min-height: 0;
        }
        .btn-submit {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: 100%; padding: 11px 24px; border-radius: 8px;
            font-size: 14px; font-weight: 600; cursor: pointer; border: none;
            font-family: inherit; transition: all 0.2s;
            background: var(--accent); color: #fff; margin-top: 2px;
        }
        .btn-submit:hover { background: var(--accent-hover); }
        .btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-submit svg { width: 16px; height: 16px; }
        .switch-link {
            text-align: center; margin-top: 14px;
            font-size: 12px; color: var(--text-dim);
        }
        .switch-link a {
            color: var(--blue); text-decoration: none;
            font-weight: 500; cursor: pointer;
        }
        .switch-link a:hover { text-decoration: underline; }
        .general-error {
            padding: 8px 12px; border-radius: 8px;
            background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
            color: var(--accent); font-size: 12px; margin-bottom: 12px;
            display: none;
        }
        .general-error.show { display: block; }

        @media (max-height: 740px) {
            .auth-overlay {
                padding: 16px 12px;
            }
            .auth-card {
                padding: 20px 18px;
                border-radius: 12px;
            }
            .auth-logo { margin-bottom: 12px; }
            .auth-logo img { width: 30px; height: 30px; border-radius: 8px; }
            .auth-logo span { font-size: 15px; }
            .auth-card h1 { font-size: 17px; margin-bottom: 2px; }
            .auth-card .subtitle { font-size: 11px; margin-bottom: 12px; }
            .form-group { margin-bottom: 10px; }
            .form-group label { font-size: 10px; margin-bottom: 4px; }
            .form-group input { padding: 9px 12px; font-size: 14px; border-radius: 6px; }
            .field-error { min-height: 0; margin-top: 2px; font-size: 10px; }
            .general-error { padding: 8px 12px; margin-bottom: 10px; font-size: 11px; }
            .btn-submit { padding: 11px 20px; font-size: 14px; border-radius: 6px; margin-top: 4px; }
            .btn-submit svg { width: 15px; height: 15px; }
            .switch-link { margin-top: 10px; font-size: 12px; }
            .auth-theme-btn { margin-top: 12px; padding: 6px 12px; font-size: 12px; }
        }

        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .spinner {
            display: inline-block; width: 18px; height: 18px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: #fff; border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        /* ==================== Dashboard Tab ==================== */
        .stats-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px; margin-bottom: 32px;
        }
        .stat-box {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 20px 24px;
        }
        .stat-box-clickable {
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s, transform 0.2s;
        }
        .stat-box-clickable:hover {
            background: var(--bg-card-hover);
            border-color: var(--accent);
            transform: translateY(-1px);
        }
        .stat-box-clickable:active {
            transform: translateY(0);
        }
        .stat-box .stat-value {
            font-size: 30px; font-weight: 800; letter-spacing: -0.02em;
            line-height: 1;
        }
        .stat-box .stat-label {
            font-size: 12px; color: var(--text-dim);
            text-transform: uppercase; letter-spacing: 0.04em;
            margin-top: 6px;
        }
        .stat-value.green { color: var(--green); }
        .stat-value.amber { color: var(--amber); }
        .stat-value.accent { color: var(--accent); }

        /* User summary card in dashboard */
        .user-summary-card {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 24px 28px;
            display: flex; align-items: center; gap: 20px;
            margin-bottom: 20px; flex-wrap: wrap;
        }
        .user-avatar-lg {
            width: 56px; height: 56px; border-radius: 16px;
            background: var(--accent); color: #fff;
            display: flex; align-items: center; justify-content: center;
            font-size: 24px; font-weight: 700; flex-shrink: 0;
        }
        .user-summary-info { flex: 1; min-width: 0; }
        .user-summary-name {
            font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
        }
        .user-summary-email {
            font-size: 13px; color: var(--text-dim); margin-top: 2px;
        }
        .user-summary-meta {
            display: flex; gap: 24px; margin-top: 8px; flex-wrap: wrap;
        }
        .user-summary-meta-item {
            font-size: 12px; color: var(--text-dim);
        }
        .user-summary-meta-item span {
            color: var(--text-muted); font-weight: 500;
        }
        .user-summary-actions {
            display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
        }
        .user-summary-spent {
            font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
        }

        /* Password change modal */
        .pwd-modal-overlay {
            display: none; position: fixed; inset: 0; z-index: 400;
            background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
            align-items: center; justify-content: center;
        }
        .pwd-modal-overlay.active { display: flex; }
        .pwd-modal {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-lg); padding: 32px 28px;
            max-width: 400px; width: 90vw;
        }
        .pwd-modal h3 {
            font-size: 18px; font-weight: 700; margin-bottom: 4px;
        }
        .pwd-modal .modal-sub {
            font-size: 13px; color: var(--text-dim); margin-bottom: 24px;
        }

        /* ==================== License List ==================== */
        .section-title {
            font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
            margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
        }
        .section-title svg { width: 18px; height: 18px; color: var(--text-dim); }

        .license-list {
            display: flex; flex-direction: column; gap: 10px;
            margin-bottom: 40px;
        }
        .license-item {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 18px 22px;
            display: flex; align-items: center; gap: 18px;
            transition: border-color 0.2s;
        }
        .license-item:hover { border-color: var(--accent); }
        .license-icon {
            width: 42px; height: 42px; border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0; font-size: 18px;
        }
        .license-icon.active { background: var(--green-soft); color: var(--green); }
        .license-icon.inactive { background: var(--amber-soft); color: var(--amber); }
        .license-icon.expired { background: rgba(113,113,122,0.08); color: var(--text-dim); }
        .license-icon.unbound { background: var(--blue-soft); color: var(--blue); }
        .license-icon.revoked { background: var(--red-soft); color: var(--accent); }
        .license-info { flex: 1; min-width: 0; }
        .license-info .lic-key {
            font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
            font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
            color: var(--text);
            word-break: break-all;
        }
        .license-info .lic-key-row {
            display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap;
        }
        .license-actions {
            display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
        }
        .license-actions .btn-sm {
            width: 100%; justify-content: center;
        }
        .license-info .lic-meta {
            font-size: 12px; color: var(--text-dim);
            display: flex; gap: 14px; flex-wrap: wrap;
        }
        .license-info .lic-meta span { display: flex; align-items: center; gap: 4px; }
        .license-status {
            flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
            padding: 4px 14px; border-radius: 999px; font-size: 11px; font-weight: 600;
        }
        .lic-key-actions {
            display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
        }
        .lic-key-btn {
            display: inline-flex; align-items: center; justify-content: center;
            width: 26px; height: 26px; border-radius: 6px;
            border: 1px solid transparent; background: transparent;
            color: var(--text-dim); cursor: pointer;
            transition: all 0.15s; font-size: 14px;
            padding: 0; line-height: 1;
        }
        .lic-key-btn:hover {
            background: var(--bg-card-hover); border-color: var(--border); color: var(--text-muted);
        }
        .lic-key-btn.copied {
            color: var(--green); border-color: var(--green); background: var(--green-soft);
        }
        .license-status.active { background: var(--green-soft); color: var(--green); }
        .license-status.inactive { background: var(--amber-soft); color: var(--amber); }
        .license-status.expired { background: rgba(113,113,122,0.08); color: var(--text-dim); }
        .license-status.unbound { background: var(--blue-soft); color: var(--blue); }
        .license-status.revoked { background: var(--red-soft); color: var(--accent); }

        /* Token Bar */
        .token-bar-wrap { margin-top: 8px; }
        .token-bar-label {
            display: flex; justify-content: space-between;
            font-size: 11px; color: var(--text-dim); margin-bottom: 4px;
        }
        .token-bar {
            width: 100%; height: 5px; border-radius: 999px;
            background: rgba(128,128,128,0.12); overflow: hidden;
        }
        .token-bar-fill {
            height: 100%; border-radius: 999px;
            background: var(--green); transition: width 0.5s ease;
        }
        .token-bar-fill.low { background: var(--accent); }
        .token-bar-fill.medium { background: var(--amber); }

        /* Empty State */
        .empty-state {
            background: var(--bg-card); border: 1px dashed var(--border);
            border-radius: var(--radius); padding: 40px 24px;
            margin-bottom: 32px;
            display: flex; flex-direction: column; align-items: center;
            text-align: center;
        }
        .empty-state .empty-icon {
            font-size: 36px; margin-bottom: 10px; opacity: 0.4;
        }
        .empty-state h3 {
            font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted);
        }
        .empty-state p {
            font-size: 13px; color: var(--text-dim);
            margin-bottom: 14px; max-width: 320px;
        }
        .btn-outline {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 9px 20px; border-radius: 999px;
            font-size: 13px; font-weight: 600; text-decoration: none;
            border: 1px solid var(--border); color: var(--text-muted);
            transition: all 0.2s; cursor: pointer;
        }
        .btn-outline:hover {
            border-color: var(--text-dim); color: var(--text);
            text-decoration: none;
        }
        .btn-outline svg { width: 14px; height: 14px; }

        /* ==================== Table Styles ==================== */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
        }
        .card-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex; justify-content: space-between; align-items: center;
            font-size: 14px; font-weight: 600;
        }
        .card-body { padding: 0; overflow-x: auto; }
        .card-body-padded { padding: 20px; }

        /* Profile two-card layout */
        .profile-cards {
            display: flex;
            gap: 16px;
            align-items: flex-start;
        }
        .profile-card {
            flex: 1;
            min-width: 0;
        }
        @media (max-width: 768px) {
            .profile-cards {
                flex-direction: column;
            }
        }

        /* Profile Info */
        .profile-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0;
        }
        .profile-item {
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--border);
        }
        .profile-item:nth-child(odd) {
            border-right: 1px solid var(--border);
        }
        .profile-label {
            font-size: 12px;
            color: var(--text-dim);
            white-space: nowrap;
            min-width: 60px;
        }
        .profile-value {
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
        }
        .profile-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
            background: var(--green-soft);
            color: var(--green);
            white-space: nowrap;
        }

        table {
            width: 100%; border-collapse: collapse;
            font-size: 13px;
        }
        thead {
            background: rgba(128,128,128,0.04);
            border-bottom: 1px solid var(--border);
        }
        th {
            padding: 10px 16px;
            text-align: left;
            font-size: 11px; font-weight: 600;
            color: var(--text-dim);
            text-transform: uppercase; letter-spacing: 0.04em;
            white-space: nowrap;
        }
        td {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            color: var(--text-muted);
        }
        tr:last-child td { border-bottom: none; }
        tr:hover td { background: rgba(128,128,128,0.02); }
        td.mono {
            font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
            font-size: 12px;
        }

        /* Badges */
        .badge {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 2px 10px; border-radius: 999px;
            font-size: 11px; font-weight: 600;
            white-space: nowrap;
        }
        .badge-success { background: var(--green-soft); color: var(--green); }
        .badge-warning { background: var(--amber-soft); color: var(--amber); }
        .badge-muted { background: rgba(128,128,128,0.08); color: var(--text-dim); }
        .badge-danger { background: var(--red-soft); color: var(--accent); }

        /* Search */
        .search-bar {
            display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
        }
        .search-bar input, .search-bar select {
            padding: 8px 14px; border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-input); color: var(--text);
            font-size: 13px; font-family: inherit;
            outline: none;
        }
        .search-bar input:focus, .search-bar select:focus { border-color: var(--accent); }
        .search-bar select {
            width: 120px; cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 10px center;
            padding-right: 32px;
        }
        [data-theme="light"] .search-bar select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239999a3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        }
        .search-bar input { flex: 1; min-width: 180px; }

        .btn-sm {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 8px 16px; border-radius: 8px;
            font-size: 12px; font-weight: 600; text-decoration: none;
            border: 1px solid var(--border);
            background: transparent; color: var(--text-muted);
            cursor: pointer; font-family: inherit;
            transition: all 0.15s;
        }
        .btn-sm:hover { border-color: var(--text-dim); color: var(--text); }
        .btn-sm.btn-primary-sm {
            background: var(--accent); border-color: var(--accent); color: #fff;
        }
        .btn-sm.btn-primary-sm:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
        .btn-sm.btn-danger-sm {
            background: transparent; border-color: #ef4444; color: #ef4444;
        }
        .btn-sm.btn-danger-sm:hover { background: #ef4444; color: #fff; }

        /* ==================== Checkout Modal ==================== */
        .checkout-overlay {
            display: none; position: fixed; inset: 0; z-index: 300;
            background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
            align-items: center; justify-content: center;
        }
        .checkout-overlay.active { display: flex; }
        .checkout-modal {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-lg); padding: 32px 28px;
            max-width: 440px; width: 90vw; max-height: 90vh; overflow-y: auto;
            position: relative;
        }
        .checkout-modal h3 {
            font-size: 18px; font-weight: 700; margin-bottom: 4px;
            text-align: center;
        }
        .checkout-modal .modal-sub {
            font-size: 13px; color: var(--text-dim); text-align: center;
            margin-bottom: 20px;
        }
        .checkout-modal .plan-summary {
            padding: 12px 16px; border-radius: 10px;
            background: rgba(128,128,128,0.05); margin-bottom: 20px;
            text-align: center; font-size: 13px; color: var(--text-muted);
        }
        .checkout-modal .plan-summary strong { color: var(--text); }
        .checkout-modal .btn-pay {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            width: 100%; padding: 13px 24px; border-radius: 10px;
            font-size: 15px; font-weight: 600; cursor: pointer; border: none;
            background: var(--accent); color: #fff; font-family: inherit;
            transition: all 0.2s; margin-top: 4px;
        }
        .checkout-modal .btn-pay:hover { background: var(--accent-hover); }
        .checkout-modal .btn-pay:disabled { opacity: 0.5; cursor: not-allowed; }
        .checkout-modal .btn-pay svg { width: 18px; height: 18px; }
        .checkout-modal .btn-close {
            display: flex; align-items: center; justify-content: center;
            width: 100%; padding: 11px 24px; border-radius: 10px;
            font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--border);
            background: transparent; color: var(--text-muted); font-family: inherit;
            transition: all 0.15s; margin-top: 12px;
        }
        .checkout-modal .btn-close:hover { border-color: var(--text-dim); color: var(--text); }
        .checkout-modal .modal-tabs {
            display: flex; gap: 0; margin-bottom: 20px;
            border-bottom: 2px solid var(--border);
        }
        .checkout-modal .modal-tab {
            flex: 1; padding: 10px 0; text-align: center;
            font-size: 14px; font-weight: 600; color: var(--text-dim);
            cursor: pointer; border-bottom: 2px solid transparent;
            margin-bottom: -2px; transition: all .2s;
        }
        .checkout-modal .modal-tab:hover { color: var(--text); }
        .checkout-modal .modal-tab.active {
            color: var(--accent); border-bottom-color: var(--accent);
        }
        .checkout-modal .modal-tab-content { display: none; }
        .checkout-modal .modal-tab-content.active { display: block; }
        .checkout-modal .order-id-display {
            font-family: "SF Mono","Fira Code","Cascadia Code",monospace;
            padding: 8px 12px; font-size: 12px; border-radius: 8px;
            background: rgba(128,128,128,0.06); word-break: break-all;
            color: var(--text-muted);
        }
        .checkout-modal .order-timer {
            display: flex; align-items: center; gap: 6px;
            font-size: 13px; color: var(--text-muted); margin-bottom: 12px;
        }
        .checkout-modal .order-timer.expiring { color: var(--accent); }
        .checkout-modal .order-timer svg { width: 16px; height: 16px; }
        .checkout-modal .order-timer .timer-val { font-weight: 700; color: var(--text); }
        .checkout-modal .qr-wrap {
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 12px;
        }
        .checkout-modal .qr-tip {
            text-align: center; font-size: 12px; color: var(--text-dim);
            margin-bottom: 8px;
        }
        .checkout-modal .license-note {
            display: flex; align-items: flex-start; gap: 8px;
            font-size: 12px; color: var(--text-dim); padding: 10px 14px;
            border-radius: 8px; background: rgba(128,128,128,0.04);
        }
        .checkout-modal .license-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
        .checkout-modal .restart-link {
            display: block; text-align: center; font-size: 12px;
            color: var(--blue); cursor: pointer; margin-top: 8px;
            text-decoration: none;
        }
        .checkout-modal .restart-link:hover { text-decoration: underline; }
        .checkout-modal .email-readonly {
            padding: 10px 14px; border-radius: 10px;
            background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2);
            font-size: 14px; color: var(--green); cursor: default;
        }

        /* Plan Selection */
        .plan-select-list {
            display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
        }
        .plan-select-item {
            display: flex; align-items: center; gap: 14px;
            padding: 14px 16px; border-radius: 10px;
            border: 1px solid var(--border); background: var(--bg-card);
            cursor: pointer; transition: all 0.2s;
        }
        .plan-select-item:hover { border-color: var(--accent); }
        .plan-select-item.selected {
            border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow);
        }
        .plan-select-item .plan-radio {
            width: 18px; height: 18px; border-radius: 50%;
            border: 2px solid var(--border); flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .plan-select-item.selected .plan-radio {
            border-color: var(--accent); background: var(--accent);
        }
        .plan-select-item.selected .plan-radio::after {
            content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff;
        }
        .plan-select-item .plan-info { flex: 1; min-width: 0; }
        .plan-select-item .plan-info .plan-name {
            font-size: 14px; font-weight: 600; color: var(--text);
        }
        .plan-select-item .plan-info .plan-meta {
            font-size: 12px; color: var(--text-dim); margin-top: 2px;
        }
        .plan-select-item .plan-price {
            font-size: 22px; font-weight: 800; color: var(--text);
            flex-shrink: 0;
        }
        .plan-select-item .plan-price .orig {
            font-size: 12px; color: var(--text-dim);
            text-decoration: line-through; margin-right: 6px;
        }

        /* Success section */
        .pay-success {
            padding: 20px 0; text-align: center;
        }
        .pay-success .success-icon {
            width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
            background: rgba(34,197,94,0.15); display: flex;
            align-items: center; justify-content: center;
        }
        .pay-success .license-key-box {
            padding: 14px 18px; border-radius: 10px;
            border: 2px solid rgba(34,197,94,0.3);
            background: rgba(34,197,94,0.05);
            font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
            font-size: 18px; font-weight: 600; letter-spacing: 0.04em;
            color: var(--green); word-break: break-all; margin-bottom: 16px;
        }
        .pay-success .btn-copy {
            padding: 10px 24px; border-radius: 999px;
            font-size: 14px; font-weight: 600; cursor: pointer; border: none;
            background: var(--green); color: #fff; transition: all 0.15s;
            font-family: inherit; margin-bottom: 4px;
        }
        .pay-success .btn-copy:hover { opacity: 0.9; }

        /* Pagination */
        .pagination {
            display: flex; gap: 4px; align-items: center;
            padding: 16px; justify-content: center;
        }
        .pagination a, .pagination span {
            padding: 6px 12px; border-radius: 6px;
            font-size: 13px; border: 1px solid var(--border);
            text-decoration: none; color: var(--text-muted);
            transition: all 0.15s; cursor: pointer;
        }
        .pagination a:hover {
            border-color: var(--text-dim); color: var(--text);
        }
        .pagination .current {
            background: var(--accent); border-color: var(--accent);
            color: #fff; font-weight: 600;
        }
        .pagination .dots {
            border: none; padding: 6px 4px; color: var(--text-dim);
        }

        /* ==================== Tab Content ==================== */
        .tab-content { display: none; }
        .tab-content.active { display: block; }

        /* ==================== Toast ==================== */
        .toast {
            position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
            z-index: 300; padding: 12px 24px; border-radius: 10px;
            font-size: 14px; font-weight: 500;
            background: var(--bg-card); border: 1px solid var(--border);
            color: var(--text); opacity: 0; pointer-events: none;
            transition: opacity 0.3s, transform 0.3s;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }
        .toast.success { border-color: var(--green); }
        .toast.error { border-color: var(--accent); }

        /* ==================== Mobile Nav Toggle ==================== */
        .mobile-toggle {
            display: none;
            padding: 8px; border-radius: 8px;
            background: none; border: 1px solid var(--border);
            color: var(--text); cursor: pointer;
            flex-shrink: 0;
            align-items: center; justify-content: center;
        }
        .mobile-toggle svg { width: 20px; height: 20px; }
        .mobile-toggle .close-icon { display: none; }
        .mobile-toggle.open .menu-icon { display: none; }
        .mobile-toggle.open .close-icon { display: block; }

        /* ==================== Responsive ==================== */
        @media (max-width: 768px) {
            .layout { flex-direction: column; }
            .sidebar {
                width: 100%; height: auto; position: relative;
                flex-shrink: 1;
                border-right: none; border-bottom: 1px solid var(--border);
            }
            .sidebar-header {
                display: flex; align-items: center;
            }
            .sidebar-logo {
                justify-content: flex-start;
                flex: 1; padding: 16px 16px;
            }
            .sidebar-nav {
                flex-direction: row; overflow-x: auto;
                padding: 8px 12px; gap: 0;
                display: none;
            }
            .sidebar-nav.expanded {
                display: flex; flex-direction: column;
                padding: 4px 12px 12px;
                border-top: 1px solid var(--border);
                animation: slideDown 0.2s ease;
            }
            .sidebar-nav a {
                white-space: nowrap; padding: 10px 12px;
                font-size: 13px; border-radius: 8px;
            }
            .sidebar-nav a svg { display: inline-block; width: 16px; height: 16px; }
            .sidebar-footer {
                display: none;
            }
            .sidebar-nav a.nav-logout { display: flex; }
            .mobile-toggle {
                display: flex;
                margin-right: 12px;
            }
            .sidebar-divider { display: none; }
            .main-body { padding: 20px 16px; }
            .main-header { padding: 0 16px; }
            .main-header h1 { font-size: 13px; }
            .header-right { gap: 8px; }
            .header-theme-btn span { display: none; }
            .header-theme-btn { padding: 6px 8px; }
            .user-summary-card {
                flex-direction: column; align-items: center;
                padding: 20px 16px; gap: 12px; text-align: center;
            }
            .user-summary-info { text-align: center; }
            .user-summary-meta { justify-content: center; }
            .user-summary-actions {
                align-items: center; flex-direction: column;
                flex-wrap: wrap; gap: 12px;
            }
            .user-summary-spent {
                font-size: 20px;
            }
            .stats-row { grid-template-columns: 1fr; }
            .license-item { flex-direction: column; align-items: flex-start; gap: 10px; }
            .search-bar { flex-direction: column; }
            .search-bar select { width: 100%; }
        }

        /* ── Shared Footer ── */
        footer {
            position: relative;
            z-index: 1;
            text-align: center;
            padding: 48px 24px 40px;
            border-top: 1px solid var(--border);
        }
        footer .footer-links {
            display: flex;
            justify-content: center;
            gap: 28px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }
        footer .footer-links a {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 13px;
            transition: color 0.15s;
        }
        footer .footer-links a:hover { color: var(--text); }
        footer .copyright {
            font-size: 12px;
            color: var(--text-dim);
        }
        footer .copyright a {
            color: inherit;
            text-decoration: none;
        }

        /* Payment Method Selector */
        .payment-type-btn {
            display: flex; align-items: center; gap: 6px;
            padding: 10px 18px; border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--bg-card);
            color: var(--text-muted);
            font-size: 14px; font-weight: 500;
            cursor: pointer; transition: all 0.2s;
            font-family: inherit;
        }
        .payment-type-btn:hover {
            border-color: var(--accent);
            color: var(--text);
        }
        .payment-type-btn.active {
            border-color: var(--accent);
            background: rgba(239,68,68,0.08);
            color: var(--text);
        }
        .payment-type-btn.active svg {
            opacity: 1;
        }
        .payment-type-btn svg {
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        /* ==================== Template Store ==================== */
        .store-header {
            margin-bottom: 24px;
        }
        .store-subtitle {
            font-size: 13px; color: var(--text-dim); margin: 0 0 16px;
        }
        .store-categories {
            display: flex; flex-wrap: wrap; gap: 8px;
        }
        .store-cat-btn {
            display: inline-flex; align-items: center;
            padding: 6px 16px; border-radius: 20px;
            font-size: 12px; font-weight: 500; cursor: pointer;
            border: 1px solid var(--border); background: transparent;
            color: var(--text-muted); font-family: inherit;
            transition: all 0.15s;
        }
        .store-cat-btn:hover {
            border-color: var(--text-dim); color: var(--text);
        }
        .store-cat-btn.active {
            border-color: var(--accent); background: rgba(239,68,68,0.08);
            color: var(--accent); font-weight: 600;
        }

        .template-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 14px;
        }
        @media (max-width: 600px) {
            .template-grid { grid-template-columns: 1fr; }
        }
        .template-card {
            background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-lg); padding: 20px;
            display: flex; flex-direction: column; gap: 12px;
            transition: border-color 0.15s;
        }
        .template-card:hover { border-color: var(--text-dim); }
        .template-card-header {
            display: flex; align-items: flex-start; gap: 12px;
        }
        .template-card-icon {
            width: 44px; height: 44px; border-radius: 10px;
            background: var(--bg); display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
            color: var(--text-muted);
        }
        .template-card-icon svg { width: 20px; height: 20px; }
        .template-card-meta { flex: 1; min-width: 0; }
        .template-card-title {
            font-size: 14px; font-weight: 600; color: var(--text);
            margin-bottom: 2px; line-height: 1.3;
        }
        .template-card-category {
            font-size: 11px; color: var(--accent); font-weight: 500;
        }
        .template-card-desc {
            font-size: 12px; color: var(--text-dim); line-height: 1.5;
            flex: 1;
        }
        .template-card-actions {
            display: flex; align-items: center; justify-content: space-between;
            padding-top: 8px; border-top: 1px solid var(--border);
        }
        .template-card-price {
            font-size: 15px; font-weight: 700; color: var(--text);
        }
        .template-card-price .free-badge {
            color: var(--green); font-size: 13px;
        }
        .template-card .btn-install {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 7px 16px; border-radius: 8px;
            font-size: 12px; font-weight: 600; cursor: pointer;
            border: none; font-family: inherit; transition: all 0.15s;
            white-space: nowrap; color: #fff;
        }
        .template-card .btn-install:hover { opacity: 0.85; }
        .template-card .btn-install svg { width: 14px; height: 14px; }
        .btn-download { background: var(--green); }
        .btn-buy { background: var(--accent); }
        .btn-installed { background: var(--border); color: var(--text-dim) !important; cursor: default; }
        .btn-preview-outline {
            background: transparent !important;
            color: var(--text-muted) !important;
            border: 1px solid var(--border) !important;
        }
        .btn-preview-outline:hover {
            border-color: var(--text-dim) !important;
            color: var(--text) !important;
            opacity: 1;
        }
        #templateBuyOverlay .payment-type-btn.active { border-color: #22c55e; background: rgba(34,197,94,0.08); }
        #templateBuyOverlay .payment-type-btn:hover { border-color: #22c55e; }

        /* Template Search */
        .template-search-wrap {
            position: relative;
            margin-bottom: 14px;
        }
        .template-search-input {
            width: 100%;
            padding: 9px 14px 9px 42px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text);
            font-size: 13px;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
        }
        .template-search-input:focus { border-color: var(--accent); }
        .template-search-input::placeholder { color: var(--text-dim); }

        /* ── Template Preview Modal ── */
        .tpl-preview-modal {
            padding: 24px 28px 20px !important;
        }
        .tpl-preview-header {
            padding: 0;
            margin-bottom: 16px;
        }
        .tpl-preview-title {
            font-size: 18px; font-weight: 700; margin-bottom: 4px;
        }
        .tpl-preview-sub {
            font-size: 12px; color: var(--text-dim); margin-bottom: 0;
        }
        .tpl-preview-body-wrap {
            padding: 0;
        }
        .tpl-preview-body {
            background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
            padding: 20px; font-size: 13px; line-height: 1.8;
            color: var(--text); max-height: 500px; overflow-y: auto;
            white-space: pre-wrap; user-select: none; -webkit-user-select: none;
            font-family: inherit;
        }
        .tpl-preview-footer {
            padding-top: 16px; display: flex; gap: 8px; justify-content: flex-end;
        }

        /* 移动端：大幅缩减内边距，让预览区域更大 */
        @media (max-width: 600px) {
            .tpl-preview-modal {
                padding: 16px 12px 12px !important;
            }
            .tpl-preview-body {
                padding: 14px; font-size: 12px; line-height: 1.7;
                max-height: 350px;
            }
            .tpl-preview-title {
                font-size: 16px;
            }
            .tpl-preview-sub {
                font-size: 11px;
            }
        }
