/* ==========================================================================
   画布工作流模块样式
   覆盖：编排工具宫格卡片列表页（/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 {
    transform: translateY(1px);
}

.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, #059669, #047857);
    box-shadow: 0 8px 18px -8px rgba(5, 150, 105, .55);
}

.nf-btn-run:hover {
    box-shadow: 0 14px 26px -10px rgba(5, 150, 105, .75);
}

.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-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 {
    right: auto;
    left: 0;
    top: 20px;
    width: 180px;
    z-index: 40;
}

.nf-palette-info:hover .nf-ncard-tip {
    display: block;
}

.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-wb-canvas {
    position: absolute;
    inset: 0;
    cursor: grab;
}

/* 覆盖 X6 注入的 -webkit-grab：Windows 上该前缀光标会渲染成一团黑块 */
.nf-wb-canvas .x6-graph,
.nf-wb-canvas .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-repainting .x6-node,
.nf-wb-canvas.is-repainting .x6-graph-svg,
.nf-wb-canvas.is-repainting .x6-graph-svg-stage {
    transform: translateZ(0);
}

.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-tip {
    position: absolute;
    left: 50%;
    top: 22px;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e2e8f0;
    color: var(--nf-muted);
    font-size: 12.5px;
    box-shadow: var(--nf-shadow-sm);
    pointer-events: none;
    z-index: 3;
}

.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-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-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;
}

.nf-ncard-tip {
    position: absolute;
    top: 24px;
    right: 0;
    z-index: 20;
    display: none;
    width: 200px;
    padding: 8px 10px;
    background: #0f172a;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.5;
    font-style: normal;
    font-weight: 400;
    border-radius: 8px;
    box-shadow: 0 10px 24px -10px rgba(15, 23, 42, .6);
}

.nf-ncard-info:hover .nf-ncard-tip {
    display: block;
}

.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;
}

.nf-ncard-row {
    display: flex;
    flex-direction: column;
}

.nf-ncard-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.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;
}

.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-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-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-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 {
    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-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-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-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%;
}

.nf-cfg-field-body .nf-cfg-info {
    flex: 1 1 0;
    width: 50%;
}

.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;
}

.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: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: 1 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-cfg-info {
    flex: 1 1 0;
    min-width: 0;
    min-height: 88px;
    height: auto;
    resize: vertical;
    font-size: 12px;
    padding: 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-ncard-field-info .nf-ncard-tip {
    right: auto;
    left: 0;
    top: 18px;
}

.nf-ncard-field-info:hover .nf-ncard-tip,
.nf-ncard-field-info.is-open .nf-ncard-tip {
    display: block;
}

.nf-ncard-compact {
    padding: 0 14px;
}

.nf-ncard-compact .nf-ncard-head {
    border-bottom: 0;
}

.nf-exp-panel {
    width: 300px;
    flex-basis: 300px;
}

.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-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;
}

.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-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-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-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-batch-scroll-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.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-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-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-up,
.nf-batch-nav.is-down {
    width: 100%;
    height: 18px;
    transform: rotate(90deg);
}

.nf-batch-cell {
    position: relative;
    min-width: 0;
    width: 100%;
}

.nf-batch-cell.is-media {
    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-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-batch-cell.is-selectable {
    cursor: pointer;
}

.nf-batch-cell.is-selectable.is-media::after,
.nf-batch-cell.is-selected.is-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, .18);
    pointer-events: none;
}

.nf-batch-cell.is-selectable:not(.is-selected)::after {
    background: transparent;
}

.nf-batch-check {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 2px #fff;
    z-index: 2;
}

.nf-batch-cell.is-selected:not(.is-media) {
    box-shadow: 0 0 0 2px #2563eb;
    border-radius: 8px;
}

.nf-batch-cell.is-selected .nf-batch-check::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    width: 6px;
    height: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}
