@import "./var.scss";

.miao-tag {
    font-size: 24px;
    vertical-align: middle;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0px 16px;
    height: 48px;
    white-space: nowrap;

    &:not([class*="bg"]):not([class*="line"]) {
        background-color: #f1f1f1;
    }

    &[class*="line-"] {
        &::after {
            content: " ";
            width: 200%;
            height: 200%;
            position: absolute;
            top: 0;
            left: 0;
            border: 2px solid currentColor;
            transform: scale(0.5);
            transform-origin: 0 0;
            box-sizing: border-box;
            border-radius: inherit;
            z-index: 1;
            pointer-events: none;
        }
    }

    &.radius {
        &[class*="line"] {
            &::after {
                border-radius: 12px;
            }
        }
    }

    &.round {
        &[class*="line"] {
            &::after {
                border-radius: 1000px;
            }
        }
    }



    &.tag_sm {
        font-size: 20px;
        padding: 4px 12px;
        height: 32px;
    }

    &.tag_xs {
        font-size: 22px;
        padding: 4px 14px;
        height: 40px;
    }

    &.tag_md {
        font-size: 24px;
        padding: 0px 16px;
        height: 48px;
    }

    &.tag_xl {
        font-size: 26px;
        padding: 0px 18px;
        height: 56px;
    }

    &.tag_xxl {
        font-size: 28px;
        padding: 0px 20px;
        height: 64px;
    }

    &.tag_sl {
        font-size: 30px;
        padding: 0px 22px;
        height: 72px;
    }


    &.tag_xsl {
        font-size: 32px;
        padding: 0px 24px;
        height: 80px;
    }

    &.badge {
        border-radius: 200px;
        position: absolute;

        top: -10px;
        right: -10px;
        font-size: 20px;
        padding: 0px 10px;
        height: 28px;
        color: $white;



        &:not([class*="bg-"]) {
            background-color: #dd514c;
        }
    }

    &:empty {
        &:not([class*="EIcon-"]) {
            padding: 0px;
            width: 16px;
            height: 16px;
            top: -4px;
            right: -4px;
            z-index: 1;
        }
    }

    &[class*="EIcon-"] {
        width: 32px;
        height: 32px;
        top: -4px;
        right: -4px;
    }
}

.miao-tag-group {
    display: inline-flex;
    vertical-align: middle;

    +.miao-tag-group {
        margin-left: 10px;
    }

    .miao-tag {
        margin: 0;

        &[class*="line-"] {
            &:last-child {
                &::after {
                    border-left: 0px solid transparent;
                }
            }

            &:first-child {
                &::after {
                    border-right: 0px solid transparent;
                }
            }
        }
    }

    &._radius {
        .miao-tag {

            &:first-child,
            &[class*="line-"] {
                &:first-child {
                    border-top-left-radius: 6Px;
                    border-bottom-left-radius: 6Px;
                }
            }

            &:last-child,
            &[class*="line-"] {
                &:last-child {
                    border-top-right-radius: 6Px;
                    border-bottom-right-radius: 6Px;
                }

            }
        }
    }

    &._round {
        .miao-tag {
            &:first-child {
                border-top-left-radius: 200px;
                border-bottom-left-radius: 200px;
                text-indent: 4px;
            }

            &:last-child::after,
            &:last-child {
                border-top-right-radius: 200px;
                border-bottom-right-radius: 200px;
                text-indent: -4px;
            }
        }
    }
}