@import "../../less/global-variable.less";
.cess-select {
  display: inline-block;
  position: relative;

  .choose-all {
    position: absolute;
    bottom: 8px;
    right: 8px;
    visibility: hidden;
  }

  .ant-select {
    color: @color-font-normal;
    vertical-align: middle;
  }

  .ant-select:not(.ant-select-disabled):hover .ant-select-selector {
    border-color: @color-primary;
  }

  .ant-select-multiple .ant-select-selector {
    padding: 4px 8px 0 8px;
  }

  .cess-select-all {
    &.ant-select-multiple.ant-select-open .ant-select-selector {
      padding: 4px 64px 0 8px;
    }
    &.ant-select-open + .choose-all {
      visibility: visible;
    }
  }

  .ant-select-multiple .ant-select-selection-item {
    height: @height-large;
    line-height: @height-large;
    margin: 0;
    margin-right: @gap-xxsmall;
    border: none;
    background-color: @color-primary-multi-tag-bg;
    color: @color-primary-multi-tag-color;
    padding: 0 8px 0 4px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
  }

  .ant-select-multiple .ant-select-selection-item-content {
    margin-right: 8px;
  }

  .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
    padding: 4px 8px;
    border-color: @color-border;
  }

  .ant-select-single.ant-select-show-arrow .ant-select-selection-item,
  .ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder {
    padding-right: 12px;
    height: 24px;
    line-height: 24px;
    margin-top: -1px;
  }

  .ant-select-arrow {
    right: 8px;
    height: 24px;
    top: 10px;
    line-height: 24px;

    .cessicon-caret-bottom {
      font-size: @font-size-small;
      transition: transform 0.3s, -webkit-transform 0.3s;
      line-height: 5px;
    }
  }

  .ant-select-open .ant-select-arrow .cessicon-caret-bottom {
    transform: rotate(180deg);
    transform-origin: 50% 45%;
  }

  .ant-select-single.ant-select-open .ant-select-selection-item {
    opacity: 1;
  }

  .ant-select-multiple .ant-select-selection-item-remove {
    font-size: 8px;
    line-height: 1;

    .cessicon-close {
      font-size: 8px;
      color: #a0a5af;
      vertical-align: text-bottom;
    }
  }

  .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
    box-shadow: none;
    border-color: @color-primary;
  }
}

.ant-select-dropdown {
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
  border: solid 1px #e1e3e6;
  background-color: #ffffff;
  padding: 0;

  .ant-select-item {
    font-size: @font-size-normal;
    padding: @gap-xsmall;
    height: @height-xlarge;
    line-height: @height-xlarge;

    .ant-select-item-option-content {
      line-height: @height-normal;
      color: @color-font-normal;
    }

    &.ant-select-item-option-disabled {
      .ant-select-item-option-content {
        color: @color-secondary;
      }
    }

    &.ant-select-item-option-active:not(.ant-select-item-option-disabled),
    &.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
      background-color: @color-background;

      .ant-select-item-option-content {
        color: @color-primary;
        font-weight: @font-weight-normal;
      }
    }
  }

  .ant-select-item-empty {
    padding: @gap-normal;
    color: @color-secondary;
    text-align: center;
  }

  // 多选或tags
  &.ant-select-dropdown-multiple {
    .ant-select-item {
      &.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
        .ant-select-item-option-content {
          color: @color-font-normal;
        }
      }

      &.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
        background: fade(@color-primary, 10%);

        .ant-select-item-option-content {
          color: @color-primary;
        }

        .anticon {
          vertical-align: top;
        }
      }
    }
  }

  // 自定义 dropdown
  .self-dropdown {
    max-height: 256px;
    overflow: auto;
    .anticon-check {
      color: @color-primary;
    }
  }
}
