@use '../../styles/variables';
@use 'mixin';

.thy-card {
    display: flex;
    flex-direction: column;
    background: variables.$bg-default;
    border-radius: variables.$card-border-radius;

    .thy-card-header {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        // @deprecated remove in v11
        .card-header-icon {
            display: block;
            margin-right: 8px;
            width: 0;
            height: 14px;
            @include mixin.card-head-title-icon(variables.$card-title-icon-color);
        }

        .card-header-title {
            color: variables.$card-title-color;
            font-size: variables.$card-title-font-size;
            line-height: variables.$card-title-line-height;
        }

        .card-header-description {
            margin-left: 10px;
            font-size: 12px;
            color: variables.$card-title-info-color;
        }

        .card-header-operation {
            margin-left: auto;
        }
    }

    @include mixin.card-set-size(
        variables.$card-header-padding-x,
        variables.$card-header-padding-y,
        variables.$card-content-padding-x,
        variables.$card-content-padding-y,
        variables.$card-divided-content-spacing-y
    );

    &.thy-card-lg {
        @include mixin.card-set-size(
            variables.$card-header-padding-x-lg,
            variables.$card-header-padding-y-lg,
            variables.$card-content-padding-x-lg,
            variables.$card-content-padding-y-lg,
            variables.$card-divided-content-spacing-y
        );
    }

    &.thy-card-sm {
        @include mixin.card-set-size(
            variables.$card-header-padding-x-sm,
            variables.$card-header-padding-y-sm,
            variables.$card-content-padding-x-sm,
            variables.$card-content-padding-y-sm,
            variables.$card-divided-content-spacing-y
        );
    }

    .thy-card-header {
        &--sm {
            padding-top: 0;
        }

        &--lg {
            padding: {
                top: 15px;
                bottom: 15px;
            }
        }
    }

    .thy-card-content {
        flex: auto;

        // @deprecated remove in v11
        &--alignment-title {
            padding-left: 30px;
            padding-right: 30px;
        }

        &--scroll {
            // margin-top: 10px;
            padding-bottom: 0;
            overflow-y: auto;
            overflow-x: hidden;
        }

        &--sm {
            padding-top: 0px;
            padding-bottom: 10px;
        }
    }

    // 分割的模式, 头底部出现分割线，标题前面的垂直分割符隐藏，上下间距变大
    &--divided {
        .thy-card-header {
            position: relative;
            &::after {
                position: absolute;
                content: ' ';
                bottom: 0;
                height: 1px;
                background-color: variables.$card-header-divider-color;
            }
        }
    }

    &--clear-left-right-padding {
        .thy-card-header {
            padding-left: 0;
            padding-right: 0;
        }

        .thy-card-content {
            padding-left: 0;
            padding-right: 0;
            // @deprecated remove in v11
            &--alignment-title {
                padding-left: 10px;
                padding-right: 10px;
            }
        }
    }

    &--bordered {
        border: 1px solid variables.$card-border-color;
    }
}
