        /* ==========================================================================
       00. 基础重置
       ========================================================================== */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body,
        html {
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            background: #0f0f12;
            color: #e4e4e7;
            user-select: none;
        }

        #canvasPage {
            position: fixed;
            inset: 0;
            z-index: 9999;
            display: none;
            flex-direction: column;
            background: #0f0f12;
        }

        .cv-scrollbar::-webkit-scrollbar {
            width: 6px;
        }

        .cv-scrollbar::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        /* ==========================================================================
       新增：顶部栏即梦风格样式
       ========================================================================== */
        /* ★ 画布页顶栏：悬浮不占布局 */
.cv-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 200;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border-bottom: none;
    pointer-events: none;
}
.cv-topbar > * { pointer-events: auto; }

/* 顶栏左侧胶囊（项目名称+节点数）加毛玻璃 */
.cv-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 6px;
    background: rgba(15, 15, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 顶栏右侧按钮组加毛玻璃 */
.cv-topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(15, 15, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}



        .cv-logo {
            border-right: none;
            /* 移除旧的分隔线 */
            padding-right: 0;
            margin-right: 4px;
        }

        /* 项目下拉容器 */
        .cv-project-dropdown-wrap {
            position: relative;
        }

        /* 胶囊按钮 */
        .cv-project-name {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 500;
            color: #e4e4e7;
            padding: 6px 12px;
            background: #1a1a20;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s ease;
            min-width: 140px;
            max-width: 320px;
        }

        .cv-project-name:hover {
            background: #232329;
            border-color: #3a3a44;
        }

        .cv-project-name .project-name-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* 节点数和保存状态文字 */
        .cv-topbar-node-count {
            font-size: 12px;
            color: #71717a;
            margin-left: 4px;
        }

        .cv-topbar-save-status {
            font-size: 12px;
            color: #71717a;
            margin-left: 4px;
        }

        .cv-topbar-save-status.saving {
            color: #facc15;
        }

        /* 下拉菜单面板（图2样式） */
        .cv-project-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            width: 280px;
            background: #1a1a20;
            border: 1px solid #2a2a32;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
            display: none;
            flex-direction: column;
            overflow: hidden;
            z-index: 9999;
            animation: ctxIn 0.15s ease;
        }

        .cv-project-dropdown.show {
            display: flex;
        }

        .cv-pd-header {
            padding: 12px 16px;
            font-size: 12px;
            color: #71717a;
            border-bottom: 1px solid #2a2a32;
        }

        .cv-pd-list {
            max-height: 260px;
            overflow-y: auto;
            padding: 6px;
        }

        .cv-pd-list::-webkit-scrollbar {
            width: 5px;
        }

        .cv-pd-list::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-pd-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 9px 12px;
            border-radius: 8px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: all 0.1s;
        }

        .cv-pd-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-pd-item.active {
            background: rgba(99, 102, 241, 0.1);
            color: #a5b4fc;
        }

        .cv-pd-item .pd-check {
            display: none;
            color: #6366f1;
            font-size: 12px;
        }

        .cv-pd-item.active .pd-check {
            display: block;
        }

        .cv-pd-item .pd-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-right: 8px;
        }

        .cv-pd-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            border-top: 1px solid #2a2a32;
            font-size: 13px;
            color: #a1a1aa;
            cursor: pointer;
            transition: all 0.15s;
        }

        .cv-pd-footer:hover {
            background: #232329;
            color: #fff;
        }

        /* ==========================================================================
   02. 主体布局
   ========================================================================== */
        .cv-main {
            position: relative;
            flex: 1;
            overflow: hidden;
            display: flex;
        }

        /* ==========================================================================
   03. 项目侧边栏
   ========================================================================== */
        .cv-project-sidebar {
            width: 280px;
            flex-shrink: 0;
            background: #18181c;
            border-right: 1px solid #2a2a32;
            display: flex;
            flex-direction: column;
            transition: margin-left .25s ease;
            z-index: 15;
        }

        .cv-project-sidebar.hidden {
            margin-left: -280px;
        }

        .cv-sidebar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 48px;
            padding: 0 14px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-sidebar-header span {
            font-size: 13px;
            font-weight: 600;
            color: #e4e4e7;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cv-sidebar-header span i {
            color: #8b5cf6;
        }

        .cv-sidebar-close {
            width: 26px;
            height: 26px;
            border: none;
            background: transparent;
            color: #71717a;
            cursor: pointer;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

        .cv-sidebar-close:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-project-actions {
            padding: 12px 14px;
            flex-shrink: 0;
            border-bottom: 1px solid #2a2a32;
        }

        .cv-new-project-btn {
            width: 100%;
            height: 38px;
            border: 1px dashed #4f46e5;
            border-radius: 8px;
            background: rgba(99, 102, 241, .08);
            color: #a5b4fc;
            font-size: 13px;
            cursor: pointer;
            transition: all .15s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .cv-new-project-btn:hover {
            background: rgba(99, 102, 241, .18);
            color: #c7d2fe;
            border-style: solid;
        }

        .cv-project-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px 10px;
        }

        .cv-project-list::-webkit-scrollbar {
            width: 6px;
        }

        .cv-project-list::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-project-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            margin-bottom: 4px;
            border-radius: 8px;
            cursor: pointer;
            background: transparent;
            border: 1px solid transparent;
            transition: all .15s;
        }

        .cv-project-item:hover {
            background: #1f1f24;
            border-color: #2a2a32;
        }

        .cv-project-item.active {
            background: rgba(99, 102, 241, .1);
            border-color: rgba(99, 102, 241, .4);
        }

        .cv-project-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 14px;
            flex-shrink: 0;
        }

        .cv-project-item-info {
            flex: 1;
            min-width: 0;
        }

        .cv-project-item-name {
            font-size: 13px;
            font-weight: 500;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-project-item-meta {
            font-size: 11px;
            color: #71717a;
            margin-top: 2px;
        }

        .cv-project-item-del {
            width: 26px;
            height: 26px;
            border: none;
            background: transparent;
            color: #71717a;
            cursor: pointer;
            border-radius: 5px;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            flex-shrink: 0;
        }

        .cv-project-item:hover .cv-project-item-del {
            display: flex;
        }

        .cv-project-item-del:hover {
            background: #7f1d1d;
            color: #fecaca;
        }

        .cv-project-empty {
            text-align: center;
            padding: 40px 20px;
            color: #52525b;
            font-size: 12px;
            line-height: 1.8;
        }

        .cv-project-empty i {
            font-size: 28px;
            display: block;
            margin-bottom: 12px;
            opacity: .5;
        }

        /* ==========================================================================
   04. 画布视口
   ========================================================================== */
        .cv-viewport {
            position: relative;
            flex: 1;
            overflow: hidden;
            background-color: #0f0f12;
            background-image: radial-gradient(circle, #26262e 1.2px, transparent 1.2px);
            background-size: 24px 24px;
            cursor: default;
            touch-action: none;
        }

        .cv-viewport.panning {
            cursor: grabbing !important;
        }

        .cv-viewport.connecting {
            cursor: crosshair;
        }

        .cv-world {
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            transform-origin: 0 0;
            will-change: transform;
        }

        .cv-groups {
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            z-index: 0;
        }

        .cv-nodes {
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            z-index: 1;
        }

        .cv-edges {
            position: absolute;
            top: 0;
            left: 0;
            width: 1px;
            height: 1px;
            overflow: visible;
            pointer-events: none;
            z-index: 0;
        }

        .cv-edge-base {
            fill: none;
            stroke: rgba(180, 190, 220, 0.35);
            stroke-width: 1.4;
            stroke-linecap: round;
            pointer-events: stroke;
            cursor: pointer;
            transition: stroke .2s ease, stroke-width .2s ease;
        }

        .cv-edge-group:hover .cv-edge-base {
            stroke: url(#cvEdgeGrad);
            stroke-width: 2;
        }

        .cv-edge-flow {
            fill: none;
            stroke: rgba(255, 255, 255, 0.95);
            stroke-width: 2;
            stroke-dasharray: 3 22;
            stroke-linecap: round;
            opacity: 0;
            pointer-events: none;
            transition: opacity .2s ease;
        }

        .cv-edge-group:hover .cv-edge-flow {
            opacity: 1;
            animation: cvEdgeFlow 1.2s linear infinite;
        }

        @keyframes cvEdgeFlow {
            to {
                stroke-dashoffset: -25;
            }
        }

        .cv-edge-temp {
            fill: none;
            stroke: #a78bfa;
            stroke-width: 2;
            stroke-dasharray: 6 5;
            stroke-linecap: round;
            animation: cvDash .6s linear infinite;
            pointer-events: none;
        }

        @keyframes cvDash {
            to {
                stroke-dashoffset: -22;
            }
        }

        .cv-edge-scissor {
            position: fixed;
            width: 34px;
            height: 34px;
            background: #1e1e24;
            border: 1.5px solid #6366f1;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 13px;
            cursor: pointer;
            z-index: 200000;
            box-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 0 3px rgba(99, 102, 241, .18);
            transform: translate(-50%, -50%);
            transition: transform .15s ease, background .15s ease, border-color .15s ease;
            user-select: none;
        }

        .cv-edge-scissor.show {
            display: flex;
        }

        .cv-edge-scissor:hover {
            background: #ef4444;
            border-color: #ef4444;
            transform: translate(-50%, -50%) scale(1.12);
            box-shadow: 0 6px 20px rgba(239, 68, 68, .55), 0 0 0 3px rgba(239, 68, 68, .25);
        }

        .cv-selection-box {
            position: absolute;
            border: 1.5px solid #6366f1;
            background: rgba(99, 102, 241, .08);
            pointer-events: none;
            z-index: 50;
        }

        /* ==========================================================================
   05. 编组
   ========================================================================== */
        .cv-group {
            position: absolute;
            background: rgba(99, 102, 241, .06);
            border: 1.5px dashed rgba(99, 102, 241, .45);
            border-radius: 14px;
            pointer-events: none;
            transition: border-color .15s, background .15s;
        }

        .cv-group.selected {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
        }

        .cv-group-header {
            position: absolute;
            top: -30px;
            left: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 12px;
            background: #1e1e24;
            border: 1px solid #3a3a44;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 500;
            color: #e4e4e7;
            pointer-events: auto;
            cursor: pointer;
            white-space: nowrap;
            user-select: none;
            transition: all .15s;
        }

        .cv-group-header:hover {
            background: #2a2a32;
            border-color: #52525b;
        }

        .cv-group.selected .cv-group-header {
            background: rgba(99, 102, 241, .15);
            border-color: #6366f1;
            color: #c7d2fe;
        }

        .cv-group-header i {
            font-size: 11px;
            color: #8b5cf6;
        }

        .cv-group.selected .cv-group-header i {
            color: #a5b4fc;
        }

        .cv-group-header .cv-group-count {
            font-size: 10px;
            color: #71717a;
            padding: 1px 6px;
            background: #121216;
            border-radius: 8px;
            margin-left: 2px;
        }

        .cv-group-toolbar {
            position: absolute;
            top: 16px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(30, 30, 36, .95);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid #3a3a44;
            border-radius: 12px;
            padding: 6px 8px;
            display: none;
            align-items: center;
            gap: 4px;
            z-index: 35;
            box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
        }

        .cv-group-toolbar.show {
            display: flex;
        }

        .cgt-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 30px;
            padding: 0 12px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #d4d4d8;
            font-size: 12px;
            cursor: pointer;
            white-space: nowrap;
            transition: all .15s;
        }

        .cgt-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cgt-btn.cgt-danger {
            color: #fca5a5;
        }

        .cgt-btn.cgt-danger:hover {
            background: #7f1d1d;
            color: #fff;
        }

        .cgt-sep {
            width: 1px;
            height: 20px;
            background: #3a3a44;
            margin: 0 4px;
        }

        .cgt-colors {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 6px;
        }

        .cgt-color {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid transparent;
            transition: transform .15s;
        }

        .cgt-color:hover {
            transform: scale(1.15);
        }

        .cgt-color.active {
            border-color: #fff;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, .5);
        }

        /* ==========================================================================
   06. 节点
   ========================================================================== */
        .cv-node {
            position: absolute;
            z-index: 1;
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
            display: flex;
            flex-direction: column;
            padding: 0;
            transition: opacity .15s;
        }

        .cv-node.selected {
            background: transparent;
            border: none;
            box-shadow: none;
        }

        .cv-node.running {
            background: transparent;
            border: none;
        }

        .cv-node.disabled {
            opacity: .45;
            filter: grayscale(.5);
        }

        .cv-node.disabled .cv-node-body::after {
            content: '已禁用';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(239, 68, 68, .85);
            color: #fff;
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 11px;
            pointer-events: none;
            z-index: 20;
        }

        .cv-node-header {
            display: flex;
            align-items: center;
            gap: 6px;
            height: 26px;
            padding: 0 4px;
            background: transparent;
            border: none;
            border-radius: 0;
            cursor: move;
            user-select: none;
            margin-bottom: 4px;
        }

        .cv-node-header .node-icon {
            width: 16px;
            height: 16px;
            border-radius: 0;
            background: transparent !important;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            flex-shrink: 0;
            color: #71717a !important;
            transition: color .15s;
        }

        .cv-node:hover .cv-node-header .node-icon,
        .cv-node.selected .cv-node-header .node-icon {
            color: #a1a1aa !important;
        }

        .cv-node-title {
            flex: 1;
            font-size: 12px;
            font-weight: 400;
            color: #71717a;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            transition: color .15s;
            line-height: 1;
            cursor: text;
            padding: 3px 4px;
            border-radius: 4px;
        }

        .cv-node-title:hover {
            color: #e4e4e7;
            background: rgba(255, 255, 255, .06);
        }

        .cv-node:hover .cv-node-title {
            color: #a1a1aa;
        }

        .cv-node.selected .cv-node-title {
            color: #e4e4e7;
        }

        .cv-node-title-input {
            flex: 1;
            min-width: 0;
            height: 20px;
            padding: 0 6px;
            margin: 0;
            background: #121216;
            border: 1px solid #6366f1;
            border-radius: 5px;
            color: #e4e4e7;
            font-size: 12px;
            font-family: inherit;
            line-height: 18px;
            outline: none;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, .18);
        }

        .cv-node-status {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: transparent;
            flex-shrink: 0;
            transition: background .2s;
        }

        .cv-node-status.running {
            background: #facc15;
            animation: cvPulse 1s infinite;
        }

        .cv-node-status.done {
            background: #22c55e;
        }

        .cv-node-status.error {
            background: #ef4444;
        }

        @keyframes cvPulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: .25;
            }
        }

        .cv-node-body {
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 0;
            position: relative;
            background: #18181c;
            border: 1px solid #2a2a32;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
            transition: border-color .15s, box-shadow .15s;
        }

        .cv-node:hover .cv-node-body {
            border-color: #3a3a44;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
        }

        .cv-node.selected .cv-node-body {
            border-color: #6366f1;
            box-shadow: 0 0 0 1px rgba(99, 102, 241, .4), 0 4px 14px rgba(99, 102, 241, .18);
        }

        .cv-node.connect-target .cv-node-body {
            border-color: #22c55e;
            box-shadow: 0 0 0 2px rgba(34, 197, 94, .5), 0 4px 14px rgba(34, 197, 94, .25);
        }

        .cv-node-result {
            position: relative;
        }

        .cv-node-preview {
            display: block;
            width: 100%;
            height: auto;
            max-height: none;
            background: #0d0d10;
            object-fit: contain;
        }

        .cv-node-preview.video-preview {
            cursor: default;
            min-height: 100px;
            background: #000;
        }

        .cv-node-text-content {
            padding: 12px;
            font-size: 13px;
            line-height: 1.6;
            color: #d4d4d8;
            overflow-y: auto;
            white-space: pre-wrap;
            word-break: break-word;
            background: #121216;
            box-sizing: border-box;
        }

        .cv-node-text-content::-webkit-scrollbar {
            width: 6px;
        }

        .cv-node-text-content::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-node-text-content .cv-text-empty {
            color: #52525b;
        }

        .cv-node-text-content[contenteditable="true"] {
            cursor: text;
            outline: none;
            transition: background .15s, box-shadow .15s;
        }

        .cv-node-text-content[contenteditable="true"]:hover {
            box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .25);
        }

        .cv-node-text-content[contenteditable="true"]:focus {
            box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .6);
        }

        .cv-node-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #52525b;
            font-size: 12px;
            gap: 6px;
            height: 160px;
            border: none;
            border-radius: 0;
            cursor: default;
            background: #121216;
        }

        .cv-node-empty i {
            font-size: 22px;
        }

        .cv-node-empty.running i {
            color: #facc15;
        }

        .cv-node-empty-hint {
            font-size: 10px;
            color: #3f3f46;
            margin-top: 2px;
        }

        .cv-node-add-btn {
            position: absolute;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #1a1a20;
            border: 1px solid #3f3f46;
            color: #a1a1aa;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            cursor: crosshair;
            z-index: 15;
            top: 50%;
            transform: translateY(-50%) scale(.6);
            opacity: 0;
            transition: opacity .18s, transform .18s, background .15s, border-color .15s, box-shadow .15s;
            pointer-events: none;
        }

        .cv-node:hover .cv-node-add-btn,
        .cv-node.selected .cv-node-add-btn,
        .cv-viewport.connecting .cv-node-add-btn {
            opacity: 1;
            transform: translateY(-50%) scale(1);
            pointer-events: auto;
        }

        .cv-node-add-left {
            left: -32px;
        }

        .cv-node-add-right {
            right: -32px;
        }

        .cv-node-add-btn:hover {
            background: #6366f1;
            border-color: #6366f1;
            color: #fff;
            transform: translateY(-50%) scale(1.2);
        }

        .cv-node.connect-target .cv-node-add-btn {
            background: #22c55e;
            border-color: #22c55e;
            color: #fff;
            box-shadow: 0 0 12px rgba(34, 197, 94, .7);
        }

        .cv-port {
            display: none;
        }

        /* 节点大小调整手柄 */
        .cv-node-resize {
            position: absolute;
            right: -3px;
            bottom: -3px;
            width: 18px;
            height: 18px;
            cursor: nwse-resize;
            z-index: 25;
            opacity: 0;
            transition: opacity .15s;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cv-node-resize::before {
            content: '';
            width: 9px;
            height: 9px;
            border-right: 2px solid #6366f1;
            border-bottom: 2px solid #6366f1;
            border-radius: 0 0 3px 0;
        }

        .cv-node:hover .cv-node-resize,
        .cv-node.selected .cv-node-resize {
            opacity: 1;
            pointer-events: auto;
        }

        .cv-node-resize:hover::before {
            border-color: #a78bfa;
        }

        .cv-node.has-height .cv-node-body {
            flex: 1;
            min-height: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .cv-node.has-height .cv-node-result {
            flex: 1;
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .cv-node.has-height .cv-node-preview {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .cv-node.has-height .cv-node-empty {
            height: 100%;
        }

        /* ==========================================================================
   07. 文本节点悬浮工具栏
   ========================================================================== */
        .cv-text-node-toolbar {
            position: absolute;
            top: -46px;
            left: 0;
            display: none;
            align-items: center;
            gap: 4px;
            padding: 5px 8px;
            background: rgba(30, 30, 36, .96);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid #3a3a44;
            border-radius: 10px;
            z-index: 100;
            box-shadow: 0 8px 30px rgba(0, 0, 0, .6);
            white-space: nowrap;
        }

        .cv-node.selected[data-node-type="text"] .cv-text-node-toolbar {
            display: flex;
        }

        .cv-tnt-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            height: 26px;
            padding: 0 9px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #d4d4d8;
            font-size: 12px;
            cursor: pointer;
            transition: background .15s;
        }

        .cv-tnt-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tnt-btn.icon-only {
            width: 26px;
            padding: 0;
        }

        .cv-tnt-color-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 26px;
            padding: 0 8px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            color: #d4d4d8;
            transition: background .15s;
        }

        .cv-tnt-color-wrap:hover {
            background: #2a2a32;
        }

        .cv-tnt-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
            border: 1px solid #3a3a44;
            cursor: pointer;
            padding: 0;
            background: transparent;
        }

        .cv-tnt-sep {
            width: 1px;
            height: 18px;
            background: #3a3a44;
            margin: 0 4px;
        }

        /* ==========================================================================
   08. 时间线内嵌组件
   ========================================================================== */
        .cv-timeline-wrap {
            background: #0d0d10;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            overflow: hidden;
        }

        .cv-timeline-toolbar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            background: #15151a;
            border-bottom: 1px solid #2a2a32;
            font-size: 11px;
        }

        .cv-timeline-toolbar .tl-icon-btn {
            width: 22px;
            height: 22px;
            border: none;
            border-radius: 4px;
            background: transparent;
            color: #a1a1aa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            transition: all .15s;
        }

        .cv-timeline-toolbar .tl-icon-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-timeline-toolbar .tl-icon-btn.playing {
            color: #6366f1;
        }

        .cv-timeline-toolbar .tl-spacer {
            flex: 1;
        }

        .cv-timeline-toolbar .tl-export-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            height: 22px;
            padding: 0 8px;
            background: #6366f1;
            color: #fff;
            border: none;
            border-radius: 4px;
            font-size: 11px;
            cursor: pointer;
            transition: background .15s;
        }

        .cv-timeline-toolbar .tl-export-btn:hover {
            background: #4f46e5;
        }

        .cv-timeline-time {
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 11px;
            color: #a1a1aa;
            margin: 0 4px;
            white-space: nowrap;
        }

        .cv-timeline-ruler {
            height: 18px;
            position: relative;
            background: #15151a;
            border-bottom: 1px solid #2a2a32;
            overflow: hidden;
            font-size: 9px;
            color: #52525b;
        }

        .cv-timeline-ruler-inner {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            will-change: transform;
        }

        .cv-timeline-tick {
            position: absolute;
            top: 0;
            height: 100%;
            border-left: 1px solid #2a2a32;
            padding-left: 4px;
            display: flex;
            align-items: center;
            font-size: 9px;
            color: #52525b;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
        }

        .cv-timeline-tracks {
            position: relative;
            min-height: 62px;
            padding: 6px 0;
            overflow-x: auto;
            overflow-y: hidden;
            background: #0d0d10;
        }

        .cv-timeline-tracks::-webkit-scrollbar {
            height: 6px;
        }

        .cv-timeline-tracks::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-timeline-tracks-inner {
            position: relative;
            height: 50px;
            min-width: 100%;
        }

        .cv-timeline-track {
            position: absolute;
            height: 44px;
            border-radius: 5px;
            overflow: hidden;
            cursor: pointer;
            border: 1.5px solid transparent;
            transition: border-color .15s;
            display: flex;
            align-items: center;
            background: #26262e;
        }

        .cv-timeline-track:hover {
            border-color: #6366f1;
        }

        .cv-timeline-track.selected {
            border-color: #6366f1;
            box-shadow: 0 0 0 1px #6366f1;
        }

        .cv-timeline-track-thumb {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center;
            opacity: .7;
        }

        .cv-timeline-track-overlay {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            padding: 4px 8px;
            width: 100%;
            height: 100%;
            justify-content: space-between;
            pointer-events: none;
        }

        .cv-timeline-track-name {
            font-size: 10px;
            color: #fff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-timeline-track-duration {
            font-size: 9px;
            color: rgba(255, 255, 255, .8);
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
        }

        .cv-timeline-track-audio .cv-timeline-track-thumb {
            background: linear-gradient(90deg, #059669, #10b981, #059669);
            opacity: .5;
        }

        .cv-timeline-track-image .cv-timeline-track-thumb {
            opacity: 1;
        }

        .cv-timeline-playhead {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #fff;
            z-index: 10;
            pointer-events: none;
            box-shadow: 0 0 6px rgba(255, 255, 255, .6);
        }

        .cv-timeline-playhead::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -4px;
            width: 10px;
            height: 8px;
            background: #fff;
            border-radius: 2px;
            clip-path: polygon(0 0, 100% 0, 50% 100%);
        }

        .cv-timeline-add-clip {
            position: absolute;
            width: 44px;
            height: 44px;
            border: 1px dashed #3f3f46;
            border-radius: 5px;
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #71717a;
            cursor: pointer;
            font-size: 16px;
            transition: all .15s;
        }

        .cv-timeline-add-clip:hover {
            border-color: #6366f1;
            color: #a5b4fc;
            background: rgba(99, 102, 241, .08);
        }

        .cv-timeline-empty {
            text-align: center;
            padding: 20px;
            color: #52525b;
            font-size: 11px;
            line-height: 1.6;
        }

        .cv-timeline-empty i {
            font-size: 20px;
            display: block;
            margin-bottom: 6px;
            opacity: .5;
        }

        /* ==========================================================================
   09. 右侧节点面板
   ========================================================================== */
        .cv-node-sidebar {
            width: 440px;
            flex-shrink: 0;
            background: #18181c;
            border-left: 1px solid #2a2a32;
            display: flex;
            flex-direction: column;
            transition: margin-right .25s ease;
            z-index: 15;
        }

        .cv-node-sidebar.hidden {
            margin-right: -440px;
            pointer-events: none;
            visibility: hidden;
            transition: margin-right .25s ease, visibility 0s linear .25s;
        }

        .cv-node-sidebar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 44px;
            padding: 0 12px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-node-sidebar-title {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12.5px;
            font-weight: 600;
            color: #e4e4e7;
            flex: 1;
            min-width: 0;
        }

        .cv-node-sidebar-title i {
            color: #a78bfa;
        }

        .cv-node-sidebar-title span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-node-header-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .cv-node-copy-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 28px;
            padding: 0 10px;
            border: 1px solid #3f3f46;
            border-radius: 7px;
            background: transparent;
            color: #a1a1aa;
            font-size: 11.5px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
        }

        .cv-node-copy-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #52525b;
        }

        .cv-node-delete-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 28px;
            padding: 0 10px;
            border: 1px solid #7f1d1d;
            border-radius: 7px;
            background: rgba(127, 29, 29, .2);
            color: #fca5a5;
            font-size: 11.5px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
        }

        .cv-node-delete-btn:hover {
            background: #7f1d1d;
            color: #fff;
            border-color: #991b1b;
        }

        .cv-node-sidebar-body {
            flex: 1;
            overflow-y: auto;
            padding: 10px 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .cv-node-sidebar-body::-webkit-scrollbar {
            width: 6px;
        }

        .cv-node-sidebar-body::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-field-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .cv-field-label {
            font-size: 11.5px;
            font-weight: 500;
            color: #a1a1aa;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .cv-field-label i {
            font-size: 10px;
            color: #71717a;
        }

        .cv-input,
        .cv-textarea,
        .cv-select {
            width: 100%;
            background: #121216;
            border: 1px solid #33333c;
            border-radius: 6px;
            color: #e4e4e7;
            font-size: 12.5px;
            padding: 7px 10px;
            outline: none;
            font-family: inherit;
            transition: border-color .15s;
        }

        .cv-input:focus,
        .cv-textarea:focus,
        .cv-select:focus {
            border-color: #6366f1;
        }

        .cv-textarea {
            resize: vertical;
            min-height: 90px;
            line-height: 1.5;
        }

        .cv-select {
            cursor: pointer;
        }

        .cv-sidebar-divider {
            height: 1px;
            background: #2a2a32;
            margin: 2px 0;
        }

        .cv-prompt-textarea {
            min-height: 170px;
        }

        .cv-param-row {
            display: flex;
            flex-direction: row;
            gap: 6px;
        }

        .cv-param-row .cv-select {
            flex: 1;
            min-width: 0;
            padding: 7px 10px;
            font-size: 12.5px;
        }

        .cv-field-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cv-field-row .cv-field-label {
            flex-shrink: 0;
            margin: 0;
            white-space: nowrap;
            min-width: 48px;
        }

        .cv-field-row .cv-input,
        .cv-field-row .cv-select {
            flex: 1;
            min-width: 0;
        }

        .cv-upstream-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
            gap: 6px;
        }

        .cv-upstream-item {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 6px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 7px;
            min-width: 0;
            transition: border-color .15s;
        }

        .cv-upstream-item:hover {
            border-color: #3f3f46;
        }

        .cv-upstream-thumb {
            width: 30px;
            height: 30px;
            border-radius: 5px;
            flex-shrink: 0;
            overflow: hidden;
            background: #1a1a20;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 12px;
            border: 1px solid #2a2a32;
        }

        .cv-upstream-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-upstream-info {
            flex: 1;
            min-width: 0;
        }

        .cv-upstream-name {
            font-size: 11px;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-upstream-type {
            font-size: 9.5px;
            color: #71717a;
            margin-top: 1px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-upstream-remove {
            width: 20px;
            height: 20px;
            border: none;
            background: transparent;
            color: #71717a;
            cursor: pointer;
            border-radius: 4px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
        }

        .cv-upstream-remove:hover {
            background: #7f1d1d;
            color: #fecaca;
        }

        .cv-result-box {
            position: relative;
            width: 100%;
            height: 190px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            overflow: hidden;
            padding: 5px;
        }

        .cv-result-box img,
        .cv-result-box video {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 5px;
            display: block;
            cursor: zoom-in;
        }

        .cv-result-box video {
            cursor: default;
        }

        .cv-result-box audio {
            width: 100%;
        }

        .cv-result-overlay {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 6px;
            z-index: 3;
        }

        .cv-result-overlay-btn {
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 8px;
            background: rgba(0, 0, 0, .7);
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all .15s;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
        }

        .cv-result-overlay-btn:hover {
            background: #6366f1;
            transform: scale(1.05);
        }

        .cv-result-overlay-btn.danger:hover {
            background: #dc2626;
        }

        .cv-result-overlay-btn.edit {
            background: rgba(99, 102, 241, .85);
        }

        .cv-result-overlay-btn.edit:hover {
            background: #4f46e5;
        }

        .cv-run-btn {
            width: 100%;
            height: 38px;
            border: none;
            border-radius: 8px;
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all .15s;
        }

        .cv-run-btn:hover {
            filter: brightness(1.1);
        }

        .cv-run-btn:active {
            transform: scale(.98);
        }

        .cv-upload-btn {
            width: 100%;
            height: 34px;
            border: 1px solid #3b82f6;
            border-radius: 8px;
            background: rgba(59, 130, 246, .1);
            color: #93c5fd;
            font-size: 11.5px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all .15s;
        }

        .cv-upload-btn:hover {
            background: rgba(59, 130, 246, .2);
            color: #bfdbfe;
        }


        /* ==========================================================================
   11. 左侧悬浮工具栏
   ========================================================================== */
        .cv-floating-toolbar {
            position: absolute;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(24, 24, 28, .88);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid #2a2a32;
            border-radius: 12px;
            padding: 8px 7px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            z-index: 25;
            box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
            width: 50px;
            overflow: hidden;
            transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .cv-floating-toolbar:hover {
            width: 160px;
        }

        .cv-floating-toolbar-btn {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 10px 8px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: #a1a1aa;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
            white-space: nowrap;
            width: 100%;
            box-sizing: border-box;
            text-align: left;
        }

        .cv-floating-toolbar-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-floating-toolbar-btn i {
            font-size: 14px;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
            display: inline-block;
        }

        .cv-floating-toolbar-btn span {
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
        }

        .cv-floating-toolbar:hover .cv-floating-toolbar-btn span {
            opacity: 1;
        }

        /* ==========================================================================
   12. 右键菜单
   ========================================================================== */
        .cv-ctx-menu {
            position: fixed;
            z-index: 200000;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, .8);
            padding: 6px;
            min-width: 200px;
            max-height: 70vh;
            overflow-y: auto;
            animation: ctxIn .1s ease;
        }

        .cv-ctx-menu::-webkit-scrollbar {
            width: 6px;
        }

        .cv-ctx-menu::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        @keyframes ctxIn {
            from {
                opacity: 0;
                transform: translateY(-4px);
            }
        }

        .cv-ctx-title {
            font-size: 11px;
            color: #71717a;
            padding: 6px 12px 4px;
        }

        .cv-ctx-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-ctx-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-ctx-item i {
            width: 16px;
            text-align: center;
            font-size: 13px;
        }

        .cv-ctx-item.danger {
            color: #fca5a5;
        }

        .cv-ctx-item.danger:hover {
            background: #7f1d1d;
            color: #fff;
        }

        .cv-ctx-item .shortcut {
            margin-left: auto;
            font-size: 11px;
            color: #71717a;
        }

        .cv-ctx-sep {
            height: 1px;
            background: #2a2a32;
            margin: 4px 0;
        }

        /* ==========================================================================
   13. 大图查看器
   ========================================================================== */
        .cv-viewer-modal {
            position: fixed;
            inset: 0;
            z-index: 100000;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .92);
            backdrop-filter: blur(4px);
        }

        .cv-viewer-modal.show {
            display: flex;
        }

        .cv-viewer-content {
            position: relative;
            max-width: 92vw;
            max-height: 92vh;
        }

        .cv-viewer-content img,
        .cv-viewer-content video {
            max-width: 92vw;
            max-height: 92vh;
            border-radius: 8px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
            display: block;
        }

        .cv-viewer-close {
            position: absolute;
            top: -50px;
            right: 0;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, .15);
            border: none;
            color: #fff;
            font-size: 22px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cv-viewer-close:hover {
            background: rgba(255, 255, 255, .3);
        }

        /* ==========================================================================
   14. 资产库弹窗
   ========================================================================== */
        .cv-asset-modal {
            position: fixed;
            inset: 0;
            z-index: 100000;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .7);
            backdrop-filter: blur(4px);
        }

        .cv-asset-modal.show {
            display: flex;
        }

        .cv-asset-dialog {
            width: 720px;
            max-width: 90vw;
            max-height: 80vh;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .cv-asset-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px;
            border-bottom: 1px solid #2a2a32;
        }

        .cv-asset-header span {
            font-size: 14px;
            font-weight: 600;
            color: #e4e4e7;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cv-asset-header span i {
            color: #8b5cf6;
        }

        .cv-asset-close {
            width: 30px;
            height: 30px;
            border: none;
            background: transparent;
            color: #71717a;
            cursor: pointer;
            border-radius: 6px;
            font-size: 16px;
        }

        .cv-asset-close:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-asset-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 18px;
        }

        .cv-asset-body::-webkit-scrollbar {
            width: 6px;
        }

        .cv-asset-body::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-asset-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
        }

        .cv-asset-item {
            aspect-ratio: 1;
            background: #121216;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            border: 1px solid #2a2a32;
            transition: all .15s;
        }

        .cv-asset-item:hover {
            border-color: #6366f1;
            transform: scale(1.02);
        }

        .cv-asset-item img,
        .cv-asset-item video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-asset-item .asset-icon {
            font-size: 28px;
            color: #52525b;
        }

        .cv-asset-item .asset-badge {
            position: absolute;
            bottom: 4px;
            left: 4px;
            right: 4px;
            background: rgba(0, 0, 0, .75);
            color: #fff;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-asset-empty {
            text-align: center;
            padding: 60px 20px;
            color: #52525b;
            font-size: 13px;
        }

        .cv-asset-empty i {
            font-size: 40px;
            display: block;
            margin-bottom: 14px;
            opacity: .5;
        }

        /* ==========================================================================
   15. 全屏时间线编辑器
   ========================================================================== */
        .cv-tl-editor {
            position: fixed;
            inset: 0;
            z-index: 150000;
            display: none;
            background: #0a0a0d;
            flex-direction: column;
        }

        .cv-tl-editor.show {
            display: flex;
        }

        .cv-tl-editor-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 48px;
            padding: 0 18px;
            background: #15151a;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-tl-editor-header-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .cv-tl-editor-header-title i {
            color: #06b6d4;
        }

        .cv-tl-editor-header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cv-tl-editor-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        .cv-tl-asset-panel {
            width: 260px;
            flex-shrink: 0;
            background: #15151a;
            border-right: 1px solid #2a2a32;
            display: flex;
            flex-direction: column;
        }

        .cv-tl-asset-tabs {
            display: flex;
            padding: 8px 8px 0;
            gap: 4px;
            border-bottom: 1px solid #2a2a32;
        }

        .cv-tl-asset-tab {
            flex: 1;
            padding: 8px 12px;
            background: transparent;
            border: none;
            border-radius: 6px 6px 0 0;
            color: #71717a;
            font-size: 12px;
            cursor: pointer;
            transition: all .15s;
            text-align: center;
        }

        .cv-tl-asset-tab:hover {
            color: #a1a1aa;
            background: #1a1a20;
        }

        .cv-tl-asset-tab.active {
            background: #1e1e24;
            color: #e4e4e7;
            border-bottom: 2px solid #6366f1;
        }

        .cv-tl-asset-filter {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 12px;
            border-bottom: 1px solid #2a2a32;
            font-size: 12px;
        }

        .cv-tl-asset-filter .filter-item {
            padding: 3px 10px;
            border-radius: 12px;
            color: #71717a;
            cursor: pointer;
            transition: all .15s;
        }

        .cv-tl-asset-filter .filter-item:hover {
            color: #a1a1aa;
        }

        .cv-tl-asset-filter .filter-item.active {
            background: rgba(99, 102, 241, .15);
            color: #a5b4fc;
        }

        .cv-tl-asset-filter .filter-spacer {
            flex: 1;
        }

        .cv-tl-asset-filter .import-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            height: 24px;
            padding: 0 10px;
            background: transparent;
            border: 1px solid #3f3f46;
            border-radius: 5px;
            color: #a1a1aa;
            font-size: 11px;
            cursor: pointer;
            transition: all .15s;
        }

        .cv-tl-asset-filter .import-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #52525b;
        }

        .cv-tl-asset-list {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            align-content: flex-start;
        }

        .cv-tl-asset-list::-webkit-scrollbar {
            width: 6px;
        }

        .cv-tl-asset-list::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-tl-asset-card {
            position: relative;
            aspect-ratio: 16/10;
            border-radius: 6px;
            overflow: hidden;
            background: #121216;
            border: 1.5px solid #2a2a32;
            cursor: grab;
            transition: all .15s;
        }

        .cv-tl-asset-card:hover {
            border-color: #6366f1;
            transform: translateY(-1px);
        }

        .cv-tl-asset-card:active {
            cursor: grabbing;
        }

        .cv-tl-asset-card img,
        .cv-tl-asset-card video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-tl-asset-card .card-icon {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: #71717a;
        }

        .cv-tl-asset-card .card-badge {
            position: absolute;
            top: 4px;
            left: 4px;
            background: rgba(0, 0, 0, .75);
            color: #fff;
            font-size: 9px;
            padding: 2px 5px;
            border-radius: 3px;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        .cv-tl-asset-card .card-name {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85));
            color: #fff;
            font-size: 10px;
            padding: 12px 6px 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-tl-asset-card.added::after {
            content: '✓';
            position: absolute;
            top: 4px;
            right: 4px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #22c55e;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
        }

        .cv-tl-asset-empty {
            grid-column: 1 / -1;
            padding: 40px 20px;
            color: #52525b;
            font-size: 12px;
            text-align: center;
            line-height: 1.7;
        }

        .cv-tl-asset-empty i {
            font-size: 30px;
            display: block;
            margin-bottom: 12px;
            opacity: .5;
        }

        .cv-tl-preview-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #050507;
            position: relative;
            overflow: hidden;
        }

        .cv-tl-preview-stage {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            padding: 20px;
        }

        .cv-tl-preview-player {
            max-width: 100%;
            max-height: 100%;
            border-radius: 6px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
            background: #000;
            object-fit: contain;
        }

        .cv-tl-preview-empty {
            color: #3f3f46;
            font-size: 14px;
            text-align: center;
        }

        .cv-tl-preview-empty i {
            font-size: 48px;
            display: block;
            margin-bottom: 16px;
            opacity: .4;
        }

        .cv-tl-preview-controls {
            height: 44px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 16px;
            background: rgba(0, 0, 0, .6);
            border-top: 1px solid #1a1a20;
            flex-shrink: 0;
        }

        .cv-tl-preview-controls .pc-btn {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: #a1a1aa;
            cursor: pointer;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: all .15s;
        }

        .cv-tl-preview-controls .pc-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tl-preview-controls .pc-time {
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 12px;
            color: #e4e4e7;
            margin: 0 4px;
            white-space: nowrap;
        }

        .cv-tl-preview-controls .pc-spacer {
            flex: 1;
        }

        .cv-tl-editor-bottom {
            flex-shrink: 0;
            background: #15151a;
            border-top: 1px solid #2a2a32;
            display: flex;
            flex-direction: column;
            height: 240px;
        }

        .cv-tl-toolbar {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            border-bottom: 1px solid #2a2a32;
            height: 38px;
        }

        .cv-tl-toolbar .tool-btn {
            width: 26px;
            height: 26px;
            border: none;
            background: transparent;
            color: #a1a1aa;
            cursor: pointer;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all .15s;
        }

        .cv-tl-toolbar .tool-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tl-toolbar .tool-sep {
            width: 1px;
            height: 16px;
            background: #2a2a32;
            margin: 0 6px;
        }

        .cv-tl-toolbar .tool-spacer {
            flex: 1;
        }

        .cv-tl-toolbar .tl-zoom {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #71717a;
            font-size: 11px;
        }

        .cv-tl-toolbar .tl-zoom input[type="range"] {
            width: 100px;
            accent-color: #6366f1;
        }

        .cv-tl-ruler-wrap {
            position: relative;
            height: 22px;
            background: #101014;
            border-bottom: 1px solid #2a2a32;
            overflow: hidden;
            cursor: pointer;
        }

        .cv-tl-ruler-inner {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
        }

        .cv-tl-ruler-tick {
            position: absolute;
            top: 0;
            height: 100%;
            border-left: 1px solid #2a2a32;
            padding-left: 5px;
            display: flex;
            align-items: center;
            font-size: 10px;
            color: #71717a;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            pointer-events: none;
        }

        .cv-tl-ruler-tick.major {
            border-color: #52525b;
            color: #a1a1aa;
        }

        .cv-tl-tracks-area {
            flex: 1;
            overflow: auto;
            position: relative;
            background: #0a0a0d;
        }

        .cv-tl-tracks-area::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        .cv-tl-tracks-area::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 4px;
        }

        .cv-tl-tracks-area::-webkit-scrollbar-track {
            background: transparent;
        }

        .cv-tl-tracks {
            position: relative;
            min-width: 100%;
            min-height: 100%;
            padding: 8px 0 16px;
        }

        .cv-tl-track-row {
            position: relative;
            height: 56px;
            margin-bottom: 4px;
            border-bottom: 1px dashed rgba(42, 42, 50, .5);
        }

        .cv-tl-track-row:last-child {
            border-bottom: none;
        }

        .cv-tl-clip {
            position: absolute;
            height: 48px;
            top: 4px;
            border-radius: 6px;
            overflow: hidden;
            cursor: pointer;
            border: 1.5px solid transparent;
            background: #26262e;
            transition: border-color .1s, box-shadow .1s;
        }

        .cv-tl-clip:hover {
            border-color: #818cf8;
        }

        .cv-tl-clip.selected {
            border-color: #6366f1;
            box-shadow: 0 0 0 1px #6366f1, 0 0 12px rgba(99, 102, 241, .5);
            z-index: 5;
        }

        .cv-tl-clip-bg {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center;
            opacity: .85;
        }

        .cv-tl-clip-overlay {
            position: relative;
            z-index: 1;
            height: 100%;
            padding: 4px 6px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            pointer-events: none;
        }

        .cv-tl-clip-name {
            font-size: 10px;
            color: #fff;
            text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-tl-clip-duration {
            font-size: 9px;
            color: rgba(255, 255, 255, .85);
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
        }

        .cv-tl-clip-handle {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 6px;
            background: rgba(99, 102, 241, .6);
            cursor: ew-resize;
            opacity: 0;
            transition: opacity .15s;
        }

        .cv-tl-clip:hover .cv-tl-clip-handle {
            opacity: 1;
        }

        .cv-tl-clip-handle.left {
            left: 0;
        }

        .cv-tl-clip-handle.right {
            right: 0;
        }

        .cv-tl-clip.audio {
            background: #064e3b;
        }

        .cv-tl-clip.audio .cv-tl-clip-bg {
            background: linear-gradient(90deg, #059669, #10b981, #059669);
            opacity: .55;
        }

        .cv-tl-clip.image .cv-tl-clip-bg {
            opacity: 1;
        }

        .cv-tl-playhead {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #fff;
            z-index: 20;
            pointer-events: none;
            box-shadow: 0 0 8px rgba(255, 255, 255, .7);
        }

        .cv-tl-playhead::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -5px;
            width: 12px;
            height: 10px;
            background: #fff;
            border-radius: 2px;
            clip-path: polygon(0 0, 100% 0, 50% 100%);
        }

        .cv-tl-add-clip-btn {
            position: absolute;
            top: 4px;
            height: 48px;
            width: 48px;
            border: 1px dashed #3f3f46;
            background: transparent;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #71717a;
            font-size: 18px;
            cursor: pointer;
            transition: all .15s;
        }

        .cv-tl-add-clip-btn:hover {
            border-color: #6366f1;
            color: #a5b4fc;
            background: rgba(99, 102, 241, .08);
        }

        .cv-tl-editor-empty {
            text-align: center;
            padding: 60px 20px;
            color: #52525b;
            font-size: 13px;
            line-height: 1.8;
        }

        .cv-tl-editor-empty i {
            font-size: 40px;
            display: block;
            margin-bottom: 14px;
            opacity: .5;
        }

        /* ==========================================================================
   16. 图片编辑器
   ========================================================================== */
        .cv-img-editor {
            position: fixed;
            inset: 0;
            z-index: 160000;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .88);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .cv-img-editor.show {
            display: flex;
        }

        .civie-dialog {
            position: relative;
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            max-width: 95vw;
            max-height: 95vh;
            width: 960px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
        }

        .civie-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 52px;
            padding: 0 18px;
            background: #18181c;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .civie-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .civie-title i {
            color: #8b5cf6;
        }

        .civie-header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .civie-body {
            display: flex;
            flex-direction: column;
            padding: 12px;
            gap: 10px;
            min-height: 0;
            flex: 1;
            overflow: hidden;
        }

        .civie-toolbar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            flex-shrink: 0;
            flex-wrap: wrap;
        }

        .civie-tool {
            width: 34px;
            height: 34px;
            border: none;
            background: transparent;
            color: #a1a1aa;
            border-radius: 7px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all .15s;
        }

        .civie-tool:hover {
            background: #2a2a32;
            color: #fff;
        }

        .civie-tool.active {
            background: #6366f1;
            color: #fff;
        }

        .civie-tool-label {
            font-size: 11px;
            color: #71717a;
            margin-left: 4px;
        }

        .civie-tool-sep {
            width: 1px;
            height: 22px;
            background: #2a2a32;
            margin: 0 4px;
        }

        #civieColor {
            width: 34px;
            height: 34px;
            border: 1px solid #3a3a44;
            border-radius: 7px;
            cursor: pointer;
            background: transparent;
            padding: 3px;
        }

        #civieSize {
            width: 90px;
            accent-color: #6366f1;
        }

        .civie-canvas-wrap {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: auto;
            background: #0a0a0d;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            padding: 16px;
            min-height: 260px;
            position: relative;
        }

        #civieCanvas {
            max-width: 100%;
            max-height: 100%;
            display: block;
            box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
            touch-action: none;
            cursor: crosshair;
        }

        #civieCanvas.has-selection {
            cursor: move;
        }

        #civieCanvas.mode-text {
            cursor: text;
        }

        .civie-hint {
            font-size: 11px;
            color: #71717a;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 4px;
            flex-shrink: 0;
        }

        .civie-hint i {
            color: #6366f1;
        }

        .civie-text-modal {
            position: absolute;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .6);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 10;
        }

        .civie-text-modal.show {
            display: flex;
        }

        .civie-text-dialog {
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            padding: 16px;
            width: 440px;
            max-width: 92%;
            display: flex;
            flex-direction: column;
            gap: 12px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
        }

        .civie-text-title {
            font-size: 13px;
            font-weight: 600;
            color: #e4e4e7;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .civie-text-title i {
            color: #8b5cf6;
        }

        .civie-text-dialog textarea {
            width: 100%;
            min-height: 110px;
            background: #121216;
            border: 1px solid #33333c;
            border-radius: 7px;
            padding: 10px 12px;
            color: #e4e4e7;
            font-size: 13px;
            font-family: inherit;
            line-height: 1.5;
            resize: vertical;
            outline: none;
        }

        .civie-text-dialog textarea:focus {
            border-color: #6366f1;
        }

        .civie-text-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .civie-text-btn {
            height: 32px;
            padding: 0 16px;
            border-radius: 7px;
            border: 1px solid #3f3f46;
            background: transparent;
            color: #d4d4d8;
            font-size: 13px;
            cursor: pointer;
            transition: all .15s;
        }

        .civie-text-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .civie-text-btn.primary {
            background: #6366f1;
            border-color: #6366f1;
            color: #fff;
        }

        .civie-text-btn.primary:hover {
            background: #4f46e5;
        }





           /* ==========================================================================
   17. 全屏文本编辑器（即梦风格）
   ========================================================================== */
   .cv-text-editor {
    position: fixed;
    inset: 0;
    z-index: 165000;
    display: none;
    flex-direction: column;
    background: #0a0a0d;
}

