@import '../../variables.scss';

#{$biz-css-prefix}-steps {
  box-sizing: border-box;

  &.horizontal {
    display: flex;
    //padding: 28px 14px 20px;
    .step-item {
      flex: 1;
      box-sizing: border-box;
      text-align: center;

      &:last-child {
        flex: none;
        margin-top: 2px;
      }

      .tail {
        position: relative;
        top: 5px;
        left: 62px;
        height: 2px;
        background: #BFBFBF;
        width: calc(100% - 8px);
      }

      .finish-tail {
        @extend .tail;
        background-color: #0046C7;
      }

      .finish-point {
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 8px;
        height: 8px;
        margin-left: 54px;
        border-radius: 12px;
        border: 2px solid #0046C7;
        background-color: #0046C7;
      }

      .current-point {
        @extend .finish-point;
      }

      .waiting-point {
        @extend .finish-point;
        border: 2px solid #BFBFBF;
        background-color: #BFBFBF;
      }

      .fail-point {
        @extend .finish-point;
        border: 2px solid #DB1D49;
        background-color: #DB1D49;
      }
    }

    .step-title-finish {
      word-break: break-word;
    }

    .step-desc-finish {
      word-break: break-word;
    }
  }

  &.vertical {
    display: block;
    padding: 20px 33px;

    .step-item {
      position: relative;
      .tail {
        display: flex;
        position: absolute;
        top: 16px;
        left: 3px;
        height: 33px;
        background: #BFBFBF;
        width: 1px;
      }

      .finish-tail {
        @extend .tail;
        background-color: #0046C7;
      }

      .finish-point {
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 8px;
        height: 8px;
        border-radius: 12px;
        border: 2px solid #0046C7;
        background-color: #0046C7;
        float: left;
        margin: 8px 10px 0 0;
      }

      .current-point {
        @extend .finish-point;
      }

      .waiting-point {
        @extend .finish-point;
        border: 2px solid #BFBFBF;
        background-color: #BFBFBF;
      }

      .fail-point {
        @extend .finish-point;
        border: 2px solid #DB1D49;
        background-color: #DB1D49;
      }

      &.num {
        overflow: visible;
        &:not(:last-child) {
          .step-title {
            &::after {
              display: none;
            }
          }
        }
        .finish-tail {
          display: block!important;
        }
        .finish-point, .waiting-point {
          margin: 0!important;
        }
        .step-desc-waiting, .step-desc-current, .step-desc-finish {
          margin-left: 0;
        }
        .tail {
          display: block;
          position: absolute;
          top: 31px;
          left: 10px;
          height: 20px;
        }
      }
    }

    .step-title-finish {
      margin: 0;
      width: 100%;
    }

    .step-desc-finish {
      margin-left: 19px;
      width: 100%;
    }
  }

  .step-item {
    &.num {
      padding: 5px 0;
      text-align: initial;
      overflow: hidden;
      .finish-point {
        display: inline-block;
        width: 20px;
        height: 20px;
        vertical-align: top;
        color: #1677ff;
        background-color: #fff;
        margin-left: 10px;
        justify-content: center;
        align-items: center;
        text-align: center;
      }
      .point-num {
        position: relative;
        top: -3px;
      }
      .finish-point .current-point {
        .point-num {
          color: #0046C7;
        }
      }
      .waiting-point {
        .point-num {
          color: #BFBFBF;
        }
      }
      .fail-point {
        .point-num {
          color: #DB1D49;
        }
      }
      .step-con {
        display: inline-block;
        padding: 0 5px;
      }

      .step-title {
        position: relative;
        margin: 0;
        padding: 0 10px 0 0;
        width: auto;
        //color: #1F1F1F;
      }

      &:not(:last-child) {
        .step-title {
          &::after {
            position: absolute;
            top: 10px;
            inset-inline-start: 100%;
            display: block;
            width: 9999px;
            height: 1px;
            background: #1677ff;
            content: "";
          }
        }
        .step-title-waiting, .step-title-current, .step-title-fail {
          &::after {
            background: #BFBFBF;
          }
        }
      }

      .icon-times {
        color: #DB1D49;
        font-size: 12px;
      }

      .icon-angle-down {
        color: #0046C7;
        font-size: 12px;
      }

      .step-desc-finish {
        width: auto;
        padding-left: 1px;
      }

      .tail {
        display: none;
      }

    }
  }

  .step-title-finish {
    font-size: 14px;
    font-weight: 400;
    color: #1F1F1F;
    width: 116px;
    margin: 10px 0 4px;
  }

  .step-title-current {
    @extend .step-title-finish;
    color: #0046C7;
  }

  .step-title-waiting {
    @extend .step-title-finish;
    color: #BFBFBF;
  }

  .step-title-fail {
    @extend .step-title-finish;
    color: #DB1D49;
  }

  .step-desc-finish {
    width: 116px;
    font-size: 12px;
    font-weight: 400;
    color: #8C8C8C;
  }

  .step-desc-current {
    @extend .step-desc-finish;
    color: #8C8C8C;
  }

  .step-desc-waiting {
    @extend .step-desc-finish;
    color: #BFBFBF;
  }
}
