* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #191919;
}

header {
    z-index: 999;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 200px;
    transition: 0.5s ease;
}

header .brand {
    color: #FFF;
    font-size: 1.5em;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

header .brand img {
    height: 60px;
    width: 60px;
}

header .navigation {
    position: relative;
}

header .navigation .navigation-items a {
    position: relative;
    color: #fff;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    margin-left: 30px;
    transition: 0.3s ease;
}

header .navigation .navigation-items a:before {
    content: '';
    position: absolute;
    background: #fff;
    width: 0%;
    height: 3px;
    bottom: 0;
    left: 0;
    transition: 0.3s ease;
}

header .navigation .navigation-items a:hover::before {
    width: 100%;
}

.base {
    width: 100%;
    height: 100vh;
    background-image: linear-gradient(rgba(12, 3, 51, 0.3), rgba(12, 3, 51, 0.3));
    position: relative;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content {
    text-align: center;
}

.content h1 {
    font-size: 160px;
    color: #fff;
    font-weight: 600;
    transition: 0.5s;
}

.content h1:hover {
    -webkit-text-stroke: 2px #fff;
    color: transparent;
}

h2 {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 80px;
    color: #fff;
    font-weight: 60;
    transition: 0.5s;
}

h2:hover {
    -webkit-text-stroke: 2px #fff;
    color: transparent;
}

.content a {
    text-decoration: none;
    display: inline-block;
    color: #fff;
    font-size: 24px;
    border: 2px solid #fff;
    padding: 14px 70px;
    border-radius: 50px;
    margin-top: 20px;
}

.back-video {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: -1;
}

section {
    padding: 100px 200px;
}

.home {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    flex-direction: column;
    background: #2696E9;
}

.home:before {
    z-index: 777;
    content: '';
    position: absolute;
    background: rgba(3, 96, 251, 0.3);
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

#video-describe {
    text-align: left;
    z-index: 888;
    color: #fff;
    width: 70%;
    margin-top: 50px;
    display: none;
}

#video-describe.active {
    display: block;
}

#video-describe h1 {
    font-size: 4em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 5px;
    line-height: 75px;
    margin-top: 40px;
}

#video-describe h1 span {
    font-size: 1.2em;
    font-weight: 600;
}

#video-describe p {
    margin-bottom: 65px;
}

#video-describe a {
    background: #fff;
    padding: 15px 35px;
    color: #1680ac;
    font-size: 1.1em;
    font-weight: 500;
    text-decoration: none;
    border-radius: 2px;
}

.media-icons {
    position: fixed;
    /* 使用 fixed 使图标固定在窗口上，即使页面滚动，图标仍在同一位置 */
    right: 30px;
    /* 图标距离右侧 30px */
    top: 50%;
    /* 图标距离顶部 50%，即页面中间 */
    transform: translateY(-50%);
    /* 用 translateY(-50%) 垂直居中图标 */
    z-index: 9999;
    /* 确保图标在其他内容上方 */
    display: flex;
    flex-direction: column;
}

.media-icons a {
    color: #fff;
    font-size: 1.6em;
    transition: 0.3s ease;
}

.media-icons a:not(:last-child) {
    margin-bottom: 20px;
}

.media-icons a:hover {
    transform: scale(1.3);
}

.home video {
    z-index: 000;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-navigation {
    z-index: 888;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(80px);
    margin-bottom: 12px;
}

.slider-navigation .nav-btn {
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
    transition: 0.3s ease;
}

.slider-navigation .nav-btn.active {
    background: #2696E9;
}

.slider-navigation .nav-btn:not(:last-child) {
    margin-right: 20px;
}

.slider-navigation .nav-btn:hover {
    transform: scale(1.2);
}

.video-slide {
    position: absolute;
    width: 100%;
    clip-path: circle(0% at 0 50%);
}

.video-slide.active {
    clip-path: circle(150% at 0 50%);
    transition: 2s ease;
    transition-property: clip-path;
}

.gallery {
    width: 95%;
    display: flex;
    overflow-x: scroll;
    align-items: center;
    /* 确保 gallery 内的项水平居中 */
}

.gallery div {
    width: 35%;
    display: grid;
    grid-template-columns: auto;
    grid-gap: 20px;
    padding: 10px;
    flex: none;
    justify-content: center;
    /* 确保 div 内的图片水平居中 */
}

.gallery div img {
    width: 100%;
    object-fit: cover;
    /* 保持图片比例，填满容器 */
    filter: grayscale(0.8);
    transition: filter 1s ease, transform 1s ease;
}

.gallery::-webkit-scrollbar {
    display: none;
}

.gallery-wrap #backBtn,
#nextBtn {
    width: 50px;
    cursor: pointer;
    margin: 40px;
}

.gallery div img:hover {
    filter: grayscale(0);
    cursor: pointer;
    transform: scale(1.05);
    transition: filter 2s ease, transform 5s ease;
}

.thumbnail {
    width: 150px;
    cursor: pointer;
    transition: transform 0.3s ease, width 0.3s ease;
    margin: 10px;
}

