/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.4;
    color: #333;
    background-color: #f4f4f4;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* 背景容器 */
.background-container {
    position: relative;
    min-height: 200vh; /* 确保容器高度足够容纳两个视口高度 */
}

.background-image {
    position: fixed;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

#image1 {
    background-image: url('images/page_summary_2.webp');
    top: 0;
}

#image2 {
    background-image: url('images/page_wealth.webp');
    opacity: 0; /* 初始设为透明，滚动时会显示 */
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

section {
    margin-bottom: 3rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

/* 比赛信息部分 */
.race-info {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding-bottom: 120px; /* 调整内容位置 */
    margin-top: 7px; /* 添加顶部边距使内容向下移动 */
}

.race-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.race-image img {
    width: 100%;
    display: block;
}

.race-details {
    width: 100%;
    background: rgba(0, 0, 0, 0.4); /* 增加背景透明度 */
    color: white;
    padding: 0.3rem 0.6rem; /* 进一步减小内边距 */
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0px 3px; /* 再减小列间距 */
    backdrop-filter: blur(3px); /* 添加模糊效果 */
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9); /* 加深文字阴影，添加双重阴影 */
    border-left: 3px solid #e5c86a; /* 添加金色边框 */
}

.race-item {
    font-size: 1.1rem; /* 进一步减小字体大小 */
    font-weight: 600; /* 增加字体粗细 */
    letter-spacing: 0; /* 移除字符间距 */
    padding: 0.1rem 0.2rem; /* 减小内边距 */
    background-color: transparent;
    border-radius: 0;
    text-align: left;
    margin-bottom: 0;
    line-height: 1.2;
    display: inline-flex; /* 改为内联弹性布局 */
    align-items: center;
    position: relative; /* 用于添加效果 */
    white-space: nowrap; /* 防止文本换行 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 1); /* 加深文字阴影 */
}

/* 添加特定针对"淘汰或"和"万撤离"的样式 */
.race-item span + span {
    margin-left: 1px; /* 进一步减小间距 */
}

.race-item::before {
    content: '';
    position: absolute;
    left: -8px; /* 调整左边距 */
    width: 2px; /* 减小宽度 */
    height: 70%;
    background-color: rgba(229, 200, 106, 0.5); /* 金色透明边线 */
    display: none; /* 默认隐藏 */
}

.race-item:hover::before {
    display: block; /* 悬停时显示 */
}

.race-number {
    color: #f0d070; /* 使用更亮的金色 */
    font-size: 1.3rem; /* 调整字体大小 */
    font-weight: 700;
    margin-right: 2px; /* 减小右边距 */
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 12px rgba(240, 208, 112, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 4px rgba(240, 208, 112, 1); /* 增强发光效果和阴影 */
}

.distance-number {
    color: #f0d070; /* 使用更亮的金色 */
    font-size: 1.2rem; /* 调整字体大小 */
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 12px rgba(240, 208, 112, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 4px rgba(240, 208, 112, 1); /* 增强发光效果和阴影 */
    margin: 0 1px; /* 减小间距 */
}

/* 任务列表部分 */
.task-list h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.task-list h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #e5c86a;
}

.task-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task-image img {
    width: 100%;
    display: block;
}

.tasks {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.4); /* 增加背景透明度 */
    padding: 1.5rem;
    backdrop-filter: blur(3px);
    border-left: 3px solid #e5c86a;
}

.task-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.task-item {
    background: transparent;
    border-radius: 0;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: none;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.task-item:hover {
    transform: translateX(5px);
    border-left: 2px solid #e5c86a;
    background: transparent;
}

.task-item h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9); /* 加深文字阴影 */
    font-size: 1.3rem;
    font-weight: 600; /* 增加字体粗细 */
}

.task-item p {
    color: rgba(255, 255, 255, 0.95); /* 增加文字不透明度 */
    margin-bottom: 0;
    font-size: 1rem;
    flex: 1;
    padding-right: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); /* 添加文字阴影 */
    font-weight: 500; /* 增加字体粗细 */
}

.task-item p span {
    color: #f0d070; /* 使用更亮的金色 */
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(240, 208, 112, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 4px rgba(240, 208, 112, 1); /* 增强发光效果和阴影 */
}

.task-btn {
    background-image: url('images/btn_style_1.webp');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    color: white;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, filter 0.3s;
    min-width: 80px;
    min-height: 36px;
    filter: drop-shadow(0 0 8px rgba(229, 200, 106, 0.5));
    font-size: 0.9rem;
}

.task-btn:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(229, 200, 106, 0.7));
}

/* 报名按钮 */
#register-btn {
    background-image: url('images/btn_style_1.webp');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    color: white;
    border: none;
    padding: 12px 40px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 30px; /* 增加与列表的距离 */
    align-self: center;
    transition: transform 0.2s, filter 0.3s;
    box-shadow: none;
    min-width: 150px;
    min-height: 50px;
    filter: drop-shadow(0 0 10px rgba(229, 200, 106, 0.5)); /* 添加金色发光效果 */
}