.cv-text-editor.show {
    display: flex;
}

/* ---------- 顶部单行：标题 | 工具栏 | 下载+关闭 ---------- */
.cv-text-editor-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    height: 52px;
    padding: 0 20px;
    background: #15151a;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

/* 左：标题 */
.cv-text-editor-title {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #e4e4e7;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
}

.cv-text-editor-title i {
    color: #a1a1aa;
    font-size: 14px;
    flex-shrink: 0;
}

.cv-text-editor-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 中：工具栏 */
.cv-text-editor-toolbar {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    background: #1a1a20;
    border: 1px solid #2a2a32;
    border-radius: 10px;
}

.cv-text-editor-tool {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    transition: all .15s;
    flex-shrink: 0;
}

.cv-text-editor-tool:hover {
    background: #2a2a32;
    color: #fff;
}

.cv-text-editor-tool.active {
    background: #6366f1;
    color: #fff;
}

.cv-text-editor-sep {
    width: 1px;
    height: 16px;
    background: #2a2a32;
    margin: 0 4px;
    flex-shrink: 0;
}

.cv-text-editor-font-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 28px;
    padding: 0 6px;
    color: #a1a1aa;
    font-size: 11.5px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    cursor: default;
    user-select: none;
}

/* 右：操作按钮 */
.cv-text-editor-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-text-editor-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}

.cv-text-editor-btn:hover {
    background: #232329;
    color: #fff;
    border-color: #3a3a44;
}

.cv-text-editor-btn.icon-only {
    width: 32px;
    padding: 0;
    justify-content: center;
}

.cv-text-editor-btn i {
    font-size: 13px;
}

/* ---------- 主体内容区 ---------- */
.cv-text-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 20px 60px;
    display: flex;
    justify-content: center;
}

.cv-text-editor-body::-webkit-scrollbar {
    width: 8px;
}

.cv-text-editor-body::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 4px;
}

.cv-text-editor-body::-webkit-scrollbar-thumb:hover {
    background: #3a3a44;
}

.cv-text-editor-content {
    width: 100%;
    max-width: 820px;
    min-height: 100%;
    background: #121216;
    border-radius: 10px;
    padding: 40px 48px;
    font-size: 15px;
    line-height: 1.85;
    color: #e4e4e7;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .3);
    transition: box-shadow .15s;
    /* ★ 关键：不允许任何超宽元素撑破 */
    overflow-x: hidden;
}

.cv-text-editor-content:focus {
    box-shadow: 0 2px 16px rgba(0, 0, 0, .3), 0 0 0 1px rgba(99, 102, 241, .35);
}

.cv-text-editor-content:empty::before {
    content: attr(data-placeholder);
    color: #52525b;
    pointer-events: none;
}

/* ★ 关键：强制所有子元素继承颜色和背景，避免粘贴内容带出底色 */
.cv-text-editor-content * {
    color: inherit !important;
    background-color: transparent !important;
    font-family: inherit !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ★ 图片/视频/表格：限制最大宽度，自动缩放 */
.cv-text-editor-content img,
.cv-text-editor-content video {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 6px;
    margin: 8px 0;
}

.cv-text-editor-content table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13.5px;
    table-layout: fixed;
}

.cv-text-editor-content table td,
.cv-text-editor-content table th {
    border: 1px solid #2a2a32;
    padding: 6px 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cv-text-editor-content table th {
    background: #1a1a20;
    font-weight: 600;
}

/* ★ 长链接/长单词自动换行 */
.cv-text-editor-content a {
    color: #a5b4fc;
    word-break: break-all;
    text-decoration: underline;
}

/* 富文本元素样式 */
.cv-text-editor-content h1,
.cv-text-editor-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 18px 0 10px;
    color: #fff;
    line-height: 1.4;
}

.cv-text-editor-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 14px 0 8px;
    color: #e4e4e7;
}

.cv-text-editor-content blockquote {
    border-left: 3px solid #6366f1;
    padding-left: 14px;
    margin: 12px 0;
    color: #a1a1aa;
    font-style: italic;
}

.cv-text-editor-content ul,
.cv-text-editor-content ol {
    padding-left: 26px;
    margin: 10px 0;
}

.cv-text-editor-content li {
    margin: 4px 0;
}

.cv-text-editor-content p {
    margin: 8px 0;
}

/* 引用弹出菜单 */
.cv-text-editor-mention-popup {
    position: fixed;
    width: 320px;
    max-height: 340px;
    overflow-y: auto;
    background: #1e1e24;
    border: 1px solid #3a3a44;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .75);
    display: none;
    z-index: 170500;
}

.cv-text-editor-mention-popup.show {
    display: block;
}

.cv-text-editor-mention-popup::-webkit-scrollbar {
    width: 5px;
}

.cv-text-editor-mention-popup::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

#cvTextEditorMentionBtn {
    position: relative;
}

/* ==========================================================================
   ★★★ 文本编辑器 - 加宽 + 即梦风格滚动条（追加在末尾，覆盖旧样式）
   ========================================================================== */

/* 1. 内容卡片加宽 */
.cv-text-editor-content {
    max-width: 1100px !important;
    padding: 48px 64px !important;
    font-size: 15px !important;
    line-height: 1.9 !important;
}

