/* 基础重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    overflow-x: hidden;
    font-size: 16px; /* 设置基础字体大小 */
    margin: 0;
    padding: 0;
}

/* 容器样式 - 使用底图作为背景 */
.container {
    position: relative;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    background-image: url('../img/底图.png');
    background-repeat: no-repeat;
    background-size: 100% auto;
    /*min-height: 100vh;*/
    z-index: 1;
    background-position: top center;
}

/* 固定框样式 */
.fixed-box {
    position: fixed;
    bottom: clamp(5px, 1vw, 20px);
    transform: translateX(-50%);
    min-width: 365px;
    width: clamp(200px, 85vw, 800px);
    max-width: clamp(250px, 90vw, 850px); /* 保持最大宽度限制 */
    height: clamp(150px, 50vw, 500px);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: clamp(5px, 3vw, 20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: height 0.3s ease;
    box-sizing: border-box;
}

/* 页面滚动后固定框变高 */
.fixed-box.scrolled {
    min-width: 365px;
    width: clamp(250px, 90vw, 850px);
    max-width: clamp(250px, 90vw, 850px); /* 保持最大宽度限制 */
    transform: translateX(-50%) ; /* 保持居中并稍微缩小 */
}

/* 固定框内容样式 */
.box-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 第一个小方块样式 */
.sub-box-1 {
    position: absolute;
    width: clamp(50px, 17vw, 150px);
    height: clamp(50px, 17vw, 150px);
    background-image: url('../img/icon.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    top: clamp(-30px, -10vw, -5px);
    left: 50%;
    transform: translateX(-50%);
    border-radius: clamp(3px, 1vw, 8px);
    transition: all 0.3s ease;
}

/* 滚动后第一个小方块样式 */
.fixed-box.scrolled .sub-box-1 {
    position: absolute;
    width: clamp(50px, 17vw, 150px);
    height: clamp(50px, 17vw, 150px);
    top: 50%;
    left: clamp(5px, 2vw, 20px);
    transform: translateY(-50%);
}

/* 第二个小方块样式 */
.sub-box-2 {
    position: absolute;
    width: clamp(80px, 25vw, 250px);
    height: clamp(60px, 20vw, 200px);
    background-color: transparent;
    top: clamp(15px, 7vw, 50px); /* 在第一个方块下方 */
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

/* 滚动后第二个小方块样式 */
.fixed-box.scrolled .sub-box-2 {
    position: absolute;
    width: clamp(120px, 40vw, 400px);
    height: clamp(60px, 20vw, 200px);
    background-color: transparent;
    top: 50%;
    left: clamp(50px, 20vw, 180px); /* 第一个方块宽度70px + 14px间距 + 10px补偿 */
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: clamp(10px, 3.5vw, 30px);
}

/* 第二个小方块内容容器 */
.sub-box-2-content {
    width: 100%;
    height: 100%;
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

/* 游戏标题样式 */
.game-title {
    font-size: clamp(12px, 3.5vw, 35px); /* 再增大一号 */
    font-weight: bold;
    color: black;
    margin-bottom: 2px;
    white-space: nowrap;
}

/* 游戏评分样式 */
.game-rating {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

/* 星星样式 */
.star {
    font-size: 14px; /* 再增大一号 */
    margin: 0 1px;
}

/* 满星样式（橙色） */
.star.full {
    color: orange;
}

/* 空星样式（浅黑色） */
.star.empty {
    color: #ccc;
}

/* 评分数字 */
.rating-number {
    font-size: 14px; /* 再增大一号 */
    color: black;
    margin-left: 2px;
}

/* 游戏标签容器 */
.game-tags {
    display: flex;
    gap: 3px;
    justify-content: center;
}

/* 标签样式 */
.tag {
    font-size: 12px; /* 再增大一号 */
    color: red;
    border: 1px solid red;
    border-radius: 3px;
    padding: 3px 5px; /* 增加内边距以适应更大字体 */
    white-space: nowrap;
}

/* 滚动后第二个小方块内容样式 */
.fixed-box.scrolled .sub-box-2-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
}

/* 滚动后游戏标签左对齐 */
.fixed-box.scrolled .game-tags {
    justify-content: flex-start;
}

/* 滚动后隐藏第三个标签 */
.fixed-box.scrolled .game-tags .tag:nth-child(3) {
    display: none;
}

/* 滚动后确保前两行内容可见 */
.fixed-box.scrolled .game-title,
.fixed-box.scrolled .game-rating {
    display: block;
}

/* 滚动后确保前两行内容可见 */
.fixed-box.scrolled .game-title,
.fixed-box.scrolled .game-rating {
    display: block;
}

/* 第三个小方块样式 */
.sub-box-3 {
    position: absolute;
    width: 90%;
    height: clamp(30px, 11vw, 100px);
    background-color: #E4963A;
    top: clamp(60px, 27vw, 250px); /* 在第二个方块下方 */
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
}

/* 滚动后第三个小方块样式 */
.fixed-box.scrolled .sub-box-3 {
    position: absolute;
    width: clamp(80px, 30vw, 300px);
    height: clamp(35px, 12vw, 120px);
    background-color: #E4963A;
    top: 50%;
    right: 14px;
    left: auto;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
}

/* 下载链接样式 */
.download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

/* 下载链接悬停效果 */
.download-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 确保在第三个小方块中的下载链接是白色的 */
.sub-box-3 .download-link {
    color: white !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 第四个小方块样式 - 位于第三个方块下方 */
.sub-box-4 {
    position: absolute;
    width: 100%;
    height: auto;
    background-color: transparent;
    top: 37vw; /* 在第三个方块下方 */
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    transition: all 0.3s ease;
    text-align: center;
    padding: 10px 0;
}

/* 滚动后第四个小方块隐藏 */
.fixed-box.scrolled .sub-box-4 {
    display: none;
}

/* 响应式设计，确保在电脑和手机上看起来一致 */
@media screen and (max-width: 768px) {
    .fixed-box {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 28px);
        max-width: 378px; /* 限制最大宽度 */
    }
    
    .fixed-box.scrolled {
        height: 100px; /* 增加20px */
        transform: translateX(-50%) scale(0.95); /* 保持居中并稍微缩小 */
    }
}

/* 电脑端样式 */
@media screen and (min-width: 769px) {
    .fixed-box {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 28px);
        max-width: 378px; /* 限制最大宽度 */
    }
    
    .fixed-box.scrolled {
        height: 100px; /* 增加20px */
        transform: translateX(-50%) scale(0.95); /* 保持居中并稍微缩小 */
    }
}

/* 资源信息模块 */
.resource-section {
    position: relative;
    width: 100%;
    height: 17.1vw; /* 128px / 1080px ≈ 17.1% */
}

/* 资源信息模块 */
.none-section {
    position: relative;
    width: 100%;
    height: 17.1vw; /* 128px / 1080px ≈ 17.1% */
}

/* 顶部下载遮罩 */
.top-download-mask {
    margin: -1%;
    width: 102%;
    height: 120%;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

/* 顶部内容容器 */
.top-content {
    position: absolute;
    top: 1.5vw;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.7vw; /* 20px / 1080px ≈ 2.7% */
    z-index: 10;
}

/* 应用图标 */
.app-icon {
    width: 16vw; /* 104px / 1080px ≈ 13.9% */
    height: 16vw; /* 106px / 1080px ≈ 14.1% */
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

/* 下载按钮 */
.download-button {
    width: 30vw; /* 195px / 1080px ≈ 26% */
    height: 14vw; /* 70px / 1080px ≈ 9.3% */
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
    cursor: pointer;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

/* 左侧文字信息容器 */
.text-info-container {
    position: absolute;
    left: 20vw; /* 140px / 1080px ≈ 18.7% */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    text-align: left;
}

/* 游戏标题大字 */
.game-title-large {
    font-size: clamp(20px, 3.5vw, 26px); /* 自适应字体大小，最小20px，最大26px */
    font-weight: 400;
    color: #FFFFFF ;
    margin-bottom: 0.7vw;
}

/* 游戏大小 */
.game-size {
    font-size: clamp(12px, 2.0vw, 18px); /* 自适应字体大小 */
    color: #FBF2E0 ;
    margin-bottom: -0.4vw;
}

/* 游戏标签 */
.game-tags {
    font-size: clamp(12px, 2.0vw, 18px); /* 自适应字体大小 */
    color: #FBF2E0;
}

/* 轮播图容器 */
.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    z-index: 2;
    margin-top: -18vw; /* 使用负边距减少与上方模块的距离 */
}

/* 轮播图包装器 */
.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.33, 0, 0.67, 1);
}

/* 轮播图片项 */
.carousel-slide {
    width: 100%;
    height: auto;
    display: block;
    flex: 0 0 100%;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

/* 指示点 */
.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* 活跃指示点 */
.indicator.active {
    background-color: white;
}

/* 主图模块 */
.main-image-section {
    width: 100%;
    text-align: center;
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

/* 邀请码模块 */
.invite-code-section {
    width: 100%;
    text-align: center;
    margin-top: -6.7vw;
}

.invite-code-container {
    position: relative;
    width: 100%;
    display: inline-block;
}

.invite-title {
    width: 100%;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

.invite-code {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); /* 添加阴影效果，白色阴影使文字在不同背景上更清晰 */
    font-family: "KaiTi", "楷体", serif; /* 设置为楷体 */
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    justify-content: center;
    cursor: pointer;
    user-select: none; /* 防止文本被选中 */
    font-size: clamp(16px, 4.7vw, 35px); /* 字体大小自适应 */
}

.invite-text {
    font-size: 1em; /* 相对于父元素字体大小 */
    align-self: center; /* 确保文字垂直居中 */
}

.invite-number {
    font-size: 1.1em; /* 相对于父元素字体大小 */
    font-weight: 200;
    align-self: center; /* 确保数字垂直居中 */
    transform: translateY(2px); /* 下移2px */
}

/* 标题图片模块 */
.title-image-section {
    width: 100%;
    text-align: center;
    margin-top: 5.7vw;
}
/* 下载图片模块 */
.download-image-section {
    width: 100%;
    text-align: center;
    margin-top: 5vw;
    position: relative;
    z-index: 20;
    cursor: pointer;
}

.title-image {
    /*width: 100%;*/
    width: auto;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
    max-width: 40%; /* 缩小图片，最大宽度为容器的80% */
    margin: 0 auto; /* 居中显示 */
}

.download-image {
    width: auto;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
    max-width: 27%; /* 缩小图片，最大宽度为容器的80% */
    margin: 0 auto; /* 居中显示 */
    cursor: pointer;
    position: relative;
    z-index: 20;
    pointer-events: auto;
    display: inline-block; /* 改为内联块元素 */
}

/* 下载容器 */
.download-container {
    text-align: center;
    position: relative;
    width: 100%;
}

.ios-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    /* 确保点击事件不会穿透到下层元素 */
    pointer-events: none;
}

.ios-guide-overlay.show {
    display: flex;
    /* 当显示时启用点击事件 */
    pointer-events: auto;
}

.ios-guide-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.ios-guide-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

/* 奖励模块 */
.rewards-section {
    width: 100%;
    margin-top: 5.7vw;
    text-align: center;
}

.rewards-container {
    display: flex;
    justify-content: center;
    gap: 2.9vw; /* 22px / 1080px ≈ 2.9% */
    padding: 0 2.9vw; /* 22px / 1080px ≈ 2.9% */
}

.reward-item {
    flex: 1;
    text-align: center;
    max-width: 30%; /* 确保三个项目能并排显示 */
}

.reward-image {
    width: 100%;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
    margin: 0 auto;
}

.reward-text {
    font-size: clamp(12px, 3.1vw, 24px); /* 自适应字体大小 */
    color: #FFF1D8;
    margin-top: 2vw;
    font-weight: 400;
    white-space: nowrap;
}

/* 活动说明文字模块 */
.activity-description-section {
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.first-line {
    display: inline-block; /* 关键：让 margin 生效 */
    margin-bottom: 0.1em; /* 根据需要调整 */
}

.activity-description-text {
    font-size: 2.5vw; /* 增大字体大小 */
    color: #FFFFFF;
    /*line-height: 1.4; !* 稍微减少行高 *!*/
    text-align: center;
    font-weight: 300;
    z-index: 111;
}

/* 空白块样式 */
.spacer-block {
    height: 56vw; /* 恢复为较大高度，以实现内容整体下移 */
    width: 100%;
}

/* 底部资源图片模块 */
.bottom-resource-section {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: -1; /* 设置为负值，确保在最底层，可被其他元素覆盖 */
    pointer-events: none; /* 不响应鼠标事件，不影响其他元素交互 */
}

.bottom-resource-image {
    width: 100%;
    height: auto;
    display: block;
    /* 保护图片原始颜色 */
    filter: none;
    -webkit-filter: none;
    mix-blend-mode: normal;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 设备选择弹窗样式 */
.device-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.device-selection-box {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    width: 80%;
}

.device-selection-title {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.device-selection-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f8f8;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.device-selection-button:hover {
    background-color: #e0e0e0;
}

/* 微信浏览器提示蒙层样式 */
.wechat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    justify-content: flex-start;
    align-items: flex-end;
    flex-direction: column;
    padding: 15px;
    box-sizing: border-box;
}

.wechat-overlay.show {
    display: flex;
}

.wechat-content {
    text-align: right;
    color: white;
    padding: 0;
    background: transparent;
}

.guide-arrow {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    display: inline-block;
}

.wechat-message {
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
    text-align: right;
}

/* 大屏幕适配 */
@media screen and (min-width: 768px) {
    .game-title-large {
        font-size: 30px; /* 从24px改为30px */
    }
    
    .game-size, .game-tags {
        font-size: 22px; /* 从14px改为22px */
    }
    
    .resource-section {
        height: 187px;
    }
    
    .top-content {
        padding: 0 20px;
    }
    
    .app-icon {
        width: 104px;
        height: 106px;
    }
    
    .download-button {
        width: 195px;
        height: 70px;
    }
    
    .text-info-container {
        left: 140px;
    }
    
    .game-title-large {
        margin-bottom: 5px;
    }
    
    .game-size {
        margin-bottom: 3px;
    }
    
    .main-image-section {
        margin-top: 20px;
    }
    
    .invite-code {
        font-size: 18px;
        text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.8); /* 添加阴影效果 */
        font-family: "KaiTi", "楷体", serif; /* 设置为楷体 */
        align-items: center; /* 添加垂直居中对齐 */
        justify-content: center;
    }

    .invite-text {
        font-size: 35px;
        align-self: center; /* 添加垂直居中对齐 */
    }

    .invite-number {
        font-size: 40px;
        font-weight: bold;
        align-self: center; /* 添加垂直居中对齐 */
        transform: translateY(2px); /* 下移2px */
    }
    
    .wechat-message {
        font-size: 18px;
    }
    
    .guide-arrow {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .wechat-overlay {
        padding: 30px;
    }
}