/* ============================================
   画布引擎公共样式
   三个画布（工作流/审批流/数据工厂）共用
   ============================================ */

/* 节点 */
.ce-node {
  position: absolute;
  min-width: 140px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: move;
  user-select: none;
  z-index: 1;
  transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.ce-node:hover { box-shadow: var(--shadow); }
.ce-node.ce-selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.2); }

.ce-node-header {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ce-node-body {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  min-height: 24px;
}

/* 端口 */
.ce-port {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  position: absolute;
  cursor: crosshair;
  z-index: 10;
  transition: transform 0.15s var(--ease);
}
.ce-port:hover, .ce-port.ce-port-hover {
  transform: scale(1.4);
  background: var(--primary);
}
.ce-port-in {
  left: -7px;
  top: 50%;
  margin-top: -6px;
}
.ce-port-out {
  right: -7px;
  top: 50%;
  margin-top: -6px;
}

/* 兼容 af-port（审批流/工作流自定义端口，与 ce-port 一致） */
.af-port {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  position: absolute;
  cursor: crosshair;
  z-index: 10;
  transition: transform 0.15s var(--ease);
}
.af-port:hover, .af-port.af-port-hover {
  transform: scale(1.4);
  background: var(--primary);
}
.af-port-in {
  left: -7px;
  top: 50%;
  margin-top: -6px;
}
.af-port-out {
  right: -7px;
  top: 50%;
  margin-top: -6px;
}

/* 连线 SVG */
.ce-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.ce-svg path {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  pointer-events: stroke;
  cursor: pointer;
}
.ce-svg path:hover { stroke: var(--primary); stroke-width: 2.5; }
.ce-svg .ce-selected { stroke: var(--primary); stroke-width: 2.5; }
.ce-svg .ce-temp-path {
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 6,3;
  pointer-events: none;
}

/* 删除按钮 */
.ce-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  font-size: var(--text-sm);
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  display: none;
  z-index: 20;
}
.ce-node:hover .ce-delete-btn { display: block; }

/* 画布容器 */
.ce-wrap {
  position: relative;
  overflow: auto;
  flex: 1;
  background:
    linear-gradient(90deg, var(--bg-panel) 1px, transparent 1px),
    linear-gradient(var(--bg-panel) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 400px;
}
.ce-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}
