/**
 * 工具链统一样式系统
 * 整合所有工具链相关样式，采用模块化设计
 */

/* ========== 1. 设计系统变量 ========== */
:root {
    /* 颜色系统 */
    --tc-primary: #6366f1;
    --tc-secondary: #8b5cf6;
    --tc-accent: #ec4899;
    --tc-primary-light: #e0e7ff;
    --tc-primary-dark: #4f46e5;
    --tc-success: #10b981;
    --tc-warning: #f59e0b;
    --tc-danger: #ef4444;
    --tc-info: #3b82f6;
    
    /* 中性色 */
    --tc-gray-50: #f9fafb;
    --tc-gray-100: #f3f4f6;
    --tc-gray-200: #e5e7eb;
    --tc-gray-300: #d1d5db;
    --tc-gray-400: #9ca3af;
    --tc-gray-500: #6b7280;
    --tc-gray-600: #4b5563;
    --tc-gray-700: #374151;
    --tc-gray-800: #1f2937;
    --tc-gray-900: #111827;
    
    /* 尺寸系统 */
    --tc-spacing-xs: 0.25rem;
    --tc-spacing-sm: 0.5rem;
    --tc-spacing-md: 1rem;
    --tc-spacing-lg: 1.5rem;
    --tc-spacing-xl: 2rem;
    
    /* 圆角 */
    --tc-radius-sm: 0.375rem;
    --tc-radius-md: 0.5rem;
    --tc-radius-lg: 0.75rem;
    
    /* 阴影 */
    --tc-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --tc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --tc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* 动画 */
    --tc-transition: all 0.2s ease;
}

/* 暗色主题 */
[data-theme="dark"] {
    --tc-gray-50: #111827;
    --tc-gray-100: #1f2937;
    --tc-gray-200: #374151;
    --tc-gray-300: #4b5563;
    --tc-gray-400: #6b7280;
    --tc-gray-500: #9ca3af;
    --tc-gray-600: #d1d5db;
    --tc-gray-700: #e5e7eb;
    --tc-gray-800: #f3f4f6;
    --tc-gray-900: #f9fafb;
}

/* ========== 2. 布局系统 ========== */

.toolchain-page {
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    min-height: 100vh;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* 覆盖继承的容器限制 */
body.toolchain-body,
body .toolchain-page {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.toolchain-page * {
    box-sizing: border-box;
}

.toolchain-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr 320px !important;
    gap: 20px !important;
    padding: 0 20px 20px !important;
    height: calc(100vh - 120px);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* 确保各列正确显示 */
.tc-sidebar-left {
    grid-column: 1;
    display: block !important;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    height: 100%;
}

.tc-main {
    grid-column: 2;
    display: block !important;
    height: 100%;
}

.tc-sidebar-right {
    grid-column: 3;
    display: block !important;
    padding: 0;
    height: 100%;
}

/* 响应式布局 - 采用静态页面设计 */
@media (max-width: 1400px) {
    .toolchain-layout {
        grid-template-columns: 260px 1fr 300px !important;
    }
}

@media (max-width: 1200px) {
    .toolchain-layout {
        grid-template-columns: 240px 1fr 280px !important;
    }
}

@media (max-width: 1024px) {
    .toolchain-layout {
        grid-template-columns: 220px 1fr !important;
    }
    .tc-sidebar-right {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .toolchain-layout {
        grid-template-columns: 1fr !important;
    }
    .tc-sidebar-left {
        display: none !important;
    }
    
    .tc-toolbar {
        margin: 10px !important;
        padding: 10px 15px !important;
        width: calc(100% - 20px) !important;
    }
}

/* ========== 3. 组件库 ========== */

/* 基础卡片 - 采用静态页面设计 */
.tc-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 工具卡片 - 采用静态页面设计 */
.tc-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: move;
    transition: all 0.2s;
}

.tc-tool-card:hover {
    border-color: #6366f1;
    background: #f9fafb;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.tc-tool-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg) scale(1.05);
}

.tc-tool-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff, rgba(99, 102, 241, 0.1));
    color: #6366f1;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.tc-tool-card:hover .tc-tool-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    transform: scale(1.05);
}

