/* 安全基线模块样式 */

/* 主容器 */
.baseline-view {
    height: 100%;
}

/* 左侧目录树 */
.baseline-sidebar {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

.baseline-category-tree {
    height: 100%;
}

.tree-header {
    background-color: white;
}

.tree-content {
    background-color: #f8f9fa;
}

/* 树节点样式 */
.tree-node {
    margin-bottom: 2px;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tree-node-content:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.tree-node-content.selected {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

.tree-node-content.has-children {
    font-weight: 500;
}

.tree-node-toggle {
    width: 20px;
    cursor: pointer;
    color: #6c757d;
}

.tree-node-toggle:hover {
    color: #0d6efd;
}

.tree-node-toggle-placeholder {
    width: 20px;
}

.tree-node-icon {
    margin-right: 8px;
}

.tree-node-label {
    flex: 1;
}

.tree-node-actions {
    display: none;
    margin-left: 8px;
}

.tree-node-content:hover .tree-node-actions {
    display: flex;
    gap: 4px;
}

.tree-node-children {
    margin-left: 24px;
    margin-top: 4px;
}

/* 右侧基线列表 */
.baseline-main {
    background-color: white;
}

.baseline-list {
    height: 100%;
}

.list-header {
    background-color: #f8f9fa;
}

.list-content {
    background-color: white;
}

.baseline-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* 搜索结果样式 */
.result-item,
.match-item {
    transition: all 0.2s;
}

.result-item.selected,
.match-item.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.result-item:hover,
.match-item:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.clause-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.clause-content mark {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

.preview-content {
    color: #6c757d;
}

.full-content {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 结果列表滚动条 */
.results-list::-webkit-scrollbar,
.matches-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track,
.matches-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.results-list::-webkit-scrollbar-thumb,
.matches-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover,
.matches-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .baseline-view {
        flex-direction: column;
    }

    .baseline-sidebar {
        width: 100% !important;
        min-width: auto !important;
        height: 300px;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
    }
}

/* 工具提示 */
.cursor-pointer {
    cursor: pointer;
}

/* 表格行禁用状态 */
.table-secondary {
    opacity: 0.6;
}

.table-secondary .baseline-content {
    text-decoration: line-through;
}

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

.tree-node {
    animation: fadeIn 0.2s ease-out;
}

/* 拖拽排序样式 */
.tree-node-drag-handle {
    width: 20px;
    color: #adb5bd;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.tree-node-drag-handle:hover {
    color: #6c757d;
}

.tree-node-drag-handle:active {
    cursor: grabbing;
}

.tree-node-content[draggable="true"] {
    cursor: grab;
}

.tree-node-content.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tree-node-content.drag-over {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    border-style: dashed;
    border-width: 2px;
}
