* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#bgMusic {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
}

#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.text-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
}

.text-container.hidden {
    opacity: 0;
}

.year-text {
    font-size: clamp(8rem, 25vw, 20rem);
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 20px #ffd700,
        0 0 40px #ff6b00,
        0 0 60px #ff0000,
        0 0 80px #ff6b00,
        0 0 100px #ffd700;
    opacity: 0;
    animation: yearFadeIn 1s ease-out forwards;
    letter-spacing: 0.05em;
}

.greeting-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 3vw, 3rem);
    opacity: 0;
}

.greeting-char {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 
        0 0 20px #ff6b6b,
        0 0 40px #ff8e53,
        0 0 60px #ff6b6b,
        0 0 80px #ff8e53;
    opacity: 0;
    transform: scale(0.5) translateY(50px);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.greeting-char.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.greeting-char:nth-child(1) {
    color: #ff6b6b;
    text-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff8e53;
}

.greeting-char:nth-child(2) {
    color: #ffd93d;
    text-shadow: 0 0 20px #ffd93d, 0 0 40px #ff6b00;
}

.greeting-char:nth-child(3) {
    color: #6bcb77;
    text-shadow: 0 0 20px #6bcb77, 0 0 40px #4ade80;
}

.greeting-char:nth-child(4) {
    color: #4d96ff;
    text-shadow: 0 0 20px #4d96ff, 0 0 40px #3b82f6;
}

@keyframes yearFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    50% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes yearFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.year-text.fade-out {
    animation: yearFadeOut 1s ease-in forwards;
}

.blessing-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 90%;
    max-width: 1200px;
}

.blessing-text {
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 20px #ffd700,
        0 0 40px #ff6b00,
        0 0 60px #ff0000,
        0 0 80px #ff6b00,
        0 0 100px #ffd700;
    opacity: 0;
    margin: 20px 0;
    line-height: 1.5;
    position: relative;
}

.blessing-text.show {
    opacity: 1;
}

