@use "common/var" as *;

.m-editor-tree {
  $node-height: 22px;
  color: $font-color;
  font-size: 13px;

  .m-editor-tree-node {
    cursor: pointer;
    white-space: nowrap;

    .tree-node {
      display: flex;
      align-items: center;

      &:hover {
        background-color: $hover-color;
        color: $font-color;
      }

      &.selected {
        background-color: $theme-color;
        color: $hover-color;
      }

      &.drag-inner {
        .tree-node-content {
          background-color: rgba($color: $theme-color, $alpha: 0.5);
          color: $hover-color;
        }
      }

      &.drag-before {
        .tree-node-content {
          border-top-color: rgba($color: $theme-color, $alpha: 0.5);
        }
      }

      &.drag-after {
        .tree-node-content {
          border-bottom-color: rgba($color: $theme-color, $alpha: 0.5);
        }
      }

      .expand-icon {
        padding: 4px;
        box-sizing: content-box;
        font-size: 14px;
      }

      .tree-node-content {
        display: flex;
        flex: 1;
        justify-content: space-between;
        height: $node-height;
        border-top: 2px solid transparent;
        border-bottom: 2px solid transparent;
        .tree-node-label {
          line-height: $node-height;
          flex: 1;
          width: 100px;
          overflow: hidden;
          text-overflow: ellipsis;

          .disabled {
            cursor: default;
          }

          .hook {
            color: #999;
          }
        }
      }

      .tree-node-tool {
        display: flex;
        align-items: center;

        .tmagic-design-icon {
          margin-right: 10px;
        }
      }
    }
  }

  .m-editor-tree-empty {
    text-align: center;
    color: #909399;
    font-size: 14px;
  }
}
