// steps
.yc-steps {
  display: flex;
}
// vertical
.yc-steps-vertical {
  flex-direction: column;
}
//changeable
.yc-steps-changeable {
  .yc-steps-item {
    &:not(.yc-steps-item-process) {
      cursor: pointer;
      &:hover {
        .yc-steps-item-content {
          .yc-steps-item-title,
          .yc-steps-item-description {
            color: rgb(var(--primary-6));
          }
        }
      }
    }
  }
}
// mode
.yc-steps-mode-default,
.yc-steps-mode-navigation {
  .yc-steps-item {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-align: left;
    margin-right: 12px;

    .yc-steps-item-node {
      .yc-steps-icon {
        width: 28px;
        height: 28px;
        border-radius: var(--border-radius-circle);
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .yc-steps-item-content {
      .yc-steps-item-title {
        position: relative;
        padding-right: 12px;
        width: fit-content;
        white-space: nowrap;
      }
      .yc-steps-item-description {
        max-width: 140px;
        margin-top: 2px;
        white-space: normal;
      }
    }
  }
  .yc-steps-item-horizontal {
    display: flex;
    gap: 12px;
    &:not(:last-child) {
      flex: 1;
    }
    &:not(.yc-steps-item-line-less):not(.yc-steps-item-label-vertical) {
      .yc-steps-item-title {
        &::after {
          content: '';
          display: block;
          position: absolute;
          top: 13.5px;
          left: 100%;
          width: 5000px;
          height: 1px;
        }
      }
    }
    .yc-steps-item-content {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
  }
  .yc-steps-item-vertical {
    display: flex;
    gap: 12px;
    &:not(.yc-steps-item-line-less) {
      .yc-steps-item-tail {
        top: 0;
        left: 13.5px;
        bottom: 0;
        width: 1px;
        padding: 34px 0 6px;

        &::after {
          content: '';
          display: block;
          height: 100%;
          width: 100%;
        }
      }
    }
    .yc-steps-item-content {
      min-height: 90px;
    }
  }
  // label
  .yc-steps-item-label-vertical {
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    &:not(.yc-steps-item-line-less) {
      .yc-steps-item-tail {
        position: absolute;
        top: 13.5px;
        left: 96px;
        padding-right: 40px;
        width: 100%;
        height: 1px;
        &::after {
          content: '';
          display: block;
          width: 100%;
          height: 1px;
        }
      }
    }
    .yc-steps-item-node {
      margin-left: 56px;
      .yc-steps-icon {
        width: 28px;
        height: 28px;
        border-radius: var(--border-radius-circle);
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .yc-steps-item-content {
      width: 140px;
      text-align: center;
      .yc-steps-item-title {
        padding-right: 0;
        width: 100%;
      }
    }
  }
  //size
  .yc-steps-item-size-small {
    .yc-steps-item-node {
      font-size: 14px;
      .yc-steps-icon {
        width: 24px;
        height: 24px;
      }
    }
    .yc-steps-item-content {
      .yc-steps-item-title {
        font-size: 14px;
        line-height: 24px;
      }
    }
    &:not(.yc-steps-item-line-less) {
      &:not(.yc-steps-item-label-vertical) {
        .yc-steps-item-title {
          &::after {
            top: 11.5px;
          }
        }
      }
      &.yc-steps-item-vertical {
        .yc-steps-item-tail {
          top: 0;
          left: 11.5px;
          padding: 30px 0 6px;
        }
      }
      &.yc-steps-item-label-vertical {
        .yc-steps-item-tail {
          top: 11.5px;
          left: 94px;
          padding-right: 36px;
        }
      }
    }
  }
  // status
  @steps-status: {
    wait: .set-steps-item-status(
      var(--color-text-2),
      var(--color-fill-2),
      var(--color-text-2)
    );
    process: .set-steps-item-status(var(--color-white), rgb(var(--primary-6)));
    finish: .set-steps-item-status(
      rgb(var(--primary-6)),
      rgb(var(--primary-1))
    );
    error: .set-steps-item-status(var(--color-white), rgb(var(--danger-6)));
  };
  each(@steps-status, {
    .yc-steps-item-@{key} {
      @value();
    }
  });
  .set-steps-item-status(@icon-color, @icon-bg-color, @title-color: null) {
    .yc-steps-icon {
      color: @icon-color;
      background-color: @icon-bg-color;
    }
    & when not (@title-color = null) {
      .yc-steps-item-content {
        .yc-steps-item-title {
          color: @title-color;
        }
      }
    }
  }
}
.yc-steps-mode-dot {
  .yc-steps-item {
    position: relative;
    &.yc-steps-item-horizontal {
      &:not(:last-child) {
        margin-right: 16px;
      }
      .yc-steps-item-tail {
        left: 78px;
        width: 100%;
        height: 1px;
      }
      .yc-steps-item-node {
        margin-left: 67px;
      }
      &.yc-steps-item-process {
        .yc-steps-item-node {
          margin-top: -1px;
          margin-left: 65px;
        }
      }
    }
    &.yc-steps-item-vertical {
      &:not(:last-child) {
        margin-bottom: 4px;
      }
      .yc-steps-item-tail {
        bottom: 0;
        left: 4px;
        transform: translateX(-50%);
        width: 1px;
        height: 100%;
        padding: 16px 0 2px 0;
      }
      .yc-steps-item-node {
        margin-top: 8px;
      }
      &.yc-steps-item-process {
        .yc-steps-item-node {
          margin-top: 6px;
          margin-left: -1px;
        }
      }
    }
    &.yc-steps-item-process {
      .yc-steps-item-node {
        width: 10px;
        height: 10px;
      }
    }
    &:not(.yc-steps-item-line-less) {
      .yc-steps-item-tail {
        &::after {
          content: '';
          height: 100%;
          width: 100%;
          display: block;
        }
      }
    }
    .yc-steps-item-tail {
      position: absolute;
      top: 3.5px;
      background-color: transparent;
    }
    .yc-steps-item-node {
      width: 8px;
      height: 8px;
      border-radius: var(--border-radius-circle);
    }
  }
  // vertical
  .yc-steps-item-horizontal {
    display: flex;
    flex-direction: column;
    gap: 4px;

    &:not(:last-child) {
      flex: 1;
    }
    .yc-steps-item-content {
      width: 140px;
      text-align: center;
      gap: 4px;
    }
  }
  .yc-steps-item-vertical {
    min-height: 90px;
    display: flex;
    gap: 16px;

    .yc-steps-item-content {
      gap: 4px;
      .yc-steps-item-title {
        margin-top: -2px;
      }
    }
  }
  //status
  @step-status: {
    wait: var(--color-neutral-4);
    process: rgb(var(--primary-6));
    finish: rgb(var(--primary-6));
    error: rgb(var(--danger-6));
  };
  each(@step-status, {
    .yc-steps-item-@{key} {
      .yc-steps-item-node {
        background-color: @value;
        border-color: @value;

        & when (@key = process) {
          width: 10px;
          height: 10px;
        }
      }
    }
  });
}
.yc-steps-mode-arrow {
  gap: 4px;
  .yc-steps-item {
    flex: 1;
    position: relative;
    overflow: visible;
    height: 72px;

    &:not(:first-child)::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      z-index: 1;
      width: 0;
      height: 0;
      border-top: 36px solid transparent;
      border-bottom: 36px solid transparent;
      border-left: 36px solid var(--color-bg-1);
    }
    &:not(:last-child)::after {
      content: '';
      position: absolute;
      top: 0;
      right: -36px;
      z-index: 2;
      width: 0;
      height: 0;
      background-color: transparent;
      border-top: 36px solid transparent;
      border-bottom: 36px solid transparent;
    }
    &:first-child {
      .yc-steps-item-content {
        padding-left: 16px;
      }
    }
    .yc-steps-item-content {
      flex: 1;
      padding-left: 52px;
      height: 72px;
      justify-content: center;
    }
  }
  // small
  &.yc-steps-item-size-small {
    height: 40px;
    &:not(:first-child)::before {
      border-top: 20px solid transparent;
      border-bottom: 20px solid transparent;
      border-left: 20px solid var(--color-bg-1);
    }
    &:not(:last-child)::after {
      right: -20px;
      border-top: 20px solid transparent;
      border-bottom: 20px solid transparent;
    }
    .yc-steps-item-content {
      height: 40px;
      .yc-steps-item-description {
        display: none;
      }
    }
  }
  @step-status: {
    wait: .set-steps-item-status(var(--color-fill-1));
    process: .set-steps-item-status(rgb(var(--primary-6)), var(--color-white));
    finish: .set-steps-item-status(rgb(var(--primary-1)));
    error: .set-steps-item-status(rgb(var(--danger-6)), var(--color-white));
  };
  each(@step-status, {
    .yc-steps-item-@{key} {
      @value();
    }
  });
  .set-steps-item-status(@bg-color, @text-color: null) {
    background-color: @bg-color;
    &::after {
      border-left: 36px solid @bg-color;
    }
    & when not (@text-color = null) {
      .yc-steps-item-content {
        .yc-steps-item-title,
        .yc-steps-item-description {
          color: @text-color;
        }
      }
    }
  }
}
.yc-steps-mode-navigation {
  gap: 32px;
  .yc-steps-item {
    flex: 1;
    overflow: hidden;
    padding: 0 10px 0 20px;
    &:not(:last-child)::before {
      content: '';
      position: absolute;
      top: 10px;
      right: 0;
      width: 6px;
      height: 6px;
      border: 2px solid var(--color-border-3);
      border-bottom: none;
      border-left: none;
      background-color: var(--color-bg-1);
      transform: rotate(45deg);
    }
    .yc-steps-item-content {
      margin-bottom: 20px;
      .yc-steps-item-description {
        max-width: unset;
        white-space: nowrap;
      }
    }
  }
}
// steps-item
.yc-steps-item {
  .yc-steps-item-tail {
    position: absolute;
  }
  .yc-steps-item-node {
    font-weight: 500;
    font-size: 16px;
    .yc-steps-icon {
      width: 28px;
      height: 28px;
      border-radius: var(--border-radius-circle);
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
  .yc-steps-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    .yc-steps-item-title {
      line-height: 28px;
      font-size: 16px;
      color: var(--color-text-1);
      transition: all 0.1s cubic-bezier(0, 0, 1, 1);
    }
    .yc-steps-item-description {
      max-width: 140px;
      font-size: 12px;
      color: var(--color-text-3);
      transition: all 0.1s cubic-bezier(0, 0, 1, 1);
    }
  }
}
// active
.yc-steps-item-active {
  &::after {
    content: '';
    position: absolute;
    display: block;
    height: 2px;
    right: 30px;
    left: 0;
    bottom: 0;
  }
  @stauts: {
    finish: var(--color-primary-light-1);
    wait: var(--color-fill-2);
    error: rgb(var(--danger-6));
    process: rgb(var(--primary-6));
  };
  each(@stauts,{
    &.yc-steps-item-@{key}{
      &::after {
        background-color: @value;
      }
    }
  });
}
// next-status
@next-status: {
  wait: var(--color-border-2);
  process: rgb(var(--primary-6));
  finish: rgb(var(--primary-6));
  error: rgb(var(--danger-6));
};
each(@next-status, {
  .yc-steps-item-next-@{key} {
    &,
    .yc-steps-item-title,
    .yc-steps-item-tail {
      &::after {
        background-color: @value;
      }
    }
  }
});