.tc-tool-info {
    flex: 1;
    min-width: 0;
}

.tc-tool-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-tool-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* 分类组 - 采用静态页面设计 */
.tc-category {
    margin-bottom: 20px;
}

.tc-category.collapsed .tc-tool-list {
    display: none;
}

/* 侧边栏标题 */
.tc-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 按钮 - 统一交互效果与项目其他页面保持一致 */
.tc-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--tc-spacing-xs);
    padding: var(--tc-spacing-sm) var(--tc-spacing-md);
    border-radius: var(--tc-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1.5px solid var(--tc-gray-200);
    background: white;
    color: var(--tc-gray-700);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 统一的滑动光效动画，与项目其他页面保持一致 */
.tc-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tc-btn:hover::before {
    left: 100%;
}

/* 统一的hover效果：轻微上移 + 阴影增强 + 边框颜色变化 */
.tc-btn:hover {
    border-color: var(--tc-primary);
    background: var(--tc-gray-50);
    color: var(--tc-gray-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.tc-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tc-btn i {
    position: relative;
    z-index: 1;
}

.tc-btn span {
    position: relative;
    z-index: 1;
}

.tc-btn-primary {
    background: linear-gradient(135deg, var(--tc-primary), var(--tc-primary-dark));
    border-color: var(--tc-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.tc-btn-primary::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.tc-btn-primary:hover {
    background: linear-gradient(135deg, var(--tc-primary-dark), var(--tc-primary));
    border-color: var(--tc-primary-dark);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3), 0 2px 6px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.tc-btn-success {
    background: linear-gradient(135deg, var(--tc-success), #059669);
    border-color: var(--tc-success);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.tc-btn-success::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.tc-btn-success:hover {
    background: linear-gradient(135deg, #059669, var(--tc-success));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 2px 6px rgba(16, 185, 129, 0.15);
}

.tc-btn-danger {
    background: linear-gradient(135deg, var(--tc-danger), #dc2626);
    border-color: var(--tc-danger);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.tc-btn-danger::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.tc-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, var(--tc-danger));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), 0 2px 6px rgba(239, 68, 68, 0.15);
}

.tc-btn-secondary {
    background: var(--tc-gray-100);
    border-color: var(--tc-gray-300);
    color: var(--tc-gray-700);
}

.tc-btn-secondary::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.tc-btn-secondary:hover {
    background: var(--tc-gray-200);
    border-color: var(--tc-gray-400);
    color: var(--tc-gray-800);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.tc-btn-sm {
    padding: var(--tc-spacing-xs) var(--tc-spacing-sm);
    font-size: 0.75rem;
}

/* 管理按钮 - 统一hover效果 */
.tc-manage-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tc-manage-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.tc-manage-btn:hover::before {
    left: 100%;
}

.tc-manage-btn.rename {
    background: #3b82f6;
}

.tc-manage-btn.rename:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.tc-manage-btn.delete {
    background: #ef4444;
}

.tc-manage-btn.delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.tc-manage-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: none;
}

/* 工具栏 - 采用静态页面设计 */
.tc-toolbar {
    display: flex !important;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border: 1px solid transparent;
    border-radius: 12px;
    margin: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    align-items: center;
    width: calc(100% - 40px);
    box-sizing: border-box;
    position: relative;
}

/* 更明显的模式视觉：背景、边框、左侧强调条与模式徽章 */
body[data-execution-mode="folder_pipeline"] .tc-toolbar {
    background: #e0f2fe; /* 更明显的淡蓝 */
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
    border-left: 6px solid #3b82f6;
}
body[data-execution-mode="sequential"] .tc-toolbar {
    background: #ecfdf5; /* 更明显的淡绿 */
    border-color: #6ee7b7;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
    border-left: 6px solid #10b981;
}

.tc-toolbar::before {
    content: '';
}
body[data-execution-mode="folder_pipeline"] .tc-toolbar::before {
    content: '批量模式';
    position: absolute;
    top: -10px;
    left: 16px;
    background: #3b82f6;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}
body[data-execution-mode="sequential"] .tc-toolbar::before {
    content: '串行模式';
    position: absolute;
    top: -10px;
    left: 16px;
    background: #10b981;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.tc-toolbar-divider {
    flex: 1;
    height: 1px;
    background: transparent;
}

.tc-toolbar-divider::before {
    content: '';
    display: block;
    height: 24px;
    width: 1px;
    background: var(--tc-gray-200);
    margin: 0 var(--tc-spacing-sm);
}

/* 面板 - 采用静态页面设计 */
.tc-panel {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.tc-panel-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #f9fafb, white);
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-panel-header i {
    color: #6366f1;
}

/* 面板头部根据模式加重色相 */
body[data-execution-mode="folder_pipeline"] .tc-panel-header {
    background: linear-gradient(to right, #eff6ff, #ffffff);
    border-bottom-color: #bfdbfe;
}
body[data-execution-mode="sequential"] .tc-panel-header {
    background: linear-gradient(to right, #ecfdf5, #ffffff);
    border-bottom-color: #a7f3d0;
}

.tc-panel-header i {
    color: #6366f1;
}

.tc-panel-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

/* 右侧边栏特殊布局优化 */
.tc-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 执行配置面板保持固定高度 */
.tc-sidebar-right #executionConfigPanel {
    flex-shrink: 0;
}

/* 参数配置面板扩展到剩余空间 */
.tc-sidebar-right #configPanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-height: 0;
}

.tc-sidebar-right #configPanel .tc-panel-body {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tc-sidebar-right #configPanel .tc-panel-body form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tc-sidebar-right #configPanel .tc-panel-body .tc-form-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    position: sticky;
    bottom: 0;
}

/* 优化配置表单的布局和间距 */
.tc-sidebar-right #configPanel .tc-form-group {
    margin-bottom: 16px;
}

.tc-sidebar-right #configPanel .tc-form-group:last-of-type {
    margin-bottom: 0;
}

/* 确保表单内容区域能够正确滚动 */
.tc-sidebar-right #configPanel .tc-panel-body {
    min-height: 200px;
}

.tc-sidebar-right #configPanel .tc-panel-body form > div:not(.tc-form-actions) {
    margin-bottom: 16px;
}

/* 改进滚动条样式 */
.tc-sidebar-right #configPanel .tc-panel-body::-webkit-scrollbar {
    width: 6px;
}

.tc-sidebar-right #configPanel .tc-panel-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.tc-sidebar-right #configPanel .tc-panel-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.tc-sidebar-right #configPanel .tc-panel-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 执行配置面板和参数配置面板间的间距 */
.tc-sidebar-right #executionConfigPanel {
    margin-bottom: 16px;
}

/* 确保右侧边栏整体高度利用 */
.tc-sidebar-right {
    height: 100%;
    overflow: hidden;
}

/* 工具链步骤动作按钮 - 统一hover效果 */
.tc-step-action-btn {
    padding: 8px 12px;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.tc-step-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.tc-step-action-btn:hover::before {
    left: 100%;
}

.tc-step-action-btn.config {
    border: 1px solid #6366f1;
    color: #6366f1;
}

.tc-step-action-btn.config:hover {
    background: #f0f4ff;
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(99, 102, 241, 0.2);
}

.tc-step-action-btn.remove {
    border: 1px solid #ef4444;
    color: #ef4444;
}

.tc-step-action-btn.remove:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.2);
}

.tc-step-action-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: none;
}

