@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
    --primary-color: #ff69b4;
    --secondary-color: #ff1493;
    --text-color: #fff;
    --bg-dark: #000;
    --animation-duration: 0.8s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --title-font: 'Dancing Script', 'Ma Shan Zheng', cursive;
    --text-font: 'Noto Serif SC', serif;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Roboto', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-control button {
    width: 50px;
    height: 50px;
    background: rgba(255, 105, 180, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.2);
}

.music-control button:hover {
    background: rgba(255, 105, 180, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
}

.music-control button:active {
    transform: scale(0.95);
}

.container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.page {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    transform: translateY(20px);
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.page.active {
    opacity: 1;
    transform: translateY(0);
}

.fireworks {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.firework-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    transform: translateZ(0);
    opacity: 0.8;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 768px) {
    :root {
        --animation-duration: 0.5s;
    }

    .title {
        font-size: clamp(2em, 8vw, 3em);
    }

    .subtitle {
        font-size: clamp(1em, 4vw, 1.5em);
    }

    .page2 .number {
        font-size: 3.5em;
    }

    .message p {
        font-size: clamp(1.2em, 5vw, 1.8em);
    }

    .highlight {
        font-size: 2em !important;
    }

    .cake {
        font-size: 50px;
    }

    button {
        padding: 12px 24px;
        font-size: 1.2em;
    }
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.page {
    position: relative;
    overflow: hidden;
}

.page1 { 
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%),
                radial-gradient(circle at top right, rgba(255, 105, 180, 0.3), transparent 50%);
    background-blend-mode: overlay;
}

.page2 { 
    background: linear-gradient(135deg, #2c1a4d 0%, #000000 100%),
                radial-gradient(circle at center left, rgba(255, 105, 180, 0.2), transparent 60%);
    background-blend-mode: overlay;
}

.page3 { 
    background: linear-gradient(135deg, #4a1a4d 0%, #000000 100%),
                radial-gradient(circle at bottom right, rgba(255, 105, 180, 0.25), transparent 55%);
    background-blend-mode: overlay;
}

.page4 { 
    background: linear-gradient(135deg, #1a4d4d 0%, #000000 100%),
                radial-gradient(circle at top left, rgba(255, 105, 180, 0.2), transparent 50%);
    background-blend-mode: overlay;
}

.page5 { 
    background: linear-gradient(135deg, #4d1a1a 0%, #000000 100%),
                radial-gradient(circle at center, rgba(255, 105, 180, 0.3), transparent 70%);
    background-blend-mode: overlay;
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(255, 255, 255, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.page.active::before {
    opacity: 1;
}

.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 50px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.1);
    width: 80%;
    max-width: 800px;
    z-index: 1;
    text-align: center;
}

.page.active .content {
    animation: contentFadeIn 1s var(--transition-timing) forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.title, .subtitle, .number, .text, .description {
    transition: transform 0.5s ease-out;
    position: relative;
}

.page.active .title { transform: translate3d(0, 0, 50px); }
.page.active .subtitle { transform: translate3d(0, 0, 30px); }
.page.active .number { transform: translate3d(0, 0, 40px); }
.page.active .text { transform: translate3d(0, 0, 20px); }
.page.active .description { transform: translate3d(0, 0, 25px); }

.page1 {
    background: linear-gradient(45deg, #1a1a1a, #000);
}

.title {
    font-size: clamp(3em, 8vw, 5em);
    margin-bottom: 30px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--title-font);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: titleFloat 3s ease-in-out infinite;
    width: 100%;
    text-align: center;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: clamp(1.3em, 3.5vw, 2em);
    color: #fff;
    opacity: 0.9;
    font-family: var(--text-font);
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0 0 80px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

@keyframes floatArrow {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-8px);
        opacity: 0.8;
    }
}

.page1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.page2 {
    background: linear-gradient(45deg, #2c1a4d, #000);
}

.page2 .number {
    font-size: clamp(4em, 12vw, 8em);
    font-family: var(--title-font);
    font-weight: 700;
    background: linear-gradient(45deg, #ff69b4, #ff1493);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.page3 {
    background: linear-gradient(45deg, #4a1a4d, #000);
}

.hearts-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.heart {
    position: relative;
    font-size: 66px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.heart:nth-child(2) {
    animation-delay: 0.2s;
}

.heart:nth-child(3) {
    animation-delay: 0.4s;
}

.page4 {
    background: linear-gradient(45deg, #1a4d4d, #000);
}

.message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.message p {
    font-family: var(--text-font);
    font-size: clamp(1.5em, 4vw, 2.5em);
    margin: 10px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s var(--transition-timing);
    letter-spacing: 2px;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    width: 100%;
    text-align: center;
}

.message p.show {
    opacity: 1;
    transform: translateY(0);
}

.message p.highlight {
    font-family: var(--title-font);
    font-size: clamp(2em, 6vw, 3.5em);
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 3px 3px 6px rgba(255, 105, 180, 0.3);
}

.page5 {
    background: linear-gradient(45deg, #4d1a1a, #000);
}

.cake {
    position: relative;
    font-size: 80px;
    animation: cakeFloat 3s ease-in-out infinite;
}

@keyframes cakeFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.final-message p {
    font-family: var(--text-font);
    font-size: clamp(1.3em, 3.5vw, 2em);
    margin: 15px 0;
    line-height: 1.8;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s var(--transition-timing) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.final-message p:nth-child(1) { animation-delay: 0.3s; }
.final-message p:nth-child(2) { animation-delay: 0.6s; }
.final-message p:nth-child(3) { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#surpriseBtn {
    margin: 0 auto;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.5em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
}

#surpriseBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.5);
}

#surpriseBtn:active {
    transform: translateY(1px);
}

#surpriseBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

#surpriseBtn:hover::before {
    left: 100%;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-30px);
    }
    60% {
        transform: translateX(-50%) translateY(-15px);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0);
        will-change: transform;
    }
    50% { 
        transform: translateY(-20px);
        will-change: transform;
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat {
    margin-top: 30px;
}

.stat .number {
    font-size: 5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.final-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.final-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    margin: 30px 0;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #000000);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #000;
        --text-color: #fff;
    }
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.sparkle {
    position: absolute;
    background: white;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 1.5s infinite;
}

@keyframes twinkle {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.loading-text {
    font-family: var(--text-font);
    font-size: 1.5em;
    color: var(--primary-color);
    position: relative;
}

.loading-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: loading 2s infinite;
}

@keyframes loading {
    0% { transform: scaleX(0); opacity: 0; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; }
}

.content:hover {
    transform: translate(-50%, -50%) scale(1.02);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .content {
        width: 90%;
        padding: 30px 20px;
        gap: 20px;
    }

    .cake {
        font-size: 60px;
    }

    .heart {
        font-size: 30px;
    }

    .hearts-container {
        gap: 20px;
    }

    .message {
        gap: 15px;
    }

    .final-message {
        gap: 15px;
        margin: 20px 0;
    }

    .scroll-hint {
        bottom: 25px;
        font-size: 1em;
        padding: 8px 16px;
    }
}

/* 添加新的样式 */
.number-wrapper {
    position: relative;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.highlight-text {
    font-family: var(--text-font);
    font-size: clamp(1.5em, 4vw, 2.2em);
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

.sub-text {
    font-size: clamp(1em, 2.5vw, 1.4em);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    font-family: var(--text-font);
}

.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-hint .arrow {
    font-size: 1.5em;
    animation: arrowBounce 2s infinite;
}

@keyframes arrowBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

/* 优化按钮样式 */
#surpriseBtn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    font-size: 1.2em;
    animation: sparkle 1.5s infinite;
}

/* 优化消息动画 */
.message p {
    transform: perspective(1000px) translateZ(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.message p.show {
    transform: perspective(1000px) translateZ(50px);
}

/* 优化心形动画 */
.hearts-container {
    perspective: 1000px;
}

.heart {
    transform-style: preserve-3d;
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* 优化最终页面样式 */
.final-message p {
    position: relative;
    padding: 10px;
}

.final-message p::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, 
                rgba(255, 105, 180, 0.1), 
                transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.final-message p:hover::before {
    opacity: 1;
}

/* 优化描述文本样式 */
.description {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes arrowBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .scroll-hint {
        bottom: 20px;
        font-size: 0.8em;
    }

    .subtitle {
        font-size: clamp(1.1em, 3vw, 1.6em);
        margin-bottom: 30px;
    }

    .page1 .content {
        padding-bottom: 60px;
    }
}