/* 一人公司板块样式 */

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* 表格样式 */
.agent-table {
    width: 100%;
    border-collapse: collapse;
}

.agent-table th,
.agent-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.agent-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.agent-table td {
    color: #1f2937;
    font-size: 14px;
}

.agent-table tr:hover {
    background: #f9fafb;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.status-idle {
    background: #e5e7eb;
    color: #6b7280;
}

.status-working {
    background: #dbeafe;
    color: #166534;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Agent节点样式 */
.agent-node {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: grab;
    min-width: 200px;
    z-index: 10;
}

.agent-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.agent-node.dragging {
    cursor: grabbing;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.node-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.node-info {
    text-align: center;
}

.node-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.node-status {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* Agent详情样式 */
.agent-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agent-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.agent-detail-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-detail-icon .material-symbols-outlined {
    font-size: 32px;
}

.agent-detail-info h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.agent-type {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.agent-detail-section {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.agent-detail-section h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item .label {
    font-size: 12px;
    color: #6b7280;
}

.info-item .value {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

/* 任务历史样式 */
.task-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.task-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.task-time {
    font-size: 12px;
    color: #6b7280;
}

/* 统计网格样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
}

/* 按钮样式 */
.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f3f4f6;
}

.btn-danger {
    color: #ef4444;
}

.btn-danger:hover {
    background: #fee2e2;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2937;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* 加载状态样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

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

/* ===================== */
/* 树状图样式 */
/* ===================== */

.tree-diagram-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 30px 20px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 420px;
    position: relative;
}

.tree-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: fit-content;
    padding: 10px 0;
}

.tree-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.tree-level-0 {
    margin-bottom: 0;
}

.tree-level-1 {
    margin-top: 50px;
}

.tree-level-2 {
    margin-top: 50px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 10px;
}

.tree-connector-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.tree-connector-group .tree-connector-line {
    width: 2px;
    height: 50px;
    background: linear-gradient(180deg, #c7d2fe 0%, #a5b4fc 100%);
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.tree-connector-horizontal {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 50%, #c7d2fe 100%);
    margin: 0 auto;
    width: 80%;
    max-width: 600px;
    margin-bottom: 0;
}

.tree-connector-horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 50%, #c7d2fe 100%);
}

/* 树节点基础样式 */
.tree-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.tree-node:hover {
    transform: translateY(-4px);
}

.tree-node:active {
    transform: translateY(-1px);
}

/* 创始人节点 - 第一层 */
.tree-node-founder .tree-node-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #6366f1 50%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.5), 0 0 0 4px rgba(99, 102, 241, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tree-node-founder .tree-node-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    animation: tree-rotate-slow 20s linear infinite;
}

.tree-node-founder:hover .tree-node-avatar {
    box-shadow: 0 12px 35px -5px rgba(99, 102, 241, 0.6), 0 0 0 6px rgba(99, 102, 241, 0.15);
}

.tree-node-founder .tree-node-avatar .material-symbols-outlined {
    font-size: 36px;
    color: white;
}

.tree-node-founder .tree-node-label {
    font-size: 15px;
    font-weight: 700;
    color: #1e1b4b;
    margin-top: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}

.tree-node-founder .tree-node-sublabel {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    text-align: center;
}

/* 经理人节点 - 第二层 */
.tree-node-manager .tree-node-avatar {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px -4px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tree-node-manager:hover .tree-node-avatar {
    box-shadow: 0 10px 30px -4px rgba(59, 130, 246, 0.6), 0 0 0 5px rgba(59, 130, 246, 0.15);
    transform: scale(1.05);
}

.tree-node-manager .tree-node-avatar .material-symbols-outlined {
    font-size: 30px;
}

.tree-node-alex .tree-node-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #6366f1 100%);
    box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tree-node-alex:hover .tree-node-avatar {
    box-shadow: 0 10px 30px -4px rgba(99, 102, 241, 0.6), 0 0 0 5px rgba(99, 102, 241, 0.15);
}

.tree-node-alex .tree-node-label {
    color: #6366f1;
}

.tree-node-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-top: 2px;
}

.tree-node-manager .tree-node-avatar .material-symbols-outlined {
    color: white;
}

.tree-node-manager .tree-node-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    margin-top: 10px;
    text-align: center;
}

.tree-node-manager .tree-node-sublabel {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    text-align: center;
}

.tree-node-manager .tree-node-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    background: #dbeafe;
    color: #1d4ed8;
}

.tree-node-manager .tree-node-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    animation: tree-pulse-dot 2s ease-in-out infinite;
}

/* Agent节点 - 第三层 */
.tree-node-agent {
    position: relative;
}

.tree-node-agent .tree-node-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 160px;
    max-width: 200px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tree-node-agent .tree-node-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
}

.tree-node-agent:hover .tree-node-card {
    box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #c7d2fe;
}

.tree-node-agent .tree-node-card .tree-node-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: transform 0.3s ease;
}

.tree-node-agent:hover .tree-node-card .tree-node-icon {
    transform: scale(1.1);
}

.tree-node-agent .tree-node-card .tree-node-icon .material-symbols-outlined {
    font-size: 22px;
    color: white;
}

.tree-node-agent .tree-node-card .tree-node-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node-agent .tree-node-card .tree-node-task {
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-node-agent .tree-node-card .tree-node-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
}

.tree-node-agent .tree-node-card .tree-node-model-badge .material-symbols-outlined {
    font-size: 12px;
}

