* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    /* 樱花粉背景 */
    background: linear-gradient(135deg, #ffb7c5 0%, #ffc0cb 30%, #ffd1dc 60%, #ffe4e1 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: backgroundShift 8s ease-in-out infinite alternate;
    position: relative;
}

#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.birthday-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.birthday-title {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite, glow 1.5s ease-in-out infinite alternate;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.birthday-title a {
    text-decoration: none;
    /* 橘黄色系渐变 */
    background: linear-gradient(45deg, #ff6b00, #ff9500, #ffd700, #ffb700, #ff6b00);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* 调整文字描边为深橘色，与渐变更搭配 */
    -webkit-text-stroke: 2px rgba(255, 107, 0, 0.8);
    text-stroke: 2px rgba(255, 107, 0, 0.8);
    /* 调整阴影为橘黄色系，保持协调性 */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.9),
                 0 0 15px rgba(255, 149, 0, 0.9),
                 0 0 25px rgba(255, 215, 0, 0.8),
                 0 0 35px rgba(255, 107, 0, 0.6),
                 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: gradientShift 3s ease-in-out infinite, glow 1.5s ease-in-out infinite alternate, sparkle 2s ease-in-out infinite;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 900;
    letter-spacing: 1px;
}

.birthday-title a:hover {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 1),
                 0 0 25px rgba(255, 149, 0, 1),
                 0 0 40px rgba(255, 215, 0, 0.9),
                 0 0 60px rgba(255, 107, 0, 0.7),
                 0 3px 6px rgba(0, 0, 0, 0.4);
    filter: brightness(1.5) contrast(1.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 149, 0, 0.8));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.9));
    }
}

/* 闪烁动画 */
@keyframes sparkle {
    0%, 100% {
        filter: brightness(1) contrast(1);
    }
    50% {
        filter: brightness(1.3) contrast(1.2);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.birthday-message {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cake {
    position: relative;
    width: 180px;
    height: 150px;
    margin: 30px auto;
    animation: fadeIn 3s ease-in, cakeFloat 2s ease-in-out infinite;
}

@keyframes cakeFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(1deg);
    }
}

.cake-base {
    position: absolute;
    bottom: 0;
    left: 15px;
    width: 150px;
    height: 12px;
    background: #8b4513;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cake-layer {
    position: absolute;
    bottom: 12px;
    left: 25px;
    width: 130px;
    height: 35px;
    background: linear-gradient(135deg, #ffcccb 0%, #ffb6c1 50%, #ffcccb 100%);
    border-radius: 12px 12px 0 0;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 蛋糕层装饰 */
.cake-layer::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #ff69b4 0px,
        #ff69b4 8px,
        transparent 8px,
        transparent 16px
    );
    opacity: 0.7;
}

.cake-layer.top {
    bottom: 47px;
    left: 35px;
    width: 110px;
    height: 30px;
    background: linear-gradient(135deg, #ffb6c1 0%, #ff69b4 50%, #ffb6c1 100%);
}

/* 顶部蛋糕装饰 */
.cake-layer.top::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 12px;
    background: radial-gradient(circle, #ff1493 0%, #ff69b4 50%, transparent 70%);
    border-radius: 50%;
    opacity: 0.8;
}

/* 蜡烛 */
.candle {
    position: absolute;
    bottom: 77px;
    left: 87px;
    width: 8px;
    height: 25px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
    border-radius: 4px 4px 2px 2px;
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.1);
}

/* 蜡烛芯 */
.candle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5px;
    background: #8b4513;
    border-radius: 1px;
}

/* 蜡泪效果 */
.candle::after {
    content: '';
    position: absolute;
    top: 10px;
    left: -2px;
    width: 3px;
    height: 15px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    border-radius: 0 0 2px 2px;
    transform: rotate(-10deg);
    box-shadow: 10px -2px 0 -1px #ffffff, 10px 0px 0 -1px #f0f0f0;
}

/* 火焰 */
.flame {
    position: absolute;
    bottom: 102px;
    left: 85px;
    width: 12px;
    height: 20px;
    background: radial-gradient(circle, #ffff00 0%, #ff9800 40%, #ff5722 70%, transparent 90%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.8), 0 0 20px rgba(255, 87, 34, 0.5);
    z-index: 10;
}

/* 火焰光晕 */
.flame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: flameGlow 0.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.1) rotate(2deg);
        opacity: 0.95;
    }
    50% {
        transform: scale(0.95) rotate(-1deg);
        opacity: 0.9;
    }
    75% {
        transform: scale(1.05) rotate(1deg);
        opacity: 0.98;
    }
}

@keyframes flameGlow {
    from {
        transform: scale(1);
        opacity: 0.6;
    }
    to {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

/* 吹灭蜡烛动画 */
@keyframes blowOut {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(20deg);
        opacity: 0;
    }
}

/* 蛋糕装饰 - 糖霜 */
.cake-decoration {
    position: absolute;
    bottom: 77px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffffff 0%, #f0f0f0 70%, transparent 100%);
    border-radius: 50%;
    animation: decorationFloat 3s ease-in-out infinite;
}

/* 多个装饰 */
.cake-decoration:nth-child(1) {
    left: 45px;
    animation-delay: 0s;
}

.cake-decoration:nth-child(2) {
    left: 65px;
    animation-delay: 0.5s;
}

.cake-decoration:nth-child(3) {
    left: 105px;
    animation-delay: 1s;
}

.cake-decoration:nth-child(4) {
    left: 125px;
    animation-delay: 1.5s;
}

@keyframes decorationFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.1);
    }
}

