* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0ee2b0;
    overflow: hidden; /* 防止文字超出屏幕范围 */
}

.background-text-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* 允许内容垂直排列 */
    justify-content: center;
    align-items: center;
    font-size: 18vw; /* 略微调整字体大小以适应换行 */
    font-weight: 900; /* 设置为最粗的字重 */
    color: rgb(204, 255, 1);
    text-transform: uppercase;
    pointer-events: none;
    z-index: -2;
    text-align: center; /* 确保换行后文本居中 */
    line-height: 1; /* 调整行高，使其更紧凑 */
}


.background-text-animation {
    animation:
        colorChange 5s linear infinite, /* 颜色渐变 */
        dynamicTransform 2s ease-in-out infinite alternate; /* 动态变换：包含缩放、位移和旋转 */
}


/* 动画效果 1: 颜色渐变 */
@keyframes colorChange {
    0%, 100% { color: rgba(255, 105, 180, 0.8); } /* Hot Pink */
    16% { color: rgba(255, 165, 0, 0.8); }    /* Orange */
    32% { color: rgba(255, 255, 0, 0.8); }    /* Yellow */
    48% { color: rgba(0, 128, 0, 0.8); }      /* Green */
    64% { color: rgba(0, 0, 255, 0.8); }      /* Blue */
    80% { color: rgba(75, 0, 130, 0.8); }     /* Indigo */
}

/* 动画效果 2: 动态变换 - 包含缩放、水平移动、垂直移动和轻微旋转 */
@keyframes dynamicTransform {
    0% { transform: translate(-25%, -15%) scale(0.7) rotate(-12deg); }
    33% { transform: translate(0%, 10%) scale(1.2) rotate(5deg); }
    66% { transform: translate(15%, -8%) scale(0.9) rotate(8deg); }
    100% { transform: translate(25%, 15%) scale(1.3) rotate(12deg); }
}



.music-box {
    position: relative;
    width: 350px;
    height: 350px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.music-box:hover {
    transform: scale(1.02);
}

.music-box-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    fill: #ffffff;
    stroke: #ffffff;
    stroke-width: 0.5;
    transform-origin: center;
    z-index: 1;
    pointer-events: none;
}

@keyframes rotate3D {
    0% { transform: perspective(1000px) rotateY(0deg); }
    100% { transform: perspective(1000px) rotateY(360deg); }
}

.music-box-svg-2 {
    opacity: 1;
    z-index: 2;
    animation: rotate3D 3s linear infinite;
    transform-style: preserve-3d;
}

.box-layer {
    transform-origin: center;
    transition: transform 0.3s ease;
}

.horse-layer {
    transform-origin: center;
    transition: transform 0.3s ease;
}

@keyframes rock {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.music-box.playing .music-box-svg-2 {
} 


.music-box.playing .box-layer {
    transform: scale(1.02);
}

#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 100;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 48px;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    transform: scale(1.1);
}