* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0c0c1e 0%, #1a1a3e 50%, #2d1b4e 100%);
}

/* 星空背景粒子 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.shooting-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(90deg, white, transparent);
    border-radius: 50%;
    animation: shooting 3s linear infinite;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), transparent);
    right: 4px;
}

/* 烟花容器 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
}

.firework-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* 礼物盒场景 */
.gift-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gift-scene.hide {
    opacity: 0;
    transform: scale(0.5) translateY(-100px);
    pointer-events: none;
}

/* 标题文字 */
.greeting {
    color: white;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 50px;
    text-align: center;
    padding: 0 20px;
    animation: fadeInDown 1s ease, glowText 2s ease-in-out infinite;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4);
    background: linear-gradient(90deg, #ffd700, #fff, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 礼物盒 */
.gift-box {
    position: relative;
    width: 220px;
    height: 220px;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.gift-box::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: shadow-pulse 3s ease-in-out infinite;
}

.gift-box:hover {
    animation: float 3s ease-in-out infinite, wiggle 0.5s ease-in-out;
}

.gift-box:active {
    transform: scale(0.95);
}

/* 盒子主体 */
.box {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 150px;
    background: linear-gradient(145deg, #ff4757, #c0392b);
    border-radius: 12px;
    box-shadow: 
        0 25px 80px rgba(255, 71, 87, 0.4),
        inset 0 -10px 30px rgba(0,0,0,0.2),
        inset 0 10px 30px rgba(255,255,255,0.1);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,215,0,0.9), rgba(255,180,0,0.9));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: 12px;
    pointer-events: none;
}

/* 盒盖 */
.lid {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 55px;
    background: linear-gradient(145deg, #ff6b81, #e74c3c);
    border-radius: 12px 12px 8px 8px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 5px 20px rgba(255,255,255,0.2);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,215,0,1), rgba(255,180,0,1));
    border-radius: 4px 4px 0 0;
}

.lid::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 8px;
    background: linear-gradient(180deg, #c0392b, #a93226);
    border-radius: 0 0 6px 6px;
}

/* 蝴蝶结 */
.ribbon {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, #ffd700, #f39c12);
    border-radius: 50%;
    transition: all 0.8s ease;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.4);
    z-index: 10;
}

.ribbon::before,
.ribbon::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 32px;
    background: linear-gradient(145deg, #ffd700, #f39c12);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.ribbon::before {
    left: -42px;
    transform: translateY(-50%) rotate(-15deg);
}

.ribbon::after {
    right: -42px;
    transform: translateY(-50%) rotate(15deg);
}

/* 光晕效果 */
.glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.glow-ring::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite 0.5s;
}

/* 点击提示 */
.tap-hint {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin-top: 280px;
    animation: bounce 2s ease infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 打开礼物的动画 */
.gift-box.opening .lid {
    transform: translateX(-50%) translateY(-200px) rotateZ(-35deg) rotateX(20deg);
    opacity: 0;
}

.gift-box.opening .ribbon {
    transform: translateX(-50%) translateY(-200px) scale(0) rotate(360deg);
    opacity: 0;
}

.gift-box.opening .box {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 
        0 30px 100px rgba(255, 71, 87, 0.6),
        0 0 60px rgba(255, 215, 0, 0.8);
}

.gift-box.opening .glow-ring {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

/* 闪光效果 */
.sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 200;
}

.sparkles.active {
    opacity: 1;
}

.sparkle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* 视频容器 */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    z-index: 50;
    transition: opacity 1.2s ease;
}

.video-container.show {
    opacity: 1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.3);
}

/* 如果没有视频时的提示 */
.video-placeholder {
    color: white;
    font-size: 24px;
    text-align: center;
    padding: 40px;
    animation: fadeIn 1s ease;
}

.video-placeholder p {
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.upload-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 18px 50px;
    background: linear-gradient(135deg, #ffd700 0%, #f39c12 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        0 10px 40px rgba(255, 215, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 50px rgba(255, 215, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.4);
}

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-25px);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes bounce {
    0%, 100% {
        opacity: 0.9;
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-10px);
    }
}

@keyframes glowText {
    0%, 100% {
        filter: brightness(1);
        background-position: 0% center;
    }
    50% {
        filter: brightness(1.3);
        background-position: 100% center;
    }
}

@keyframes glow-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }
}

@keyframes shadow-pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translateX(-50%) scale(0.85);
        opacity: 0.6;
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(300px) translateY(300px);
        opacity: 0;
    }
}

@keyframes firework-explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}
