@treePrefixCls: ~"co-tree";
@treeNodePrefixCls: ~"@{treePrefixCls}-treenode";

.@{treePrefixCls} {
  margin: 0;
  border: 1px solid transparent;

  &-focused:not(&-active-focused) {
    border-color: cyan;
  }

  // padding: 5px;
  .@{treeNodePrefixCls} {
    margin: 0;
    padding: 0;
    line-height: 20px;
    white-space: nowrap;
    list-style: none;
    outline: 0;
    .draggable {
      color: #333;
      -moz-user-select: none;
      -khtml-user-select: none;
      -webkit-user-select: none;
      user-select: none;
      /* Required to make elements draggable in old WebKit */
      -khtml-user-drag: element;
      -webkit-user-drag: element;
    }
    &.drag-over {
      > .draggable {
        color: white;
        background-color: #316ac5;
        border: 1px #316ac5 solid;
        opacity: 0.8;
      }
    }
    &.drag-over-gap-top {
      > .draggable {
        border-top: 2px blue solid;
      }
    }
    &.drag-over-gap-bottom {
      > .draggable {
        border-bottom: 2px blue solid;
      }
    }
    &.filter-node {
      > .@{treePrefixCls}-node-content-wrapper {
        color: #a60000 !important;
        font-weight: bold !important;
      }
    }
    ul {
      margin: 0;
      padding: 0 0 0 18px;
    }
    .@{treePrefixCls}-node-content-wrapper {
      display: inline-block;
      height: 17px;
      margin: 0;
      padding: 1px 3px 0 0;
      text-decoration: none;
      vertical-align: top;
      cursor: pointer;
    }
    span {
      &.@{treePrefixCls}-switcher,
      &.@{treePrefixCls}-iconEle {
        display: inline-block;
        width: 16px;
        height: 16px;
        margin-right: 2px;
        line-height: 16px;
        vertical-align: middle;
        background-color: transparent;
        background-image: url("./icon.png");
        background-repeat: no-repeat;
        background-attachment: scroll;
        border: 0 none;
        outline: none;
        cursor: pointer;

        &.@{treePrefixCls}-icon__customize {
          background-image: none;
        }
      }
      &.@{treePrefixCls}-icon_loading {
        margin-right: 2px;
        vertical-align: top;
        background: url("./loading.gif") no-repeat scroll 0 0 transparent;
      }
      &.@{treePrefixCls}-switcher {
        &.@{treePrefixCls}-switcher-noop {
          cursor: auto;
        }
        &.@{treePrefixCls}-switcher_open {
          background-position: -93px -56px;
        }
        &.@{treePrefixCls}-switcher_close {
          background-position: -75px -56px;
        }
      }
      &.@{treePrefixCls}-checkbox {
        width: 13px;
        height: 13px;
        margin: 0 3px;
        background-position: 0 0;
        &-indeterminate {
          background-position: -14px -28px;
        }
        &-disabled {
          background-position: 0 -56px;
        }
      }
    }
  }
  &:not(.@{treePrefixCls}-show-line) {
    .@{treeNodePrefixCls} {
      .@{treePrefixCls}-switcher-noop {
        background: none;
      }
    }
  }
  &.@{treePrefixCls}-show-line {
    .@{treeNodePrefixCls}:not(:last-child) {
      > ul {
        background: url("./line.gif") 0 0 repeat-y;
      }
      > .@{treePrefixCls}-switcher-noop {
        background-position: -56px -18px;
      }
    }
    .@{treeNodePrefixCls}:last-child {
      > .@{treePrefixCls}-switcher-noop {
        background-position: -56px -36px;
      }
    }
  }
  &-child-tree {
    display: none;
    &-open {
      display: block;
    }
  }
  &-treenode-disabled {
    > span:not(.@{treePrefixCls}-switcher),
    > a,
    > a span {
      color: #767676;
      cursor: not-allowed;
    }
  }
  &-treenode-active {
    background: rgba(0, 0, 0, 0.1);
  }
  &-treenode-selected {
    background-color: #ffe6b0;
    border: 1px #ffb951 solid;
    opacity: 0.8;
  }
  &-icon__open {
    margin-right: 2px;
    vertical-align: top;
    background-position: -110px -16px;
  }
  &-icon__close {
    margin-right: 2px;
    vertical-align: top;
    background-position: -110px 0;
  }
  &-icon__docu {
    margin-right: 2px;
    vertical-align: top;
    background-position: -110px -32px;
  }
  &-icon__customize {
    margin-right: 2px;
    vertical-align: top;
  }
  &-indent-unit {
    display: inline-block;
    padding-left: 18px;
  }
}
