@root-entry-name: 'default';
@import (reference) '~antd/es/style/themes/index.less';

.border-radius(@start-end: 0, @end-end: 0, @start-start: 0, @end-start: 0) {
  border-start-end-radius: @start-end;
  border-end-end-radius: @end-end;
  border-start-start-radius: @start-start;
  border-end-start-radius: @end-start;
}

.start-radius() {
  border-start-start-radius: var(--zaui-border-radius, 4px);
  border-end-start-radius: var(--zaui-border-radius, 4px);
}

.end-radius() {
  border-start-end-radius: var(--zaui-border-radius, 4px);
  border-end-end-radius: var(--zaui-border-radius, 4px);
}

.pro-group {
  width: unset !important;

  &.pro-group-diy-width {
    .@{ant-prefix}-space .@{ant-prefix}-space-item {
      width: auto;

      .@{ant-prefix}-space-item {
        width: auto;
      }
    }
  }

  .@{ant-prefix}-space {
    width: 100%;

    .@{ant-prefix}-space-item {
      width: 100%;
    }

    .@{ant-prefix}-form-item {
      margin-bottom: 0 !important;
    }
  }

  .@{ant-prefix}-form-item-label {
    display: none;
  }

  .@{ant-prefix}-space-compact {
    flex: auto;
    align-items: center;
    width: 100%;

    &>.@{ant-prefix}-input-number{
      &:first-child{
        border-end-end-radius: 0;
        border-start-end-radius: 0;
      }
      &:last-child{
        border-start-start-radius: 0;
        border-end-start-radius: 0;
        margin-left: -1px;
      }
    }

    .@{ant-prefix}-form-item {
      margin-bottom: 0 !important;
    }

    .group-separator {
      margin-inline-end: -2px;
      margin-inline-start: -1px;
      border-start-start-radius: 0;
      border-end-start-radius: 0;
    }
    .pro-modal-select {
      margin-left: -1px;
      .@{ant-prefix}-input{
        border-start-start-radius: 0;
        border-end-start-radius: 0;
      }
    }

    // 定制内敛合并样式
    .@{ant-prefix}-input-affix-wrapper,
    .@{ant-prefix}-select {
      .border-radius(0, 0, 0, 0);

      &:nth-child(n + 2) {
        margin-inline-start: -1px;
      }

      &:first-child {
        .start-radius();
      }

      &:last-child {
        .end-radius();
      }
    }

    .@{ant-prefix}-select {
      .@{ant-prefix}-select-selector {
        .border-radius(0, 0, 0, 0);
      }

      &:first-child {
        .@{ant-prefix}-select-selector {
          .start-radius();
        }
      }

      &:last-child {
        .@{ant-prefix}-select-selector {
          .end-radius();
        }
      }
    }

    // 报错样式定制
    .@{ant-prefix}-input-affix-wrapper-status-error ~ .group-separator {
      color: var(--ant-error-color);
      border-color: var(--ant-error-color);
    }
  }
}
