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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    background-size: 100% 100%;
    min-height: 100vh;
    position: relative;
}

/* 星星背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 流星 */
.meteors {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.meteor {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to top, rgba(255,255,255,0.8), rgba(255,255,255,0));
    border-radius: 50%;
    animation: meteorFall linear infinite;
}

.meteor::before {
    content: '';
    position: absolute;
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 15px 3px rgba(255,255,255,0.8);
}

@keyframes meteorFall {
    0% {
        transform: rotate(45deg) translate(0, 0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) translate(500px, 500px);
        opacity: 0;
    }
}

/* 进度点 */
.progress-dots {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.dot:hover {
    background: rgba(255,255,255,0.7);
}

/* 倒计时 */
.countdown-timer {
    position: relative;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(15px);
    padding: 12px 20px;
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.countdown-timer:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.countdown-timer .time-unit {
    display: inline-block;
    min-width: 25px;
    text-align: center;
}

.countdown-timer .time-separator {
    color: rgba(255,255,255,0.6);
    animation: separatorPulse 1s ease infinite;
}

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

.countdown-timer .time-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.countdown-timer .time-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

/* 打字效果 */
.typing-container {
    margin: 20px 0;
    min-height: 60px;
}

.typing-text {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    display: inline;
}

.cursor {
    color: white;
    animation: blink 0.7s infinite;
}

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

/* 浮动爱心 */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    font-size: 2rem;
    animation: floatUp 4s ease-in infinite;
    opacity: 0.7;
    bottom: -50px;
}

.floating-heart {
    position: absolute;
    font-size: 2rem;
    animation: floatUp 4s ease-in infinite;
    opacity: 0.6;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* 多蜡烛 */
.candle-container {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
    z-index: 5;
}

.candle-2 {
    position: relative;
    left: auto;
    transform: none;
}

.candle-3 {
    position: relative;
    left: auto;
    transform: none;
}

/* 蛋糕层 */
.cake {
    position: relative;
    width: 200px;
    margin-top: 10px;
}

.layer {
    width: 200px;
    height: 60px;
    background: linear-gradient(to right, #f8c8dc, #f4a7d4, #f8c8dc);
    border-radius: 10px;
    position: relative;
    margin-bottom: 10px;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.1);
}

.layer-2 {
    width: 170px;
    margin-left: 15px;
}

/* 吹蜡烛提示 */
.blow-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1rem;
    animation: pulseText 1.5s ease-in-out infinite;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.blow-text:hover {
    opacity: 1;
}

/* 熄灭的蜡烛 */
.candle.blown .flame {
    animation: blowOut 0.5s forwards;
}

@keyframes blowOut {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(2); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

/* 气球爆炸 */
.balloon.popped {
    animation: pop 0.3s forwards;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(0); opacity: 0; }
}

/* 礼物计数器 */
.gift-counter {
    color: white;
    font-size: 1rem;
    margin: 10px 0;
    opacity: 0.8;
}

/* 章节标题 */
.section-title {
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    animation: slideDown 0.8s ease;
}

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

/* 翻转卡片 */
.wish-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    min-width: 200px;
    animation: slideIn 0.5s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.cake {
    position: relative;
    width: 200px;
    height: 150px;
    display: flex;
    flex-direction: column-reverse;
}

.tap-hint {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 15px;
}

/* 分享按钮 */
/* 粒子画布 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 更多动画效果 */
.delay-4 { animation-delay: 1.2s; }

/* 气球爆炸音效触发点 */
.balloon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.balloon:active::before {
    opacity: 1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 第一屏样式 */
.welcome-text {
    text-align: center;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-text h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }
    to {
        text-shadow: 2px 2px 20px rgba(255,255,255,0.8);
    }
}

.name {
    color: #ffd700;
    font-size: 3.5rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.5rem;
    margin-top: 20px;
    opacity: 0.9;
}

.countdown-hint {
    font-size: 3rem;
    color: #ffd700;
    font-weight: bold;
    margin-top: 20px;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation: pulse 1s infinite;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }

/* 按钮样式 */
.btn-start, .btn-restart {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.btn-start:hover, .btn-restart:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

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

/* 蛋糕样式 */
.cake-container {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.candle {
    width: 12px;
    height: 60px;
    background: linear-gradient(to bottom, #ff6b6b, #c92a2a);
    position: absolute;
    left: 50%;
    top: -70px;
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
    animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
    from { transform: translateX(-50%) rotate(-2deg); }
    to { transform: translateX(-50%) rotate(2deg); }
}

.flame {
    width: 20px;
    height: 35px;
    background: radial-gradient(ellipse at center, #ffd93d 0%, #ff6b6b 70%, transparent 100%);
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flameFlicker 0.3s infinite alternate;
}

@keyframes flameFlicker {
    from {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.8;
    }
}

.cake {
    position: relative;
    width: 200px;
    height: 150px;
}

.layer {
    width: 200px;
    height: 60px;
    background: linear-gradient(to right, #f8c8dc, #f4a7d4, #f8c8dc);
    border-radius: 10px;
    position: relative;
    margin-bottom: 10px;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.1);
}

.layer-2 {
    width: 170px;
    margin-left: 15px;
}

.icing {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: white;
    border-radius: 10px 10px 50% 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cream {
    width: 15px;
    height: 30px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: -15px;
    z-index: 10;
    animation: creamDrop 2s ease-in-out infinite;
}

.cream-1 { left: 20px; animation-delay: 0s; }
.cream-2 { left: 50%; transform: translateX(-50%); animation-delay: 0.5s; }
.cream-3 { right: 20px; animation-delay: 1s; }

@keyframes creamDrop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

.wish-text {
    text-align: center;
    color: white;
}

.wish-text h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: bounce 1s infinite;
}

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

.wish-text p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.wish-text .btn-start {
    margin: 10px;
}

/* 气球样式 */
.balloons {
    display: none;
}

.balloon-1 { animation-delay: 0s; }
.balloon-2 { animation-delay: 0.5s; }
.balloon-3 { animation-delay: 1s; }
.balloon-4 { animation-delay: 1.5s; }
.balloon-5 { animation-delay: 2s; }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* 礼物样式 */
.gifts {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    position: relative;
    z-index: 5;
}

.gift {
    font-size: 5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: giftShake 0.5s ease infinite;
    user-select: none;
}

.gift:hover {
    transform: scale(1.2);
}

.gift.opened {
    animation: none;
    transform: scale(1);
}

@keyframes giftShake {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.gift-message {
    min-height: 80px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 祝福卡片 */
.wishes-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    max-width: 900px;
    flex-wrap: nowrap;
}

.wish-card:nth-child(1) { animation-delay: 0.2s; }
.wish-card:nth-child(2) { animation-delay: 0.4s; }
.wish-card:nth-child(3) { animation-delay: 0.6s; }

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

.wish-card .emoji {
    display: none;
}

.wish-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.wish-card p {
    font-size: 1.2rem;
    opacity: 0.95;
    line-height: 1.6;
    margin: 8px 0;
}

/* 最终页面 */
.final-message {
    text-align: center;
    color: white;
    position: relative;
    z-index: 5;
    padding: 0 20px;
}

.celebration-icon {
    display: none;
}

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

.final-message h1 {
    font-size: 3.5rem;
    margin: 30px 0;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.final-message p {
    font-size: 1.5rem;
    margin: 10px 0;
    opacity: 0.9;
}

.fireworks {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: firework 3s infinite;
    box-shadow: 0 0 10px currentColor;
}

@keyframes firework {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 音乐按钮 */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.music-btn:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.3);
}

.music-btn.playing {
    animation: musicPulse 1s infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}

/* 按钮禁用状态 */
.btn-start:disabled, .btn-start[style*="pointer-events: none"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .progress-dots {
        bottom: 15px;
    }

    .music-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .countdown-timer {
        padding: 8px 12px;
        font-size: 0.75rem;
        border-radius: 18px;
        margin-bottom: 15px;
        gap: 5px;
    }

    .countdown-timer .time-value {
        font-size: 0.85rem;
    }

    .typing-text {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .card-front, .card-back {
        padding: 30px 20px;
    }

    .wish-card .emoji {
        font-size: 3rem;
    }

    .wish-card h3 {
        font-size: 1.4rem;
    }

    .wish-card p {
        font-size: 1rem;
    }

    .share-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .candle-container {
        gap: 15px;
    }
    .welcome-text h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .name {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 1.1rem;
        margin-top: 15px;
    }

    .cake {
        width: 150px;
        height: 110px;
    }

    .layer {
        width: 150px;
        height: 45px;
    }

    .layer-2 {
        width: 125px;
    }

    .balloon {
        font-size: 3rem;
    }

    .balloons {
        gap: 15px;
    }

    .gift {
        font-size: 3.5rem;
    }

    .gifts {
        gap: 20px;
    }

    .wishes-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .wish-card {
        width: 100%;
        max-width: 280px;
        padding: 20px;
    }

    .final-message h1 {
        font-size: 2.2rem;
    }

    .final-message p {
        font-size: 1.1rem;
    }

    .btn-start, .btn-restart {
        padding: 12px 30px;
        font-size: 1rem;
        margin-top: 30px;
    }

    .countdown-hint {
        font-size: 2.5rem;
        margin-top: 15px;
    }

    .wish-text h2 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .wish-text p {
        font-size: 1rem;
    }

    .wish-text .btn-start {
        margin: 8px;
    }
}

@media (max-width: 480px) {
    .welcome-text {
        padding: 10px;
    }

    .welcome-text h1 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    .name {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .countdown-timer {
        padding: 6px 10px;
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .countdown-timer .time-value {
        font-size: 0.8rem;
    }

    .countdown-hint {
        font-size: 2rem;
        margin-top: 10px;
    }

    .progress-dots {
        bottom: 10px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .wish-card {
        padding: 15px;
        max-width: 260px;
    }

    .wish-card h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .wish-card p {
        font-size: 0.9rem;
        margin: 5px 0;
    }

    .final-message h1 {
        font-size: 1.8rem;
        margin: 20px 0;
    }

    .final-message p {
        font-size: 1rem;
    }

    .btn-start, .btn-restart {
        padding: 10px 25px;
        font-size: 0.9rem;
        margin-top: 25px;
    }

    .gift {
        font-size: 3rem;
    }

    .gifts {
        gap: 15px;
    }

    .gift-message {
        font-size: 1.2rem;
        min-height: 60px;
    }

    .gift-counter {
        font-size: 0.9rem;
    }
}

/* 粒子效果 */
.particle {
    position: fixed;
    pointer-events: none;
    animation: particleFade 3s ease forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0);
    }
}
