/* ==========================================================================
   万象城活动页面样式
   ========================================================================== */

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

html {
    width: 100%;
    overflow-x: hidden; /* 只禁用横向滚动 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    overflow-x: hidden; /* 只禁用横向滚动 */
    position: relative;
    background-color: #000;
    width: 100%;
    min-height: 100vh; /* 确保最小高度为视口高度 */
}

/* 主页面允许正常滚动，但限制内容高度 */
#main-page {
    overflow-y: auto;
    height: 100vh;
    position: relative;
}

/* 活动明细页面允许滚动 */
#details-page {
    overflow-y: auto;
    height: 100vh;
}

/* 图片基础样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* 按钮基础样式 */
button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-image {
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

button:hover .btn-image,
button:focus .btn-image {
    transform: scale(1.05);
}

button:active .btn-image {
    transform: scale(0.95);
}

/* ==========================================================================
   页面布局系统
   ========================================================================== */

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page.active {
    opacity: 1;
    visibility: visible;
    z-index: 100; /* 提高z-index确保完全覆盖 */
}

/* 主页面默认显示 */
#main-page {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* 确保活动明细页面完全覆盖主页面 */
#details-page {
    background-color: #000; /* 添加黑色背景确保完全遮盖 */
}

#details-page.active {
    z-index: 100; /* 确保在最顶层 */
}

/* ==========================================================================
   主页面样式
   ========================================================================== */

/* 背景容器 */
.background-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 页面头部 */
.page-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.top-logo-container {
    flex-shrink: 0;
}

.top-logo {
    max-width: 25vw;
    min-width: 80px;
}

.details-btn-container {
    flex-shrink: 0;
}

.details-btn {
    max-width: 10vw;
    min-width: 60px;
}

/* 活动内容区域 - 重新调整布局 */
.activity-content {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 40px 20px; /* 添加底部padding */
    margin-top: -100vh; /* 负边距让内容覆盖在背景上 */
    min-height: 10vh; /* 确保内容区域至少占满一屏 */
    box-sizing: border-box;
}

/* 页面底部 - 确保在内容区域内 */
.page-footer {
    position: relative;
    bottom: auto;
    left: auto;
    width: 100%;
    z-index: 20;
    padding: 0 20px 20px; /* 添加底部padding */
    background: transparent;
    margin-top: 2px;
}

.qr-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 减小间距从12px到8px */
    max-width: 80vw; /* 减小最大宽度从85vw到80vw */
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 12px; /* 减小内边距从8px 15px到6px 12px */
    border-radius: 6px; /* 减小圆角从8px到6px */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-code {
    max-width: 15vw;
    min-width: 50px;
    flex-shrink: 0;
    order: 1;
}

.qr-text {
    max-width: 60vw;
    min-width: 150px;
    flex-shrink: 0;
    order: 2;
}

/* ==========================================================================
   活动明细页面样式
   ========================================================================== */

.details-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    background-color: #000; /* 确保背景为黑色 */
}

.details-image {
    width: 100%;
    height: auto;
}

.back-btn-container {
    position: absolute;
    top: 85px;
    left: 0px;
    z-index: 10;
}

.back-btn {
    max-width: 20vw;
    min-width: 80px;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

/* 平板设备 */
@media screen and (max-width: 768px) {
    .title-container {
        margin-top: 10vh;
    }
    
    .participate-btn-container {
        margin-top: 18vh;
        max-width: 50vw; /* 从65vw减小到50vw */
    }
    
    .prize-info-container {
        margin-top: 2vh;
        margin-bottom: 0; /* 移除底部间距 */
    }
    
    .page-footer {
        position: relative; /* 确保在响应式设计中也是relative */
        bottom: auto;
        margin-top: 15px; /* 调整间距 */
        padding: 15px;
    }
    
    .qr-section {
        gap: 6px; /* 平板设备减小间距 */
        padding: 5px 10px; /* 减小内边距 */
        max-width: 85vw;
    }
}

/* 手机设备 */
@media screen and (max-width: 480px) {
    .title-container {
        margin-top: 8vh;
    }
    
    .participate-btn-container {
        margin-top: 2vh;
        max-width: 48vw; /* 从70vw减小到55vw */
    }
    
    .prize-info-container {
        margin-top: 1.5vh;
        margin-bottom: 0; /* 移除底部间距 */
    }
    
    .page-footer {
        position: relative; /* 确保在响应式设计中也是relative */
        bottom: auto;
        margin-top: 10px; /* 调整间距 */
        padding: 10px;
    }
    
    .qr-section {
        padding: 5px 8px; /* 进一步减小内边距 */
        max-width: 88vw; /* 稍微调整最大宽度 */
        gap: 5px; /* 减小间距 */
    }
}

/* 超小屏幕设备 */
@media screen and (max-width: 320px) {
    .participate-btn-container {
        max-width: 60vw; /* 从75vw减小到60vw */
    }
    
    .prize-info-container {
        margin-bottom: 0; /* 移除底部间距 */
    }
    
    .qr-section {
        flex-direction: column;
        gap: 4px; /* 减小垂直间距 */
        padding: 4px 8px; /* 进一步减小内边距 */
    }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .title-container {
        margin-top: 5vh;
    }
    
    .participate-btn-container {
        margin-top: 15vh;
    }
    
    .prize-info-container {
        margin-top: 3vh;
    }
    
    .page-footer {
        position: relative; /* 确保在横屏时也是relative */
        bottom: auto;
        margin-top: 10px;
    }
}