// inspired by https://www.youtube.com/watch?v=Pl1Gw14pS2I
@import '@/styles/fn.less';

.mainPage {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
    // overflow: hidden;
    position: relative;
    max-width: 1640px;
    margin: 2px auto;

    .input {
        border: 1px solid var(--grey-4);
        border-radius: 16px;
        background: var(--grey-1);
        padding: 14px 4px 14px 16px;
        position: relative;

        &:hover {
            background: var(--grey-3);
        }

        &.focus {
            background: var(--white);
            box-shadow: 0px 2px 10px 0px var(--dark-1);
        }

        &-main {
            width: 100%;
            display: flex;
            align-items: flex-end;

            &-box {
                flex: 1;
                position: relative;

                .textarea {
                    color: var(--dark-8);
                    font-size: 16px;
                    line-height: 24px;
                    padding: 0;
                    padding-right: 48px;
                    caret-color: var(--theme-color);
                    .custom-scroll();
                }

                .send {
                    position: absolute;
                    bottom: 0;
                    right: 8px;
                    color: var(--theme-color);
                    display: flex;
                    align-items: center;

                    i {
                        font-size: 24px;
                    }

                    &.disabled {
                        color: var(--dark-2);

                        &:hover,
                        &:active {
                            color: var(--dark-2);
                        }
                    }

                    &:hover {
                        color: var(--blue-3);
                    }

                    &:active {
                        color: var(--blue-4);
                    }
                }
            }
        }
    }

    .chatContent {
        position: relative;
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        flex-grow: 1;
        margin-right: 40px;
        max-width: 800px;
        height: 100%;
        // overflow-y: hidden;
        padding: 0;
        box-sizing: border-box;

        .top {
            height: 100%;
            overflow-y: auto;

            &.mb12 {
                margin-bottom: 12px;
            }

            &::-webkit-scrollbar {
                width: 6px;
            }

            &::-webkit-scrollbar-track {
                background-color: rgba(255, 255, 255, 0);
                border-radius: 100px;
            }

            &::-webkit-scrollbar-thumb {
                background-color: rgba(255, 255, 255, 0);
                border-radius: 100px;
            }
        }

        .sendArea {
            display: flex;
            width: 100%;
            box-sizing: border-box;
            height: 52px;
            border-radius: 16px !important;

            :global {
                .ant-input {
                    &:focus {
                        box-shadow: none !important;
                        outline: 0 !important;
                    }
                }
            }

            input {
                height: 36px;
                line-height: 36px;
                flex-grow: 1;
                border: 0;
                outline: 0;

                &:focus {
                    border: 0;
                    outline: 0;
                }
            }

            button {
                display: flex;
                justify-content: flex-start;
                align-items: center;
                border: 0;
                background-color: #fff;
                cursor: pointer;
                padding: 8px;
                width: 65px;
                flex-shrink: 0;

                img {
                    margin-right: 4px;
                }
            }
        }

        .notice {
            color: #12131659;
            padding-top: 8px;
            text-align: center;
            font-weight: 400;
            font-size: 12px;
            line-height: 18px;

            a {
                text-decoration: none;
                color: #444;
                display: inline-flex;
                align-items: center;

                span {
                    font-size: 18px;
                }
            }
        }
    }

    .progressContent {
        max-width: 800px;
        flex-shrink: 1;
        box-sizing: border-box;
        padding: 24px;
        border-radius: 8px;
        border: rgba(33, 38, 192, 0.1);
        background: rgba(255, 255, 255, 0.8);
        height: calc(100% - 60px);
        overflow-y: auto;
        position: relative;

        &::-webkit-scrollbar {
            width: 6px;
        }

        &::-webkit-scrollbar-track {
            background-color: rgba(255, 255, 255, 0);
            border-radius: 100px;
        }

        &::-webkit-scrollbar-thumb {
            background-color: rgba(255, 255, 255, 0);
            border-radius: 100px;
        }

        .toggleIcon {
            position: absolute;
            right: 24px;
            top: 28px;
            cursor: pointer;
        }
    }
}

