/* 节点工具栏样式 */
.node-toolbar {
    position: absolute;
    display: none;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 6px;
    z-index: 1000;
    flex-direction: row;
    gap: 6px;
    border: 1px solid #e0e0e0;

    /* 确保工具栏可点击 */
    pointer-events: auto;
}

/* 工具栏按钮通用样式 */
.toolbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* 查询类型按钮 - 蓝色背景 */
.toolbar-button.query-action {
    background-color: #53bbfc;
    color: white;
    border: 1px solid #53bbfc;
}

.toolbar-button.query-action:hover {
    background-color: #53bbfc;
    border-color: #53bbfc;
}

/* 显示类型按钮 - 灰色背景 */
.toolbar-button.display-action {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #f0f0f0;
}

.toolbar-button.display-action:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
}

.toolbar-button:active {
    transform: translateY(1px);
}

/* 按钮图标样式 */
.toolbar-button i {
    margin-right: 4px;
    font-size: 14px;
}

/* 特定按钮图标颜色 */
#askAIBtn i {
    color: #ffffff;
}

#summariseNodeBtn i {
    color: #ffffff;
}

#summariseContextBtn i {
    color: #ffffff;
}

/* 工具栏显示动画 */
@keyframes toolbarFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.node-toolbar {
    animation: toolbarFadeIn 0.2s ease;
}

/* 移动端工具栏优化 */
@media (max-width: 768px) {
    .node-toolbar {
        padding: 8px;
        gap: 8px;
        border-radius: 8px;
        /* 确保工具栏不会超出屏幕 */
        max-width: calc(100vw - 40px);
        flex-wrap: wrap;
    }

    .toolbar-button {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 6px;
        min-height: 44px;
        min-width: 44px;
        /* 触摸反馈 */
        transition: all 0.2s ease;
        /* 确保文字不换行但允许按钮自适应 */
        white-space: nowrap;
        flex-shrink: 0;
    }

    .toolbar-button:active {
        transform: scale(0.95);
    }

    .toolbar-button.query-action:active {
        background-color: #4a9fd8;
    }

    .toolbar-button.display-action:active {
        background-color: #d4d4d4;
    }

    /* 工具栏按钮图标适配 */
    .toolbar-button i {
        margin-right: 6px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .node-toolbar {
        padding: 6px;
        gap: 6px;
        /* 小屏幕上可能需要垂直布局 */
        flex-direction: column;
        min-width: 120px;
    }

    .toolbar-button {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        justify-content: flex-start;
    }
}