* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(to bottom, #0a0e27 0%, #1a1a3e 30%, #2d1b4e 60%, #4a1a4a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Canvas 烟花背景 */
#firework-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.5);
    }
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* 倒计时样式 */
.countdown-content {
    text-align: center;
    animation: fadeInScale 1s ease;
}

.cake-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease infinite;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

.title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 40px rgba(255, 255, 255, 0.3);
    font-weight: 300;
    letter-spacing: 2px;
}

.countdown {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    border-radius: 25px;
    min-width: 110px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.time-box:hover {
    transform: translateY(-5px);
}

.separator {
    font-size: 3rem;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 1s ease infinite;
}

.time {
    font-size: 3.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
}

.label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    margin-top: 2rem;
    animation: fadeIn 2s ease;
}

/* 生日祝福样式 */
.birthday-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.birthday-header {
    margin-bottom: 3rem;
}

.birthday-title {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.letter {
    display: inline-block;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
                 0 0 60px rgba(255, 200, 0, 0.6);
    animation: letterBounce 1s ease infinite;
    font-weight: bold;
}

.letter:nth-child(1) { animation-delay: 0s; }
.letter:nth-child(2) { animation-delay: 0.1s; }
.letter:nth-child(3) { animation-delay: 0.2s; }
.letter:nth-child(4) { animation-delay: 0.3s; }

.emoji-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.emoji {
    font-size: 3rem;
    display: inline-block;
    animation: emojiFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.emoji:nth-child(1) { animation-delay: 0s; }
.emoji:nth-child(2) { animation-delay: 0.2s; }
.emoji:nth-child(3) { animation-delay: 0.4s; }
.emoji:nth-child(4) { animation-delay: 0.6s; }
.emoji:nth-child(5) { animation-delay: 0.8s; }

.wishes-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 700px;
    margin: 0 auto 3rem;
}

.wish-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
    animation: slideInLeft 0.8s ease forwards;
    opacity: 0;
}

.wish-item:nth-child(1) { animation-delay: 0.5s; }
.wish-item:nth-child(2) { animation-delay: 0.8s; }
.wish-item:nth-child(3) { animation-delay: 1.1s; }
.wish-item:nth-child(4) { animation-delay: 1.4s; }

.wish-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    animation: rotate 3s ease-in-out infinite;
}

.wish {
    color: white;
    font-size: 1.4rem;
    text-align: left;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

/* 蛋糕动画 */
.cake-animation {
    margin-top: 2rem;
}

.cake {
    width: 150px;
    height: 120px;
    background: linear-gradient(145deg, #ff9a9e, #fad0c4);
    border-radius: 10px 10px 0 0;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: cakeBounce 2s ease-in-out infinite;
}

.cake::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 10%;
    width: 80%;
    height: 30px;
    background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
    border-radius: 50%;
}

.candle {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 40px;
    background: linear-gradient(145deg, #74b9ff, #0984e3);
    border-radius: 5px 5px 0 0;
}

.flame {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: radial-gradient(circle, #fff, #ffeb3b, #ff9800);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.3s ease-in-out infinite alternate;
    box-shadow: 0 0 20px #ff9800, 0 0 40px #ff5722;
}

/* 气球动画 */
.balloons {
    position: fixed;
    bottom: -100px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
    z-index: 1;
}

.balloon {
    width: 70px;
    height: 90px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    animation: floatUp 8s ease-in-out infinite;
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(255, 255, 255, 0.3);
}

.balloon-1 {
    background: linear-gradient(145deg, #ff6b6b, #ee5a6f);
    animation-delay: 0s;
    left: 5%;
}

.balloon-2 {
    background: linear-gradient(145deg, #4ecdc4, #44a08d);
    animation-delay: 1.5s;
    left: 20%;
}

.balloon-3 {
    background: linear-gradient(145deg, #ffe66d, #ffd93d);
    animation-delay: 3s;
    left: 35%;
}

.balloon-4 {
    background: linear-gradient(145deg, #a8e6cf, #7fd8be);
    animation-delay: 4.5s;
    left: 50%;
}

.balloon-5 {
    background: linear-gradient(145deg, #ff8b94, #ff6b9d);
    animation-delay: 6s;
    left: 65%;
}

.balloon-6 {
    background: linear-gradient(145deg, #c7b3ff, #a78bfa);
    animation-delay: 7.5s;
    left: 80%;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
}

.balloon::before {
    content: '🎀';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
}

/* 烟花效果 */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 彩纸效果 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

@keyframes emojiFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-150vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) scaleY(1);
    }
    100% {
        transform: translateX(-50%) scaleY(1.1);
    }
}

@keyframes cakeBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .countdown {
        gap: 1rem;
    }
    
    .time-box {
        padding: 1rem;
        min-width: 80px;
    }
    
    .time {
        font-size: 2.5rem;
    }
    
    .label {
        font-size: 1rem;
    }
    
    .birthday-title {
        font-size: 2.5rem;
    }
    
    .wishes {
        padding: 2rem;
        margin: 0 1rem;
    }
    
    .wish {
        font-size: 1.2rem;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cake-icon {
        font-size: 4rem;
    }
    
    .title {
        font-size: 1.8rem;
        padding: 0 1rem;
    }
    
    .countdown {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .separator {
        font-size: 2rem;
    }
    
    .time-box {
        padding: 1.5rem 1rem;
        min-width: 70px;
    }
    
    .time {
        font-size: 2.5rem;
    }
    
    .label {
        font-size: 0.9rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .birthday-title {
        font-size: 3rem;
    }
    
    .letter {
        font-size: 3rem;
    }
    
    .emoji {
        font-size: 2rem;
    }
    
    .emoji-row {
        gap: 1rem;
    }
    
    .wishes-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem 2rem;
    }
    
    .wish-item {
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .wish-icon {
        font-size: 2rem;
    }
    
    .wish {
        font-size: 1.1rem;
    }
    
    .cake {
        width: 120px;
        height: 100px;
    }
    
    .balloon {
        width: 50px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .time-box {
        padding: 1rem 0.8rem;
        min-width: 60px;
    }
    
    .time {
        font-size: 2rem;
    }
    
    .birthday-title {
        font-size: 2.5rem;
    }
    
    .wishes-card {
        padding: 1.5rem 1rem;
    }
    
    .wish {
        font-size: 1rem;
    }
}