pre {
    margin: 0;
    padding-top: 8px;
    color: #121316;
    font-size: 14px;
    line-height: 24px;
    font-family: 'PingFang SC', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    white-space: wrap;
}

ul {
    margin: 0;
    padding: 0;
}

.draft {
    width: 100%;
    white-space: wrap;
    // display: flex;
    // justify-content: flex-start;
    // align-items: flex-start;

    .loading,
    .loading>div {
        position: relative;
        box-sizing: border-box;
    }

    .loading {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0;
        color: #fff;
        background-color: #f90;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        margin-right: 3px;
        flex-shrink: 0;
    }

    .loading>div {
        display: inline-block;
        float: none;
        background-color: currentColor;
        border: 0 solid currentColor;
    }

    .loading>div:nth-child(1) {
        animation-delay: -200ms;
    }

    .loading>div:nth-child(2) {
        animation-delay: -100ms;
    }

    .loading>div:nth-child(3) {
        animation-delay: 0ms;
    }

    .loading>div {
        width: 3px;
        height: 3px;
        margin: 2px 1px;
        border-radius: 100%;
        animation: ball-pulse 1s ease infinite;
    }
}

.qaItem {
    width: 100%;
    margin-bottom: 40px;
}

.newChatTip {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--35-text-2, rgba(18, 19, 22, 0.35));
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    position: relative;
    margin-bottom: 80px;

    span {
        background-color: #fff;
        position: relative;
        z-index: 10;
        padding: 0 16px;
    }

    &::before {
        position: absolute;
        width: 100%;
        left: 0;
        top: calc(50% - 1px);
        height: 1px;
        content: '';
        background-color: #d7d8dd;
    }

    a {
        padding: 0 4px;
        color: #3477eb;
        text-decoration: none;
        cursor: pointer;
    }
}

.showRight {
    position: fixed;
    top: 45px;
    right: 24px;
    width: 32px;
    cursor: pointer;
    z-index: 100;

    .actionIcon {
        width: 32px;
        height: 32px;
        border-radius: 4px;
        padding: 3px;
        margin-bottom: 12px;
        box-sizing: border-box;

        &.forbidden {
            cursor: not-allowed;
            opacity: 0.5;
        }

        &.robotIcon {
            display: flex;
            justify-content: center;
            align-items: center;

            img {
                width: 17px;
            }
        }

        &:hover {
            background-color: #f4f5f9;
        }
    }

    img {
        width: 100%;
    }
}

@keyframes ball-pulse {

    0%,
    60%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    30% {
        opacity: 0.1;
        transform: scale(0.01);
    }
}

@keyframes moveGradient {
    50% {
        background-position: 100% 50%;
    }
}

@keyframes fadeIn {
    0% {
        width: 0;
        opacity: 0;
    }

    100% {
        width: auto;
        opacity: 1;
    }
}

@keyframes unfold {
    0% {
        height: auto;
    }

    100% {
        height: 0;
    }
}

.loading99 {
    margin: 20px;
    position: relative;
    width: 1px;
    height: 1px;
}

.loading99:before,
.loading99:after {
    position: absolute;
    display: inline-block;
    width: 15px;
    height: 15px;
    content: '';
    border-radius: 100%;
    background-color: #5551ff;
}

.loading99:before {
    left: -15px;
    animation: ball-pulse infinite 0.75s -0.4s cubic-bezier(0.2, 0.68, 0.18, 1.08);
}

.loading99:after {
    right: -15px;
    animation: ball-pulse infinite 0.75s cubic-bezier(0.2, 0.68, 0.18, 1.08);
}

@keyframes ball-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

// @media (max-width: 1360px) {
//     .mainPage {
//         padding: 0 60px 0 120px;
//     }
// }