.blessing-text.animate-slide-top {
    animation: slideInTop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-slide-bottom {
    animation: slideInBottom 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-slide-left {
    animation: slideInLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-slide-right {
    animation: slideInRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-rotate {
    animation: rotateIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-scale {
    animation: scaleIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.blessing-text.animate-fade {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes slideInTop {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInBottom {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes rotateIn {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 280px);
    z-index: 5;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 26, 0.3);
    padding-bottom: 20px;
}

.image-container.show {
    display: flex;
}

.image-wrapper {
    max-width: 55%;
    max-height: 70%;
    animation: imageFadeIn 0.8s ease-out forwards;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

@keyframes imageFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .year-text {
        letter-spacing: 0;
    }

    .greeting-container {
        flex-direction: column;
        gap: clamp(0.5rem, 2vw, 1rem);
    }

    .greeting-char {
        font-size: clamp(3rem, 12vw, 8rem);
    }
}

@media (max-width: 480px) {
    .year-text {
        font-size: clamp(5rem, 20vw, 8rem);
    }

    .greeting-char {
        font-size: clamp(2.5rem, 10vw, 6rem);
    }
}

@media (min-width: 1920px) {
    .year-text {
        font-size: 18rem;
    }

    .greeting-char {
        font-size: 10rem;
    }
}

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 rgba(255, 215, 0, 0.1);
}

.intro-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #ff6b00 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

.intro-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 300;
    line-height: 1.6;
}

.play-button {
    background: linear-gradient(135deg, #ffd700 0%, #ff6b00 50%, #ffd700 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 60px;
    padding: 18px 60px;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: #0a0a1a;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 8px 30px rgba(255, 107, 0, 0.4),
        0 0 0 rgba(255, 215, 0, 0.2),
        inset 0 0 0 rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(255, 107, 0, 0.6),
        0 0 0 rgba(255, 215, 0, 0.3);
    background-position: 100% 0;
}

.play-button:active {
    transform: translateY(-2px) scale(0.98);
}

.play-button.playing {
    background: linear-gradient(135deg, #6bcb77 0%, #4ade80 100%);
    box-shadow: 
        0 8px 30px rgba(107, 203, 119, 0.4),
        0 0 0 rgba(74, 222, 128, 0.2);
}

.play-button.paused {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    box-shadow: 
        0 8px 30px rgba(255, 107, 107, 0.4),
        0 0 0 rgba(255, 142, 83, 0.2);
}

.button-icon {
    font-size: 1.3em;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button.playing .button-icon {
    animation: iconPulse 1.5s ease-in-out infinite;
}

.button-text {
    font-size: 1em;
    letter-spacing: 0.05em;
}

.music-indicator {
    margin-top: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.music-indicator.playing {
    color: #6bcb77;
    background: rgba(107, 203, 119, 0.1);
}

.indicator-icon {
    font-size: 1.5em;
    animation: musicNote 1.5s ease-in-out infinite;
}

.indicator-text {
    font-weight: 500;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 20px #ffd700,
            0 0 40px #ff6b00,
            0 0 60px #ff0000,
            0 0 80px #ff6b00,
            0 0 100px #ffd700;
    }
    100% {
        text-shadow: 
            0 0 30px #ffd700,
            0 0 60px #ff6b00,
            0 0 90px #ff0000,
            0 0 120px #ff6b00,
            0 0 150px #ffd700;
    }
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes musicNote {
    0%, 100% {
        transform: rotate(-10deg) scale(1);
    }
    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

/* 祝福语容器过渡动画 */
.blessing-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 90%;
    max-width: 1200px;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

.blessing-container.fade-out {
    opacity: 0;
}

.blessing-container.fade-in {
    opacity: 1;
}

/* 页面切换过渡动画 */
@keyframes pageTransitionFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

@keyframes pageTransitionFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pageSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 歌词容器样式 */
.lyrics-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(to top, rgba(10, 10, 26, 0.95) 0%, rgba(26, 26, 58, 0.85) 30%, rgba(0, 0, 0, 0));
    backdrop-filter: blur(8px);
    z-index: 8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 20px 30px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    border-top: 2px solid rgba(255, 215, 0, 0.2);
}

.lyrics-container.show {
    opacity: 1;
    pointer-events: auto;
}

.lyrics-content {
    width: 100%;
    max-width: 900px;
    height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    /* 隐藏滚动条 */
    scrollbar-width: none;
}

.lyrics-content::-webkit-scrollbar {
    width: 0;
}

.lyrics-line {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.4;
    opacity: 0.5;
}

/* 单行歌词样式 - 优化版本 */
.lyrics-single-line {
    text-align: center;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    color: #b8b8c8;
    transition: opacity 0.3s ease-out;
    white-space: normal;
    max-width: 90%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 15px 30px;
    border-radius: 10px;
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.8;
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 淡出效果 */
.lyrics-single-line.fade-out {
    opacity: 0;
    transition: opacity 0.18s ease-in;
}

/* 淡入效果 */
.lyrics-single-line.fade-in {
    opacity: 1;
    animation: lyricsFadeIn 0.3s ease-out forwards;
}

@keyframes lyricsFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lyrics-retry-button {
    background: linear-gradient(90deg, #ffd700, #ff8e53);
    color: #111;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 10px;
}
.lyrics-retry-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.lyrics-line.prev {
    color: rgba(255, 255, 255, 0.25);
    font-size: clamp(0.9rem, 2.8vw, 1.1rem);
    transform: translateY(-10px);
}

.lyrics-line.active {
    color: #ffd700;
    text-shadow: 
        0 0 10px #ffd700,
        0 0 20px #ff6b00,
        0 0 30px #ff6b00;
    font-weight: bold;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    transform: scale(1.08) translateY(0);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 107, 0, 0.1));
    backdrop-filter: blur(4px);
    border-radius: 12px;
    opacity: 1;
    padding: 14px 32px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.lyrics-line.next {
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(1rem, 3vw, 1.2rem);
    transform: translateY(10px);
    opacity: 0.7;
}

/* 改进的祝福语字体颜色 - 使用渐变色 */
.blessing-text {
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 25%, #f8b500 50%, #ffd700 75%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    opacity: 0;
    margin: 20px 0;
    line-height: 1.5;
    position: relative;
    filter: drop-shadow(0 0 8px rgba(255, 107, 157, 0.3));
}

.blessing-text.show {
    opacity: 1;
}

/* 时间校准提示 */
.sync-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(107, 203, 119, 0.5);
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(107, 203, 119, 0.5);
}

.sync-indicator.synced {
    background: #6bcb77;
    box-shadow: 0 0 12px #6bcb77;
}

.sync-indicator.unsynced {
    background: rgba(255, 107, 107, 0.5);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}