/* 2. 外层滚动容器（.cv-text-editor-body）的滚动条 - 即梦风格 */
.cv-text-editor-body::-webkit-scrollbar {
    width: 8px !important;
}
.cv-text-editor-body::-webkit-scrollbar-track {
    background: transparent !important;
}
.cv-text-editor-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 4px !important;
    border: 2px solid transparent !important;
    background-clip: content-box !important;
}
.cv-text-editor-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    background-clip: content-box !important;
}
/* Firefox 支持 */
.cv-text-editor-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* 3. 内容卡片内部滚动条（万一有）也改成即梦风格 */
.cv-text-editor-content::-webkit-scrollbar {
    width: 6px !important;
}
.cv-text-editor-content::-webkit-scrollbar-track {
    background: transparent !important;
}
.cv-text-editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 3px !important;
}
.cv-text-editor-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* 4. 顶部和底部轻微内边距调整，让卡片视觉更居中和舒适 */
.cv-text-editor-body {
    padding: 40px 40px 80px !important;
}

        /* ==========================================================================
   18. AI 对话悬浮按钮 + 面板
   ========================================================================== */
        .cv-ai-chat-fab {
            position: absolute;
            left: 20px;
            bottom: 16px;
            height: 40px;
            padding: 0 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background: rgba(24, 24, 28, .95);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid #3a3a44;
            border-radius: 20px;
            color: #e4e4e7;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            z-index: 9998;
            transition: all .2s;
            box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
            white-space: nowrap;
            box-sizing: border-box;
        }

        .cv-ai-chat-fab:hover {
            background: #6366f1;
            border-color: #6366f1;
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 12px 40px rgba(99, 102, 241, .4);
        }

        .cv-ai-chat-fab i {
            font-size: 14px;
            color: #8b5cf6;
            transition: color .2s;
        }

        .cv-ai-chat-fab:hover i {
            color: #fff;
        }

        .cv-ai-chat-fab .cv-ai-chat-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            min-width: 18px;
            height: 18px;
            border-radius: 9px;
            background: #ef4444;
            color: #fff;
            font-size: 10px;
            font-weight: 600;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 0 5px;
        }

        .cv-ai-chat-fab .cv-ai-chat-badge.show {
            display: flex;
        }

        .cv-ai-chat-panel {
            position: fixed;
            top: 52px;
            left: 0;
            bottom: 0;
            width: 520px;
            background: #15151a;
            border-right: 1px solid #2a2a32;
            display: none;
            flex-direction: column;
            z-index: 10000;
            box-shadow: 10px 0 40px rgba(0, 0, 0, .5);
            transform: translateX(-100%);
            transition: transform .25s cubic-bezier(.4, 0, .2, 1);
        }

        .cv-ai-chat-panel.show {
            display: flex;
            transform: translateX(0);
        }

        .cv-ai-chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 48px;
            padding: 0 14px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-ai-chat-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14.5px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .cv-ai-chat-title i {
            color: #8b5cf6;
        }

        .cv-ai-chat-actions {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .cv-ai-chat-action {
            width: 28px;
            height: 28px;
            border: none;
            background: transparent;
            color: #71717a;
            cursor: pointer;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
        }

        .cv-ai-chat-action:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-ai-chat-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .cv-ai-chat-body::-webkit-scrollbar {
            width: 6px;
        }

        .cv-ai-chat-body::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-ai-chat-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            padding: 40px 20px;
            color: #52525b;
            text-align: center;
        }

        .cv-ai-chat-empty-icon {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(139, 92, 246, .2));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 26px;
            color: #8b5cf6;
            margin-bottom: 20px;
        }

        .cv-ai-chat-empty h3 {
            font-size: 16px;
            color: #a1a1aa;
            font-weight: 500;
            margin-bottom: 6px;
        }

        .cv-ai-chat-empty p {
            font-size: 12px;
            color: #52525b;
            margin-bottom: 20px;
        }

        .cv-ai-chat-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            max-width: 340px;
        }

        .cv-ai-chat-suggestion {
            padding: 6px 14px;
            background: #1e1e24;
            border: 1px solid #2a2a32;
            border-radius: 16px;
            font-size: 12px;
            color: #a1a1aa;
            cursor: pointer;
            transition: all .15s;
        }

        .cv-ai-chat-suggestion:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #4f46e5;
        }

        .cv-ai-msg {
            display: flex;
            gap: 10px;
            max-width: 100%;
        }

        .cv-ai-msg.user {
            flex-direction: row-reverse;
        }

        .cv-ai-msg-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }

        .cv-ai-msg.user .cv-ai-msg-avatar {
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff;
        }

        .cv-ai-msg.assistant .cv-ai-msg-avatar {
            background: #1e1e24;
            border: 1px solid #3a3a44;
            color: #8b5cf6;
        }

        .cv-ai-msg-content {
            max-width: calc(100% - 50px);
            display: flex;
            flex-direction: column;
        }

        .cv-ai-msg.user .cv-ai-msg-content {
            align-items: flex-end;
        }

        .cv-ai-msg-attachments {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 6px;
        }

        .cv-ai-msg-attachment {
            width: 56px;
            height: 56px;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid #3a3a44;
            background: #121216;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 16px;
        }

        .cv-ai-msg-attachment img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-ai-msg-bubble {
            padding: 11px 15px;
            border-radius: 10px;
            font-size: 14px;
            line-height: 1.7;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .cv-ai-msg.user .cv-ai-msg-bubble {
            background: #6366f1;
            color: #fff;
            border-top-right-radius: 3px;
        }

        .cv-ai-msg.assistant .cv-ai-msg-bubble {
            background: #1e1e24;
            color: #d4d4d8;
            border-top-left-radius: 3px;
        }

        .cv-ai-msg-actions {
            display: flex;
            gap: 6px;
            margin-top: 6px;
            justify-content: flex-end;
        }

        .cv-ai-msg-action {
            padding: 3px 10px;
            border-radius: 6px;
            background: rgba(99, 102, 241, .15);
            color: #a5b4fc;
            font-size: 11px;
            border: none;
            cursor: pointer;
            transition: all .15s;
        }

        .cv-ai-msg-action:hover {
            background: rgba(99, 102, 241, .3);
            color: #c7d2fe;
        }

        .cv-ai-msg-typing {
            display: flex;
            gap: 3px;
            padding: 4px 0;
        }

        .cv-ai-msg-typing span {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #6366f1;
            animation: cvAiTyping 1.2s ease-in-out infinite;
        }

        .cv-ai-msg-typing span:nth-child(2) {
            animation-delay: .2s;
        }

        .cv-ai-msg-typing span:nth-child(3) {
            animation-delay: .4s;
        }

        @keyframes cvAiTyping {

            0%,
            60%,
            100% {
                transform: translateY(0);
                opacity: .5;
            }

            30% {
                transform: translateY(-4px);
                opacity: 1;
            }
        }

        .cv-ai-chat-input-area {
            flex-shrink: 0;
            padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px)) 12px;
            border-top: 1px solid #2a2a32;
            background: #18181c;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .cv-ai-prompt-row {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 8px;
        }

        .cv-ai-prompt-row .cv-ai-prompt-select {
            flex: 1;
            min-width: 0;
            height: 38px;
            padding: 0 34px 0 12px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 9px;
            color: #e4e4e7;
            font-size: 13.5px;
            cursor: pointer;
            outline: none;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
            background-repeat: no-repeat;
            background-position: right 12px center;
            transition: border-color .15s, color .15s;
        }

        .cv-ai-prompt-row .cv-ai-prompt-select:hover {
            border-color: #3a3a44;
            color: #e4e4e7;
        }

        .cv-ai-prompt-row .cv-ai-prompt-select:focus {
            border-color: #6366f1;
        }

        .cv-ai-prompt-manage-btn {
            flex-shrink: 0;
            width: 38px;
            height: 38px;
            border: 1px solid #2a2a32;
            border-radius: 9px;
            background: #121216;
            color: #a1a1aa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all .15s;
        }

        .cv-ai-prompt-manage-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #52525b;
        }

        .cv-ai-attachments {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .cv-ai-attachments:empty {
            display: none;
        }

        .cv-ai-attachment {
            position: relative;
            width: 52px;
            height: 52px;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid #3a3a44;
            background: #121216;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 16px;
        }

        .cv-ai-attachment img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-ai-attachment-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: rgba(0, 0, 0, .75);
            color: #fff;
            border: none;
            cursor: pointer;
            font-size: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cv-ai-input-wrapper {
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 10px;
            padding: 8px 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: border-color .15s;
            position: relative;
        }

        .cv-ai-input-wrapper:focus-within {
            border-color: #6366f1;
        }

        .cv-ai-input {
            width: 100%;
            min-height: 88px;
            max-height: 320px;
            background: transparent;
            border: none;
            outline: none;
            resize: none;
            color: #e4e4e7;
            font-size: 14px;
            font-family: inherit;
            line-height: 1.65;
            padding-right: 76px;
            padding-bottom: 4px;
        }

        .cv-ai-input::-webkit-scrollbar {
            width: 6px;
        }

        .cv-ai-input::-webkit-scrollbar-track {
            background: transparent;
            margin-top: 40px;
            margin-bottom: 4px;
        }

        .cv-ai-input::-webkit-scrollbar-thumb {
            background: #33333c;
            border-radius: 3px;
            border: 1px solid transparent;
            background-clip: content-box;
        }

        .cv-ai-input::-webkit-scrollbar-thumb:hover {
            background: #52525b;
            background-clip: content-box;
        }

        .cv-ai-input {
            scrollbar-width: thin;
            scrollbar-color: #33333c transparent;
        }

        .cv-ai-input::placeholder {
            color: #52525b;
        }

        .cv-ai-input-actions {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 4px;
            z-index: 5;
            background: #121216;
            border-radius: 7px;
            padding: 2px;
        }

        .cv-ai-input-action-btn {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            background: transparent;
            border: none;
            color: #a1a1aa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: all .15s;
        }

        .cv-ai-input-action-btn:hover {
            background: rgba(99, 102, 241, .22);
            color: #a5b4fc;
        }

        .cv-ai-input-action-btn.danger:hover {
            background: rgba(239, 68, 68, .22);
            color: #fca5a5;
        }

        .cv-ai-input-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .cv-ai-input-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            height: 34px;
            padding: 0 12px;
            background: transparent;
            border: none;
            border-radius: 7px;
            color: #a1a1aa;
            font-size: 13.5px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
        }

        .cv-ai-input-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-ai-input-btn i {
            font-size: 14px;
        }

        .cv-ai-input-spacer {
            flex: 1;
        }

        .cv-ai-send-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: #6366f1;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all .15s;
        }

        .cv-ai-send-btn:hover {
            background: #4f46e5;
        }

        .cv-ai-send-btn:disabled {
            opacity: .4;
            cursor: not-allowed;
        }

        .cv-ai-model-select {
            height: 34px;
            padding: 0 28px 0 12px;
            background: #1e1e24;
            border: 1px solid #2a2a32;
            border-radius: 7px;
            color: #d4d4d8;
            font-size: 13px;
            cursor: pointer;
            outline: none;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
            background-repeat: no-repeat;
            background-position: right 9px center;
            max-width: 200px;
            transition: all .15s;
        }

        .cv-ai-model-select:hover {
            border-color: #52525b;
            color: #e4e4e7;
        }

        .cv-ai-popup {
            position: absolute;
            bottom: 100%;
            left: 0;
            margin-bottom: 8px;
            width: 300px;
            max-height: 300px;
            overflow-y: auto;
            background: #1e1e24;
            border: 1px solid #3a3a44;
            border-radius: 10px;
            padding: 6px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, .7);
            display: none;
            z-index: 20;
        }

        .cv-ai-popup.show {
            display: block;
        }

        .cv-ai-popup::-webkit-scrollbar {
            width: 5px;
        }

        .cv-ai-popup::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-ai-popup-title {
            font-size: 11px;
            color: #71717a;
            padding: 6px 10px 4px;
        }

        .cv-ai-preset-item {
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-ai-preset-item:hover {
            background: #2a2a32;
        }

        .cv-ai-preset-item-name {
            font-weight: 500;
            font-size: 12px;
            color: #e4e4e7;
            margin-bottom: 3px;
        }

        .cv-ai-preset-item-preview {
            font-size: 10.5px;
            color: #71717a;
            -webkit-box-orient: vertical;
            overflow: hidden;
            line-height: 1.4;
        }

        .cv-ai-ref-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-ai-ref-item:hover {
            background: #2a2a32;
        }

        .cv-ai-ref-thumb {
            width: 36px;
            height: 36px;
            border-radius: 5px;
            overflow: hidden;
            background: #121216;
            border: 1px solid #2a2a32;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 13px;
            flex-shrink: 0;
        }

        .cv-ai-ref-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-ai-ref-info {
            flex: 1;
            min-width: 0;
        }

        .cv-ai-ref-name {
            font-size: 12px;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .cv-ai-ref-type {
            font-size: 10px;
            color: #71717a;
            margin-top: 1px;
        }

        .cv-ai-ref-empty {
            padding: 16px;
            text-align: center;
            font-size: 11.5px;
            color: #52525b;
        }

        /* 提示词输入区（图片/视频节点） */
        .cv-prompt-wrap {
            position: relative;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 10px;
            padding: 10px 12px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: border-color .15s;
        }

        .cv-prompt-wrap:focus-within {
            border-color: #6366f1;
        }

        .cv-prompt-wrap .cv-prompt-textarea {
            width: 100%;
            min-height: 88px;
            max-height: 320px;
            background: transparent !important;
            border: none !important;
            outline: none;
            resize: none;
            color: #e4e4e7;
            font-size: 14px;
            font-family: inherit;
            line-height: 1.65;
            padding: 0 76px 0 0 !important;
            margin: 0;
            box-shadow: none !important;
        }

        .cv-prompt-wrap .cv-prompt-textarea:focus {
            border: none !important;
            box-shadow: none !important;
        }

        .cv-prompt-wrap .cv-prompt-textarea::placeholder {
            color: #52525b;
        }

        .cv-prompt-wrap .cv-prompt-textarea::-webkit-scrollbar {
            width: 6px;
        }

        .cv-prompt-wrap .cv-prompt-textarea::-webkit-scrollbar-track {
            background: transparent;
            margin-top: 40px;
            margin-bottom: 4px;
        }

        .cv-prompt-wrap .cv-prompt-textarea::-webkit-scrollbar-thumb {
            background: #33333c;
            border-radius: 3px;
            border: 1px solid transparent;
            background-clip: content-box;
        }

        .cv-prompt-wrap .cv-prompt-textarea::-webkit-scrollbar-thumb:hover {
            background: #52525b;
            background-clip: content-box;
        }

        .cv-prompt-wrap .cv-prompt-textarea {
            scrollbar-width: thin;
            scrollbar-color: #33333c transparent;
        }

        .cv-prompt-actions {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 4px;
            z-index: 5;
            background: #121216;
            border-radius: 7px;
            padding: 2px;
        }

        .cv-prompt-action-btn {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            background: transparent;
            border: none;
            color: #a1a1aa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: all .15s;
        }

        .cv-prompt-action-btn:hover {
            background: rgba(99, 102, 241, .22);
            color: #a5b4fc;
        }

        .cv-prompt-action-btn.danger:hover {
            background: rgba(239, 68, 68, .22);
            color: #fca5a5;
        }

        /* ==========================================================================
   19. 画布工具栏（右下角）
   ========================================================================== */
        .cv-canvas-toolbar {
            position: absolute;
            right: 16px;
            bottom: 16px;
            height: 40px;
            padding: 4px;
            display: flex;
            align-items: center;
            gap: 2px;
            background: rgba(24, 24, 28, .92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid #2a2a32;
            border-radius: 12px;
            z-index: 20;
            box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
        }

        .cv-tb-btn {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: #a1a1aa;
            cursor: pointer;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: all .15s;
        }

        .cv-tb-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tb-btn.active {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tb-btn.active.hand {
            background: rgba(99, 102, 241, .2);
            color: #a5b4fc;
        }

        .cv-tb-sep {
            width: 1px;
            height: 20px;
            background: #2a2a32;
            margin: 0 6px;
        }

        .cv-tb-zoom-btn {
            min-width: 60px;
            height: 32px;
            padding: 0 10px;
            border: none;
            background: transparent;
            color: #a1a1aa;
            cursor: pointer;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12.5px;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            transition: all .15s;
        }

        .cv-tb-zoom-btn:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tb-zoom-btn.open {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tb-zoom-menu {
            position: absolute;
            bottom: calc(100% + 10px);
            right: 0;
            min-width: 230px;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            padding: 6px;
            box-shadow: 0 12px 44px rgba(0, 0, 0, .85);
            display: none;
            z-index: 30;
        }

        .cv-tb-zoom-menu.show {
            display: block;
            animation: ctxIn .12s ease;
        }

        .cv-tb-zoom-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 9px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: background .1s;
            white-space: nowrap;
        }

        .cv-tb-zoom-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-tb-zoom-item.disabled {
            opacity: .35;
            pointer-events: none;
        }

        .cv-tb-zoom-item .shortcut {
            font-size: 11px;
            color: #71717a;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
        }

        .cv-tb-zoom-sep {
            height: 1px;
            background: #2a2a32;
            margin: 4px 0;
        }

        /* 小地图 */
        .cv-minimap {
            position: absolute;
            right: 16px;
            bottom: 68px;
            width: 230px;
            height: 155px;
            background: rgba(24, 24, 28, .92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid #2a2a32;
            border-radius: 10px;
            overflow: hidden;
            display: none;
            z-index: 19;
            box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
            cursor: pointer;
            user-select: none;
        }

        .cv-minimap.show {
            display: block;
        }

        .cv-minimap-canvas {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: block;
        }

        .cv-minimap-viewport {
            position: absolute;
            border: 1.5px solid #6366f1;
            background: rgba(99, 102, 241, .1);
            border-radius: 2px;
            pointer-events: none;
            z-index: 2;
            box-shadow: 0 0 8px rgba(99, 102, 241, .5);
        }

        /* ==========================================================================
   20. 顶部工具栏（搜索/历史/更多/用户）
   ========================================================================== */
        .cv-top-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .cv-top-icon-btn {
            width: 36px;
            height: 36px;
            border: 1px solid transparent;
            background: transparent;
            border-radius: 10px;
            color: #a1a1aa;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all .15s;
            position: relative;
            flex-shrink: 0;
        }

        .cv-top-icon-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #3a3a44;
        }

        .cv-top-icon-btn.active {
            background: #2a2a32;
            color: #fff;
            border-color: #6366f1;
        }

        .cv-top-pill-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 36px;
            padding: 0 14px;
            background: transparent;
            border: 1px solid transparent;
            border-radius: 10px;
            color: #a1a1aa;
            font-size: 13px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .cv-top-pill-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #3a3a44;
        }

        .cv-top-pill-btn i {
            font-size: 13.5px;
        }

        .cv-top-divider {
            width: 1px;
            height: 22px;
            background: #2a2a32;
            margin: 0 4px;
            flex-shrink: 0;
        }

        .cv-top-user {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            height: 36px;
            padding: 0 10px 0 12px;
            background: rgba(99, 102, 241, .12);
            border: 1px solid rgba(99, 102, 241, .35);
            border-radius: 10px;
            color: #c7d2fe;
            font-size: 13px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .cv-top-user:hover {
            background: rgba(99, 102, 241, .22);
            border-color: rgba(99, 102, 241, .6);
            color: #fff;
        }

        .cv-top-user .gem-icon {
            color: #a5b4fc;
            font-size: 12px;
        }

        .cv-top-user .user-tier {
            color: #a1a1aa;
            font-size: 12px;
        }

        .cv-top-user-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: #fff;
            font-weight: 600;
            overflow: hidden;
            flex-shrink: 0;
        }

        /* 搜索面板 */
        .cv-search-panel {
            position: fixed;
            top: 60px;
            right: 16px;
            width: 400px;
            max-height: calc(100vh - 80px);
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .75);
            z-index: 210000;
            display: none;
            flex-direction: column;
            overflow: hidden;
            animation: cvPanelIn .15s ease;
        }

        .cv-search-panel.show {
            display: flex;
        }

        @keyframes cvPanelIn {
            from {
                opacity: 0;
                transform: translateY(-6px);
            }
        }

        .cv-search-header {
            padding: 12px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-search-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
        }

        .cv-search-input-wrap>i {
            position: absolute;
            left: 12px;
            color: #71717a;
            font-size: 13px;
            pointer-events: none;
        }

        .cv-search-input {
            width: 100%;
            height: 38px;
            padding: 0 12px 0 36px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 8px;
            color: #e4e4e7;
            font-size: 13px;
            outline: none;
            font-family: inherit;
            transition: border-color .15s;
        }

        .cv-search-input:focus {
            border-color: #6366f1;
        }

        .cv-search-input::placeholder {
            color: #52525b;
        }

        .cv-search-tabs {
            /* 原有代码保持不变 */
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 10px 12px 12px;
            border-bottom: 1px solid #2a2a32;
            overflow-x: auto;
            flex-shrink: 0;
            scrollbar-width: none;
            scroll-behavior: smooth;
            /* 新增：平滑滚动 */
        }

        .cv-search-tabs::-webkit-scrollbar {
            display: none;
        }

        /* 新增：标签栏滚动按钮 */
        .cv-search-tabs-scroll-btn {
            position: absolute;
            right: 10px;
            width: 26px;
            height: 26px;
            background: #2a2a32;
            border: 1px solid #3a3a44;
            border-radius: 50%;
            color: #a1a1aa;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            cursor: pointer;
            z-index: 10;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
            transition: all .15s;
            pointer-events: auto;
        }

        .cv-search-tabs-scroll-btn:hover {
            background: #6366f1;
            color: #fff;
            border-color: #6366f1;
        }

        .cv-search-tabs-scroll-btn.show {
            display: flex;
        }

        /* 新增：悬浮预览框 */
        /* ==========================================================================
修改：搜索悬浮预览框（去掉类型标识，文本用节点名+内容布局）
========================================================================== */
        .cv-search-preview {
            position: fixed;
            z-index: 210005;
            width: 260px;
            max-height: 360px;
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 10px;
            box-shadow: 0 12px 44px rgba(0, 0, 0, .85);
            overflow: hidden;
            display: none;
            pointer-events: none;
            padding: 10px;
            /* 改为统一 padding，不再为标识留空间 */
            box-sizing: border-box;
        }

        .cv-search-preview.show {
            display: block;
        }

        .cv-search-preview img,
        .cv-search-preview video {
            width: 100%;
            max-height: 320px;
            object-fit: contain;
            border-radius: 6px;
            background: #0d0d10;
            display: block;
        }

        /* 文本预览：上方节点名 + 下方内容 */
        .cv-search-preview .preview-text-wrap {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 340px;
        }

        .cv-search-preview .preview-text-name {
            font-size: 13px;
            font-weight: 600;
            color: #e4e4e7;
            line-height: 1.4;
            padding-bottom: 8px;
            border-bottom: 1px solid #2a2a32;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .cv-search-preview .preview-text {
            font-size: 12.5px;
            color: #d4d4d8;
            line-height: 1.65;
            overflow-y: auto;
            white-space: pre-wrap;
            word-break: break-word;
            flex: 1;
            min-height: 0;
            max-height: 280px;
        }

        .cv-search-preview .preview-text::-webkit-scrollbar {
            width: 4px;
        }

        .cv-search-preview .preview-text::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 2px;
        }

        /* 音频预览 */
        .cv-search-preview .preview-audio-wrap {
            padding: 24px 8px 12px;
            text-align: center;
        }

        .cv-search-preview .preview-audio-wrap .audio-icon {
            font-size: 42px;
            color: #10b981;
            display: block;
            margin-bottom: 16px;
            opacity: .85;
        }

        .cv-search-preview .preview-audio-wrap audio {
            width: 100%;
            height: 34px;
        }

        /* 无内容占位 */
        .cv-search-preview .preview-empty {
            padding: 30px 12px;
            text-align: center;
            color: #52525b;
            font-size: 12px;
            line-height: 1.7;
        }

        .cv-search-preview .preview-empty i {
            display: block;
            font-size: 26px;
            margin-bottom: 8px;
            opacity: .5;
        }

        .cv-search-tab {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 5px 10px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #71717a;
            font-size: 12.5px;
            cursor: pointer;
            white-space: nowrap;
            transition: all .15s;
            position: relative;
        }

        .cv-search-tab:hover {
            color: #a1a1aa;
            background: #232329;
        }

        .cv-search-tab.active {
            color: #fff;
            font-weight: 500;
        }

        .cv-search-tab.active::after {
            content: '';
            position: absolute;
            bottom: -13px;
            left: 20%;
            right: 20%;
            height: 2px;
            background: #6366f1;
            border-radius: 1px;
        }

        .cv-search-tab .count {
            font-size: 11px;
            color: #52525b;
            margin-left: 2px;
        }

        .cv-search-tab.active .count {
            color: #a5b4fc;
        }

        .cv-search-list {
            flex: 1;
            overflow-y: auto;
            padding: 6px;
            min-height: 120px;
            max-height: 520px;
        }

        .cv-search-list::-webkit-scrollbar {
            width: 6px;
        }

        .cv-search-list::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-search-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-search-item:hover {
            background: #232329;
        }

        .cv-search-item.active {
            background: rgba(99, 102, 241, .15);
        }

        .cv-search-thumb {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            flex-shrink: 0;
            background: #121216;
            border: 1px solid #2a2a32;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 16px;
            position: relative;
        }

        .cv-search-thumb img,
        .cv-search-thumb video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-search-thumb .thumb-index {
            position: absolute;
            top: 2px;
            left: 2px;
            background: rgba(0, 0, 0, .75);
            color: #fff;
            font-size: 9px;
            padding: 1px 4px;
            border-radius: 3px;
            font-family: 'SF Mono', Monaco, monospace;
        }

        .cv-search-thumb .thumb-duration {
            position: absolute;
            bottom: 2px;
            left: 2px;
            right: 2px;
            background: rgba(0, 0, 0, .75);
            color: #fff;
            font-size: 9px;
            padding: 1px 4px;
            border-radius: 3px;
            text-align: center;
            font-family: 'SF Mono', Monaco, monospace;
        }

        .cv-search-info {
            flex: 1;
            min-width: 0;
        }

        .cv-search-name {
            font-size: 13px;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-bottom: 4px;
        }

        .cv-search-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: #71717a;
        }

        .cv-search-meta .type-badge {
            padding: 1px 6px;
            background: #232329;
            border-radius: 4px;
            font-size: 10.5px;
        }

        .cv-search-locate {
            width: 26px;
            height: 26px;
            border: none;
            background: transparent;
            border-radius: 6px;
            color: #71717a;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            flex-shrink: 0;
            transition: all .15s;
        }

        .cv-search-locate:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-search-empty {
            padding: 40px 20px;
            text-align: center;
            color: #52525b;
            font-size: 13px;
            line-height: 1.8;
        }

        .cv-search-empty i {
            font-size: 28px;
            display: block;
            margin-bottom: 10px;
            opacity: .4;
        }




        /* 历史面板 */
        .cv-history-panel {
            position: fixed;
            top: 60px;
            right: 16px;
            width: 380px;
            max-height: calc(100vh - 80px);
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .75);
            z-index: 210000;
            display: none;
            flex-direction: column;
            overflow: hidden;
            animation: cvPanelIn .15s ease;
        }

        .cv-history-panel.show {
            display: flex;
        }

        .cv-history-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-history-title {
            font-size: 14px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .cv-history-credits {
            font-size: 12px;
            color: #a5b4fc;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .cv-history-credits:hover {
            color: #c7d2fe;
        }

        .cv-history-tabs {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 12px 12px;
            border-bottom: 1px solid #2a2a32;
            overflow-x: auto;
            flex-shrink: 0;
            scrollbar-width: none;
        }

        .cv-history-tabs::-webkit-scrollbar {
            display: none;
        }

        .cv-history-tab {
            padding: 5px 10px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #71717a;
            font-size: 12.5px;
            cursor: pointer;
            white-space: nowrap;
            transition: all .15s;
            position: relative;
        }

        .cv-history-tab:hover {
            color: #a1a1aa;
            background: #232329;
        }

        .cv-history-tab.active {
            color: #fff;
            font-weight: 500;
        }

        .cv-history-tab.active::after {
            content: '';
            position: absolute;
            bottom: -9px;
            left: 20%;
            right: 20%;
            height: 2px;
            background: #6366f1;
            border-radius: 1px;
        }

        .cv-history-list {
            flex: 1;
            overflow-y: auto;
            padding: 6px;
            min-height: 160px;
            max-height: 500px;
        }

        .cv-history-list::-webkit-scrollbar {
            width: 6px;
        }

        .cv-history-list::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-history-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-history-item:hover {
            background: #232329;
        }

        .cv-history-thumb {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            flex-shrink: 0;
            background: #121216;
            border: 1px solid #2a2a32;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 16px;
        }

        .cv-history-thumb img,
        .cv-history-thumb video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .cv-history-info {
            flex: 1;
            min-width: 0;
        }

        .cv-history-name {
            font-size: 13px;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-bottom: 3px;
        }

        .cv-history-time {
            font-size: 11px;
            color: #71717a;
        }

        .cv-history-empty {
            padding: 60px 20px;
            text-align: center;
            color: #52525b;
            font-size: 13px;
        }

        /* 更多菜单 */
        .cv-more-menu {
            position: fixed;
            top: 60px;
            right: 16px;
            min-width: 180px;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            padding: 6px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
            z-index: 210000;
            display: none;
            animation: cvPanelIn .12s ease;
        }

        .cv-more-menu.show {
            display: block;
        }

        .cv-more-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: background .1s;
        }

        .cv-more-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-more-item i {
            width: 16px;
            text-align: center;
            font-size: 13px;
            color: #a1a1aa;
        }

        .cv-more-item:hover i {
            color: #fff;
        }

        /* 项目信息弹窗 */
        .cv-projinfo-modal {
            position: fixed;
            inset: 0;
            z-index: 220000;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .8);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .cv-projinfo-modal.show {
            display: flex;
        }

        .cv-projinfo-dialog {
            width: 780px;
            max-width: 94vw;
            max-height: 88vh;
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 14px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 24px 80px rgba(0, 0, 0, .85);
        }

        .cv-projinfo-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px 0 24px;
            flex-shrink: 0;
        }

        .cv-projinfo-title {
            font-size: 17px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .cv-projinfo-close {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            border-radius: 8px;
            color: #71717a;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all .15s;
        }

        .cv-projinfo-close:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-projinfo-tabs {
            display: flex;
            align-items: center;
            gap: 24px;
            padding: 16px 24px 0;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .cv-projinfo-tab {
            padding: 0 0 12px;
            background: transparent;
            border: none;
            color: #71717a;
            font-size: 13.5px;
            cursor: pointer;
            position: relative;
            transition: color .15s;
        }

        .cv-projinfo-tab:hover {
            color: #a1a1aa;
        }

        .cv-projinfo-tab.active {
            color: #e4e4e7;
            font-weight: 500;
        }

        .cv-projinfo-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 2px;
            background: #6366f1;
            border-radius: 1px;
        }

        .cv-projinfo-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        .cv-projinfo-body::-webkit-scrollbar {
            width: 6px;
        }

        .cv-projinfo-body::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .cv-projinfo-section {
            margin-bottom: 28px;
        }

        .cv-projinfo-section-title {
            font-size: 12px;
            color: #71717a;
            margin-bottom: 14px;
            letter-spacing: .3px;
        }

        .cv-projinfo-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .cv-projinfo-field-label {
            font-size: 12px;
            color: #71717a;
            margin-bottom: 8px;
        }

        .cv-projinfo-field-value {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13.5px;
            color: #e4e4e7;
        }

        .cv-projinfo-user-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: #fff;
            font-weight: 600;
            flex-shrink: 0;
        }

        .cv-projinfo-nodes-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .cv-projinfo-node-card {
            padding: 14px 16px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 10px;
            transition: all .15s;
        }

        .cv-projinfo-node-card:hover {
            border-color: #3a3a44;
            background: #181820;
        }

        .cv-projinfo-node-card.active {
            background: rgba(99, 102, 241, .1);
            border-color: rgba(99, 102, 241, .45);
        }

        .cv-projinfo-node-label {
            font-size: 12px;
            color: #a1a1aa;
            margin-bottom: 8px;
        }

        .cv-projinfo-node-card.active .cv-projinfo-node-label {
            color: #c7d2fe;
        }

        .cv-projinfo-node-count {
            font-size: 24px;
            font-weight: 600;
            color: #e4e4e7;
            font-family: 'SF Mono', Monaco, monospace;
        }

        .cv-projinfo-node-card.active .cv-projinfo-node-count {
            color: #a5b4fc;
        }

        .cv-projinfo-footer {
            display: flex;
            justify-content: flex-end;
            padding: 0 24px 20px;
            flex-shrink: 0;
        }

        .cv-projinfo-credits-link {
            font-size: 12.5px;
            color: #a5b4fc;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .cv-projinfo-credits-link:hover {
            color: #c7d2fe;
        }

        .cv-projinfo-empty {
            padding: 40px 20px;
            text-align: center;
            color: #52525b;
            font-size: 13px;
        }