/* 工具链步骤 - 优化视觉反馈 */
.tc-chain-step {
    display: flex;
    align-items: center;
    gap: var(--tc-spacing-md);
    padding: var(--tc-spacing-lg) var(--tc-spacing-md);
    margin-bottom: var(--tc-spacing-lg);
    background: white;
    border: 2px solid var(--tc-gray-100);
    border-radius: var(--tc-radius-lg);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: move;
}

.tc-chain-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--tc-radius-lg);
    background: linear-gradient(135deg, var(--tc-primary-light), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tc-chain-step:hover::before {
    opacity: 0.08;
}

.tc-chain-step:hover {
    border-color: var(--tc-primary-light);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.tc-chain-step.configured {
    border-color: var(--tc-success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
}

.tc-chain-step.configured .tc-step-number {
    background: linear-gradient(135deg, var(--tc-success), #059669) !important;
    animation: pulse 2s infinite;
}

.tc-chain-step.configuring {
    border-color: #f59e0b !important;
    background: linear-gradient(to right, rgba(245, 158, 11, 0.1), white) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2) !important;
}

.tc-chain-step.incompatible {
    border-color: var(--tc-danger) !important;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.1), white) !important;
}

.tc-chain-step.incompatible .tc-step-number {
    background: linear-gradient(135deg, var(--tc-danger), #dc2626) !important;
}

.tc-chain-step.incompatible::after {
    content: '⚠️';
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--tc-danger);
    font-size: 14px;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tc-step-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tc-primary), var(--tc-primary-dark));
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.tc-chain-step:hover .tc-step-number {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.tc-step-content {
    flex: 1;
}

.tc-step-actions {
    display: flex;
    gap: var(--tc-spacing-xs);
}

/* 连接线 - 添加动画效果 */
.tc-step-connector {
    position: absolute;
    left: 18px;
    top: 100%;
    width: 2px;
    height: var(--tc-spacing-lg);
    background: linear-gradient(to bottom, var(--tc-primary), var(--tc-primary-light));
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.tc-step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 6px;
    height: 6px;
    background: var(--tc-primary);
    border-radius: 50%;
    animation: flow 2s linear infinite;
}

@keyframes flow {
    0% { transform: translateY(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(24px); opacity: 0; }
}

/* 空状态 - 更友好的视觉引导 */
.tc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--tc-gray-400);
    text-align: center;
    position: relative;
}

