* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    width: 100vw;
    position: fixed;
    touch-action: none;
}

/* 页面容器 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.page.active {
    display: flex;
    opacity: 1;
}

.content {
    text-align: center;
    z-index: 10;
    padding: 20px;
    max-width: 90%;
}

/* 爱心容器 */
.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.heart {
    position: absolute;
    font-size: 20px;
    animation: floatHeart 4s linear;
    pointer-events: none;
    user-select: none;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 点击爱心效果 */
.click-heart {
    position: absolute;
    font-size: 30px;
    pointer-events: none;
    animation: clickHeartAnimation 1s ease-out forwards;
    user-select: none;
}

@keyframes clickHeartAnimation {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100px) scale(1);
        opacity: 0;
    }
}

/* 文字样式 */
h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: white;
    margin: 10px 0;
}

p {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    margin: 15px 0;
}

/* 按钮样式 */
.btn {
    padding: 15px 40px;
    font-size: clamp(1rem, 4vw, 1.3rem);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    margin: 20px 10px;
    touch-action: manipulation;
}

.btn:hover, .btn:active {
    background: white;
    color: #764ba2;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 1s ease-in;
}

.delay-1 {
    animation-delay: 0.5s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.delay-2 {
    animation-delay: 1s;
    opacity: 0;
    animation-fill-mode: forwards;
}

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

/* 页面2: 倒计时样式 */
.countdown-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    margin: 20px 0;
}

.days {
    font-size: clamp(4rem, 15vw, 8rem);
    color: #FFD700;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: pulse 2s infinite;
    margin: 20px 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.date-text {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #FFD700;
    margin: 15px 0;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-style: italic;
}

.heart-beat {
    font-size: clamp(3rem, 10vw, 5rem);
    animation: heartBeat 1.5s infinite;
    margin: 20px 0;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
}

/* 页面3: 打字机效果 */
.letter-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    min-height: 200px;
    max-width: 600px;
    margin: 0 auto;
}

.typing-text {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: white;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: white;
    margin-left: 2px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 页面4: 愿望清单 */
.wish-title {
    margin-bottom: 30px;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
}

.wish-list {
    max-width: 500px;
    margin: 0 auto 30px;
}

.wish-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    animation: slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.wish-item:nth-child(1) { animation-delay: 0.1s; }
.wish-item:nth-child(2) { animation-delay: 0.2s; }
.wish-item:nth-child(3) { animation-delay: 0.3s; }
.wish-item:nth-child(4) { animation-delay: 0.4s; }
.wish-item:nth-child(5) { animation-delay: 0.5s; }
.wish-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wish-item:hover, .wish-item:active {
    transform: translateX(10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.wish-heart {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-right: 15px;
    animation: heartBeat 1.5s infinite;
}

.wish-text {
    font-size: clamp(1rem, 4vw, 1.3rem);
    color: white;
    flex: 1;
    text-align: left;
}

/* 页面5: 最终表白 */
.final-question {
    margin: 20px 0;
    animation: fadeIn 1s ease-in;
}

.button-group {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-yes {
    background: linear-gradient(45deg, #ff6b6b, #ee5a6f);
    border: none;
    font-weight: bold;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
}

.btn-yes:hover, .btn-yes:active {
    background: linear-gradient(45deg, #ff5252, #f44336);
    transform: scale(1.1);
}

.btn-no {
    position: relative;
    transition: all 0.3s;
}

.celebration {
    margin-top: 30px;
}

.celebration-text {
    font-size: clamp(2.5rem, 8vw, 4rem);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.celebration-sub {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-top: 20px;
}

/* 烟花效果 */
.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: fireworkAnimation 1s ease-out forwards;
}

@keyframes fireworkAnimation {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* 音乐控制 */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s;
    font-size: 24px;
    touch-action: manipulation;
}

.music-control:hover, .music-control:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .content {
        padding: 15px;
    }

    .countdown-box {
        padding: 30px 20px;
    }

    .letter-box {
        padding: 20px;
    }

    .wish-item {
        padding: 12px 15px;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 80%;
        max-width: 300px;
    }
}

/* 菜单样式 */
.menu-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    color: white;
    margin-bottom: 30px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
}

.menu-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.menu-card:hover, .menu-card:active {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.menu-icon {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    margin-bottom: 10px;
}

.menu-card h3 {
    font-size: clamp(1rem, 4vw, 1.3rem);
    color: white;
    margin: 10px 0 5px;
}

.menu-card p {
    font-size: clamp(0.8rem, 3vw, 1rem);
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* 游戏样式 */
.game-score, .game-timer, .game-hint {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: white;
    margin: 10px 0;
}

/* 游戏1: 点击爱心 */
.game-area {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 20px auto;
    backdrop-filter: blur(10px);
}

.game-heart {
    position: absolute;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.2s;
    animation: heartPop 0.3s ease-out;
}

.game-heart:hover, .game-heart:active {
    transform: scale(1.3);
}

@keyframes heartPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 游戏2: 记忆翻牌 */
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 20px auto;
}

.memory-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.memory-card:hover, .memory-card:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.memory-card.flipped {
    background: rgba(255, 255, 255, 0.4);
    transform: rotateY(180deg);
}

.memory-card.matched {
    background: rgba(76, 217, 100, 0.5);
    pointer-events: none;
}

.card-back {
    font-size: 2rem;
    color: white;
}

/* 游戏3: 接爱心 */
#catchGame {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin: 20px auto;
    display: block;
    max-width: 100%;
    touch-action: none;
}

/* 游戏4: 拼图 */
.puzzle-game {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-width: 350px;
    margin: 20px auto;
}

.puzzle-tile {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.puzzle-tile:hover, .puzzle-tile:active {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.puzzle-tile.empty {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    cursor: default;
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 500px) {
    h1 {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .countdown-box {
        padding: 20px;
    }

    .days {
        font-size: 4rem;
        margin: 10px 0;
    }

    .heart-beat {
        font-size: 2rem;
        margin: 10px 0;
    }

    .btn {
        padding: 10px 30px;
        margin: 10px 5px;
    }

    .game-area, .memory-game, .puzzle-game {
        max-width: 300px;
        height: 300px;
    }

    #catchGame {
        height: 300px;
    }
}