/* ==========================================================================
   21. 首页（HomePage）
   ========================================================================== */
   #homePage {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    color: #e4e4e7;
    overflow: hidden;
}

#homePage.hidden { display: none; }

/* ★ 顶栏：完全悬浮，不占布局，只保留右侧用户信息 */
.hm-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: transparent;
    pointer-events: none;
}
.hm-topbar > * { pointer-events: auto; }

.hm-topbar-left,
.hm-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hm-topbar-left .hm-icon-btn {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 右侧用户信息栏整体加毛玻璃 */
.hm-topbar-right > #hmNormalTopbar {
    padding: 4px 4px 4px 6px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}



.hm-icon-btn {
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hm-icon-btn:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #2a2a2a;
}

.hm-icon-btn.icon-only {
    width: 36px;
    padding: 0;
    justify-content: center;
}

.hm-icon-btn i {
    font-size: 14px;
}

.hm-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px 0 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 18px;
    color: #e4e4e7;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hm-user-pill:hover {
    background: #232323;
    border-color: #3a3a3a;
}

.hm-user-pill .hm-user-tier {
    color: #a1a1aa;
    font-size: 12px;
}

.hm-user-pill .hm-user-discount {
    padding: 1px 6px;
    background: rgba(99, 102, 241, .15);
    color: #a5b4fc;
    font-size: 10.5px;
    border-radius: 8px;
}

.hm-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

/* ★ 侧边栏从 0 开始，无需 padding-top 避让悬浮顶栏 */
.hm-body {
    flex: 1;
    min-height: 0;
    display: flex;
}




/* ==========================================================================
   侧边栏
   ========================================================================== */
   .hm-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0a0a0a;
    border-right: 1px solid #181818;
    display: flex;
    flex-direction: column;
    padding: 12px 8px 8px;
    overflow-y: auto;
    overflow-x: visible;
    transition: width .22s ease, padding .22s ease;
    position: relative;
}

.hm-sidebar::-webkit-scrollbar { width: 5px; }
.hm-sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* ---------- 侧边栏顶部 ---------- */
.hm-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 4px 14px;
    flex-shrink: 0;
    min-height: 40px;
}

.hm-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.hm-sidebar-logo i {
    font-size: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.hm-sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #71717a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all .15s;
    flex-shrink: 0;
}

.hm-sidebar-toggle-btn:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ---------- 主导航 ---------- */
.hm-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    flex-shrink: 0;
    align-items: stretch;
}

.hm-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.hm-nav-item:hover {
    background: #181818;
    color: #fff;
}

.hm-nav-item.active {
    background: #1f1f1f;
    color: #fff;
    font-weight: 500;
}

.hm-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: #8b5cf6;
    border-radius: 0 2px 2px 0;
}

.hm-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* ---------- 分组 ---------- */
.hm-group {
    margin-bottom: 6px;
    flex-shrink: 0;
}

.hm-group-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 6px 6px 4px;
    color: #52525b;
    font-size: 11.5px;
    user-select: none;
    min-height: 30px;
}

.hm-group-toggle-btn {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #52525b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-radius: 4px;
    transition: all .15s;
    flex-shrink: 0;
    padding: 0;
}

.hm-group-toggle-btn:hover {
    background: #181818;
    color: #a1a1aa;
}

.hm-group-toggle-btn i {
    transition: transform .2s;
    display: block;
}

.hm-group.collapsed .hm-group-toggle-btn i {
    transform: rotate(-90deg);
}

.hm-group-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 2px;
}

.hm-group-extra {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hm-group-link {
    background: transparent;
    border: none;
    color: #52525b;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all .15s;
    white-space: nowrap;
}

.hm-group-link:hover {
    background: #181818;
    color: #a1a1aa;
}

.hm-group-action-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: #52525b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all .15s;
    flex-shrink: 0;
    padding: 0;
}

.hm-group-action-btn:hover {
    background: #181818;
    color: #fff;
}

/* ---------- 列表 ---------- */
.hm-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    transition: max-height .25s ease;
}

.hm-group.collapsed .hm-list {
    max-height: 0 !important;
    overflow: hidden;
}

/* ---------- 列表项 ---------- */
.hm-list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 5px 8px 5px 10px;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    overflow: hidden;
    box-sizing: border-box;
}

.hm-list-item:hover {
    background: #181818;
    color: #e4e4e7;
}

.hm-list-item.active {
    background: #1f1f1f;
    color: #fff;
}

/* 缩略图 */
.hm-list-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: #1a1a20;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    font-size: 13px;
    overflow: hidden;
    border: 1px solid #232323;
}

.hm-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
}

.hm-list-thumb.chat-thumb {
    background: #1a1a20;
    color: #a1a1aa;
}

.hm-list-thumb.canvas-thumb {
    background: #1a1a20;
    color: #a1a1aa;
}

/* 名称 */
.hm-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 操作按钮 */
.hm-list-actions {
    display: none;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.hm-list-item:hover .hm-list-actions {
    display: flex;
}

.hm-list-action-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: #71717a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all .15s;
    padding: 0;
}

.hm-list-action-btn:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-list-action-btn.danger:hover {
    background: #7f1d1d;
    color: #fecaca;
}

/* 空状态 */
.hm-list-empty {
    padding: 12px 14px;
    color: #3f3f46;
    font-size: 11.5px;
    text-align: left;
}












/* ==========================================================================
   侧边栏折叠状态
   ========================================================================== */
   .hm-sidebar.collapsed {
    width: 56px;
    padding: 12px 0 8px; /* ★ 左右 padding 归零，改用内部居中 */
    display: flex;
    flex-direction: column;
    align-items: center; /* ★ 所有直接子元素水平居中 */
}

/* header：LOGO 居中 */
.hm-sidebar.collapsed .hm-sidebar-header {
    justify-content: center;
    align-items: center;
    padding: 4px 0 14px;
    width: 100%;
}

.hm-sidebar.collapsed .hm-sidebar-logo {
    flex: none;
    padding: 6px;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}

.hm-sidebar.collapsed .hm-sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hm-sidebar.collapsed .hm-sidebar-logo span {
    display: none;
}

.hm-sidebar.collapsed .hm-sidebar-toggle-btn {
    display: none;
}

/* 导航居中 */
.hm-sidebar.collapsed .hm-nav {
    align-items: center;
    width: 100%;
}

.hm-sidebar.collapsed .hm-nav-item {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    overflow: visible;
    box-sizing: border-box;
}

.hm-sidebar.collapsed .hm-nav-item span {
    display: none;
}

.hm-sidebar.collapsed .hm-nav-item i {
    margin: 0;
    font-size: 16px;
    width: auto;
    line-height: 1;
}

.hm-sidebar.collapsed .hm-nav-item.active::before {
    display: none;
}

/* 分组居中 */
.hm-sidebar.collapsed .hm-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.hm-sidebar.collapsed .hm-group-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    gap: 6px;
    width: 40px;
    margin: 0 auto;
}

.hm-sidebar.collapsed .hm-group-toggle-btn,
.hm-sidebar.collapsed .hm-group-title,
.hm-sidebar.collapsed .hm-group-link {
    display: none;
}

.hm-sidebar.collapsed .hm-group-extra {
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.hm-sidebar.collapsed .hm-group-action-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 8px;
    overflow: visible;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.hm-sidebar.collapsed .hm-group-action-btn:hover {
    background: #181818;
    color: #fff;
}

/* 列表居中 */
.hm-sidebar.collapsed .hm-list {
    width: 100%;
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hm-sidebar.collapsed .hm-list-item {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow: visible;
    box-sizing: border-box;
    display: flex;
}

.hm-sidebar.collapsed .hm-list-name,
.hm-sidebar.collapsed .hm-list-actions {
    display: none !important;
}

.hm-sidebar.collapsed .hm-list-thumb {
    width: 28px;
    height: 28px;
    margin: 0;
    flex-shrink: 0;
}

.hm-sidebar.collapsed .hm-list-empty {
    display: none;
}


/* ==========================================================================
   ★★★ 侧边栏折叠状态最终修正（加在文件末尾，覆盖所有之前定义）
   ========================================================================== */

/* 折叠容器：允许 tooltip 溢出，禁止裁切 */
.hm-sidebar.collapsed {
    width: 56px !important;
    padding: 12px 0 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    overflow: visible !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
}

/* header 居中 */
.hm-sidebar.collapsed .hm-sidebar-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 4px 0 14px !important;
    margin: 0 !important;
}

.hm-sidebar.collapsed .hm-sidebar-logo {
    flex: none !important;
    padding: 6px !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

.hm-sidebar.collapsed .hm-sidebar-logo span { display: none !important; }
.hm-sidebar.collapsed .hm-sidebar-toggle-btn { display: none !important; }

/* 导航居中 */
.hm-sidebar.collapsed .hm-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    gap: 2px !important;
}

.hm-sidebar.collapsed .hm-nav-item {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    display: flex !important;
    position: relative !important;
    border-radius: 8px !important;
}

.hm-sidebar.collapsed .hm-nav-item span { display: none !important; }

.hm-sidebar.collapsed .hm-nav-item i {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    width: auto !important;
    line-height: 1 !important;
    text-align: center !important;
    display: block !important;
}

.hm-sidebar.collapsed .hm-nav-item.active::before { display: none !important; }

/* 分组居中 */
.hm-sidebar.collapsed .hm-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
}

.hm-sidebar.collapsed .hm-group-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 0 !important;
    margin: 0 auto !important;
    gap: 6px !important;
    width: 40px !important;
}

.hm-sidebar.collapsed .hm-group-toggle-btn,
.hm-sidebar.collapsed .hm-group-title,
.hm-sidebar.collapsed .hm-group-link { display: none !important; }

.hm-sidebar.collapsed .hm-group-extra {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: center !important;
    margin: 0 !important;
}

.hm-sidebar.collapsed .hm-group-action-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    border-radius: 8px !important;
    overflow: visible !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* ★ 列表居中（关键修复） */
.hm-sidebar.collapsed .hm-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 4px !important;
    overflow: visible !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hm-sidebar.collapsed .hm-list-item {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    position: relative !important;
    border-radius: 8px !important;
    flex: none !important;
}

.hm-sidebar.collapsed .hm-list-name,
.hm-sidebar.collapsed .hm-list-actions,
.hm-sidebar.collapsed .hm-list-more { display: none !important; }

.hm-sidebar.collapsed .hm-list-thumb {
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
}

.hm-sidebar.collapsed .hm-list-thumb i { font-size: 13px !important; }

.hm-sidebar.collapsed .hm-list-empty { display: none !important; }

/* 折叠状态下所有工具的 tooltip */
.hm-sidebar.collapsed [data-tooltip] { position: relative !important; }

.hm-sidebar.collapsed [data-tooltip]:hover::after {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    left: calc(100% + 12px) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 6px 10px !important;
    background: #1e1e24 !important;
    border: 1px solid #33333c !important;
    color: #e4e4e7 !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .6) !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 折叠状态下阻止父级裁切 tooltip */
.hm-sidebar.collapsed .hm-group,
.hm-sidebar.collapsed .hm-list,
.hm-sidebar.collapsed .hm-list-item {
    overflow: visible !important;
}



/* ==========================================================================
   会话项的三点菜单
   ========================================================================== */
.hm-chat-item-menu {
    position: fixed;
    min-width: 140px;
    padding: 6px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    z-index: 200000;
    animation: ctxIn 0.12s ease;
}

.hm-chat-item-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.hm-chat-item-menu .menu-item:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-chat-item-menu .menu-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #a1a1aa;
}

.hm-chat-item-menu .menu-item:hover i {
    color: #fff;
}

.hm-chat-item-menu .menu-item.danger {
    color: #fca5a5;
}

.hm-chat-item-menu .menu-item.danger i {
    color: #fca5a5;
}

.hm-chat-item-menu .menu-item.danger:hover {
    background: #7f1d1d;
    color: #fff;
}

.hm-chat-item-menu .menu-item.danger:hover i {
    color: #fff;
}










/* 会话列表项高亮（覆盖 nav-item 样式） */
#hmChatList .hm-list-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    font-weight: 500;
}

#hmChatList .hm-list-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #6366f1;
    border-radius: 0 3px 3px 0;
}

#hmChatList .hm-list-item {
    position: relative;
    padding-left: 14px;
}



.hm-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.hm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    text-align: left;
}

.hm-nav-item:hover {
    background: #181818;
    color: #fff;
}

.hm-nav-item.active {
    background: #1f1f1f;
    color: #fff;
    border-left: 2px solid #8b5cf6;
}

.hm-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.hm-list-group {
    margin-bottom: 16px;
}

.hm-list-title {
    font-size: 11.5px;
    color: #52525b;
    padding: 8px 12px 6px;
    user-select: none;
}

.hm-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hm-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-list-item:hover {
    background: #181818;
    color: #e4e4e7;
}

.hm-list-item.active {
    background: #1f1f1f;
    color: #fff;
}

.hm-list-item i {
    font-size: 13px;
    flex-shrink: 0;
    color: #71717a;
}

.hm-list-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



.hm-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    background: #0a0a0a;
}

/* ★ 首页内容区顶部预留空间，避免抵到悬浮顶栏 */
.hm-main-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px 80px; /* ★ 从 24px 加到 80px */
    min-height: 100%;
    box-sizing: border-box;
}

.hm-main::-webkit-scrollbar {
    width: 8px;
}

.hm-main::-webkit-scrollbar-thumb {
    background: #232323;
    border-radius: 4px;
}



.hm-welcome {
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 28px;
}

.hm-mode-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.hm-mode-tabs-inner {
    display: flex;
    align-items: center;
    background: #161616;
    border-radius: 24px;
    padding: 4px;
}

.hm-mode-tab {
    min-width: 100px;
    height: 40px;
    padding: 0 24px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.hm-mode-tab:hover {
    color: #e4e4e7;
}

.hm-mode-tab.active {
    background: #e4e4e7;
    color: #0a0a0a;
    font-weight: 600;
}

/* ==========================================================================
   首页创作区（AI 会话设置区）—— 完整样式
   ========================================================================== */

/* 主容器 */
.hm-composer {
    max-width: 960px;
    margin: 0 auto 12px;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 20px;
    padding: 16px 20px 12px;
    transition: border-color .15s;
    position: relative;
}

.hm-composer:focus-within {
    border-color: #3a3a3a;
}

/* 顶部：上传区 + 文本输入框 */
.hm-composer-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 80px;
    margin-bottom: 12px;
}

/* 左侧上传区 */
.hm-composer-upload {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* 上传框（即梦AI的灰色方块） */
.hm-upload-box {
    width: 64px;
    height: 64px;
    background: #1f1f24;
    border: 1px dashed #3a3a44;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #71717a;
    position: relative;
    overflow: hidden;
}

.hm-upload-box:hover {
    background: #2a2a32;
    border-color: #6366f1;
    color: #a5b4fc;
}

.hm-upload-box i {
    font-size: 16px;
}

.hm-upload-box span {
    font-size: 10px;
    font-weight: 500;
}

/* 已上传素材缩略图列表 */
.hm-upload-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 400px;
    padding-bottom: 4px;
}

.hm-upload-thumbs::-webkit-scrollbar {
    height: 4px;
}
.hm-upload-thumbs::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 2px;
}

.hm-upload-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #121216;
    border: 1px solid #2a2a32;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-upload-thumb img,
.hm-upload-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-upload-thumb .thumb-icon {
    font-size: 20px;
    color: #8b5cf6;
}

.hm-upload-thumb .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.hm-upload-thumb:hover .remove-btn {
    opacity: 1;
}

/* 右侧文本输入框 */
.hm-composer-input {
    flex: 1;
    min-height: 64px;
    max-height: 200px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: #e4e4e7;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    padding-top: 6px;
}

.hm-composer-input::placeholder {
    color: #52525b;
}

/* 底部工具栏 */
.hm-composer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* 设置区容器 */
.hm-composer-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hm-composer-spacer {
    flex: 1;
}

/* ==========================================================================
   下拉菜单与设置按钮（分类、模型、参数）
   ========================================================================== */

/* 下拉菜单容器 */
.hm-dropdown-wrap {
    position: relative;
}

/* 下拉按钮 */
.hm-chip.dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    padding: 0 12px;
    height: 34px;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.hm-chip.dropdown-btn:hover,
.hm-chip.dropdown-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.hm-chip.dropdown-btn i {
    font-size: 14px;
}

/* 下拉面板（向下弹出，支持滚动） */
.hm-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 9999;
    animation: ctxIn 0.15s ease;
}

.hm-dropdown-menu.show {
    display: block;
}

.hm-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.hm-dropdown-menu::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

/* 下拉菜单项 */
.hm-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.15s;
}

.hm-dd-item:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-dd-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.hm-dd-item i {
    width: 16px;
    text-align: center;
    color: #71717a;
}

.hm-dd-item.active i {
    color: #a5b4fc;
}

.hm-dd-item .check-icon {
    margin-left: auto;
    color: #6366f1;
    display: none;
}

.hm-dd-item.active .check-icon {
    display: block;
}

/* 空模型提示 */
.hm-empty-model {
    padding: 16px;
    text-align: center;
    color: #52525b;
    font-size: 12px;
    line-height: 1.6;
}
.hm-empty-model i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ==========================================================================
   参数面板（即梦AI风格，精细布局）
   ========================================================================== */

.hm-params-panel {
    width: 560px;
    padding: 16px;
    background: #18181c;
    border: 1px solid #2a2a32;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
}

.hm-param-group {
    margin-bottom: 18px;
}

.hm-param-group:last-child {
    margin-bottom: 0;
}

.hm-param-label {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

/* 1. 比例选择网格（强制单行 9 个） */
.hm-ratio-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
}

.hm-ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 44px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.hm-ratio-btn:hover {
    background: #1e1e24;
    border-color: #3a3a44;
}

.hm-ratio-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #a5b4fc;
}

/* 比例小图标 */
.hm-ratio-btn::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    margin-bottom: 3px;
}

.hm-ratio-btn[data-val="16:9"]::before { width: 18px; height: 10px; }
.hm-ratio-btn[data-val="9:16"]::before { width: 10px; height: 18px; }
.hm-ratio-btn[data-val="1:1"]::before { width: 14px; height: 14px; }
.hm-ratio-btn[data-val="4:3"]::before { width: 16px; height: 12px; }
.hm-ratio-btn[data-val="3:4"]::before { width: 12px; height: 16px; }
.hm-ratio-btn[data-val="21:9"]::before { width: 20px; height: 8px; }
.hm-ratio-btn[data-val="3:2"]::before { width: 16px; height: 11px; }
.hm-ratio-btn[data-val="2:3"]::before { width: 11px; height: 16px; }

/* 2. 分辨率 & 3. 生成数量（强制单行） */
.hm-size-grid,
.hm-count-grid {
    display: flex;
    gap: 8px;
    width: 100%;
}

.hm-size-btn,
.hm-count-btn {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-size-btn:hover,
.hm-count-btn:hover {
    background: #1e1e24;
    border-color: #3a3a44;
}

.hm-size-btn.active,
.hm-count-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    font-weight: 600;
}

/* 4. 开关（即梦AI的蓝色胶囊开关） */
.hm-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #d4d4d8;
}

.hm-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #3a3a44;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hm-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.hm-switch.active { background: #6366f1; }
.hm-switch.active::after { transform: translateX(16px); }

/* 5. 尺寸 W/H 联动区 */
.hm-size-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    padding: 6px 12px;
}

.hm-size-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.hm-size-input-wrap span {
    font-size: 13px;
    color: #71717a;
}

.hm-size-input-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: #e4e4e7;
    font-size: 14px;
    font-family: 'SF Mono', Monaco, monospace;
    outline: none;
    text-align: right;
}

.hm-size-unit {
    font-size: 12px;
    color: #52525b;
    margin-left: -4px;
}

/* 6. 滑块样式 */
.hm-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hm-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: #6366f1;
    height: 4px;
    background: #2a2a32;
    border-radius: 2px;
    appearance: none;
}

.hm-slider-wrap input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hm-slider-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: #e4e4e7;
    min-width: 40px;
    text-align: right;
}

/* 通用 chip 和按钮 */
.hm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hm-chip:hover {
    background: #232323;
    color: #fff;
}

.hm-chip i {
    font-size: 13px;
}

.hm-chip.icon-only {
    width: 30px;
    padding: 0;
    justify-content: center;
}

.hm-chip.agent {
    color: #a5b4fc;
}

.hm-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e4e4e7;
    color: #0a0a0a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all .15s;
}

.hm-send-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.hm-send-btn:disabled {
    background: #2a2a2a;
    color: #52525b;
    cursor: not-allowed;
}

/* 快捷技能区 */
.hm-shortcuts {
    max-width: 960px;
    margin: 0 auto 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hm-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 17px;
    color: #a1a1aa;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hm-shortcut:hover {
    background: #232323;
    color: #fff;
    border-color: #3a3a3a;
}

.hm-shortcut .hm-tag {
    padding: 1px 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    font-weight: 600;
}

/* ==========================================================================
   首页画布网格 / 推荐卡片 / 内容卡片（原有样式保留）
   ========================================================================== */
.hm-canvas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.hm-canvas-card {
    aspect-ratio: 16/9;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hm-canvas-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

.hm-canvas-thumb {
    flex: 1;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.hm-canvas-name {
    padding: 8px 12px;
    font-size: 12.5px;
    color: #a1a1aa;
    border-top: 1px solid #232323;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #161616;
}

.hm-canvas-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-style: dashed;
    background: transparent;
}

.hm-canvas-new i {
    font-size: 28px;
    color: #52525b;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #161616;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.hm-canvas-new:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, .05);
}

.hm-canvas-new:hover i {
    background: #6366f1;
    color: #fff;
}

.hm-canvas-new span {
    font-size: 13px;
    color: #a1a1aa;
}

.hm-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.hm-section-head-title {
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
}

.hm-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.hm-featured-card {
    aspect-ratio: 16/10;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #161616;
    transition: transform .2s;
}

.hm-featured-card:hover {
    transform: scale(1.01);
}

.hm-featured-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.hm-featured-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85));
    color: #fff;
}