.tc-empty-state::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--tc-primary-light), transparent);
    opacity: 0.2;
    border-radius: 50%;
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.2); opacity: 0.1; }
}

.tc-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--tc-spacing-md);
    opacity: 0.6;
    color: var(--tc-primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tc-empty-text {
    font-size: 1rem;
    margin-bottom: var(--tc-spacing-sm);
    font-weight: 500;
    color: var(--tc-gray-600);
}

.tc-empty-hint {
    font-size: 0.875rem;
    color: var(--tc-gray-400);
}

/* 表单元素 */
.tc-form-group {
    margin-bottom: var(--tc-spacing-md);
}

.tc-form-label {
    display: block;
    margin-bottom: var(--tc-spacing-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tc-gray-700);
}

.tc-form-input {
    width: 100%;
    padding: var(--tc-spacing-sm);
    border: 1px solid var(--tc-gray-300);
    border-radius: var(--tc-radius-md);
    font-size: 0.875rem;
    transition: var(--tc-transition);
}

.tc-form-input:focus {
    outline: none;
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px var(--tc-primary-light);
}

/* 滚动条 - 优化样式 */
.tc-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tc-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.tc-scrollbar::-webkit-scrollbar-thumb {
    background: var(--tc-gray-300);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.tc-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--tc-primary);
}

/* 侧边栏样式 */
.tc-sidebar-left,
.tc-sidebar-right {
    background: white;
    border-radius: var(--tc-radius-lg);
    padding: var(--tc-spacing-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.tc-main {
    min-height: 500px;
}

/* ========== 4. 工具类 ========== */

/* 显示 */
.tc-hidden { display: none !important; }
.tc-block { display: block !important; }
.tc-flex { display: flex !important; }
.tc-inline-flex { display: inline-flex !important; }

/* 对齐 */
.tc-items-center { align-items: center; }
.tc-justify-center { justify-content: center; }
.tc-justify-between { justify-content: space-between; }

/* 间距 */
.tc-m-0 { margin: 0; }
.tc-p-0 { padding: 0; }
.tc-mt-1 { margin-top: var(--tc-spacing-xs); }
.tc-mt-2 { margin-top: var(--tc-spacing-sm); }
.tc-mt-3 { margin-top: var(--tc-spacing-md); }
.tc-mt-4 { margin-top: var(--tc-spacing-lg); }

/* 文本 */
.tc-text-center { text-align: center; }
.tc-text-sm { font-size: 0.875rem; }
.tc-text-xs { font-size: 0.75rem; }
.tc-font-bold { font-weight: 600; }

/* ========== 5. 执行模式样式 ========== */

/* 执行模式配置面板 */
.execution-mode-config {
    padding: 0;
}

.config-section {
    margin-bottom: 16px;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tc-gray-700);
    margin-bottom: 8px;
}

.config-label i {
    color: var(--tc-primary);
    width: 16px;
}

.config-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tc-gray-300);
    border-radius: var(--tc-radius-md);
    font-size: 14px;
    transition: var(--tc-transition);
    background: white;
}

