@osui-steps-class-prefix: osui-steps;

.@{osui-steps-class-prefix} {
    // == 对navigation模式下的调整，去掉了下划线 ==
    &.@{ant-prefix}-steps-navigation .@{ant-prefix}-steps-item-active {
        &::before {
            height: 0;
        }
    }

    &.@{ant-prefix}-steps-navigation .@{ant-prefix}-steps-item {
        &::before {
            transition: none;
        }

        &:last-child::after {
            display: none;
        }

        &::after {
            position: absolute;
            top: 5px;
            display: inline-block;
            width: 14px;
            height: 14px;
            margin-top: 0;
            margin-left: 0;
            vertical-align: middle;
            background-color: var(--theme-icon-color);
            transform: none;
            content: '';
            -webkit-mask: url('./arrow.svg') no-repeat 50% 50%;
            mask: url('./arrow.svg') no-repeat 50% 50%;
            -webkit-mask-size: cover;
            mask-size: cover;
        }
    }
    // == 结束 ==

    // == 对title调整字体行高 ==
    .@{ant-prefix}-steps-item .@{ant-prefix}-steps-item-title {
        font-size: 14px;
        line-height: var(--steps-item-title-height);

        &::after {
            top: 10px;
        }
    }
    // == 结束 ==

    // == 对description调整字体行高 ==
    &.@{ant-prefix}-steps .@{ant-prefix}-steps-item-process,
    &.@{ant-prefix}-steps .@{ant-prefix}-steps-item-finish,
    &.@{ant-prefix}-steps .@{ant-prefix}-steps-item-wait {
        >.@{ant-prefix}-steps-item-container
        >.@{ant-prefix}-steps-item-content
        >.@{ant-prefix}-steps-item-description {
            color: var(--text-color-tertiary);
        }
    }

    .@{ant-prefix}-steps-item .@{ant-prefix}-steps-item-description {
        font-size: 12px;
    }
    // == 结束 ==

    // == 对垂直模式调整竖线位置 ==
    &.@{ant-prefix}-steps-vertical > .@{ant-prefix}-steps-item > .@{ant-prefix}-steps-item-container > .@{ant-prefix}-steps-item-tail {
        left: 14px;
    }
    // == 结束 ==

    // == process 颜色调整 ==
    .@{ant-prefix}-steps-item-process {
        > .@{ant-prefix}-steps-item-container {
            > .@{ant-prefix}-steps-item-icon {
                color: var(--steps-item-active-icon-color);
                background: var(--steps-item-active-icon-bg-color);
                border-color: var(--steps-item-active-icon-bg-color);
            }
        }
    }

    .@{ant-prefix}-steps-item-wait {
        > .@{ant-prefix}-steps-item-container {
            > .@{ant-prefix}-steps-item-icon {
                background-color: var(--component-color-grayB2);
                border-color: var(--component-color-grayB2);

                .@{ant-prefix}-steps-icon {
                    color: var(--text-color-secondary);
                }
            }
            > .@{ant-prefix}-steps-item-content > .@{ant-prefix}-steps-item-title {
                color: var(--text-color-secondary);
            }
        }
    }
    // == 结束 ==

    // == icon内文字行高 ==
    .@{ant-prefix}-steps-item-icon {
        line-height: 26px;
        height: 28px;
        width: 28px;
    }

    // == 调整错误状态以及错误状态内行高 ==
    .@{ant-prefix}-steps-item-error {
        .@{ant-prefix}-steps-item-icon {
            line-height: 28px;
            background-color: #fff;

            .@{ant-prefix}-steps-icon {
                color: var(--error-color);
            }
        }

        // 当前错误状态
        &.@{ant-prefix}-steps-item-active {
            .@{ant-prefix}-steps-item-icon {
                background-color: var(--theme-error-color);

                .@{ant-prefix}-steps-icon {
                    color: var(--theme-component-bg);
                }
            }
        }
    }

    // == 调整已完成状态以及已完成状态内行高 ==
    .@{ant-prefix}-steps-item-finish {
        > .@{ant-prefix}-steps-item-container {
            > .@{ant-prefix}-steps-item-icon {
                line-height: 28px;
                border-color: var(--brand-color-light);
                background-color: var(--brand-color-light);

                .@{ant-prefix}-steps-icon {
                    color: var(--brand-color);
                }
            }
        }
    }

    // ==================== hover ====================
    &.@{ant-prefix}-steps .@{ant-prefix}-steps-item {
        .@{ant-prefix}-steps-item-finish {
            &:hover {
                border-color: var(--gray-color-7);
            }
        }
    }
    // 非active状态下的hover
    &.@{ant-prefix}-steps .@{ant-prefix}-steps-item:not(.@{ant-prefix}-steps-item-active):not(.@{ant-prefix}-steps-item-process) {
        &.@{ant-prefix}-steps-item-finish,
        &.@{ant-prefix}-steps-item-wait {
            > .@{ant-prefix}-steps-item-container[role='button'] {
                &:hover > .@{ant-prefix}-steps-item-icon {
                    background-color: var(--brand-color-1);
                    border-color: var(--brand-color-5);
                }

                &:active > .@{ant-prefix}-steps-item-icon {
                    background-color: var(--brand-color-2);
                    border-color: var(--brand-color-7);
                }
            }
        }

        &.@{ant-prefix}-steps-item-error {
            > .@{ant-prefix}-steps-item-container[role='button'] {
                &:hover {
                    > .@{ant-prefix}-steps-item-icon {
                        background-color: var(--error-color-light-hover);
                        border-color: var(--error-color-hover);

                        .@{ant-prefix}-steps-icon {
                            color: var(--error-color-hover);
                        }
                    }

                    .@{ant-prefix}-steps-item-title,
                    .@{ant-prefix}-steps-item-description {
                        color: var(--error-color-hover);
                    }
                }

                &:active > .@{ant-prefix}-steps-item-icon {
                    background-color: var(--error-color-light);
                    border-color: var(--error-color-active);

                    .@{ant-prefix}-steps-icon {
                        color: var(--error-color-active);
                    }
                }
            }
        }
    }
    // == 结束hover调整 ==

    // == dot状态 ==
    &.@{ant-prefix}-steps.@{ant-prefix}-steps-dot {
        .@{ant-prefix}-steps-item {
            .@{ant-prefix}-steps-item-title,
            .@{ant-prefix}-steps-item-description {
                font-size: 12px;
            }
        }
    }

    &.@{ant-prefix}-steps-dot .@{ant-prefix}-steps-item-tail,
    &.@{ant-prefix}-steps-dot.@{ant-prefix}-steps-small .@{ant-prefix}-steps-item-tail {
        top: 3px;

        &::after {
            height: 1px;
        }
    }

    &.@{ant-prefix}-steps-vertical.@{ant-prefix}-steps-dot .@{ant-prefix}-steps-item > .@{ant-prefix}-steps-item-container > .@{ant-prefix}-steps-item-tail {
        left: -9px;

        &::after {
            margin-inline-start: 12px;
        }
    }
    // == 结束dot状态调整 ==

    &.@{ant-prefix}-steps-label-vertical {
        .@{ant-prefix}-steps-item-content {
            margin-top: 8px;
        }

        .@{ant-prefix}-steps-item-icon {
            margin-inline-start: 42px;
        }

        &.@{ant-prefix}-steps-dot .@{ant-prefix}-steps-item-icon {
            margin-inline-start: 67px;
        }
    }
}

