.#{$ns}Selection {
  >.#{$ns}Checkbox {
    display: block;
    // height: var(--Form-input-height);
    line-height: var(--Form-input-lineHeight);
    font-size: var(--Form-input-fontSize);
    padding: calc((var(--Form-input-height) - var(--Form-input-lineHeight) * var(--Form-input-fontSize)) / 2) var(--gap-sm) calc((var(--Form-input-height) - var(--Form-input-lineHeight) * var(--Form-input-fontSize)) / 2) calc(var(--gap-sm) + var(--Checkbox-size));
  }

  &--inline>.#{$ns}Checkbox {
    display: inline-block;
  }

  &-addBtn {
    display: block;
    cursor: pointer;

    &:hover {
      text-decoration: none;
    }

    >svg {
      width: px2rem(14px);
      height: px2rem(14px);
      margin-right: var(--Checkbox-gap);
    }
  }
}

.#{$ns}GroupedSelection {
  max-height: px2rem(300px);
  overflow-y: auto;
  overflow-x: hidden;
  user-select: none;

  &-group:not(:first-child)>&-itemLabel {
    border-top: px2rem(1px) solid var(--ListMenu-divider-color);
  }

  &-group>&-itemLabel {
    font-size: var(--fontSizeSm);
    padding: var(--gap-xs) var(--gap-xs);
    color: var(--text--muted-color);
  }

  &-item {
    display: flex;
    // height: var(--Form-input-height);
    line-height: var(--Form-input-lineHeight);
    font-size: var(--Form-input-fontSize);
    padding: calc((var(--Form-input-height) - var(--Form-input-lineHeight) * var(--Form-input-fontSize)) / 2) var(--gap-sm);
    flex-direction: row;

    >.#{$ns}Checkbox {
      margin-right: 0;
    }

    cursor: pointer;
    user-select: none;

    &.is-active {
      color: var(--Form-select-menu-onActive-color);
      background: var(--Form-select-menu-onActive-bg);
    }

    &:hover {
      background: var(--Tree-item-onHover-bg);
      color: var(--Form-select-menu-onActive-color);
    }

    &.is-disabled {
      pointer-events: none;
      color: var(--text--muted-color);
    }
  }

  &-group>&-items>&-item {
    padding-left: var(--gap-base);
  }

  &-itemLabel {
    flex-grow: 1;

    span {
      white-space: nowrap; // 避免在条件组合中折行
      max-width: 100%;
      overflow: hidden;
      display: block;
      text-overflow: ellipsis;
    }
  }

  &-placeholder {
    @include checkboxes-placeholder();
  }
}

.#{$ns}TableSelection {
  .#{$ns}Table-content {
    border-top: var(--Table-borderWidth) solid var(--Table-borderColor);
  }

  .#{$ns}Table-table>thead>tr>th,
  .#{$ns}Table-table>tbody>tr>td {
    font-size: var(--fontSizeSm);
    padding-top: var(--gap-xs);
    padding-bottom: px2rem(6px);
    vertical-align: middle;
  }

  .#{$ns}Table-table>thead>tr>th {
    padding-top: px2rem(6px);
  }

  .#{$ns}Table-table>thead>tr>th:first-child,
  .#{$ns}Table-table>tbody>tr>td:first-child {
    padding-left: px2rem(10px);
    padding-right: px2rem(10px);
  }

  .#{$ns}Table-table>thead>tr>th:last-child,
  .#{$ns}Table-table>tbody>tr>td:last-child {
    padding-right: var(--gap-md);
  }

  .#{$ns}Table-table>tbody>tr {
    cursor: pointer;
  }

  .#{$ns}Table-table>tbody>tr.is-active {
    color: var(--Form-select-menu-onActive-color);
    background: var(--Form-select-menu-onActive-bg);
  }
}

