/* Workflow Canvas - 可视化拖拽编辑器样式 */
.wf-canvas-app { display: flex; flex-direction: column; height: 100vh; background: #f8fafc; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* 工具栏 */
.wf-canvas-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); z-index: 100; }
.wf-btn { padding: 6px 14px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.wf-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.wf-btn-primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.wf-btn-primary:hover { background: #2563eb; }
.wf-btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.wf-btn-sm { padding: 2px 8px; font-size: 12px; }
.wf-name-input { flex: 0 1 250px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-weight: 500; }
.wf-name-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.wf-status-badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; background: #fef3c7; color: #92400e; }
.wf-toolbar-spacer { flex: 1; }
.wf-zoom-group { display: flex; align-items: center; gap: 4px; background: #f3f4f6; border-radius: 6px; padding: 2px; }
.wf-zoom-label { font-size: 12px; color: #6b7280; min-width: 42px; text-align: center; }

/* 主体三栏 */
.wf-canvas-body { display: flex; flex: 1; overflow: hidden; }

/* 左侧节点面板 */
.wf-node-panel { width: 200px; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; flex-shrink: 0; }
.wf-panel-header { padding: 10px; border-bottom: 1px solid #f1f5f9; }
.wf-panel-header input { width: 100%; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.wf-node-list { flex: 1; overflow-y: auto; padding: 8px; }
.wf-cat-group { margin-bottom: 12px; }
.wf-cat-title { font-size: 11px; font-weight: 600; text-transform: uppercase; margin-bottom: 6px; padding: 0 4px; }
.wf-panel-node { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: grab; font-size: 13px; color: #374151; transition: background 0.15s; }
.wf-panel-node:hover { background: #f3f4f6; }
.wf-panel-node:active { cursor: grabbing; }
.wf-node-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* 画布区域 */
.wf-canvas-area { flex: 1; position: relative; overflow: hidden; cursor: default; }
.wf-canvas-area:active { cursor: grabbing; }
.wf-node-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.wf-edge-layer { position: absolute; top: 0; left: 0; width: 5000px; height: 5000px; pointer-events: none; overflow: visible; }
.wf-edge-layer path { pointer-events: stroke; cursor: pointer; }

/* 节点卡片 */
.wf-node-card { position: absolute; width: 180px; background: #fff; border-radius: 8px; border: 2px solid #e2e8f0; border-left: 4px solid #6b7280; box-shadow: 0 2px 8px rgba(0,0,0,0.08); pointer-events: auto; cursor: move; user-select: none; transition: box-shadow 0.15s; }
.wf-node-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.wf-node-card.selected { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2), 0 4px 12px rgba(0,0,0,0.12); }
.wf-node-card.running { border-color: #f59e0b; animation: pulse 1s infinite; }
.wf-node-card.success { border-color: #22c55e; }
.wf-node-card.failed { border-color: #ef4444; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }
.wf-node-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 6px 6px 0 0; font-size: 13px; font-weight: 600; color: #1f2937; }
.wf-node-del { background: none; border: none; cursor: pointer; font-size: 16px; color: #9ca3af; padding: 0 4px; line-height: 1; }
.wf-node-del:hover { color: #ef4444; }
.wf-node-body { padding: 8px 10px; font-size: 12px; color: #6b7280; min-height: 24px; }
.wf-summary { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 连接点 */
.wf-node-port { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #9ca3af; top: 50%; transform: translateY(-50%); z-index: 10; }
.wf-port-input { left: -7px; }
.wf-port-output { right: -7px; cursor: crosshair; }
.wf-port-output:hover { border-color: #3b82f6; background: #dbeafe; }

/* 连线 */
.wf-edge { fill: none; stroke: #9ca3af; stroke-width: 2; transition: stroke 0.15s; }
.wf-edge:hover { stroke: #3b82f6; stroke-width: 3; }
.wf-edge.selected { stroke: #3b82f6; stroke-width: 3; }
.wf-edge.true { stroke: #22c55e; }
.wf-edge.false { stroke: #ef4444; }
.wf-edge.temp { stroke: #3b82f6; stroke-dasharray: 5,5; }

/* 右侧配置面板 */
.wf-config-panel { width: 280px; background: #fff; border-left: 1px solid #e2e8f0; overflow-y: auto; flex-shrink: 0; }
.wf-config-empty { padding: 40px 20px; text-align: center; color: #9ca3af; font-size: 14px; }
.wf-config-header { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.wf-config-header h4 { margin: 0; font-size: 15px; color: #1f2937; }
.wf-config-type { font-size: 11px; color: #9ca3af; font-family: monospace; }
.wf-config-field { padding: 10px 16px; border-bottom: 1px solid #f8fafc; position: relative; }
.wf-config-field label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.wf-config-field input, .wf-config-field textarea, .wf-config-field select { width: 100%; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; box-sizing: border-box; }
.wf-config-field input:focus, .wf-config-field textarea:focus { outline: none; border-color: #3b82f6; }
.wf-config-field textarea { resize: vertical; font-family: monospace; font-size: 12px; }
.wf-var-btn { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); margin-top: 8px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 1px 6px; font-size: 11px; cursor: pointer; color: #6b7280; }
.wf-var-btn:hover { background: #e5e7eb; color: #3b82f6; }
.wf-help { display: block; font-size: 11px; color: #9ca3af; margin-top: 3px; }
.wf-config-outputs { padding: 12px 16px; background: #f8fafc; }
.wf-config-outputs h5 { margin: 0 0 8px; font-size: 12px; color: #6b7280; }
.wf-var-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.wf-var-item code { background: #e0e7ff; color: #4338ca; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.wf-var-item span { color: #6b7280; }

/* 画布提示 */
.wf-canvas-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #cbd5e1; font-size: 15px; pointer-events: none; text-align: center; }

/* 变量提示栏 */
.wf-var-hint { padding: 6px 16px; background: #f1f5f9; border-top: 1px solid #e2e8f0; font-size: 12px; color: #64748b; font-family: monospace; }

/* 执行日志 */
.wf-exec-log { position: absolute; bottom: 30px; left: 210px; right: 290px; max-height: 200px; background: #1e293b; color: #e2e8f0; border-radius: 8px; overflow: hidden; z-index: 50; font-size: 12px; }
.wf-log-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: #334155; font-weight: 600; }
.wf-log-content { padding: 10px 12px; overflow-y: auto; max-height: 160px; font-family: monospace; line-height: 1.6; }

/* Toast */
.wf-toast { position: fixed; top: 20px; right: 20px; padding: 10px 20px; background: #22c55e; color: #fff; border-radius: 8px; font-size: 14px; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s; }
.wf-toast.error { background: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
