@color: #333;

.sim-tree {
    list-style: none;
    font-size: 14px;
    color: @color;
    padding: 5px;

    ul,
    li {
        margin: 0;
        padding: 0;
    }

    li {
        font-size: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;

        ul {
            flex: 1;
            flex-basis: 100%;
            width: 100%;
            display: none;
            margin-left: 15px;
        }
    }

    ul.show, li.show {
        display: block;
    }

    ul.none, li.none {
        display: none;
    }

    li.disabled {
        > a {
            color: #aaa;
            cursor: not-allowed;

            .sim-tree-checkbox {
                border-color: #eee;
            }
        }
    }

    a {
        flex: 1;
        font-size: 14px;
        color: @color;
        text-decoration: none;
        vertical-align: top;
        line-height: 26px;
        position: relative;
        padding-left: 20px;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        height: 26px;
    }

    .sim-tree-spread {
        width: 20px;
        padding-left: 5px;
        box-sizing: border-box;

        &.sim-hidden {
            visibility: hidden;
        }
    }

    .sim-tree-spread, a {
        cursor: pointer;
    }

    .sim-tree-spread {
        height: 26px;
    }

    .sim-loading {
        background: url('data:image/gif;base64,R0lGODlhEAAQAMQQAObm5uLi4unp6dHR0cnJydfX1+jo6O/v7/Dw8NPT0/39/crKyvr6+uDg4MfHx////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAAQACwAAAAAEAAQAAAFXeAjPkiTjGgaLI6Tvs9BtPAIMPH8KgK5DDhZSlFYlFrAGIrYMrUcyRGzdapZr6jE02FAyZ6JxrOrEAVnjgaCRS6IkjLjo9F2PaDBwLJAu+NfAix2LQsAMCVVYQgoIQAh+QQFAAAQACwJAAAABwAHAAAFFGDSIE/5OM7SmKhjsK55vjIt32UIACH5BAUAABAALAoAAwAGAAoAAAUaICQqgggpxYKcheM0qOskZm0/eA7luMibvRAAIfkEBQAAEAAsCQAJAAcABwAABRXgcxBOmTwi6TRouiAoIwbtI9d4/oQAIfkEBQAAEAAsAwAKAAoABgAABRsgJI7MKD6POJQnKjpD60IODKFzvQD3nDQISAgAIfkEBQAAEAAsAAAJAAcABwAABRPgI45kSSrFWTgj6rCisLwk0iQhACH5BAUAABAALAAAAwAHAAoAAAUcIPRAJPmco4mm61m+cJk4tGNATX0ryGK/jVspBAAh+QQFAAAQACwAAAAABwAHAAAFFOAjjmRpPgBDIsugio3juGIiz2oIADs=') center center no-repeat;

        &.sim-icon-d:before,
        &.sim-icon-r:before {
            display: none;
        }
    }

    .sim-icon-d:before,
    .sim-icon-r:before {
        content: '';
        display: inline-block;
        width: 0;
        height: 0;
        border: 6px solid transparent;
        vertical-align: top;
        position: relative;
    }

    .sim-icon-r:before {
        border-left-width: 8px;
        border-left-color: @color;
        top: ((26px - 6 * 2px) / 2);
    }

    .sim-icon-d:before {
        margin-left: -4px;
        border-top-color: @color;
        top: ((26px - 6 * 2px) / 2 + 6px / 2);
    }

    .sim-tree-checkbox {
        display: inline-block;
        border: 1px solid #ccc;
        height: 16px;
        width: 16px;
        border-radius: 3px;
        box-sizing: border-box;
        text-align: center;
        line-height: 16px;
        background: #fff;
        color: #fff;
        vertical-align: middle;
        position: absolute;
        left: 0;
        top: 4px;

        &.sim-hide {
            display: none;
        }

        &.sim-tree-semi, &.checked {
            border-color: #2b85e4;
            background-color: #2b85e4;
        }

        &.sim-tree-semi {
            position: relative;

            &:after {
                content: '';
                display: block;
                position: absolute;
                width: 8px;
                height: 2px;
                background: #fff;
                top: 6px;
                left: 3px;
            }
        }

        &.checked {
            background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAPFBMVEUAAAD///////////////////////////////////////////////////////////////////////8AAADY904BAAAAE3RSTlMAOiE8877cHQkXr9cZQvUc20NAbrhSVAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAA7SURBVAjXY2DADhiZEGxmFlYkNhs7KpuDE0mci5sHoYaXj5sHyOaHqOblE4CzGRgE+RBsBgYhfmxuAABcBQF5T7U3IwAAAABJRU5ErkJggg==');
            background-repeat: no-repeat;
            background-position: center center;
        }
    }
}