/* 装饰元素 */
.birthday-card::before {
    content: '🎁';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

.birthday-card::after {
    content: '🎈';
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

/* 调整容器和卡片大小 */
.container {
    max-width: 800px;
    width: 95%;
}

.birthday-card {
    padding: 30px 20px;
    max-width: 100%;
}

/* 确保文字整合成一行 */
.birthday-message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    white-space: normal;
    word-wrap: break-word;
}

/* 修复蛋糕响应式问题，确保比例正确 */
@media (max-width: 768px) {
    .birthday-title {
        font-size: 2rem;
        white-space: nowrap;
        overflow-x: auto;
        padding: 0 10px;
    }
    
    .birthday-title::-webkit-scrollbar {
        height: 3px;
    }
    
    .birthday-title::-webkit-scrollbar-thumb {
        background: rgba(255, 107, 107, 0.5);
        border-radius: 3px;
    }
    
    .birthday-message {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .birthday-card {
        padding: 25px 15px;
        margin: 0 10px;
    }
    
    /* 蛋糕响应式调整 - 保持比例 */
    .cake {
        width: 140px;
        height: 120px;
    }
    
    .cake-base {
        left: 10px;
        width: 120px;
        height: 10px;
    }
    
    .cake-layer {
        bottom: 10px;
        left: 20px;
        width: 100px;
        height: 30px;
    }
    
    .cake-layer.top {
        bottom: 40px;
        left: 30px;
        width: 80px;
        height: 25px;
    }
    
    .cake-decoration {
        bottom: 65px;
    }
    
    .cake-decoration:nth-child(1) { left: 35px; }
    .cake-decoration:nth-child(2) { left: 55px; }
    .cake-decoration:nth-child(3) { left: 85px; }
    .cake-decoration:nth-child(4) { left: 105px; }
    
    .candle {
        bottom: 65px;
        left: 66px;
        width: 8px;
        height: 20px;
    }
    
    .flame {
        bottom: 85px;
        left: 64px;
        width: 12px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .birthday-title {
        font-size: 1.5rem;
        padding: 0 5px;
    }
    
    .birthday-message {
        font-size: 0.9rem;
        padding: 0 5px;
    }
    
    .birthday-card {
        padding: 20px 10px;
        margin: 0 5px;
    }
    
    /* 蛋糕响应式调整 - 保持比例 */
    .cake {
        width: 120px;
        height: 100px;
    }
    
    .cake-base {
        left: 8px;
        width: 104px;
        height: 8px;
    }
    
    .cake-layer {
        bottom: 8px;
        left: 16px;
        width: 88px;
        height: 25px;
    }
    
    .cake-layer.top {
        bottom: 33px;
        left: 24px;
        width: 72px;
        height: 20px;
    }
    
    .cake-decoration {
        bottom: 53px;
        width: 8px;
        height: 8px;
    }
    
    .cake-decoration:nth-child(1) { left: 30px; }
    .cake-decoration:nth-child(2) { left: 48px; }
    .cake-decoration:nth-child(3) { left: 72px; }
    .cake-decoration:nth-child(4) { left: 90px; }
    
    .candle {
        bottom: 53px;
        left: 56px;
        width: 8px;
        height: 18px;
    }
    
    .flame {
        bottom: 71px;
        left: 54px;
        width: 12px;
        height: 18px;
    }
}

/* 樱花特效样式 */
.cherry-blossom {
    position: fixed;
    top: -50px;
    pointer-events: none;
    z-index: 1;
    animation: cherryBlossomFall linear infinite;
    display: inline-block;
    transition: transform 0.1s ease;
}

/* 樱花飘落动画 */
@keyframes cherryBlossomFall {
    0% {
        transform: translateY(-50px) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    10% {
        transform: translateY(10vh) rotate(10deg) scale(1.1);
        opacity: 1;
    }
    20% {
        transform: translateY(20vh) rotate(-10deg) scale(1);
    }
    30% {
        transform: translateY(30vh) rotate(15deg) scale(1.1);
    }
    40% {
        transform: translateY(40vh) rotate(-15deg) scale(1);
    }
    50% {
        transform: translateY(50vh) rotate(20deg) scale(1.1);
    }
    60% {
        transform: translateY(60vh) rotate(-20deg) scale(1);
    }
    70% {
        transform: translateY(70vh) rotate(25deg) scale(1.1);
        opacity: 0.9;
    }
    80% {
        transform: translateY(80vh) rotate(-25deg) scale(1);
    }
    90% {
        transform: translateY(90vh) rotate(30deg) scale(1.1);
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) rotate(-30deg) scale(1);
        opacity: 0;
    }
}

/* 粒子效果 */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffeb3b;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fall 3s linear infinite;
}

@keyframes particle-fall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(360deg);
    }
}

/* 背景渐变动画 - 樱花粉 */
@keyframes backgroundShift {
    0% {
        background: linear-gradient(135deg, #ffb7c5 0%, #ffc0cb 30%, #ffd1dc 60%, #ffe4e1 100%);
    }
    100% {
        background: linear-gradient(135deg, #ff8fab 0%, #ffb7c5 30%, #ffc0cb 60%, #ffd1dc 100%);
    }
}