.thumbnail.expanded {
    width: 80vw;
    /* 最大宽度为视口宽度的80% */
    max-height: 80vh;
    /* 最大高度为视口高度的80% */
    object-fit: contain;
    /* 保持图片比例 */
    position: relative;
    z-index: 1;
    filter: none;
    /* 取消灰度效果 */
    transform: none;
    /* 取消缩放效果 */
}

/* 确保放大状态下不应用悬浮效果 */
.thumbnail.expanded:hover {
    filter: none;
    /* 取消灰度效果 */
    cursor: default;
    /* 取消手型光标 */
    transform: none;
    /* 取消缩放效果 */
}

.overlay {
    position: fixed; /* 固定定位，确保其覆盖整个视口 */
    top: 5%; /* 距离顶部 5% */
    left: 5%; /* 距离左侧 5% */
    width: 90%; /* 宽度占据原窗口的 90% */
    height: 90%; /* 高度占据原窗口的 90% */
    background-color: rgba(0, 0, 0, 0.8); /* 半透明背景色 */
    display: flex; /* 使用 flex 布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    z-index: 10000; /* 确保 overlay 在所有内容之上 */
    flex-direction: column; /* 使内容区域垂直布局 */
}

.overlay-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.overlay-info {
    position: absolute;
    top: 10px; /* 离顶部 10px */
    left: 10px; /* 离左侧 10px */
    color: #fff;
    text-align: left;
    z-index: 10001; /* 确保在 overlay-content 之上 */
}

#score, #dir, #diff {
    margin-bottom: 10px;
}


#map {
    position: absolute;
    margin: auto;
    width: 670px;
    height: 670px;
    border: 5px solid black;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    visibility: hidden;
    background-color: #FFF;
}

#Snak_head {
    width: 20px;
    height: 20px;
    background-color: red;
    position: absolute;
    box-shadow: 0 0 15px 1px black;
}

.food_span {
    position: absolute;
    display: block;
    background-color: blue;
    width: 20px;
    height: 20px;
}

.Snak_body {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: black;
    box-shadow: 0 0 15px 1px black;
}

#Start_game {
    width: auto; /* 调整宽度以适应内容 */
    height: auto; /* 调整高度以适应内容 */
    margin: 10px 0; /* 上下边距 */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    font-size: 2rem; /* 调整字体大小 */
    background-color: black;
    color: white;
    z-index: 9999;
}


#Start_game span {
    position: relative;
}

select {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    width: 60px;
    height: 30px;
    margin-left: 18px;
    outline: none;
    padding-left: 15px;
    border-radius: 5px;
}

#Start_game span:after {
    position: absolute;
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    animation: loading 2s -2s steps(3) infinite;
    content: attr(data-text);
}

@keyframes loading {
    0% {
        width: 0rem;
    }

    33% {
        width: 5rem;
    }

    100% {
        width: 10rem;
    }
}

@media (max-width: 1040px) {
    header {
        padding: 12px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        /* 固定 header 位置 */
        width: 100%;
        top: 0;
        left: 0;
        z-index: 1000;
        /* 确保 header 在最前面 */
    }

    header .brand {
        position: relative;
        z-index: 1001;
        /* 确保 logo 在前 */
    }

    header .menu-btn {
        position: relative;
        z-index: 1001;
        /* 确保 menu-btn 在前 */
    }

    header .navigation {
        display: none;
        position: fixed;
        /* 将导航栏设为固定定位 */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        justify-content: center;
        align-items: center;
        background: rgba(1, 1, 0, 0.5);
        z-index: 999;
        /* 确保导航栏位于 LOGO 和 menu-btn 之后 */
    }

    header .navigation.active {
        display: flex;
    }

    header .navigation .navigation-items {
        background: #fff;
        width: 600px;
        max-width: 600px;
        margin: 20px;
        padding: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        border-radius: 5px;
        box-shadow: 0 tpx 25px rgb(1 1 1 / 20%);
    }

    header .navigation .navigation-items a {
        color: #222;
        font-size: 1.2em;
        margin: 20px;
    }

    header .navigation .navigation-items a:before {
        background: #222;
        height: 5px;
    }

    header .navigation.active .navigation-items {
        background: #fff;
        width: 600px;
        max-width: 600px;
        margin: 20px;
        padding: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        border-radius: 5px;
        box-shadow: 0 tpx 25px rgb(1 1 1 / 20%);
    }

    .menu-btn {
        background: url(images/menu.png)no-repeat;
        background-size: 30px;
        background-position: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        transition: 0.3s ease;
    }

    .menu-btn.active {
        z-index: 1001;
        background: url(images/close.png)no-repeat;
        background-size: 30px;
        background-position: center;
        transition: 0.3s ease;
    }

}

@media (min-aspect-ratio: 16/9) {
    .back-video {
        width: 100%;
        height: auto;
    }
}

@media (max-aspect-ratio: 16/9) {
    .back-video {
        width: auto;
        height: 100%;
    }
}