/* ==========================================================================
   画布工作流模块样式
   覆盖：编排工具宫格卡片列表页（/admin/flow-tools）
        编排画布工作台页（/admin/flow-tools/workbench）
   ========================================================================== */

:root {
    --nf-radius: 18px;
    --nf-radius-sm: 12px;
    --nf-shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
    --nf-shadow-md: 0 10px 24px -8px rgba(15, 23, 42, .18), 0 4px 10px rgba(15, 23, 42, .06);
    --nf-shadow-lg: 0 24px 48px -18px rgba(15, 23, 42, .32), 0 10px 20px -8px rgba(15, 23, 42, .16);
    --nf-border: #e8edf5;
    --nf-text: #0f172a;
    --nf-muted: #64748b;
}

/* ─────────────── 编排工具列表页 ─────────────── */

.nf-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.nf-page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.nf-page-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.nf-page-head p {
    margin: 0;
    color: var(--nf-muted);
    font-size: 14px;
}

.nf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius-sm);
    box-shadow: var(--nf-shadow-sm);
}

.nf-toolbar .form-control,
.nf-toolbar .form-select {
    min-width: 140px;
    height: 38px;
    border-radius: 10px;
    border-color: #e2e8f0;
    font-size: 13.5px;
}

.nf-toolbar-search {
    flex: 1 1 240px;
    min-width: 200px;
}

.nf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
    white-space: nowrap;
}

.nf-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.nf-btn:disabled {
    cursor: not-allowed;
    opacity: .45;
    box-shadow: none;
}

.nf-btn svg {
    pointer-events: none;
}

.nf-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .55);
}

.nf-btn-primary:hover {
    box-shadow: 0 14px 26px -10px rgba(37, 99, 235, .75);
}

.nf-btn-outline {
    color: #475569;
    background: #fff;
    border-color: #e2e8f0;
}

.nf-btn-outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.nf-btn-danger {
    color: #dc2626;
    background: #fff;
    border-color: #fecaca;
}

.nf-btn-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.nf-btn-run {
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #059669 52%, #047857 100%);
    box-shadow: 0 10px 22px -8px rgba(5, 150, 105, .65);
}

.nf-btn-run:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #10b981 52%, #059669 100%);
    box-shadow: 0 16px 30px -10px rgba(5, 150, 105, .85);
    transform: translateY(-1px);
}

/* 运行按钮置灰态（仅工具体验页真实执行且草稿不可运行时出现）：与常驻可点击的翠绿色明确区分，且不响应点击动画 */
.nf-btn-run:disabled {
    color: #94a3b8;
    background: #e2e8f0;
    box-shadow: none;
    transform: none;
}

.nf-btn-run:disabled:hover {
    background: #e2e8f0;
    box-shadow: none;
    transform: none;
}

.nf-btn-xs {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

/* ─────────────── 宫格卡片 ─────────────── */

.nf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
    gap: 20px;
}

.nf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--nf-border);
    border-radius: var(--nf-radius);
    box-shadow: var(--nf-shadow-md);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s ease, border-color .22s ease;
    will-change: transform;
}

.nf-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--nf-radius);
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.nf-card:hover {
    transform: translateY(-6px);
    border-color: #d7dff0;
    box-shadow: var(--nf-shadow-lg);
}

.nf-card-cover {
    position: relative;
    height: 148px;
    overflow: hidden;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 45%, #e0f2fe 100%);
}

.nf-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.nf-card:hover .nf-card-cover img {
    transform: scale(1.06);
}

.nf-card-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    opacity: .5;
}

.nf-card-cover-fallback svg {
    width: 46px;
    height: 46px;
}

.nf-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.nf-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}

.nf-badge-draft {
    color: #92400e;
    background: rgba(254, 243, 199, .92);
}

.nf-badge-published {
    color: #065f46;
    background: rgba(209, 250, 229, .92);
}

.nf-badge-offline {
    color: #475569;
    background: rgba(226, 232, 240, .92);
}

.nf-badge-category {
    color: #3730a3;
    background: rgba(224, 231, 255, .92);
}

.nf-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 16px 18px 12px;
}

.nf-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--nf-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nf-card-short {
    font-size: 12.5px;
    color: #1d4ed8;
    font-weight: 600;
}

.nf-card-desc {
    margin: 0;
    font-size: 13px;
    color: var(--nf-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.nf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.nf-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nf-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fcfdff, #fff);
}

.nf-card-actions .nf-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    flex: 1 1 auto;
}

/* 新建卡片 */
.nf-card-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 300px;
    color: #94a3b8;
    background: #fbfcfe;
    border: 2px dashed #cfd8e6;
    border-radius: var(--nf-radius);
    cursor: pointer;
    transition: all .22s ease;
}

.nf-card-new:hover {
    color: #2563eb;
    border-color: #93c5fd;
    background: #f5f7ff;
    transform: translateY(-4px);
    box-shadow: var(--nf-shadow-md);
}

.nf-card-new svg {
    width: 40px;
    height: 40px;
}

.nf-card-new strong {
    font-size: 15px;
    font-weight: 600;
}

.nf-card-new small {
    font-size: 12.5px;
    color: #a0aec0;
}

.nf-empty {
    grid-column: 1 / -1;
    padding: 64px 20px;
    text-align: center;
    color: #94a3b8;
    background: #fff;
    border: 1px dashed #cfd8e6;
    border-radius: var(--nf-radius);
}

/* 封面选择 */
.nf-cover-picker {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nf-cover-preview {
    width: 96px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 11px;
}

.nf-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nf-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.nf-list-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    min-height: 28px;
}

.nf-list-status {
    font-size: 13px;
    color: var(--nf-muted);
}

.nf-list-sentinel {
    width: 100%;
    height: 1px;
}

/* ─────────────── 画布工作台 ─────────────── */

.nf-workbench {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nf-topbar-h, 72px));
    min-height: 620px;
    background: #f6f8fb;
}

.nf-wb-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: #fff;
    border-bottom: 1px solid var(--nf-border);
    box-shadow: var(--nf-shadow-sm);
    z-index: 5;
}

.nf-wb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    background: #fff;
}

.nf-wb-back:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.nf-wb-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-right: auto;
}

.nf-wb-title strong {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-wb-title small {
    color: #94a3b8;
    font-size: 12px;
}

.nf-wb-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.nf-wb-stage {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.nf-wb-panel {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nf-wb-panel-left {
    width: 380px;
    flex: 0 0 380px;
    border-right: 1px solid var(--nf-border);
}

.nf-wb-panel-right {
    width: 320px;
    flex: 0 0 320px;
    border-left: 1px solid var(--nf-border);
}

.nf-wb-panel-head {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    letter-spacing: .01em;
}

.nf-wb-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 18px;
}

.nf-palette-group {
    margin-bottom: 14px;
}

.nf-palette-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: none;
}

.nf-palette-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nf-palette-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 11px;
    cursor: grab;
    transition: all .16s ease;
    box-shadow: var(--nf-shadow-sm);
    min-width: 0;
    overflow: visible;
}

.nf-palette-item:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: var(--nf-shadow-md);
}

.nf-palette-item:active {
    cursor: grabbing;
}

.nf-palette-name {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.nf-palette-item strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
}

.nf-palette-info {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    user-select: none;
}

.nf-palette-info .nf-ncard-tip {
    display: none;
}

.nf-palette-forms {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}

