/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    overflow: hidden;
    color: white;
}

/* 背景渐变动画 */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 雪花装饰 */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.snowflake {
    position: absolute;
    color: #fff;
    font-size: 1.5rem;
    animation: fall linear infinite;
    opacity: 0.8;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.snowflake:nth-child(1) {
    left: 10%;
    animation-duration: 10s;
    animation-delay: 0s;
}

.snowflake:nth-child(2) {
    left: 20%;
    animation-duration: 12s;
    animation-delay: 1s;
}

.snowflake:nth-child(3) {
    left: 30%;
    animation-duration: 9s;
    animation-delay: 2s;
}

.snowflake:nth-child(4) {
    left: 40%;
    animation-duration: 11s;
    animation-delay: 0.5s;
}

.snowflake:nth-child(5) {
    left: 50%;
    animation-duration: 10s;
    animation-delay: 3s;
}

.snowflake:nth-child(6) {
    left: 60%;
    animation-duration: 13s;
    animation-delay: 1.5s;
}

.snowflake:nth-child(7) {
    left: 70%;
    animation-duration: 9s;
    animation-delay: 2.5s;
}

.snowflake:nth-child(8) {
    left: 80%;
    animation-duration: 12s;
    animation-delay: 0.8s;
}

.snowflake:nth-child(9) {
    left: 90%;
    animation-duration: 11s;
    animation-delay: 2.8s;
}

.snowflake:nth-child(10) {
    left: 15%;
    animation-duration: 10s;
    animation-delay: 1.2s;
}

/* 主要内容区域 */
.content {
    text-align: center;
    z-index: 10;
    padding: 20px;
    max-width: 800px;
    position: relative;
}

.main-title {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }

    to {
        text-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.8);
    }
}

.date-display {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #FFD700;
}

.greeting {
    font-size: 1.5rem;
    margin: 30px 0;
    line-height: 1.8;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* 毛玻璃效果的文字容器 */
.greeting-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px;
    margin: 30px auto;
    max-width: 700px;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 逐字输入的打字效果 */
.typing-text {
    font-size: 1.5rem;
    line-height: 2;
    color: white;
    text-align: center;
    overflow: visible;
    /* 允许内容溢出可见 */
    white-space: pre-wrap;
    /* 允许自动换行 */
    word-wrap: break-word;
    /* 允许长单词换行 */
    max-width: 100%;
    margin: 0;
    position: relative;
}

.typing-text::after {
    content: '▋';
    animation: blink-caret 1s infinite;
    margin-left: 4px;
}

@keyframes blink-caret {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.countdown {
    margin: 40px 0;
}

.countdown h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #FFD700;
}

.time-units {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-unit {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    min-width: 80px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.time-unit span {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.time-unit p {
    margin-top: 5px;
    font-size: 1rem;
    color: white;
}

/* 烟花画布容器 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#fireworks {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: transparent;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .greeting-container {
        padding: 25px;
        margin: 20px auto;
        max-width: 90%;
        min-height: 250px;
    }

    .typing-text {
        font-size: 1.2rem;
        max-width: 100%;
    }

    .countdown h2 {
        font-size: 1.8rem;
    }

    .time-unit {
        min-width: 60px;
        padding: 10px;
    }

    .time-unit span {
        font-size: 1.8rem;
    }

    #fireworks {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }

    .time-units {
        gap: 10px;
    }

    .time-unit {
        min-width: 50px;
        padding: 8px;
    }

    .time-unit span {
        font-size: 1.5rem;
    }

    .greeting-container {
        padding: 20px;
        margin: 15px auto;
        min-height: 200px;
    }

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