.hm-featured-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.hm-featured-author {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .7);
}

.hm-cat-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hm-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #71717a;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}

.hm-cat-tab:hover {
    color: #a1a1aa;
}

.hm-cat-tab.active {
    background: #1f1f1f;
    color: #fff;
    font-weight: 500;
}

.hm-cat-spacer {
    flex: 1;
}

.hm-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 8px;
    min-width: 200px;
}

.hm-search-box i {
    color: #71717a;
    font-size: 12px;
}

.hm-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e4e4e7;
    font-size: 12.5px;
    font-family: inherit;
}

.hm-search-box input::placeholder {
    color: #52525b;
}

.hm-content-section {
    margin-bottom: 24px;
}

.hm-content-title {
    font-size: 13px;
    color: #a1a1aa;
    margin-bottom: 14px;
}

.hm-content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.hm-content-card {
    background: #161616;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}

.hm-content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
}


/* ==========================================================================
   @ 引用弹出菜单（紧贴 @ 按钮下方）
   ========================================================================== */
   .hm-mention-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-height: 340px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.hm-mention-popup.show {
    display: flex;
}

.hm-mention-title {
    padding: 12px 16px 8px;
    font-size: 12px;
    color: #71717a;
}

.hm-mention-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.hm-mention-list::-webkit-scrollbar {
    width: 5px;
}
.hm-mention-list::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

.hm-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.hm-mention-item:hover {
    background: #2a2a32;
}

.hm-mention-item .item-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #121216;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    flex-shrink: 0;
}

.hm-mention-item .item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-mention-item .item-info {
    flex: 1;
    min-width: 0;
}

.hm-mention-item .item-name {
    font-size: 13px;
    color: #e4e4e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-mention-item .item-type {
    font-size: 10.5px;
    color: #71717a;
    margin-top: 2px;
}

/* 引用/本地素材的缩略图标记 */
.hm-upload-thumb .ref-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    pointer-events: none;
}

/* ★ 让 @ 按钮与其它 dropdown-btn 视觉完全一致 */
#hmMentionBtn {
    width: 34px;
    padding: 0;
    justify-content: center;
    font-size: 14px;
}


/* ==========================================================================
   AI 会话视图 - 即梦风格记录流
   ========================================================================== */
   /* 会话视图：撑满可视区，输入区贴底 */
   #hmViewChat {
    margin: -80px -40px -80px; /* ★ 抵消新的 padding-top: 80px */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hm-chat-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 32px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* ★ 删除原 .hm-chat-header 样式（HTML 已移除），保留兼容 */
.hm-chat-header { display: none; }

/* 消息区：顶部留 72px 避让悬浮顶栏 */
.hm-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 72px 4px 24px; /* ★ 顶部留出悬浮顶栏空间 */
    display: flex;
    flex-direction: column;
    gap: 32px;
    scroll-behavior: smooth;
}

.hm-chat-messages::-webkit-scrollbar { width: 6px; }
.hm-chat-messages::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

/* 输入区贴底 */
.hm-chat-composer {
    flex-shrink: 0;
    margin: 0 0 16px;
    max-width: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
}



/* ========== 单条记录容器（4层：日期 → 提示词 → 结果 → 操作） ========== */
.hm-chat-record {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

/* 第1层：日期 */
.hm-chat-record-date {
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 4px;
}

/* 记录主体（左对齐） */
.hm-chat-record-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 0;
}

/* 第2层：提示词区（引用 + 文本 + 模型信息） */
.hm-chat-record-prompt {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 引用缩略图 */
.hm-chat-record-refs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.hm-chat-record-refs .ref-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #121216;
    border: 1px solid #2a2a32;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #a78bfa;
    font-size: 20px;
}

.hm-chat-record-refs .ref-thumb:hover {
    border-color: #6366f1;
    transform: scale(1.04);
}

.hm-chat-record-refs .ref-thumb img,
.hm-chat-record-refs .ref-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-chat-record-refs .ref-thumb .ref-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
}

/* 提示词文本（默认 2 行截断） */
.hm-chat-record-prompt-text {
    font-size: 13.5px;
    color: #d4d4d8;
    line-height: 1.65;
    position: relative;
    cursor: pointer;
}

.hm-chat-record-prompt-text .prompt-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}

.hm-chat-record-prompt-text:hover .prompt-preview {
    color: #fff;
}

/* 模型信息行 */
.hm-chat-record-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #71717a;
    flex-wrap: wrap;
}

.hm-chat-record-meta .meta-model {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #a1a1aa;
    font-weight: 500;
}

.hm-chat-record-meta .meta-model i {
    color: #8b5cf6;
}

.hm-chat-record-meta .meta-sep {
    color: #3f3f46;
}

.hm-chat-record-meta .meta-param {
    color: #a1a1aa;
}

.hm-chat-record-meta .meta-info {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #71717a;
    cursor: pointer;
    transition: color 0.15s;
}

.hm-chat-record-meta .meta-info:hover {
    color: #a5b4fc;
}

/* 第3层：结果区 */
.hm-chat-record-results {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hm-chat-record-results .result-item {
    max-width: 480px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a32;
    background: #0d0d10;
    cursor: pointer;
    transition: all 0.15s;
}

.hm-chat-record-results .result-item:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.hm-chat-record-results .result-item img,
.hm-chat-record-results .result-item video {
    width: 100%;
    display: block;
    max-height: 520px;
    object-fit: contain;
}

/* 文本结果 */
.hm-chat-record-text-result {
    font-size: 14px;
    color: #d4d4d8;
    line-height: 1.75;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 12px;
    padding: 14px 18px;
    max-width: 720px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 打字动画 */
.hm-chat-msg-typing {
    display: inline-flex;
    gap: 4px;
    padding: 14px 18px;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 12px;
}

.hm-chat-msg-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    animation: chatTyping 1.2s ease-in-out infinite;
}

.hm-chat-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.hm-chat-msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* 第4层：底部操作按钮 */
.hm-chat-record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.hm-chat-record-actions .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background: #161616;
    border: 1px solid #232323;
    border-radius: 8px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.hm-chat-record-actions .action-btn:hover {
    background: #232323;
    color: #fff;
    border-color: #3a3a44;
}

.hm-chat-record-actions .action-btn i {
    font-size: 12px;
}

.hm-chat-record-actions .action-btn.icon-only {
    width: 32px;
    padding: 0;
    justify-content: center;
}

/* 悬停提示：完整提示词 */
.prompt-tooltip {
    position: fixed;
    max-width: 620px;
    padding: 14px 18px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.75;
    color: #e4e4e7;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    z-index: 99999;
    white-space: pre-wrap;
    word-break: break-word;
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.prompt-tooltip.show {
    display: block;
    opacity: 1;
}

/* 更多菜单 */
.hm-chat-more-menu {
    position: fixed;
    min-width: 180px;
    padding: 6px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
    z-index: 100000;
    animation: ctxIn 0.12s ease;
}

.hm-chat-more-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.hm-chat-more-menu .menu-item:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-chat-more-menu .menu-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
}

/* 空状态 */
.hm-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #52525b;
    font-size: 13px;
    gap: 12px;
    padding: 60px 20px;
}

.hm-chat-empty i {
    font-size: 42px;
    color: #6366f1;
    opacity: 0.5;
}

/* 底部输入区（滚动时收缩） */
.hm-chat-composer {
    flex-shrink: 0;
    margin-bottom: 16px;
    transition: padding 0.25s ease, border-radius 0.25s ease;
}

.hm-chat-container.scrolled .hm-chat-composer {
    padding: 8px 14px 6px;
    border-radius: 16px;
}

.hm-chat-container.scrolled .hm-chat-composer .hm-composer-top {
    min-height: 40px;
    margin-bottom: 4px;
}

.hm-chat-container.scrolled .hm-chat-composer .hm-upload-box {
    width: 40px;
    height: 40px;
}

.hm-chat-container.scrolled .hm-chat-composer .hm-upload-box span {
    display: none;
}

.hm-chat-container.scrolled .hm-chat-composer .hm-composer-input {
    min-height: 36px;
    font-size: 13.5px;
    padding-top: 8px;
}

/* 左侧会话列表 */
#hmChatList .hm-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

#hmChatList .hm-list-item .chat-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#hmChatList .hm-list-item .chat-del-btn {
    opacity: 0;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

#hmChatList .hm-list-item:hover .chat-del-btn {
    opacity: 1;
}

#hmChatList .hm-list-item .chat-del-btn:hover {
    background: #7f1d1d;
    color: #fecaca;
}










/* ==========================================================================
   资产页 - 全新重构样式 (对应图2)
   ========================================================================== */
        /* 顶部主标签 */
        .hm-assets-main-tabs {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 24px;
        }

        .hm-assets-main-tab {
            background: transparent;
            border: none;
            color: #a1a1aa;
            font-size: 14px;
            font-weight: 500;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .hm-assets-main-tab:hover {
            color: #fff;
            background: #1f1f1f;
        }

        .hm-assets-main-tab.active {
            color: #fff;
            background: #2a2a2a;
            /* 选中时的灰色胶囊背景 */
        }

        /* 二级过滤栏 */
        .hm-assets-filter-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            border-bottom: 1px solid #232323;
            padding-bottom: 12px;
        }

        .hm-assets-filter-left {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .hm-assets-filter-btn {
            background: transparent;
            border: none;
            color: #71717a;
            font-size: 13px;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .hm-assets-filter-btn:hover {
            color: #e4e4e7;
        }

        .hm-assets-filter-btn.active {
            color: #fff;
            font-weight: 500;
            background: rgba(99, 102, 241, 0.15);
            /* 选中时的轻微颜色标识 */
        }

        .hm-assets-filter-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .hm-assets-tool-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: transparent;
            border: 1px solid #232323;
            color: #a1a1aa;
            font-size: 12px;
            padding: 5px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .hm-assets-tool-btn:hover {
            background: #1f1f1f;
            color: #fff;
            border-color: #3a3a3a;
        }

        /* 资产内容网格 (确保和现有的 hm-content-grid 兼容) */
        #hmHistoryGrid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 16px;
            align-content: flex-start;
            min-height: 300px;
        }

        #hmAssetsCanvasGrid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 16px;
            align-content: flex-start;
        }


        #hmViewAssets {
            /* 如果需要资产页有独立的边距，可以在这里覆盖 */
            margin-top: -10px;
        }

        #hmViewAssets .hm-assets-main-tabs {
            margin-top: 0;
        }


        /* ==========================================================================
资产页 - 画布卡片增强样式 (对应图2)
========================================================================== */
        #hmAssetsCanvasGrid .hm-canvas-card {
            position: relative;
            aspect-ratio: 16/9;
            border-radius: 12px;
            overflow: hidden;
            cursor: pointer;
            border: 1px solid #232323;
            background: #161616;
            transition: all 0.2s;
        }

        /* 画布卡片悬浮遮罩层 */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
            z-index: 1;
        }

        /* 底部文字信息与操作栏 */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-info {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 2;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-title {
            font-size: 13px;
            color: #fff;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 1;
            margin-right: 8px;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-time {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
            margin-top: 2px;
        }

        /* 更多操作按钮 (默认隐藏，悬浮显示) */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-more {
            display: none;
            width: 26px;
            height: 26px;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: #fff;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            backdrop-filter: blur(4px);
            transition: all 0.15s;
            flex-shrink: 0;
        }

        #hmAssetsCanvasGrid .hm-canvas-card:hover .canvas-card-more {
            display: flex;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-more:hover {
            background: #6366f1;
        }

        /* 右上角收藏星标 (悬浮显示，或已收藏时显示) */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-fav-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 5;
            color: #fff;
            font-size: 14px;
            cursor: pointer;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 50%;
            width: 26px;
            height: 26px;
            display: none;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            border: none;
            transition: all 0.15s;
        }

        #hmAssetsCanvasGrid .hm-canvas-card:hover .canvas-card-fav-btn,
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-fav-btn.active {
            display: flex;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-fav-btn:hover {
            background: rgba(0, 0, 0, 0.7);
            transform: scale(1.1);
        }

        /* 左上角复选框 (默认隐藏，悬浮显示) */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-check {
            position: absolute;
            top: 8px;
            left: 8px;
            z-index: 5;
            width: 18px;
            height: 18px;
            border: 1.5px solid rgba(255, 255, 255, 0.6);
            border-radius: 4px;
            display: none;
            cursor: pointer;
            background: transparent;
            transition: all 0.15s;
        }

        #hmAssetsCanvasGrid .hm-canvas-card:hover .canvas-card-check {
            display: block;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-check:hover {
            border-color: #fff;
        }

        /* ==========================================================================
新增：顶部多选操作栏样式
========================================================================== */
        .hm-multi-select-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #1a1a1a;
            border: 1px solid #2a2a2a;
            border-radius: 8px;
            padding: 4px 12px;
            height: 36px;
        }

        .hm-ms-count {
            font-size: 13px;
            color: #a1a1aa;
            margin-right: 8px;
        }

        .hm-ms-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 28px;
            padding: 0 10px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #a1a1aa;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .hm-ms-btn:hover {
            background: #2a2a2a;
            color: #fff;
        }

        /* ==========================================================================
新增：画布卡片选中与复选框样式
========================================================================== */
        /* 默认复选框 (可见但未选中) */
        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-check {
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 10;
            width: 18px;
            height: 18px;
            border: 1.5px solid rgba(255, 255, 255, 0.6);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background: rgba(0, 0, 0, 0.4);
            transition: all 0.15s;
        }

        #hmAssetsCanvasGrid .hm-canvas-card .canvas-card-check:hover {
            border-color: #fff;
        }

        /* 选中时的卡片样式 */
        #hmAssetsCanvasGrid .hm-canvas-card.selected {
            border: 1.5px solid #e4e4e7;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
        }

        /* 选中时的复选框样式 */
        #hmAssetsCanvasGrid .hm-canvas-card.selected .canvas-card-check {
            background: #e4e4e7;
            border-color: #e4e4e7;
        }

        /* 选中时的打勾图标 */
        #hmAssetsCanvasGrid .hm-canvas-card.selected .canvas-card-check::after {
            content: '✓';
            color: #121212;
            font-size: 12px;
            font-weight: bold;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        /* 悬浮时更多按钮和收藏按钮的显示逻辑保留原样，但选中时也强制显示收藏按钮 */
        #hmAssetsCanvasGrid .hm-canvas-card.selected .canvas-card-fav-btn {
            display: flex;
        }



        /* ==========================================================================
   22. AI 设置 V2
   ========================================================================== */
        .ai-tabs {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 0 16px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .ai-tab {
            padding: 12px 4px;
            background: transparent;
            border: none;
            color: #71717a;
            font-size: 13.5px;
            cursor: pointer;
            transition: color .15s;
            position: relative;
        }

        .ai-tab:hover {
            color: #a1a1aa;
        }

        .ai-tab.active {
            color: #e4e4e7;
            font-weight: 500;
        }

        .ai-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 2px;
            background: #6366f1;
            border-radius: 1px;
        }

        .ai-tab-count {
            font-size: 11px;
            color: #52525b;
            padding: 1px 6px;
            background: #232329;
            border-radius: 8px;
            margin-left: 4px;
        }

        .ai-tab.active .ai-tab-count {
            color: #a5b4fc;
        }

        .ai-panel {
            display: none;
        }

        .ai-panel.show {
            display: block;
        }

        .ai-provider-card {
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 10px;
            padding: 14px 16px;
            margin-bottom: 10px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            transition: border-color .15s;
        }

        .ai-provider-card:hover {
            border-color: #3a3a44;
        }

        .ai-provider-card.enabled {
            border-color: rgba(99, 102, 241, .35);
        }

        .ai-provider-head {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .ai-provider-status {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #52525b;
            flex-shrink: 0;
        }

        .ai-provider-status.ok {
            background: #22c55e;
            box-shadow: 0 0 8px rgba(34, 197, 94, .5);
        }

        .ai-provider-status.error {
            background: #ef4444;
        }

        .ai-provider-status.testing {
            background: #facc15;
            animation: cvPulse 1s infinite;
        }

        .ai-provider-name {
            font-size: 14px;
            font-weight: 600;
            color: #e4e4e7;
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-provider-name .ai-provider-tag {
            font-size: 10.5px;
            color: #71717a;
            padding: 1px 6px;
            background: #232329;
            border-radius: 6px;
        }

        .ai-provider-name .ai-provider-enabled-count {
            font-size: 11px;
            color: #a5b4fc;
        }

        .ai-provider-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .ai-btn {
            height: 28px;
            padding: 0 10px;
            background: transparent;
            border: 1px solid #33333c;
            border-radius: 7px;
            color: #a1a1aa;
            font-size: 12px;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .ai-btn:hover {
            background: #2a2a32;
            color: #fff;
            border-color: #52525b;
        }

        .ai-btn.primary {
            background: #6366f1;
            border-color: #6366f1;
            color: #fff;
        }

        .ai-btn.primary:hover {
            background: #4f46e5;
        }

        .ai-btn.primary:disabled {
            opacity: .4;
            cursor: not-allowed;
        }

        .ai-btn.danger {
            color: #fca5a5;
            border-color: #7f1d1d;
        }

        .ai-btn.danger:hover {
            background: #7f1d1d;
            color: #fff;
        }

        .ai-btn i {
            font-size: 11.5px;
        }

        .ai-key-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-key-row .cv-input {
            flex: 1;
            height: 34px;
            padding: 0 12px;
            font-family: 'SF Mono', Monaco, monospace;
            font-size: 12.5px;
        }

        .ai-empty {
            padding: 50px 20px;
            text-align: center;
            color: #52525b;
            font-size: 13px;
            line-height: 1.8;
        }

        .ai-empty i {
            font-size: 36px;
            display: block;
            margin-bottom: 12px;
            opacity: .4;
        }

        .ai-models-dialog {
            position: fixed;
            inset: 0;
            z-index: 180000;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .75);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }

        .ai-models-dialog.show {
            display: flex;
        }

        .ai-models-box {
            width: 780px;
            max-width: 94vw;
            height: 82vh;
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 24px 80px rgba(0, 0, 0, .85);
        }

        .ai-models-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .ai-models-title {
            font-size: 15px;
            font-weight: 600;
            color: #e4e4e7;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-models-title i {
            color: #8b5cf6;
        }

        .ai-models-title em {
            font-style: normal;
            font-size: 12px;
            color: #a5b4fc;
            padding: 2px 8px;
            background: rgba(99, 102, 241, .15);
            border-radius: 8px;
        }

        .ai-models-toolbar {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 20px;
            border-bottom: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .ai-models-search {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            height: 34px;
            padding: 0 12px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 8px;
        }

        .ai-models-search i {
            color: #71717a;
            font-size: 12px;
        }

        .ai-models-search input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: #e4e4e7;
            font-size: 13px;
            font-family: inherit;
        }

        .ai-models-search input::placeholder {
            color: #52525b;
        }

        .ai-models-body {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        .ai-models-body::-webkit-scrollbar {
            width: 6px;
        }

        .ai-models-body::-webkit-scrollbar-thumb {
            background: #2a2a32;
            border-radius: 3px;
        }

        .ai-model-group {
            margin-bottom: 12px;
        }

        .ai-model-group-head {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            cursor: pointer;
            user-select: none;
            color: #a1a1aa;
            font-size: 12.5px;
        }

        .ai-model-group-head:hover {
            color: #e4e4e7;
        }

        .ai-model-group-head input[type=checkbox] {
            width: 15px;
            height: 15px;
            cursor: pointer;
            accent-color: #6366f1;
        }

        .ai-model-group-head .ai-model-count {
            margin-left: auto;
            font-size: 11px;
            color: #52525b;
        }

        .ai-model-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            margin: 2px 8px;
            border-radius: 8px;
            cursor: pointer;
            transition: background .1s;
        }

        .ai-model-item:hover {
            background: #232329;
        }

        .ai-model-item.selected {
            background: rgba(99, 102, 241, .1);
        }

        .ai-model-item input[type=checkbox] {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: #6366f1;
            flex-shrink: 0;
        }

        .ai-model-item-info {
            flex: 1;
            min-width: 0;
        }

        .ai-model-item-name {
            font-size: 13.5px;
            color: #e4e4e7;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-model-item-name .ai-model-tags {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }

        .ai-model-item-name .ai-model-tag {
            font-size: 10px;
            color: #71717a;
            padding: 1px 6px;
            background: #232329;
            border-radius: 4px;
            font-weight: 400;
        }

        .ai-model-item-id {
            font-size: 11px;
            color: #52525b;
            margin-top: 3px;
            font-family: 'SF Mono', Monaco, monospace;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .ai-models-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 20px;
            border-top: 1px solid #2a2a32;
            flex-shrink: 0;
        }

        .ai-models-footer-info {
            font-size: 12.5px;
            color: #71717a;
        }

        .ai-models-footer-info strong {
            color: #a5b4fc;
            font-weight: 600;
        }

        .ai-models-footer-actions {
            display: flex;
            gap: 8px;
        }

        .ai-scene-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            margin-bottom: 8px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 10px;
        }

        .ai-scene-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(99, 102, 241, .12);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a5b4fc;
            font-size: 15px;
            flex-shrink: 0;
        }

        .ai-scene-info {
            flex: 1;
            min-width: 0;
        }

        .ai-scene-name {
            font-size: 13.5px;
            color: #e4e4e7;
            margin-bottom: 4px;
        }

        .ai-scene-desc {
            font-size: 11.5px;
            color: #71717a;
        }

        .ai-scene-select {
            width: 260px;
            height: 34px;
            padding: 0 30px 0 12px;
            background: #121216;
            border: 1px solid #2a2a32;
            border-radius: 7px;
            color: #e4e4e7;
            font-size: 12.5px;
            outline: none;
            cursor: pointer;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
            background-repeat: no-repeat;
            background-position: right 10px center;
            appearance: none;
            -webkit-appearance: none;
        }

        .ai-scene-select:focus {
            border-color: #6366f1;
        }

        /* ==========================================================================
   23. 响应式
   ========================================================================== */
        @media (max-width: 1200px) {
            .hm-featured-grid {
                grid-template-columns: repeat(3, 1fr);
            }

            .hm-content-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 900px) {

            .cv-project-sidebar,
            .cv-node-sidebar {
                position: absolute;
                top: 0;
                bottom: 0;
            }

            .cv-project-sidebar {
                left: 0;
            }

            .cv-node-sidebar {
                right: 0;
            }

            .cv-top-btn span {
                display: none;
            }

            .cv-project-name {
                display: none;
            }

            .cv-tl-asset-panel {
                width: 200px;
            }

            .cv-floating-toolbar {
                left: 10px;
            }

            .hm-main-inner {
                padding: 24px 20px 60px;
            }

            .hm-welcome {
                font-size: 24px;
            }

            .hm-featured-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .hm-content-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .hm-user-pill .hm-user-tier,
            .hm-user-pill .hm-user-discount {
                display: none;
            }

            .cv-top-pill-btn span {
                display: none;
            }

            .cv-top-user .user-tier {
                display: none;
            }

            .cv-top-user span:not(.user-tier) {
                display: none;
            }
        }

        @media (max-width: 700px) {
            .hm-sidebar {
                position: absolute;
                top: 56px;
                bottom: 0;
                left: 0;
                z-index: 100;
            }

            .hm-sidebar.hidden {
                display: none;
            }

            .hm-featured-grid {
                grid-template-columns: 1fr;
            }

            .hm-content-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 500px) {
            .cv-ai-chat-panel {
                width: 100%;
                max-width: 520px;
            }
        }


        /* ==========================================================================
       新增：新建项目弹窗样式
       ========================================================================== */
        .cv-new-project-modal {
            position: fixed;
            inset: 0;
            z-index: 220000;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
        }

        .cv-new-project-modal.show {
            display: flex;
        }

        .cv-np-dialog {
            width: 420px;
            max-width: 90vw;
            background: #1a1a20;
            border: 1px solid #33333c;
            border-radius: 14px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
            overflow: hidden;
            animation: ctxIn 0.15s ease;
        }

        .cv-np-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px 20px;
            border-bottom: 1px solid #2a2a32;
            font-size: 15px;
            font-weight: 600;
            color: #e4e4e7;
        }

        .cv-np-body {
            padding: 20px 20px 10px;
        }

        .cv-np-input {
            width: 100%;
            height: 40px;
            background: #121216;
            border: 1px solid #33333c;
            border-radius: 8px;
            padding: 0 14px;
            color: #e4e4e7;
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s;
            font-family: inherit;
        }

        .cv-np-input:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
        }

        .cv-np-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 10px 20px 20px;
        }

        .cv-np-btn {
            height: 36px;
            padding: 0 20px;
            border-radius: 8px;
            font-size: 13.5px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            transition: all 0.15s;
        }

        .cv-np-btn.cancel {
            background: #2a2a32;
            color: #d4d4d8;
        }

        .cv-np-btn.cancel:hover {
            background: #3a3a44;
            color: #fff;
        }

        .cv-np-btn.confirm {
            background: #6366f1;
            color: #fff;
        }

        .cv-np-btn.confirm:hover {
            background: #4f46e5;
        }




        /* ==========================================================================
       新增：项目下拉菜单悬浮交互样式
       ========================================================================== */
        .cv-pd-item {
            position: relative;
            /* 保证三点按钮绝对定位 */
            display: flex;
            align-items: center;
        }

        .cv-pd-item .pd-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* 三点按钮，默认隐藏，悬浮显示 */
        .cv-pd-item .pd-more {
            display: none;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: transparent;
            border: none;
            color: #a1a1aa;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            margin-left: 6px;
            flex-shrink: 0;
        }

        .cv-pd-item:hover .pd-more,
        .cv-pd-item .pd-more:focus {
            display: flex;
            /* 悬浮或聚焦时显示 */
        }

        .cv-pd-item .pd-more:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        /* 隐藏原有的勾选图标，当有 .pd-more 时 */
        .cv-pd-item .pd-check {
            margin-left: auto;
            margin-right: 4px;
        }

        /* 二级菜单（新窗口打开、复制项目） */
        .cv-pd-context-menu {
            position: fixed;
            z-index: 200005;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
            padding: 6px;
            min-width: 160px;
            animation: ctxIn 0.1s ease;
        }

        .cv-pd-context-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: background 0.1s;
        }

        .cv-pd-context-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .cv-pd-context-item i {
            width: 16px;
            text-align: center;
            font-size: 13px;
        }


        /* ==========================================================================
       新增：首页画布管理样式
       ========================================================================== */
        /* 侧边栏画布列表项 */
        .hm-list-item {
            position: relative;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 12px;
            height: auto;
            min-height: 40px;
        }

        .hm-list-item:hover .hm-list-more {
            display: flex;
        }

        .hm-list-thumb {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            object-fit: cover;
            background: #1a1a20;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
            font-size: 13px;
            overflow: hidden;
        }
        
        .hm-list-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .hm-list-thumb.chat-thumb {
            background: #1a1a20;
            color: #a1a1aa;
            border: 1px solid #232323;
        }
        
        .hm-list-thumb.chat-thumb i {
            font-size: 13px;
        }
        
        .hm-list-thumb.canvas-thumb {
            background: #1a1a20;
            color: #a1a1aa;
            border: 1px solid #232323;
        }
        
        .hm-list-thumb.canvas-thumb i {
            font-size: 13px;
        }

        .hm-list-name {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .hm-list-more {
            display: none;
            width: 22px;
            height: 22px;
            border-radius: 4px;
            background: transparent;
            border: none;
            color: #a1a1aa;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            flex-shrink: 0;
        }

        .hm-list-more:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        /* 首页主区域画布卡片 */
        .hm-canvas-card {
            position: relative;
        }

        .hm-canvas-card .canvas-card-bg {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center;
            opacity: 0.8;
            transition: opacity 0.2s;
        }

        .hm-canvas-card:hover .canvas-card-bg {
            opacity: 1;
        }

        .hm-canvas-card .canvas-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
        }

        .hm-canvas-card .canvas-card-info {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .hm-canvas-card .canvas-card-title {
            font-size: 13px;
            color: #fff;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 1;
            margin-right: 8px;
        }

        .hm-canvas-card .canvas-card-time {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
            margin-top: 2px;
        }

        .hm-canvas-card .canvas-more-btn {
            display: none;
            width: 26px;
            height: 26px;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: #fff;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            backdrop-filter: blur(4px);
            transition: all 0.15s;
        }

        .hm-canvas-card:hover .canvas-more-btn {
            display: flex;
        }

        .hm-canvas-card .canvas-more-btn:hover {
            background: #6366f1;
        }

        /* 新建画布卡片 */
        .hm-canvas-new {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            border-style: dashed;
            background: transparent;
            border: 1px dashed #3a3a44;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .hm-canvas-new:hover {
            border-color: #6366f1;
            background: rgba(99, 102, 241, 0.05);
        }

        .hm-canvas-new i {
            font-size: 28px;
            color: #52525b;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: #161616;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .hm-canvas-new:hover i {
            background: #6366f1;
            color: #fff;
        }

        .hm-canvas-new span {
            font-size: 13px;
            color: #a1a1aa;
        }

        /* 通用二级下拉菜单 (首页项目操作) */
        .hm-project-ctx-menu {
            position: fixed;
            z-index: 200005;
            background: #1e1e24;
            border: 1px solid #33333c;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
            padding: 6px;
            min-width: 140px;
            animation: ctxIn 0.1s ease;
        }

        .hm-ctx-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #d4d4d8;
            cursor: pointer;
            transition: background 0.1s;
        }

        .hm-ctx-item:hover {
            background: #2a2a32;
            color: #fff;
        }

        .hm-ctx-item.danger {
            color: #fca5a5;
        }

        .hm-ctx-item.danger:hover {
            background: #7f1d1d;
            color: #fff;
        }