#register-btn:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(229, 200, 106, 0.7)); /* 增强发光效果 */
}

/* 活动规则按钮 */
#rules-btn {
    position: fixed;
    right: 0;
    top: 15%; /* 往上移动 */
    transform: translateY(-50%);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    width: 24px; /* 控制宽度 */
}

#rules-btn img {
    max-width: 100%;
    height: auto;
    display: block;
}

#rules-btn:hover {
    transform: translateY(-50%) translateX(-5px);
    filter: drop-shadow(0 0 15px rgba(229, 200, 106, 0.6));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .race-details {
        flex-direction: column;
        align-items: center;
    }
    
    .race-item {
        margin-bottom: 0.5rem;
    }
    
    .tasks {
        position: relative;
        background: transparent;
    }
    
    .task-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .task-item p {
        margin-right: 8px;
        margin-bottom: 0;
    }
}

/* 规则弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    width: auto;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 规则弹窗标题 */
.modal-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #e5c86a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.modal-background {
    width: 100%;
    height: auto;
    max-width: 600px;
    position: relative;
}

/* 移除关闭按钮样式 */
.modal-close {
    display: none;
}

.modal-body {
    position: absolute;
    top: 12%; /* 调整位置 */
    left: 1%; /* 调整左边距 */
    right: 1%; /* 调整右边距 */
    height: 74%; /* 设置高度 */
    overflow-y: auto;
    padding: 10px 20px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-body h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e5c86a;
}

.rules-content {
    font-size: 0.9rem; /* 减小字体大小 */
    line-height: 1.4;
}

.rules-content p {
    margin-bottom: 0.5rem;
}

.rules-content strong {
    color: #e5c86a;
    font-weight: 700;
}

.modal-footer {
    position: relative; /* 改为相对定位 */
    margin-top: 20px; /* 在图片下方添加间距 */
    display: flex;
    justify-content: center;
}

/* 规则弹窗的确定按钮 */
#rules-modal .modal-footer {
    position: relative; /* 确保为相对定位 */
    bottom: auto; /* 移除绝对定位的底部值 */
    left: auto;
    right: auto;
    margin-top: 20px; /* 在图片下方添加间距 */
}

#confirm-btn, #ticket-confirm-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

#confirm-btn img, #ticket-confirm-btn img {
    max-width: 120px;
    height: auto;
}

#confirm-btn span, #ticket-confirm-btn span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#confirm-btn:hover, #ticket-confirm-btn:hover {
    transform: scale(1.05);
}

/* 显示弹窗时禁止滚动 */
body.modal-open {
    overflow: hidden;
}

/* 门票不足弹窗特殊样式 */
#ticket-modal .modal-footer {
    position: absolute; /* 保持门票弹窗的绝对定位 */
    bottom: 2%; /* 将按钮位置调得更低 */
    left: 0;
    right: 0;
    margin-top: 0; /* 移除上边距 */
}

#ticket-modal h3 {
    margin-bottom: 0.5rem; /* 减少标题下方间距 */
    font-size: 1.4rem; /* 增大标题文字 */
    color: #000000; /* 将标题颜色改为黑色 */
    text-align: left; /* 文字靠左显示 */
    padding-left: 10px; /* 添加左侧内边距 */
    position: absolute; /* 绝对定位 */
    top: -20px; /* 向上移动标题位置，从-5px改为-20px */
    left: -3px; /* 更靠左一些 */
}

#ticket-modal .rules-content {
    text-align: center; /* 将内容居中显示 */
    font-size: 1.1rem;
    position: static; /* 确保内容不会滚动 */
    padding-left: 0; /* 移除左侧内边距 */
    margin-top: 20px; /* 为标题腾出空间 */
    overflow: visible; /* 确保内容不被裁剪 */
}

#ticket-modal .rules-content p {
    color: #000000; /* 将文字颜色改为黑色 */
    text-shadow: none; /* 移除文字阴影 */
    white-space: normal; /* 允许文字换行，解决文字裁剪问题 */
    overflow: visible; /* 确保文字可见 */
    text-align: center; /* 确保段落文字居中 */
}

#ticket-confirm-btn {
    margin-top: 30px; /* 增加与上方内容的距离 */
}

#ticket-confirm-btn span {
    white-space: nowrap; /* 防止文字换行 */
    min-width: 80px; /* 确保按钮宽度足够 */
}

/* 添加门票弹窗特定样式 */
#ticket-modal .modal-body {
    height: auto; /* 自动调整高度 */
    max-height: 80%; /* 最大高度限制 */
    overflow-y: visible; /* 允许内容溢出可见 */
} 