* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
}

.container {
    position: relative;
    height: 100vh;
    transition: transform 0.8s ease-in-out;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.page-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.page-content {
    position: relative;
    height: 100%;
    width: 100%;
}

.foreground {
    position: absolute;
    cursor: pointer;
}

.foreground img {
    max-width: 100%;
    height: auto;
    max-height: 80vh;
}

/* Page 1 */
#page1 .page-bg {
    background-image: url('../images/p1-g.png');
}

#page1 .fg1 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: shakeIn 1s ease forwards;
}

@keyframes shakeIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    90% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Page 2 */
#page2 .page-bg {
    background-image: url('../images/p2-g.png');
}

#page2 .fg1 {
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    transition: top 1s ease, transform 1s ease;
}

#page2 .fg2 {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    transition: top 1s ease, transform 1s ease;
}

#page2.active .fg1 {
    top: 20%;
    transform: translateX(-50%) scale(1.2);
}

#page2.active .fg2 {
    top: 40%;
    transform: translateX(-50%) scale(0.3);
}

/* Page 3 */
#page3 .page-bg {
    background-image: url('../images/p3-g.png');
}

#page3 .fg1 {
    left: -100%;
    top: 20%;
    transform: translateX(-50%);
    transition: left 1s ease;
}

#page3 .fg2 {
    left: 200%;
    top: 40%;
    transform: translateX(-50%);
    transition: left 1s ease, transform 1s ease;
}

#page3 .fg3 {
    left: 200%;
    top: 60%;
    transform: translateX(-50%);
    transition: left 1s ease, transform 1s ease;
}

#page3.active .fg1 {
    left: 50%;
}

#page3.active .fg2 {
    left: 50%;
    transform: translateX(-50%) scale(0.5);
}

#page3.active .fg3 {
    left: 50%;
    transform: translateX(-50%) scale(0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Page 1 mobile */
    #page1 .page-bg {
        background-image: url('../images/m-p1-g.png');
    }
    
    #page1 .fg1 img {
        content: url('../images/m-p1-f.png');
    }
    
    /* Page 2 mobile */
    #page2 .page-bg {
        background-image: url('../images/m-p2-g.png');
    }
    
    #page2 .fg1 img {
        content: url('../images/m-p2-f1.png');
    }
    
    #page2 .fg2 img {
        content: url('../images/m-p2-f2.png');
    }
    
    /* 手机版第二页前景2位置调整 */
    #page2.active .fg2 {
        top: 60%;
    }
    
    /* Page 3 mobile */
    #page3 .page-bg {
        background-image: url('../images/m-p3-g.png');
    }
    
    #page3 .fg1 img {
        content: url('../images/m-p3-f1.png');
    }
    
    #page3 .fg2 img {
        content: url('../images/m-p3-f2.png');
    }
    
    #page3 .fg3 img {
        content: url('../images/m-p3-f3.png');
    }
    
    /* Responsive adjustments */
    .foreground img {
        max-width: 80%;
        height: auto;
    }
}