@charset "UTF-8";
@import "./common/var.css";

@component-namespace el {
  @b tree {
    cursor: default;
    background: var(--color-white);
    border: 1px solid var(--color-base-gray);

    @e empty-block {
      position: relative;
      min-height: 60px;
      text-align: center;
      width: 100%;
      height: 100%;
    }

    @e empty-text {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      color: color(var(--color-primary) s(16%) l(44%));
    }
  }

  @b tree-node {
    white-space: nowrap;

    @e content {
      line-height: 36px;
      height: 36px;
      cursor: pointer;

      & > .el-checkbox,
      & > .el-tree-node__expand-icon {
        margin-right: 8px;
      }
      & > .el-checkbox {
        vertical-align: middle;
      }
      &:hover {
        background: var(--color-light-gray);
      }
    }

    @e expand-icon {
      display: inline-block;
      cursor: pointer;
      width: 0;
      height: 0;
      vertical-align: middle;
      margin-left: 10px;
      border: 6px solid transparent;
      border-right-width: 0;
      border-left-color: var(--color-light-silver);
      border-left-width: 7px;

      transform: rotate(0deg);
      transition: transform 0.3s ease-in-out;

      &:hover {
        border-left-color: #999;
      }

      &.expanded {
        transform: rotate(90deg);
      }

      &.is-leaf {
        border-color: transparent;
        cursor: default;
      }
    }

    @e label {
      font-size: var(--font-size-base);
      vertical-align: middle;
      display: inline-block;
    }

    @e loading-icon {
      display: inline-block;
      vertical-align: middle;
      margin-right: 4px;
      font-size: var(--font-size-base);
      color: var(--color-light-silver);
    }

    & > .el-tree-node__children {
      overflow: hidden;
      background-color: transparent;
    }

    &.is-expanded > .el-tree-node__children {
      display: block;
    }
  }
}

.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
  background-color: color(var(--color-primary) tint(92%));
}