/* ==========================================================================
   ★★★ 主体页 - 独立样式（追加在末尾）
   ========================================================================== */

/* ---------- 顶部工具栏 ---------- */
.hm-subj-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px 0;
}

.hm-filter-wrap {
    position: relative;
}

.hm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s;
}

.hm-filter-btn:hover {
    background: #181818;
    color: #fff;
}

.hm-filter-btn.active {
    color: #fff;
}

.hm-filter-btn i {
    font-size: 11px;
    transition: transform .2s;
}

.hm-filter-btn.open i {
    transform: rotate(180deg);
}

/* 下拉面板 */
.hm-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    padding: 6px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .75);
    display: none;
    z-index: 100;
    animation: ctxIn .12s ease;
}

.hm-filter-menu.show {
    display: block;
}

.hm-filter-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
}

.hm-filter-menu-item:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-filter-menu-item.active {
    color: #a5b4fc;
}

.hm-filter-menu-item .check {
    color: #6366f1;
    font-size: 12px;
    display: none;
}

.hm-filter-menu-item.active .check {
    display: block;
}

.hm-filter-menu-sep {
    height: 1px;
    background: #2a2a32;
    margin: 4px 0;
}

.hm-filter-menu-label {
    font-size: 11px;
    color: #52525b;
    padding: 8px 12px 4px;
}

/* 时间选择器内的日期行 */
.hm-filter-date-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 8px;
}

.hm-filter-date-input {
    flex: 1;
    height: 30px;
    padding: 0 8px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}

.hm-filter-date-input:focus {
    border-color: #6366f1;
}

/* ---------- 主体网格 ---------- */
.hm-subj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 16px;
    align-content: flex-start;
    min-height: 300px;
    padding-bottom: 40px;
}

.hm-subj-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform .15s;
}

.hm-subj-card:hover {
    transform: translateY(-2px);
}

.hm-subj-card-thumb {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    background: #161616;
    border: 1px solid #232323;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-subj-card-thumb img,
.hm-subj-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-subj-card-thumb .thumb-icon {
    font-size: 40px;
    color: #52525b;
}

/* 新建主体卡片 */
.hm-subj-card-new .hm-subj-card-thumb {
    border-style: dashed;
    background: transparent;
}

.hm-subj-card-new .hm-subj-card-thumb i {
    font-size: 32px;
    color: #52525b;
    transition: color .15s;
}

.hm-subj-card-new:hover .hm-subj-card-thumb {
    border-color: #6366f1;
    background: rgba(99, 102, 241, .05);
}

.hm-subj-card-new:hover .hm-subj-card-thumb i {
    color: #a5b4fc;
}

.hm-subj-card-title {
    font-size: 13px;
    color: #e4e4e7;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.hm-subj-card-meta {
    font-size: 11.5px;
    color: #71717a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

/* 类型角标 */
.hm-subj-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 悬浮时操作按钮 */
.hm-subj-card-more {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background .15s;
}

.hm-subj-card:hover .hm-subj-card-more {
    display: flex;
}

.hm-subj-card-more:hover {
    background: #6366f1;
}

/* 空状态 */
.hm-subj-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #52525b;
    font-size: 13px;
    line-height: 1.8;
}

.hm-subj-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 14px;
    opacity: .4;
}

/* ---------- 新建主体弹窗 ---------- */
.hm-subj-modal {
    position: fixed;
    inset: 0;
    z-index: 220000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hm-subj-modal.show {
    display: flex;
}

.hm-subj-dialog {
    width: 600px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .85);
    overflow: hidden;
    animation: ctxIn .15s ease;
}

.hm-subj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    flex-shrink: 0;
}

.hm-subj-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
}

.hm-subj-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #71717a;
    cursor: help;
    font-size: 13px;
}

.hm-subj-info:hover {
    color: #a1a1aa;
}

.hm-subj-info:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    padding: 12px 14px;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 10px;
    color: #d4d4d8;
    font-size: 12px;
    line-height: 1.7;
    font-weight: 400;
    white-space: normal;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .85);
    z-index: 9999;
    pointer-events: none;
}

.hm-subj-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #71717a;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.hm-subj-close:hover {
    background: #2a2a32;
    color: #fff;
}

.hm-subj-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hm-subj-body::-webkit-scrollbar { width: 6px; }
.hm-subj-body::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

.hm-subj-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-subj-label {
    font-size: 13px;
    color: #e4e4e7;
    font-weight: 500;
}

.hm-subj-req {
    color: #ef4444;
    margin-left: 2px;
}

/* 上传器 */
.hm-subj-uploader {
    background: #121216;
    border: 1px dashed #2a2a32;
    border-radius: 12px;
    padding: 24px;
    transition: border-color .15s, background .15s;
}

.hm-subj-uploader:hover {
    border-color: #3a3a44;
}

.hm-subj-uploader.dragover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, .05);
}

.hm-subj-uploader-empty {
    text-align: center;
}

.hm-subj-uploader-empty > i {
    font-size: 40px;
    color: #52525b;
    display: block;
    margin-bottom: 10px;
}

.hm-subj-uploader-empty p {
    font-size: 12.5px;
    color: #71717a;
    margin-bottom: 14px;
}

.hm-subj-uploader-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.hm-subj-upbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background: #1e1e24;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
}

.hm-subj-upbtn:hover {
    background: #2a2a32;
    color: #fff;
    border-color: #52525b;
}

.hm-subj-uploader-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.hm-subj-uploader-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0d10;
    border: 1px solid #2a2a32;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 24px;
}

.hm-subj-uploader-item img,
.hm-subj-uploader-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-subj-uploader-item .rm {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-subj-uploader-item .rm:hover {
    background: #ef4444;
}

/* 名称输入 */
.hm-subj-input-wrap {
    position: relative;
}

.hm-subj-input {
    width: 100%;
    height: 40px;
    padding: 0 60px 0 14px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}

.hm-subj-input:focus {
    border-color: #6366f1;
}

.hm-subj-input::placeholder {
    color: #52525b;
}

.hm-subj-counter {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #52525b;
    font-family: 'SF Mono', Monaco, monospace;
    pointer-events: none;
}

.hm-subj-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 14px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    transition: border-color .15s;
}

.hm-subj-textarea:focus {
    border-color: #6366f1;
}

.hm-subj-textarea::placeholder {
    color: #52525b;
}

/* 底部保存按钮 */
.hm-subj-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px 20px;
    flex-shrink: 0;
}

.hm-subj-save {
    height: 36px;
    padding: 0 28px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.hm-subj-save:hover {
    background: #4f46e5;
}

.hm-subj-save:disabled {
    background: #2a2a32;
    color: #52525b;
    cursor: not-allowed;
}

.hm-subj-btn-secondary {
    height: 36px;
    padding: 0 20px;
    background: transparent;
    border: 1px solid #33333c;
    border-radius: 8px;
    color: #d4d4d8;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s;
}

.hm-subj-btn-secondary:hover {
    background: #2a2a32;
    color: #fff;
}

/* ---------- 从资产选择的弹窗 ---------- */
.hm-subj-picker {
    position: fixed;
    inset: 0;
    z-index: 220001;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hm-subj-picker.show {
    display: flex;
}

.hm-subj-picker-dialog {
    width: 720px;
    max-width: 94vw;
    height: 80vh;
    display: flex;
    flex-direction: column;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .85);
    overflow: hidden;
}

.hm-subj-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    flex-shrink: 0;
}

.hm-subj-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    align-content: flex-start;
}

.hm-subj-picker-body::-webkit-scrollbar { width: 6px; }
.hm-subj-picker-body::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

.hm-subj-picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0d10;
    border: 1.5px solid #2a2a32;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    font-size: 24px;
    transition: all .15s;
}

.hm-subj-picker-item img,
.hm-subj-picker-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-subj-picker-item:hover {
    border-color: #6366f1;
}

.hm-subj-picker-item.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .3);
}

.hm-subj-picker-item.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.hm-subj-picker-item .name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 6px 4px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85));
    color: #fff;
    font-size: 10.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-subj-picker-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #52525b;
    font-size: 12.5px;
}

.hm-subj-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #2a2a32;
    flex-shrink: 0;
}














/* ==========================================================================
   ★★★ 画布 - 主体节点样式
   ========================================================================== */

/* 主体节点空状态 */
.cv-subject-empty {
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #121216;
    cursor: pointer;
    transition: background .15s;
}

.cv-subject-empty:hover {
    background: #16161c;
}

.cv-subject-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #71717a;
    text-align: center;
}

.cv-subject-empty-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1a20;
    border: 1px solid #2a2a32;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 4px;
}

.cv-subject-empty-text {
    font-size: 13px;
    color: #e4e4e7;
    font-weight: 500;
}

.cv-subject-empty-sub {
    font-size: 11px;
    color: #52525b;
    line-height: 1.6;
}

/* 主体节点已选择状态 */
.cv-subject-content {
    background: #121216;
    padding: 14px;
}

.cv-subject-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.cv-subject-at {
    color: #a5b4fc;
    font-size: 15px;
    font-weight: 700;
}

.cv-subject-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-subject-edit {
    font-size: 11px;
    color: #71717a;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    transition: all .15s;
    flex-shrink: 0;
}

.cv-subject-edit:hover {
    background: #2a2a32;
    color: #fff;
}

.cv-subject-desc {
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-subject-desc-empty {
    color: #52525b;
    font-style: italic;
}

/* 文件展示：单个 */
.cv-subject-files {
    border-radius: 8px;
    overflow: hidden;
    background: #0d0d10;
}

.cv-subject-cover {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: contain;
    background: #000;
}

.cv-subject-icon-file {
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #a1a1aa;
    font-size: 12px;
}

.cv-subject-icon-file i {
    font-size: 32px;
    color: #8b5cf6;
}

.cv-subject-no-files {
    padding: 20px;
    text-align: center;
    color: #52525b;
    font-size: 12px;
}

/* 文件展示：多个 */
.cv-subject-multi {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4px;
    height: 240px;
}

.cv-subject-main {
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-subject-main img,
.cv-subject-main video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-subject-main .cv-subject-icon-file {
    padding: 20px;
}

.cv-subject-thumbs {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    position: relative;
}

.cv-subject-mini {
    background: #1a1a20;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    font-size: 18px;
}

.cv-subject-mini img,
.cv-subject-mini video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-subject-more {
    position: absolute;
    right: 4px;
    bottom: 4px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* 侧边栏：文件网格 */
.cv-subject-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
    padding: 6px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
}

.cv-subject-file-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #0d0d10;
    border: 1px solid #2a2a32;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    font-size: 20px;
}

.cv-subject-file-item img,
.cv-subject-file-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-subject-file-rm {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .7);
    border: none;
    color: #fff;
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}

.cv-subject-file-item:hover .cv-subject-file-rm {
    opacity: 1;
}

.cv-subject-file-rm:hover {
    background: #ef4444;
}

/* ==========================================================================
   画布 - 主体选择弹窗
   ========================================================================== */
.cv-subject-picker {
    position: fixed;
    inset: 0;
    z-index: 150000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cv-subject-picker.show {
    display: flex;
}

.cv-subject-picker-dialog {
    width: 780px;
    max-width: 94vw;
    height: 76vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ctxIn .15s ease;
}

.cv-subject-picker-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

.cv-subject-picker-header > span {
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    white-space: nowrap;
}

.cv-subject-picker-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    max-width: 320px;
    margin-left: auto;
}

.cv-subject-picker-search i {
    color: #71717a;
    font-size: 12px;
}

.cv-subject-picker-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e4e4e7;
    font-size: 13px;
    font-family: inherit;
}

.cv-subject-picker-search input::placeholder {
    color: #52525b;
}

.cv-subject-picker-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #71717a;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}

.cv-subject-picker-close:hover {
    background: #2a2a32;
    color: #fff;
}

.cv-subject-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    align-content: flex-start;
}

.cv-subject-picker-body::-webkit-scrollbar { width: 6px; }
.cv-subject-picker-body::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

.cv-subject-picker-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.cv-subject-picker-item-thumb {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 10px;
    overflow: hidden;
    background: #0d0d10;
    border: 1.5px solid #2a2a32;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    font-size: 30px;
}

.cv-subject-picker-item-thumb img,
.cv-subject-picker-item-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-subject-picker-item:hover .cv-subject-picker-item-thumb {
    border-color: #6366f1;
}

.cv-subject-picker-item.selected .cv-subject-picker-item-thumb {
    border-color: #e4e4e7;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}

.cv-subject-picker-item.selected .cv-subject-picker-item-thumb::after {
    content: '✓';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e4e4e7;
    color: #121212;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-subject-picker-item-name {
    font-size: 12.5px;
    color: #e4e4e7;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-subject-picker-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #52525b;
    font-size: 13px;
    line-height: 1.8;
}

.cv-subject-picker-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: .4;
}

.cv-subject-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #2a2a32;
    flex-shrink: 0;
}

.cv-subject-picker-info {
    font-size: 13px;
    color: #a1a1aa;
}

.cv-subject-picker-info strong {
    color: #a5b4fc;
    font-weight: 600;
}

.cv-subject-picker-confirm {
    height: 36px;
    padding: 0 28px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.cv-subject-picker-confirm:hover {
    background: #4f46e5;
}

.cv-subject-picker-confirm:disabled {
    background: #2a2a32;
    color: #52525b;
    cursor: not-allowed;
}












/* ==========================================================================
   ★★★ 会话页输入区 - 下拉菜单向上弹出（避免被底部裁切）
   仅作用于 .hm-chat-composer 作用域内，首页创作区不受影响
   ========================================================================== */

/* 1. 模型/分类/参数 下拉菜单 —— 向上弹出 */
.hm-chat-composer .hm-dropdown-menu {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 380px !important; /* 高度稍小一点，避免占满整个屏幕 */
}

/* 2. 参数面板（即梦AI风格的宽面板）—— 向上弹出，同时限制宽高 */
.hm-chat-composer .hm-params-panel {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 420px !important;
    overflow-y: auto !important;
}

/* 3. @ 引用弹出菜单 —— 向上弹出 */
.hm-chat-composer .hm-mention-popup {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 340px !important;
}

/* 4. 会话页专用：让底部输入区的下拉在触发时不被 overflow 裁切 */
.hm-chat-composer {
    overflow: visible !important;
}
.hm-chat-composer .hm-composer-bar,
.hm-chat-composer .hm-composer-settings,
.hm-chat-composer .hm-dropdown-wrap {
    overflow: visible !important;
}


/* ==========================================================================
   ★★★ 输入区附件区（统一版：斜转层叠 + 悬浮展开 + hover 放大预览）
   作用于：首页创作区 / 会话区 / 未来任何使用 .hm-composer-upload 的地方
   ========================================================================== */

/* ---------- 1. 容器：固定小方块，不挤压输入框 ---------- */
.hm-composer-upload {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    overflow: visible;
    z-index: 30;
}

/* ---------- 2. + 号按钮：空状态铺满整块，斜转 ---------- */
.hm-upload-box {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    background: #1f1f24;
    border: 1px dashed #3a3a44;
    color: #71717a;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transform: rotate(-6deg);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1),
                background-color .2s ease,
                border-color .2s ease,
                color .2s ease,
                box-shadow .2s ease;
    z-index: 20;
}

/* 空状态 hover：转正 */
.hm-composer-upload:not(.has-files):hover .hm-upload-box {
    transform: rotate(0deg);
    border-color: #6366f1;
    color: #a5b4fc;
    background: #232329;
}

.hm-upload-box i {
    font-size: 16px;
    transition: font-size .25s;
}

.hm-upload-box span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    transition: opacity .2s;
}

/* ---------- 3. 缩略图容器 ---------- */
.hm-upload-thumbs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    max-width: none;
    overflow: visible;
    pointer-events: none;
    display: block;
    transition: none;
}

/* ---------- 4. 单张缩略图：居中 + 层叠 ---------- */
.hm-upload-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;   /* ★ 用 margin 居中，不依赖 transform */
    border-radius: 8px;
    background: #121216;
    border: 2px solid #0a0a0a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    z-index: calc(100 - var(--i, 0));
    transform:
        translate(calc(var(--i, 0) * 1.6px),
                  calc(var(--i, 0) * 1.6px))
        rotate(calc(-8deg + var(--i, 0) * 3.5deg));
    transition:
        transform .35s cubic-bezier(.4, 0, .2, 1),
        box-shadow .2s ease,
        border-color .2s ease;
    will-change: transform;
}

/* 每张的层叠索引 */
.hm-upload-thumb:nth-child(1) { --i: 0; }
.hm-upload-thumb:nth-child(2) { --i: 1; }
.hm-upload-thumb:nth-child(3) { --i: 2; }
.hm-upload-thumb:nth-child(4) { --i: 3; }
.hm-upload-thumb:nth-child(5) { --i: 4; }
.hm-upload-thumb:nth-child(6) { --i: 5; }
.hm-upload-thumb:nth-child(7) { --i: 6; }
.hm-upload-thumb:nth-child(8) { --i: 7; }
.hm-upload-thumb:nth-child(9) { --i: 8; }
.hm-upload-thumb:nth-child(10) { --i: 9; }

/* ---------- 5. 有附件时：+ 号缩到右下角小蓝点 ---------- */
.hm-composer-upload.has-files .hm-upload-box {
    inset: auto -4px -4px auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: #6366f1;
    border: 2px solid #0a0a0a;
    color: #fff;
    transform: none;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
    gap: 0;
}

.hm-composer-upload.has-files .hm-upload-box span {
    display: none;
}

.hm-composer-upload.has-files .hm-upload-box i {
    font-size: 11px;
    color: #fff;
}

/* ---------- 6. ★ hover 展开：缩略图横向排列 + + 号跟队 ---------- */

/* 6.1 缩略图展开：横向排开、全部转正、浮在容器上方 */
.hm-composer-upload.has-files:hover .hm-upload-thumb {
    transform:
        translate(calc(-22px + var(--i, 0) * 62px),
                  -64px)
        rotate(0deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
    border-color: rgba(255, 255, 255, .15);
}

/* 6.2 + 号也浮到队列末尾（第 total 个位置） */
.hm-composer-upload.has-files:hover .hm-upload-box {
    inset: auto;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    padding: 0;
    border-radius: 8px;
    background: #1f1f24;
    border: 1px dashed #3a3a44;
    color: #71717a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transform: translate(calc(-22px + var(--total, 0) * 62px), -64px) rotate(0deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
    z-index: 200;
}

.hm-composer-upload.has-files:hover .hm-upload-box i {
    font-size: 16px;
    color: #71717a;
}

.hm-composer-upload.has-files:hover .hm-upload-box span {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: #71717a;
    line-height: 1;
}

.hm-composer-upload.has-files:hover .hm-upload-box:hover {
    background: #2a2a32;
    border-color: #6366f1;
    color: #a5b4fc;
}

.hm-composer-upload.has-files:hover .hm-upload-box:hover i,
.hm-composer-upload.has-files:hover .hm-upload-box:hover span {
    color: #a5b4fc;
}

/* ---------- 7. ★ 单张 hover：放大预览 ---------- */
.hm-composer-upload.has-files:hover .hm-upload-thumb:hover {
    transform:
        translate(calc(-22px + var(--i, 0) * 62px),
                  -84px)
        rotate(0deg)
        scale(1.5);
    box-shadow:
        0 24px 60px rgba(99, 102, 241, .55),
        0 0 0 3px rgba(99, 102, 241, .85),
        0 0 32px rgba(99, 102, 241, .4);
    border-color: #818cf8;
    z-index: 500;
}

/* ---------- 8. 缩略图内容 ---------- */
.hm-upload-thumb img,
.hm-upload-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.hm-upload-thumb .thumb-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #8b5cf6;
}

/* 删除按钮 */
.hm-upload-thumb .remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all .15s;
    z-index: 10;
}

/* 展开状态才显示删除按钮，避免折叠时干扰 */
.hm-composer-upload.has-files:hover .hm-upload-thumb .remove-btn {
    opacity: 1;
}

.hm-upload-thumb .remove-btn:hover {
    background: #ef4444;
    transform: scale(1.15);
}

/* 引用角标 */
.hm-upload-thumb .ref-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: rgba(0, 0, 0, .7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    pointer-events: none;
    z-index: 5;
}

/* ---------- 9. 会话区滚动收缩状态：等比缩小 ---------- */
.hm-chat-container.scrolled .hm-composer-upload {
    width: 52px;
    height: 52px;
}

.hm-chat-container.scrolled .hm-upload-thumb {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
}

.hm-chat-container.scrolled .hm-composer-upload.has-files:hover .hm-upload-thumb {
    transform:
        translate(calc(-18px + var(--i, 0) * 50px),
                  -54px)
        rotate(0deg);
}

.hm-chat-container.scrolled .hm-composer-upload.has-files:hover .hm-upload-box {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    transform: translate(calc(-18px + var(--total, 0) * 50px), -54px) rotate(0deg);
}

/* ---------- 10. 输入框最大高度 ---------- */
.hm-composer-input {
    max-height: 300px !important;
}

.hm-chat-container.scrolled .hm-chat-composer .hm-composer-input {
    max-height: 300px !important;
}

.cv-prompt-wrap .cv-prompt-textarea {
    max-height: 420px !important;
}






/* ==========================================================================
   ★★★ 会话记录区 - 使用提示词按钮 + 开放文本选择复制
   ========================================================================== */

/* ---------- 1. 允许会话内容区的文字被选中复制 ---------- */
.hm-chat-messages,
.hm-chat-messages * {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* 例外：按钮、缩略图、结果图不参与文本选择，避免误选 */
.hm-chat-messages .action-btn,
.hm-chat-messages .hm-chat-record-use-prompt,
.hm-chat-messages .result-item,
.hm-chat-messages .ref-thumb,
.hm-chat-messages .hm-chat-more-menu,
.hm-chat-messages img,
.hm-chat-messages video,
.hm-chat-messages audio {
    user-select: none !important;
    -webkit-user-select: none !important;
}






/* ==========================================================================
   ★★★ 会话记录 - 提示词 2行截断 + hover 展开滚动
   ★★★ 会话记录 - AI 文本回复最大高度 + 内部滚动
   ========================================================================== */

/* ---------- 1. 提示词：默认 2 行截断，hover 展开并滚动 ---------- */
.hm-chat-record-prompt-text {
    position: relative;
    max-height: 3.3em;                 /* ★ 2 行高度（行高 1.65 × 2） */
    overflow: hidden;                   /* 截断超出的行 */
    padding-right: 118px;              /* 给"使用提示词"按钮预留位置 */
    transition: max-height .28s cubic-bezier(.4, 0, .2, 1),
                padding-right .2s ease;
    cursor: default;
}

/* hover 时展开：最大高度 420px，超出滚动 */
.hm-chat-record-prompt-text:hover {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 118px;
}

/* 提示词文字：不再用 line-clamp，靠 max-height 控制 */
.hm-chat-record-prompt-text .prompt-preview {
    display: block;
    line-height: 1.65;
    font-size: 13.5px;
    color: #d4d4d8;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-box-orient: unset;
    overflow: visible;
}

/* 提示词内容的滚动条（hover 展开后） */
.hm-chat-record-prompt-text::-webkit-scrollbar {
    width: 6px;
}
.hm-chat-record-prompt-text::-webkit-scrollbar-track {
    background: transparent;
}
.hm-chat-record-prompt-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
.hm-chat-record-prompt-text::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
.hm-chat-record-prompt-text {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* 提示词区 hover 时轻微高亮背景（可选，视觉反馈） */
.hm-chat-record-prompt-text:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

/* ★ 保证"使用提示词"按钮 hover 时始终显示在右上角 */
.hm-chat-record-use-prompt {
    position: absolute;
    right: 0;
    top: 4px;                          /* 改为固定顶部，跟着展开的框走 */
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
    font-family: inherit;
}

.hm-chat-record-prompt-text:hover .hm-chat-record-use-prompt {
    opacity: 1;
    pointer-events: auto;
}

.hm-chat-record-use-prompt:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(99, 102, 241, .6);
}

.hm-chat-record-use-prompt:active {
    transform: scale(0.96);
}

.hm-chat-record-use-prompt i {
    font-size: 11px;
}

/* ---------- 2. AI 文本回复：最大高度 480px + 内部滚动 ---------- */
.hm-chat-record-text-result {
    max-height: 480px !important;      /* ★ 超过 480px 就内部滚动 */
    overflow-y: auto !important;
    padding-right: 20px;                /* 给滚动条留出空间 */
    position: relative;
}

/* AI 回复内容的滚动条（即梦风格） */
.hm-chat-record-text-result::-webkit-scrollbar {
    width: 8px;
}
.hm-chat-record-text-result::-webkit-scrollbar-track {
    background: transparent;
}
.hm-chat-record-text-result::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.hm-chat-record-text-result::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    background-clip: content-box;
}