.nf-palette-form {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.nf-palette-form svg {
    width: 15px;
    height: 15px;
    display: block;
}

.nf-palette-item small {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nf-palette-dot {
    width: 18px;
    height: 3px;
    border-radius: 999px;
}

.nf-wb-canvas-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: #f6f8fb;
    background-image: radial-gradient(circle, #dbe3ef 1px, transparent 1px);
    background-size: 18px 18px;
}

.nf-record-banner {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.nf-record-banner[hidden] {
    display: none;
}

.nf-record-banner p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
}

.nf-record-banner .nf-btn {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 10px;
    background: #fff;
}

/* 默认＝移动模式：空白处左键是框选，光标给默认箭头（不是 grab）；
   抓手模式才给 grab，由 .is-tool-hand 切换。节点上始终是 grab（节点可拖动）。 */
.nf-wb-canvas {
    position: absolute;
    inset: 0;
    cursor: default;
}

/* 覆盖 X6 注入的 -webkit-grab：Windows 上该前缀光标会渲染成一团黑块 */
.nf-wb-canvas .x6-graph,
.nf-wb-canvas .x6-graph.x6-graph-pannable {
    cursor: default !important;
}

/* 抓手模式：空白处左键直接平移画布，光标与行为对齐 */
.nf-wb-canvas.is-tool-hand,
.nf-wb-canvas.is-tool-hand .x6-graph,
.nf-wb-canvas.is-tool-hand .x6-graph.x6-graph-pannable {
    cursor: grab !important;
}

.nf-wb-canvas .x6-graph.x6-graph-panning,
.nf-wb-canvas.is-canvas-panning,
.nf-wb-canvas.is-canvas-panning .x6-graph {
    cursor: grabbing !important;
}

.nf-wb-canvas .x6-node,
.nf-wb-canvas .x6-node foreignObject,
.nf-wb-canvas .x6-node .foContent,
.nf-ncard,
.nf-ncard-inner,
.nf-ncard-head,
.nf-ncard-body {
    cursor: grab;
}

.nf-wb-canvas .x6-node foreignObject {
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.nf-wb-canvas .x6-node .foContent,
.nf-wb-canvas .x6-node .foContent > * {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.nf-wb-canvas.is-node-dragging,
.nf-wb-canvas.is-node-dragging *,
.nf-wb-canvas.is-canvas-panning,
.nf-wb-canvas.is-canvas-panning * {
    cursor: grabbing !important;
}

/* 画布右下角帮助按钮（复用下载按钮观感，改为底部定位） */
.nf-wb-canvas-help {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    color: #475569;
    box-shadow: var(--nf-shadow-sm);
    cursor: pointer;
}

.nf-wb-canvas-help:hover,
.nf-wb-canvas-help[aria-expanded="true"] {
    border-color: #bfdbfe;
    color: #2563eb;
    background: #eff6ff;
}

/* 自适应比例按钮：贴在帮助按钮左侧，复用其观感，仅改变水平位置 */
.nf-wb-canvas-fit {
    right: 60px;
}

/* 操作模式（移动 / 抓手工具）：自定义下拉，不用原生 select——
   原生控件无法在选项内放图标，且各系统观感差异大。继续向左排，right = fit 60 + 宽 36 + 间距 8 */
.nf-wb-canvas-mode {
    position: absolute;
    bottom: 16px;
    right: 104px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    height: 36px;
    border-radius: 10px;
}

/* 收起态按钮：左侧图标随当前模式变化（移动=四向箭头 / 抓手=手形），右侧文字 + 下拉箭头 */
.nf-wb-canvas-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 8px 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    color: #475569;
    box-shadow: var(--nf-shadow-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.nf-wb-canvas-mode-btn:hover,
.nf-wb-canvas-mode-btn[aria-expanded="true"] {
    border-color: #bfdbfe;
    color: #2563eb;
    background: #eff6ff;
}

.nf-wb-canvas-mode-ico,
.nf-wb-canvas-mode-item svg {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
}

/* 下拉箭头用 CSS 三角，避免额外 svg 节点 */
.nf-wb-canvas-mode-caret {
    flex: none;
    width: 0;
    height: 0;
    margin-left: 1px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transform: translateY(2px);
    opacity: .75;
}

/* 展开态菜单：锚在按钮正上方、右侧对齐，越界由 JS 收敛 */
.nf-wb-canvas-mode-menu {
    position: absolute;
    bottom: 42px;
    right: 0;
    z-index: 6;
    min-width: 132px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    user-select: none;
}

.nf-wb-canvas-mode-menu[hidden] {
    display: none !important;
}

.nf-wb-canvas-mode-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.nf-wb-canvas-mode-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* 选中项：底色 + 字重 + 左侧色条，与节点操作菜单选中态区分开 */
.nf-wb-canvas-mode-item.is-on {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.nf-wb-canvas-mode-item.is-on::after {
    content: "✓";
    margin-left: auto;
    padding-left: 8px;
}

/* 帮助悬浮层：默认隐藏，锚定在按钮上方右对齐；.is-open 显示 */
.nf-wb-help-pop {
    position: absolute;
    right: 16px;
    bottom: 60px;
    z-index: 20;
    width: 300px;
    max-width: calc(100% - 32px);
    max-height: min(60vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    box-shadow: 0 18px 44px -20px rgba(15, 23, 42, .4), 0 0 0 1px rgba(15, 23, 42, .04);
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    pointer-events: none;
}

.nf-wb-help-pop.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nf-wb-help-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.nf-wb-help-list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.7;
}

.nf-wb-help-list li { margin-bottom: 4px; }
.nf-wb-help-list li:last-child { margin-bottom: 0; }
.nf-wb-help-list b { color: #1e293b; font-weight: 600; }

.nf-wb-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: 12px;
}

.nf-wb-title-inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.nf-wb-title-inline .nf-badge { box-shadow: none; font-size: 11px; padding: 3px 8px; }

/* 顶栏标题旁重命名按钮 */
.nf-wb-title-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.nf-wb-title-edit:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #dbeafe;
}

.nf-rename-pop {
    position: fixed;
    z-index: 4200;
    width: 260px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    box-shadow: 0 18px 44px -20px rgba(15, 23, 42, .4), 0 0 0 1px rgba(15, 23, 42, .04);
}

.nf-rename-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.nf-rename-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #0f172a;
    box-sizing: border-box;
}

.nf-rename-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.nf-rename-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.nf-rename-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.nf-rename-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.nf-rename-btn.is-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.nf-rename-btn.is-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
.nf-save-split { flex-wrap: nowrap; }
.nf-save-split > .nf-btn:first-child { border-radius: 7px 0 0 7px; }
.nf-save-split > .dropdown-toggle { border-radius: 0 7px 7px 0; padding-inline: 7px; border-left: 1px solid #ffffff50; }
.nf-save-split .dropdown-item { font-size: 12px; }
.nf-cfg-head-row { flex-wrap: wrap; }
.nf-workbench:not(.nf-experience) #nfWbDownload { right: 60px; }
.nf-history-panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: 300px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border-left: 1px solid var(--nf-border);
    box-shadow: -4px 0 14px #0f172a0d;
    z-index: 6;
    font-size: 12px;
}
.nf-history-panel[hidden] { display: none; }
.nf-history-head { display: flex; align-items: center; justify-content: space-between; padding: 12px; flex-shrink: 0; }
.nf-history-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.nf-history-list .nf-version-item { gap: 5px; padding: 8px 4px; margin-bottom: 5px; border-radius: 6px; align-items: flex-start; }
.nf-history-item-body { flex: 1; min-width: 0; }
.nf-history-remark { overflow-wrap: anywhere; margin-top: 4px; color: #475569; }
.nf-history-list .nf-version-meta { font-size: 10px; margin-top: 3px; }
.nf-history-icon { border: 0; background: transparent; color: #64748b; width: 28px; height: 28px; flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; padding: 0; }
.nf-history-icon:hover { color: #2563eb; background: #eff6ff; }
.nf-history-icon:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.nf-history-icon:disabled { opacity: .4; cursor: not-allowed; }
.nf-is-busy #nfCanvas, .nf-is-busy #nfPalette, .nf-is-busy #nfPreview { pointer-events: none; }
.nf-publish-header { gap: 8px; flex-wrap: wrap; }
.nf-publish-header .modal-title { margin-right: auto; }
.nf-publish-cover { width: 100%; max-height: 180px; aspect-ratio: 16 / 9; object-fit: contain; background: #f8fafc; margin-bottom: 8px; border-radius: 8px; }
.nf-publish-icon { width: 48px; height: 48px; object-fit: contain; margin-bottom: 8px; }
.nf-publish-message { color: #b45309; font-size: 12px; overflow-wrap: anywhere; }
#nfPublishFields { min-width: 0; }
#nfPublishRemoveIcon { margin-top: 6px; }
@media (max-width: 600px) {
    .nf-wb-topbar { flex-wrap: wrap; gap: 6px; padding: 8px; }
    .nf-wb-title-inline { gap: 5px; }
    .nf-history-panel { width: min(300px, 100%); }
    .nf-publish-header .nf-btn { padding-inline: 8px; }
}

.nf-wb-canvas-download {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    color: #475569;
    box-shadow: var(--nf-shadow-sm);
    cursor: pointer;
}

.nf-wb-canvas-download:hover {
    border-color: #bfdbfe;
    color: #2563eb;
    background: #eff6ff;
}

/* 画布右上角「一键运行」：与版本历史(16)、下载(60) 共用同一套外观与基线（top 16 / 36×36 / 圆角 10），
   排在二者左侧 right=104，视觉上是一排同规格图标按钮；仅用主色图标区分「运行」这一主动作。
   必须排在 .nf-wb-canvas-download 之后，才能覆盖其默认位置与配色。 */
.nf-wb-canvas-run {
    right: 104px;
    color: #059669;
}

.nf-wb-canvas-run:hover {
    border-color: #a7f3d0;
    color: #047857;
    background: #ecfdf5;
}

.nf-wb-canvas-run:disabled,
.nf-wb-canvas-run:disabled:hover {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.nf-edge-toolbar {
    position: absolute;
    z-index: 8;
    transform: translate(-50%, calc(-100% - 10px));
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .4);
    pointer-events: auto;
}

.nf-edge-toolbar[hidden] {
    display: none !important;
}

.nf-edge-styles {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.nf-edge-style,
.nf-edge-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.nf-edge-style:hover,
.nf-edge-delete:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nf-edge-style.is-active {
    background: #eff6ff;
    color: #2563eb;
}

.nf-edge-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 节点选中后的右侧操作下拉：修改节点名称 / 删除节点 */
.nf-node-menu {
    position: absolute;
    z-index: 9;
    min-width: 124px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    user-select: none;
    pointer-events: auto;
}

.nf-node-menu[hidden] {
    display: none !important;
}

.nf-node-menu-item {
    display: block;
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.nf-node-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nf-node-menu-item.is-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 无标题栏的编排组件（调度器/容器）改名用的画布内浮层 */
.nf-node-rename {
    position: absolute;
    z-index: 10;
    width: 220px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 36px -16px rgba(15, 23, 42, .45);
    box-sizing: border-box;
    user-select: none;
    pointer-events: auto;
}

.nf-node-rename-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #0f172a;
    box-sizing: border-box;
}

.nf-node-rename-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.nf-node-rename-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.nf-node-rename-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.nf-node-rename-btn.is-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.nf-wb-canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #b3bfd0;
    pointer-events: none;
    z-index: 2;
}

.nf-wb-canvas-empty svg {
    width: 52px;
    height: 52px;
    opacity: .7;
}

.nf-prop-empty {
    padding: 36px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.nf-kind-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.nf-form-item .nf-kind-card {
    display: block;
    margin: 0;
    font-weight: 400;
}

.nf-kind-card {
    display: block;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.nf-kind-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nf-kind-card-body {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 76px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.nf-kind-card-body strong {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.nf-kind-card-body em {
    font-style: normal;
    font-size: 12px;
    line-height: 1.45;
    color: #94a3b8;
}

.nf-kind-card:hover .nf-kind-card-body {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.nf-kind-card:has(input:checked) .nf-kind-card-body {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.nf-kind-card:has(input:checked) .nf-kind-card-body strong {
    color: #1d4ed8;
}

.nf-icon-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nf-icon-pick-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 58px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.nf-icon-pick-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.nf-icon-pick-face {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.nf-icon-pick-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.nf-icon-pick-copy strong {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.nf-icon-pick-copy small {
    font-size: 12px;
    color: #94a3b8;
}

#nfPublishModal .modal-content {
    position: relative;
}

.nf-icon-pop {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .38);
    border-radius: inherit;
}

.nf-icon-pop[hidden] {
    display: none !important;
}

.nf-icon-pop-card {
    width: min(100%, 480px);
    max-height: 100%;
    overflow: auto;
    padding: 14px 14px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}

.nf-icon-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.nf-icon-pop-head strong {
    font-size: 14px;
    color: #0f172a;
}

.nf-icon-pop-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.nf-icon-pop-close:hover {
    background: #e2e8f0;
}

.nf-icon-library {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.nf-icon-lib-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.nf-icon-lib-face {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    pointer-events: none;
}

.nf-icon-lib-btn img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.nf-icon-lib-name {
    font-size: 12px;
    line-height: 1.2;
    color: #475569;
}

.nf-icon-lib-btn:hover,
.nf-icon-lib-btn.is-on {
    border-color: #2563eb;
    background: #eff6ff;
}

.nf-icon-lib-btn.is-on .nf-icon-lib-name {
    color: #1d4ed8;
    font-weight: 650;
}

.nf-form-item {
    margin-bottom: 14px;
}

.nf-form-item label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.nf-form-item label .nf-required {
    color: #ef4444;
    margin-left: 2px;
}

.nf-form-item .form-control,
.nf-form-item .form-select {
    border-radius: 10px;
    border-color: #e2e8f0;
    font-size: 13px;
}

.nf-form-item textarea.form-control {
    min-height: 84px;
    resize: vertical;
}

.nf-form-hint {
    margin-top: 4px;
    font-size: 11.5px;
    color: #94a3b8;
}

.nf-port-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nf-port-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #eef2f7;
    border-radius: 9px;
    background: #fafbfe;
    font-size: 12.5px;
}

.nf-port-item .nf-port-side {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.nf-port-in .nf-port-side {
    color: #1d4ed8;
    background: #dbeafe;
}

.nf-port-out .nf-port-side {
    color: #047857;
    background: #d1fae5;
}

.nf-port-item .nf-port-limit {
    margin-left: auto;
    color: #94a3b8;
    font-size: 11.5px;
}

.nf-version-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
}

.nf-version-no {
    font-weight: 700;
    color: #4338ca;
    font-size: 13px;
}

.nf-version-meta {
    font-size: 11.5px;
    color: #94a3b8;
}

.nf-toast {
    position: fixed;
    top: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    font-size: 13.5px;
    box-shadow: var(--nf-shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 2000;
}

.nf-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nf-toast-error {
    background: rgba(185, 28, 28, .94);
}

/* 画布节点选中态在 node-flow-workbench.js 中通过 attrs 动态应用（蓝色描边 + 投影） */

@media (max-width: 992px) {
    .nf-wb-panel-left {
        width: 280px;
        flex-basis: 280px;
    }

    .nf-wb-panel-right {
        width: 260px;
        flex-basis: 260px;
    }

    .nf-palette-items {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─────────────── 全屏铺满（/admin/flow-tools/workbench） ─────────────── */
/* 让编排工作台脱离 .container 最大宽度约束，左右铺满屏幕，中间画布尽可能宽。 */

body.nf-flow-wb-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body.nf-flow-wb-page .app-header {
    flex: 0 0 auto;
}

body.nf-flow-wb-page > .container {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
}

body.nf-flow-wb-page main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    padding: 0 !important;
}

body.nf-flow-wb-page .footer,
body.nf-flow-wb-page .app-mobile-tabbar {
    display: none !important;
}

body.nf-flow-wb-page .nf-workbench {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
}

/* ─────────────── 画布节点卡片（HTML 富卡片） ─────────────── */

.nf-ncard {
    --nf-accent: #2563eb;
    --nf-accent-tint: #2563eb1a;
    box-sizing: border-box;
    width: 100%;
    /* 高度由内容撑开（渲染后由 JS 测量并 resize 节点），避免内部滚动条 */
    height: auto;
    display: flex;
    /* 两侧留出连接端口可见区域，端口位于节点边缘、浮层卡片之外 */
    padding: 0 14px;
}

.nf-ncard-inner {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e6ecf5;
    border-radius: 14px;
    box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .18);
    overflow: hidden;
    font-family: inherit;
}

.nf-ncard-selected .nf-ncard-inner {
    border-color: var(--nf-accent);
    box-shadow: 0 0 0 2px var(--nf-accent-tint), 0 10px 22px -10px rgba(37, 99, 235, .45);
}

.nf-ncard-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px 0 12px;
    background: var(--nf-accent-tint);
    border-bottom: 1px solid #eef2f8;
}

.nf-ncard-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--nf-accent);
    flex: 0 0 auto;
}

.nf-ncard-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
}

.nf-ncard-title-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 22px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    border: 1px solid var(--nf-accent);
    border-radius: 6px;
    outline: none;
    cursor: text;
}

.nf-ncard-info {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--nf-accent);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    user-select: none;
}

/* 调度器胶囊内的 info 图标：紧邻开关右侧，复用节点 info 形态；尺寸收紧并加淡色内环，避免白底上糊成一片 */
.nf-orch-info {
    width: 16px;
    height: 16px;
    font-size: 10px;
    background: rgba(255, 255, 255, .92);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .32);
}

.nf-ncard-tip {
    display: none;
}

.nf-info-float {
    position: fixed;
    z-index: 4000;
    display: none;
    max-width: 240px;
    padding: 8px 11px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    line-height: 1.55;
    font-style: normal;
    font-weight: 400;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    box-shadow: 0 16px 36px -18px rgba(15, 23, 42, .38), 0 0 0 1px rgba(15, 23, 42, .04);
    pointer-events: none;
    word-break: break-word;
}

.nf-info-float.is-on {
    display: block;
}

/* 节点局部执行按钮：排在 info 图标左侧，常驻可见；与删除按钮同为 flex 自然序项，
   选中态出现删除按钮时靠标题 flex 收缩让位，不会互相遮挡。 */
.nf-ncard-exec {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--nf-accent);
    cursor: pointer;
}

.nf-ncard-exec:hover {
    background: var(--nf-accent);
    color: #fff;
}

.nf-ncard-exec svg {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
}

/* 运行中只做视觉降级，仍保持可点：点击后由命令层给出「请先暂停」的明确提示 */
.nf-ncard-run-run .nf-ncard-exec {
    opacity: .45;
}

.nf-ncard-delete {
    display: none;
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: #64748b;
    cursor: pointer;
}

.nf-ncard-selected .nf-ncard-delete {
    display: inline-flex;
}

.nf-ncard-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.nf-ncard-body {
    /* 高度随内容自适应，禁止内部滚动条 */
    flex: 0 0 auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
}

.nf-ncard-row {
    display: flex;
    flex-direction: column;
}

.nf-ncard-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.nf-ncard-spec-source .nf-ncard-label {
    margin-bottom: 6px;
}

.nf-ncard-spec-value {
    display: none;
}

.nf-spec-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    max-width: 100%;
    padding: 4px 8px 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    box-sizing: border-box;
}

.nf-spec-chip-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--nf-accent, #2563eb);
}

.nf-spec-chip-parts {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.nf-spec-chip-part {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    letter-spacing: .01em;
}

.nf-spec-chip-part.is-auto {
    color: #64748b;
    font-weight: 600;
}

.nf-spec-sep {
    display: inline-block;
    width: 1px;
    height: 11px;
    margin: 0 8px;
    flex: 0 0 auto;
    border-radius: 1px;
    background: linear-gradient(180deg, transparent, #cbd5e1 18%, #94a3b8 50%, #cbd5e1 82%, transparent);
    opacity: .9;
}

.nf-ncard-req {
    color: #ef4444;
    margin-left: 2px;
}

.nf-ncard-input {
    width: 100%;
    box-sizing: border-box;
    height: 30px;
    padding: 0 8px;
    font-size: 12.5px;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    outline: none;
    cursor: text;
}

.nf-ncard-input:focus {
    border-color: var(--nf-accent);
    box-shadow: 0 0 0 2px var(--nf-accent-tint);
}

.nf-ncard-area {
    height: 52px;
    padding: 6px 8px;
    resize: none;
    line-height: 1.4;
}

/* 文本域列表：逐项文本域（分场梗概 / 场次剧本 / 分镜脚本）。
   节点执行后按业务项回填，可逐项编辑；值以 JSON 数组存入节点参数。 */
.nf-ncard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.nf-ncard-list-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* 「场次选择」过滤显示：被藏起来的分镜不占位，但仍参与参数采集，人工编辑不丢失。 */
.nf-ncard-list-item[hidden] {
    display: none;
}

.nf-ncard-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

.nf-ncard-list-label {
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nf-ncard-list-remove {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.nf-ncard-list-remove:hover {
    border-color: #f87171;
    color: #dc2626;
}

.nf-ncard-list-area {
    height: 56px;
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

.nf-ncard-list-foot {
    display: flex;
    justify-content: flex-start;
}

.nf-ncard-list-add {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    padding: 3px 10px;
    cursor: pointer;
}

.nf-ncard-list-add:hover {
    border-color: var(--nf-accent, #2563eb);
    color: var(--nf-accent, #2563eb);
}

/* 文本输入（原「提示词输入」）：文本域只允许上下拖拽调节高度（宽度锁死），
   高度由内容与手动拖拽共同决定，节点高度再由 syncHtmlNodeSize 跟随撑开。 */
.nf-ncard.is-text-input .nf-ncard-area {
    height: auto;
    min-height: 52px;
    resize: vertical;
    overflow: hidden;
    box-sizing: border-box;
}

.nf-ncard-none {
    color: #94a3b8;
    font-size: 12px;
}

.nf-ncard-title.is-readonly {
    cursor: default;
}

.nf-ncard-result {
    min-height: 72px;
    height: auto;
    background: #f8fafc;
}

.nf-ncard-result-media {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.nf-ncard-result-media img,
.nf-ncard-result-media video {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    background: #0f172a;
    pointer-events: auto;
}

.nf-ncard-result-video video {
    max-height: 200px;
}

.nf-ncard-result-audio audio {
    width: 100%;
    min-height: 40px;
}

.nf-ncard-result-media.is-single-fill img,
.nf-ncard-result-media.is-single-fill video {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

.nf-ncard-result-placeholder {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
    word-break: break-all;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
}

.nf-ncard-view .nf-ncard-input:disabled,
.nf-ncard-view .nf-ncard-input[readonly] {
    background: #f8fafc;
    color: #334155;
    cursor: default;
}

/* ─────────────── 端口圆点与悬停标签 ─────────────── */

/* 端口文本默认隐藏，只保留圆点 */
.nf-wb-canvas .x6-port-label {
    opacity: 0;
    transition: opacity .12s ease;
    pointer-events: none;
    font-size: 11px;
    fill: #64748b;
}

/* 鼠标移入端口圆点时显示文本 */
.nf-wb-canvas .x6-port:hover .x6-port-label {
    opacity: 1;
}

/* 出端口在节点右侧：文本左对齐圆点，向节点外侧（右）展开，保证文本不压节点 */
.nf-wb-canvas .x6-port-out .x6-port-label {
    text-anchor: start;
}

/* 入端口在节点左侧：文本右对齐圆点，向节点外侧（左）展开 */
.nf-wb-canvas .x6-port-in .x6-port-label {
    text-anchor: end;
}

/* ─────────────── 右侧工具预览 ─────────────── */

.nf-preview-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.nf-preview-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-preview-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 10px;
}

.nf-preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 6px;
}

.nf-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

.nf-stat b {
    font-size: 16px;
    color: #1e293b;
}

.nf-stat span {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.nf-preview-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nf-preview-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.nf-preview-field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.nf-preview-node {
    font-size: 11px;
    color: #94a3b8;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-preview-fields .form-control {
    background: #f8fafc;
    opacity: 1;
}

.nf-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.nf-preview-tag {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10.5px;
}

.nf-preview-tag-req {
    background: #fef2f2;
    color: #dc2626;
}

/* ─────────────── 运行 Console（浅色） ─────────────── */

.nf-wb-console {
    flex: 0 0 188px;
    display: flex;
    flex-direction: column;
    min-height: 36px;
    background: #f8fafc;
    color: #334155;
    border-top: 1px solid var(--nf-border);
}

.nf-wb-console.nf-console-collapsed {
    flex-basis: 36px;
}

.nf-wb-console.nf-console-collapsed .nf-wb-console-body {
    display: none;
}

.nf-wb-console-head {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
}

.nf-wb-console-head strong {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #334155;
}

.nf-wb-console-status {
    margin-right: auto;
    font-size: 12px;
    color: #94a3b8;
}

.nf-wb-console-status.is-run {
    color: #059669;
}

.nf-wb-console-status.is-error {
    color: #dc2626;
}

.nf-wb-console-head .nf-btn-outline {
    color: #475569;
    background: #fff;
    border-color: #e2e8f0;
}

.nf-console-views {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    padding: 2px;
    border-radius: 8px;
    background: #f1f5f9;
}

.nf-console-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.nf-console-view:hover {
    color: #0f172a;
}

.nf-console-view.is-on {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.nf-wb-console-body {
    flex: 1;
    overflow: auto;
    padding: 8px 12px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
}

.nf-console-nodes {
    font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.nf-run-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.nf-run-item:hover {
    border-color: #93c5fd;
}

.nf-run-item.is-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.nf-run-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nf-run-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 700;
}

.nf-run-tag.is-release {
    background: #ecfdf5;
    color: #047857;
}

.nf-run-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.nf-run-status.is-success { color: #059669; }
.nf-run-status.is-failed { color: #dc2626; }
.nf-run-status.is-running { color: #2563eb; }

.nf-run-item small {
    color: #94a3b8;
    font-size: 11px;
}

.nf-run-item-error {
    color: #dc2626;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nf-cnode {
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.nf-cnode-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.nf-cnode-order {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
}

.nf-cnode-title {
    min-width: 0;
    flex: 1;
}

.nf-cnode-title strong {
    display: block;
    font-size: 12.5px;
    color: #0f172a;
}

.nf-cnode-title em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    color: #94a3b8;
}

.nf-cnode-body {
    display: none;
    padding: 0 10px 10px;
}

.nf-cnode.is-open .nf-cnode-body {
    display: block;
}

.nf-cnode-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.nf-cnode-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.nf-cnode-section {
    margin-top: 8px;
}

.nf-cnode-section h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 12px;
    color: #334155;
}

.nf-cnode-copy {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.nf-cnode-pre {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    padding: 8px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
}

.nf-cnode-kv {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 4px 8px;
    margin: 0;
    font-size: 12px;
}

.nf-cnode-kv dt {
    color: #64748b;
}

.nf-cnode-kv dd {
    margin: 0;
    color: #0f172a;
    word-break: break-all;
}

.nf-cnode-log {
    margin: 0 0 4px;
    color: #334155;
    font-size: 12px;
}

.nf-cnode-log.is-error { color: #dc2626; }
.nf-cnode-log.is-warn { color: #b45309; }

.nf-console-empty {
    color: #94a3b8;
    padding: 18px 4px;
}

.nf-console-line {
    display: grid;
    grid-template-columns: 76px 92px 1fr;
    gap: 8px;
    padding: 2px 0;
}

.nf-console-time {
    color: #94a3b8;
}

.nf-console-node {
    color: #2563eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-console-msg {
    color: #334155;
    word-break: break-word;
}

.nf-console-line.is-warn .nf-console-msg {
    color: #b45309;
}

.nf-console-line.is-error .nf-console-msg {
    color: #dc2626;
}

.nf-ncard-file {
    font-size: 11.5px;
}

.nf-ncard-file-name {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-ncard-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.nf-ncard-meta label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.nf-ncard-meta input {
    width: 72px;
    height: 26px;
}

.nf-palette-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.nf-palette-chip {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.nf-ncard-asset {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nf-ncard-bound {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.nf-ncard-bound-chip {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 10.5px;
    font-weight: 600;
}

.nf-ncard-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    background: #e2e8f0;
    color: #475569;
}

.nf-ncard-retry {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    height: 18px;
    padding: 0 6px 0 4px;
    border: 0;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    cursor: pointer;
}

.nf-ncard-retry svg {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
}

.nf-ncard-retry:hover {
    background: #ffedd5;
}

.nf-ncard-status-spin {
    width: 9px;
    height: 9px;
    border: 1.5px solid #93c5fd;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: nf-ncard-spin .7s linear infinite;
    flex: 0 0 auto;
}

@keyframes nf-ncard-spin {
    to { transform: rotate(360deg); }
}

@keyframes nf-edge-flow {
    to { stroke-dashoffset: -28; }
}

.x6-edge.nf-edge-flowing path:nth-child(2) {
    animation: nf-edge-flow .7s linear infinite;
}

.nf-ncard-status-ok,
.nf-ncard-run-ok .nf-ncard-status {
    background: #d1fae5;
    color: #047857;
}

.nf-ncard-status-err,
.nf-ncard-run-err .nf-ncard-status {
    background: #fee2e2;
    color: #b91c1c;
}

.nf-ncard-status-skip,
.nf-ncard-run-skip .nf-ncard-status {
    background: #fef3c7;
    color: #b45309;
}

.nf-ncard-status-run,
.nf-ncard-run-run .nf-ncard-status {
    background: #dbeafe;
    color: #1d4ed8;
}

.nf-ncard-run-run .nf-ncard-inner {
    box-shadow: 0 0 0 1px #bfdbfe, 0 6px 16px -8px rgba(15, 23, 42, .18);
}

.nf-ncard-run-ok .nf-ncard-inner {
    box-shadow: 0 0 0 1px #a7f3d0, 0 6px 16px -8px rgba(15, 23, 42, .18);
}

.nf-ncard-status-wait,
.nf-ncard-run-wait .nf-ncard-status {
    background: #fef3c7;
    color: #b45309;
}

.nf-ncard-run-wait .nf-ncard-inner {
    box-shadow: 0 0 0 1px #fde68a, 0 6px 16px -8px rgba(15, 23, 42, .18);
}

.nf-console-line.is-clickable {
    cursor: pointer;
    border-radius: 6px;
    padding-left: 4px;
    padding-right: 4px;
}

.nf-console-line.is-clickable:hover {
    background: rgba(148, 163, 184, .12);
}

.nf-preview-node-item {
    cursor: pointer;
}

.nf-preview-node-item:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.nf-cfg-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.nf-cfg-head-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nf-cfg-head-row strong {
    font-size: 13px;
}

.nf-cfg-head-aside {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nf-cfg-meta {
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.4;
    margin-left: auto;
    text-align: right;
}

.nf-cfg-run {
    margin-left: 0;
    gap: 5px;
}

.nf-cfg-section-title {
    margin: 4px 0 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

.nf-cfg-node {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.nf-cfg-node-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.nf-cfg-node-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    min-width: 0;
}

.nf-cfg-node-name strong {
    font-size: 13px;
    color: #0f172a;
}

.nf-stepper {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.nf-stepper button {
    width: 22px;
    height: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    line-height: 1;
    cursor: pointer;
}

.nf-stepper button:hover {
    border-color: #93c5fd;
    color: #2563eb;
}

.nf-stepper input {
    width: 40px;
    height: 22px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.nf-cfg-field {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #fafbfe;
}

.nf-cfg-field-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.nf-cfg-label-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

/* 表单项名称未填写（保存/另存为版本前校验不通过）的红框提示 */
.nf-cfg-label-input.nf-cfg-label-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .14);
}

.nf-cfg-type {
    flex: 0 0 auto;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
}

.nf-cfg-field-body {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.nf-cfg-field-control {
    flex: 1 1 0;
    min-width: 0;
    width: 50%;
    display: flex;
    flex-direction: column;
}

.nf-cfg-field-control textarea.nf-ncard-area,
.nf-cfg-field-control .nf-ncard-area {
    flex: 1 1 auto;
    height: 100%;
    min-height: 88px;
    box-sizing: border-box;
}

.nf-cfg-info-wrap {
    position: relative;
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
    display: flex;
}

.nf-cfg-info-wrap .nf-cfg-info {
    flex: 1 1 auto;
    width: 100%;
    min-height: 88px;
    height: auto;
    padding-right: 24px;
}

.nf-cfg-info-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    margin-left: 0;
    width: 16px;
    height: 16px;
    font-size: 10px;
    background: #eef2ff;
    color: #4338ca;
}

.nf-cfg-bound-note {
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
}

.nf-cfg-field-flags {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: nowrap;
}

.nf-cfg-sort {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    margin-left: auto;
}

.nf-cfg-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.nf-cfg-sort-btn svg {
    pointer-events: none;
}

.nf-cfg-sort-btn:hover:not(:disabled) {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
}

.nf-cfg-sort-btn:disabled {
    opacity: .35;
    cursor: default;
}

.nf-cfg-field-flags .nf-preview-tags {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
}

.nf-cfg-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    flex: 0 1 auto;
}

.nf-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.nf-switch input {
    appearance: none;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background .16s ease;
}

.nf-switch input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .2);
    transition: transform .16s ease;
}

.nf-switch input:checked {
    background: #2563eb;
}

.nf-switch input:checked::after {
    transform: translateX(14px);
}

.nf-switch input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.nf-switch-solo {
    min-height: 22px;
    width: auto;
}

.nf-ncard-ctrl .nf-switch-solo {
    align-self: flex-start;
}

.nf-cfg-info {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 88px;
    height: auto;
    resize: vertical;
    font-size: 12px;
    padding: 6px 24px 6px 8px;
    line-height: 1.45;
}

.nf-cfg-none {
    color: #94a3b8;
    font-size: 12px;
}

.nf-preview-tag-default {
    background: #ecfdf5;
    color: #047857;
}

.nf-ncard-field-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    vertical-align: middle;
}

.nf-cfg-info-wrap .nf-cfg-info-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    margin-left: 0;
    width: 16px;
    height: 16px;
    font-size: 10px;
    background: #eef2ff;
    color: #4338ca;
}

.nf-ncard-field-info .nf-ncard-tip {
    display: none;
}

.nf-ncard-compact {
    padding: 0 14px;
}

.nf-ncard-compact .nf-ncard-head {
    border-bottom: 0;
}

.nf-exp-nav {
    width: 72px;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    background: #fff;
    border-right: 1px solid var(--nf-border);
}

.nf-exp-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 60px;
    padding: 8px 4px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.nf-exp-nav-tab svg {
    width: 22px;
    height: 22px;
}

.nf-exp-nav-tab:hover {
    background: #f1f5f9;
    color: #334155;
}

.nf-exp-nav-tab.is-active {
    background: #eff6ff;
    color: #2563eb;
}

.nf-exp-panel {
    width: 300px;
    flex-basis: 300px;
}

.nf-exp-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.nf-exp-pane[hidden] {
    display: none !important;
}

.nf-exp-runbar {
    padding: 12px 14px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.nf-exp-run {
    width: 100%;
    height: 46px;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.nf-exp-run svg {
    flex: 0 0 auto;
}

.nf-exp-run-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .35);
    font-variant-numeric: tabular-nums;
}

.nf-exp-run-cost img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex: 0 0 auto;
}

.nf-exp-block {
    margin-top: 14px;
}

.nf-exp-block:first-of-type {
    margin-top: 0;
}

.nf-exp-block-title {
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

.nf-wb-panel-right {
    width: 360px;
    flex: 0 0 360px;
}

.nf-form-item .nf-ncard-field-info {
    margin-left: 2px;
}

/* ─────────────── 常规 info 图标（非节点场景统一使用） ─────────────── */
/* 与「节点 info 图标」(.nf-ncard-field-info 实心圆底 i) 区分：常规为描边圆圈 + i，参考 AI 扩图「原画质」提示图标。 */
.nf-info-regular {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    color: #94a3b8;
    cursor: help;
    vertical-align: middle;
    transition: color .15s ease;
}

.nf-info-regular:hover {
    color: #2563eb;
}

.nf-info-regular svg {
    width: 14px;
    height: 14px;
    display: block;
    pointer-events: none;
}

.nf-info-regular .nf-ncard-tip {
    display: none;
}

.nf-cfg-section-title {
    display: flex;
    align-items: center;
}

/* ─────────────── 工具配置：表单项卡片（上 / 中 / 下 布局） ─────────────── */
.nf-cfg-group + .nf-cfg-group {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.nf-cfg-group-title {
    display: flex;
    align-items: center;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.nf-cfg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

/* 「执行入口」等工具级配置行：非卡片，不参与隐藏 / 排序 / 拖拽，视觉上与卡片列表区分开 */
.nf-cfg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
}

.nf-cfg-row + .nf-cfg-row {
    margin-top: 10px;
}

.nf-cfg-row-label {
    flex: 0 0 64px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.nf-cfg-req {
    margin-left: 2px;
    color: #dc2626;
    font-weight: 700;
}

.nf-cfg-row-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 30px;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 12.5px;
}

.nf-cfg-row-input:focus {
    border-color: var(--nf-cfg-accent, #2563eb);
    box-shadow: 0 0 0 3px var(--nf-cfg-accent-tint, #2563eb1a);
    outline: none;
}

.nf-cfg-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

/* 颜色选择器：原生取色控件，去掉浏览器默认边框后做成小方块 */
.nf-cfg-color {
    flex: 0 0 30px;
    display: block;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.nf-cfg-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.nf-cfg-color::-webkit-color-swatch {
    border: 0;
    border-radius: 6px;
}

.nf-cfg-color::-moz-color-swatch {
    border: 0;
    border-radius: 6px;
}

.nf-cfg-color-hex {
    font-variant-numeric: tabular-nums;
}

.nf-cfg-card {
    position: relative;
    border: 1px solid #e6ebf3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    overflow: hidden;
    transition: box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}

.nf-cfg-card.is-hidden-field {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.nf-cfg-card.is-hidden-field .nf-cfg-card-mid,
.nf-cfg-card.is-hidden-field .nf-cfg-card-top,
.nf-cfg-card.is-hidden-field .nf-cfg-card-bottom {
    opacity: .5;
    filter: grayscale(1);
}

/* 画布单选节点 → 右侧「工具配置」对应卡片联动高亮；描边沿用节点强调色，需排在 is-hidden-field 之后才能覆盖灰底边框 */
.nf-cfg-card.is-node-selected {
    border-color: var(--nf-cfg-accent, #2563eb);
    box-shadow: 0 0 0 2px var(--nf-cfg-accent-tint, #2563eb1a);
}

.nf-cfg-card.is-dragging {
    opacity: .5;
    box-shadow: var(--nf-shadow-md);
}

/* 上：标题状态栏 */
.nf-cfg-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.nf-cfg-drag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 20px;
    color: #94a3b8;
    cursor: grab;
    border-radius: 5px;
}

.nf-cfg-drag:hover {
    color: #475569;
    background: #eef2f7;
}

.nf-cfg-drag:active {
    cursor: grabbing;
}

.nf-cfg-drag svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.nf-cfg-jump {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    border: 0;
    background: transparent;
    padding: 2px 4px;
    margin-left: auto;
    cursor: pointer;
    font-size: 11px;
    color: #64748b;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
}

.nf-cfg-jump:hover {
    background: #eef2ff;
    color: #4338ca;
}

.nf-cfg-jump .nf-cfg-comp {
    font-weight: 700;
    color: #4338ca;
}

.nf-cfg-jump .nf-cfg-sep {
    color: #cbd5e1;
}

.nf-cfg-jump .nf-cfg-jname {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 96px;
}

.nf-cfg-node-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

/* 中：表单组件管理内容（左右对半） */
.nf-cfg-card-mid {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 8px;
}

.nf-cfg-mid-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nf-cfg-mid-div {
    flex: 0 0 1px;
    width: 1px;
    margin: 0 8px;
    background: #eef2f7;
}

.nf-cfg-mid-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nf-cfg-name-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nf-cfg-name-wrap .nf-cfg-label-input {
    width: 100%;
    padding-right: 28px;
    font-weight: 600;
}

.nf-cfg-name-sync {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.nf-cfg-name-sync:hover {
    color: #2563eb;
    background: #eff6ff;
}

.nf-cfg-name-sync svg {
    width: 13px;
    height: 13px;
    pointer-events: none;
}

.nf-cfg-comp-slot {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.nf-cfg-comp-slot .nf-ncard-input,
.nf-cfg-comp-slot textarea.nf-ncard-area {
    width: 100%;
    min-height: 60px;
    box-sizing: border-box;
}

/* Tab（小型选项卡） */
.nf-cfg-tabs {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 2px;
    padding: 2px;
    background: #eef2f7;
    border-radius: 9px;
}

.nf-cfg-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.nf-cfg-tab svg {
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.nf-cfg-tab:hover {
    color: #475569;
}

.nf-cfg-tab.is-on {
    color: #2563eb;
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
}

.nf-cfg-panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 60px;
}

.nf-cfg-panel {
    display: none;
}

.nf-cfg-panel.is-on {
    display: block;
}

.nf-cfg-panel .nf-cfg-info,
.nf-cfg-panel .nf-cfg-placeholder-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

.nf-cfg-panel .nf-cfg-info {
    min-height: 60px;
    resize: vertical;
    padding: 6px 8px;
    line-height: 1.45;
}

.nf-cfg-panel .nf-stepper {
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* “输出最大数量限制”Tab下：文本独占一行，−/输入框/+ 数字选择器换到下一行 */
.nf-cfg-panel .nf-stepper > span {
    flex: 1 0 100%;
}

/* 下：配置功能面板栏 */
.nf-cfg-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: #fbfcfe;
    border-top: 1px solid #eef2f7;
}

.nf-cfg-card-bottom .nf-cfg-switches {
    flex: 1 1 auto;
    gap: 10px;
}

.nf-cfg-card-bottom .nf-cfg-sort {
    margin-left: auto;
}

.nf-cfg-more {
    position: relative;
    display: inline-flex;
}

.nf-cfg-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.nf-cfg-more-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
}

.nf-cfg-more-btn svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.nf-cfg-more-menu {
    position: absolute;
    right: 0;
    bottom: 26px;
    z-index: 20;
    min-width: 108px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    box-shadow: var(--nf-shadow-md);
    display: none;
}

.nf-cfg-more-menu.is-open {
    display: block;
}

.nf-cfg-more-menu button {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 12px;
    color: #334155;
    border-radius: 7px;
    cursor: pointer;
}

.nf-cfg-more-menu button:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* 拖拽落地位置指示线 */
.nf-cfg-drop-line {
    height: 0;
    border-top: 2px solid #2563eb;
    border-radius: 2px;
    margin: -1px 0;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}

.nf-form-item .nf-ncard-input,
.nf-cfg-field .nf-ncard-input {
    background: #fff;
}

.nf-ncard-row-solo .nf-ncard-ctrl {
    display: block;
    width: 100%;
}

.nf-asset-wrap {
    width: 100%;
}

.nf-asset-value {
    display: none;
}

.nf-asset-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.nf-asset-wrap:not(.is-multi) .nf-asset-grid {
    display: block;
}

.nf-asset-card {
    position: relative;
    box-sizing: border-box;
    width: 132px;
    height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

.nf-asset-wrap:not(.is-multi) .nf-asset-card,
.nf-ncard-ctrl .nf-asset-wrap:not(.is-multi) .nf-asset-card,
.nf-cfg-field-control .nf-asset-wrap:not(.is-multi) .nf-asset-card,
.nf-form-item .nf-asset-wrap:not(.is-multi) .nf-asset-card {
    width: 100%;
}

.nf-asset-wrap.is-multi .nf-asset-card {
    width: 100%;
    height: 132px;
}

.nf-asset-card.is-empty:hover,
.nf-asset-card.is-dragover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
}

.nf-asset-card.is-filled {
    border-style: solid;
    border-color: #e2e8f0;
    background: #0f172a;
}

.nf-asset-card.is-filled.is-audio {
    background: #f8fafc;
    color: #0f766e;
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    justify-content: flex-start;
    align-items: center;
}

.nf-asset-card-audio {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    pointer-events: none;
}

.nf-asset-audio-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: #0f766e;
}

.nf-asset-card-audio-name {
    flex: 1 1 auto;
    min-width: 0;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nf-asset-wrap:not(.is-multi) .nf-asset-card.is-filled.is-image-fit {
    height: auto;
    min-height: 88px;
    max-height: none;
    padding: 0;
    justify-content: flex-start;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.nf-asset-card.is-image-fit .nf-asset-card-img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.nf-asset-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.nf-asset-card-file {
    max-width: 86%;
    padding: 0 6px;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    word-break: break-all;
}

.nf-asset-card-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    pointer-events: auto;
}

.nf-asset-card-plus {
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
}

.nf-asset-wrap.is-multi .nf-asset-card-plus {
    font-size: 28px;
}

.nf-asset-card-hint {
    font-size: 11px;
    font-weight: 600;
}

.nf-asset-wrap.is-multi .nf-asset-card-hint {
    font-size: 11px;
}

.nf-asset-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .46);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.nf-asset-card.is-filled:hover .nf-asset-card-overlay {
    display: flex;
}

.nf-asset-wrap.is-multi .nf-asset-card.is-filled .nf-asset-card-overlay {
    display: none;
}

.nf-asset-card-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.nf-asset-card-remove:hover {
    background: #dc2626;
}

.nf-ncard-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
    padding: 4px 8px;
    background: #f8fafc;
    font-size: 11px;
    color: #475569;
}

.nf-ncard-chrome-top {
    border-bottom: 1px solid #eef2f8;
}

.nf-ncard-chrome-bottom {
    border-top: 1px solid #eef2f8;
}

.nf-ncard-chrome-left {
    min-width: 0;
    flex: 1 1 auto;
}

.nf-mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nf-mode-chip {
    border: 1px solid #dbe4f0;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    line-height: 18px;
    cursor: pointer;
}

.nf-mode-chip.is-on {
    border-color: var(--nf-accent, #2563eb);
    background: var(--nf-accent-tint, #2563eb1a);
    color: var(--nf-accent, #2563eb);
    font-weight: 600;
}

.nf-batch-cell.is-media.is-audio {
    aspect-ratio: auto;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
}

.nf-ncard.is-preview-audio .nf-batch-cell.is-media.is-audio,
.nf-ncard.is-preview-audio .nf-batch-cell.is-audio {
    width: var(--nf-cell-w, 100%);
}

.nf-batch-cell.is-audio audio {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
}

.nf-ncard-stepper {
    margin-left: 0;
}

.nf-batch-styles {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.nf-batch-style,
.nf-batch-rotate,
.nf-batch-nav,
.nf-batch-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.nf-batch-style svg,
.nf-batch-rotate svg,
.nf-batch-next svg {
    width: 14px;
    height: 14px;
}

.nf-batch-style:hover,
.nf-batch-rotate:hover,
.nf-batch-nav:hover,
.nf-batch-next:hover {
    border-color: #bfdbfe;
    color: #2563eb;
    background: #eff6ff;
}

.nf-batch-style.is-on {
    border-color: var(--nf-accent);
    color: var(--nf-accent);
    background: #fff;
}

.nf-batch-picked {
    font-weight: 700;
    color: #0f172a;
}

.nf-batch-picked.is-over {
    color: #b45309;
}

.nf-batch-modes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 600;
}

.nf-batch-radio {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    cursor: pointer;
}

.nf-batch-count {
    width: 42px;
    height: 22px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.nf-batch-pick-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-weight: 600;
    color: #94a3b8;
}

.nf-batch-pick-toggle > span.is-on {
    color: #0f172a;
    font-weight: 700;
}

.nf-batch-pick-toggle.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.nf-batch-next {
    border-color: var(--nf-accent);
    color: var(--nf-accent);
    background: #fff;
    font-weight: 700;
}

.nf-batch-grid {
    display: grid;
    gap: 6px;
    width: 100%;
}

.nf-batch-grid.is-page {
    grid-template-columns: minmax(0, 1fr);
}

.nf-batch-grid.is-page.is-row {
    grid-template-columns: repeat(var(--nf-cols, 1), var(--nf-cell-w, 100%));
    width: max-content;
    max-width: none;
}

.nf-batch-grid.is-page.is-col {
    grid-template-columns: minmax(0, 1fr);
}

.nf-batch-grid.is-matrix {
    grid-template-columns: repeat(var(--nf-cols, 1), var(--nf-cell-w, 100%));
    width: max-content;
    max-width: none;
}

.nf-ncard.is-preview .nf-batch-grid.is-matrix {
    max-width: 100%;
}

.nf-batch-scroll-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.nf-batch-scroll-wrap.is-row {
    width: max-content;
    max-width: none;
}

.nf-batch-scroll-wrap.is-col {
    flex-direction: column;
}

.nf-batch-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    flex: 1 1 auto;
    min-width: 0;
}

.nf-batch-scroll.is-row {
    width: var(--nf-scroll-w, 100%);
    max-width: var(--nf-scroll-w, none);
    overflow-y: hidden;
    scrollbar-width: none;
}

.nf-batch-scroll.is-row::-webkit-scrollbar {
    display: none;
}

.nf-batch-scroll.is-col {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    max-height: var(--nf-scroll-h, none);
    width: 100%;
}

.nf-batch-scroll .nf-batch-cell {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.nf-batch-scroll.is-row .nf-batch-cell {
    flex: 0 0 var(--nf-cell-w, 100%);
    width: var(--nf-cell-w, 100%);
}

.nf-batch-scroll.is-col .nf-batch-cell {
    flex: 0 0 auto;
    width: 100%;
}

.nf-batch-nav {
    width: 20px;
    padding: 0;
    flex: 0 0 auto;
}

.nf-batch-nav.is-left,
.nf-batch-nav.is-right {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 22px;
    height: 28px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .94);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px -6px rgba(15, 23, 42, .35);
}

.nf-batch-nav.is-left {
    left: 0;
}

.nf-batch-nav.is-right {
    right: 0;
}

.nf-batch-nav.is-up,
.nf-batch-nav.is-down {
    width: 100%;
    height: 18px;
    transform: rotate(90deg);
}

.nf-batch-cell {
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.nf-batch-cell.is-media {
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.nf-batch-cell.is-text {
    width: 100%;
}

.nf-batch-cell.is-text.is-empty {
    min-height: 88px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.nf-batch-index {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

.nf-batch-cell.is-text:has(.nf-batch-index) .nf-batch-text {
    padding-top: 22px;
}

.nf-ncard-input[readonly],
.nf-ncard-input:disabled {
    cursor: default;
}

.nf-ncard button,
.nf-ncard .nf-batch-style,
.nf-ncard .nf-batch-rotate,
.nf-ncard .nf-batch-nav,
.nf-ncard .nf-batch-next,
.nf-ncard .nf-batch-radio,
.nf-ncard .nf-ncard-delete,
.nf-ncard .nf-stepper button {
    cursor: pointer;
}

.nf-batch-cell.is-media img,
.nf-batch-cell.is-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nf-batch-cell.is-media.is-fit {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nf-batch-cell.is-media.is-fit img,
.nf-batch-cell.is-media.is-fit video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nf-batch-cell.is-media.is-fit.is-landscape img,
.nf-batch-cell.is-media.is-fit.is-landscape video {
    width: 100%;
    height: auto;
    max-height: 100%;
}

.nf-batch-cell.is-media.is-fit.is-portrait img,
.nf-batch-cell.is-media.is-fit.is-portrait video {
    width: auto;
    height: 100%;
    max-width: 100%;
}

/* 首选地址与平台访问代理都取不到内容时：明确提示预览不可用，避免只剩一片空白格。 */
.nf-batch-cell.is-media.is-broken {
    position: relative;
    background: #fef2f2;
    border-color: #fecaca;
}

.nf-batch-cell.is-media.is-broken::after {
    content: "预览不可用";
    position: absolute;
    inset: auto 0 6px;
    text-align: center;
    color: #b91c1c;
    font-size: 11px;
    line-height: 16px;
    pointer-events: none;
}

.nf-batch-cell.is-media.is-broken img,
.nf-batch-cell.is-media.is-broken video {
    display: none;
}

.nf-batch-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.nf-batch-text {
    width: 100%;
    min-height: 88px;
    height: 88px;
    resize: none;
}

.nf-merge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nf-merge-item {
    position: relative;
}

.nf-merge-key {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    width: 42%;
    max-width: 148px;
    min-width: 64px;
    height: 18px;
    padding: 0 6px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: left;
}

.nf-merge-key:focus {
    outline: 1px solid #fff;
    background: #0f766e;
}

.nf-merge-item .nf-batch-text {
    padding-top: 22px;
}

.nf-merge-template-wrap {
    position: relative;
    margin-top: 8px;
}

.nf-merge-template {
    min-height: 72px;
    resize: vertical;
}

/* 自定义文本模式：左右双列布局，中间为同步按钮。JSON 文本模式去掉中间列。 */
.nf-merge-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
}

.nf-merge-cols.is-json {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* 转JSON：左列（端口区域卡）固定宽，右侧 JSON 预览吃掉剩余宽度 */
.nf-merge-cols.is-json.is-jc {
    grid-template-columns: var(--nf-jc-list-w, 200px) minmax(0, 1fr);
}

/* 转JSON：左列（端口卡片）固定窄宽（约为原来的一半），右侧 JSON 预览吃掉剩余宽度 */
.nf-ncard.is-json-compose .nf-merge-cols.is-json {
    grid-template-columns: var(--nf-jc-list-w, 116px) minmax(0, 1fr);
}

.nf-json-view {
    height: 100%;
    min-height: 96px;
    overflow: auto;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    color: #0f172a;
}

.nf-json-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 1px 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.nf-json-caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    border-left: 5px solid #64748b;
}

.nf-json-node.is-open > .nf-json-toggle .nf-json-caret {
    transform: rotate(90deg);
}

.nf-json-node.is-collapsed > .nf-json-children {
    display: none;
}

.nf-json-children {
    margin-left: 12px;
}

.nf-json-key {
    color: #0f766e;
}

.nf-json-key::after {
    content: ": ";
    color: #94a3b8;
}

.nf-json-val {
    color: #334155;
}

.nf-json-meta {
    color: #94a3b8;
}

.nf-json-leaf {
    padding: 1px 0 1px 9px;
    word-break: break-all;
}

.nf-merge-col {
    min-width: 0;
}

.nf-merge-mid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nf-merge-sync {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nf-merge-sync svg {
    width: 13px;
    height: 13px;
}

.nf-merge-sync:hover {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.nf-merge-sync:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* 双列布局中的右侧文本域：占满整列并与左侧列表等高 */
.nf-merge-cols .nf-merge-template-wrap {
    margin-top: 0;
    height: 100%;
}

.nf-merge-cols .nf-merge-template {
    width: 100%;
    height: 100%;
    min-height: 96px;
    resize: none;
    box-sizing: border-box;
}

/* 双列布局中文本域占满整列，@ 提及菜单改为覆盖在文本域顶部，避免被卡片裁剪 */
.nf-merge-cols .nf-mention {
    top: 6px;
    bottom: auto;
    margin-top: 0;
}

.nf-mention {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    max-height: 140px;
    overflow: auto;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.nf-mention-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 6px 10px;
    font-size: 12px;
    color: #0f172a;
    cursor: pointer;
}

.nf-mention-item:hover,
.nf-mention-item.is-active {
    background: #ecfdf5;
    color: #0f766e;
}

.nf-mention-empty {
    padding: 8px 10px;
    font-size: 12px;
    color: #94a3b8;
}

.nf-extract-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nf-extract-index {
    width: 88px;
}

.nf-extract-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nf-extract-split {
    width: auto;
    min-width: 76px;
    height: 24px;
    padding: 0 6px;
    font-size: 12px;
}

.nf-extract-hint {
    padding: 8px 10px;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

/* 提取节点底部栏：标签与右侧输入框固定宽度，「提取内容」下拉吃掉两者之间的全部剩余空间。
   下拉用 flex:1 + min-width:0 双向约束——剩余多就多占、剩余少就少占，
   且不会把内容尺寸传导给卡片外壳（min-width:0 是关键，否则长文案会把整张卡片撑宽）。 */
.nf-ncard.is-text-extract .nf-ncard-chrome-bottom {
    flex-wrap: nowrap;
    gap: 6px;
}

/* 左侧「提取内容」组占据剩余空间，作为下拉的伸缩容器 */
.nf-ncard.is-text-extract .nf-batch-modes {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

/* 标签文字固定宽度，不参与伸缩 */
.nf-ncard.is-text-extract .nf-batch-modes > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 右侧输入框固定不收缩，始终留在同一行右端 */
.nf-extract-pick {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* 提取内容下拉：宽度 100% 吃满剩余空间，但受 flex 收缩约束，不影响卡片整体宽度 */
.nf-extract-content {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 24px;
    padding: 0 4px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #0f172a;
}

.nf-extract-content:focus {
    outline: 1px solid var(--nf-accent, #115e59);
}

.nf-extract-pick-input {
    width: 88px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #0f172a;
}

/* 序号框已改为纯文本输入（允许填文本），此处保留 type=number 的兼容隐藏规则（历史存量节点仍可能命中） */
.nf-extract-pick-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.nf-extract-pick-input[type="number"]::-webkit-outer-spin-button,
.nf-extract-pick-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select.nf-extract-pick-input {
    width: auto;
    min-width: 84px;
    max-width: 88px;
}

.nf-ncard.is-text-extract .nf-ncard-body,
.nf-ncard.is-text-select .nf-ncard-body,
.nf-ncard.is-text-merge .nf-ncard-body {
    min-height: 48px;
}

/* ───────── JSON提取：沿用文本提取的顶栏/底栏排版 ───────── */
.nf-ncard.is-json-extract .nf-ncard-chrome-bottom {
    flex-wrap: nowrap;
    gap: 6px;
}

.nf-ncard.is-json-extract .nf-batch-modes {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.nf-ncard.is-json-extract .nf-ncard-body {
    min-height: 48px;
}

/* JSON提取底栏：左「提取内容」单选 + 取值输入框，最右「批量」勾选框固定不收缩 */
.nf-ncard.is-json-extract .nf-jex-bottom {
    align-items: center;
}

.nf-jex-batch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    border-left: 1px solid #eef2f8;
    color: #475569;
    font-size: 11px;
    line-height: 18px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.nf-jex-batch input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    cursor: pointer;
}

.nf-jex-batch.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* 文本选择标题：必填为空时红底提示（默认空 + “请输入标题”占位） */
.nf-merge-key.nf-select-title::placeholder {
    color: #cbd5e1;
    opacity: .9;
}

.nf-merge-key.nf-select-title.is-title-empty {
    background: rgba(185, 28, 28, .82);
}

.nf-merge-key.nf-select-title.is-title-empty:focus {
    outline: 1px solid #fff;
    background: #b91c1c;
}

.nf-batch-cell.is-selectable {
    cursor: pointer;
}

.nf-batch-cell.is-selectable.is-media::after,
.nf-batch-cell.is-selected.is-media::after,
.nf-batch-cell.is-over.is-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.nf-batch-cell.is-selectable:not(.is-selected)::after {
    background: rgba(15, 23, 42, .34);
}

.nf-batch-cell.is-selected.is-media {
    box-shadow: 0 0 0 3px #2563eb;
}

.nf-batch-cell.is-selected.is-media::after {
    background: rgba(37, 99, 235, .16);
}

.nf-batch-cell.is-over.is-media {
    box-shadow: 0 0 0 3px #d97706;
}

.nf-batch-cell.is-over.is-media::after {
    background: rgba(217, 119, 6, .28);
}

.nf-batch-check {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
    z-index: 3;
}

.nf-batch-cell.is-selectable .nf-batch-check {
    display: block;
}

.nf-batch-cell.is-selected:not(.is-media),
.nf-batch-cell.is-selectable.is-text.is-selected {
    box-shadow: 0 0 0 3px #2563eb;
    border-radius: 8px;
}

.nf-batch-cell.is-over:not(.is-media),
.nf-batch-cell.is-selectable.is-text.is-over {
    box-shadow: 0 0 0 3px #d97706;
    border-radius: 8px;
}

.nf-batch-cell.is-selected .nf-batch-check,
.nf-batch-cell.is-over .nf-batch-check {
    border-color: transparent;
    background: #2563eb;
}

.nf-batch-cell.is-over .nf-batch-check {
    background: #d97706;
}

.nf-batch-cell.is-selected .nf-batch-check::after,
.nf-batch-cell.is-over .nf-batch-check::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

.nf-batch-flag {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 3;
    padding: 1px 6px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}

.nf-batch-flag.is-over {
    background: #d97706;
}

/* 编排阶段音频编辑：独立时间轴，不改变上传卡片或其它媒体预览语义。 */
.nf-audio-editor {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    color: #334155;
    font-size: 11px;
    line-height: 1.45;
    user-select: none;
    cursor: default;
}
.nf-audio-editor [hidden] { display: none !important; }
.nf-audio-editor button,
.nf-audio-editor select,
.nf-audio-editor input[type="number"] {
    box-sizing: border-box;
    min-width: 0;
    height: 29px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 7px;
    background: #fff;
    color: #334155;
    font: inherit;
}
.nf-audio-editor button:disabled { opacity: .45; cursor: not-allowed; }
.nf-audio-editor button:focus-visible,
.nf-audio-editor input:focus-visible,
.nf-audio-editor select:focus-visible,
.nf-ae-wave:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}
.nf-ae-modes { display: grid; grid-template-columns: .8fr .8fr 1.15fr 1.55fr; gap: 4px; }
.nf-ae-modes button { padding-inline: 3px; white-space: nowrap; }
.nf-ae-modes .is-on,
.nf-audio-editor [data-ae-play] {
    color: #065f46;
    border-color: #5eead4;
    background: #ccfbf1;
}
.nf-ae-status {
    box-sizing: border-box;
    height: 46px;
    overflow: auto;
    overflow-wrap: anywhere;
    padding: 5px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    user-select: text;
}
.nf-audio-editor.is-error .nf-ae-status { color: #b45309; background: #fffbeb; }
.nf-ae-wave {
    position: relative;
    height: 80px;
    margin-inline: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}
.nf-ae-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.nf-ae-selection { position: absolute; top: 0; bottom: 0; background: #ccfbf1; pointer-events: none; }
.nf-audio-editor .nf-ae-handle {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 13px;
    height: auto;
    border: 1px solid #047857;
    border-radius: 4px;
    padding: 0;
    background: #0d9488;
    transform: translateX(-50%);
    cursor: ew-resize;
    touch-action: none;
    z-index: 4;
}
.nf-ae-handle::after {
    content: "";
    position: absolute;
    top: 35%;
    left: 4px;
    height: 30%;
    width: 3px;
    border-inline: 1px solid #ecfdf5;
}
.nf-ae-cursor { position: absolute; top: -4px; bottom: -4px; width: 2px; left: 0; background: #e11d48; z-index: 3; pointer-events: none; }
.nf-ae-cursor::before { content: ""; position: absolute; left: -3px; top: -1px; border: 4px solid transparent; border-top-color: #e11d48; }
.nf-ae-ruler { display: flex; justify-content: space-between; color: #64748b; font-variant-numeric: tabular-nums; }
.nf-ae-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 48px; align-items: end; }
.nf-ae-fields label { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.nf-ae-fields input[type="number"] { width: 100%; user-select: text; font-variant-numeric: tabular-nums; }
.nf-audio-editor input[type="range"] { width: 100%; margin: 7px 0; accent-color: #0d9488; touch-action: none; }
.nf-audio-editor input[type="checkbox"] { accent-color: #0d9488; }
.nf-ae-duration { min-height: 30px; font-variant-numeric: tabular-nums; color: #0f766e; }
.nf-ae-transport { display: flex; align-items: center; gap: 6px; }
.nf-ae-transport select { flex: 1; }
.nf-ae-transport label { display: inline-flex; align-items: center; gap: 3px; margin: 0; white-space: nowrap; }
.nf-ae-footer { display: flex; align-items: center; gap: 5px; }
.nf-ae-footer [data-ae-time] { flex: 1; font-variant-numeric: tabular-nums; }
.nf-ae-footer button { height: 25px; color: #64748b; }
@media (prefers-contrast: more) {
    .nf-ae-selection { outline: 2px solid #047857; }
    .nf-ae-wave { background: #cbd5e1; }
}

/* ───────── 画布框选 / 多选插件（X6 Selection & Snapline） ───────── */

/* 多选选中框：品牌色虚线描边，与节点单选高亮同一色系 */
.x6-widget-selection-box {
    border: 1.5px dashed #2563eb;
    border-radius: 12px;
    background: rgba(37, 99, 235, .04);
    box-shadow: none;
}

/* 橡皮筋框选矩形：半透明品牌色 */
.x6-widget-selection-rubberband {
    border: 1px solid #2563eb;
    border-radius: 4px;
    background: rgba(37, 99, 235, .12);
    box-shadow: none;
}

/* 对齐参考线：品牌色加粗，点阵背景上更醒目 */
.x6-widget-snapline {
    stroke: #2563eb;
    stroke-width: 1.2;
}

/* ───────── 连线断开节点引导悬浮层 ───────── */

.nf-connect-popover {
    position: absolute;
    z-index: 30;
    width: 300px;
    max-width: calc(100% - 16px);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    overflow: hidden;
    user-select: none;
}

.nf-connect-popover-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.nf-connect-popover-port {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.nf-connect-popover-from {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.nf-connect-popover-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
}

.nf-connect-popover-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.nf-connect-popover-body {
    max-height: 260px;
    overflow: auto;
    padding: 6px;
}

.nf-connect-popover-group + .nf-connect-popover-group {
    margin-top: 6px;
}

.nf-connect-popover-group-title {
    padding: 4px 6px 3px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.nf-connect-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.nf-connect-popover-item:hover {
    background: #ecfdf5;
}

.nf-connect-popover-item .nf-palette-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
}

.nf-connect-popover-name {
    flex: 0 0 auto;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.nf-connect-popover-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    min-width: 0;
}

.nf-connect-popover-chip {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.nf-connect-popover-empty {
    padding: 14px 10px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

/* ───────── 编排组件（调度器 / 容器）：纯组件形态，无标题栏、info、删除与内容区域 ───────── */

/* 根元素铺满整个节点几何区域：X6 的就近吸附按磁体元素外框判定，铺满后组件任意位置都是端口落点 */
.nf-orch {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    cursor: default;
}

/* 调度器：开关胶囊组件 */
.nf-orch-scheduler {
    padding: 0 14px;
}

.nf-orch-pill {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e6ecf5;
    border-radius: 999px;
    box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .28);
    cursor: grab;
}

.nf-orch-scheduler.nf-ncard-selected .nf-orch-pill {
    border-color: var(--nf-accent);
    box-shadow: 0 0 0 2px var(--nf-accent-tint);
}

.nf-ncard-run-ok.nf-orch-scheduler .nf-orch-pill {
    border-color: rgba(22, 163, 74, .5);
}

.nf-ncard-run-err.nf-orch-scheduler .nf-orch-pill {
    border-color: rgba(220, 38, 38, .55);
}

.nf-ncard-run-skip.nf-orch-scheduler .nf-orch-pill,
.nf-ncard-run-wait.nf-orch-scheduler .nf-orch-pill {
    border-color: rgba(148, 163, 184, .6);
}

.nf-orch-state {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    user-select: none;
    white-space: nowrap;
}

/* 容器缩放手柄：X6 原生手柄为 10px 纯黑描边小圆点，这里放大到 14px 并改为蓝色圆角方块，
   右下角（bottom-right）作为「从右下角拉大/拉小宽高」的主入口，配色再加重一档。
   X6 用 -5px 偏移把 10px 手柄压在边框中线上，放大到 14px 后偏移同步改为 -7px。 */
.x6-widget-transform > .x6-widget-transform-resize {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border-color: #94a3b8;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .22);
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='bottom-right'] {
    right: -7px;
    bottom: -7px;
    border-color: #2563eb;
    background-color: #dbeafe;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='bottom-right']:hover {
    background-color: #bfdbfe;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='top-left'],
.x6-widget-transform > .x6-widget-transform-resize[data-position='bottom-left'] {
    left: -7px;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='top-left'],
.x6-widget-transform > .x6-widget-transform-resize[data-position='top-right'] {
    top: -7px;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='top-right'] {
    right: -7px;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='top'],
.x6-widget-transform > .x6-widget-transform-resize[data-position='bottom'] {
    margin-left: -7px;
}

.x6-widget-transform > .x6-widget-transform-resize[data-position='left'],
.x6-widget-transform > .x6-widget-transform-resize[data-position='right'] {
    margin-top: -7px;
}

/* 容器：可调节的矩形区域组件（子节点为独立 X6 节点，浮在区域之上） */
.nf-orch-container {
    position: relative;
    align-items: flex-start;
    justify-content: flex-start;
    background: rgba(100, 116, 139, .06);
    border: 1.5px dashed rgba(100, 116, 139, .55);
    border-radius: 12px;
    cursor: move;
}

/* 顶部左侧的容器节点名称（未自定义时不渲染该标签）。
   默认贴在边框内侧上沿（任何环境都不会被节点边界裁掉）；
   容器节点的 foreignObject 放开裁剪后，标题再上移到边框中线上，真正压住边框。 */
/* 容器顶部左侧压边框的一行：循环标志与容器节点名称在同一 flex 行内连排，
   名称始终跟在标志后面，标志宽度变化（×N / 指定次数）都不会重叠。
   默认贴在边框内侧上沿（任何环境都不会被节点边界裁掉）；
   容器节点的 foreignObject 放开裁剪后，这一行再上移到边框中线上，真正压住边框。 */
.nf-orch-head {
    position: absolute;
    top: 2px;
    left: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 4px);
    height: 18px;
    user-select: none;
    /* 不参与命中：不阻断整块区域的拖动与连线落点 */
    pointer-events: none;
}

.nf-orch-label {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 6px;
    background: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    color: #64748b;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
}

.nf-wb-canvas .x6-node foreignObject:has(.nf-orch-container) {
    overflow: visible;
}

.nf-wb-canvas .x6-node foreignObject:has(.nf-orch-container) .nf-orch-head {
    top: -9px;
}

.nf-orch-container.nf-ncard-selected .nf-orch-label {
    color: var(--nf-accent);
}

.nf-orch-container.nf-ncard-selected {
    border-style: solid;
    border-color: var(--nf-accent);
    background: var(--nf-accent-tint);
}

.nf-ncard-run-ok.nf-orch-container {
    border-color: rgba(22, 163, 74, .55);
}

.nf-ncard-run-err.nf-orch-container {
    border-color: rgba(220, 38, 38, .6);
}

.nf-ncard-run-skip.nf-orch-container,
.nf-ncard-run-wait.nf-orch-container {
    border-color: rgba(148, 163, 184, .7);
}

/* 连线正落在容器区域上时的整体高亮（调度器出口「容器」的落点就是整块区域） */
.nf-orch-container.nf-orch-drop {
    border-style: solid;
    border-color: var(--nf-accent);
    background: var(--nf-accent-tint);
    box-shadow: 0 0 0 3px var(--nf-accent-tint) inset;
}

/* 条件分支 / 循环调度的调度信号落在调度器胶囊上时同样整块高亮 */
.nf-orch-scheduler.nf-orch-drop .nf-orch-pill {
    border-color: var(--nf-accent);
    box-shadow: 0 0 0 3px var(--nf-accent-tint) inset;
}

/* 容器自适应扩大以包含子节点后的一次边界脉冲，让「自动放大」这一步可见 */
.nf-orch-container.nf-orch-grow {
    animation: nf-orch-grow .42s ease-out;
}

@keyframes nf-orch-grow {
    0% {
        border-color: var(--nf-accent);
        box-shadow: 0 0 0 4px var(--nf-accent-tint) inset;
    }

    100% {
        border-color: rgba(100, 116, 139, .55);
        box-shadow: 0 0 0 0 rgba(100, 116, 139, 0) inset;
    }
}

.nf-orch-hint {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(100, 116, 139, .85);
    user-select: none;
    pointer-events: none;
}

/* ───────── 转JSON：左侧每端口一张区域卡片 + 右 JSON 预览 ───────── */
.nf-jc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.nf-jc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 每个端口独立成卡：左上角 KEY 输入框，中部按类型渲染预览域（文本域/图像域/视频域/音频条），
   预览域内居中叠加类型图标（文本类型除外），卡片左下角为「批量XX」勾选行 */
.nf-jc-port {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px;
}

.nf-jc-stage {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* 预览域：图像/视频为 1:1 方形占位，尺寸由左列宽度决定 */
.nf-jc-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 音频预览域：沿用文本/图像/视频统一的「KEY / 预览域 / 批量勾选」结构，
   但去掉 aspect-ratio: 1/1 改用固定高度——套方形会比原播放器卡高一倍多。
   84px 与「播放器条 + KEY + 勾选」的紧凑观感接近，类型图标由 .nf-jc-overlay 上下居中 */
.nf-jc-port.is-audio .nf-jc-media.is-audio {
    aspect-ratio: auto;
    height: 84px;
}

/* 文本域：宽高口径与「文本合并」左侧文本域一致 */
.nf-jc-text {
    width: 100%;
    min-height: 88px;
    height: 88px;
    resize: none;
    /* 顶部留出 KEY 输入框的位置，避免首行文字被盖住 */
    padding-top: 24px;
}

/* 类型图标：居中叠加在预览域上（文本类型不渲染图标） */
.nf-jc-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.nf-jc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #7c3aed;
    opacity: .85;
}

.nf-jc-icon svg {
    width: 100%;
    height: 100%;
}

.nf-jc-port .nf-jc-key {
    width: 46%;
    max-width: 118px;
    min-width: 56px;
}

.nf-jc-port .nf-jc-del {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    margin-left: 0;
}

/* 「批量XX」勾选行：固定在端口卡左下角，文案随端口类型变化 */
.nf-jc-multi {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: flex-start;
    height: 18px;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}

/* 「添加输入」按钮与上方卡片列表保持间距，避免贴在一起 */
.nf-jc-addbar {
    display: flex;
    margin-top: 16px;
}

.nf-jc-addbar .nf-jc-add {
    margin-top: 0;
}

.nf-jc-del,
.nf-cond-del {
    flex: none;
    margin-left: auto;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.nf-jc-del:hover,
.nf-cond-del:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.nf-jc-add,
.nf-cond-add {
    align-self: flex-start;
    margin-top: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
}

.nf-jc-add:hover,
.nf-cond-add:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* ───────── 条件分支：条件块 + 条件组 + 规则行 ───────── */
.nf-cond {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.nf-cond-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nf-cond-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nf-cond-name {
    font-size: 12px;
    font-weight: 700;
    color: #be185d;
}

.nf-cond-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nf-cond-group {
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nf-cond-join {
    display: flex;
    justify-content: center;
}

select.nf-cond-op {
    width: 76px;
    text-align: center;
    font-weight: 700;
}

.nf-cond-rule {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nf-cond-rule .nf-cond-key {
    width: 84px;
    flex: none;
}

/* 「当」引导词与规则类型只读标签：同为默认强调字重与颜色，不使用额外配色 */
.nf-cond-when {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    flex: none;
}

.nf-cond-type-tag {
    max-width: 132px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    line-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: none;
}

/* 逻辑下拉需完整显示「等于/不等于/包含」等三个字，选项统一左对齐 */
select.nf-cond-logic {
    width: 66px;
    flex: none;
    font-weight: 700;
    text-align: left;
    padding-left: 6px;
}

select.nf-cond-logic option {
    text-align: left;
    direction: ltr;
}

.nf-cond-rule .nf-cond-value {
    flex: 1;
    min-width: 72px;
}

.nf-cond-add-rule {
    align-self: flex-start;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.nf-cond-add-rule:hover {
    background: #eff6ff;
    color: #2563eb;
}

.nf-cond-foot {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 无规则条件的空态提示：与运行逻辑同口径（空条件视为成立） */
.nf-cond-empty {
    padding: 6px 8px;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ───────── 规则级联菜单（挂在画布容器内，规避卡片 overflow:hidden 裁剪） ───────── */
.nf-cond-menu {
    position: absolute;
    z-index: 40;
    min-width: 132px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
    user-select: none;
}

.nf-cond-menu-head {
    padding: 4px 8px 6px;
    font-size: 11px;
    color: #94a3b8;
}

/* 「添加输入」类型下拉：单层列表，宽度按最长项收敛 */
.nf-jc-kind-menu {
    min-width: 92px;
}

.nf-cond-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #0f172a;
    white-space: nowrap;
    cursor: pointer;
}

.nf-cond-menu-item:hover {
    background: #eff6ff;
    color: #2563eb;
}

.nf-cond-menu-cascade::after,
.nf-cond-menu-group::after {
    content: "›";
    color: #94a3b8;
}

.nf-cond-menu-cascade:hover::after,
.nf-cond-menu-group:hover::after {
    color: #2563eb;
}

/* 二级：规则分组；三级：规则类型。悬停逐级展开，子层是父项的 DOM 子节点，:hover 链不会断 */
.nf-cond-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -5px;
    min-width: 116px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}

.nf-cond-menu-item:hover > .nf-cond-submenu {
    display: block;
}

/* ───────── 容器策略：右上角设置图标 + 循环标志 + 策略浮层 ───────── */
/* 设置图标固定在容器内右上角（与左上角内侧的隐式输入端口形成区域内均匀对角） */
.nf-orch-settings {
    position: absolute;
    top: var(--nf-orch-inset, 18px);
    right: var(--nf-orch-inset, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--nf-orch-settings-size, 22px);
    height: var(--nf-orch-settings-size, 22px);
    padding: 0;
    border: 1px solid rgba(100, 116, 139, .35);
    border-radius: 6px;
    background: rgba(255, 255, 255, .9);
    color: #64748b;
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}

.nf-orch-settings:hover {
    opacity: 1;
    color: #2563eb;
    border-color: #93c5fd;
    background: #fff;
}

.nf-orch-container.nf-ncard-selected .nf-orch-settings,
.nf-orch-container:hover .nf-orch-settings {
    opacity: 1;
}

/* 循环标志：容器顶部左侧压边框的一行里，位于节点名称前面，带上循环次数 / 指定次数 */
.nf-orch-loop {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    padding: 0 6px;
    border-radius: 6px;
    background: #fff;
    color: #f97316;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    user-select: none;
    /* 不参与命中：不阻断整块区域的拖动与连线落点 */
    pointer-events: none;
}

.nf-orch-loop b {
    font-weight: 700;
}

.nf-orch-container.is-loop-on {
    border-style: solid;
    border-color: rgba(249, 115, 22, .5);
}


/* 容器策略浮层：由容器右上角设置图标打开 */
.nf-orch-policy {
    position: absolute;
    z-index: 12;
    width: 260px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 36px -16px rgba(15, 23, 42, .45);
    box-sizing: border-box;
    user-select: none;
    pointer-events: auto;
}

.nf-orch-policy-head {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.nf-orch-policy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
    margin-bottom: 8px;
}

/* 容器策略：标签内嵌 info 图标（说明文案移入悬浮层，不再平铺在下方） */
.nf-orch-policy-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #475569;
    white-space: nowrap;
}

/* info 悬浮层里的 {index} 胶囊样式 */
.nf-info-float .nf-policy-capsule {
    display: inline-block;
    padding: 0 5px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
}

.nf-orch-policy-select {
    flex: none;
    width: 132px;
    height: 30px;
    font-size: 12.5px;
}

.nf-orch-policy-hint {
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 11px;
    line-height: 1.6;
    color: #94a3b8;
}

.nf-orch-policy-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* ───────── 工作流管理列表页：页面内弹窗（不依赖 window.prompt） ───────── */
.nfw-dialog-open {
    overflow: hidden;
}

.nfw-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45);
}

.nfw-dialog-card {
    width: min(520px, 100%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .45);
    overflow: hidden;
}

.nfw-dialog-head {
    padding: 16px 20px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid var(--nf-border);
}

.nfw-dialog-body {
    padding: 16px 20px;
    overflow-y: auto;
}

.nfw-dialog-field {
    margin-bottom: 14px;
}

.nfw-dialog-field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.nfw-dialog-field input[type="text"],
.nfw-dialog-field select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
}

.nfw-dialog-field input[type="text"]:focus,
.nfw-dialog-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.nfw-dialog-hint {
    font-size: 11.5px;
    line-height: 1.6;
    color: #94a3b8;
}

.nfw-dialog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nfw-dialog-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
}

.nfw-dialog-option:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.nfw-dialog-option-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nfw-dialog-option-main strong {
    font-size: 13px;
    color: #0f172a;
}

.nfw-dialog-option-main small {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
}

.nfw-dialog-option-main em {
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.6;
    color: #94a3b8;
}

.nfw-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--nf-border);
}

/* ───────── 工作流编排台：右侧「工作流配置」面板 ───────── */
.nf-wfc-field {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #475569;
}

.nf-wfc-field > span:first-child {
    flex: none;
    width: 62px;
    color: #94a3b8;
}

.nf-wfc-field > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-weight: 600;
}

.nf-wfc-name-btn {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: #2563eb;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.nf-wfc-name-btn:hover {
    text-decoration: underline;
}

.nf-wfc-stage {
    border: 1px solid #e6ecf5;
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
}

.nf-wfc-stage + .nf-wfc-stage {
    margin-top: 8px;
}

.nf-wfc-stage-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nf-wfc-stage-key {
    flex: none;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.nf-wfc-stage-name {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
}

.nf-wfc-stage-name:hover {
    border-color: #e2e8f0;
}

.nf-wfc-stage-name:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}

.nf-wfc-stage-del {
    flex: none;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.nf-wfc-stage-del:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.nf-wfc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.nf-wfc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 11px;
    color: #475569;
    cursor: pointer;
}

.nf-wfc-chip:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.nf-wfc-chip b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.nf-wfc-chip.is-node-selected {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .16);
}

.nf-wfc-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
}

.nf-wfc-pick-empty {
    width: 100%;
    font-size: 11.5px;
    color: #94a3b8;
}

.nf-wfc-stage-add {
    margin-top: 8px;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.nf-wfc-stage-add:hover {
    background: #eff6ff;
}

.nf-wfc-chip i {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
}

.nf-wfc-chip.is-assigned i {
    background: #2563eb;
}

.nf-wfc-chip.is-plain {
    cursor: default;
    opacity: .75;
}

.nf-wfc-chip.is-plain:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.nf-wfc-chip.is-running i {
    background: #f59e0b;
}

.nf-wfc-chip.is-done i {
    background: #16a34a;
}

.nf-wfc-chip.is-failed i {
    background: #dc2626;
}

.nf-wfc-add {
    margin-top: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
}

.nf-wfc-add:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* ==========================================================================
   工作流管理列表页：宫格卡片
   --------------------------------------------------------------------------
   列表页（/admin/flow-tools/workflows）渲染的是「封面 + 标题行 + 描述 + 标签 +
   操作条」的卡片，与编排工具列表页的 .nf-grid 卡片结构不同，故单独成体系。
   设计取向对齐主流短视频创作平台的工作流卡片：16:9 封面、玻璃态状态签、
   轻投影 + 悬浮抬升、底部操作条常驻。
   ========================================================================== */

/* 宫格：自适应列数，窄屏逐列收敛 */
.nf-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.nf-card-grid .nf-card {
    cursor: pointer;
}

.nf-card-grid .nf-card:hover .nf-card-actions {
    background: linear-gradient(180deg, #f7faff, #fff);
    border-top-color: #e6eefb;
}

/* 封面：固定 16:9，保证不同卡片高度一致、排版整齐 */
.nf-card-grid .nf-card-cover {
    position: relative;
    height: auto;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 46%, #0ea5e9 100%);
}

/* 无封面时的默认视觉：渐变底 + 斜纹质感 + 首字缩写 */
.nf-card-cover-default {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1;
    text-shadow: 0 4px 14px rgba(15, 23, 42, .22);
    background:
        radial-gradient(120% 90% at 78% 12%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 58%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 12px, rgba(255, 255, 255, 0) 12px 24px),
        linear-gradient(135deg, #6366f1 0%, #8b5cf6 46%, #0ea5e9 100%);
}

/* 封面右下角节点流程装饰符号，增加「工作流」识别度 */
.nf-card-cover-watermark {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    opacity: .55;
    pointer-events: none;
}

.nf-card-cover-watermark svg {
    width: 34px;
    height: 20px;
}

/* 标题行：名称 + 状态签 */
.nf-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nf-card-title-row h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--nf-text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.nf-card-title-row h3:hover {
    color: #1d4ed8;
}

/* 标签（领域 / 统计 / 状态） */
.nf-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.nf-tag-muted {
    background: #f1f5f9;
    color: #64748b;
}

.nf-tag-draft {
    background: #fef3c7;
    color: #92400e;
}

.nf-tag-success {
    background: #d1fae5;
    color: #065f46;
}

/* 统计标签行 */
.nf-card-grid .nf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}

/* 底部操作条 */
.nf-card-grid .nf-card-actions {
    padding: 10px 16px 14px;
}

.nf-btn-sm {
    height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12.5px;
}

/* 次级按钮（裸 .nf-btn）：卡片操作条里的「编排」需要与主按钮拉开层级 */
.nf-card-grid .nf-card-actions .nf-btn:not(.nf-btn-primary):not(.nf-btn-outline):not(.nf-btn-danger) {
    color: #334155;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.nf-card-grid .nf-card-actions .nf-btn:not(.nf-btn-primary):not(.nf-btn-outline):not(.nf-btn-danger):hover {
    color: #1d4ed8;
    background: #e8eefb;
    border-color: #c7d7f5;
}

/* 分页 */
.nf-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.nf-pager-text {
    font-size: 13px;
    color: var(--nf-muted);
}

/* 响应式：中等屏两列、窄屏单列 */
@media (max-width: 1100px) {
    .nf-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .nf-card-grid {
        grid-template-columns: 1fr;
    }

    .nf-page {
        padding: 18px 14px 48px;
    }
}