.config-input:focus {
    outline: none;
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px var(--tc-primary-light);
}

/* 执行模式选择器 */
#executionModeSelect {
    min-width: 120px;
    font-weight: 500;
}

#executionModeSelect:hover {
    border-color: var(--tc-primary);
}

/* 执行模式选择器在不同模式下的配色更明显 */
body[data-execution-mode="folder_pipeline"] #executionModeSelect {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e3a8a;
}
body[data-execution-mode="sequential"] #executionModeSelect {
    background: #d1fae5;
    border-color: #34d399;
    color: #065f46;
}

/* 编排区容器外轮廓提示当前模式 */
body[data-execution-mode="folder_pipeline"] #chainSteps {
    outline: 2px dashed #93c5fd;
    outline-offset: 6px;
}
body[data-execution-mode="sequential"] #chainSteps {
    outline: 2px dashed #6ee7b7;
    outline-offset: 6px;
}

/* 编排区滚动布局：外层容器固定，高度内滚动 */
#chainDropZone {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* 避免双滚动条 */
}

#chainSteps {
    flex: 1 1 auto;
    min-height: 0; /* 允许在flex容器内正确收缩，启用滚动 */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative; /* 供连线与指示线定位 */
}

/* 批量文件上传区域 */
.batch-upload-area {
    border: 2px dashed var(--tc-gray-300);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--tc-gray-50);
    transition: var(--tc-transition);
}

.batch-upload-area:hover {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
}

.batch-upload-area.drag-over {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
    transform: scale(1.02);
}

/* 直接使用ID的拖拽高亮，适配当前页面结构 */
#batchUploadArea.drag-over {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
    transform: scale(1.02);
}
#sequentialUploadArea.drag-over {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
    transform: scale(1.01);
}

/* 文件列表项 */
.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    margin: 4px 0;
    border: 1px solid var(--tc-gray-200);
    font-size: 13px;
    transition: var(--tc-transition);
}

.file-list-item:hover {
    background: var(--tc-gray-50);
    border-color: var(--tc-primary);
}

.file-list-item .file-icon {
    color: var(--tc-primary);
    margin-right: 8px;
}

.file-list-item .file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-item .file-size {
    color: var(--tc-gray-400);
    font-size: 11px;
}

/* 执行日志样式增强 */
.tc-log-item {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid var(--tc-gray-300);
    background: var(--tc-gray-50);
}

.tc-log-success {
    border-left-color: var(--tc-success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.1), transparent);
    color: var(--tc-gray-700);
}

.tc-log-error {
    border-left-color: var(--tc-danger);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.1), transparent);
    color: var(--tc-gray-700);
}

.tc-log-warning {
    border-left-color: var(--tc-warning);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.1), transparent);
    color: var(--tc-gray-700);
}

.tc-log-info {
    border-left-color: var(--tc-info);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
    color: var(--tc-gray-700);
}

.tc-log-item i {
    margin-right: 6px;
    width: 14px;
}