.tree-node-agent .tree-node-connector {
    width: 2px;
    height: 50px;
    background: linear-gradient(180deg, #c7d2fe 0%, #a5b4fc 100%);
    margin: 0 auto;
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
}

/* 树状图SVG连接线 */
.tree-svg-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tree-svg-connections path {
    fill: none;
    stroke: #a5b4fc;
    stroke-width: 2;
    stroke-dasharray: 6 3;
    animation: tree-dash-flow 1.5s linear infinite;
}

/* 树状图动画 */
@keyframes tree-rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes tree-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes tree-dash-flow {
    to { stroke-dashoffset: -18; }
}

@keyframes tree-node-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tree-connector-appear {
    from {
        opacity: 0;
        stroke-dashoffset: 100;
    }
    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

.tree-node {
    animation: tree-node-appear 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tree-node-founder { animation-delay: 0s; }
.tree-node-manager { animation-delay: 0.2s; }
.tree-node-agent:nth-child(1) { animation-delay: 0.4s; }
.tree-node-agent:nth-child(2) { animation-delay: 0.5s; }
.tree-node-agent:nth-child(3) { animation-delay: 0.6s; }
.tree-node-agent:nth-child(4) { animation-delay: 0.7s; }
.tree-node-agent:nth-child(5) { animation-delay: 0.8s; }
.tree-node-agent:nth-child(6) { animation-delay: 0.9s; }

.tree-svg-connections path {
    animation: tree-connector-appear 0.6s ease-out both;
}

/* 展开折叠动画 */
.tree-level-2.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-level-2.expanded {
    max-height: 500px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.tree-toggle-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.tree-toggle-btn .material-symbols-outlined {
    font-size: 16px;
    color: #3b82f6;
    transition: transform 0.3s ease;
}

.tree-toggle-btn.collapsed .material-symbols-outlined {
    transform: rotate(0deg);
}

.tree-toggle-btn.expanded .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Agent详情弹窗增强 */
.agent-detail-config {
    padding: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.agent-detail-config h5 {
    color: #0369a1;
    margin-bottom: 12px;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e0f2fe;
}

.config-item:last-child {
    border-bottom: none;
}

.config-item .config-label {
    font-size: 12px;
    color: #64748b;
    min-width: 80px;
}

.config-item .config-value {
    font-size: 13px;
    color: #0c4a6e;
    font-weight: 500;
    word-break: break-all;
}

.config-item .config-value.masked {
    font-family: monospace;
    letter-spacing: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .agent-node {
        min-width: 150px;
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .tree-diagram-container {
        padding: 20px 10px;
        min-height: 350px;
    }

    .tree-node-founder .tree-node-avatar {
        width: 64px;
        height: 64px;
    }

    .tree-node-founder .tree-node-avatar .material-symbols-outlined {
        font-size: 28px;
    }

    .tree-node-manager .tree-node-avatar {
        width: 56px;
        height: 56px;
    }

    .tree-node-manager .tree-node-avatar .material-symbols-outlined {
        font-size: 24px;
    }

    .tree-node-agent .tree-node-card {
        min-width: 130px;
        max-width: 160px;
        padding: 12px 14px;
    }

    .tree-level-1 {
        margin-top: 36px;
    }

    .tree-level-2 {
        margin-top: 36px;
        gap: 10px;
    }

    .tree-node-agent .tree-node-connector {
        height: 36px;
        top: -36px;
    }

    .tree-connector-group .tree-connector-line {
        height: 36px;
        top: -36px;
    }
}

@media (max-width: 480px) {
    .tree-level-2 {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tree-node-agent .tree-node-card {
        min-width: 120px;
        padding: 10px 12px;
    }

    .tree-node-agent .tree-node-card .tree-node-icon {
        width: 36px;
        height: 36px;
    }

    .tree-node-agent .tree-node-card .tree-node-icon .material-symbols-outlined {
        font-size: 18px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-node,
.modal-content {
    animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* === v1.2.5 === */
.tree-horizontal-container{width:100%;overflow-x:auto;overflow-y:hidden;padding:20px;background:linear-gradient(180deg,#f8fafc,#f1f5f9);border-radius:12px;border:1px solid rgba(0, 0, 0, 0.1);min-height:200px}
.tree-horizontal{display:flex;flex-direction:row;align-items:center;justify-content:center;min-width:fit-content;padding:10px 0}
.h-node{display:flex;flex-direction:column;align-items:center;flex-shrink:0}
.h-connector{display:flex;align-items:center;flex-shrink:0;width:40px;height:2px;background:linear-gradient(90deg,#a5b4fc,#c7d2fe);margin:0 4px;position:relative}
.h-connector::after{content:"";position:absolute;right:-2px;top:-4px;width:0;height:0;border-left:8px solid #a5b4fc;border-top:5px solid transparent;border-bottom:5px solid transparent}
.h-node-founder .h-node-avatar{width:64px;height:64px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#6366f1,#a855f7);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 20px -4px rgba(99,102,241,.5),0 0 0 3px rgba(99,102,241,.1)}
.h-node-founder:hover .h-node-avatar{box-shadow:0 10px 30px -4px rgba(99,102,241,.6),0 0 0 5px rgba(99,102,241,.15);transform:scale(1.05)}
.h-node-founder .h-node-avatar .material-symbols-outlined{font-size:30px;color:#ffffff}
.h-node-founder .h-node-label{font-size:13px;font-weight:700;color:#1e1b4b;margin-top:8px;text-align:center}
.h-node-manager .h-node-avatar{width:56px;height:56px;border-radius:16px;background:linear-gradient(135deg,#6366f1,#6366f1);display:flex;align-items:center;justify-content:center;box-shadow:0 5px 16px -3px rgba(99,102,241,.5),0 0 0 3px rgba(99,102,241,.1);cursor:pointer}
.h-node-manager .h-node-badge{display:inline-block;padding:1px 6px;border-radius:8px;font-size:9px;font-weight:600;background:rgba(99,102,241,.1);color:#6366f1;border:1px solid rgba(99,102,241,.2);margin-top:2px}
.h-node-manager .h-node-status{display:inline-flex;align-items:center;gap:4px;margin-top:4px;padding:2px 8px;border-radius:9999px;font-size:10px;font-weight:500;background:#dbeafe;color:#1d4ed8}
.h-node-manager .h-node-status .status-dot{width:5px;height:5px;border-radius:50%;background:#3b82f6}
/* Icon fallback: Material Symbols overlays fallback letter via CSS Grid stacking */
.h-node-avatar, .h-node-icon{display:grid!important;place-items:center!important}
.h-node-avatar>*,.h-node-icon>*{grid-area:1/1/2/2;display:flex;align-items:center;justify-content:center}
.h-node-avatar .material-symbols-outlined,.h-node-icon .material-symbols-outlined{z-index:2;position:relative}
.icon-fallback{z-index:1;font-weight:700}
/* When Material Symbols font is missing, hide raw text and show fallback */
.ms-fallback .material-symbols-outlined{font-size:0!important;width:0!important;height:0!important;overflow:hidden!important}
.ms-fallback .icon-fallback{display:flex!important}
/* 分支Agent图标缩小为原有大小的一半 */
.h-node-agent .h-node-card{background:#ffffff;border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;min-width:80px;max-width:100px;box-shadow:0 2px 6px -1px rgba(0,0,0,.06);text-align:center;position:relative;overflow:hidden;cursor:pointer}
.h-node-agent .h-node-card::before{content:"";position:absolute;top:0;left:0;right:0;height:2px}
.h-node-agent:hover .h-node-card{box-shadow:0 4px 12px -2px rgba(0,0,0,.1);transform:translateY(-2px);border-color:#c7d2fe}
.h-node-agent .h-node-card .h-node-icon{width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;margin:0 auto 4px}
.h-node-agent .h-node-card .h-node-icon .material-symbols-outlined{font-size:13px;color:#ffffff}
.h-node-agent .h-node-card .h-node-name{font-size:10px;font-weight:600;color:#1f2937;margin:0 0 1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.h-node-agent .h-node-card .h-node-task{font-size:9px;color:#9ca3af;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.h-node-agent .h-node-card .h-node-model-badge{display:inline-flex;align-items:center;gap:2px;margin-top:3px;padding:1px 4px;border-radius:4px;font-size:8px;font-weight:500;background:#f3f4f6;color:#6b7280;line-height:1.2}
/* === Fixed Input Bar (永久固化在页面底部) === */
.fixed-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 10px 24px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.95) 12%, rgba(255,255,255,1) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.input-bar-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.06);
    transition: box-shadow .3s, border-color .3s;
}
.input-bar-wrapper:focus-within {
    border-color: rgba(59,130,246,.25);
    box-shadow: 0 2px 12px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.08), 0 0 0 3px rgba(59,130,246,.08);
}

/* ---- 顶部工具栏 ---- */
.input-bar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 2px 10px;
}
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.tool-btn .material-symbols-outlined {
    font-size: 17px;
}
.tool-btn:hover {
    background: #f3f4f6;
    color: #334155;
}
.tool-btn:active {
    background: #e5e7eb;
}
.toolbar-divider {
    width: 1px;
    height: 18px;
    background: rgba(0,0,0,.08);
    margin: 0 4px;
}

/* ---- 模式选择器 ---- */
.mode-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.mode-trigger .material-symbols-outlined {
    font-size: 17px;
    color: #9ca3af;
}
.mode-trigger .mode-arrow {
    font-size: 16px !important;
    transition: transform .2s;
}
.mode-selector.open .mode-arrow {
    transform: rotate(180deg);
}
.mode-trigger:hover {
    background: #f3f4f6;
    color: #334155;
}

/* ---- 输入行 ---- */
.input-bar-main {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 4px 12px 12px 12px;
}
.ib-input {
    flex: 1;
    min-height: 48px;
    max-height: 160px;
    padding: 12px 0 12px 6px;
    border: none;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    overflow-y: auto;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    caret-color: #3b82f6;
}
.ib-input:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

/* ---- 发送按钮 ---- */
.ib-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: none;
    cursor: pointer;
    color: #ffffff;
    flex-shrink: 0;
    transition: background .2s, transform .15s, box-shadow .2s;
    align-self: flex-end;
    margin-bottom: 4px;
}
.ib-send .material-symbols-outlined {
    font-size: 20px;
}
.ib-send:hover {
    background: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.ib-send:active {
    transform: scale(.94);
}

/* ---- 附件预览 ---- */
.chat-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 18px 10px 18px;
    border-top: 1px solid rgba(0,0,0,.04);
}
.chat-attachments-preview .chat-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 4px;
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 20px;
    font-size: 12px;
    color: #334155;
    transition: border-color .15s;
}
.chat-attachments-preview .chat-attachment-item:hover {
    border-color: rgba(0,0,0,.12);
}
.chat-attachments-preview .chat-attachment-item .file-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}
.chat-attachments-preview .chat-attachment-item .file-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #334155;
    font-weight: 500;
}
.chat-attachments-preview .chat-attachment-item .remove-attachment {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    color: #9ca3af;
    border-radius: 50%;
    transition: color .15s, background .15s;
    margin-left: 1px;
}
.chat-attachments-preview .chat-attachment-item .remove-attachment:hover {
    color: #ef4444;
    background: rgba(239,68,68,.08);
}

.has-fixed-input { padding-bottom: 170px !important; }

/* ---- 模式下拉菜单 ---- */
.mode-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    z-index: 100;
    min-width: 170px;
    overflow: hidden;
    padding: 4px;
}
.mode-selector.open .mode-dropdown {
    display: block;
}
.mode-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
    border-radius: 10px;
    transition: background .12s, color .12s;
}
.mode-dropdown-item .material-symbols-outlined {
    font-size: 18px;
    color: #9ca3af;
}
.mode-dropdown-item:hover {
    background: #f3f4f6;
    color: #1e293b;
}
.mode-dropdown-item.active {
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 600;
}
.mode-dropdown-item.active .material-symbols-outlined {
    color: #3b82f6;
}
.workflow-engine {
    position: relative;
    --primary-color: #3b82f6;
    --primary-hover: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e5e7eb;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px #f1f5f9;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* 平滑滚动 */
.visual-editor .palette,
.visual-editor .canvas,
.modal-body {
    scroll-behavior: smooth;
}

/* 选中文本样式 */
.visual-editor ::selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1e293b;
}

/* 聚焦样式 */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 禁用文本选择（拖拽时） */
.visual-editor .node.dragging,
.visual-editor .palette-item:active {
    user-select: none;
    -webkit-user-select: none;
}

/* 滚动条样式 */
.visual-editor .palette::-webkit-scrollbar,
.visual-editor .canvas::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.visual-editor .palette::-webkit-scrollbar-track,
.visual-editor .canvas::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.visual-editor .palette::-webkit-scrollbar-thumb,
.visual-editor .canvas::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.visual-editor .palette::-webkit-scrollbar-thumb:hover,
.visual-editor .canvas::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 工具提示 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #1e293b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.empty-state .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    color: #94a3b8;
    max-width: 300px;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease both;
}

/* 滑入动画 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease both;
}

/* 缩放动画 */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.2s ease both;
}

/* 节点出现动画 */
@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.visual-editor .node {
    animation: nodeAppear 0.3s ease both;
}

/* 连线目标节点高亮 */
.visual-editor .node.potential-target {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.visual-editor .node.potential-target .input-port {
    animation: port-pulse 1s ease-in-out infinite;
    background-color: #10b981;
    transform: scale(1.2);
}

.visual-editor .node.hover-target {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.visual-editor .node.hover-target .input-port {
    animation: port-glow 0.5s ease-in-out infinite alternate;
    background-color: #10b981;
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

@keyframes port-glow {
    from {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }
    to {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
    }
}

/* 连接成功动画 */
.visual-editor .node.connection-success {
    animation: connection-flash 0.5s ease;
}

@keyframes connection-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.2);
        border-color: #10b981;
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-color: #e5e7eb;
    }
}

/* 连线悬停效果增强 */
.visual-editor .connections-layer path.conn-line {
    stroke-linecap: round;
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
    cursor: pointer;
}

.visual-editor .connections-layer path.conn-line:hover {
    stroke: #ef4444;
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.3));
}

/* 临时连线样式 */
.visual-editor .connections-layer path.temp {
    pointer-events: none;
    opacity: 0.7;
    animation: dash-animation 0.5s linear infinite;
}

/* 连线箭头标记 */
.visual-editor .connections-layer marker {
    fill: #3b82f6;
}

.visual-editor .connections-layer marker.arrow-red {
    fill: #ef4444;
}

/* 对齐参考线 */
.visual-editor .alignment-guide-x,
.visual-editor .alignment-guide-y {
    position: absolute;
    background: #3b82f6;
    opacity: 0.5;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.2s ease;
}

.visual-editor .alignment-guide-x {
    width: 1px;
    top: 0;
    bottom: 0;
}

.visual-editor .alignment-guide-y {
    height: 1px;
    left: 0;
    right: 0;
}

/* 连线提示 */
.visual-editor .connection-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
    pointer-events: none;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.visual-editor .connection-hint .material-symbols-outlined {
    font-size: 16px;
}

/* 连接预览线 */
.visual-editor .connections-layer .preview-line {
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* 吸附对齐动画 */
.visual-editor .node.snapping {
    transition: left 0.1s ease, top 0.1s ease;
}

/* 节点拖拽时的阴影 */
.visual-editor .node.dragging {
    opacity: 0.9;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    z-index: 100;
    cursor: grabbing;
}

/* 连接成功动画增强 */
@keyframes connectionSuccess {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}

.visual-editor .node.connection-success {
    animation: connectionSuccess 0.5s ease;
    border-color: #10b981;
}

/* 连接线动画 */
@keyframes connectionFlow {
    from {
        stroke-dashoffset: 20;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.visual-editor .connections-layer path.conn-line {
    stroke-dasharray: none;
}

.visual-editor .connections-layer path.conn-line.animated {
    stroke-dasharray: 10, 5;
    animation: connectionFlow 1s linear infinite;
}

/* 连线工具栏 */
.visual-editor .connection-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.visual-editor .connection-tools .btn-secondary {
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.visual-editor .connection-tools .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.visual-editor .connection-tools .connection-count {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 16px;
}

.visual-editor .connection-tools .connection-count .material-symbols-outlined {
    font-size: 14px;
}

/* 连接点提示动画 */
@keyframes connectionPointPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.visual-editor .node.potential-target .input-port,
.visual-editor .node.hover-target .input-port {
    animation: connectionPointPulse 1.5s ease-in-out infinite;
}

/* 连接线流动动画 */
@keyframes connectionLineFlow {
    from {
        stroke-dashoffset: 20;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.visual-editor .connections-layer path.conn-line.flowing {
    stroke-dasharray: 10, 5;
    animation: connectionLineFlow 1s linear infinite;
}

/* 连接点悬停效果 */
.visual-editor .input-port:hover,
.visual-editor .output-port:hover {
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

/* 连接线删除确认弹窗 */
.visual-editor .delete-confirm {
    position: absolute;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
}

.visual-editor .delete-confirm button {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.visual-editor .delete-confirm .btn-confirm {
    background: #ef4444;
    color: #ffffff;
    border: none;
}

.visual-editor .delete-confirm .btn-confirm:hover {
    background: #dc2626;
}

.visual-editor .delete-confirm .btn-cancel {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.visual-editor .delete-confirm .btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 1000;
    overflow: hidden;
    animation: contextMenuIn 0.15s ease;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu .menu-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.context-menu .menu-item:hover {
    background: #f1f5f9;
}

.context-menu .menu-item.danger {
    color: #ef4444;
}

.context-menu .menu-item.danger:hover {
    background: #fef2f2;
}

.context-menu .menu-item .material-symbols-outlined {
    font-size: 16px;
}

.context-menu .menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* 连线悬停提示 */
.visual-editor .connections-layer path.conn-line:hover {
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
}

/* 连接点动画增强 */
@keyframes portBreathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }
}

.visual-editor .output-port:hover {
    animation: portBreathe 2s ease-in-out infinite;
}

/* 选中的连线 */
.visual-editor .connections-layer path.conn-line.selected {
    stroke: #6366f1;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.4));
}

/* 连线选中动画 */
@keyframes lineSelected {
    0% {
        stroke-dasharray: 0, 100;
    }
    100% {
        stroke-dasharray: 100, 0;
    }
}

.visual-editor .connections-layer path.conn-line.selecting {
    animation: lineSelected 0.3s ease forwards;
}

/* 连线批量操作工具栏 */
.batch-operations {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.batch-operations .batch-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.batch-operations .batch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.batch-operations .batch-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.batch-operations .batch-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.batch-operations .batch-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.batch-operations .batch-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

/* 连线图例 */
.connection-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    z-index: 50;
    font-size: 11px;
}

.connection-legend h4 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.connection-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.connection-legend .legend-line {
    width: 20px;
    height: 2px;
    border-radius: 1px;
}

.connection-legend .legend-line.normal {
    background: #3b82f6;
}

.connection-legend .legend-line.selected {
    background: #6366f1;
}

.connection-legend .legend-line.hover {
    background: #ef4444;
}

/* 教程弹窗 */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.tutorial-card {
    background: #ffffff;
    border-radius: 16px;
    width: 90vw;
    max-width: 480px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideInUp 0.3s ease;
}

.tutorial-header {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    padding: 32px 24px;
    text-align: center;
}

.tutorial-header .material-symbols-outlined {
    font-size: 48px;
    color: #ffffff;
    margin-bottom: 16px;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.tutorial-header p {
    margin: 8px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.tutorial-content {
    padding: 24px;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tutorial-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tutorial-step-icon.blue {
    background: #eff6ff;
}

.tutorial-step-icon.green {
    background: #f0fdf4;
}

.tutorial-step-icon.red {
    background: #fef2f2;
}

.tutorial-step-icon .material-symbols-outlined {
    font-size: 18px;
}

.tutorial-step-icon.blue .material-symbols-outlined {
    color: #3b82f6;
}

.tutorial-step-icon.green .material-symbols-outlined {
    color: #10b981;
}

.tutorial-step-icon.red .material-symbols-outlined {
    color: #ef4444;
}

.tutorial-step-content h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.tutorial-step-content p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
}

.tutorial-close-btn {
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    background: linear-gradient(135deg, #3b82f6, #3b82f6);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 快捷键提示 */
.shortcuts-hint {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    z-index: 50;
    font-size: 11px;
    display: none;
}

.shortcuts-hint.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.shortcuts-hint h4 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.shortcuts-hint .shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.shortcuts-hint .shortcut-key {
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    font-family: monospace;
}

.shortcuts-hint .shortcut-desc {
    font-size: 11px;
    color: #64748b;
}

/* 画布缩放控制 */
.zoom-controls {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.zoom-controls button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zoom-controls button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.zoom-controls button .material-symbols-outlined {
    font-size: 18px;
    color: #475569;
}

.zoom-controls .zoom-level {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 0;
}

/* 涟漪效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(59, 130, 246, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ripple:active::before {
    opacity: 1;
}

/* 骨架屏加载 */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, rgba(0, 0, 0, 0.1) 50%, #f1f5f9 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* 渐变背景 */
.gradient-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #3b82f6 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
}

.gradient-pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.gradient-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* 玻璃效果 */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 发光效果 */
.glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.glow-success {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-warning {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.glow-danger {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* 禁用状态 */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* 激活状态 */
.active {
    position: relative;
}

.active::after {
    content: none;
}

/* 加载旋转 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 弹跳动画 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 1s ease infinite;
}

/* 摇晃动画 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* 成功动画 */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: successPulse 1s ease;
}

/* 错误动画 */
@keyframes errorPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.error-pulse {
    animation: errorPulse 1s ease;
}

/* 布局工具类 */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-5 {
    gap: 20px;
}

.gap-6 {
    gap: 24px;
}

/* 间距工具类 */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.m-6 { margin: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-5 { padding-top: 20px; }
.pt-6 { padding-top: 24px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; }
.pb-4 { padding-bottom: 16px; }
.pb-5 { padding-bottom: 20px; }
.pb-6 { padding-bottom: 24px; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 4px; }
.pl-2 { padding-left: 8px; }
.pl-3 { padding-left: 12px; }
.pl-4 { padding-left: 16px; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 4px; }
.pr-2 { padding-right: 8px; }
.pr-3 { padding-right: 12px; }
.pr-4 { padding-right: 16px; }

/* 文本工具类 */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: #3b82f6; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-danger { color: #ef4444; }
.text-muted { color: #94a3b8; }

/* 圆角工具类 */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: 4px; }
.rounded { border-radius: 6px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }
.rounded-2xl { border-radius: 20px; }
.rounded-full { border-radius: 9999px; }

/* 宽度工具类 */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

/* 高度工具类 */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-fit { height: fit-content; }

/* 溢出工具类 */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* 显示工具类 */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

/* 定位工具类 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; top: 0; }

/* 边框工具类 */
.border { border: 1px solid #e5e7eb; }
.border-2 { border: 2px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-l { border-left: 1px solid #e5e7eb; }
.border-r { border-right: 1px solid #e5e7eb; }

/* 阴影工具类 */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: 0 1px 2px #f1f5f9; }
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }

/* 背景色工具类 */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }

.workflow-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.workflow-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
}

.workflow-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.workflow-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
}

.status-active {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-inactive {
    background-color: #f1f5f9;
    color: #64748b;
}

.status-inactive::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
}

.workflow-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.workflow-triggers h5,
.workflow-actions h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.workflow-triggers h5::before,
.workflow-actions h5::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: #3b82f6;
}

.workflow-triggers h5::before {
    background: #f59e0b;
}

.workflow-triggers ul,
.workflow-actions ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.workflow-triggers li,
.workflow-actions li {
    font-size: 12px;
    color: #64748b;
    padding: 8px 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.workflow-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.workflow-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
}

.workflow-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.workflow-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #f1f5f9;
    border-color: #3b82f6;
}

.btn-icon.btn-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background-color: #fef2f2;
}

.btn-icon .material-symbols-outlined {
    font-size: 18px;
    color: #64748b;
}

.btn-icon:hover .material-symbols-outlined {
    color: #3b82f6;
}

.btn-icon.btn-danger:hover .material-symbols-outlined {
    color: #ef4444;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modal-slide-up 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafbfc;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.modal-close .material-symbols-outlined {
    font-size: 20px;
    color: #64748b;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 表单样式 */
#workflow-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trigger-list,
.action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.trigger-item,
.action-item {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
}

.trigger-item:hover,
.action-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px #f1f5f9;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn-secondary {
    padding: 10px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.form-actions .btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #3b82f6);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 80px;
    right: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1001;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

/* 工作流详情样式 */
.workflow-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.detail-section p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.detail-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-section li {
    font-size: 13px;
    color: #64748b;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-item {
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
}

.detail-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.detail-actions .btn-secondary {
    padding: 10px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.detail-actions .btn-danger {
    padding: 10px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-actions .btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* 工作流列表样式 */
.workflows-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.workflow-item:hover {
    box-shadow: 0 4px 12px #f1f5f9;
    border-color: #cbd5e1;
}

.workflow-item .workflow-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1e293b;
}

.workflow-item .workflow-info p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.workflow-item .workflow-actions {
    display: flex;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .workflow-body {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .workflow-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .workflow-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-content {
        width: 95%;
        margin: 12px;
        max-height: 95vh;
    }

    .visual-editor .palette {
        width: 200px;
    }

    .visual-editor .palette-item-desc {
        display: none;
    }

    .visual-editor .editor-header {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .detail-actions .btn-secondary,
    .detail-actions .btn-danger {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 640px) {
    .visual-editor .editor-content {
        flex-direction: column;
    }

    .visual-editor .palette {
        width: 100%;
        max-height: 250px;
    }

    .visual-editor .palette-items {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .visual-editor .palette-item {
        flex: 1;
        min-width: 140px;
    }

    .visual-editor .node {
        width: 180px;
    }

    .workflow-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .workflow-item .workflow-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 可视化编辑器样式 */
.visual-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 80vh;
}

.visual-editor .editor-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.visual-editor .editor-header .form-group {
    margin-bottom: 0;
}

.visual-editor .editor-header .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    display: block;
}

.visual-editor .editor-header .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.visual-editor .editor-header .form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.visual-editor .editor-content {
    display: flex;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
}

.visual-editor .palette {
    width: 260px;
    background-color: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.visual-editor .palette-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.visual-editor .palette-header .material-symbols-outlined {
    font-size: 20px;
    color: #3b82f6;
}

.visual-editor .palette-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.visual-editor .palette-search .material-symbols-outlined {
    font-size: 18px;
    color: #94a3b8;
}

.visual-editor .palette-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    color: #1e293b;
    background: transparent;
}

.visual-editor .palette-search input::placeholder {
    color: #94a3b8;
}

.visual-editor .palette-section {
    padding: 12px 14px;
}

.visual-editor .palette-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.visual-editor .palette-section-title .material-symbols-outlined {
    font-size: 16px;
}

.visual-editor .palette-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.visual-editor .palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s ease;
}

.visual-editor .palette-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.visual-editor .palette-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.visual-editor .palette-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.visual-editor .palette-item-icon .material-symbols-outlined {
    font-size: 18px;
    color: #ffffff;
}

.visual-editor .palette-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.visual-editor .palette-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visual-editor .palette-item-desc {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visual-editor .canvas-container {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.visual-editor .canvas {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: auto;
}

.visual-editor .canvas-grid {
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 24px 24px;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.visual-editor .node {
    position: absolute;
    width: 220px;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: move;
    z-index: 10;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.visual-editor .node:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.visual-editor .node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #3b82f6, #3b82f6);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.visual-editor .node-header .material-symbols-outlined {
    font-size: 18px;
}

.visual-editor .node-header span {
    font-size: 13px;
    font-weight: 600;
}

.visual-editor .node-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visual-editor .node-property {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visual-editor .node-property label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.visual-editor .node-input {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    width: 100%;
    transition: border-color 0.2s ease;
}

.visual-editor .node-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.visual-editor .node-inputs, .visual-editor .node-outputs {
    display: flex;
    gap: 8px;
    padding: 0 14px 12px;
}

.visual-editor .input-port, .visual-editor .output-port {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: crosshair;
    transition: transform 0.2s ease;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.visual-editor .input-port:hover, .visual-editor .output-port:hover {
    transform: scale(1.3);
}

.visual-editor .input-port {
    background-color: #10b981;
}

.visual-editor .output-port {
    background-color: #3b82f6;
}

.visual-editor .connections-layer line.conn-line {
    cursor: pointer;
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
}
.visual-editor .connections-layer line.conn-line:hover {
    stroke: #ef4444;
    stroke-width: 3;
}
.visual-editor .connections-layer line.temp {
    pointer-events: none;
    opacity: 0.7;
    animation: dash-animation 0.5s linear infinite;
}

@keyframes dash-animation {
    to {
        stroke-dashoffset: -9;
    }
}

/* 节点拖拽时的视觉反馈 */
.visual-editor .node.dragging {
    opacity: 0.8;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

/* 连接端口激活状态 */
.visual-editor .input-port.active, .visual-editor .output-port.active {
    animation: port-pulse 1s ease-in-out infinite;
}

@keyframes port-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

.visual-editor .trigger-node .node-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.visual-editor .trigger-node {
    border-color: #fde68a;
}

.visual-editor .action-node .node-header {
    background: linear-gradient(135deg, #3b82f6, #3b82f6);
}

.visual-editor .action-node {
    border-color: #bfdbfe;
}

.visual-editor .editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.visual-editor .editor-actions .btn-secondary {
    padding: 10px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.visual-editor .editor-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.visual-editor .editor-actions .btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #3b82f6);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.visual-editor .editor-actions .btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* 服务能力标签样式 */
.service-capabilities {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.service-capabilities h6 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.capabilities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.capability-tag {
    padding: 4px 10px;
    background-color: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 11px;
    color: #64748b;
    transition: all 0.2s ease;
}

.capability-tag:hover {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}/* 结果验收板块样式 */

.result-acceptance {
    padding: 0;
}

.result-acceptance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.result-acceptance-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-acceptance-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.result-acceptance-title .material-symbols-outlined {
    color: #3b82f6;
    font-size: 28px;
}

/* 标签页导航 */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e5e7eb;
    color: #334155;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
}

.tab-btn .material-symbols-outlined {
    font-size: 20px;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.tab-btn:not(.active) .tab-count {
    background: #d1d5db;
    color: #334155;
}

/* 交付品列表 */
.deliverables-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deliverable-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.deliverable-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.deliverable-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.deliverable-info {
    flex: 1;
}

.deliverable-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.deliverable-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.deliverable-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.deliverable-meta-item .material-symbols-outlined {
    font-size: 16px;
}

.deliverable-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.deliverable-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.deliverable-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.deliverable-status.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.deliverable-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

/* 交付品内容区域 */
.deliverable-content {
    margin-bottom: 16px;
}

.deliverable-text {
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.deliverable-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.deliverable-preview.image-preview {
    max-width: 300px;
    cursor: pointer;
}

.deliverable-preview.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.deliverable-preview.audio-preview,
.deliverable-preview.video-preview {
    max-width: 100%;
}

.deliverable-preview audio,
.deliverable-preview video {
    width: 100%;
    border-radius: 8px;
}

.deliverable-preview.document-preview {
    padding: 20px;
    text-align: center;
}

.document-preview .document-icon {
    font-size: 48px;
    color: #6b7280;
    margin-bottom: 8px;
}

.document-preview .document-name {
    font-size: 14px;
    color: #334155;
    margin-bottom: 4px;
}

.document-preview .document-size {
    font-size: 12px;
    color: #9ca3af;
}

/* 预览遮罩层 */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
}

.preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #334155;
}

/* 交付品操作按钮 */
.deliverable-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.action-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.action-btn.primary:hover {
    background: #3b82f6;
}

.action-btn.success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.action-btn.success:hover {
    background: #059669;
}

.action-btn.danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.action-btn.danger:hover {
    background: #dc2626;
}

.action-btn .material-symbols-outlined {
    font-size: 18px;
}

/* 验收备注模态框 */
.remark-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.remark-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
}

.remark-modal .modal-header {
    margin-bottom: 20px;
}

.remark-modal .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.remark-modal textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
}

.remark-modal textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.remark-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .result-acceptance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .tab-navigation {
        width: 100%;
    }

    .deliverable-header {
        flex-direction: column;
        gap: 12px;
    }

    .deliverable-meta {
        flex-direction: column;
        gap: 8px;
    }

    .deliverable-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}/* 用户需求输入界面样式 */

.requirement-input {
    padding: 0;
}

.requirement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.requirement-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.requirement-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.requirement-title .material-symbols-outlined {
    color: #3b82f6;
    font-size: 28px;
}

/* 需求表单 */
.requirement-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-section-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.form-section-header .material-symbols-outlined {
    color: #3b82f6;
    font-size: 24px;
}

/* 富文本编辑器 */
.rich-text-editor {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.toolbar-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.toolbar-btn .material-symbols-outlined {
    font-size: 20px;
}

.toolbar-divider {
    width: 1px;
    height: 36px;
    background: #e5e7eb;
    margin: 0 8px;
}

.editor-content {
    flex: 1;
    min-height: 200px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    font-family: "SimSun", "宋体", serif;
}

.editor-content:focus {
    outline: none;
}

.editor-content[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

/* @选项功能 */
.at-selector {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
}

.at-selector-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.at-selector-item:hover {
    background-color: #f3f4f6;
}

.at-selector-item.selected {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.at-selector-item .item-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.at-selector-item .item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.at-selector-item .item-icon {
    font-size: 20px;
    color: #6b7280;
    flex-shrink: 0;
}

.at-selector-item .item-info {
    flex: 1;
    min-width: 0;
}

.at-selector-item .item-name {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.at-selector-item .item-size {
    font-size: 12px;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.at-selector-item .item-type {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* 插入的附件引用 */
.attachment-reference {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    color: white;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.attachment-reference:hover {
    background: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.attachment-reference .reference-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.attachment-reference .reference-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-reference .material-symbols-outlined {
    font-size: 16px;
    flex-shrink: 0;
}

.attachment-reference .reference-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-id strong {
    color: #3b82f6;
}

/* 历史需求记录 */
.history-section {
    margin-top: 32px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.history-info {
    flex: 1;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.history-meta {
    font-size: 12px;
    color: #9ca3af;
}

.history-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.history-status.received {
    background: #fef3c7;
    color: #92400e;
}

.history-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.history-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.history-status.needs-info {
    background: #fee2e2;
    color: #991b1b;
}

/* 状态反馈模态框 */
.status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.status-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.received {
    background: #fef3c7;
}

.status-icon.processing {
    background: #dbeafe;
}

.status-icon.completed {
    background: #d1fae5;
}

.status-icon.needs-info {
    background: #fee2e2;
}

.status-icon .material-symbols-outlined {
    font-size: 32px;
}

.status-icon.received .material-symbols-outlined {
    color: #f59e0b;
}

.status-icon.processing .material-symbols-outlined {
    color: #3b82f6;
}

.status-icon.completed .material-symbols-outlined {
    color: #10b981;
}

.status-icon.needs-info .material-symbols-outlined {
    color: #ef4444;
}

.status-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.status-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.status-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .requirement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .file-upload-section {
        grid-template-columns: 1fr;
    }
    
    .submit-section {
        flex-direction: column;
        gap: 16px;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .editor-toolbar {
        justify-content: center;
    }
}

/* 附件功能 - 整合到富文本编辑器 */
.attachment-buttons {
    display: flex;
    gap: 4px;
}

.attachment-btn {
    position: relative;
}

.attachment-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #334155;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
}

.attachment-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

.hidden-upload-inputs {
    display: none;
}

.upload-input-hidden {
    display: none;
}

/* 附件区域 */
.attachment-area {
    border-top: 1px dashed #e5e7eb;
    padding: 12px 16px;
    background: #fafafa;
    display: block;
}

.attachment-area:empty {
    display: none;
}

/* 表单操作区域 */
.form-actions {
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.uploaded-files-lists {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uploaded-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uploaded-files-list:empty {
    display: none;
}

/* 已上传文件项 */
.uploaded-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
}

.uploaded-file:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.uploaded-file .file-thumbnail-small {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.uploaded-file .file-thumbnail-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-file .file-icon-small {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 4px;
    flex-shrink: 0;
}

.uploaded-file .file-icon-small .material-symbols-outlined {
    font-size: 16px;
    color: #6b7280;
}

.uploaded-file .file-info-small {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.uploaded-file .file-name-small {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-weight: 500;
}

.uploaded-file .file-size-small {
    font-size: 10px;
    color: #9ca3af;
}

.uploaded-file .file-remove-small {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.uploaded-file .file-remove-small:hover {
    background: #fee2e2;
    color: #ef4444;
}

.uploaded-file .file-remove-small .material-symbols-outlined {
    font-size: 14px;
}

/* 附件摘要 */
#attachment-summary {
    color: #6b7280;
}

#attachment-summary.has-attachments {
    color: #10b981;
    font-weight: 500;
}

/* 工具栏分组 */
.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.editor-toolbar .toolbar-divider {
    height: 24px;
    margin: 0 4px;
}