/**
 * treeTable - Layui 树形表格插件样式
 * @version 2.0.0
 */

/* 树形表格容器 */
.layui-treeTable {
    position: relative;
}

/* 缩进 */
.treeTable-indent {
    display: inline-block;
    height: 16px;
    vertical-align: middle;
}

/* 图标基础样式 */
.treeTable-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 4px;
    color: #666;
    transition: all 0.2s;
}

.treeTable-icon:hover {
    color: #1E9FFF;
}

.treeTable-icon .layui-icon {
    font-size: 12px;
}

/* 展开状态 */
.treeTable-icon-open {
    color: #1E9FFF;
}

.treeTable-icon-open .layui-icon {
    transform: rotate(0deg);
}

/* 折叠状态 */
.treeTable-icon-close {
    color: #666;
}

.treeTable-icon-close .layui-icon {
    transform: rotate(-90deg);
}

/* 叶子节点 */
.treeTable-icon-leaf {
    cursor: default;
    color: #999;
}

.treeTable-icon-leaf .layui-icon {
    font-size: 8px;
}

/* 树形单元格 */
.treeTable-cell-tree {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

/* 选中行样式 */
.layui-treeTable .layui-table-click {
    background-color: #f2f2f2;
}

/* 鼠标悬停 */
.layui-treeTable .layui-table-hover {
    background-color: #f8f8f8;
}

/* 父子行关系线（可选样式） */
.treeTable-line .treeTable-indent {
    position: relative;
}

.treeTable-line .treeTable-indent::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e6e6e6;
}

/* 加载中状态 */
.treeTable-loading {
    position: relative;
}

.treeTable-loading::after {
    content: '\e63d';
    font-family: 'layui-icon' !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: layui-rotate 1s linear infinite;
}

@keyframes layui-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 自定义图标 */
.treeTable-icon-folder {
    color: #FFB800;
}

.treeTable-icon-file {
    color: #1E9FFF;
}

/* 复选框级联状态 */
.treeTable-checkbox-indeterminate .layui-form-checkbox i {
    background-color: #1E9FFF;
    border-color: #1E9FFF;
}

.treeTable-checkbox-indeterminate .layui-form-checkbox i::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 7px;
    width: 8px;
    height: 2px;
    background-color: #fff;
}

/* 过滤高亮 */
.treeTable-highlight {
    background-color: #FFFF00;
    padding: 0 2px;
}

/* 不同层级的缩进宽度 */
.treeTable-level-0 .treeTable-indent { width: 0px; }
.treeTable-level-1 .treeTable-indent { width: 20px; }
.treeTable-level-2 .treeTable-indent { width: 40px; }
.treeTable-level-3 .treeTable-indent { width: 60px; }
.treeTable-level-4 .treeTable-indent { width: 80px; }
.treeTable-level-5 .treeTable-indent { width: 100px; }

/* 表格工具栏 */
.treeTable-tool {
    padding: 10px 15px;
    background-color: #f2f2f2;
    border-bottom: 1px solid #e6e6e6;
}

.treeTable-tool .layui-btn {
    margin-right: 10px;
}

.treeTable-tool .layui-input {
    display: inline-block;
    width: 200px;
    vertical-align: middle;
}

/* 展开折叠动画 */
.treeTable-anim {
    transition: all 0.3s ease-in-out;
}

/* 节点操作按钮 */
.treeTable-node-action {
    display: inline-block;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.layui-table-body tr:hover .treeTable-node-action {
    opacity: 1;
}

.treeTable-node-action .layui-btn {
    padding: 0 5px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
}

/* 拖拽排序样式 */
.treeTable-drag-placeholder {
    background-color: #f0f9ff;
    border: 1px dashed #1E9FFF;
    height: 36px;
    line-height: 36px;
}

.treeTable-dragging {
    opacity: 0.5;
    background-color: #f2f2f2;
}

/* 响应式 */
@media screen and (max-width: 768px) {
    .treeTable-tool .layui-input {
        width: 150px;
    }
    
    .treeTable-icon {
        width: 14px;
        height: 14px;
        line-height: 14px;
    }
}