/* 执行状态指示 */
.execution-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--tc-primary-light);
    color: var(--tc-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

/* 执行进度条 */
.execution-progress {
    width: 100%;
    height: 4px;
    background: var(--tc-gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.execution-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tc-primary), var(--tc-primary-dark));
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* 动画效果 */
@keyframes progressPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.execution-progress-bar.pulsing {
    animation: progressPulse 1.5s ease-in-out infinite;
}

/* ========== 动态连接线样式 ========== */
.tc-connectors-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tc-dynamic-connector {
    fill: none;
    stroke: var(--tc-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.tc-dynamic-connector.active {
    stroke: var(--tc-success);
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.4));
}

.tc-dynamic-connector.error {
    stroke: var(--tc-danger);
    stroke-width: 3;
    stroke-dasharray: 3,3;
    animation: tc-error-pulse 1.5s ease-in-out infinite;
}

@keyframes tc-error-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.tc-connector-arrow {
    fill: var(--tc-primary);
    transition: all 0.3s ease;
}

.tc-connector-arrow.active {
    fill: var(--tc-success);
}

.tc-connector-arrow.error {
    fill: var(--tc-danger);
}

/* 连接线流动动画 */
@keyframes tc-flow-animation {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -20; }
}

.tc-dynamic-connector.flowing {
    stroke-dasharray: 10,5;
    animation: tc-flow-animation 2s linear infinite;
}

/* 连接点样式 */
.tc-connection-point {
    width: 8px;
    height: 8px;
    background: var(--tc-primary);
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 2;
}

.tc-connection-point.input {
    top: -4px;
    left: 50%;
}

.tc-connection-point.output {
    bottom: -4px;
    left: 50%;
}

.tc-connection-point:hover {
    background: var(--tc-success);
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* 插入位置指示线 */
.tc-drop-indicator {
    height: 0;
    border-top: 3px dashed var(--tc-primary);
    margin: -6px 0 18px 0;
    position: relative;
}
.tc-drop-indicator::before,
.tc-drop-indicator::after {
    content: '';
    position: absolute;
    top: -5px;
    width: 8px;
    height: 8px;
    background: var(--tc-primary);
    border-radius: 50%;
}
.tc-drop-indicator::before { left: 0; }
.tc-drop-indicator::after { right: 0; }

/* ========== 步骤动作按钮优化样式 ========== */

/* 步骤动作按钮容器 */
.tc-step-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 配置和删除按钮的基础样式优化 */
.tc-step-actions .tc-btn {
    min-width: 70px;
    justify-content: center;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 配置按钮样式优化 */
.tc-step-actions .tc-btn:not(.tc-btn-danger) {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1.5px solid #cbd5e0;
    color: #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tc-step-actions .tc-btn:not(.tc-btn-danger):hover {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: #6366f1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.tc-step-actions .tc-btn:not(.tc-btn-danger) i {
    margin-right: 4px;
    font-size: 11px;
}

/* 删除按钮样式优化 */
.tc-step-actions .tc-btn-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1.5px solid #fca5a5;
    color: #dc2626;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
}

.tc-step-actions .tc-btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.tc-step-actions .tc-btn-danger i {
    margin-right: 4px;
    font-size: 11px;
}

/* 按钮激活状态 */
.tc-step-actions .tc-btn:active {
    transform: translateY(0) scale(0.96);
    transition: all 0.1s;
}

/* 优化按钮在不同状态下的图标和文字间距 */
.tc-step-actions .tc-btn i + * {
    margin-left: 0;
}

/* 响应式设计：在较小屏幕上隐藏文字，只保留图标 */
@media (max-width: 1200px) {
    .tc-step-actions .tc-btn {
        min-width: auto;
        padding: 6px 8px;
    }
    
    .tc-step-actions .tc-btn i {
        margin-right: 0;
    }
    
    /* 隐藏文字，只保留图标 */
    .tc-step-actions .tc-btn i + * {
        display: none;
    }
}

/* 为整个步骤卡片添加更好的按钮显示效果 */
.tc-chain-step:hover .tc-step-actions .tc-btn {
    opacity: 1;
    transform: scale(1.02);
}

.tc-chain-step .tc-step-actions .tc-btn {
    opacity: 0.85;
    transition: all 0.2s ease;
}