/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 统一字体 */
    font-family: 'Times New Roman', Times, serif;
}

/* 图片样式设置，确保图片最大宽度不超过容器 */
img {
    max-width: 100%;
}

/* h1 标题样式设置，设置颜色、居中对齐和内边距 */
h1 {
    color: rgb(191, 218, 255);
    text-align: center;
    padding: 40px;
}

/* 去除无序列表的默认样式 */
ul {
    list-style: none;
}

/* 页面头部样式设置，设置背景颜色 */
.page-header {
    background-color: rgb(0, 0, 0);
}

/* 预览区域样式设置，设置最大宽度并居中显示 */
.preview {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 预览区域内视频样式设置，设置背景颜色、宽度、边框和上边距 */
.preview video {
    background-color: black;
    width: 100%;
    border: 5px solid black;
    margin-top: 80px;
}

/* 截图区域样式设置，使用弹性布局，允许换行，水平和垂直方向设置间距，设置上下内边距 */
.screenshots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 40px;
    row-gap: 40px;
    padding-top: 80px;
    padding-bottom: 80px;
}

/* 单个截图样式设置，设置最大和最小宽度、边框圆角和边框样式 */
.screenshot {
    max-width: 320px;
    min-width: 280px;
    border-radius: 20px;
    border: 5px solid rgb(224, 193, 245);
}

/* 截图内图片样式设置，确保图片填充整个容器，设置边框圆角 */
.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

/* 游戏包装器样式设置，设置最大宽度并居中显示，设置背景颜色 */
.game-wrapper {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    background-color: rgb(56, 44, 79);
}

/* WebGL 画布样式设置，去除轮廓线 */
.webgl {
    outline: none;
}

/* 页面底部样式设置，设置背景颜色、文字颜色、内边距和文字居中对齐 */
.page-footer p {
    background-color: rgb(0, 13, 57);
    color: aliceblue;
    padding: 100px;
    text-align: center;
}

/* 响应式设计，当屏幕宽度小于 768px 时，调整截图的最大宽度 */
@media (max-width: 768px) {
    .screenshot {
        max-width: 280px;
    }
}

#gameOverOverlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    color: white;
    font-family: 'Orbitron', sans-serif;
}

#gameOverOverlay h2 {
    font-size: 3em;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #ff4444 0%, #ff0000 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

#finalScore {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #4facfe;
}

#restartButton {
    padding: 1em 2em;
    font-size: 1.2em;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.4);
}

#restartButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 242, 254, 0.6);
}

/* 添加生命值显示的样式 */
#healthBar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    color: white;
}

#healthValue {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #4facfe;
    border-radius: 10px;
    overflow: hidden;
}

#healthFill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
}    