* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    scroll-behavior: smooth;
    transition: all 0.25s;
    font-family: 'SourceHanSansSC',"微软雅黑", serif;
    user-select: none;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    perspective: 300px;
}

@font-face {
    font-family: 'SourceHanSansSC';
    src: url('../fonts/Source_Han_Sans_SC_Normal_Normal.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

main {
    position: relative;
    height: 100vh;
    background-image: url("../imgs/背景图 (2).png");
    background-size: cover;
    background-attachment: fixed;

    .overlay {
        position: absolute;
        z-index: 10;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
    }

    .title {
        position: fixed;
        z-index: 200;
        left: 1rem;
        top: 1rem;

        a {
            color: rgba(255, 255, 255, 0.8);
            font-size: 18px;
            cursor: pointer;

            &:hover {
                transition: 0.3s;
                color: rgba(255, 255, 255, 1);
            }
        }
    }

    .second-title {
        position: fixed;
        z-index: 200;
        right: 1rem;
        top: 1rem;

        .afd {
            color: rgba(255, 255, 255, 0.8);
            cursor: pointer;
            background: none;
            border: none;

            &:hover {
                transition: 0.3s;
                color: rgba(255, 255, 255, 1);
            }
        }

        .qrcode {
            position: absolute;
            right: 0;
            top: 2.5rem;
            width: 14rem;
            display: none;

            img {
                width: 100%;
                box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
            }
        }

        &:hover {
            .qrcode {
                display: block;
            }
        }
    }

    #page1 {
        position: relative;
        z-index: 101;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        height: 92vh;

        .logo {
            cursor: pointer;

            img {
                width: 250px;
                filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));

                &:hover {
                    transform: scale(1.02);
                }

                &:active {
                    transform: scale(0.98);
                }
            }
        }

        .online {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;

            .server-status {
                #loading {
                    color: rgba(255, 255, 255, 0.8);
                    font-size: 14px;
                }

                #server-info {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 10px;

                    > div {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        gap: 4px;
                        color: rgba(255, 255, 255, 0.8);

                        .on {
                            position: relative;
                            width: 11px;
                            height: 11px;
                            border-radius: 50%;
                            background: #3bd671;

                            &:before {
                                content: '';
                                position: absolute;
                                width: 100%;
                                height: 100%;
                                border-radius: 50%;
                                background: #3bd671;
                                animation: 2.5s ease 0s infinite normal none running led;
                            }
                        }

                        .off {
                            position: relative;
                            width: 11px;
                            height: 11px;
                            border-radius: 50%;
                            background: #df484a;

                            &:before {
                                content: '';
                                position: absolute;
                                width: 100%;
                                height: 100%;
                                border-radius: 50%;
                                background: #df484a;
                                animation: 2.5s ease 0s infinite normal none running led;
                            }
                        }

                        .icon {
                            opacity: 0.9;
                            width: 15px;
                        }

                        span {
                            color: rgba(255, 255, 255, 0.8);
                            font-size: 15px;
                        }
                    }

                    #server-address {
                        user-select: all;
                    }
                }

                #error-info {
                    color: rgba(255, 255, 255, 0.8);
                    font-size: 14px;
                }
            }

            .refresh {
                position: absolute;
                top: 50%;
                right: -20%;
                transform: translateY(-50%) translateX(-50%) rotate(0);
                cursor: pointer;
                width: 12px;
                opacity: 0.8;

                &:hover {
                    transition: 0.2s;
                    opacity: 1;
                }
            }

            .rotate-animation {
                animation: rotate 0.5s linear infinite;
            }
        }

        .mode {
            display: flex;
            align-items: center;
            gap: 1rem;

            .box {
                display: flex;
                align-items: center;
                cursor: pointer;
                opacity: 0.7;
                gap: 2px;

                img {
                    width: 22px;
                }

                &:hover {
                    opacity: 1;
                }
            }

            span {
                color: #fff;
                font-size: 12px;
                white-space: normal;
            }
        }

        .divider {
            margin: 0.5rem 0;
            width: 14%;
            height: 1px;
            background: linear-gradient(90deg,transparent, rgba(255, 255, 255, 0.2),transparent);
        }
    }

    .page-btn {
        position: fixed;
        top: 50%;
        z-index: 1000;
        transform: translateY(-50%);
        cursor: pointer;
        animation: breathe 2.4s infinite;

        svg {
            width: 40px;
            opacity: 0.5;
        }

        &:hover {
            animation: none;
            transition: 0.3s;
            opacity: 1;
        }
    }

    #btn-left {
        left: 1.5rem;
    }

    #btn-right {
        right: 1.5rem;
    }
}

@keyframes rotate {
    to {
        transform: translateY(-50%) translateX(-50%) rotate(180deg);
    }
}

@keyframes led {
    0% {
        opacity: 0.5;
    }

    70% {
        opacity: 0;
        transform: scale(2.4);
    }

    100% {
        opacity: 0;
    }
}

@keyframes breathe {
    0%,100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.85;
    }
}