/* Firefox */
.hm-chat-record-text-result {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ★ 底部渐隐提示：内容超出时显示"还有更多"的视觉暗示 */
.hm-chat-record-text-result::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 32px;
    margin-top: -32px;
    background: linear-gradient(180deg, transparent, rgba(22, 22, 22, 0.9));
    pointer-events: none;
}

/* ---------- 3. 让会话区文本仍可选中复制 ---------- */
.hm-chat-record-prompt-text,
.hm-chat-record-prompt-text .prompt-preview,
.hm-chat-record-text-result {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* 按钮、图片不参与选中 */
.hm-chat-record-use-prompt,
.hm-chat-record-prompt-text img {
    user-select: none !important;
    -webkit-user-select: none !important;
}






/* ==========================================================================
   ★★★ 置顶状态的视觉标识
   ========================================================================== */

/* 对话置顶项：左上角一个小图钉 */
#hmChatList .hm-list-item[data-pinned="1"] .hm-list-name::before {
    content: '📌';
    margin-right: 4px;
    font-size: 11px;
    opacity: 0.8;
}

/* 画布置顶项：同样显示图钉 */
#hmCanvasList .hm-list-item[data-pinned="1"] .hm-list-name::before {
    content: '📌';
    margin-right: 4px;
    font-size: 11px;
    opacity: 0.8;
}













/* 画布 AI 面板的下拉向上弹 */
#cvAiChatPanel .hm-dropdown-menu {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 380px !important;
}
#cvAiChatPanel .hm-params-panel {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 420px !important;
    overflow-y: auto !important;
}
#cvAiChatPanel .hm-skill-popup,
#cvAiChatPanel .hm-mention-popup {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    max-height: 340px !important;
}









/* ==========================================================================
   生成历史卡片 - 复用画布卡片的选择/收藏/更多操作样式
   ========================================================================== */
   #hmHistoryGrid .hm-content-card {
    position: relative;
    aspect-ratio: 16/10;
    border-radius: 10px;
    overflow: hidden;
    background: #161616;
    border: 1px solid #232323;
    cursor: pointer;
    transition: all .2s;
}
#hmHistoryGrid .hm-content-card:hover {
    border-color: #3a3a44;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

#hmHistoryGrid .hm-content-card .history-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .85) 100%);
    z-index: 1;
    pointer-events: none;
}

#hmHistoryGrid .hm-content-card .history-card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 2;
}
#hmHistoryGrid .hm-content-card .history-card-title {
    font-size: 13px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* 复选框 */
#hmHistoryGrid .hm-content-card .history-card-check {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 10;
    width: 18px; height: 18px;
    border: 1.5px solid rgba(255, 255, 255, .6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, .4);
    transition: all .15s;
}
#hmHistoryGrid .hm-content-card .history-card-check:hover {
    border-color: #fff;
}
#hmHistoryGrid .hm-content-card.selected {
    border: 1.5px solid #e4e4e7;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .2);
}
#hmHistoryGrid .hm-content-card.selected .history-card-check {
    background: #e4e4e7;
    border-color: #e4e4e7;
}
#hmHistoryGrid .hm-content-card.selected .history-card-check::after {
    content: '✓';
    color: #121212;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* 收藏按钮 */
#hmHistoryGrid .hm-content-card .history-card-fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 5;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    background: rgba(0, 0, 0, .4);
    border-radius: 50%;
    width: 26px; height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: none;
    transition: all .15s;
}
#hmHistoryGrid .hm-content-card:hover .history-card-fav-btn,
#hmHistoryGrid .hm-content-card .history-card-fav-btn.active {
    display: flex;
}
#hmHistoryGrid .hm-content-card .history-card-fav-btn:hover {
    background: rgba(0, 0, 0, .7);
    transform: scale(1.1);
}

/* 更多按钮 */
#hmHistoryGrid .hm-content-card .history-card-more {
    display: none;
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    backdrop-filter: blur(4px);
    transition: all .15s;
    flex-shrink: 0;
}
#hmHistoryGrid .hm-content-card:hover .history-card-more {
    display: flex;
}
#hmHistoryGrid .hm-content-card .history-card-more:hover {
    background: #6366f1;
}














/* ==========================================================================
   ★★★ 关系图 - 节点样式
   ========================================================================== */
   .cv-relation-node-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 140px;
    color: #52525b;
    font-size: 12px;
    gap: 6px;
    background: #121216;
}
.cv-relation-node-empty i {
    font-size: 28px;
    color: #f59e0b;
    opacity: .6;
}
.cv-relation-node-empty .hint {
    font-size: 10px;
    color: #3f3f46;
}

.cv-relation-node {
    background: #121216;
    display: flex;
    flex-direction: column;
}
.cv-relation-mini-svg {
    width: 100%;
    aspect-ratio: 340 / 200;   /* ★ 从 180 改成 200，和 viewBox 匹配 */
    background: #0d0d10;
}
.cv-relation-mini-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}
.cv-relation-node-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-top: 1px solid #2a2a32;
    font-size: 11.5px;
    color: #a1a1aa;
}
.cv-relation-node-stats i {
    color: #f59e0b;
    margin-right: 3px;
}
.cv-relation-node-stats .hint {
    margin-left: auto;
    font-size: 10.5px;
    color: #52525b;
}

/* ==========================================================================
   ★★★ 关系图 - 右侧面板
   ========================================================================== */
.cv-relation-panel {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: 640px;
    max-width: 100vw;
    background: #15151a;
    border-left: 1px solid #2a2a32;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), width .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, .5);
}
.cv-relation-panel.show {
    transform: translateX(0);
}
.cv-relation-panel.fullscreen {
    width: 100vw;
}

.cv-relation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 12px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
    background: #18181c;
}
.cv-relation-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    min-width: 0;
    overflow: hidden;
}
.cv-relation-title i {
    color: #f59e0b;
    flex-shrink: 0;
}
.cv-relation-title span:first-of-type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cv-relation-stats {
    font-size: 11.5px;
    color: #71717a;
    padding: 2px 8px;
    background: #232329;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: 400;
}
.cv-relation-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.cv-relation-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all .15s;
}
.cv-relation-action-btn:hover {
    background: #2a2a32;
    color: #fff;
}

.cv-relation-main {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}
.cv-relation-chart-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
    background: #0d0d10;
}
#cvRelationChart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.cv-relation-edit-wrap {
    width: 500px;
    display: none;
    flex-direction: column;
    border-left: 1px solid #2a2a32;
    background: #131318;
    overflow: hidden;
}
.cv-relation-panel.fullscreen .cv-relation-edit-wrap {
    display: flex;
}

.cv-relation-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 42px;
    padding: 0 10px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
    background: #18181c;
}
.cv-relation-tab {
    height: 30px;
    padding: 0 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #71717a;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.cv-relation-tab:hover {
    color: #a1a1aa;
    background: #232329;
}
.cv-relation-tab.active {
    color: #fff;
    background: rgba(245, 158, 11, .15);
}
.cv-relation-tab-spacer {
    flex: 1;
}
.cv-relation-tab-btn {
    width: 30px;
    height: 30px;
    background: rgba(245, 158, 11, .15);
    border: 1px solid rgba(245, 158, 11, .4);
    border-radius: 6px;
    color: #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all .15s;
}
.cv-relation-tab-btn:hover {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.cv-relation-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.cv-relation-tab-content::-webkit-scrollbar { width: 6px; }
.cv-relation-tab-content::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

/* 表格 */
.cv-rel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.cv-rel-table thead th {
    padding: 8px 6px;
    text-align: left;
    color: #71717a;
    font-weight: 500;
    font-size: 11.5px;
    border-bottom: 1px solid #2a2a32;
    position: sticky;
    top: 0;
    background: #131318;
    z-index: 1;
}
.cv-rel-table tbody tr {
    border-bottom: 1px solid #1f1f26;
}
.cv-rel-table tbody tr:hover {
    background: #1a1a20;
}
.cv-rel-table td {
    padding: 6px;
    vertical-align: top;
}
.cv-rel-td-avatar {
    vertical-align: middle !important;
}
.cv-rel-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #2a2a32;
    transition: all .15s;
    display: block;
}
.cv-rel-avatar:hover {
    border-color: #f59e0b;
    transform: scale(1.05);
}
.cv-rel-input,
.cv-rel-textarea,
.cv-rel-select {
    width: 100%;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 5px;
    color: #e4e4e7;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}
.cv-rel-input:focus,
.cv-rel-textarea:focus,
.cv-rel-select:focus {
    border-color: #f59e0b;
}
.cv-rel-textarea {
    min-height: 60px;
    resize: vertical;
    line-height: 1.5;
}
.cv-rel-select {
    cursor: pointer;
}
.cv-rel-del-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #71717a;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.cv-rel-del-btn:hover {
    background: #7f1d1d;
    color: #fecaca;
}

.cv-rel-empty {
    padding: 60px 20px;
    text-align: center;
    color: #52525b;
    font-size: 12.5px;
    line-height: 1.8;
}
.cv-rel-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: .4;
}
.cv-rel-add-btn {
    margin-top: 12px;
    height: 32px;
    padding: 0 16px;
    background: #232329;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.cv-rel-add-btn.primary {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.cv-rel-add-btn:hover {
    filter: brightness(1.15);
}

/* 面板底部 */
.cv-relation-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #2a2a32;
    background: #18181c;
    flex-shrink: 0;
}
.cv-relation-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background: #232329;
    border: 1px solid #2a2a32;
    border-radius: 7px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.cv-relation-btn:hover {
    background: #2f2f38;
    color: #fff;
    border-color: #52525b;
}
.cv-relation-btn.icon-only {
    width: 32px;
    padding: 0;
    justify-content: center;
    margin-left: auto;
}
.cv-relation-btn i {
    font-size: 11.5px;
}

/* 主体选择器 */
.cv-rel-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: rgba(0, 0, 0, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.cv-rel-selector-dialog {
    width: 720px;
    max-width: 92vw;
    max-height: 80vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .85);
}
.cv-rel-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2a32;
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 600;
}
.cv-rel-selector-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #71717a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.cv-rel-selector-close:hover {
    background: #2a2a32;
    color: #fff;
}
.cv-rel-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    align-content: flex-start;
}
.cv-rel-selector-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    border: 1.5px solid #2a2a32;
    background: #121216;
    cursor: pointer;
    transition: all .15s;
}
.cv-rel-selector-item:hover {
    border-color: #f59e0b;
}
.cv-rel-selector-item.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, .1);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .3);
}
.cv-rel-selector-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #0d0d10;
}
.cv-rel-selector-item .name {
    font-size: 12px;
    color: #e4e4e7;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cv-rel-selector-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #2a2a32;
}
.cv-rel-selector-cancel,
.cv-rel-selector-confirm {
    height: 32px;
    padding: 0 18px;
    border-radius: 7px;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    border: none;
}
.cv-rel-selector-cancel {
    background: #232329;
    color: #d4d4d8;
    border: 1px solid #2a2a32;
}
.cv-rel-selector-cancel:hover {
    background: #2f2f38;
    color: #fff;
}
.cv-rel-selector-confirm {
    background: #f59e0b;
    color: #fff;
}
.cv-rel-selector-confirm:hover {
    filter: brightness(1.15);
}

/* ==========================================================================
   ★★★ 关系图 v2 - 人物库 / 详情 / 头像菜单 / 图片选择器
   ========================================================================== */

/* 描述框 wrapper（用来放右上角小图标） */
.cv-rel-desc-wrap {
    position: relative;
    width: 100%;
}
.cv-rel-desc-wrap textarea {
    padding-right: 56px !important;
    min-height: 68px !important;
}
.cv-rel-desc-actions {
    position: absolute;
    top: 4px;
    right: 6px;
    display: flex;
    gap: 2px;
    z-index: 2;
}
.cv-rel-act-btn {
    width: 22px;
    height: 22px;
    border: 1px solid #2a2a32;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    color: #a1a1aa;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    padding: 0;
}
.cv-rel-act-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

/* 备注按钮 */
.cv-rel-note-btn {
    width: 100%;
    height: 26px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 5px;
    color: #71717a;
    font-size: 11.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    transition: all .15s;
    font-family: inherit;
}
.cv-rel-note-btn:hover {
    background: #1e1e24;
    border-color: #f59e0b;
    color: #f59e0b;
}
.cv-rel-note-btn.has-content {
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, .4);
    background: rgba(99, 102, 241, .08);
}
.cv-rel-note-btn.has-content:hover {
    background: rgba(99, 102, 241, .2);
    color: #c7d2fe;
    border-color: #6366f1;
}

/* 头像悬浮菜单 */
.cv-rel-avatar-menu {
    position: fixed;
    z-index: 200005;
    background: #1e1e24;
    border: 1px solid #33333c;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .8);
    padding: 6px;
    min-width: 160px;
    animation: ctxIn .1s ease;
}
.cv-rel-avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
}
.cv-rel-avatar-menu-item:hover {
    background: #2a2a32;
    color: #fff;
}
.cv-rel-avatar-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: #a1a1aa;
}
.cv-rel-avatar-menu-item:hover i {
    color: #f59e0b;
}
.cv-rel-avatar-menu-item.danger {
    color: #fca5a5;
}
.cv-rel-avatar-menu-item.danger:hover {
    background: #7f1d1d;
    color: #fff;
}
.cv-rel-avatar-menu-item.danger i {
    color: #fca5a5;
}
.cv-rel-avatar-menu-sep {
    height: 1px;
    background: #2a2a32;
    margin: 4px 0;
}

/* 通用图片选择器 */
.cv-rel-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 200010;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ctxIn .15s ease;
}
.cv-rel-picker-dialog {
    width: 720px;
    max-width: 92vw;
    max-height: 80vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .85);
}
.cv-rel-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2a32;
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 600;
}
.cv-rel-picker-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #71717a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.cv-rel-picker-close:hover {
    background: #2a2a32;
    color: #fff;
}
.cv-rel-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    align-content: flex-start;
}
.cv-rel-picker-body::-webkit-scrollbar { width: 6px; }
.cv-rel-picker-body::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }
.cv-rel-picker-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 8px;
    border: 1.5px solid #2a2a32;
    background: #121216;
    cursor: pointer;
    transition: all .15s;
}
.cv-rel-picker-item:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
}
.cv-rel-picker-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #0d0d10;
    display: block;
}
.cv-rel-picker-item .name {
    font-size: 11.5px;
    color: #a1a1aa;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 人物详情 / 关系备注编辑器 */
.cv-rel-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 200020;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ctxIn .15s ease;
}
.cv-rel-detail-dialog {
    width: 640px;
    max-width: 92vw;
    max-height: 80vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .9);
}
.cv-rel-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}
.cv-rel-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
}
.cv-rel-detail-title i {
    color: #f59e0b;
    flex-shrink: 0;
}
.cv-rel-detail-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cv-rel-detail-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #71717a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.cv-rel-detail-close:hover {
    background: #2a2a32;
    color: #fff;
}
.cv-rel-detail-body {
    flex: 1;
    padding: 16px 20px;
    overflow: hidden;
    display: flex;
}
.cv-rel-detail-textarea {
    width: 100%;
    min-height: 320px;
    max-height: 60vh;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    padding: 14px 16px;
    color: #e4e4e7;
    font-size: 14px;
    line-height: 1.75;
    outline: none;
    font-family: inherit;
    resize: vertical;
    transition: border-color .15s;
}
.cv-rel-detail-textarea:focus {
    border-color: #f59e0b;
}
.cv-rel-detail-textarea[readonly] {
    background: #0d0d10;
    cursor: default;
    color: #d4d4d8;
}
.cv-rel-detail-textarea::-webkit-scrollbar { width: 6px; }
.cv-rel-detail-textarea::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }
.cv-rel-detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #2a2a32;
    flex-shrink: 0;
}
.cv-rel-detail-btn {
    height: 34px;
    padding: 0 20px;
    border-radius: 7px;
    border: 1px solid #2a2a32;
    background: #232329;
    color: #d4d4d8;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.cv-rel-detail-btn:hover {
    background: #2f2f38;
    color: #fff;
}
.cv-rel-detail-btn.primary {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.cv-rel-detail-btn.primary:hover {
    filter: brightness(1.1);
}

/* ==========================================================================
   关系图人物库 - 列表样式优化
   ========================================================================== */

/* 1. 取消原有的悬浮包裹层，让 textarea 占满单元格 */
.cv-rel-desc-wrap {
    position: relative;
    width: 100%;
    display: block !important; /* 覆盖之前的可能存在的 flex */
}
.cv-rel-desc-wrap textarea {
    padding-right: 8px !important; /* 恢复原本的右侧间距 */
    min-height: 68px !important;
}

/* 隐藏原有的悬浮操作层 */
.cv-rel-desc-actions {
    display: none !important;
}

/* 2. 右侧操作列：纵向排列按钮 */
.cv-rel-td-actions {
    vertical-align: middle !important;
    text-align: center;
}

.cv-rel-action-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 调整操作按钮的尺寸，让其紧凑 */
.cv-rel-action-stack .cv-rel-act-btn,
.cv-rel-action-stack .cv-rel-del-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #2a2a32;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    color: #a1a1aa;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    padding: 0;
}

.cv-rel-action-stack .cv-rel-act-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.cv-rel-action-stack .cv-rel-del-btn {
    background: transparent;
}

.cv-rel-action-stack .cv-rel-del-btn:hover {
    background: #7f1d1d;
    border-color: #ef4444;
    color: #fecaca;
}

/* ==========================================================================
   文本域滚动条美化（即梦风格）
   ========================================================================== */

/* Webkit (Chrome, Edge, Safari) */
.cv-rel-textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.cv-rel-textarea::-webkit-scrollbar-track {
    background: transparent;
}
.cv-rel-textarea::-webkit-scrollbar-thumb {
    background: #33333c;
    border-radius: 4px;
    border: 1px solid #121216; /* 增加一点内边距视觉效果 */
}
.cv-rel-textarea::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Firefox */
.cv-rel-textarea {
    scrollbar-width: thin;
    scrollbar-color: #33333c transparent;
}










/* ==========================================================================
   ★★★ 用户栏 & 弹窗（全新深色主题）
   ========================================================================== */