.#{$ns}TreeSelection {
  .#{$ns}Table-expandBtn {
    color: var(--icon-color);
    margin-right: 5px;
  }

  &-sublist {
    position: relative;
    margin: 0 0 0 px2rem(35px);
    display: none;

    &:before {
      width: 1px;
      content: '';
      display: block;
      position: absolute;
      top: calc(var(--gap-xs) * -1);
      bottom: calc(var(--Form-input-height) / 2);
      left: -19px;
      border-left: dashed 1px var(--icon-color);
    }
  }

  &-item {
    position: relative;
  }

  &-item.is-expanded>&-sublist {
    display: block;
  }

  &-item:not(:last-child)>&-sublist:before {
    bottom: 0;
  }

  &-sublist &-item:before {
    height: 1px;
    content: '';
    display: block;
    position: absolute;
    top: calc(var(--Form-input-height) / 2);
    width: 19px;
    left: -19px;
    border-top: dashed 1px var(--icon-color);
  }

  &-itemInner {
    display: flex;
    align-items: center;
    // height: var(--Form-input-height);
    line-height: var(--Form-input-lineHeight);
    font-size: var(--Form-input-fontSize);
    padding: calc((var(--Form-input-height) - var(--Form-input-lineHeight) * var(--Form-input-fontSize)) / 2) var(--gap-sm);
    flex-direction: row;
    white-space: nowrap;
    /*控制单行显示*/
    overflow: hidden;
    /*超出隐藏*/
    text-overflow: ellipsis;

    /*隐藏的字符用省略号表示*/
    @media screen and (min-width:1280px) and (max-width:1440px) {
      font-size: 0.75rem;
    }

    >.#{$ns}Checkbox {
      margin-right: 0;
      margin-left: var(--gap-sm);
    }

    cursor: pointer;
    user-select: none;

    position: relative;

    &>* {
      position: relative;
      z-index: 2;
    }

    &:hover:after {
      position: absolute;
      content: '';
      z-index: 1;
      top: 0;
      right: 0;
      bottom: 0;
      left: -99999px;
      background: var(--Tree-item-onHover-bg);
    }

    &.is-active {
      color: var(--Form-select-menu-onActive-color);
    }

    &.is-disabled {
      pointer-events: none;
      color: var(--text--muted-color);
    }
  }

  &-itemLabel {
    flex-grow: 1;
  }

  &-placeholder {
    @include checkboxes-placeholder();
  }
}

.#{$ns}ChainedSelection {
  display: flex;
  flex-direction: row;
  // min-height: 100%;

  &-col {
    flex-grow: 1;
    min-width: 150px;
    overflow: auto;
  }

  &-col:not(:last-child) {
    border-right: 1px solid var(--borderColor);
  }

  &-subTitle {
    font-size: var(--fontSizeSm);
    padding: var(--gap-xs) var(--gap-xs);
    color: var(--text--muted-color);
  }

  &-item {
    display: flex;
    // height: var(--Form-input-height);
    line-height: var(--Form-input-lineHeight);
    font-size: var(--Form-input-fontSize);
    padding: calc((var(--Form-input-height) - var(--Form-input-lineHeight) * var(--Form-input-fontSize)) / 2) var(--gap-sm);
    flex-direction: row;

    >.#{$ns}Checkbox {
      margin-right: 0;
    }

    cursor: pointer;
    user-select: none;

    &.is-active {
      color: var(--Form-select-menu-onActive-color);
      background: var(--Form-select-menu-onActive-bg);
    }

    &:hover {
      background: var(--Tree-item-onHover-bg);
    }

    &.is-disabled {
      pointer-events: none;
      color: var(--text--muted-color);
    }
  }

  &-itemLabel {
    flex-grow: 1;
  }

  &-placeholder {
    @include checkboxes-placeholder();
  }
}

.#{$ns}AssociatedSelection {
  display: flex;
  flex-direction: row;

  &-left,
  &-right {
    flex-grow: 1;
    width: 0;
    min-height: px2rem(200px);
    max-height: px2rem(400px);
    overflow: auto;
  }

  &-left {
    border-right: 1px solid var(--borderColor);
  }

  &-reload {
    text-align: center;
    color: var(--info);
    margin: 20px 0 0;

    &.is-clickable {
      cursor: pointer;
    }
  }

  &-box {
    line-height: var(--Form-input-lineHeight);
    font-size: var(--fontSizeSm);
    color: var(--text--muted-color);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;

    >p {
      text-align: center;
      margin: 10px 0 20px;
      color: var(--text--muted-color);
    }
  }
}
