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

        /* 避免加载中 Web 字体与回退字体切换导致字号/行高跳动；禁止移动端自动放大正文 */
        html {
            font-size: 16px;
            line-height: 1.5;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
            -moz-text-size-adjust: 100%;
            height: 100%;
        }

        :root {
            color-scheme: dark;
            --bg-body: #0b0f1a;
            --bg-card: #111827;
            --bg-input: #1e293b;
            --bg-hover: #273549;
            --border: #1e293b;
            --border-focus: #6366f1;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --accent: #6366f1;
            --accent-hover: #818cf8;
            --accent-glow: rgba(99, 102, 241, 0.25);
            --success: #22c55e;
            --warning: #f59e0b;
            --error: #ef4444;
            --radius: 12px;
        }

        html, body {
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
        }
        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
            background: var(--bg-body);
            color: var(--text-primary);
            min-height: 100vh;
            height: 100%;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }

        /* Header */
        .page-header {
            padding: 24px 40px;
            border-bottom: 1px solid var(--border);
            background: rgba(17, 24, 39, 0.8);
            -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
            position: sticky;
            top: 0;
            z-index: 100;
            flex-shrink: 0;
        }

        .header-inner {
            max-width: 1440px;
            margin: 0 auto;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
        }

        .brand-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }
        .brand-row .model-title {
            margin-bottom: 0;
        }
        .brand-logo--header {
            width: 40px;
            height: 40px;
            object-fit: contain;
            flex-shrink: 0;
            background: transparent;
            display: block;
        }

        .model-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
            background: linear-gradient(135deg, #6366f1, #a78bfa, #6366f1);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .model-desc {
            font-size: 14px;
            color: var(--text-secondary);
            line-height: 1.6;
            max-width: 700px;
        }

        .tags {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .tag {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            background: rgba(99, 102, 241, 0.12);
            color: var(--accent-hover);
            border: 1px solid rgba(99, 102, 241, 0.2);
        }

        /* Main Layout */
        .main-container {
            max-width: 1440px;
            margin: 0 auto;
            padding: 32px 40px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 32px;
            flex: 1;
            min-height: 0;
            box-sizing: border-box;
        }

        @media (max-width: 1024px) {
            .main-container {
                grid-template-columns: 1fr;
                padding: 20px;
            }
        }

        /* 手机端：头部与主区域 */
        @media (max-width: 768px) {
            .page-header { padding: 16px 16px; }
            .header-inner { flex-direction: column; align-items: stretch; gap: 16px; }
            .header-inner > div:first-child { min-width: 0; }
            .brand-row { margin-bottom: 6px; gap: 10px; }
            .brand-logo--header { width: 32px; height: 32px; }
            .model-title { font-size: 18px; margin-bottom: 6px; }
            .model-desc { font-size: 13px; }
            .tags { margin-top: 8px; }
            .user-area {
                flex-wrap: wrap;
                justify-content: flex-start;
                gap: 8px;
            }
            .quota-badge { padding: 5px 10px; font-size: 12px; }
            .user-name { max-width: 80px; }
            .logout-btn { padding: 6px 12px; font-size: 12px; }
            .main-container { padding: 16px 12px; min-height: auto; }
            .panel-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
            .panel-body { padding: 16px; }
        }
        @media (max-width: 480px) {
            .page-header { padding: 12px 12px; }
            .brand-logo--header { width: 28px; height: 28px; }
            .model-title { font-size: 16px; }
            .model-desc { font-size: 12px; line-height: 1.5; }
            .tag { padding: 3px 10px; font-size: 11px; }
            .user-info .user-name { display: none; }
            .user-area { gap: 6px; }
            .logout-btn { padding: 6px 10px; font-size: 11px; }
            .main-container { padding: 12px 10px; }
        }

        /* Panel */
        .panel {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            border-bottom: 1px solid var(--border);
        }

        .panel-title {
            font-size: 16px;
            font-weight: 600;
        }

        .panel-tabs {
            display: flex;
            gap: 4px;
            background: var(--bg-input);
            border-radius: 8px;
            padding: 3px;
        }

        .panel-tab {
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-secondary);
            border: none;
            background: transparent;
            transition: all 0.2s;
        }

        .panel-tab.active {
            background: var(--bg-card);
            color: var(--text-primary);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .panel-tab:hover:not(.active) {
            color: var(--text-primary);
        }

        .panel-body {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
        }

        /* Form Controls */
        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .form-select, .form-input {
            width: 100%;
            padding: 10px 14px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
            appearance: none;
            -webkit-appearance: none;
        }

        .form-select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 36px;
            cursor: pointer;
        }

        .form-select:focus, .form-input:focus {
            border-color: var(--border-focus);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .form-select option {
            background: var(--bg-card);
            color: var(--text-primary);
        }

        /* Textarea */
        .prompt-wrapper {
            position: relative;
        }

        .prompt-textarea {
            width: 100%;
            min-height: 100px;
            max-height: 200px;
            padding: 12px 14px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            outline: none;
            resize: vertical;
            line-height: 1.6;
            transition: border-color 0.2s;
        }

        .prompt-textarea:focus {
            border-color: var(--border-focus);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        .prompt-textarea::placeholder {
            color: var(--text-muted);
        }

        .char-count {
            position: absolute;
            bottom: 8px;
            right: 12px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .prompt-clear-btn{
            position: absolute;
            top: 10px;
            right: 12px;
            z-index: 2;
            padding: 5px 10px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
        }
        .prompt-clear-btn:hover{
            border-color: var(--accent);
            color: var(--accent);
        }

        /* Toggle Switch */
        .toggle-group {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 12px;
            transition: all 0.3s;
        }

        .toggle-slider::before {
            content: '';
            position: absolute;
            width: 18px;
            height: 18px;
            left: 2px;
            bottom: 2px;
            background: var(--text-secondary);
            border-radius: 50%;
            transition: all 0.3s;
        }

        .toggle-switch input:checked + .toggle-slider {
            background: var(--accent);
            border-color: var(--accent);
        }

        .toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(20px);
            background: white;
        }

        /* Upload Zone */
        .upload-zone {
            border: 2px dashed var(--border);
            border-radius: 8px;
            padding: 32px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
        }

        .upload-zone:hover, .upload-zone.dragover {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.05);
        }

        .upload-zone input[type="file"] {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            opacity: 0;
            cursor: pointer;
        }

        .upload-icon {
            font-size: 32px;
            margin-bottom: 8px;
            opacity: 0.5;
        }

        .upload-text {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }

        .upload-hint {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* Preview uploaded images */
        .uploaded-images {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
        }

        .uploaded-thumb {
            position: relative;
            width: 72px;
            height: 72px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .uploaded-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* 输出面板 · 最近生成：底部缩略图条 + 两侧「上一张 / 下一张」（始终占位可见） */
        .output-history-wrap { user-select: none; }
        .output-history-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
            gap: 8px;
        }
        .output-history-counter {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 500;
            font-variant-numeric: tabular-nums;
        }
        .history-thumbs-toolbar {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            gap: 10px;
            width: 100%;
            min-width: 0;
        }
        .history-nav-btn {
            flex: 0 0 auto;
            width: 56px;
            min-height: 76px;
            padding: 6px 4px;
            border-radius: 10px;
            border: 2px solid rgba(129, 140, 248, 0.65);
            background: linear-gradient(165deg, rgba(99, 102, 241, 0.42), rgba(15, 23, 42, 0.98));
            color: #eef2ff;
            font-size: 11px;
            font-weight: 700;
            line-height: 1.2;
            letter-spacing: 0.02em;
            cursor: pointer;
            font-family: inherit;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
            transition: transform .15s ease, border-color .2s, filter .2s;
        }
        .history-nav-btn .history-nav-glyph {
            font-size: 18px;
            line-height: 1;
            font-weight: 900;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
        }
        .history-nav-btn:hover:not(:disabled) {
            border-color: rgba(196, 181, 253, 0.95);
            filter: brightness(1.08);
        }
        .history-nav-btn:active:not(:disabled) { transform: scale(0.97); }
        .history-nav-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            box-shadow: none;
            border-color: var(--border);
            filter: grayscale(0.3);
        }
        .history-thumbs-scroll {
            flex: 1;
            min-width: 0;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            padding: 2px 0 6px;
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.35);
            border: 1px solid var(--border);
        }
        .history-thumbs-track {
            display: flex;
            flex-direction: row;
            gap: 10px;
            align-items: center;
            padding: 6px 8px;
            min-height: 76px;
        }
        .output-history-wrap .history-thumb-item {
            flex: 0 0 auto;
            width: 72px;
            height: 72px;
            border-radius: 10px;
            overflow: hidden;
            border: 2px solid var(--border);
            cursor: pointer;
            transition: border-color .2s, box-shadow .2s, transform .15s;
            background: var(--bg-input);
        }
        .output-history-wrap .history-thumb-item.history-thumb-item--active {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.45);
            transform: scale(1.04);
        }
        .output-history-wrap .history-thumb-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            pointer-events: none;
        }
        .opus-history-thumb-fallback {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4px;
            box-sizing: border-box;
            pointer-events: none;
        }
        .opus-result-missing {
            padding: 20px 14px;
            text-align: center;
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-muted);
            border-radius: 8px;
            border: 1px dashed var(--border);
            background: var(--bg-input);
        }

        .thumb-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 20px;
            height: 20px;
            background: rgba(0, 0, 0, 0.7);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .thumb-convert {
            position: absolute;
            bottom: 2px;
            left: 2px;
            right: 2px;
            padding: 4px 6px;
            background: rgba(0,0,0,.75);
            border: none;
            border-radius: 4px;
            color: #fff;
            font-size: 11px;
            cursor: pointer;
            font-family: inherit;
        }
        .thumb-convert:hover { background: var(--accent); }

        .image-groups-container { display: flex; flex-direction: column; gap: 16px; }
        /* 动态新增组卡片在 #imageGroupsDynamic 里，需要在容器内部也保持间距 */
        #imageGroupsDynamic { display: flex; flex-direction: column; gap: 16px; }
        .image-group-card {
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 14px;
            position: relative;
        }
        .image-group-card .group-head {
            display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
            font-size: 13px; font-weight: 600; color: var(--text-secondary);
        }
        .image-group-card .group-remove {
            padding: 4px 10px; font-size: 12px; background: transparent; border: 1px solid var(--border);
            border-radius: 6px; color: var(--text-muted); cursor: pointer;
        }
        .image-group-card .group-remove:hover { border-color: var(--error); color: var(--error); }
        .ref-target-row { display: flex; gap: 16px; flex-wrap: wrap; }
        .ref-target-row .slot-box { flex: 1; min-width: 140px; }
        .ref-target-row .slot-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; cursor: default; }
        .ref-target-row .upload-zone.small {
            min-height: 80px;
            padding: 12px;
            border: 2px dashed var(--text-muted);
            background: var(--bg-input);
        }
        .ref-target-row .upload-zone.small:hover,
        .ref-target-row .upload-zone.small.dragover {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.08);
        }
        .ref-target-row .upload-zone.small .upload-text { font-size: 12px; }
        .ref-target-row .target-slot-split {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 10px 8px;
            min-height: 88px;
            justify-content: center;
            cursor: default;
        }
        .ref-target-row .target-opt-btn {
            width: 100%;
            padding: 8px 6px;
            font-size: 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-hover);
            color: var(--text-primary);
            cursor: pointer;
            font-family: inherit;
            line-height: 1.3;
        }
        .ref-target-row .target-opt-btn:hover {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.12);
        }
        .ref-target-row .target-opt-btn.target-opt-models {
            border-color: rgba(99, 102, 241, 0.45);
            background: rgba(99, 102, 241, 0.14);
            color: var(--accent-hover);
            font-weight: 600;
        }
        .ref-target-row .uploaded-images { margin-top: 8px; min-height: 0; }
        .add-group-btn {
            display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
            padding: 10px 18px; background: transparent; border: 1px dashed var(--border);
            border-radius: 8px; color: var(--text-secondary); font-size: 13px; cursor: pointer;
        }
        .add-group-btn:hover { border-color: var(--accent); color: var(--accent); }
        .add-group-icon { font-size: 18px; font-weight: 700; }

        /* Run Button */
        .run-btn {
            width: 100%;
            padding: 14px;
            background: var(--accent);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 15px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 8px;
        }

        .run-btn:hover:not(:disabled) {
            background: var(--accent-hover);
            box-shadow: 0 4px 16px var(--accent-glow);
        }

        .run-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 生成选项（分辨率 / 尺寸 / 生成数量，类似设置） */
        .generate-options {
            display: flex;
            flex-wrap: wrap;
            gap: 16px 24px;
            margin-top: 16px;
            padding: 14px 16px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            align-items: flex-end;
        }
        .generate-option {
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }
        .generate-option-label {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 500;
        }
        .form-select.form-select-sm {
            padding: 8px 32px 8px 12px;
            font-size: 13px;
            min-width: 100px;
        }
        @media (max-width: 768px) {
            .generate-options { gap: 12px 16px; padding: 12px; }
        }

        /* Output Panel */
        .output-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 400px;
            position: relative;
        }

        /* 模型管理：占满输出区，可滚动 */
        .output-models-pane {
            align-items: stretch;
            justify-content: flex-start;
            min-height: 360px;
            width: 100%;
            overflow: auto;
        }
        .output-models-pane .mm-scroll-col {
            max-height: min(52vh, 520px);
            overflow: auto;
        }

        /* 模型管理：待上传区域 */
        .mm-upload-zone {
            border: 2px dashed var(--border);
            border-radius: 10px;
            min-height: 100px;
            padding: 16px;
            text-align: center;
            cursor: pointer;
            background: var(--bg-input);
            transition: border-color 0.2s, background 0.2s;
        }
        .mm-upload-zone:hover, .mm-upload-zone.mm-dragover {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.08);
        }
        .mm-upload-zone .mm-upload-hint {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .mm-upload-zone .mm-upload-sub {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 6px;
        }
        .mm-upload-queue {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 12px 0;
            min-height: 0;
        }
        /* 模型管理：图片格悬停操作 */
        .mm-img-tile {
            position: relative;
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid var(--border);
            background: var(--bg-card);
        }
        .mm-img-tile > img {
            display: block;
            width: 100%;
            height: 180px;
            object-fit: contain;
            object-position: center;
            vertical-align: top;
            background: rgba(11, 18, 32, 0.9);
        }
        /* 选择模型弹窗内：再略加高，便于看清全身/整体 */
        #flowModelModalBody .mm-img-tile > img {
            height: clamp(200px, 28vh, 320px);
        }
        .mm-img-tile .mm-img-del {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: none;
            background: rgba(0,0,0,.68);
            color: #fff;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            z-index: 3;
            padding: 0;
        }
        .mm-img-hover {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            gap: 8px;
            padding: 8px;
            background: rgba(0,0,0,.78);
            opacity: 0;
            transition: opacity 0.15s ease;
            pointer-events: none;
            z-index: 2;
        }
        .mm-img-tile:hover .mm-img-hover {
            opacity: 1;
            pointer-events: auto;
        }
        .mm-img-action {
            font-size: 12px;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,.35);
            background: rgba(255,255,255,.12);
            color: #f1f5f9;
            cursor: pointer;
            width: 100%;
        }
        .mm-img-action:hover {
            background: rgba(255,255,255,.22);
        }
        .mm-img-action.mm-img-action-primary {
            border-color: rgba(129, 140, 248, .9);
            background: rgba(99, 102, 241, .35);
            color: #fff;
            font-weight: 600;
        }
        .mm-add-folder-btn {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-hover);
            color: var(--accent-hover);
            font-size: 18px;
            line-height: 1;
            font-weight: 600;
            cursor: pointer;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .mm-add-folder-btn:hover {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.15);
        }
        .mm-upload-card {
            position: relative;
            width: 100px;
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid var(--border);
            background: var(--bg-card);
            flex-shrink: 0;
        }
        .mm-upload-card img {
            width: 100%;
            height: 76px;
            object-fit: cover;
            display: block;
        }
        .mm-upload-card .mm-upload-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 22px;
            height: 22px;
            border: none;
            border-radius: 6px;
            background: rgba(0,0,0,.6);
            color: #fff;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 0;
            z-index: 5;
            pointer-events: auto;
        }
        .mm-upload-card .mm-upload-remove:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .mm-upload-card .mm-upload-bar-wrap {
            height: 4px;
            background: var(--border);
        }
        .mm-upload-card .mm-upload-bar {
            height: 100%;
            width: 0%;
            background: var(--accent);
            transition: width 0.08s linear;
        }
        .mm-upload-card .mm-upload-meta {
            font-size: 10px;
            color: var(--text-muted);
            padding: 4px 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .output-placeholder {
            text-align: center;
            color: var(--text-muted);
        }

        .output-placeholder-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        .output-placeholder-text {
            font-size: 14px;
        }

        .output-notice {
            padding: 8px 16px;
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.2);
            border-radius: 6px;
            font-size: 12px;
            color: var(--warning);
            margin-bottom: 16px;
            width: 100%;
            text-align: center;
        }

        .result-image {
            width: 100%;
            border-radius: 8px;
            border: 1px solid var(--border);
            cursor: pointer;
            transition: transform 0.2s;
        }

        .result-image:hover {
            transform: scale(1.01);
        }

        .result-list {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            width: 100%;
        }
        .result-card {
            flex: 1;
            min-width: 200px;
            max-width: 100%;
        }
        .result-card img {
            width: 100%;
            border-radius: 8px;
            border: 1px solid var(--border);
            cursor: pointer;
        }
        .result-card .result-card-actions { display: flex; gap: 8px; margin-top: 8px; }
        .result-card .opus-result-missing { width: 100%; }

        .result-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            width: 100%;
        }

        .result-btn {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .result-btn:hover {
            background: var(--bg-hover);
        }

        /* Progress / Loading */
        .loading-state {
            text-align: center;
        }

        /* Fullscreen overlay */
        .fullscreen-overlay {
            display: none;
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            cursor: zoom-out;
            padding: 40px;
            justify-content: center;
            align-items: center;
        }
        /* 须高于流程图内选择/编辑弹窗（flow-editor 内最高约 1000002）、流程编辑器首屏 splash（1000070） */
        #fullscreenOverlay.fullscreen-overlay {
            z-index: 1000080;
        }
        /* 充值：默认 .fullscreen-overlay 为 1000，会落在数据流底部输入（.opus-pc-flow-bottom-mount 1000075）与 flow-editor 内 fixed 遮罩（约 1e6）之下 */
        #rechargeModal.fullscreen-overlay {
            z-index: 1007000;
        }

        .fullscreen-overlay.show {
            display: flex;
        }

        .fullscreen-overlay img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 8px;
        }

        .fullscreen-close {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.15);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .fullscreen-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
            border: 1px solid rgba(255, 255, 255, 0.25);
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.45);
            color: #fff;
            font-size: 26px;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1002;
        }

        .fullscreen-nav:disabled {
            opacity: .35;
            cursor: not-allowed;
        }

        .fullscreen-nav-prev {
            left: 20px;
        }

        .fullscreen-nav-next {
            right: 20px;
        }

        .fullscreen-actions {
            position: absolute;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 1002;
        }

        .fullscreen-set-target {
            display: none;
            border: 1px solid rgba(255, 255, 255, 0.35);
            background: rgba(99, 102, 241, 0.9);
            color: #fff;
            border-radius: 999px;
            padding: 8px 16px;
            font-size: 13px;
            cursor: pointer;
        }

        .fullscreen-counter {
            display: none;
            color: rgba(255, 255, 255, 0.9);
            font-size: 12px;
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 999px;
            padding: 6px 10px;
        }

        .flow-editor-wrap {
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.72));
            min-height: 520px;
            margin-bottom: 12px;
        }

        .flow-editor-canvas {
            width: 100%;
            height: 520px;
        }

        /* 数据流底部输入：React Flow Panel 根节点不抢画布拖拽，仅输入条可点 */
        .opus-flow-bottom-composer-panel {
            pointer-events: none;
        }
        .opus-flow-bottom-composer-panel .opus-flow-bottom-composer {
            pointer-events: auto;
        }
        .opus-flow-bottom-composer__panel {
            background: rgba(15, 23, 42, 0.25);
            border: none;
            border-radius: 0;
            box-shadow: none;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            overflow: hidden;
        }
        /* 创作对话壳内：输入区与画布背景区分（外层边框在 .opus-pc-chat-dock） */
        .opus-pc-chat-dock .opus-flow-bottom-composer__panel {
            background: rgba(15, 23, 42, 0.88);
            border: 1px solid rgba(148, 163, 184, 0.28);
            border-radius: 10px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
        }
        .opus-flow-bottom-composer__toolbar {
            border-top: none;
            background: transparent;
        }
        .opus-pc-chat-dock .opus-flow-bottom-composer__toolbar {
            border-top: 1px solid rgba(148, 163, 184, 0.14);
            background: rgba(15, 23, 42, 0.5);
        }
        .opus-flow-bottom-composer__input {
            background: transparent !important;
            width: 100%;
            box-sizing: border-box;
            min-height: calc(1.55em + 16px);
            max-height: min(40vh, 320px);
        }
        .opus-pc-chat-dock .opus-flow-bottom-composer__input {
            background: rgba(2, 6, 23, 0.72) !important;
            border-radius: 8px;
            box-shadow: inset 0 0 0 1px rgba(51, 65, 85, 0.65);
        }
        .opus-pc-chat-dock .opus-flow-bottom-composer__input:focus {
            box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.42);
        }
        .opus-flow-bottom-composer__input::placeholder {
            color: #64748b;
            opacity: 1;
        }
        .opus-flow-bottom-composer__input:focus {
            outline: none;
        }
        .opus-flow-bottom-composer__input:disabled {
            color: #94a3b8;
        }

        /* PC 数据流：可拖拽底部输入 Portal 挂载（须低于 #fullscreenOverlay 大图全屏预览 1000080） */
        .opus-pc-flow-bottom-mount {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1000075;
            pointer-events: none;
        }
        .opus-pc-flow-bottom-mount > * {
            pointer-events: auto;
        }
        /* Portal 仅负责定位，不再包一层玻璃外壳；视觉由 .opus-flow-bottom-composer__panel 承担 */
        .opus-flow-composer-float {
            width: 100%;
            max-width: 100%;
            max-height: min(52vh, 420px);
            box-sizing: border-box;
            position: absolute;
        }
        /* 收起态：统一吸附到画布右侧中部；父级 .opus-flow-composer-float--minimized 与 :has 双写，避免旧浏览器不支持 :has 导致定位失效 */
        .opus-flow-composer-float:has(.opus-pc-chat-dock--minimized),
        .opus-flow-composer-float.opus-flow-composer-float--minimized {
            max-height: none !important;
            height: auto !important;
            width: auto !important;
            top: 50% !important;
            right: max(8px, env(safe-area-inset-right, 0px)) !important;
            bottom: auto !important;
            left: auto !important;
            transform: translateY(-50%) !important;
        }
        /* 底部对话 Dock 第一版：抬高浮层上限，避免消息区+输入被裁切（笔记本屏用 min） */
        html.opus-pc-chat-dock-v1 .opus-flow-composer-float {
            max-height: min(72vh, 640px);
        }
        .opus-pc-chat-dock {
            border-radius: 14px 14px 0 0;
            border: 1px solid rgba(148, 163, 184, 0.38);
            border-bottom: none;
            background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.72));
            box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: 100%;
        }
        .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        .opus-flow-composer-float.opus-flow-composer-float--dataflow {
            display: flex;
            flex-direction: column;
            height: auto;
            max-height: min(52vh, 420px);
        }
        html.opus-pc-chat-dock-v1 .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        html.opus-pc-chat-dock-v1 .opus-flow-composer-float.opus-flow-composer-float--dataflow {
            max-height: min(72vh, 640px);
        }
        .opus-pc-chat-dock--dataflow {
            flex: 0 0 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .opus-pc-chat-dock--dataflow .opus-flow-bottom-composer__dataflow.rule-llm-stream {
            min-height: calc(1.55em + 16px) !important;
            max-height: min(40vh, 320px) !important;
        }
        .opus-pc-chat-dock__head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 12px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.08);
            flex-shrink: 0;
        }
        /* Portal 模式：在「创作对话」标题栏拖动整块浮层（非输入框顶条） */
        .opus-pc-chat-dock__head--draggable {
            cursor: grab;
            user-select: none;
            -webkit-user-select: none;
        }
        .opus-pc-chat-dock__head--draggable:hover {
            background: rgba(30, 41, 59, 0.35);
        }
        .opus-pc-chat-dock__head--draggable-locked {
            cursor: not-allowed;
        }
        .opus-pc-chat-dock__head--draggable.opus-pc-chat-dock__head--dragging {
            cursor: grabbing;
        }
        .opus-pc-chat-dock__head-title {
            display: flex;
            align-items: baseline;
            gap: 6px;
            min-width: 0;
        }
        .opus-pc-chat-dock__brand {
            font-weight: 700;
            font-size: 14px;
            color: #e0e7ff;
        }
        .opus-pc-chat-dock__sub {
            font-size: 12px;
            color: #94a3b8;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .opus-pc-chat-dock__head-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }
        .opus-pc-chat-dock__btn {
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 6px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(30, 41, 59, 0.55);
            color: #c7d2fe;
            cursor: pointer;
        }
        .opus-pc-chat-dock__btn:hover {
            border-color: rgba(129, 140, 248, 0.45);
        }
        .opus-pc-chat-dock__btn--icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            min-height: 28px;
            padding: 4px 8px;
        }
        .opus-pc-chat-dock__hint {
            font-size: 11px;
            line-height: 1.4;
            color: #64748b;
            padding: 6px 12px 4px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
        }
        .opus-pc-chat-dock__thread {
            max-height: min(28vh, 220px);
            min-height: 56px;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 8px 10px 10px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
        }
        .opus-pc-chat-bubble {
            display: flex;
            flex-shrink: 0;
            width: 100%;
            margin-bottom: 8px;
        }
        .opus-pc-chat-bubble--user {
            justify-content: flex-end;
        }
        .opus-pc-chat-bubble--assistant,
        .opus-pc-chat-bubble--system {
            justify-content: flex-start;
        }
        .opus-pc-chat-bubble__stack {
            max-width: 92%;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0;
        }
        .opus-pc-chat-bubble--user .opus-pc-chat-bubble__stack {
            align-items: flex-end;
        }
        .opus-pc-chat-bubble__text {
            width: 100%;
            max-width: 100%;
            padding: 8px 11px;
            border-radius: 12px;
            font-size: 13px;
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .opus-pc-chat-bubble__thumb-wrap {
            margin-top: 8px;
            width: 100%;
            max-width: min(200px, 100%);
        }
        .opus-pc-chat-bubble__thumb {
            display: block;
            width: 100%;
            max-width: 200px;
            height: auto;
            border-radius: 10px;
            border: 1px solid rgba(148, 163, 184, 0.22);
            object-fit: cover;
            background: rgba(15, 23, 42, 0.4);
        }
        .opus-pc-chat-bubble__thumb--clickable {
            cursor: pointer;
        }
        .opus-pc-chat-bubble__thumb--clickable:hover {
            border-color: rgba(99, 102, 241, 0.45);
        }
        .opus-pc-chat-bubble__thumb--clickable:focus-visible {
            outline: 2px solid rgba(129, 140, 248, 0.65);
            outline-offset: 2px;
        }
        .opus-pc-chat-bubble__thumb-link {
            display: inline-block;
            margin-top: 6px;
            font-size: 11px;
            line-height: 1.35;
            color: #93c5fd;
            word-break: break-all;
            max-width: min(200px, 100%);
        }
        .opus-pc-chat-bubble__thumb-link:hover {
            color: #bfdbfe;
            text-decoration: underline;
        }
        .opus-pc-chat-bubble__loading {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(30, 41, 59, 0.75);
            border: 1px solid rgba(148, 163, 184, 0.2);
            color: #cbd5e1;
            font-size: 13px;
            line-height: 1.45;
        }
        .opus-pc-chat-bubble__loading-spin {
            display: inline-flex;
            color: #a5b4fc;
            animation: opusPcChatSpin 0.85s linear infinite;
        }
        @keyframes opusPcChatSpin {
            to {
                transform: rotate(360deg);
            }
        }
        .opus-pc-chat-bubble__loading-label {
            flex: 1;
            min-width: 0;
        }
        .opus-pc-chat-bubble__typing {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(30, 41, 59, 0.75);
            border: 1px solid rgba(148, 163, 184, 0.2);
            color: #94a3b8;
            font-size: 13px;
        }
        .opus-pc-chat-bubble__typing-dots {
            display: inline-block;
            letter-spacing: 2px;
            font-weight: 700;
            color: #818cf8;
            animation: opusPcChatDots 1.2s ease-in-out infinite;
        }
        @keyframes opusPcChatDots {
            0%,
            100% {
                opacity: 0.35;
            }
            50% {
                opacity: 1;
            }
        }
        .opus-pc-chat-bubble__typing-label {
            color: #cbd5e1;
        }
        .opus-pc-chat-bubble--gen-pending .opus-pc-chat-bubble__loading-label {
            color: #a5b4fc;
        }
        .opus-pc-chat-bubble--gen-generating .opus-pc-chat-bubble__loading-label {
            color: #93c5fd;
        }
        .opus-pc-chat-bubble--gen-failed .opus-pc-chat-bubble__text {
            border-color: rgba(248, 113, 113, 0.35);
            color: #fecaca;
        }
        .opus-pc-chat-bubble--gen-blocked .opus-pc-chat-bubble__text {
            border-color: rgba(251, 191, 36, 0.35);
            color: #fde68a;
        }
        .opus-pc-chat-bubble--gen-stopped .opus-pc-chat-bubble__text {
            border-color: rgba(148, 163, 184, 0.35);
            color: #cbd5e1;
        }
        .opus-pc-chat-bubble--gen-completed .opus-pc-chat-bubble__text {
            border-color: rgba(52, 211, 153, 0.28);
            color: #d1fae5;
        }
        .opus-pc-chat-bubble--user .opus-pc-chat-bubble__text {
            background: rgba(79, 70, 229, 0.35);
            border: 1px solid rgba(129, 140, 248, 0.35);
            color: #e0e7ff;
        }
        .opus-pc-chat-bubble--assistant .opus-pc-chat-bubble__text {
            background: linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(39, 50, 68, 0.78));
            border: 1px solid rgba(148, 163, 184, 0.18);
            color: #e2e8f0;
            letter-spacing: 0.01em;
        }
        .opus-pc-chat-bubble--system .opus-pc-chat-bubble__text {
            background: rgba(15, 23, 42, 0.5);
            border: 1px dashed rgba(100, 116, 139, 0.35);
            color: #94a3b8;
            font-size: 12px;
        }
        @keyframes opus-pc-chat-bubble-focus-ring {
            0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
            35% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.18); }
            100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
        }
        .opus-pc-chat-bubble--focus-pulse {
            border-radius: 14px;
            animation: opus-pc-chat-bubble-focus-ring 0.9s ease-out 2;
        }
        /* 创作会话历史：与 .opus-pc-chat-dock__thread 同高规则，超出时出现纵向滚动条 */
        .opus-pc-chat-dock__history {
            max-height: min(36vh, 320px);
            min-height: 56px;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 8px 10px 10px;
            flex-shrink: 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.12);
        }
        .opus-pc-chat-dock--history-only .opus-pc-chat-dock__history {
            border-bottom: none;
        }
        .opus-pc-chat-dock__history-section {
            margin-bottom: 10px;
        }
        .opus-pc-chat-dock__history-section:last-of-type {
            margin-bottom: 4px;
        }
        .opus-pc-chat-dock__history-section-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: #64748b;
            text-transform: none;
            padding: 4px 2px 6px;
        }
        .opus-pc-chat-dock__history-more {
            display: block;
            width: 100%;
            margin-top: 6px;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px dashed rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.35);
            color: #94a3b8;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }
        .opus-pc-chat-dock__history-more:hover:not(:disabled) {
            border-color: rgba(99, 102, 241, 0.45);
            color: #c7d2fe;
        }
        .opus-pc-chat-dock__history-more:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }
        .opus-pc-chat-dock__history-row {
            display: block;
            width: 100%;
            text-align: left;
            padding: 8px 10px;
            margin-bottom: 4px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.15);
            background: rgba(30, 41, 59, 0.45);
            color: #e2e8f0;
            font-size: 12px;
            cursor: pointer;
        }
        .opus-pc-chat-dock__history-row:hover {
            border-color: rgba(99, 102, 241, 0.45);
        }
        .opus-pc-chat-dock__history-empty {
            font-size: 12px;
            color: #64748b;
            padding: 8px;
        }
        .opus-pc-chat-dock--minimized {
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.38);
            background: rgba(15, 23, 42, 0.82);
            box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
        }
        .opus-pc-chat-dock__restore {
            width: auto;
            height: 44px;
            padding: 0 12px 0 10px;
            min-height: 0;
            border: none;
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(79, 70, 229, 0.34), rgba(6, 182, 212, 0.16));
            color: #c7d2fe;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            white-space: nowrap;
            font-size: 13px;
            font-weight: 700;
        }
        .opus-pc-chat-dock__restore-text {
            line-height: 1;
            letter-spacing: 0.2px;
        }
        .opus-pc-chat-dock__restore:hover {
            filter: brightness(1.06);
        }
        .opus-flow-composer-float .opus-flow-bottom-composer__panel {
            overflow: hidden;
        }
        .opus-flow-composer-float--dragging {
            opacity: 0.98;
        }
        /* 流程图模式：隐藏整块旧表单（模型/提示词/组图/开始生成），仅保留数据流画布；#modelSelect 等仍保留在 DOM 供脚本同步 */
        #formView > .form-group,
        #formView > #generateCostHint,
        #formView > .run-btn {
            display: none !important;
        }
        /* 去掉左侧「输入」标题栏，主区即数据流 */
        .main-container > .panel:first-child > .panel-header {
            display: none !important;
        }

        /* 流程图模式：占满主界面，隐藏右侧输出面板 */
        .main-container {
            grid-template-columns: 1fr !important;
            max-width: none !important;
            width: 100% !important;
            margin: 0 !important;
            flex: 1;
            min-height: 0;
            align-self: stretch;
        }
        #outputPanel {
            display: none !important;
        }
        main.main-container > .panel {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #inputBody {
            flex: 1;
            min-height: 0;
            overflow: auto;
            display: flex;
            flex-direction: column;
        }
        body:has(#flowEditorRoot) #inputBody,
        html.opus-pc-flow-wb #inputBody {
            position: relative;
            overflow-x: hidden;
            overflow-y: auto;
            padding: 12px 16px 14px;
            -webkit-overflow-scrolling: touch;
        }
        #formView {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .flow-editor-wrap {
            flex: 1;
            min-height: 0;
            min-width: 0;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
            position: relative;
        }
        /* 与 /m 首屏 #opusSplash 一致：脚本与 React Flow 就绪前避免空白；须高于底部挂载层，避免未就绪时露出异常条 */
        .flow-editor-splash {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1000070;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle at 30% 20%, rgba(129, 140, 248, 0.18), transparent 45%),
                radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.14), transparent 40%),
                #0f172a;
            color: #e2e8f0;
            transition: opacity 0.22s ease, transform 0.22s ease;
            pointer-events: auto;
        }
        .flow-editor-splash.flow-editor-splash--hide {
            opacity: 0;
            transform: translateY(6px) scale(0.995);
            pointer-events: none;
        }
        .flow-editor-splash__logo {
            width: 112px;
            height: 112px;
            border-radius: 24px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(148, 163, 184, 0.22);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
            overflow: hidden;
        }
        /* 与 /m 首屏一致：200×200 资源按 100×100 显示 */
        .flow-editor-splash__logo img {
            width: 100px;
            height: 100px;
            object-fit: contain;
            display: block;
        }
        .flow-editor-splash__title {
            margin: 14px 0 0;
            font-weight: 900;
            letter-spacing: 0.02em;
            font-size: 16px;
        }
        .flow-editor-splash__sub {
            margin: 6px 0 0;
            color: #94a3b8;
            font-size: 12px;
        }
        .flow-editor-splash__dots {
            display: flex;
            gap: 6px;
            margin-top: 14px;
        }
        .flow-editor-splash__dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: rgba(129, 140, 248, 0.55);
            box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.12);
            animation: flowEditorSplashDot 1.05s ease-in-out infinite;
        }
        .flow-editor-splash__dot:nth-child(2) {
            animation-delay: 0.12s;
            opacity: 0.85;
        }
        .flow-editor-splash__dot:nth-child(3) {
            animation-delay: 0.24s;
            opacity: 0.7;
        }
        @keyframes flowEditorSplashDot {
            0%,
            100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-6px);
                background: rgba(129, 140, 248, 0.95);
            }
        }
        /* 数据流图：随父级伸缩；min-width:0 避免 flex 子项无法变窄 */
        .flow-editor-canvas {
            flex: 1 1 auto;
            width: 100%;
            min-width: 0;
            min-height: 280px;
            min-height: clamp(220px, 50vh, 720px);
            height: auto !important;
        }
        html:has(#flowEditorRoot) {
            height: 100%;
            overflow: hidden;
        }
        html:has(#flowEditorRoot) body {
            height: 100%;
            max-height: 100%;
            overflow: hidden;
        }
        @media screen and (max-height: 800px) {
            html:has(#flowEditorRoot),
            html.opus-pc-flow-wb {
                height: auto !important;
                overflow: auto !important;
                overflow-x: hidden !important;
            }
            html:has(#flowEditorRoot) body,
            html.opus-pc-flow-wb body {
                height: auto !important;
                max-height: none !important;
                overflow: visible !important;
                overflow-x: hidden !important;
            }
        }
        html:has(#flowEditorRoot) main.main-container {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            padding: clamp(8px, 1.2vw, 20px) clamp(12px, 2.2vw, 36px) clamp(8px, 1.5vw, 18px);
            box-sizing: border-box;
        }
        body:has(#flowEditorRoot) .flow-editor-wrap,
        html.opus-pc-flow-wb .flow-editor-wrap {
            min-height: max(420px, min(720px, calc(62vh - 88px)));
            min-height: max(420px, min(720px, calc(62dvh - 88px)));
        }
        @media (max-width: 1680px) {
            body:has(#flowEditorRoot) .flow-editor-wrap,
            html.opus-pc-flow-wb .flow-editor-wrap {
                min-height: max(520px, min(960px, calc(100vh - 96px)));
                min-height: max(520px, min(960px, calc(100dvh - 96px)));
            }
        }
        /**
         * 紧凑布局：由 JS 设置 html[data-opus-flow-layout="compact"]（matchMedia 笔电/矮视口），避免仅靠 max-height:1080px 误伤台式大屏。
         */
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) main.main-container,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] main.main-container {
            padding: 8px 12px 10px !important;
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) #inputBody,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] #inputBody {
            padding: 8px 10px 10px !important;
            min-height: max(400px, min(80vh, 760px));
            min-height: max(400px, min(80dvh, 760px));
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) #formView,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] #formView {
            min-height: max(360px, min(74vh, 700px));
            min-height: max(360px, min(74dvh, 700px));
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) .flow-editor-wrap,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .flow-editor-wrap {
            flex: 1 1 auto !important;
            min-height: max(340px, min(64vh, 600px)) !important;
            min-height: max(340px, min(64dvh, 600px)) !important;
            height: auto !important;
            max-height: none !important;
        }
        /** 笔记本紧凑：画布宿主随 .flow-editor-wrap flex 撑满，勿用 max-height 截断导致「画布比外层矮」 */
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) .flow-editor-canvas-host,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .flow-editor-canvas-host {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            height: auto !important;
            max-height: none !important;
            position: relative;
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) .flow-editor-canvas,
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) #flowEditorRoot.flow-editor-canvas,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .flow-editor-canvas,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] #flowEditorRoot.flow-editor-canvas {
            position: absolute !important;
            top: 0; left: 0; right: 0; bottom: 0;
            width: 100% !important;
            height: 100% !important;
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) .opus-flow-composer-float,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .opus-flow-composer-float {
            width: 420px !important;
            max-width: calc(100% - 16px) !important;
            max-height: min(56vh, 420px) !important;
        }
        html[data-opus-flow-layout="compact"]:has(#flowEditorRoot) .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        html.opus-pc-flow-wb[data-opus-flow-layout="compact"] .opus-flow-composer-float.opus-flow-composer-float--dataflow {
            height: auto !important;
            max-height: min(56vh, 420px) !important;
        }
        @media screen and (max-height: 900px) {
            html:has(#flowEditorRoot) .page-header,
            html.opus-pc-flow-wb .page-header {
                padding: 8px 14px !important;
            }
            html:has(#flowEditorRoot) .brand-row,
            html.opus-pc-flow-wb .brand-row {
                margin-bottom: 0 !important;
            }
            html:has(#flowEditorRoot) .model-desc,
            html:has(#flowEditorRoot) .tags,
            html.opus-pc-flow-wb .model-desc,
            html.opus-pc-flow-wb .tags {
                display: none !important;
            }
            html:has(#flowEditorRoot) .model-title,
            html.opus-pc-flow-wb .model-title {
                font-size: 18px !important;
            }
            html:has(#flowEditorRoot) .brand-logo--header,
            html.opus-pc-flow-wb .brand-logo--header {
                width: 32px !important;
                height: 32px !important;
            }
        }
        /* 矮屏幕(<=800px)：不压缩画布，给大固定高度让浏览器滚动条控制 */
        @media screen and (max-height: 800px) {
            html:has(#flowEditorRoot) .flow-editor-wrap,
            html.opus-pc-flow-wb .flow-editor-wrap {
                min-height: 720px !important;
            }
            html:has(#flowEditorRoot) .flow-editor-canvas-host,
            html.opus-pc-flow-wb .flow-editor-canvas-host,
            body:has(#flowEditorRoot) .flow-editor-canvas-host {
                min-height: 620px !important;
            }
            html:has(#flowEditorRoot) .flow-editor-canvas,
            html.opus-pc-flow-wb .flow-editor-canvas,
            body:has(#flowEditorRoot) .flow-editor-canvas {
                min-height: 580px !important;
            }
            html:has(#flowEditorRoot) #inputBody,
            html.opus-pc-flow-wb #inputBody,
            body:has(#flowEditorRoot) #inputBody {
                min-height: 780px !important;
            }
            html:has(#flowEditorRoot) #formView,
            html.opus-pc-flow-wb #formView {
                min-height: 720px !important;
            }
            /* 小屏对话框宽度限制，不占满全宽 */
            html:has(#flowEditorRoot) .opus-flow-composer-float,
            html.opus-pc-flow-wb .opus-flow-composer-float {
                width: 420px !important;
                max-width: calc(100% - 16px) !important;
            }
        }
        /* 更小视口：由 JS 设 data-opus-flow-layout="compact-tight"（典型 1366×768 等） */
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) main.main-container,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] main.main-container {
            padding: 6px 10px 8px !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) #inputBody,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] #inputBody {
            padding: 6px 8px 8px !important;
            min-height: max(360px, min(82vh, 660px));
            min-height: max(360px, min(82dvh, 660px));
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) #formView,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] #formView {
            min-height: max(320px, min(76vh, 600px));
            min-height: max(320px, min(76dvh, 600px));
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .flow-editor-wrap,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .flow-editor-wrap {
            flex: 1 1 auto !important;
            min-height: max(300px, min(60vh, 540px)) !important;
            min-height: max(300px, min(60dvh, 540px)) !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .flow-editor-canvas-host,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .flow-editor-canvas-host {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            height: auto !important;
            max-height: none !important;
            position: relative;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .flow-editor-canvas,
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) #flowEditorRoot.flow-editor-canvas,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .flow-editor-canvas,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] #flowEditorRoot.flow-editor-canvas {
            position: absolute !important;
            top: 0; left: 0; right: 0; bottom: 0;
            width: 100% !important;
            height: 100% !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-flow-composer-float,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float {
            width: 420px !important;
            max-width: calc(100% - 16px) !important;
            max-height: min(52vh, 380px) !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float:has(.opus-pc-chat-dock--dataflow),
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float.opus-flow-composer-float--dataflow {
            height: auto !important;
            max-height: min(52vh, 380px) !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-flow-composer-float .opus-flow-bottom-composer,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float .opus-flow-bottom-composer {
            padding: 4px clamp(6px, 2vw, 10px) 6px !important;
            max-width: 100% !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-flow-composer-float .opus-flow-bottom-composer__input,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float .opus-flow-bottom-composer__input {
            min-height: calc(1.55em + 12px) !important;
            max-height: min(22vh, 200px) !important;
            padding: 6px 10px !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-flow-composer-float .opus-flow-bottom-composer__toolbar,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-flow-composer-float .opus-flow-bottom-composer__toolbar {
            padding: 4px 6px 5px !important;
        }
        html[data-opus-flow-layout="compact-tight"]:has(#flowEditorRoot) .opus-pc-chat-dock--dataflow .opus-flow-bottom-composer__dataflow.rule-llm-stream,
        html.opus-pc-flow-wb[data-opus-flow-layout="compact-tight"] .opus-pc-chat-dock--dataflow .opus-flow-bottom-composer__dataflow.rule-llm-stream {
            min-height: calc(1.55em + 12px) !important;
            max-height: min(22vh, 200px) !important;
        }
        /**
         * 数据流工作台：画布宿主须在 .flow-editor-wrap 列 flex 中吃满剩余高度。
         * #flowEditorRoot 为 absolute 子项不参与撑高，若再用 vh min-height 易导致宿主矮于外层 → 点阵下方大块留白（见笔记本整窗截图）。
         */
        body:has(#flowEditorRoot) .flow-editor-canvas-host,
        html.opus-pc-flow-wb .flow-editor-canvas-host {
            flex: 1 1 auto;
            min-height: 0;
            height: auto;
            max-height: none;
            overflow: hidden;
            position: relative;
        }
        body:has(#flowEditorRoot) .flow-editor-canvas,
        body:has(#flowEditorRoot) #flowEditorRoot.flow-editor-canvas,
        html.opus-pc-flow-wb .flow-editor-canvas,
        html.opus-pc-flow-wb #flowEditorRoot.flow-editor-canvas {
            position: absolute !important;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100% !important;
            height: 100% !important;
            min-height: 0;
        }
        body:has(#flowEditorRoot) #flowEditorRoot .react-flow,
        html.opus-pc-flow-wb #flowEditorRoot .react-flow {
            width: 100% !important;
            height: 100% !important;
        }
        /* 隐藏 React Flow 右下角署名（与 proOptions.hideAttribution 双保险） */
        #flowEditorRoot .react-flow__attribution,
        .flow-editor-canvas .react-flow__attribution {
            display: none !important;
        }
        /* 避免透明 PNG 在某些浏览器/缩放下出现白底观感 */
        #flowEditorRoot img,
        #flowEditorRoot .react-flow__node img {
            background: transparent !important;
        }

        /* 流程图：从目标节点选择模型（复用原模型管理 DOM） */
        .flow-model-modal {
            display: none;
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1000200;
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
            flex-direction: row;
            pointer-events: auto;
            isolation: isolate;
        }
        .flow-model-modal-backdrop {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            background: rgba(2, 6, 23, 0.75);
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }
        .flow-model-modal-card {
            position: relative;
            z-index: 1;
            width: min(960px, 96vw);
            max-height: min(94vh, 960px);
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .flow-model-modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .flow-model-modal-head button {
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            border-radius: 8px;
            padding: 6px 12px;
            cursor: pointer;
        }
        .flow-model-modal-body {
            flex: 1;
            overflow: auto;
            padding: 12px;
            min-height: min(68vh, 640px);
            max-height: min(92vh, 900px);
        }
        /* 选择模型弹窗：内容区用内部滚动，避免整页与图库双重滚动 */
        #flowModelModalBody.flow-model-modal-body {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: min(70vh, 680px);
        }
        #flowModelModalBody #outputModels {
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        /* 画布宿主：与 #flowEditorRoot 同高；离屏 #ruleLlmStream 占位相对此区域 */
        .flow-editor-canvas-host {
            position: relative;
            flex: 1 1 auto;
            min-height: 280px;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }
        /**
         * PC 数据流：不依赖 :has()（Chrome 105 以下、部分内嵌 WebView 会忽略 :has）。
         * 由脚本为 html 加 .opus-pc-flow-wb，等价于 html:has(#flowEditorRoot) / body:has(...) 的关键高度链，
         * 避免画布区被 flex 压成 0、#opusPcFlowBottomMount 无高度导致创作对话整窗不显示。
         */
        html.opus-pc-flow-wb {
            height: 100%;
            overflow: hidden;
        }
        html.opus-pc-flow-wb body {
            height: 100%;
            max-height: 100%;
            overflow: hidden;
        }
        html.opus-pc-flow-wb main.main-container {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            padding: 12px 20px 12px;
            padding: clamp(8px, 1.2vw, 20px) clamp(12px, 2.2vw, 36px) clamp(8px, 1.5vw, 18px);
            box-sizing: border-box;
        }
        html.opus-pc-flow-wb .flow-editor-wrap {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 420px;
            min-height: max(420px, min(720px, calc(62vh - 88px)));
            position: relative;
        }
        html.opus-pc-flow-wb .flow-editor-canvas-host {
            flex: 1 1 auto;
            min-height: 0;
            min-width: 0;
            height: auto;
            max-height: none;
            overflow: hidden;
            position: relative;
        }
        html.opus-pc-flow-wb .flow-editor-canvas,
        html.opus-pc-flow-wb #flowEditorRoot.flow-editor-canvas {
            position: absolute !important;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100% !important;
            height: 100% !important;
            min-height: 0;
        }
        html.opus-pc-flow-wb[data-opus-flow-layout='compact'] .flow-editor-wrap {
            flex: 1 1 auto !important;
            min-height: max(340px, min(64vh, 600px)) !important;
            height: auto !important;
            max-height: none !important;
        }
        html.opus-pc-flow-wb[data-opus-flow-layout='compact'] .flow-editor-canvas-host {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            height: auto !important;
            max-height: none !important;
            position: relative;
        }
        html.opus-pc-flow-wb[data-opus-flow-layout='compact-tight'] .flow-editor-wrap {
            flex: 1 1 auto !important;
            min-height: 300px !important;
            min-height: max(300px, min(60vh, 540px)) !important;
        }
        html.opus-pc-flow-wb[data-opus-flow-layout='compact-tight'] .flow-editor-canvas-host {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            height: auto !important;
            max-height: none !important;
            position: relative;
        }
        /* 离屏宿主：#ruleLlmStream / #ruleLlmCompileHint 供 app.js 写入与快照，展示在底部「数据流」 */
        .opus-rule-llm-stream-host {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            margin: -1px !important;
            padding: 0 !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0);
            border: 0;
            white-space: nowrap;
        }
        .opus-rule-llm-stream-host .rule-llm-stream {
            min-height: 0;
            max-height: none;
            border: none;
            padding: 0;
        }
        /* 单栏流式输出（底部「数据流」与离屏 #ruleLlmStream 共用类名） */
        .rule-llm-stream {
            margin: 0;
            padding: 10px 12px;
            min-height: 140px;
            max-height: min(40vh, 320px);
            overflow: auto;
            border-radius: 8px;
            border: 1px solid rgba(63, 63, 70, 0.85);
            background: rgba(9, 9, 11, 0.96);
            color: #d4d4d8;
            font-size: 12px;
            line-height: 1.65;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
            white-space: pre-wrap;
            word-break: break-word;
            box-sizing: border-box;
            outline: none;
        }
        .rule-llm-stream:focus-visible {
            box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.45);
        }
        /* 普通用户：数据流区仅友好等待/完成，不展示管线文本 */
        .rule-llm-stream.rule-llm-stream--user-shell {
            font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
            white-space: normal;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: min(28vh, 200px);
        }
        .rule-llm-user-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
            padding: 12px 8px;
            text-align: center;
            max-width: 280px;
        }
        .rule-llm-user-panel__spinner {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 3px solid rgba(148, 163, 184, 0.22);
            border-top-color: rgba(99, 102, 241, 0.95);
            animation: opusRuleLlmSpin 0.85s linear infinite;
        }
        @keyframes opusRuleLlmSpin {
            to {
                transform: rotate(360deg);
            }
        }
        .rule-llm-user-panel__msg {
            margin: 0;
            font-size: 13px;
            line-height: 1.55;
            color: #e2e8f0;
        }
        .rule-llm-user-panel--done .rule-llm-user-panel__icon {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: rgba(34, 197, 94, 0.18);
            border: 1px solid rgba(74, 222, 128, 0.45);
            position: relative;
        }
        .rule-llm-user-panel--done .rule-llm-user-panel__icon--ok::after {
            content: '';
            position: absolute;
            left: 50%;
            top: 45%;
            width: 10px;
            height: 18px;
            border: solid rgba(74, 222, 128, 0.95);
            border-width: 0 2.5px 2.5px 0;
            transform: translate(-50%, -50%) rotate(45deg);
        }
        /* 底部输入条：清空/撤销/重做（沿用 .rule-llm-dock-quickbtn 类名） */
        .opus-flow-bottom-composer .rule-llm-dock-quickbtn {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
            padding: 0;
            border-radius: 10px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(0, 0, 0, 0.88);
            color: #cbd5e1;
            cursor: pointer;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
            box-sizing: border-box;
            flex-shrink: 0;
        }
        .opus-flow-bottom-composer .rule-llm-dock-quickbtn:hover {
            background: rgba(15, 23, 42, 0.95);
            color: #f1f5f9;
        }
        .opus-flow-bottom-composer .rule-llm-dock-quickbtn svg {
            display: block;
            width: 20px;
            height: 20px;
            opacity: 0.95;
        }
        .opus-flow-bottom-composer .rule-llm-dock-quickbtn:hover svg {
            opacity: 1;
        }

        /* 模型管理：右侧主栏（上传 + 图库） */
        .mm-manage-row {
            display: grid;
            grid-template-columns: 140px 1fr;
            gap: 12px;
            margin-bottom: 12px;
        }
        .mm-right-column {
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--bg-input);
            padding: 10px;
        }
        .mm-upload-section {
            flex-shrink: 0;
        }

        /* 「选择模型（目标图）」弹窗内：加高图片区，上传区压缩，图库独立滚动，避免被按钮挡住 */
        #flowModelModalBody #outputModels.output-models-pane {
            min-height: 0;
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        #flowModelModalBody #mmSectionManage {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        #flowModelModalBody .mm-manage-row {
            flex: 1 1 auto;
            min-height: min(58vh, 560px);
            margin-bottom: 0;
            align-items: stretch;
        }
        #flowModelModalBody .mm-scroll-col {
            max-height: none !important;
            min-height: min(58vh, 560px);
            overflow: auto;
        }
        #flowModelModalBody .mm-right-column {
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-height: min(58vh, 560px);
            overflow: hidden;
        }
        #flowModelModalBody .mm-upload-zone {
            min-height: 72px !important;
            padding: 10px 12px !important;
        }
        #flowModelModalBody #mmImageGrid {
            flex: 1 1 0%;
            min-height: clamp(220px, 38vh, 480px);
            overflow-y: auto !important;
            overflow-x: hidden;
            align-content: start;
            padding: 4px 2px 8px;
            position: relative;
            z-index: 1;
        }

        /* Toast：须高于流程图选择/编辑弹窗（flow-editor 内最高约 1000002）与应用下载弹窗（1006500） */
        .toast {
            position: fixed;
            top: 24px;
            bottom: auto;
            left: 50%;
            transform: translateX(-50%) translateY(-120px);
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            z-index: 1008000;
            transition: transform 0.3s ease;
            pointer-events: none;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
        }

        .toast.info {
            background: var(--bg-hover, #334155);
            color: var(--text-primary, #f1f5f9);
        }

        .toast.success {
            background: var(--success);
            color: white;
        }

        .toast.error {
            background: var(--error);
            color: white;
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--bg-hover);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }



        /* User Area */
        .user-area {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
        }
        #loggedInArea {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: nowrap;
            white-space: nowrap;
        }

        .opus-announce-btn {
            position: relative;
            display: none;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: 10px;
            border: 1px solid rgba(129, 140, 248, 0.35);
            background: rgba(30, 41, 59, 0.9);
            color: #e2e8f0;
            cursor: pointer;
            flex-shrink: 0;
        }
        .opus-announce-btn:hover {
            border-color: rgba(129, 140, 248, 0.55);
            color: #f8fafc;
        }
        .opus-announce-icon {
            display: block;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .opus-announce-dot {
            position: absolute;
            top: 7px;
            right: 7px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #ef4444;
            box-shadow: 0 0 0 2px #111827;
        }
        @keyframes opus-announce-shake {
            0%, 100% { transform: rotate(0deg); }
            15% { transform: rotate(-16deg); }
            30% { transform: rotate(14deg); }
            45% { transform: rotate(-12deg); }
            60% { transform: rotate(10deg); }
            75% { transform: rotate(-6deg); }
        }
        .opus-announce-btn.opus-announce--shake {
            animation: opus-announce-shake 0.55s ease-in-out;
        }

        .quota-badge {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 20px;
            background: rgba(34, 197, 94, 0.12);
            border: 1px solid rgba(34, 197, 94, 0.25);
            color: #22c55e;
            font-size: 13px;
            font-weight: 600;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .user-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), #a78bfa);
            position: relative;
            overflow: visible;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            font-weight: 700;
            color: white;
        }
        .user-avatar.user-avatar--placeholder {
            background: linear-gradient(135deg, #334155, #475569);
            border: 1px solid rgba(148, 163, 184, 0.42);
        }
        .avatar-placeholder-icon {
            width: 20px;
            height: 20px;
            color: #dbeafe;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
            display: block;
        }
        .user-avatar.editable::after {
            content: "✎";
            position: absolute;
            right: -4px;
            bottom: -4px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), #8b5cf6);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.65);
            font-size: 10px;
            line-height: 12px;
            text-align: center;
            box-shadow: 0 4px 10px rgba(2, 6, 23, 0.35);
            pointer-events: none;
        }

        .user-name {
            font-size: 13px;
            color: var(--text-secondary);
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* 可编辑昵称：须保留右侧内边距放置 ✎，且不能用负坐标（否则被 overflow 裁切） */
        .user-name.editable {
            position: relative;
            display: inline-block;
            max-width: min(320px, 36vw);
            min-height: 36px;
            line-height: 22px;
            padding: 7px 40px 7px 12px;
            margin: -4px 0;
            box-sizing: border-box;
            vertical-align: middle;
            border-radius: 10px;
            border: 1px solid rgba(129, 140, 248, 0.22);
            background: rgba(15, 23, 42, 0.45);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            cursor: pointer;
            pointer-events: auto;
            z-index: 2;
            transition: background 0.2s, border-color 0.2s;
        }
        .user-name.editable:hover {
            background: rgba(99, 102, 241, 0.14);
            border-color: rgba(129, 140, 248, 0.5);
        }
        .user-name.editable::after {
            content: "✎";
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), #8b5cf6);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.75);
            font-size: 13px;
            line-height: 22px;
            text-align: center;
            box-shadow: 0 4px 14px rgba(2, 6, 23, 0.45);
            pointer-events: none;
        }

        .logout-btn {
            padding: 6px 16px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            font-size: 12px;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }

        .logout-btn:hover {
            background: var(--error);
            border-color: var(--error);
            color: white;
        }

        .recharge-opt {
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
        }

        .preset-btn {
            padding: 5px 12px;
            border: 1px solid var(--border);
            border-radius: 16px;
            background: var(--bg-input);
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .preset-btn:hover {
            border-color: var(--accent);
            color: var(--accent-hover);
            background: rgba(99, 102, 241, 0.08);
        }

        /* 数据流画布顶部：生成中状态（与 P2 阶段条 / 左上工具同系） */
        .opus-flow-generating-chip {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            top: 8px;
            z-index: 45;
            pointer-events: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 16px 6px 12px;
            border-radius: 999px;
            max-width: min(440px, calc(100% - 24px));
            box-sizing: border-box;
            background: linear-gradient(165deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.94) 100%);
            border: 1px solid rgba(99, 102, 241, 0.28);
            box-shadow:
                0 10px 36px rgba(0, 0, 0, 0.42),
                0 0 0 1px rgba(255, 255, 255, 0.04) inset,
                0 1px 0 rgba(255, 255, 255, 0.06) inset;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .opus-flow-generating-chip .opus-flow-gen-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            background: linear-gradient(145deg, #c7d2fe 0%, #6366f1 100%);
            box-shadow: 0 0 14px rgba(129, 140, 248, 0.55);
            animation: opusFlowGenPulse 1.35s ease-in-out infinite;
        }
        @keyframes opusFlowGenPulse {
            0%,
            100% {
                opacity: 0.82;
                transform: scale(1);
            }
            50% {
                opacity: 1;
                transform: scale(1.06);
            }
        }
        .opus-flow-generating-chip .opus-flow-gen-title {
            font-size: 12px;
            font-weight: 700;
            color: #e8eaff;
            letter-spacing: 0.04em;
        }
        .opus-flow-generating-chip .opus-flow-gen-sub {
            font-size: 11px;
            font-weight: 500;
            color: #94a3b8;
            letter-spacing: 0.02em;
        }
        .opus-flow-generating-chip .opus-flow-gen-sep {
            color: #475569;
            font-weight: 700;
            font-size: 11px;
            user-select: none;
        }

        /* 功能模块卡片网格 */
        .flow-module-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            max-height: 350px;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 2px;
        }
        .flow-module-card {
            position: relative;
            border: 1.5px solid #334155;
            border-radius: 10px;
            background: #0f172a;
            cursor: pointer;
            overflow: hidden;
            transition: border-color 0.15s, box-shadow 0.15s, filter 0.12s;
        }
        .flow-module-card:hover {
            border-color: #6366f1;
            box-shadow: 0 4px 16px rgba(99,102,241,0.15);
            /* 在 ReactFlow transform 缩放下，hover 的 transform 容易触发字体发糊 */
            filter: brightness(1.03);
        }
        .flow-module-card.active {
            border-color: #818cf8;
            background: rgba(99,102,241,0.08);
            box-shadow: 0 0 0 2px rgba(99,102,241,0.25);
        }
        .flow-module-card-icon {
            width: 100%;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border-bottom: 1px solid #1e293b;
            overflow: hidden;
        }
        .flow-module-card-icon img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        .flow-module-card-body {
            padding: 6px 8px;
        }
        .flow-module-card-name {
            font-size: 12px;
            font-weight: 600;
            color: #e2e8f0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .flow-module-card-desc {
            font-size: 10px;
            color: #94a3b8;
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .flow-module-card-del {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1px solid #7f1d1d;
            background: rgba(69,10,10,0.9);
            color: #fecaca;
            font-size: 11px;
            line-height: 16px;
            text-align: center;
            cursor: pointer;
            display: none;
            z-index: 2;
        }
        .flow-module-card:hover .flow-module-card-del {
            display: block;
        }
        .flow-module-card-edit {
            position: absolute;
            top: 4px;
            left: 4px;
            min-width: 18px;
            height: 18px;
            padding: 0 4px;
            border-radius: 6px;
            border: 1px solid rgba(99, 102, 241, 0.45);
            background: rgba(30, 27, 75, 0.92);
            color: #c7d2fe;
            font-size: 10px;
            font-weight: 800;
            line-height: 16px;
            text-align: center;
            cursor: pointer;
            display: none;
            z-index: 2;
        }
        .flow-module-card:hover .flow-module-card-edit {
            display: block;
        }
        .flow-module-card-add {
            border: 1.5px dashed #475569;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 90px;
            font-size: 28px;
            color: #475569;
            transition: border-color 0.15s, color 0.15s;
        }
        .flow-module-card-add:hover {
            border-color: #6366f1;
            color: #818cf8;
        }
        /* 功能模块：卡片在弹出层内选择（须高于 .opus-pc-flow-bottom-mount 1000075，低于 #fullscreenOverlay 1000080） */
        .flow-module-picker-overlay {
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1000079;
            background: rgba(2, 6, 23, 0.72);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
        }
        .flow-module-picker-panel {
            width: min(420px, calc(100vw - 32px));
            max-height: min(520px, calc(100vh - 48px));
            background: #0f172a;
            border: 1px solid #334155;
            border-radius: 14px;
            box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .flow-module-picker-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border-bottom: 1px solid #1e293b;
            font-size: 14px;
            font-weight: 600;
            color: #e2e8f0;
            flex-shrink: 0;
        }
        .flow-module-picker-head button {
            border: none;
            background: transparent;
            color: #94a3b8;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            padding: 0 4px;
            border-radius: 6px;
        }
        .flow-module-picker-head button:hover {
            color: #e2e8f0;
            background: rgba(148, 163, 184, 0.12);
        }
        .flow-module-picker-hint {
            padding: 0 14px 10px;
            font-size: 11px;
            line-height: 1.45;
            color: #64748b;
            border-bottom: 1px solid #1e293b;
            flex-shrink: 0;
        }
        .flow-module-picker-body {
            padding: 10px 12px 14px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .flow-module-picker-body .flow-module-grid {
            max-height: min(400px, calc(100vh - 200px));
        }
        .flow-module-node-slot {
            width: 100%;
            margin-bottom: 6px;
        }
        .flow-module-node-slot .flow-module-card {
            width: 100%;
            box-sizing: border-box;
        }
        .flow-module-placeholder {
            width: 100%;
            box-sizing: border-box;
            min-height: 92px;
            border: 1.5px dashed #475569;
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.45);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 8px;
            cursor: pointer;
            transition: border-color 0.15s, background 0.15s;
        }
        .flow-module-placeholder:hover {
            border-color: #6366f1;
            background: rgba(99, 102, 241, 0.08);
        }
        .flow-module-placeholder span {
            font-size: 11px;
            color: #94a3b8;
            text-align: center;
            line-height: 1.35;
        }
        .flow-module-prompt-preview {
            margin-top: 8px;
            padding: 6px 8px;
            background: #0b1220;
            border: 1px solid #1e293b;
            border-radius: 8px;
            font-size: 11px;
            color: #94a3b8;
            max-height: 48px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            word-break: break-all;
            user-select: none;
        }

        /* 模块编辑弹窗（须高于 .opus-pc-flow-bottom-mount 1000075、.flow-module-picker-overlay 1000079、#fullscreenOverlay 1000080） */
        .flow-rule-modal {
            display: none;
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1000085;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        .flow-rule-modal-backdrop {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            background: rgba(2,6,23,0.75);
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }
        .flow-rule-modal-card {
            position: relative;
            z-index: 1;
            width: min(960px, 98vw);
            max-height: min(90vh, 720px);
            background: var(--bg-card, #0f172a);
            border: 1px solid var(--border, #334155);
            border-radius: 14px;
            box-shadow: 0 24px 80px rgba(0,0,0,0.55);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .flow-rule-modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border, #334155);
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary, #e2e8f0);
        }
        .flow-rule-modal-head button {
            border: 1px solid var(--border, #334155);
            background: var(--bg-input, #1e293b);
            color: var(--text-secondary, #94a3b8);
            border-radius: 8px;
            padding: 6px 12px;
            cursor: pointer;
        }
        .flow-rule-modal-body {
            flex: 1;
            overflow: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .flow-rule-modal-body label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary, #94a3b8);
            display: block;
            margin-bottom: 4px;
        }
        .flow-rule-modal-body input,
        .flow-rule-modal-body textarea {
            width: 100%;
            padding: 8px 10px;
            background: var(--bg-input, #1e293b);
            border: 1px solid var(--border, #334155);
            border-radius: 8px;
            color: var(--text-primary, #e2e8f0);
            font-size: 13px;
            font-family: inherit;
            box-sizing: border-box;
        }
        .flow-rule-modal-body textarea {
            min-height: 120px;
            resize: vertical;
        }
        .flow-rule-modal-split {
            display: flex;
            gap: 10px;
            margin-bottom: 12px;
            min-height: 0;
            align-items: stretch;
        }
        .flow-rule-modal-pane--refs {
            flex: 1.35;
            min-width: 0;
            min-height: 150px;
            max-height: 360px;
        }
        .flow-rule-modal-source-stack {
            display: flex;
            flex-direction: column;
            min-height: 0;
            flex: 1;
            overflow-y: auto;
            gap: 0;
        }
        .flow-rule-modal-app-wrap {
            flex-shrink: 0;
            border-top: 1px solid var(--border, #334155);
        }
        /* 单张场景图：横排居中 */
        .flow-rule-modal-pane-body--app:not(.flow-rule-modal-pane-body--model5) {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: flex-start;
            align-items: flex-start;
            padding: 10px;
            gap: 10px;
        }
        .flow-rule-modal-pane-body--app:not(.flow-rule-modal-pane-body--model5) .flow-rule-modal-thumb-cell {
            width: auto;
            max-width: 140px;
            flex: 0 0 auto;
            min-width: 0;
        }
        .flow-rule-modal-pane-body--app:not(.flow-rule-modal-pane-body--model5) .flow-rule-modal-thumb {
            max-height: 96px;
        }
        /* 模特 5 槽：单行横排（须写在 .flow-rule-modal-pane-body 之后，见下方合并规则） */
        .flow-rule-modal-pane-body--model5 {
            display: grid !important;
            grid-template-columns: repeat(5, minmax(52px, 1fr));
            grid-auto-flow: row;
            gap: 8px;
            align-content: start;
            justify-items: stretch;
            padding: 10px !important;
            width: 100%;
            box-sizing: border-box;
            overflow-x: auto;
            overflow-y: hidden;
        }
        .flow-rule-modal-pane-body--model5 .flow-rule-modal-thumb-cell {
            width: 100% !important;
            max-width: none !important;
            min-width: 0;
        }
        .flow-rule-modal-pane-body--model5 .flow-rule-modal-thumb {
            max-height: 76px;
            width: 100%;
        }
        .flow-rule-modal-pane-body--model5 .flow-rule-modal-thumb-empty {
            min-height: 48px;
            font-size: 9px;
            padding: 4px;
        }
        .flow-rule-modal-pane-body--model5 .flow-rule-modal-thumb-label {
            font-size: 9px;
            white-space: nowrap;
        }
        .flow-rule-modal-pane--target {
            flex: 0 0 168px;
            width: 168px;
            max-width: 168px;
            min-height: 120px;
            max-height: 200px;
        }
        .flow-rule-modal-arrow {
            flex: 0 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0 6px;
            color: #94a3b8;
            align-self: center;
        }
        .flow-rule-modal-arrow-icon {
            font-size: 26px;
            font-weight: 300;
            line-height: 1;
            color: #818cf8;
            text-shadow: 0 0 20px rgba(129, 140, 248, 0.35);
        }
        .flow-rule-modal-arrow-hint {
            font-size: 10px;
            color: #64748b;
            white-space: nowrap;
            writing-mode: vertical-rl;
            letter-spacing: 0.12em;
        }
        @media (max-width: 720px) {
            .flow-rule-modal-split {
                flex-direction: column;
            }
            .flow-rule-modal-pane--target {
                flex: 1;
                width: 100%;
                max-width: none;
                min-height: 140px;
                max-height: 220px;
            }
            .flow-rule-modal-arrow {
                flex-direction: row;
                padding: 6px 0;
                width: 100%;
                justify-content: center;
            }
            .flow-rule-modal-arrow-icon {
                transform: rotate(90deg);
            }
            .flow-rule-modal-arrow-hint {
                writing-mode: horizontal-tb;
            }
        }
        .flow-rule-modal-pane {
            min-width: 0;
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border, #334155);
            border-radius: 10px;
            overflow: hidden;
            background: rgba(11, 18, 32, 0.5);
        }
        .flow-rule-modal-pane-title {
            padding: 8px 10px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary, #94a3b8);
            background: var(--bg-input, #1e293b);
            border-bottom: 1px solid var(--border, #334155);
            flex-shrink: 0;
        }
        /* 缩略图容器基类：不显式 display，避免盖掉下方 --refs / --model5 的 grid */
        .flow-rule-modal-pane-body {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            min-height: 0;
            gap: 8px;
            box-sizing: border-box;
        }
        /* 参考图：一行横排 3 列 */
        .flow-rule-modal-pane-body--refs {
            display: grid !important;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
            align-content: start;
            align-items: start;
        }
        .flow-rule-modal-pane-body--refs .flow-rule-modal-thumb-cell {
            width: 100% !important;
            min-width: 0;
            max-width: none !important;
        }
        .flow-rule-modal-pane-body--refs .flow-rule-modal-thumb {
            max-height: 88px;
            width: 100%;
        }
        .flow-rule-modal-pane-body--refs .flow-rule-modal-thumb-empty {
            min-height: 52px;
            padding: 6px;
            font-size: 10px;
        }
        .flow-rule-modal-pane-body--refs .flow-rule-modal-thumb-label {
            text-align: center;
            font-size: 10px;
        }
        /* 目标图：仅一张，居中 */
        .flow-rule-modal-pane-body--target {
            display: flex !important;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            align-content: flex-start;
            align-items: flex-start;
        }
        .flow-rule-modal-pane-body--target .flow-rule-modal-thumb-cell {
            width: 100%;
            max-width: 132px;
            min-width: 0;
        }
        .flow-rule-modal-pane-body--target .flow-rule-modal-thumb {
            max-height: 100px;
        }
        .flow-rule-modal-pane-body--target .flow-rule-modal-thumb-empty {
            min-height: 56px;
            padding: 6px;
            font-size: 11px;
        }
        .flow-rule-modal-thumb-cell {
            width: calc(50% - 4px);
            min-width: 96px;
            max-width: 160px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .flow-rule-modal-thumb {
            width: 100%;
            max-height: 120px;
            object-fit: contain;
            border-radius: 6px;
            background: #0b1220;
            border: 1px solid #334155;
            display: block;
        }
        .flow-rule-modal-thumb-empty {
            width: 100%;
            min-height: 72px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 8px;
            font-size: 11px;
            color: #64748b;
            border: 1px dashed #475569;
            border-radius: 6px;
            background: rgba(15, 23, 42, 0.6);
            box-sizing: border-box;
        }
        .flow-rule-modal-thumb-label {
            font-size: 10px;
            color: #64748b;
            text-align: center;
        }
        .flow-rule-modal-gallery-empty {
            width: 100%;
            padding: 16px 8px;
            text-align: center;
            font-size: 12px;
            color: #64748b;
        }
        .flow-rule-modal-fields {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .flow-rule-modal-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            padding: 12px 16px;
            border-top: 1px solid var(--border, #334155);
        }
        .flow-rule-modal-actions button {
            padding: 8px 20px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: 1px solid var(--border, #334155);
            font-family: inherit;
        }
        .flow-rule-modal-actions .btn-cancel {
            background: var(--bg-input, #1e293b);
            color: var(--text-secondary, #94a3b8);
        }
        .flow-rule-modal-actions .btn-save {
            background: #6366f1;
            color: #fff;
            border-color: #6366f1;
        }

        /* 主预览区：水流感进度条（与流程图输出节点视觉一致） */
        @keyframes opusWaterStream {
            from { transform: translateX(0); }
            to { transform: translateX(20px); }
        }
        @keyframes opusWaterShine {
            0% { transform: translateX(-120%); opacity: 0; }
            15% { opacity: 0.85; }
            100% { transform: translateX(280%); opacity: 0; }
        }
        @keyframes opusWaterSplash {
            0% { transform: translate(0, 0) scale(0.5); opacity: 0.95; }
            100% { transform: translate(6px, -10px) scale(1.6); opacity: 0; }
        }
        .progress-big-wrapper.opus-water-progress {
            position: relative;
            height: 40px;
            margin-bottom: 16px;
            background: transparent;
            border: none;
            overflow: visible;
        }
        .progress-big-wrapper.opus-water-progress .progress-big-track {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            overflow: hidden;
        }
        .progress-big-wrapper.opus-water-progress .progress-big-bar {
            position: relative;
            height: 100%;
            border-radius: 11px;
            background: linear-gradient(180deg, rgba(56, 189, 248, 0.55) 0%, rgba(99, 102, 241, 0.95) 42%, #4338ca 100%);
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.22),
                inset 0 -8px 14px rgba(0, 0, 0, 0.18),
                0 0 14px rgba(56, 189, 248, 0.25);
            transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            min-width: 0;
            overflow: hidden;
        }
        .progress-big-wrapper.opus-water-progress.opus-ramping .progress-big-bar {
            transition: none;
        }
        .opus-water-layer {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            pointer-events: none;
        }
        .opus-water-layer-a {
            background: repeating-linear-gradient(
                -18deg,
                transparent 0 6px,
                rgba(255, 255, 255, 0.07) 6px 8px,
                transparent 8px 16px
            );
            animation: opusWaterStream 0.85s linear infinite;
            opacity: 0.9;
        }
        .opus-water-layer-b {
            background: repeating-linear-gradient(
                12deg,
                transparent 0 10px,
                rgba(255, 255, 255, 0.05) 10px 11px,
                transparent 11px 22px
            );
            animation: opusWaterStream 1.25s linear infinite reverse;
            opacity: 0.65;
        }
        .opus-water-shine {
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            width: 38%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
            animation: opusWaterShine 2.4s ease-in-out infinite;
            pointer-events: none;
        }
        .opus-water-splash {
            position: absolute;
            right: -2px;
            top: 50%;
            width: 10px;
            height: 10px;
            margin-top: -5px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(125, 211, 252, 0.5) 45%, transparent 70%);
            animation: opusWaterSplash 0.75s ease-out infinite;
            pointer-events: none;
            opacity: 0.9;
        }
        .progress-big-text {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 700;
            color: white;
            text-shadow: 0 1px 3px rgba(0,0,0,.4);
            z-index: 2;
            pointer-events: none;
        }

        .history-table { width:100%; border-collapse:collapse; font-size:13px; }
        .history-table th { text-align:left; padding:8px 10px; color:var(--text-muted); font-weight:600; font-size:12px; border-bottom:1px solid var(--border); text-transform:uppercase; }
        .history-table td { padding:10px; border-bottom:1px solid var(--border); vertical-align:middle; }
        .history-table tr:hover td { background:rgba(255,255,255,.02); }
        .history-table .prompt-cell { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .history-table .thumb-cell img { width:48px; height:48px; object-fit:cover; border-radius:6px; border:1px solid var(--border); cursor:pointer; }
        .history-table .status-badge { padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
        .status-completed { background:rgba(34,197,94,.15); color:var(--success); }
        .status-failed { background:rgba(239,68,68,.15); color:var(--error); }
        .status-pending, .status-processing { background:rgba(245,158,11,.15); color:var(--warning); }
        .history-btn { padding:5px 12px; border:1px solid var(--border); border-radius:6px; background:var(--bg-input); color:var(--text-primary); font-size:12px; cursor:pointer; font-family:inherit; }
        .history-btn:hover { background:var(--bg-hover); }
        .history-btn:disabled { opacity:.4; cursor:not-allowed; }

        .recharge-opt:hover, .recharge-opt.active {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.12);
            color: var(--accent-hover);
        }
        .recharge-modal-card {
            position: relative;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 28px;
            width: 400px;
            max-width: 90vw;
        }
        .recharge-modal-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .recharge-modal-close:hover {
            border-color: var(--accent);
            color: var(--accent-hover);
            background: var(--bg-hover);
        }

        /* --- App Download UI (PC)：弹窗仍可由顶栏「下载APP」打开 --- */
        .app-dl-modal {
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            z-index: 1006500;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
        }
        .app-dl-backdrop {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            inset: 0;
            background: rgba(0,0,0,0.6);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
        }
        .app-dl-card {
            position: relative;
            width: max-content;
            max-width: min(520px, 92vw);
            min-width: 0;
            border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.10);
            background: rgba(10,16,28,0.92);
            box-shadow: 0 30px 80px rgba(0,0,0,0.55);
            overflow: hidden;
        }
        .app-dl-head {
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            padding: 14px 44px 14px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(6,182,212,0.12));
        }
        .app-dl-title {
            color: rgba(255,255,255,0.95);
            font-weight: 900;
            letter-spacing: .02em;
            text-align: center;
            font-size: clamp(13px, 2.2vw, 15px);
            line-height: 1.35;
            white-space: normal;
            word-break: break-word;
        }
        .app-dl-close {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 34px;
            height: 34px;
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.92);
            font-size: 20px;
            cursor: pointer;
            flex-shrink: 0;
        }
        .app-dl-close:hover { background: rgba(255,255,255,0.10); }
        .app-dl-body {
            padding: 14px 16px 18px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        .app-dl-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            justify-items: center;
        }
        .app-dl-item {
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(2,6,23,0.55);
            padding: 12px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            max-width: min(100%, 92vw);
            box-sizing: border-box;
        }
        .app-dl-link {
            display: inline-flex;
            margin-top: 0;
            padding: 10px 12px;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.10);
            background: rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.95);
            text-decoration: none;
            font-weight: 800;
            justify-content: center;
            text-align: center;
            max-width: 100%;
            box-sizing: border-box;
            word-break: break-word;
        }
        .app-dl-link:hover { background: rgba(255,255,255,0.10); }
        .app-dl-qr {
            margin-top: 12px;
            display: flex;
            justify-content: center;
        }
        @media (max-width: 860px) {
            .app-dl-grid { grid-template-columns: 1fr; }
        }

        /* 数据流：笔记本宽度压缩头部与边距；矮屏收起次要文案 */
        @media (max-width: 1440px) {
            html:has(#flowEditorRoot) .page-header,
            html.opus-pc-flow-wb .page-header {
                padding: 14px 20px;
            }
            html:has(#flowEditorRoot) .header-inner,
            html.opus-pc-flow-wb .header-inner {
                max-width: 100%;
            }
        }
        @media (max-width: 1280px) {
            html:has(#flowEditorRoot) .user-area,
            html.opus-pc-flow-wb .user-area {
                gap: 6px;
                flex-wrap: wrap;
                justify-content: flex-end;
            }
            html:has(#flowEditorRoot) .logout-btn,
            html.opus-pc-flow-wb .logout-btn {
                padding: 6px 10px;
                font-size: 12px;
            }
        }
        @media (max-height: 820px) {
            html:has(#flowEditorRoot) .page-header,
            html.opus-pc-flow-wb .page-header {
                padding: 10px 18px;
            }
            html:has(#flowEditorRoot) .tags,
            html.opus-pc-flow-wb .tags {
                display: none;
            }
            html:has(#flowEditorRoot) .model-desc,
            html.opus-pc-flow-wb .model-desc {
                display: none;
            }
        }
        @media (min-width: 1600px) {
            html:has(#flowEditorRoot) main.main-container,
            html.opus-pc-flow-wb main.main-container {
                padding-left: clamp(24px, 4vw, 48px);
                padding-right: clamp(24px, 4vw, 48px);
            }
        }

        /* ========== 页内登录弹窗 ========== */
        .opus-login-modal {
            position: fixed;
            top: 0; right: 0; bottom: 0; left: 0;
            z-index: 1100000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        .opus-login-backdrop {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            background: rgba(0, 0, 0, 0.65);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
        }
        .opus-login-card {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 400px;
            background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 16px;
            padding: 32px 28px 28px;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
            color: #e2e8f0;
            max-height: min(90vh, 680px);
            overflow-y: auto;
        }
        .opus-login-close {
            position: absolute;
            top: 12px;
            right: 14px;
            background: none;
            border: none;
            color: #94a3b8;
            font-size: 24px;
            cursor: pointer;
            line-height: 1;
            padding: 4px;
            transition: color 0.2s;
        }
        .opus-login-close:hover {
            color: #e2e8f0;
        }
        .opus-login-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
        }
        .opus-login-brand img {
            border-radius: 8px;
        }
        .opus-login-brand span {
            font-size: 20px;
            font-weight: 700;
            color: #f1f5f9;
        }
        .opus-login-tabs {
            display: flex;
            gap: 0;
            margin-bottom: 20px;
            border-bottom: 2px solid rgba(148, 163, 184, 0.12);
        }
        .opus-login-tab {
            flex: 1;
            padding: 10px 0;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            color: #94a3b8;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .opus-login-tab.active {
            color: #818cf8;
            border-bottom-color: #818cf8;
        }
        .opus-login-tab:hover:not(.active) {
            color: #cbd5e1;
        }
        .opus-login-msg {
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
            margin-bottom: 14px;
            line-height: 1.4;
        }
        .opus-login-msg.error {
            background: rgba(239, 68, 68, 0.12);
            color: #fca5a5;
            border: 1px solid rgba(239, 68, 68, 0.25);
        }
        .opus-login-msg.success {
            background: rgba(34, 197, 94, 0.12);
            color: #86efac;
            border: 1px solid rgba(34, 197, 94, 0.25);
        }
        .opus-login-field {
            margin-bottom: 16px;
        }
        .opus-login-field label {
            display: block;
            font-size: 13px;
            color: #94a3b8;
            margin-bottom: 6px;
            font-weight: 500;
        }
        .opus-login-field input {
            width: 100%;
            height: 44px;
            padding: 0 14px;
            background: rgba(15, 23, 42, 0.7);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 10px;
            color: #e2e8f0;
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }
        .opus-login-field input:focus {
            border-color: #818cf8;
        }
        .opus-login-field input::placeholder {
            color: #475569;
        }
        .opus-login-code-wrap {
            display: flex;
            gap: 8px;
        }
        .opus-login-code-wrap input {
            flex: 1;
            min-width: 0;
        }
        .opus-login-send-btn {
            flex-shrink: 0;
            height: 44px;
            padding: 0 14px;
            background: rgba(99, 102, 241, 0.15);
            border: 1px solid rgba(99, 102, 241, 0.3);
            border-radius: 10px;
            color: #a5b4fc;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .opus-login-send-btn:hover:not(:disabled) {
            background: rgba(99, 102, 241, 0.25);
        }
        .opus-login-send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .opus-login-submit {
            width: 100%;
            height: 46px;
            margin-top: 8px;
            background: linear-gradient(135deg, #6366f1, #4f46e5);
            border: none;
            border-radius: 10px;
            color: white;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: opacity 0.2s, transform 0.1s;
            letter-spacing: 2px;
        }
        .opus-login-submit:hover {
            opacity: 0.92;
        }
        .opus-login-submit:active {
            transform: scale(0.98);
        }
        .opus-login-submit:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .opus-login-regmode {
            display: flex;
            gap: 0;
            margin-bottom: 16px;
            background: rgba(15, 23, 42, 0.5);
            border-radius: 8px;
            padding: 3px;
        }
        .opus-login-regmode button {
            flex: 1;
            padding: 7px 0;
            background: none;
            border: none;
            border-radius: 6px;
            color: #94a3b8;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .opus-login-regmode button.active {
            background: rgba(99, 102, 241, 0.2);
            color: #a5b4fc;
            font-weight: 600;
        }
        .opus-login-trigger {
            animation: opus-login-pulse 2s ease-in-out infinite;
        }
        @keyframes opus-login-pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
            50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
        }

        /* ========== 顶栏 v2：身份 + 创作上下文（index等） ========== */
        .page-header--identity {
            padding: 14px 28px;
        }
        .header-inner--identity {
            max-width: 1440px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: nowrap;
        }
        .header-brand-cluster {
            flex: 0 0 auto;
            min-width: 0;
        }
        .page-header--identity .brand-row {
            margin-bottom: 2px;
        }
        .header-tagline {
            margin: 0;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.02em;
        }
        .header-session-cluster {
            flex: 1 1 auto;
            min-width: 0;
            display: none;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 12px;
        }
        .header-session-ico {
            display: flex;
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .header-session-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-secondary);
            max-width: min(420px, 38vw);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .header-session-edit-btn {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            padding: 0;
            border-radius: 8px;
            border: 1px solid rgba(129, 140, 248, 0.35);
            background: rgba(30, 41, 59, 0.85);
            color: var(--accent-hover);
            font-size: 14px;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .header-session-edit-btn:hover {
            background: rgba(99, 102, 241, 0.18);
            border-color: rgba(129, 140, 248, 0.55);
        }
        .header-actions-cluster {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 12px;
            min-width: 0;
        }
        .opus-header-login-btn {
            padding: 8px 20px;
            border-radius: 10px;
            border: none;
            background: linear-gradient(135deg, var(--accent), #06b6d4);
            color: #fff;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            font-family: inherit;
            white-space: nowrap;
        }
        .header-logged-in-cluster {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .opus-user-menu-wrap {
            position: relative;
        }
        .opus-user-menu-trigger {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 4px 10px 4px 6px;
            border-radius: 12px;
            border: 1px solid rgba(129, 140, 248, 0.28);
            background: rgba(15, 23, 42, 0.55);
            color: var(--text-primary);
            cursor: pointer;
            font-family: inherit;
            transition: background 0.15s, border-color 0.15s;
        }
        .opus-user-menu-trigger:hover {
            background: rgba(99, 102, 241, 0.12);
            border-color: rgba(129, 140, 248, 0.45);
        }
        .opus-user-menu-trigger .user-info {
            display: flex;
            align-items: center;
            gap: 8px;
            pointer-events: none;
        }
        .opus-user-menu-trigger .user-avatar {
            width: 36px;
            height: 36px;
            pointer-events: auto;
        }
        .opus-user-menu-trigger .user-name {
            max-width: min(200px, 28vw);
            font-size: 13px;
            color: var(--text-secondary);
            pointer-events: auto;
        }
        .opus-user-chevron {
            font-size: 9px;
            color: var(--text-muted);
            margin-left: 2px;
        }
        .opus-user-menu-dropdown {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            min-width: 220px;
            padding: 6px;
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(15, 23, 42, 0.98);
            box-shadow: 0 16px 48px rgba(2, 6, 23, 0.55);
            z-index: 200;
        }
        .opus-user-menu-item {
            display: flex;
            align-items: center;
            width: 100%;
            gap: 8px;
            padding: 10px 12px;
            margin: 0;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 14px;
            font-family: inherit;
            text-align: left;
            text-decoration: none;
            cursor: pointer;
            box-sizing: border-box;
        }
        .opus-user-menu-item:hover {
            background: rgba(99, 102, 241, 0.14);
            color: var(--text-primary);
        }
        .opus-user-menu-item--danger:hover {
            background: rgba(239, 68, 68, 0.15);
            color: #fecaca;
        }
        .opus-user-menu-sep {
            height: 1px;
            margin: 6px 4px;
            background: rgba(148, 163, 184, 0.2);
        }
        .opus-announce-dot-inline {
            display: inline-block;
            width: 8px;
            height: 8px;
            margin-left: 6px;
            border-radius: 50%;
            background: #ef4444;
            vertical-align: middle;
        }
        .opus-announce-menu-btn.opus-announce--shake {
            animation: opus-announce-shake 0.55s ease-in-out;
        }
        @media (max-width: 900px) {
            .header-inner--identity {
                flex-wrap: wrap;
            }
            .header-session-cluster {
                order: 3;
                flex: 1 1 100%;
                justify-content: flex-start;
                padding: 4px 0 0;
            }
            .header-session-title {
                max-width: 70vw;
            }
        }

