// 初始化变量
:root {
    // 背景颜色
    --xf_background_gradient: to right top, #bba9a7, #dfecf9, #a4b3d2 100%;
    // 标题文字颜色
    --xf_text_gradient: to right top, #2199bc, #009980;
    // 距离上面盒子的高度
    --xf_top_1: 11%;
    --xf_top_2: 22%;
    --xf_top_3: 33%;
    --xf_top_4: 44%;
    --xf_top_5: 55%;
    // Z轴的大小
    --xf_translateZ_1: 50px;
    --xf_translateZ_2: 80px;
    --xf_translateZ_3: 110px;
    --xf_translateZ_4: 140px;
    --xf_translateZ_5: 190px;
}

@font-face {
    font-family: "RAGE";
    src: url('RAGE.ttf'), url('RAGE.ttf');
}

* {
    padding: 0;
    margin: 0;
}

a {
    color: #009980;
    text-decoration: none;
    -webkit-transition: color .3s;
    transition: color .3s;
}

// 粉红色的鼠标选中样式
::-moz-selection {
    background-color: #ffc0cb;
    color: #fff;
}

::-webkit-selection {
    background-color: #ffc0cb;
    color: #fff;
}

::selection {
    background-color: #ffc0cb;
    color: #fff;
}

// 背景样式
body {
    width: 100%;
    height: 100vh;
    background-attachment: fixed;
    background: -webkit-linear-gradient(var(--xf_background_gradient));
    background: -moz-linear-gradient(var(--xf_background_gradient));
    background: -o-linear-gradient(var(--xf_background_gradient));
    background: -ms-linear-gradient(var(--xf_background_gradient));
    background: linear-gradient(var(--xf_background_gradient));
    background-repeat: no-repeat;
    background-size: cover;
    overflow-x: hidden;
    overflow-y: hidden;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -moz-filter: blur(10px);
    -webkit-filter: blur(10px);
    filter: blur(10px);
    -moz-animation: xf_filter 3s;
    -webkit-animation: xf_filter 3s;
    -o-animation: xf_filter 3s;
    animation: xf_filter 3s;
    // 只执行一次动画
    -moz-animation-iteration-count:1;
    -webkit-animation-iteration-count:1;
    -o-animation-iteration-count:1;
    animation-iteration-count:1;
    // 让动画停留在最后一帧
    -moz-animation-fill-mode: forwards;
    -webkit-animation-fill-mode: forwards;
    -o-animation-fill-mode: forwards;
    animation-fill-mode: forwards;

    @keyframes xf_filter {
        100%{
            filter: blur(0);
        }
    }

    // 音乐播放器
    audio {
        display: block;
        margin: 30px auto 0;
        opacity: .5;
        -webkit-transition: opacity .5s;
        transition: opacity .5s;

        &:hover {
            -webkit-opacity: 1;
            opacity: 1;
        }
    }

    // 版心
    section {
        display: flex;
        width: 100%;

        // 左侧盒子
        .xf_left_box {
            position: relative;
            -webkit-perspective: 700px;
            perspective: 700px;
            width: 50%;
            height: 100vh;

            // 公共样式
            .xf_public {
                -webkit-transform-style: preserve-3d;
                transform-style: preserve-3d;
                position: absolute;
                left: 50%;
                -webkit-transform: translateX(-50%);
                transform: translateX(-50%);
                width: 80px;
                height: 75px;
                // 匀速循环旋转15s
                -o-animation: xfrotate 15s linear infinite;
                -ms-animation: xfrotate 15s linear infinite;
                -moz-animation: xfrotate 15s linear infinite;
                -webkit-animation: xfrotate 15s linear infinite;
                animation: xfrotate 15s linear infinite;

                li {
                    list-style: none;
                    position: absolute;
                    border: 2px solid #fff;
                    -moz-box-shadow: 0 0 3px 3px rgba(255, 255, 255, .5);
                    -webkit-box-shadow: 0 0 3px 3px rgba(255, 255, 255, .5);
                    box-shadow: 0 0 3px 3px rgba(255, 255, 255, .5);

                    img {
                        display: block;
                        width: 100%;
                        height: 100%;
                    }
                }
            }

            // 原理：用360°除以盒子的数量就是Y轴旋转的度数
            // 第1个旋转盒子样式
            .xf_rotate_1 {
                top: var(--xf_top_1);

                // 这个是90°
                li:nth-child(1) {
                    transform: rotateY(0) translateZ(var(--xf_translateZ_1));
                }

                li:nth-child(2) {
                    transform: rotateY(90deg) translateZ(var(--xf_translateZ_1));
                }

                li:nth-child(3) {
                    transform: rotateY(180deg) translateZ(var(--xf_translateZ_1));
                }

                li:nth-child(4) {
                    transform: rotateY(270deg) translateZ(var(--xf_translateZ_1));
                }
            }

            // 第2个旋转盒子样式
            .xf_rotate_2 {
                top: var(--xf_top_2);

                // 增加60°
                li:nth-child(1) {
                    transform: rotateY(0) translateZ(var(--xf_translateZ_2));
                }

                li:nth-child(2) {
                    transform: rotateY(60deg) translateZ(var(--xf_translateZ_2));
                }

                li:nth-child(3) {
                    transform: rotateY(120deg) translateZ(var(--xf_translateZ_2));
                }

                li:nth-child(4) {
                    transform: rotateY(180deg) translateZ(var(--xf_translateZ_2));
                }

                li:nth-child(5) {
                    transform: rotateY(240deg) translateZ(var(--xf_translateZ_2));
                }

                li:nth-child(6) {
                    transform: rotateY(300deg) translateZ(var(--xf_translateZ_2));
                }
            }

            // 第3个旋转盒子样式
            .xf_rotate_3 {
                top: var(--xf_top_3);

                // 增加45°
                li:nth-child(1) {
                    transform: rotateY(0) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(2) {
                    transform: rotateY(45deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(3) {
                    transform: rotateY(90deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(4) {
                    transform: rotateY(135deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(5) {
                    transform: rotateY(180deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(6) {
                    transform: rotateY(225deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(7) {
                    transform: rotateY(270deg) translateZ(var(--xf_translateZ_3));
                }

                li:nth-child(8) {
                    transform: rotateY(315deg) translateZ(var(--xf_translateZ_3));
                }
            }

            // 第4个旋转盒子样式
            .xf_rotate_4 {
                z-index: 1;
                top: var(--xf_top_4);

                // 增加36°
                li:nth-child(1) {
                    transform: rotateY(0) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(2) {
                    transform: rotateY(36deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(3) {
                    transform: rotateY(72deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(4) {
                    transform: rotateY(108deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(5) {
                    transform: rotateY(144deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(6) {
                    transform: rotateY(180deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(7) {
                    transform: rotateY(216deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(8) {
                    transform: rotateY(252deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(9) {
                    transform: rotateY(288deg) translateZ(var(--xf_translateZ_4));
                }

                li:nth-child(10) {
                    transform: rotateY(324deg) translateZ(var(--xf_translateZ_4));
                }
            }

            // 第5个旋转盒子样式
            .xf_rotate_5 {
                z-index: 0;
                top: var(--xf_top_5);

                // 增加30°
                li:nth-child(1) {
                    transform: rotateY(0) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(2) {
                    transform: rotateY(30deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(3) {
                    transform: rotateY(60deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(4) {
                    transform: rotateY(90deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(5) {
                    transform: rotateY(120deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(6) {
                    transform: rotateY(150deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(7) {
                    transform: rotateY(180deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(8) {
                    transform: rotateY(210deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(9) {
                    transform: rotateY(240deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(10) {
                    transform: rotateY(270deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(11) {
                    transform: rotateY(300deg) translateZ(var(--xf_translateZ_5));
                }

                li:nth-child(12) {
                    transform: rotateY(330deg) translateZ(var(--xf_translateZ_5));
                }
            }

            @keyframes xfrotate {
                0% {
                    transform: rotateY(0);
                }

                100% {
                    transform: rotateY(360deg);
                }
            }
        }

        // 右侧盒子
        .xf_right_box {
            position: relative;
            width: 50%;
            height: 100vh;
            padding: 3%;

            .xf_title {
                margin-top: 2%;
                background-image: -webkit-linear-gradient(var(--xf_text_gradient));
                background-image: -moz-linear-gradient(var(--xf_text_gradient));
                background-image: -o-linear-gradient(var(--xf_text_gradient));
                background-image: -ms-linear-gradient(var(--xf_text_gradient));
                background-image: linear-gradient(var(--xf_text_gradient));
                font-family: "RAGE";
                -webkit-background-clip: text;
                background-clip: text;
                color: transparent;
                font-size: 3rem;
                -moz-text-shadow: 0 0 8px rgba(255, 255, 255, .5);
                -webkit-text-shadow: 0 0 8px rgba(255, 255, 255, .5);
                text-shadow: 0 0 8px rgba(255, 255, 255, .5);
            }

            .xf_video {
                margin-top: 5%;
                width: 20em;
                -o-box-shadow: 1px 1px 5px 2px rgba(0, 102, 255, .35);
                -moz-box-shadow: 1px 1px 5px 2px rgba(0, 102, 255, .35);
                -webkit-box-shadow: 1px 1px 5px 2px rgba(0, 102, 255, .35);
                box-shadow: 1px 1px 5px 2px rgba(0, 102, 255, .35);
            }
        }
    }

    // 底部版权
    footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        height: 3.6em;
        text-align: center;
        font-family: '黑体', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
        font-weight: bold;
        color: #a4a4a4;

        p {
            display: inline-block;
            font-size: 1.1rem;
            border-bottom: 1px solid #adadad;

            a:hover {
                color: #5c77bd;
            }
        }
    }

    // 画布样式
    .xf_canvas {
        position: fixed;
        top: 0;
        left: 0;
        display: block;
        -webkit-pointer-events: none;
        pointer-events: none;
        width: 100%;
        height: 100%;
        z-index: 1809185784;
    }

    // 隐藏
    .xf_left_box,
    .xf_title,
    .xf_video {
        display: none;
    }
}

@media screen and (max-width: 730px) {
    body {
        overflow-x: hidden;
        overflow-y: hidden;

        section {
            display: flex;
            flex-direction: column-reverse;

            .xf_left_box {
                margin-top: 3%;
                width: 100%;
                height: 100vh;
                -moz-zoom: .75;
                -ms-zoom: .75;
                zoom: .75;
                left: 45%;
                -webkit-transform: translateX(-50%);
                transform: translateX(-50%);
            }

            .xf_right_box {
                width: 100%;
                height: 20vh;

                .xf_title {
                    text-align: center;
                    font-size: 2rem;
                }

                .xf_video {
                    position: absolute;
                    left: 50%;
                    -webkit-transform: translateX(-50%);
                    transform: translateX(-50%);
                    width: 13em;
                }
            }
        }
    }
}