/* CSS Reset and Basic Styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* 夜空背景 */
    font-family: "LXGW WenKai Screen", sans-serif;
    overflow: hidden;
}

/* 星空背景样式 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 5s infinite ease-in-out alternate;
}

/* 星星尺寸与分布 */
.star1 {
    width: 1px; height: 1px;
    box-shadow: 
        50px 100px #fff, 120px 200px #fff, 200px 50px #fff, 300px 250px #fff, 400px 150px #fff,
        550px 300px #fff, 680px 180px #fff, 750px 70px #fff, 880px 220px #fff, 950px 350px #fff,
        100px 400px #fff, 250px 480px #fff, 380px 350px #fff, 490px 500px #fff, 600px 420px #fff,
        700px 550px #fff, 820px 470px #fff, 900px 600px #fff, 150px 650px #fff, 280px 700px #fff,
        420px 750px #fff, 550px 680px #fff, 680px 800px #fff, 790px 720px #fff, 920px 850px #fff,
        50px 900px #fff, 180px 950px #fff, 300px 880px #fff, 450px 920px #fff, 580px 980px #fff;
    animation-duration: 6s;
    opacity: 0.8;
}

.star2 {
    width: 2px; height: 2px;
    box-shadow: 
        30px 300px #fff, 150px 100px #fff, 250px 400px #fff, 350px 150px #fff, 450px 300px #fff,
        500px 100px #fff, 600px 450px #fff, 700px 200px #fff, 800px 500px #fff, 900px 250px #fff,
        50px 700px #fff, 180px 550px #fff, 280px 800px #fff, 380px 650px #fff, 480px 900px #fff,
        580px 750px #fff, 680px 950px #fff, 780px 850px #fff, 880px 700px #fff, 980px 600px #fff;
    animation-duration: 4s;
    opacity: 0.9;
}

.star3 {
    width: 3px; height: 3px;
    box-shadow: 
        80px 80px #fff, 180px 300px #fff, 280px 120px #fff, 380px 450px #fff, 480px 250px #fff,
        580px 60px #fff, 680px 380px #fff, 780px 180px #fff, 880px 480px #fff, 980px 300px #fff;
    animation-duration: 7s;
    opacity: 1;
}

@keyframes twinkle {
    0% { opacity: 0.8; }
    50% { opacity: 0.2; transform: scale(0.9); }
    100% { opacity: 0.8; transform: scale(1); }
}

/* 字体与文本样式 */
h1, h2 {
    font-family: 'ZCOOL KuaiLe', sans-serif;
    font-size: 4.5em;
    font-weight: 400;
    letter-spacing: 5px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 215, 100, 0.5), 0 0 8px rgba(255, 255, 255, 0.3);
    margin: 0;
    animation-delay: 0.2s;
}

#page1 h1 + p {
    font-family: 'LXGW WenKai Screen', sans-serif;
    font-size: 1.3em;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
    animation-delay: 0.6s;
}

.page small {
    display: block;
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.6em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    letter-spacing: 2px;
    margin-top: 25px;
    padding: 0;
    white-space: normal;
    max-width: 90%;
    line-height: 1.6;
    animation: fadeIn 1.5s 0.4s forwards;
    opacity: 0;
}

.page p {
    font-family: "LXGW WenKai Screen", sans-serif;
    font-size: 1.15em;
    max-width: 90%;
    line-height: 2.4;
    margin-top: 35px;
    animation-delay: 0.8s;
}

/* 页面容器样式 */
.h5-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll; 
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.h5-container::-webkit-scrollbar {
    display: none;
}

.page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    box-sizing: border-box;
    color: white;
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: linear-gradient(160deg, rgba(13, 27, 42, 0.8), rgba(27, 38, 59, 0.8), rgba(65, 90, 119, 0.8));
}

/* 页面背景差异化 */
#page1 { background: linear-gradient(160deg, rgba(13, 27, 42, 0.8), rgba(27, 38, 59, 0.8), rgba(65, 90, 119, 0.8)); }
#page2 { background: linear-gradient(160deg, rgba(26, 26, 46, 0.8), rgba(40, 40, 70, 0.8)); }
#page3 { background: linear-gradient(160deg, rgba(10, 20, 40, 0.8), rgba(20, 40, 80, 0.8)); }
#page4 { background: linear-gradient(160deg, rgba(50, 40, 30, 0.8), rgba(80, 60, 40, 0.8)); }
#page5 { background: linear-gradient(160deg, rgba(20, 50, 50, 0.8), rgba(40, 80, 80, 0.8)); }
#page6 { background: linear-gradient(160deg, rgba(98, 45, 98, 0.8), rgba(44, 62, 80, 0.8)); }
#page7 { background: linear-gradient(160deg, rgba(17, 17, 17, 0.9), rgba(50, 50, 50, 0.9)); }

.page:last-child {
    cursor: default;
}

/* 元素淡入动画 */
.page h1, .page h2, .page small, .page p, .page .credits-list, .replay-button, .entry-info {
    opacity: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    animation: fadeIn 1.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 数学符号样式 */
.math-symbol {
    font-family: 'Times New Roman', serif;
    font-size: 1.2em;
    color: #ffc107;
    margin: 0 4px;
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    display: block;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* 参赛信息样式 */
.entry-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    animation: fadeIn 1.5s 1s forwards;
    opacity: 0;
    margin-top: 100px;
}

.entry-info p {
    margin: 4px 0;
    text-align: center;
    font-size: 1em;
    line-height: 1.5;
}

.final-statement {
    margin-top: 40px;
    font-size: 1.3em;
    letter-spacing: 1px;
    animation: fadeIn 1.5s 1s forwards;
    opacity: 0;
    font-family: "LXGW WenKai Screen", sans-serif;
}

/* 鸣谢页样式 */
#page7 h2 {
    font-size: 3em;
    animation-delay: 0.2s; 
    color: #ddd; 
    margin-bottom: 20px;
}

.credits-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    animation-delay: 0.6s;
}

.credits-list li {
    font-size: 1.1em;
    color: #ccc;
    line-height: 2.2;
}

.credits-list .role {
    font-size: 0.9em;
    color: #888;
    display: block;
}

.replay-button {
    margin-top: 40px;
    padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-family: "LXGW WenKai Screen", sans-serif;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    animation-delay: 1s;
}

.replay-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #111;
}

/* 响应式适配 */
@media (max-width: 768px) {
    h1, h2 { 
        font-size: 2.6em;
        letter-spacing: 2px;
    }
    #page1 h1 + p {
        font-size: 1.1em;
    }
    .page small {
        font-size: 1.3em;
        letter-spacing: 1.5px;
        margin-top: 15px;
        line-height: 1.7;
    }
    .page p { 
        font-size: 1em;
        line-height: 2.3; 
        margin-top: 30px;
    }
    .entry-info { 
        font-size: 0.8em; 
        margin-top: 60px;
    }
    .final-statement { 
        font-size: 1.1em; 
        margin-top: 30px; 
    }
    #page7 h2 { 
        font-size: 2.4em; 
    }
    .credits-list li { 
        font-size: 1em; 
    }
    .replay-button {
        font-size: 1em;
        padding: 8px 20px;
        margin-top: 35px;
    }
}