        :root {
            /* 现代创作者色板 */
            --bg-app: #f4f7f9;
            --bg-sidebar: rgba(255, 255, 255, 0.75);
            --bg-panel: rgba(255, 255, 255, 0.95);
            --bg-element: #f8fafc;
            
            --border-subtle: rgba(148, 163, 184, 0.25);
            --border-focus: rgba(99, 102, 241, 0.5);
            
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-accent: #6366f1;
            
            --brand-primary: #4f46e5;
            --brand-primary-hover: #4338ca;
            
            --shadow-app: 0 32px 64px -16px rgba(15, 23, 42, 0.15);
            --shadow-panel: 0 8px 24px -8px rgba(15, 23, 42, 0.08);
            --shadow-float: 0 16px 32px -8px rgba(15, 23, 42, 0.12);
            
            --radius-lg: 24px;
            --radius-md: 16px;
            --radius-sm: 10px;
            
            /* 丝滑物理动画曲线 */
            --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
            --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
            --transition-base: all 0.4s var(--ease-out-expo);
        }

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

        /* 隐藏原生滚动条，保留极简悬浮条 */
        ::-webkit-scrollbar { width: 5px; height: 5px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.6); }

        body {
            height: 100vh;
            overflow: hidden; 
            padding: 16px;
            color: var(--text-primary);
            font-family: "HarmonyOS Sans", "MiSans", "PingFang SC", "-apple-system", sans-serif;
            background-color: var(--bg-app);
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none; 
            -webkit-font-smoothing: antialiased;
            position: relative;
        }

        /* 动态全息流光背景 */
        .ambient-background {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: -1;
            background: 
                radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 40%),
                radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.08), transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05), transparent 40%);
            animation: ambientShift 15s ease-in-out infinite alternate;
        }

        @keyframes ambientShift {
            0% { transform: scale(1) translate(0, 0); }
            100% { transform: scale(1.1) translate(-2%, 2%); }
        }

        button, input, textarea { font: inherit; outline: none; }
        textarea, input { user-select: text; -webkit-app-region: no-drag; }

        /* Toast 物理回弹通知 */
        .toast-container {
            position: fixed; top: 24px; right: 24px; z-index: 9999;
            display: flex; flex-direction: column; gap: 12px; pointer-events: none;
        }
        .toast {
            min-width: 280px; padding: 16px 20px;
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
            border: 1px solid rgba(255,255,255,0.4);
            box-shadow: var(--shadow-float);
            color: var(--text-primary); font-size: 14px; font-weight: 500;
            transform: translateX(120%) scale(0.9);
            opacity: 0;
            transition: all 0.5s var(--ease-spring);
        }
        .toast.show { transform: translateX(0) scale(1); opacity: 1; }

        /* 主程序外壳 */
        .client-shell {
            display: flex; width: 100%; max-width: 1500px; height: 100%;
            background: var(--bg-sidebar);
            border-radius: var(--radius-lg);
            border: 1px solid rgba(255, 255, 255, 0.9);
            box-shadow: var(--shadow-app);
            overflow: hidden;
            position: relative;
            backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
            transform: scale(0.98); opacity: 0;
            animation: appEntry 0.8s var(--ease-out-expo) forwards;
        }

        @keyframes appEntry {
            to { transform: scale(1); opacity: 1; }
        }

        /* 左侧边栏 - Tauri 拖拽区 */
        .client-sidebar {
            width: 260px; display: flex; flex-direction: column;
            padding: 36px 20px 24px; 
            background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, rgba(248, 250, 252, 0.2) 100%);
            border-right: 1px solid var(--border-subtle);
            -webkit-app-region: drag; flex-shrink: 0;
            position: relative;
        }

        .client-sidebar > * { -webkit-app-region: no-drag; }

        .sidebar-top { margin-bottom: 40px; padding: 0 4px; }
        .sidebar-brand {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .sidebar-brand-logo {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            object-fit: cover;
            box-shadow: 0 16px 28px -18px rgba(15, 23, 42, 0.45);
            flex: none;
        }
        .sidebar-brand-copy {
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-height: 56px;
            gap: 4px;
        }
        .sidebar-brand-copy h1 {
            font-size: 22px; font-weight: 800;
            line-height: 1.05;
            background: linear-gradient(135deg, #1e293b 0%, #6366f1 100%);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            margin-bottom: 0; letter-spacing: -0.5px;
        }
        .sidebar-brand-copy p {
            font-size: 13px;
            line-height: 1.25;
            color: var(--text-secondary);
            font-weight: 500;
        }

        /* 侧边栏导航 - 滑动药丸动效 */
        .sidebar-tabs { display: flex; flex-direction: column; gap: 8px; flex: 1; position: relative; }
        
        .sidebar-tab {
            width: 100%; text-align: left; padding: 14px 18px;
            border-radius: var(--radius-md); background: transparent; border: none;
            color: var(--text-secondary); cursor: pointer;
            transition: var(--transition-base);
            display: flex; align-items: center; position: relative; z-index: 2;
        }
        .sidebar-tab strong {
            font-size: 14px;
            font-weight: 600;
            transition: transform 0.3s var(--ease-out-expo);
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }
        .sidebar-tab:hover { color: var(--text-primary); }
        .sidebar-tab:hover strong { transform: translateX(4px); }
        .sidebar-tab.is-active { color: var(--brand-primary); }
        .sidebar-tab.is-active strong { transform: translateX(4px); }

        .ui-icon {
            width: 1em;
            height: 1em;
            flex-shrink: 0;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.9;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .ui-icon.is-spinning { animation: iconSpin 1s linear infinite; }
        .portal-button .ui-icon { width: 16px; height: 16px; }
        .sidebar-tab .ui-icon { width: 16px; height: 16px; }
        .notice-title {
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }
        .notice-title .ui-icon { width: 20px; height: 20px; color: var(--brand-primary); }
        .toast-content {
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }
        .toast-content .ui-icon { width: 18px; height: 18px; }
        .icon-sprite {
            position: absolute;
            width: 0;
            height: 0;
            overflow: hidden;
        }

        @keyframes iconSpin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* 活动指示器 (背景药丸) */
        .tab-indicator {
            position: absolute; top: 0; left: 0; width: 100%; height: 0;
            background: #ffffff; border-radius: var(--radius-md);
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
            transition: transform 0.4s var(--ease-spring), height 0.4s var(--ease-spring);
            z-index: 1; pointer-events: none;
        }

        .sidebar-footer {
            margin-top: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 12px 4px 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }
        .sidebar-footer .ui-icon,
        .btn-ghost .ui-icon {
            width: 16px;
            height: 16px;
        }
        .btn-ghost {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            padding: 10px 16px;
            gap: 8px;
            border: none;
            border-radius: 8px;
            background-color: transparent;
            color: #4b5563;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .btn-ghost:hover {
            background-color: #f3f4f6;
            color: #111827;
        }
        .btn-ghost:disabled {
            cursor: wait;
            opacity: 0.72;
            background-color: #f9fafb;
            color: #6b7280;
        }
        .btn-logout:hover {
            background-color: #fef2f2;
            color: #ef4444;
        }
        .sidebar-account-card {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .account-info-box {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 12px 14px;
            background-color: #f9fafb;
            border-radius: 8px;
        }
        .account-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            font-size: 13px;
        }
        .account-label {
            color: #9ca3af;
        }
        .account-value {
            color: #111827;
            font-weight: 600;
            word-break: break-all;
        }
        .account-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 2px 8px;
            border-radius: 999px;
            background-color: #e5e7eb;
            color: #4b5563;
            font-size: 12px;
            font-weight: 500;
            line-height: 1.5;
            white-space: nowrap;
        }

        /* 主内容区 */
        .client-main {
            flex: 1; display: flex; flex-direction: column;
            background: rgba(248, 250, 252, 0.4); position: relative; height: 100%; overflow: hidden;
        }

        .main-topbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 32px 40px 16px; z-index: 10; -webkit-app-region: drag; 
        }
        .main-topbar > * { -webkit-app-region: no-drag; }
        .main-topbar h2 { font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
        .main-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }
        .topbar-tools { display: flex; gap: 12px; align-items: center; }

        /* 按钮动效系统 */
        .portal-button {
            border: 1px solid transparent; border-radius: var(--radius-sm);
            padding: 10px 20px; font-size: 13px; font-weight: 600;
            cursor: pointer; transition: var(--transition-base);
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            position: relative; overflow: hidden;
            text-decoration: none;
        }
        
        .portal-button:active { transform: scale(0.94); }

        .portal-button.primary {
            background: linear-gradient(135deg, var(--brand-primary) 0%, #6366f1 100%);
            color: #fff; box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
        }
        .portal-button.primary:hover {
            box-shadow: 0 12px 24px -6px rgba(99, 102, 241, 0.5);
            transform: translateY(-2px);
        }
        .portal-button.is-stop-action {
            background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
            color: #fff;
            box-shadow: 0 8px 20px -6px rgba(220, 38, 38, 0.36);
        }
        .portal-button.is-stop-action:hover {
            box-shadow: 0 12px 24px -6px rgba(220, 38, 38, 0.46);
            transform: translateY(-2px);
        }
        .portal-button.primary::after {
            content: ''; position: absolute; top: 0; left: -100%;
            width: 50%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transform: skewX(-20deg); transition: 0.5s;
        }
        .portal-button.primary:hover::after { left: 150%; }

        .portal-button.ghost {
            background: #ffffff; border-color: var(--border-subtle);
            color: var(--text-primary); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
        }
        .portal-button.ghost:hover {
            border-color: rgba(99, 102, 241, 0.3); color: var(--brand-primary);
            box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05); transform: translateY(-1px);
        }
        #topbar-download-btn {
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.08) 100%);
            border-color: rgba(79, 70, 229, 0.22);
            color: #312e81;
            box-shadow: 0 10px 22px -16px rgba(79, 70, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.65);
        }
        #topbar-download-btn .ui-icon {
            color: #4f46e5;
        }
        #topbar-download-btn:hover {
            border-color: rgba(79, 70, 229, 0.34);
            color: #1e1b4b;
            box-shadow: 0 14px 24px -16px rgba(79, 70, 229, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.75);
        }
        .portal-button:disabled {
            cursor: not-allowed;
            opacity: 0.72;
            transform: none;
            box-shadow: none;
        }
        .mobile-action-dock {
            display: none;
        }

        /* 阶梯式动画控制 */
        .portal-stage { flex: 1; min-height: 0; overflow: auto; }
        .sidebar-panels { min-height: 100%; height: 100%; padding: 16px 40px 40px; }
        .sidebar-panel { display: none; }
        .sidebar-panel.is-active { display: block; }
        .sidebar-panel.center-stage.is-active {
            min-height: 100%;
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
        }
        .center-stage-inner { width: 100%; }
        .center-stage-inner.notice-layout {
            max-width: none;
            display: grid;
            gap: 16px;
        }
        .center-stage-inner.history-layout {
            max-width: none;
            display: grid;
            gap: 20px;
        }
        .center-stage-inner.invite-layout {
            max-width: none;
            display: grid;
            gap: 20px;
        }
        .center-stage-inner.agent-layout {
            max-width: none;
            display: grid;
            gap: 20px;
        }
        .center-stage-inner.license-layout {
            max-width: none;
            display: grid;
            gap: 20px;
        }
        
        /* 面板内的子元素按顺序出现 */
        .sidebar-panel.is-active .stagger-1 { animation: slideUpFade 0.6s var(--ease-out-expo) 0.05s forwards; opacity: 0; }
        .sidebar-panel.is-active .stagger-2 { animation: slideUpFade 0.6s var(--ease-out-expo) 0.15s forwards; opacity: 0; }
        .sidebar-panel.is-active .stagger-3 { animation: slideUpFade 0.6s var(--ease-out-expo) 0.25s forwards; opacity: 0; }

        @keyframes slideUpFade {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 工作区与纸张质感 */
        .workspace {
            display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
            height: calc(100vh - 260px); min-height: 480px;
        }

        .panel {
            display: flex; flex-direction: column;
            background: var(--bg-panel); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg); overflow: hidden;
            transition: all 0.5s var(--ease-out-expo);
            box-shadow: var(--shadow-panel); position: relative;
            transform-origin: center bottom;
        }
        
        /* 聚焦时的物理悬浮感 */
        .panel:focus-within {
            border-color: rgba(99, 102, 241, 0.3);
            box-shadow: var(--shadow-float), 0 0 0 4px rgba(99, 102, 241, 0.05);
            z-index: 5;
        }

        .toolbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 18px 24px; background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-subtle);
        }

        .word-count { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
        .word-count span { color: var(--text-accent); font-weight: 700; transition: var(--transition-base); }
        
        .btn-group { display: flex; gap: 8px; }

        .editor-wrapper {
            flex: 1;
            display: flex;
            background: transparent;
            position: relative;
            overflow: hidden;
        }
        .editor-wrapper.is-typing::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 4px;
            height: var(--typing-cursor-height, 18px);
            border-radius: 999px;
            background: var(--brand-primary);
            box-shadow: 0 0 10px rgba(99, 102, 241, 0.24);
            transform: translate(var(--typing-cursor-x, 64px), var(--typing-cursor-y, 24px));
            animation: typingCursorBlink 0.9s steps(1) infinite;
            pointer-events: none;
            z-index: 3;
        }
        .line-number-gutter {
            width: 38px;
            flex-shrink: 0;
            border-right: 1px solid rgba(148, 163, 184, 0.16);
            background: rgba(248, 250, 252, 0.72);
            overflow: hidden;
            pointer-events: none;
            user-select: none;
        }
        .line-number-content {
            box-sizing: border-box;
            padding: 24px 6px 24px 0;
            color: #94a3b8;
            text-align: right;
            will-change: transform;
        }
        .line-number-content span {
            display: block;
            height: 30px;
            line-height: 30px;
            font-size: 12px;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
        }

        textarea {
            flex: 1; min-width: 0; padding: 24px; background: transparent; border: none; resize: none;
            color: var(--text-primary); font-size: 15px; line-height: 2;
            letter-spacing: 0.02em; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; caret-color: var(--brand-primary);
            transition: background 0.3s;
        }
        textarea::placeholder { color: #94a3b8; font-weight: 400; transition: opacity 0.3s; }
        textarea:focus::placeholder { opacity: 0.5; }

        @keyframes typingCursorBlink {
            0%, 44% { opacity: 1; }
            45%, 100% { opacity: 0; }
        }

        .panel.is-processing::before {
            content: none;
        }
        .panel.is-processing {
            border-color: var(--border-subtle);
            box-shadow: var(--shadow-panel);
            transform: none;
        }

        /* 底部滑块控制模块 */
        .slider-module {
            margin-top: 24px; padding: 20px 32px;
            background: var(--bg-panel); border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg); display: flex; align-items: center;
            justify-content: space-between; gap: 40px; box-shadow: var(--shadow-panel);
            transition: var(--transition-base);
        }
        .slider-module:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }

        .slider-info {
            font-size: 15px;
            color: var(--text-primary);
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .slider-info .ui-icon { width: 18px; height: 18px; color: var(--brand-primary); }
        .slider-value {
            color: var(--brand-primary); background: rgba(99, 102, 241, 0.1);
            padding: 6px 14px; border-radius: 20px; margin-left: 16px; font-size: 13px; font-weight: 600;
        }

        .slider-container { flex: 1; max-width: 480px; display: flex; align-items: center; position: relative; }

        input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 3px; background: #e2e8f0; outline: none; }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
            background: #fff; border: 4px solid var(--brand-primary);
            cursor: pointer; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
            transition: transform 0.3s var(--ease-spring);
        }
        input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); border-width: 3px; }
        input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.1); background: var(--brand-primary); }

        /* 面板卡片通用样式 */
        .notice-card {
            background: #ffffff; border: 1px solid var(--border-subtle); padding: 28px;
            border-radius: var(--radius-lg); margin-bottom: 20px;
            box-shadow: var(--shadow-panel); transition: var(--transition-base);
        }
        .notice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); border-color: rgba(99,102,241,0.2); }
        .notice-card h4 { color: var(--text-primary); margin-bottom: 12px; font-size: 18px; font-weight: 800; }
        .notice-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
        .notice-card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }
        .notice-pill {
            display: inline-flex;
            align-items: center;
            min-height: 28px;
            padding: 0 12px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.02em;
        }
        .notice-pill.success {
            color: #047857;
            background: #ecfdf5;
            border: 1px solid #bbf7d0;
        }
        .notice-pill.info {
            color: #1d4ed8;
            background: #eff6ff;
            border: 1px solid #bfdbfe;
        }
        .notice-pill.warning {
            color: #b45309;
            background: #fffbeb;
            border: 1px solid #fde68a;
        }
        .notice-time {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .history-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
            gap: 20px;
        }
        .history-status-card {
            display: flex;
            flex-direction: column;
            gap: 16px;
            padding: 24px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-panel);
        }
        .history-status-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .history-status-row h5 {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }
        .history-status-row p {
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.7;
        }
        .history-toggle {
            position: relative;
            display: inline-flex;
            align-items: center;
            cursor: pointer;
            user-select: none;
            flex-shrink: 0;
        }
        .history-toggle input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .history-toggle-track {
            width: 52px;
            height: 30px;
            border-radius: 999px;
            background: #e2e8f0;
            border: 1px solid rgba(148, 163, 184, 0.24);
            position: relative;
            transition: all 0.25s var(--ease-out-expo);
        }
        .history-toggle-track::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 3px;
            width: 22px;
            height: 22px;
            border-radius: 999px;
            background: #ffffff;
            box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
            transform: translateY(-50%);
            transition: transform 0.25s var(--ease-out-expo);
        }
        .history-toggle input:checked + .history-toggle-track {
            background: linear-gradient(135deg, var(--brand-primary) 0%, #6366f1 100%);
            border-color: rgba(79, 70, 229, 0.36);
        }
        .history-toggle input:checked + .history-toggle-track::after {
            transform: translate(22px, -50%);
        }
        .history-toggle input:disabled + .history-toggle-track {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .history-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .history-actions .portal-button {
            flex: 1 1 140px;
        }
        .history-list {
            display: grid;
            gap: 14px;
        }
        .history-item {
            display: grid;
            grid-template-rows: auto minmax(0, 1fr) auto;
            gap: 12px;
            padding: 20px 22px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-panel);
            min-height: 186px;
            cursor: pointer;
            transition: transform 0.22s var(--ease-out-expo), box-shadow 0.22s var(--ease-out-expo), border-color 0.22s ease;
        }
        .history-item:hover {
            transform: translateY(-2px);
            border-color: rgba(79, 70, 229, 0.14);
            box-shadow: 0 22px 40px -26px rgba(15, 23, 42, 0.34);
        }
        .history-item-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .history-item-meta {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }
        .history-item-text {
            display: grid;
            gap: 8px;
            min-height: 0;
            overflow: hidden;
        }
        .history-item-text h4 {
            font-size: 13px;
            color: var(--text-primary);
            line-height: 1.5;
            font-weight: 700;
            margin: 0;
            letter-spacing: 0.02em;
        }
        .history-item-text p {
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.8;
            word-break: break-word;
            margin: 0;
        }
        .history-item-snippet {
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
            max-height: calc(1.8em * 2);
        }
        .history-item-result {
            font-size: 13px;
            color: #64748b;
            line-height: 1.7;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .history-item-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            flex-wrap: wrap;
        }
        .history-modal {
            width: min(900px, 100%);
            height: min(720px, 100%);
            max-height: 100%;
            min-height: 0;
            display: flex;
            flex-direction: column;
            gap: 14px;
            position: relative;
            background: rgba(255, 255, 255, 0.97);
            border: 1px solid rgba(255, 255, 255, 0.85);
            border-radius: 28px;
            box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.35);
            padding: 20px;
            transform: translateY(20px) scale(0.96);
            opacity: 0;
            transition: all 0.4s var(--ease-spring);
            overflow: hidden;
        }
        .account-modal-overlay.is-open .history-modal {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
        .history-modal .modal-header {
            position: relative;
            padding-right: 52px;
            min-height: 34px;
        }
        .history-modal .modal-close {
            position: absolute;
            top: 0;
            right: 0;
            z-index: 2;
        }
        .history-modal-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 8px;
        }
        .history-modal-body {
            min-height: 0;
            flex: 1;
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 14px;
        }
        .history-modal-panel {
            min-height: 0;
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 18px;
            border-radius: 20px;
            background: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }
        .history-modal-panel-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .history-modal-panel h4 {
            margin: 0;
            font-size: 15px;
            font-weight: 800;
            color: var(--text-primary);
        }
        .history-modal-copy-btn {
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 700;
            gap: 6px;
            align-self: flex-start;
        }
        .history-modal-copy-btn .ui-icon {
            width: 14px;
            height: 14px;
        }
        .history-modal-text {
            margin: 0;
            min-height: 0;
            flex: 1;
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.8;
        }
        .history-empty {
            padding: 28px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px dashed rgba(148, 163, 184, 0.32);
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.8;
            text-align: center;
        }
        .invite-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
            gap: 20px;
        }
        .agent-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
            gap: 20px;
        }
        .invite-status-card,
        .invite-link-card,
        .invite-progress-card,
        .agent-status-card,
        .agent-link-card,
        .agent-progress-card {
            display: grid;
            gap: 16px;
            padding: 24px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-panel);
        }
        .invite-status-card h5,
        .invite-link-card h5,
        .invite-progress-card h5,
        .agent-status-card h5,
        .agent-link-card h5,
        .agent-progress-card h5 {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-secondary);
        }
        .invite-stat-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .invite-stat-item {
            padding: 16px;
            border-radius: 16px;
            background: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }
        .invite-stat-item span {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
        }
        .invite-stat-item strong {
            display: block;
            font-size: 24px;
            font-weight: 800;
            letter-spacing: -0.03em;
            margin-top: 6px;
        }
        .invite-link-box {
            display: grid;
            gap: 12px;
        }
        .invite-link-input {
            width: 100%;
            min-height: 52px;
            padding: 0 16px;
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            background: #f8fafc;
            color: var(--text-primary);
            font-size: 14px;
        }
        .invite-link-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .invite-link-actions .portal-button {
            flex: 1 1 160px;
        }
        .invite-progress-list {
            display: grid;
            gap: 12px;
        }
        .invite-user-list {
            display: grid;
            gap: 12px;
            margin-top: 18px;
        }
        .invite-user-list-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 0.02em;
        }
        .invite-user-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 16px;
            background: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }
        .invite-user-meta {
            display: grid;
            gap: 4px;
            min-width: 0;
        }
        .invite-user-meta strong {
            font-size: 14px;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .invite-user-meta span {
            color: var(--text-secondary);
            font-size: 12px;
        }
        .invite-user-status {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
            border: 1px solid transparent;
        }
        .invite-user-status.is-valid {
            color: #047857;
            background: #ecfdf5;
            border-color: #bbf7d0;
        }
        .invite-user-status.is-invalid {
            color: #92400e;
            background: #fffbeb;
            border-color: #fde68a;
        }
        .agent-panel-grid {
            display: grid;
            gap: 16px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .agent-application-form {
            display: grid;
            gap: 12px;
        }
        .agent-application-form input,
        .agent-application-form textarea {
            width: 100%;
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 14px;
            background: #f8fafc;
            color: var(--text-primary);
            font-size: 14px;
            padding: 12px 14px;
        }
        .agent-application-form textarea {
            min-height: 88px;
            resize: vertical;
        }
        .agent-status-list,
        .agent-commission-list {
            display: grid;
            gap: 12px;
        }
        .agent-status-item,
        .agent-commission-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 16px;
            background: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }
        .agent-status-meta,
        .agent-commission-meta {
            display: grid;
            gap: 4px;
            min-width: 0;
        }
        .agent-status-meta strong,
        .agent-commission-meta strong {
            font-size: 14px;
            color: var(--text-primary);
        }
        .agent-status-meta span,
        .agent-commission-meta span {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .agent-link-inline {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .agent-link-inline span {
            min-width: 0;
            flex: 1 1 240px;
            word-break: break-all;
        }
        .agent-link-copy-btn {
            min-height: 34px;
            padding: 0 12px;
            flex: 0 0 auto;
        }
        .agent-link-copy-btn .ui-icon {
            width: 14px;
            height: 14px;
        }
        .agent-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
            border: 1px solid transparent;
        }
        .agent-badge.is-approved {
            color: #047857;
            background: #ecfdf5;
            border-color: #bbf7d0;
        }
        .agent-badge.is-pending {
            color: #92400e;
            background: #fffbeb;
            border-color: #fde68a;
        }
        .agent-badge.is-rejected {
            color: #b91c1c;
            background: #fef2f2;
            border-color: #fecaca;
        }
        .agent-badge.is-default {
            color: var(--text-secondary);
            background: #eef2ff;
            border-color: rgba(129, 140, 248, 0.2);
        }
        .invite-progress-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 16px 18px;
            border-radius: 16px;
            background: #f8fafc;
            border: 1px solid rgba(148, 163, 184, 0.18);
        }
        .invite-progress-item.is-reached {
            background: #ecfdf5;
            border-color: #bbf7d0;
        }
        .invite-progress-item strong {
            font-size: 15px;
        }
        .invite-progress-item span {
            color: var(--text-secondary);
            font-size: 13px;
        }

        .license-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
            gap: 20px;
        }
        .license-overview {
            padding: 28px;
            border-radius: var(--radius-lg);
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
            border: 1px solid rgba(99, 102, 241, 0.12);
            box-shadow: var(--shadow-panel);
        }
        .license-eyebrow {
            display: inline-flex;
            align-items: center;
            min-height: 28px;
            padding: 0 12px;
            border-radius: 999px;
            margin-bottom: 16px;
            background: rgba(79, 70, 229, 0.08);
            color: var(--brand-primary);
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.08em;
        }
        .license-overview h4 {
            font-size: 28px;
            font-weight: 800;
            line-height: 1.2;
            letter-spacing: -0.04em;
            margin-bottom: 12px;
        }
        .license-overview p {
            color: var(--text-secondary);
            font-size: 15px;
            line-height: 1.8;
        }
        .license-status-card {
            display: flex;
            flex-direction: column;
            gap: 18px;
            padding: 24px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-panel);
        }
        .license-status-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .license-status-card h5 {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 0.02em;
        }
        .license-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            align-self: flex-start;
            min-height: 34px;
            padding: 0 14px;
            border-radius: 999px;
            font-size: 13px;
            font-weight: 700;
            border: 1px solid transparent;
        }
        .license-badge.is-muted {
            color: var(--text-secondary);
            background: #f8fafc;
            border-color: var(--border-subtle);
        }
        .license-badge.is-active {
            color: #047857;
            background: #ecfdf5;
            border-color: #bbf7d0;
        }
        .license-status-meta {
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.7;
        }
        .plan-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 18px;
            align-items: stretch;
        }
        .plan-card {
            display: flex;
            flex-direction: column;
            gap: 18px;
            padding: 24px;
            border-radius: var(--radius-lg);
            background: #ffffff;
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-panel);
            transition: var(--transition-base);
            height: 100%;
        }
        .plan-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-float);
            border-color: rgba(99, 102, 241, 0.2);
        }
        .plan-card-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
        }
        .plan-card h5 {
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.03em;
            margin-bottom: 6px;
        }
        .plan-card p {
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.7;
            flex: 1 1 auto;
        }
        .plan-chip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 28px;
            padding: 0 10px;
            border-radius: 999px;
            background: #f8fafc;
            border: 1px solid var(--border-subtle);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
        }
        .plan-meta {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--brand-primary);
            font-size: 13px;
            font-weight: 700;
        }
        .plan-price {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 4px;
        }
        .plan-price strong {
            font-size: 26px;
            line-height: 1;
            letter-spacing: -0.04em;
            color: var(--text-primary);
        }
        .plan-price span {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 700;
        }
        .plan-meta .ui-icon {
            width: 16px;
            height: 16px;
        }
        .plan-card .portal-button {
            width: 100%;
            justify-content: center;
            padding: 15px 16px;
        }
        .plan-grid-hint {
            margin: 0 0 16px;
            padding: 12px 16px;
            border-radius: 14px;
            border: 1px solid #fdba74;
            background: #fff7ed;
            color: #9a3412;
            font-size: 13px;
            font-weight: 600;
            line-height: 1.7;
        }
        .plan-grid-hint[hidden] {
            display: none;
        }
        
        .topbar-badge {
            font-size: 12px; font-weight: 700; padding: 6px 16px; border-radius: 20px;
            background: #ffffff; color: var(--text-secondary);
            border: 1px solid var(--border-subtle); box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
        }
        .topbar-badge.warning { color: #d97706; border-color: #fde68a; background: #fffbeb; }

        /* 表单区域动效 */
        .account-switch { display: flex; background: #f1f5f9; padding: 6px; border-radius: var(--radius-md); margin-bottom: 32px; position: relative; }
        .account-switch button {
            flex: 1; background: transparent; border: none; color: var(--text-secondary);
            padding: 12px 0; border-radius: 12px; font-weight: 600; font-size: 14px;
            cursor: pointer; transition: var(--transition-base); z-index: 2;
        }
        .account-switch button.is-active { color: var(--text-primary); }
        .account-switch button:disabled { cursor: wait; opacity: 0.7; }
        .form-indicator {
            position: absolute; top: 6px; left: 6px; height: calc(100% - 12px); width: calc(50% - 6px);
            background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            transition: transform 0.4s var(--ease-spring); z-index: 1; pointer-events: none;
        }

        .field-label { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
        .field-label input {
            padding: 16px 20px; border-radius: var(--radius-md); background: #ffffff;
            border: 2px solid transparent; outline: 1px solid var(--border-subtle);
            color: var(--text-primary); transition: var(--transition-base); font-size: 15px;
            box-shadow: 0 2px 6px rgba(15,23,42,0.02);
        }
        .field-label input:focus { outline-color: transparent; border-color: var(--brand-primary); box-shadow: 0 8px 20px rgba(99,102,241,0.1); transform: translateY(-1px); }
        .field-label input:disabled {
            background: #f8fafc;
            color: var(--text-secondary);
            cursor: wait;
            box-shadow: none;
        }
        .auth-challenge-box {
            display: grid;
            gap: 12px;
            margin-bottom: 20px;
            padding: 14px 16px;
            border-radius: 18px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            background: #f8fafc;
        }
        .auth-challenge-box[hidden] {
            display: none;
        }
        .auth-challenge-message {
            margin: 0;
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.7;
        }
        .auth-turnstile-slot {
            min-height: 66px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .account-form { display: none; }
        .account-form.is-active { display: block; animation: slideUpFade 0.4s var(--ease-out-expo) forwards; }

        /* 登录弹窗 */
        .account-modal-overlay,
        .payment-modal-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(15, 23, 42, 0.28);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.35s var(--ease-out-expo);
            z-index: 9998;
        }
        .payment-modal-overlay {
            padding: 16px;
        }
        .account-modal-overlay.is-open,
        .payment-modal-overlay.is-open {
            opacity: 1;
            pointer-events: auto;
        }
        .account-modal {
            position: relative;
            width: 100%;
            max-width: 460px;
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(255, 255, 255, 0.85);
            border-radius: 28px;
            box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.35);
            padding: 28px;
            transform: translateY(20px) scale(0.96);
            opacity: 0;
            transition: all 0.4s var(--ease-spring);
        }
        .account-modal .modal-header {
            margin-bottom: 32px;
            padding-right: 52px;
        }
        .account-modal .modal-close {
            position: absolute;
            top: 18px;
            right: 18px;
            z-index: 2;
        }
        .account-modal-overlay.is-open .account-modal {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
        .payment-modal {
            width: min(420px, 100%);
            max-height: min(760px, 100%);
            min-height: 0;
            display: flex;
            flex-direction: column;
            background: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.9);
            border-radius: 20px;
            box-shadow: 0 14px 36px -26px rgba(15, 23, 42, 0.32);
            padding: 0;
            transform: translateY(20px) scale(0.96);
            opacity: 0;
            transition: all 0.4s var(--ease-spring);
            overflow: hidden;
        }
        .payment-modal-overlay.is-open .payment-modal {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
        .payment-modal-meta {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 4px;
        }
        .payment-modal-pill {
            display: inline-flex;
            align-items: center;
            min-height: 22px;
            padding: 0 8px;
            border-radius: 999px;
            background: rgba(56, 108, 250, 0.08);
            color: #386cfa;
            border: none;
            font-size: 11px;
            font-weight: 700;
            white-space: nowrap;
        }
        .payment-modal-order {
            display: none;
        }
        .payment-modal-body {
            flex: 1 1 auto;
            min-height: 0;
            background: #f5f7fb;
            overflow: hidden;
            position: relative;
        }
        .payment-direct-shell {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f5f7fb;
            overflow: auto;
        }
        .payment-direct-shell[hidden] {
            display: none;
        }
        .payment-direct-card {
            width: min(100%, 420px);
            display: flex;
            flex-direction: column;
            gap: 0;
            padding: 16px;
            align-items: stretch;
        }
        .payment-qr-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-align: center;
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 14px 36px -26px rgba(15, 23, 42, 0.32);
            padding: 20px 18px 18px;
        }
        .payment-qr-box {
            width: 220px;
            height: 220px;
            max-width: 100%;
            background: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .payment-qr-box img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }
        .payment-amount {
            font-size: 32px;
            font-weight: 800;
            color: #386cfa;
            line-height: 1;
            letter-spacing: -0.03em;
        }
        .payment-caption {
            color: #475569;
            font-size: 13px;
            line-height: 1.4;
        }
        .payment-info-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-top: 10px;
        }
        .payment-channel-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 0;
            padding: 0;
            border-radius: 0;
            background: transparent;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 700;
            width: auto;
        }
        .payment-info-title {
            display: none;
        }
        .payment-info-copy {
            display: none;
        }
        .payment-status-stack {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            width: 100%;
        }
        .payment-status-row {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 18px;
            width: 100%;
        }
        .payment-status-item {
            display: inline-flex;
            align-items: baseline;
            justify-content: center;
            gap: 6px;
            padding: 0;
            border-radius: 0;
            background: transparent;
            border: none;
        }
        .payment-status-label {
            color: #0f172a;
            font-size: 15px;
            font-weight: 600;
        }
        .payment-status-value {
            color: #ef4444;
            font-size: 18px;
            font-weight: 700;
            text-align: center;
            word-break: break-all;
        }
        .payment-status-value.is-expired {
            color: #dc2626;
        }
        .payment-status-icon {
            width: 22px;
            height: 22px;
            object-fit: contain;
            flex-shrink: 0;
        }
        .payment-direct-actions {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
            width: 100%;
        }
        .payment-direct-actions .portal-button {
            width: 100%;
            justify-content: center;
        }
        #payment-status-check-btn {
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(14, 165, 233, 0.1) 100%);
            border-color: rgba(79, 70, 229, 0.22);
            color: #312e81;
            box-shadow: 0 10px 24px -16px rgba(79, 70, 229, 0.42);
        }
        #payment-status-check-btn:hover:not(:disabled) {
            border-color: rgba(79, 70, 229, 0.34);
            color: #1d4ed8;
            box-shadow: 0 14px 28px -16px rgba(79, 70, 229, 0.5);
            transform: translateY(-1px);
        }
        #payment-status-check-btn:disabled {
            box-shadow: 0 8px 18px -16px rgba(79, 70, 229, 0.28);
        }
        .payment-frame-loading {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            background: rgba(248, 250, 252, 0.95);
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 600;
            z-index: 2;
        }
        .payment-frame-loading[hidden] {
            display: none;
        }
        .payment-frame-loading .ui-icon {
            width: 22px;
            height: 22px;
            color: var(--brand-primary);
        }
        .payment-modal-footer {
            display: none;
        }
        .payment-modal-actions {
            display: none;
        }
        .payment-modal .modal-header {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 3;
            margin: 0;
            display: block;
        }
        .payment-modal .modal-header > div {
            display: none;
        }
        .modal-close {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(255, 255, 255, 0.92);
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition-base);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        }
        .modal-close .ui-icon { width: 16px; height: 16px; }
        .modal-close:hover {
            color: var(--text-primary);
            transform: scale(1.04);
        }

        @media (max-width: 1180px) {
            body {
                height: auto;
                min-height: 100vh;
                overflow: auto;
            }
            .client-shell {
                height: auto;
                min-height: calc(100vh - 32px);
            }
            .workspace {
                grid-template-columns: 1fr;
                height: auto;
            }
            .slider-module {
                flex-direction: column;
                align-items: stretch;
                gap: 18px;
            }
            .history-hero,
            .invite-hero,
            .agent-hero,
            .license-hero,
            .plan-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 900px) {
            body {
                padding: 0;
            }
            .client-shell {
                flex-direction: column;
                min-height: 100vh;
                border-radius: 0;
            }
            .client-sidebar {
                width: 100%;
                padding: 28px 18px 18px;
                border-right: none;
                border-bottom: 1px solid var(--border-subtle);
            }
            .sidebar-brand-logo {
                width: 52px;
                height: 52px;
            }
            .sidebar-brand-copy {
                min-height: 52px;
            }
            .sidebar-panels {
                padding: 16px 18px 24px;
            }
            .main-topbar,
            .slider-module {
                padding-left: 18px;
                padding-right: 18px;
            }
            .toast-container {
                top: 16px;
                right: 16px;
                left: 16px;
            }
            .toast {
                min-width: 0;
            }
            .account-modal {
                padding: 24px 20px;
            }
            .account-modal .modal-header {
                margin-bottom: 28px;
                padding-right: 48px;
            }
            .account-modal .modal-close {
                top: 14px;
                right: 14px;
            }
            .payment-modal {
                width: min(100%, 420px);
                max-height: 100%;
                padding: 0;
                border-radius: 16px;
                gap: 0;
            }
            .payment-modal-body {
                min-height: 0;
            }
            .payment-direct-card {
                width: 100%;
                min-height: auto;
                padding: 14px;
                gap: 0;
            }
            .payment-qr-panel {
                padding: 16px 12px 14px;
                border-radius: 16px;
            }
            .payment-qr-box {
                width: 188px;
                height: 188px;
            }
            .payment-direct-actions {
                gap: 6px;
            }
            .history-modal {
                height: 100%;
                max-height: 100%;
                padding: 16px;
                border-radius: 24px;
            }
            .history-modal .modal-header {
                padding-right: 48px;
            }
            .history-modal-body {
                grid-template-columns: 1fr;
            }
        }

        /* 移动端增强层：只追加，不改动桌面端布局 */
        @media (max-width: 900px) {
            body {
                min-height: 100dvh;
                -webkit-text-size-adjust: 100%;
                padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
            }
            .client-shell {
                gap: 12px;
                min-height: 0;
                background: transparent;
                border: none;
                box-shadow: none;
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
            }
            .client-sidebar {
                padding: 18px 16px 14px;
                gap: 14px;
                border: 1px solid rgba(255, 255, 255, 0.82);
                border-radius: 28px;
                background: rgba(255, 255, 255, 0.88);
                box-shadow: 0 20px 44px -32px rgba(15, 23, 42, 0.28);
                backdrop-filter: blur(26px);
                -webkit-backdrop-filter: blur(26px);
            }
            .sidebar-top {
                margin-bottom: 16px;
            }
            .sidebar-tabs {
                flex: none;
                flex-direction: row;
                overflow-x: auto;
                overflow-y: hidden;
                gap: 10px;
                padding: 2px 0 6px;
                margin: 0 -2px;
                scrollbar-width: none;
            }
            .sidebar-tabs::-webkit-scrollbar {
                display: none;
            }
            .tab-indicator {
                display: none;
            }
            .sidebar-tab {
                flex: 0 0 auto;
                min-width: max-content;
                padding: 12px 16px;
                border: 1px solid rgba(148, 163, 184, 0.18);
                background: rgba(255, 255, 255, 0.72);
                box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.3);
            }
            .sidebar-tab strong,
            .sidebar-tab:hover strong,
            .sidebar-tab.is-active strong {
                transform: none;
            }
            .sidebar-tab strong {
                white-space: nowrap;
                font-size: 13px;
            }
            .sidebar-tab.is-active {
                background: #ffffff;
                border-color: rgba(99, 102, 241, 0.2);
                box-shadow: 0 12px 24px -20px rgba(99, 102, 241, 0.36);
            }
            .sidebar-footer {
                margin-top: 14px;
                padding: 0;
                gap: 10px;
            }
            .client-main {
                overflow: visible;
                border: 1px solid rgba(255, 255, 255, 0.82);
                border-radius: 28px;
                background: rgba(248, 250, 252, 0.78);
                box-shadow: 0 22px 48px -34px rgba(15, 23, 42, 0.26);
                backdrop-filter: blur(28px);
                -webkit-backdrop-filter: blur(28px);
            }
            .main-topbar {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
                padding: 20px 16px 12px;
                background: rgba(248, 250, 252, 0.78);
                backdrop-filter: blur(16px);
                -webkit-backdrop-filter: blur(16px);
                position: sticky;
                top: 0;
                border-bottom: 1px solid rgba(148, 163, 184, 0.14);
                z-index: 12;
            }
            .main-topbar h2 {
                font-size: 22px;
            }
            .topbar-tools {
                width: 100%;
            }
            #topbar-download-btn {
                width: 100%;
            }
            .portal-stage {
                overflow: visible;
            }
            .sidebar-panels {
                height: auto;
                min-height: 0;
                padding: 10px 16px calc(108px + env(safe-area-inset-bottom));
            }
            .workspace {
                gap: 16px;
                min-height: 0;
            }
            .workspace .panel {
                min-height: 300px;
            }
            .workspace .editor-wrapper {
                min-height: 240px;
            }
            .toolbar {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
                padding: 16px;
            }
            .word-count {
                font-size: 12px;
            }
            .btn-group {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
                gap: 10px;
            }
            .btn-group .portal-button {
                width: 100%;
                min-height: 44px;
                padding: 12px 10px;
            }
            #result-panel .btn-group {
                grid-template-columns: 1fr;
            }
            #result-panel .btn-group .portal-button.primary {
                min-height: 48px;
            }
            .line-number-gutter {
                width: 32px;
            }
            .line-number-content {
                padding: 18px 4px 18px 0;
            }
            .line-number-content span {
                font-size: 11px;
            }
            textarea {
                padding: 18px 16px 20px;
                font-size: 16px;
                line-height: 1.75;
            }
            .slider-module {
                margin-top: 16px;
                padding: 16px;
                gap: 14px;
                border-radius: 20px;
                background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
            }
            .slider-info {
                justify-content: space-between;
                flex-wrap: wrap;
                font-size: 14px;
            }
            .slider-value {
                margin-left: 0;
            }
            .slider-container {
                width: 100%;
                max-width: none;
            }
            .notice-card,
            .history-status-card,
            .invite-status-card,
            .invite-link-card,
            .invite-progress-card,
            .agent-status-card,
            .agent-link-card,
            .agent-progress-card,
            .license-overview,
            .license-status-card,
            .plan-card {
                padding: 20px;
            }
            .notice-card {
                margin-bottom: 0;
            }
            .notice-card-head,
            .history-item-head,
            .license-status-head,
            .plan-card-head {
                flex-wrap: wrap;
                align-items: flex-start;
            }
            .history-actions,
            .invite-link-actions {
                display: grid;
                grid-template-columns: 1fr;
                gap: 10px;
            }
            .history-actions .portal-button,
            .invite-link-actions .portal-button {
                width: 100%;
            }
            .history-item,
            .invite-user-item,
            .agent-status-item,
            .agent-commission-item,
            .invite-progress-item {
                padding: 16px 18px;
                align-items: flex-start;
                flex-direction: column;
            }
            .history-item-meta,
            .notice-time,
            .plan-chip,
            .agent-badge,
            .invite-user-status {
                white-space: normal;
            }
            .history-item-result,
            .invite-user-meta strong,
            .agent-status-meta strong,
            .agent-commission-meta strong {
                white-space: normal;
                overflow: visible;
                text-overflow: clip;
                word-break: break-word;
            }
            .agent-badge,
            .invite-user-status {
                align-self: flex-start;
            }
            .history-item-actions {
                width: 100%;
                justify-content: stretch;
            }
            .history-item-actions .portal-button {
                width: 100%;
            }
            .agent-panel-grid {
                grid-template-columns: 1fr;
            }
            .agent-link-inline {
                align-items: flex-start;
            }
            .agent-link-inline span {
                flex-basis: 100%;
            }
            .plan-price {
                align-items: flex-start;
            }
            .account-modal-overlay,
            .payment-modal-overlay {
                position: fixed;
                align-items: flex-end;
                padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
            }
            .account-modal,
            .payment-modal,
            .history-modal {
                width: 100%;
                max-width: 640px;
                border-radius: 24px;
            }
            .account-modal {
                max-height: 92dvh;
                overflow: auto;
                padding: 20px;
            }
            .history-modal {
                height: auto;
                max-height: 92dvh;
                padding: 16px;
            }
            .history-modal-panel {
                padding: 16px;
            }
            .mobile-action-dock {
                position: fixed;
                left: max(10px, env(safe-area-inset-left));
                right: max(10px, env(safe-area-inset-right));
                bottom: max(10px, env(safe-area-inset-bottom));
                z-index: 40;
                display: grid;
                grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.35fr);
                gap: 10px;
                padding: 10px;
                border-radius: 24px;
                border: 1px solid rgba(255, 255, 255, 0.88);
                background: rgba(255, 255, 255, 0.92);
                box-shadow: 0 24px 48px -30px rgba(15, 23, 42, 0.34);
                backdrop-filter: blur(28px);
                -webkit-backdrop-filter: blur(28px);
            }
            .mobile-action-dock[aria-hidden="true"] {
                display: none;
            }
            .mobile-jump-btn {
                min-height: 48px;
                padding: 0 14px;
                border: 1px solid rgba(148, 163, 184, 0.2);
                border-radius: 16px;
                background: rgba(248, 250, 252, 0.92);
                color: var(--text-primary);
                font-size: 13px;
                font-weight: 700;
                cursor: pointer;
                box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
            }
            .mobile-strength-card {
                min-width: 0;
                display: grid;
                align-content: center;
                gap: 2px;
                padding: 8px 12px;
                border-radius: 16px;
                background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
                border: 1px solid rgba(99, 102, 241, 0.12);
            }
            .mobile-strength-card span {
                color: var(--text-secondary);
                font-size: 11px;
                font-weight: 600;
            }
            .mobile-strength-card strong {
                color: var(--text-primary);
                font-size: 14px;
                font-weight: 800;
                white-space: nowrap;
            }
            .mobile-reduce-btn {
                min-height: 52px;
                width: 100%;
                padding: 0 16px;
                border-radius: 18px;
                box-shadow: 0 16px 28px -18px rgba(79, 70, 229, 0.72);
            }
            #result-panel .btn-group .portal-button.primary {
                display: none;
            }
        }

        @media (max-width: 640px) {
            .client-sidebar {
                padding: 16px 12px 12px;
            }
            .sidebar-top {
                margin-bottom: 12px;
            }
            .sidebar-brand {
                align-items: flex-start;
            }
            .sidebar-brand-copy h1 {
                font-size: 20px;
            }
            .sidebar-brand-copy p {
                font-size: 12px;
            }
            .sidebar-tab {
                padding: 10px 14px;
            }
            .main-topbar {
                padding: 16px 12px 10px;
            }
            .main-topbar h2 {
                font-size: 20px;
            }
            .sidebar-panels {
                padding: 8px 12px calc(120px + env(safe-area-inset-bottom));
            }
            .workspace {
                gap: 14px;
            }
            .workspace .panel {
                min-height: 280px;
            }
            .toolbar {
                padding: 14px;
            }
            .btn-group {
                grid-template-columns: 1fr;
            }
            .line-number-gutter {
                width: 0;
                border-right: none;
            }
            .line-number-content {
                opacity: 0;
            }
            textarea {
                padding: 16px 14px 18px;
            }
            .slider-module {
                padding: 14px;
            }
            .license-overview h4 {
                font-size: 24px;
            }
            .invite-stat-grid {
                grid-template-columns: 1fr;
            }
            .invite-stat-item strong {
                font-size: 22px;
            }
            .field-label input,
            .agent-application-form input,
            .agent-application-form textarea,
            .invite-link-input {
                font-size: 16px;
            }
            .payment-status-row {
                flex-direction: column;
                gap: 8px;
                align-items: center;
            }
            .payment-qr-box {
                width: min(100%, 180px);
                height: auto;
                aspect-ratio: 1 / 1;
            }
            .history-modal-panel-head {
                align-items: flex-start;
            }
            .mobile-action-dock {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                padding: 9px;
            }
            .mobile-strength-card {
                order: 3;
            }
            .mobile-reduce-btn {
                order: 4;
                grid-column: 1 / -1;
            }
        }

        @media (max-width: 480px) {
            .client-sidebar {
                padding: 14px 10px 10px;
            }
            .sidebar-brand {
                gap: 10px;
            }
            .sidebar-brand-logo {
                width: 48px;
                height: 48px;
                border-radius: 14px;
            }
            .sidebar-brand-copy {
                min-height: 48px;
            }
            .sidebar-brand-copy h1 {
                font-size: 18px;
            }
            .sidebar-tab {
                padding: 10px 12px;
            }
            .sidebar-tab strong {
                font-size: 12px;
                gap: 8px;
            }
            .main-topbar {
                padding: 14px 10px 8px;
            }
            .sidebar-panels {
                padding: 8px 10px calc(116px + env(safe-area-inset-bottom));
            }
            .notice-card,
            .history-status-card,
            .invite-status-card,
            .invite-link-card,
            .invite-progress-card,
            .agent-status-card,
            .agent-link-card,
            .agent-progress-card,
            .license-overview,
            .license-status-card,
            .plan-card {
                padding: 18px;
                border-radius: 20px;
            }
            .history-item {
                padding: 14px 16px;
                min-height: 0;
            }
            .history-empty {
                padding: 20px 16px;
            }
            .slider-info {
                align-items: flex-start;
                gap: 8px;
            }
            .account-modal,
            .payment-modal,
            .history-modal {
                border-radius: 20px;
            }
            .mobile-jump-btn,
            .mobile-reduce-btn {
                min-height: 46px;
            }
            .mobile-strength-card {
                padding: 8px 10px;
            }
        }