/* ---------- 顶部用户栏 ---------- */
.ua-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 4px;
    background: rgba(15, 15, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ua-guest {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ua-btn-login {
    height: 32px;
    padding: 0 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.ua-btn-login:hover { filter: brightness(1.1); transform: translateY(-1px); }

.ua-btn-register {
    height: 32px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    color: #d4d4d8;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.ua-btn-register:hover { background: rgba(255,255,255,0.06); color: #fff; }

.ua-logged {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 用户胶囊 */
.ua-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px 0 4px;
    background: transparent;
    border-radius: 17px;
    cursor: pointer;
    transition: background .15s;
}
.ua-pill:hover { background: rgba(255,255,255,0.06); }

.ua-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.ua-name {
    font-size: 13px;
    color: #e4e4e7;
    font-weight: 500;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ua-vip-tag {
    font-size: 10px;
    color: #fff;
    padding: 2px 7px;
    border-radius: 6px;
    background: #10b981;
    font-weight: 500;
    flex-shrink: 0;
}
.ua-arrow {
    font-size: 9px;
    color: #71717a;
    flex-shrink: 0;
    transition: transform .2s;
}
.ua-menu.show ~ .ua-pill .ua-arrow,
.ua-pill.active .ua-arrow { transform: rotate(180deg); }

/* 积分 / 提现 胶囊 */
.ua-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 14px;
    background: transparent;
    border: none;
    border-radius: 16px;
    color: #d4d4d8;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.ua-chip i { font-size: 12px; color: #f59e0b; }
.ua-chip strong {
    color: #fbbf24;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}
.ua-chip:hover { background: rgba(255,255,255,0.06); color: #fff; }

.ua-chip-wd {
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f59e0b;
}
.ua-chip-wd i { color: #f59e0b; }
.ua-chip-wd:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #fbbf24;
}

/* ---------- 用户下拉菜单 ---------- */
.ua-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #1a1a20;
    border: 1px solid #2f2f38;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .18s cubic-bezier(.4,0,.2,1);
    z-index: 350000;
}
.ua-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ua-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.ua-menu-head:hover { background: rgba(255,255,255,0.04); }

.ua-menu-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.ua-menu-info { flex: 1; min-width: 0; }
.ua-menu-name {
    font-size: 13.5px;
    color: #e4e4e7;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ua-menu-tier {
    font-size: 11px;
    color: #71717a;
    margin-top: 2px;
}
.ua-menu-sep {
    height: 1px;
    background: #2a2a32;
    margin: 6px 4px;
}
.ua-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
}
.ua-menu-item:hover { background: #232329; color: #fff; }
.ua-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 12.5px;
    color: #a1a1aa;
}
.ua-menu-item:hover i { color: #a5b4fc; }
.ua-menu-danger { color: #fca5a5; }
.ua-menu-danger:hover { background: #7f1d1d; color: #fff; }
.ua-menu-danger:hover i { color: #fff; }

/* ==========================================================================
   ★★★ 弹窗（登录/注册/充值/提现/个人中心）
   ========================================================================== */
.ua-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400000;
    animation: uaFadeIn .16s ease;
}
@keyframes uaFadeIn { from { opacity: 0; } }

.ua-dialog {
    background: #1a1a20;
    border: 1px solid #2f2f38;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: uaScaleIn .2s cubic-bezier(.4,0,.2,1);
}
@keyframes uaScaleIn {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ua-dialog-auth     { width: 440px; max-width: 92vw; }
.ua-dialog-pay      { width: 520px; max-width: 92vw; }
.ua-dialog-withdraw { width: 480px; max-width: 92vw; }
.ua-dialog-center   { width: 460px; max-width: 92vw; }

.ua-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}
.ua-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #e4e4e7;
    font-weight: 600;
}
.ua-title i { color: #8b5cf6; }
.ua-close {
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #71717a;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.ua-close:hover { background: #2a2a32; color: #fff; }

.ua-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}
.ua-tab {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: #71717a;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: color .15s;
}
.ua-tab:hover { color: #a1a1aa; }
.ua-tab.active { color: #fff; font-weight: 500; }
.ua-tab.active::after {
    content: '';
    position: absolute;
    left: 20%; right: 20%; bottom: -1px;
    height: 2px;
    background: #6366f1;
    border-radius: 1px;
}

.ua-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: 70vh;
}

.ua-field { display: flex; flex-direction: column; gap: 6px; }
.ua-field > label {
    font-size: 12.5px;
    color: #a1a1aa;
    font-weight: 500;
}
.ua-field input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: #121216;
    border: 1px solid #2f2f38;
    border-radius: 10px;
    color: #e4e4e7;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}
.ua-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.ua-field input::placeholder { color: #52525b; }

.ua-captcha-row { display: flex; gap: 10px; align-items: center; }
.ua-captcha-row input { flex: 1; }
.ua-captcha-row img {
    height: 42px;
    min-width: 120px;
    border-radius: 10px;
    background: #0f0f12;
    cursor: pointer;
    border: 1px solid #2f2f38;
    display: block;
}

.ua-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #a5b4fc;
    padding: 9px 12px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 8px;
    line-height: 1.5;
}
.ua-tip i { flex-shrink: 0; color: #818cf8; }

.ua-tip-line { font-size: 12px; color: #71717a; line-height: 1.6; }
.ua-tip-line b { color: #fbbf24; font-weight: 600; }

.ua-btn-primary {
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}
.ua-btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.ua-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.ua-btn-secondary {
    height: 44px;
    background: #232329;
    border: 1px solid #2f2f38;
    border-radius: 10px;
    color: #d4d4d8;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.ua-btn-secondary:hover { background: #2f2f38; color: #fff; }

.ua-msg {
    font-size: 12.5px;
    text-align: center;
    line-height: 1.6;
    min-height: 18px;
    color: #a1a1aa;
}

/* 充值 */
.ua-goods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.ua-goods {
    padding: 16px 8px;
    background: #121216;
    border: 1.5px solid #2f2f38;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}
.ua-goods:hover { border-color: #52525b; }
.ua-goods.active {
    border-color: #6366f1;
    background: rgba(99,102,241,0.1);
}
.ua-goods-t { font-size: 17px; color: #e4e4e7; font-weight: 600; margin-bottom: 4px; }
.ua-goods-s { font-size: 11.5px; color: #71717a; }
.ua-goods.active .ua-goods-s { color: #a5b4fc; }

.ua-pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ua-pay {
    height: 46px;
    background: #121216;
    border: 1.5px solid #2f2f38;
    border-radius: 10px;
    color: #a1a1aa;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .15s;
}
.ua-pay i { font-size: 17px; }
.ua-pay:hover { border-color: #52525b; color: #e4e4e7; }
.ua-pay.active {
    border-color: #6366f1;
    background: rgba(99,102,241,0.1);
    color: #a5b4fc;
}

.ua-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.ua-pay-qr { text-align: center; }
.ua-qr-frame {
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    position: relative;
}
.ua-qr-frame iframe {
    width: 100%;
    height: calc(100% + 300px);
    border: none;
    margin-top: -180px;
}
.ua-qr-tip { margin-top: 10px; font-size: 12.5px; color: #a1a1aa; }

/* 提现 */
.ua-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 12px;
}
.ua-balance-label { font-size: 12.5px; color: #a1a1aa; }
.ua-balance-value {
    font-size: 24px;
    color: #a5b4fc;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, monospace;
}

/* 个人中心 */
.ua-center-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #121216;
    border-radius: 12px;
}
.ua-center-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}
.ua-center-info { flex: 1; min-width: 0; }
.ua-center-name {
    font-size: 15px;
    color: #e4e4e7;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ua-center-tier { font-size: 12px; margin-top: 3px; }
.ua-center-points { text-align: right; }
.ua-center-points-num {
    font-size: 22px;
    color: #fbbf24;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, monospace;
}
.ua-center-points-label { font-size: 11px; color: #71717a; }

.ua-center-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ua-center-btn {
    height: 44px;
    background: #121216;
    border: 1px solid #2f2f38;
    border-radius: 10px;
    color: #d4d4d8;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s;
}
.ua-center-btn:hover {
    background: #232329;
    border-color: #6366f1;
    color: #a5b4fc;
}

.ua-center-section {
    padding: 14px 16px;
    background: #121216;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ua-center-label {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 2px;
}
.ua-center-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #a1a1aa;
}
.ua-center-row b { color: #e4e4e7; font-weight: 500; }















/* ==========================================================================
   ★★★ AI 设置 / 模型选择 / 技能弹窗（补齐缺失的 CSS）
   —— 之前这些类没定义，导致弹窗 show 后 position:static 出现在文档流里看不见
   ========================================================================== */

/* ---------- AI 设置弹窗（外层遮罩） ---------- */
.cv-preset-modal {
    position: fixed;
    inset: 0;
    z-index: 220000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cv-preset-modal.show {
    display: flex;
}

/* ---------- AI 设置弹窗（内容框） ---------- */
.cv-preset-dialog {
    width: 860px;
    max-width: 94vw;
    max-height: 86vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
    animation: ctxIn 0.15s ease;
}

.cv-preset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

.cv-preset-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
}

.cv-preset-title i {
    color: #8b5cf6;
}

.cv-preset-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-preset-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.cv-preset-body::-webkit-scrollbar {
    width: 6px;
}
.cv-preset-body::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

/* ---------- 顶部关闭按钮（cv-top-btn，通用） ---------- */
.cv-top-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid #2a2a32;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.cv-top-btn:hover {
    background: #232329;
    color: #fff;
    border-color: #3a3a44;
}

.cv-top-btn.primary {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.cv-top-btn.primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* ---------- 模型选择弹窗 ---------- */
.ai-models-dialog {
    position: fixed;
    inset: 0;
    z-index: 180000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ai-models-dialog.show {
    display: flex;
}

.ai-models-box {
    width: 780px;
    max-width: 94vw;
    height: 82vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

.ai-models-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

.ai-models-title {
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-models-title i {
    color: #8b5cf6;
}

.ai-models-title em {
    font-style: normal;
    font-size: 12px;
    color: #a5b4fc;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
}

.ai-models-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

.ai-models-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
}

.ai-models-search i {
    color: #71717a;
    font-size: 12px;
}

.ai-models-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e4e4e7;
    font-size: 13px;
    font-family: inherit;
}

.ai-models-search input::placeholder {
    color: #52525b;
}

.ai-models-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ai-models-body::-webkit-scrollbar {
    width: 6px;
}
.ai-models-body::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

.ai-models-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #2a2a32;
    flex-shrink: 0;
}

.ai-models-footer-info {
    font-size: 12.5px;
    color: #71717a;
}

.ai-models-footer-info strong {
    color: #a5b4fc;
    font-weight: 600;
}

.ai-models-footer-actions {
    display: flex;
    gap: 8px;
}

/* ---------- AI tabs 切换栏 ---------- */
.ai-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
}

.ai-tab {
    padding: 12px 4px;
    background: transparent;
    border: none;
    color: #71717a;
    font-size: 13.5px;
    cursor: pointer;
    transition: color 0.15s;
    position: relative;
    font-family: inherit;
}

.ai-tab:hover {
    color: #a1a1aa;
}

.ai-tab.active {
    color: #e4e4e7;
    font-weight: 500;
}

.ai-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #6366f1;
    border-radius: 1px;
}

.ai-tab-count {
    font-size: 11px;
    color: #52525b;
    padding: 1px 6px;
    background: #232329;
    border-radius: 8px;
    margin-left: 4px;
}

.ai-tab.active .ai-tab-count {
    color: #a5b4fc;
}

/* ---------- AI 面板（tab 内容区） ---------- */
.ai-panel {
    display: none;
}

.ai-panel.show {
    display: block;
}

/* ---------- 厂商卡片 ---------- */
.ai-provider-card {
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s;
}

.ai-provider-card:hover {
    border-color: #3a3a44;
}

.ai-provider-card.enabled {
    border-color: rgba(99, 102, 241, 0.35);
}

.ai-provider-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-provider-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #52525b;
    flex-shrink: 0;
}

.ai-provider-status.ok {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.ai-provider-status.error {
    background: #ef4444;
}

.ai-provider-status.testing {
    background: #facc15;
    animation: cvPulse 1s infinite;
}

.ai-provider-name {
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-provider-tag {
    font-size: 10.5px;
    color: #71717a;
    padding: 1px 6px;
    background: #232329;
    border-radius: 6px;
}

.ai-provider-enabled-count {
    font-size: 11px;
    color: #a5b4fc;
}

.ai-provider-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ai-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-key-row .cv-input {
    flex: 1;
    height: 34px;
    padding: 0 12px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12.5px;
}

/* ---------- AI 按钮 ---------- */
.ai-btn {
    height: 28px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid #33333c;
    border-radius: 7px;
    color: #a1a1aa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.ai-btn:hover {
    background: #2a2a32;
    color: #fff;
    border-color: #52525b;
}

.ai-btn.primary {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.ai-btn.primary:hover {
    background: #4f46e5;
}

.ai-btn.primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-btn.danger {
    color: #fca5a5;
    border-color: #7f1d1d;
}

.ai-btn.danger:hover {
    background: #7f1d1d;
    color: #fff;
}

.ai-btn i {
    font-size: 11.5px;
}

/* ---------- AI 空状态 ---------- */
.ai-empty {
    padding: 50px 20px;
    text-align: center;
    color: #52525b;
    font-size: 13px;
    line-height: 1.8;
}

.ai-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ---------- 模型选择器内容 ---------- */
.ai-model-group {
    margin-bottom: 12px;
}

.ai-model-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    color: #a1a1aa;
    font-size: 12.5px;
}

.ai-model-group-head:hover {
    color: #e4e4e7;
}

.ai-model-group-head input[type=checkbox] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #6366f1;
}

.ai-model-group-head .ai-model-count {
    margin-left: auto;
    font-size: 11px;
    color: #52525b;
}

.ai-model-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.ai-model-item:hover {
    background: #232329;
}

.ai-model-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

.ai-model-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #6366f1;
    flex-shrink: 0;
}

.ai-model-item-info {
    flex: 1;
    min-width: 0;
}

.ai-model-item-name {
    font-size: 13.5px;
    color: #e4e4e7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-model-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ai-model-tag {
    font-size: 10px;
    color: #71717a;
    padding: 1px 6px;
    background: #232329;
    border-radius: 4px;
    font-weight: 400;
}

.ai-model-item-id {
    font-size: 11px;
    color: #52525b;
    margin-top: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 场景默认行 ---------- */
.ai-scene-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 10px;
}

.ai-scene-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    font-size: 15px;
    flex-shrink: 0;
}

.ai-scene-info {
    flex: 1;
    min-width: 0;
}

.ai-scene-name {
    font-size: 13.5px;
    color: #e4e4e7;
    margin-bottom: 4px;
}

.ai-scene-desc {
    font-size: 11.5px;
    color: #71717a;
}

.ai-scene-select {
    width: 260px;
    height: 34px;
    padding: 0 30px 0 12px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 7px;
    color: #e4e4e7;
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ai-scene-select:focus {
    border-color: #6366f1;
}



/* ==========================================================================
   ★★★ 修复 AI 设置弹窗（宽度 / 高度 / 菜单层级）
   —— 追加时间：最新修复
   ========================================================================== */

/* 1. 弹窗尺寸强制生效（覆盖 canvas_1.css 里的旧样式） */
.cv-preset-dialog {
    width: 860px !important;
    max-width: 94vw !important;
    height: 86vh !important;
    max-height: 86vh !important;
    background: #1a1a20 !important;
    border: 1px solid #33333c !important;
    border-radius: 14px !important;
    overflow: visible !important;    /* ★ 防止裁切内部菜单 */
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85) !important;
}

.cv-preset-body {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 16px 24px 20px !important;
}

.cv-preset-body::-webkit-scrollbar {
    width: 6px;
}
.cv-preset-body::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 3px;
}

/* 2. 弹窗内的 tab 和面板铺满 */
.ai-tabs {
    width: 100% !important;
}
.ai-panel {
    width: 100%;
}

/* 3. "添加厂商"菜单 z-index 提到弹窗之上 */
.cv-ctx-menu {
    z-index: 250000 !important;
    position: fixed !important;
}













/* ==========================================================================
   ★★★ 会话欢迎信息
   ========================================================================== */
   .hm-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    padding: 60px 20px;
    text-align: center;
    gap: 16px;
}

.hm-chat-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #a5b4fc;
    margin-bottom: 8px;
    animation: hmWelcomeFloat 3s ease-in-out infinite;
}

@keyframes hmWelcomeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hm-chat-welcome-title {
    font-size: 22px;
    font-weight: 600;
    color: #e4e4e7;
    margin: 0;
    letter-spacing: -0.3px;
}

.hm-chat-welcome-desc {
    font-size: 14px;
    color: #71717a;
    margin: 0 0 20px;
    line-height: 1.6;
    max-width: 400px;
}

.hm-chat-welcome-hints {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 480px;
    width: 100%;
}

.hm-chat-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #232323;
    border-radius: 10px;
    font-size: 13px;
    color: #a1a1aa;
    text-align: left;
    transition: all 0.15s;
    cursor: default;
}

.hm-chat-hint:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

.hm-chat-hint i {
    color: #8b5cf6;
    font-size: 14px;
    flex-shrink: 0;
}


















/* ==========================================================================
   ★★★ 顶部用户胶囊下拉菜单（即梦风格深色）
   ========================================================================== */
   .hm-user-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* 下拉面板 */
.hm-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #1a1a20;
    border: 1px solid #2f2f38;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 350000;
    animation: ctxIn 0.15s ease;
}
.hm-user-dropdown.show {
    display: flex;
}

/* 头部：头像 + 名字 + 等级 */
.hud-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}
.hud-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}
.hud-info {
    flex: 1;
    min-width: 0;
}
.hud-name {
    font-size: 13.5px;
    color: #e4e4e7;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hud-level {
    font-size: 11.5px;
    margin-top: 3px;
    font-weight: 500;
}

/* 三项统计 */
.hud-stats {
    display: flex;
    gap: 4px;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin: 4px 4px 6px;
}
.hud-stat {
    flex: 1;
    text-align: center;
    padding: 4px 2px;
    min-width: 0;
}
.hud-stat strong {
    display: block;
    font-size: 14px;
    color: #e4e4e7;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hud-stat span {
    font-size: 10.5px;
    color: #71717a;
}

/* 分隔线 */
.hud-divider {
    height: 1px;
    background: #2a2a32;
    margin: 4px 4px;
}

/* 菜单项 */
.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    user-select: none;
}
.hud-item:hover {
    background: #232329;
    color: #fff;
}
.hud-item i {
    width: 16px;
    text-align: center;
    font-size: 12.5px;
    flex-shrink: 0;
}
.hud-item.danger {
    color: #fca5a5;
}
.hud-item.danger:hover {
    background: #7f1d1d;
    color: #fff;
}
.hud-item.danger:hover i {
    color: #fff;
}

/* 胶囊内的积分显示 */
.hm-top-points {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    color: #d4d4d8;
}
.hm-top-points strong {
    color: #fbbf24;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}










/* ==========================================================================
   ★★★ 修复：模型选择弹窗（图2）必须高于 AI 设置弹窗（图1）
   - AI 设置：.cv-preset-modal  → z-index: 220000
   - 模型选择：.ai-models-dialog → 需要更高，且要高于 AI 设置内部下拉菜单（250000）
   ========================================================================== */

/* AI 设置弹窗基准层级 */
.cv-preset-modal {
    z-index: 220000 !important;
}

/* 模型选择弹窗：高于 AI 设置 + 高于其内部下拉 */
.ai-models-dialog {
    z-index: 260000 !important;
}

/* 模型选择弹窗内的搜索框、分类下拉等原生控件保持在弹窗内部正常层叠 */
.ai-models-dialog .ai-models-box {
    position: relative;
    z-index: 1;
}

/* AI 设置内部的下拉菜单（添加厂商弹层），保持在 220000 之上，但仍低于模型选择弹窗 */
.cv-preset-modal .cv-ctx-menu {
    z-index: 250000 !important;
}















/* ============================================================
   即梦风格 · 画布卡片（无背景框、封面圆角、标题+发布人）
   ============================================================ */
   #exGrid .bn-card[data-category="canvas"] {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    padding: 0;
}
#exGrid .bn-card[data-category="canvas"]:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: none;
}
#exGrid .bn-card[data-category="canvas"] .bn-card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background-color: #0d0d10;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
#exGrid .bn-card[data-category="canvas"] .bn-card-cover::after {
    display: none;
}

/* 「查看制作过程」按钮 */
#exGrid .bn-card-view-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    height: 30px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 7px;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    z-index: 5;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#exGrid .bn-card[data-category="canvas"]:hover .bn-card-view-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#exGrid .bn-card-view-btn:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
#exGrid .bn-card-view-btn:active {
    transform: translateY(0) scale(0.97);
}

/* 信息区：标题 + 发布人 */
#exGrid .bn-card-info-simple {
    padding: 10px 4px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#exGrid .bn-card-title-simple {
    font-size: 15px;
    font-weight: 500;
    color: #e4e4e7;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
#exGrid .bn-card-author-simple {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.3;
}
#exGrid .bn-card-author-simple .bn-card-avatar-simple {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   只读画布预览 · 视图区
   ============================================================ */
.bn-ro-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background-color: #0a0a0d;
    background-image: radial-gradient(circle, #26262e 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.bn-ro-viewport:active { cursor: grabbing; }
.bn-ro-world {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    transform-origin: 0 0;
    will-change: transform;
}
.bn-ro-edges {
    position: absolute;
    top: 0; left: 0;
    width: 1px; height: 1px;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}
.bn-ro-nodes {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    z-index: 1;
}
.bn-ro-edge {
    fill: none;
    stroke: rgba(180, 190, 220, 0.35);
    stroke-width: 1.4;
    stroke-linecap: round;
}

/* ============================================================
   只读画布 · 节点
   ============================================================ */
.bn-ro-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.bn-ro-node:hover { transform: translateY(-2px); }
.bn-ro-node .cv-node-header {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.bn-ro-node .cv-node-header .node-icon {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: #71717a;
}
.bn-ro-node .cv-node-title {
    flex: 1;
    font-size: 12px;
    color: #a1a1aa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bn-ro-node .cv-node-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #18181c;
    border: 1px solid #2a2a32;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.bn-ro-node:hover .cv-node-body {
    border-color: #6366f1;
    box-shadow: 0 4px 20px rgba(99,102,241,0.28);
}
.bn-ro-node .cv-node-result {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bn-ro-node .cv-node-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: #0d0d10;
}
.bn-ro-node .cv-node-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #52525b;
    font-size: 12px;
    gap: 6px;
    min-height: 100px;
    padding: 20px;
    background: #121216;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
.bn-ro-node .cv-node-empty i { font-size: 22px; }
.bn-ro-node .cv-text-content-ro {
    padding: 12px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    font-size: 12.5px;
    line-height: 1.6;
    color: #d4d4d8;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    background: #121216;
}

/* ============================================================
   只读画布 · 右下角工具条
   ============================================================ */
.bn-ro-toolbar {
    position: absolute;
    right: 16px;
    bottom: 16px;
    height: 40px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(24, 24, 28, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #2a2a32;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.bn-ro-btn {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}
.bn-ro-btn:hover { background: #2a2a32; color: #fff; }
.bn-ro-zoom-label {
    min-width: 52px;
    padding: 0 4px;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, monospace;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.bn-ro-sep {
    width: 1px; height: 20px;
    background: #2a2a32;
    margin: 0 4px;
}

/* ============================================================
   只读画布 · 小地图
   ============================================================ */
.bn-ro-minimap {
    position: absolute;
    right: 16px;
    bottom: 68px;
    width: 200px;
    height: 130px;
    background: rgba(24, 24, 28, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #2a2a32;
    border-radius: 10px;
    overflow: hidden;
    z-index: 9;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}
.bn-ro-minimap canvas {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    display: block;
}
.bn-ro-minimap-vp {
    position: absolute;
    border: 1.5px solid #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    pointer-events: none;
}

/* ============================================================
   只读画布 · 节点详情弹窗
   ============================================================ */
.bn-ro-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 500000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ctxIn 0.15s ease;
}
.bn-ro-detail-dialog {
    width: 720px;
    max-width: 92vw;
    max-height: 82vh;
    background: #1a1a20;
    border: 1px solid #33333c;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.9);
}
.bn-ro-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #2a2a32;
    font-size: 15px;
    font-weight: 600;
    color: #e4e4e7;
    flex-shrink: 0;
}
.bn-ro-detail-close {
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    color: #71717a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.bn-ro-detail-close:hover { background: #2a2a32; color: #fff; }
.bn-ro-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.bn-ro-detail-body::-webkit-scrollbar { width: 6px; }
.bn-ro-detail-body::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }
.bn-ro-detail-preview {
    background: #0d0d10;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bn-ro-detail-preview img,
.bn-ro-detail-preview video {
    max-width: 100%;
    max-height: 380px;
    display: block;
    background: #000;
}
.bn-ro-detail-preview audio {
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
}
.bn-ro-text {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-size: 13.5px;
    line-height: 1.8;
    color: #d4d4d8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 380px;
    overflow-y: auto;
}
.bn-ro-text::-webkit-scrollbar { width: 6px; }
.bn-ro-text::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }
.bn-ro-detail-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bn-ro-detail-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 14px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 8px;
}
.bn-ro-detail-row .k {
    flex-shrink: 0;
    width: 64px;
    font-size: 12px;
    color: #71717a;
    padding-top: 1px;
}
.bn-ro-detail-row .v {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #e4e4e7;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}
.bn-ro-detail-row .v::-webkit-scrollbar { width: 5px; }
.bn-ro-detail-row .v::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 3px; }

/* 头部按钮颜色 */
#bnReadonlyModal .cv-readonly-copy.bn-free {
    background: linear-gradient(135deg, #10b981, #059669);
}
#bnReadonlyModal .cv-readonly-copy.bn-free:hover {
    background: linear-gradient(135deg, #059669, #047857);
}
#bnReadonlyModal .cv-readonly-copy.bn-paid {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
#bnReadonlyModal .cv-readonly-copy.bn-paid:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}
#bnReadonlyModal .cv-readonly-copy:disabled {
    opacity: .6;
    cursor: not-allowed;
    filter: none;
}

/* 加载/空状态 */
#bnReadonlyModal .bn-readonly-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #71717a;
    font-size: 13px;
    gap: 14px;
}
#bnReadonlyModal .bn-readonly-loading i {
    font-size: 36px;
    color: #6366f1;
    opacity: .8;
}
#bnReadonlyModal .bn-readonly-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #52525b;
    font-size: 13px;
    gap: 12px;
}
#bnReadonlyModal .bn-readonly-empty i {
    font-size: 44px;
    opacity: .4;
}











/* ============================================================
   技能卡片 grid 布局（390 宽）
   ============================================================ */
   #exGrid.bn-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 390px));
    gap: 20px;
    justify-content: start;
}
#exGrid.bn-canvas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ============================================================
   技能卡片（即梦风格 390×360）
   ============================================================ */
#exGrid .bn-skill-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 390px;
    height: 360px;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    box-sizing: border-box;
}
#exGrid .bn-skill-card:hover {
    transform: translateY(-3px);
}
#exGrid .bn-skill-card-cover {
    position: relative;
    width: 100%;
    height: 270px;
    background-color: #0d0d10;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}
#exGrid .bn-skill-card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.9) 100%);
    pointer-events: none;
}
#exGrid .bn-skill-card-cover-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 2;
}
#exGrid .bn-skill-card-name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    letter-spacing: 0.1px;
}
#exGrid .bn-skill-card-add-btn {
    flex-shrink: 0;
    height: 30px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
}
#exGrid .bn-skill-card-add-btn:hover {
    background: #fff;
    color: #0a0a0a;
    border-color: #fff;
}
#exGrid .bn-skill-card-add-btn.added {
    background: rgba(16, 185, 129, 0.9);
    border-color: #10b981;
    color: #fff;
}
#exGrid .bn-skill-card-add-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}
#exGrid .bn-skill-card-info {
    flex: 1;
    min-height: 0;
    padding: 12px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    overflow: hidden;
}
#exGrid .bn-skill-card-author {
    font-size: 12px;
    color: #71717a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#exGrid .bn-skill-card-desc {
    font-size: 12.5px;
    color: #a1a1aa;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    word-break: break-word;
}













/* ============================================================
   ★★★ 技能详情页（左侧边栏保留 · 顶部固定 · 内容滚动）
   ============================================================ */
   .bn-skill-detail-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    /* left 由 JS 动态设置，避开左侧边栏 */
    background: #0a0a0a;
    z-index: 250000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 返回箭头：与右侧顶部用户栏齐平 */
.bn-skill-detail-back {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 10;
}
.bn-skill-detail-back:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ---- 顶部信息区（固定） ---- */
.bn-skill-detail-header {
    flex-shrink: 0;
    padding: 74px 60px 22px;   /* 顶部 74 让出返回箭头 */
    border-bottom: 1px solid #18181b;
    background: #0a0a0a;
}

.bn-skill-detail-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.bn-skill-detail-header-left {
    flex: 1;
    min-width: 0;
}

.bn-skill-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.3;
    letter-spacing: -0.3px;
    word-break: break-word;
}

.bn-skill-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #71717a;
    flex-wrap: wrap;
}
.bn-skill-author {
    color: #a1a1aa;
}
.bn-skill-sep {
    color: #3f3f46;
}
.bn-skill-time {
    color: #71717a;
}

/* 添加技能按钮 */
.bn-skill-add-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 22px;
    background: #fff;
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.bn-skill-add-btn:hover:not(:disabled) {
    background: #e4e4e7;
}
.bn-skill-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.bn-skill-add-btn.added {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    opacity: 1;
    cursor: default;
}
.bn-skill-add-btn.locked {
    background: rgba(255, 255, 255, 0.06);
    color: #71717a;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- 内容滚动区 ---- */
.bn-skill-detail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.bn-skill-detail-scroll::-webkit-scrollbar {
    width: 8px;
}
.bn-skill-detail-scroll::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 4px;
}
.bn-skill-detail-scroll::-webkit-scrollbar-thumb:hover {
    background: #3a3a44;
}

.bn-skill-detail-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 60px 80px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* 封面区 */
.bn-skill-hero {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #121216;
}
.bn-skill-hero img {
    width: 100%;
    display: block;
    max-height: 620px;
    object-fit: cover;
}

/* 通用 section */
.bn-skill-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bn-skill-section-title {
    font-size: 13px;
    color: #71717a;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.bn-skill-section-body {
    font-size: 14px;
    color: #d4d4d8;
    line-height: 1.8;
    word-break: break-word;
}

/* 技能内容（富文本） */
.bn-skill-content {
    font-size: 14.5px;
    color: #e4e4e7;
    line-height: 1.85;
    word-break: break-word;
}
.bn-skill-content h1,
.bn-skill-content h2 {
    font-size: 22px;
    color: #fff;
    font-weight: 700;
    margin: 26px 0 12px;
    line-height: 1.4;
}
.bn-skill-content h3 {
    font-size: 18px;
    color: #e4e4e7;
    font-weight: 600;
    margin: 20px 0 10px;
}
.bn-skill-content p { margin: 10px 0; }
.bn-skill-content ul,
.bn-skill-content ol {
    padding-left: 26px;
    margin: 10px 0;
}
.bn-skill-content li { margin: 5px 0; }
.bn-skill-content blockquote {
    border-left: 3px solid #6366f1;
    padding-left: 14px;
    margin: 12px 0;
    color: #a1a1aa;
    font-style: italic;
}
.bn-skill-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13.5px;
    background: #121216;
    border-radius: 8px;
    overflow: hidden;
}
.bn-skill-content table th,
.bn-skill-content table td {
    padding: 10px 14px;
    border: 1px solid #2a2a32;
    text-align: left;
    vertical-align: top;
    color: #d4d4d8;
}
.bn-skill-content table th {
    background: #1a1a20;
    color: #e4e4e7;
    font-weight: 600;
}
.bn-skill-content code {
    background: #232329;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    color: #a5b4fc;
}
.bn-skill-content strong { color: #fff; font-weight: 600; }
.bn-skill-content img { max-width: 100%; border-radius: 8px; display: block; }

/* 付费墙 */
.bn-skill-paywall {
    padding: 30px 0 20px;
    display: flex;
    justify-content: center;
}
.bn-skill-paywall-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 40px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
}
.bn-skill-paywall-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 18px;
}
.bn-skill-paywall-tip {
    font-size: 13.5px;
    color: #a1a1aa;
}
.bn-skill-paywall-btn {
    height: 44px;
    padding: 0 26px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}
.bn-skill-paywall-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.bn-skill-paywall-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 加载 / 错误 */
.bn-skill-loading,
.bn-skill-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 40px;
    color: #71717a;
    font-size: 13px;
    text-align: center;
}
.bn-skill-loading i { font-size: 32px; color: #6366f1; }
.bn-skill-error i { font-size: 40px; color: #f59e0b; }

/* 响应式 */
@media (max-width: 900px) {
    .bn-skill-detail-header { padding: 74px 24px 18px; }
    .bn-skill-detail-content { padding: 32px 24px 60px; }
    .bn-skill-title { font-size: 22px; }
}




















/* ============================================================
   ★★★ 文本编辑器 · 分卷章节导航条
   ============================================================ */
   .cv-text-editor-chapter-bar {
    display: none;  /* 默认隐藏，分卷模式时显示 */
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #15151a;
    border-bottom: 1px solid #2a2a32;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.chb-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.chb-group > label {
    font-size: 12px;
    color: #71717a;
    white-space: nowrap;
}
.chb-select {
    height: 30px;
    padding: 0 8px;
    background: #121216;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    max-width: 160px;
}
.chb-select:focus { border-color: #6366f1; }
.chb-select-wide { min-width: 160px; }
.chb-select option { background: #1a1a20; color: #e4e4e7; }

.chb-spacer { flex: 1; }

.chb-btn {
    height: 30px;
    padding: 0 12px;
    background: #232329;
    border: 1px solid #2a2a32;
    border-radius: 6px;
    color: #d4d4d8;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.chb-btn:hover:not(:disabled) {
    background: #2f2f38;
    color: #fff;
    border-color: #52525b;
}
.chb-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.chb-btn i { font-size: 11px; }

.chb-btn-primary {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}
.chb-btn-primary:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    border-color: #6366f1;
}

@media (max-width: 900px) {
    .cv-text-editor-chapter-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    .chb-select { max-width: 110px; min-width: 90px; }
    .chb-btn { padding: 0 8px; font-size: 11.5px; }
}










/* ============================================================================
   ★★★ 智能对齐辅助线 · 亮蓝虚线
   ============================================================================ */
   .cv-snap-guides {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
}

.cv-snap-line {
    position: absolute;
    pointer-events: none;
    /* 亮蓝虚线 */
}

/* 垂直线：从上到下，用 repeating-linear-gradient 画虚线 */
.cv-snap-line.v {
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        #22d3ee 0,
        #22d3ee 5px,
        transparent 5px,
        transparent 10px
    );
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.55);
    transform: translateX(-0.5px);
}

/* 水平线：从左到右，虚线 */
.cv-snap-line.h {
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        #22d3ee 0,
        #22d3ee 5px,
        transparent 5px,
        transparent 10px
    );
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.55);
    transform: translateY(-0.5px);
}








/* ============================================================================
   ★★★ 图片/视频节点 · 按内容比例铺满
   ============================================================================ */

/* 图片/视频节点：body 无内边距，让媒体撑满 */
.cv-node[data-node-type="image"] .cv-node-body,
.cv-node[data-node-type="video"] .cv-node-body {
    padding: 0;
    overflow: hidden;
}

/* 图片/视频：宽度撑满，高度撑满，比例自适应 */
.cv-node[data-node-type="image"] .cv-node-result,
.cv-node[data-node-type="video"] .cv-node-result {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
}
.cv-node[data-node-type="image"] .cv-node-preview,
.cv-node[data-node-type="video"] .cv-node-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;         /* 节点比例已与内容一致，不会留白 */
    image-rendering: -webkit-optimize-contrast;
    background: #0d0d10;
}
.cv-node[data-node-type="image"] .cv-node-preview {
    background: #0d0d10;
}

/* ============================================================================
   ★★★ 只有文本节点显示 resize 手柄，其余节点锁定尺寸
   ============================================================================ */
.cv-node:not([data-node-type="text"]) .cv-node-resize {
    display: none !important;
}

/* ============================================================================
   ★★★ 画布缩放时的清晰度优化
   - 避免浏览器把 DOM 提前栅格化后模糊
   - 图片用对比度优化渲染
   ============================================================================ */
.cv-world {
    transform-origin: 0 0;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 节点文字：抗锯齿优化 */
.cv-node-title,
.cv-node .cv-text-content,
.cv-node-text-content {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}






















