.workflow-designer-pro { 
    padding: 12px; 
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

/* 工具栏样式 - 现代扁平设计 */
.designer-toolbar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 16px;
}

.designer-toolbar .input-group-text {
    background: #f9fafb;
 border-color: #e5e7eb;
 color: #6b7280;
    font-weight: 500;
}

.designer-toolbar .form-control {
background: #ffffff;
    border-color: #e5e7eb;
    color: #111827;
}

.designer-toolbar .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.designer-toolbar .form-select {
    background: #ffffff;
  border-color: #e5e7eb;
    color: #111827;
}

.designer-toolbar .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.designer-toolbar .btn {
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.designer-toolbar .btn-outline-secondary {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #6b7280;
}

.designer-toolbar .btn-outline-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.designer-toolbar .btn-outline-primary {
    background: #ffffff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.designer-toolbar .btn-outline-primary:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.designer-toolbar .btn-outline-success {
    background: #ffffff;
    border-color: #10b981;
    color: #10b981;
}

.designer-toolbar .btn-outline-success:hover {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.designer-toolbar .btn-outline-info {
    background: #ffffff;
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.designer-toolbar .btn-outline-info:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
 transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.designer-toolbar .btn-outline-warning {
    background: #ffffff;
    border-color: #f59e0b;
    color: #f59e0b;
}

.designer-toolbar .btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
 transform: translateY(-1px);
 box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.designer-toolbar .btn-outline-danger {
  background: #ffffff;
    border-color: #ef4444;
    color: #ef4444;
}

.designer-toolbar .btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.designer-toolbar .btn-primary,
.designer-toolbar .btn.btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.designer-toolbar .btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.zoom-level {
    font-weight: 600;
    min-width: 50px;
    display: inline-block;
    text-align: center;
    color: #111827;
}

/* 按钮组样式优化 */
.designer-toolbar .btn-group {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.designer-toolbar .btn-group .btn {
    border-radius: 0;
}

.designer-toolbar .btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.designer-toolbar .btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 工具栏图标样式 */
.designer-toolbar .btn i {
    font-size: 14px;
    margin-right: 0.25rem;
}

.designer-toolbar .btn-sm i {
    font-size: 13px;
    margin-right: 0.25rem;
}

/* 确保按钮中的图标和文字正确对齐显示 */
.designer-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* 只有图标的按钮（无文字） */
.designer-toolbar .btn i:only-child {
    margin-right: 0;
}

/* 按钮文字确保不换行且垂直居中 */
.designer-toolbar .btn span,
.designer-toolbar .btn-sm span {
    display: inline-block;
  vertical-align: middle;
}

/* 主容器 */
.designer-container { 
    display: flex; 
    gap: 12px; 
    flex: 1;
    overflow: hidden;
}

/* 左侧调色板 */
.palette { 
    width: 220px; 
    border: 1px solid #e0e0e0; 
    padding: 12px; 
    border-radius: 8px; 
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
}

.palette-header {
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.palette-item { 
    padding: 12px; 
    margin: 8px 0; 
    border: 2px dashed #cbd5e0; 
    border-radius: 6px;
    cursor: grab; 
    background: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-item:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.palette-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.palette-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.palette-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* 画布包装器 */
.canvas-wrapper { 
    flex: 1; 
    border: 1px solid #e0e0e0; 
    background: #f8f9fa; 
    border-radius: 8px;
    padding: 8px; 
    overflow: auto;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* 右侧属性面板 */
.properties-panel {
    width: 320px;
    min-width: 280px;
    max-width: 600px;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 属性面板调整大小手柄 */
.properties-panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: ew-resize;
    background: transparent;
    z-index: 1000;
    transition: background-color 0.2s;
}

.properties-panel:hover::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.2) 50%, 
        transparent 100%);
}

.properties-panel.resizing::before {
    background: linear-gradient(90deg, 
   transparent 0%, 
  rgba(102, 126, 234, 0.5) 50%, 
        transparent 100%);
}

.properties-panel.resizing {
    user-select: none;
}

.properties-panel .panel-header {
padding: 12px 16px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* 调整大小指示器 */
.properties-panel .panel-header::before {
    content: '⋮⋮';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    letter-spacing: -4px;
    pointer-events: none;
}

.properties-panel.resizing .panel-header::before {
    color: rgba(255, 255, 255, 1);
}

.properties-panel .panel-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
overflow-x: hidden;
}

/* 画布 */
.canvas { 
    position: relative; 
    width: 3000px; 
    height: 2000px; 
    background: white; 
    border: 1px solid #e0e0e0; 
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.canvas.show-grid {
    background-image: 
        linear-gradient(to right, #f0f0f0 1px, transparent 1px),
        linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas.drag-over {
    background-color: #f0f8ff;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.canvas-footer {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.canvas-footer .badge {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* SVG 连接线 */
.connections-svg {
    pointer-events: none;
}

.connections-svg line {
    pointer-events: stroke;
    cursor: pointer;
}

/* 工作流步骤 */
.workflow-step { 
    position: absolute; 
    border: 2px solid #cbd5e0; 
    background: white;
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.2s ease;
    overflow: hidden;
}

.workflow-step:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.workflow-step.selected { 
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 4px 16px rgba(102, 126, 234, 0.3);
    z-index: 100;
}

.workflow-step.dragging { 
    opacity: 0.7; 
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.workflow-step.connecting {
    border-color: #51cf66;
    box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(81, 207, 102, 0.3); }
}

/* 步骤头部 */
.step-header { 
    padding: 10px 12px; 
    font-weight: 600; 
    font-size: 13px;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-header i {
    font-size: 14px;
}

.step-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-info {
    padding: 8px 12px;
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.step-info i {
    margin-right: 4px;
}

/* 连接句柄 */
.connect-handle { 
    display: inline-block;
    width: 20px; 
    height: 20px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid white;
    border-radius: 50%; 
    cursor: pointer; 
    float: right;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.connect-handle:hover {
    transform: scale(1.3);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.6);
}

.connect-handle:active {
    transform: scale(1.1);
}

/* 步骤类型样式 */
.step-type-start .step-header { 
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.step-type-end .step-header { 
    background: linear-gradient(135deg, #ff6b6b 0%, #fa5252 100%);
    color: white;
}

.step-type-approval .step-header { 
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
    color: white;
}

.step-type-countersign .step-header { 
    background: linear-gradient(135deg, #ffd43b 0%, #fcc419 100%);
    color: #495057;
}

.step-type-cc .step-header { 
    background: linear-gradient(135deg, #91a7ff 0%, #748ffc 100%);
    color: white;
}

.step-type-condition .step-header { 
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    color: white;
}

/* 条件节点菱形样式 - 优化版 */
.workflow-step.step-type-condition {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
    border: 3px solid #ea580c;
    border-radius: 4px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
    position: relative;
}

.workflow-step.step-type-condition:hover {
transform: scale(1.05) rotate(2deg);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.5);
    border-color: #c2410c;
}

.workflow-step.step-type-condition.selected {
    border-color: #3b82f6;
    border-width: 4px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 8px 20px rgba(251, 146, 60, 0.5);
    z-index: 100;
}

.workflow-step.step-type-condition.dragging {
    opacity: 0.8;
    box-shadow: 0 12px 30px rgba(251, 146, 60, 0.6);
}

.workflow-step.step-type-condition .step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    gap: 8px;
    background: transparent;
    border: none;
}

/* 条件节点图标容器 */
.workflow-step.step-type-condition .condition-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.workflow-step.step-type-condition .condition-icon i {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 条件节点文字 */
.workflow-step.step-type-condition .step-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    padding: 0 12px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* 移除旧的单独图标样式 */
.workflow-step.step-type-condition i {
    /* 由condition-icon容器控制 */
}

/* 连接线标签样式 */
.connection-label {
    font-size: 11px;
    fill: #495057;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
}

.connection-label-background {
    fill: white;
    stroke: #dee2e6;
 stroke-width: 1;
    rx: 3;
    ry: 3;
    opacity: 0.95;
}

/* 条件分支连接线样式 */
.connections-svg line.condition-branch {
    stroke: #ff9800;
    stroke-width: 2.5;
}

.connections-svg line.condition-branch.active {
  stroke: #ff5722;
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(255, 87, 34, 0.6));
}

/* 并行分支连接线样式 */
.connections-svg line.parallel-branch {
    stroke: #667eea;
    stroke-width: 2.5;
    stroke-dasharray: 8, 4;
}

.connections-svg line.parallel-branch.active {
    stroke: #5a67d8;
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.6));
}

/* 连接线标签组 */
.connection-label-group:hover .connection-label {
    fill: #0d6efd;
    font-weight: 600;
}

.connection-label-group:hover .connection-label-background {
    fill: #e7f1ff;
    stroke: #0d6efd;
}

/* 条件节点信息提示 */
.workflow-step.step-type-condition .step-info {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 152, 0, 0.9);
    color: white;
 padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
}

/* 并行网关信息提示 */
.workflow-step.step-type-parallelsplit .step-info,
.workflow-step.step-type-paralleljoin .step-info {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
}

/* 连接句柄在菱形节点上的位置调整 */
.workflow-step.step-type-condition .connect-handle,
.workflow-step.step-type-parallelsplit .connect-handle,
.workflow-step.step-type-paralleljoin .connect-handle {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: white;
 border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
    z-index: 9999;
    padding: 8px 0;
}

.context-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.context-menu li {
    padding: 0;
    margin: 0;
}

.context-menu li.divider {
    height: 1px;
  background: #e9ecef;
    margin: 4px 0;
}

.context-menu .btn {
    display: block;
    width: 100%;
  text-align: left;
  padding: 10px 16px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 13px;
    transition: all 0.2s ease;
    border-radius: 0;
}

.context-menu .btn:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.context-menu .btn.text-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.context-menu .btn.text-muted:hover {
    background: #f9fafb;
    color: #6b7280;
}

.context-menu .btn i {
 width: 20px;
text-align: center;
}

/* 连接线右键菜单 */
.connection-context-menu {
    /* 继承 .context-menu 的样式 */
}

/* 步骤右键菜单 */
.step-context-menu {
    /* 继承 .context-menu 的样式 */
}