// ==================== Compact 模式 ====================
.@{osui-steps-class-prefix}-compact {
    &.@{ant-prefix}-steps.@{ant-prefix}-steps-horizontal.osui-steps {
        display: block;
    }

    &.@{ant-prefix}-steps-navigation .@{ant-prefix}-steps-item-container {
        margin-right: 10px;
        margin-left: 10px;
    }

    .@{ant-prefix}-steps-horizontal:not(.@{ant-prefix}-steps-label-vertical) .@{ant-prefix}-steps-item {
        padding-left: 10px;

        &:first-child {
            .@{ant-prefix}-steps-item-container {
                margin-left: 0;
            }
        }
    }

    .@{ant-prefix}-steps-navigation .@{ant-prefix}-steps-item::after {
        margin-left: -4px;
    }
}

.@{ant-prefix}-steps-label-vertical:not(.@{ant-prefix}-steps-dot) .@{ant-prefix}-steps-item-container .@{ant-prefix}-steps-item-tail {
    margin-inline-start: 58px;
    padding-top: 3.5px;
    padding-bottom: 3.5px;
}

.@{ant-prefix}-steps {
    &.@{ant-prefix}-steps-dot {
        .@{ant-prefix}-steps-item-icon {
            height: 8px;
            width: 8px;
        }

        .@{ant-prefix}-steps-item:first-child .@{ant-prefix}-steps-icon-dot {
            left: 2px;
        }

        .@{ant-prefix}-steps-item-tail::after {
            width: ~"calc(100% - 20px)";
        }
    }

    &:not(.@{ant-prefix}-steps-dot) .@{ant-prefix}-steps-item .@{ant-prefix}-steps-item-tail {
        top: 12px;
    }
}
