/* 基础样式 */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle, #0a2e38, #05161f);
    color: white;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

/* 3D圣诞树 */
.tree {
    position: relative;
    width: 200px;
    height: 400px;
    transform-style: preserve-3d;
    animation: rotateTree 10s infinite linear;
}

/* 星星 */
.star {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 30px solid #ffeb3b;
    transform: translateX(-50%) rotateZ(0deg);
    filter: drop-shadow(0 0 10px #ffeb3b);
    animation: twinkle 1.5s infinite alternate;
}

/* 树层 */
.layer {
    position: absolute;
    background: #228b22;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
    transform-origin: bottom;
}

.layer1 { width: 120px; height: 120px; top: 0; transform: translateX(-50%) rotateX(0deg); }
.layer2 { width: 160px; height: 160px; top: 100px; transform: translateX(-50%) rotateX(15deg); }
.layer3 { width: 200px; height: 200px; top: 200px; transform: translateX(-50%) rotateX(30deg); }

/* 树干 */
.trunk {
    position: absolute;
    width: 30px;
    height: 80px;
    background: #8b4513;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* 装饰元素 */
.decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.decorations .light {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff4757;
    border-radius: 50%;
    filter: drop-shadow(0 0 5px #ff4757);
    animation: blink 1s infinite alternate;
}

/* 雪花 */
.snowfall {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.snowfall .snow {
    position: absolute;
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    filter: blur(1px);
    animation: fall linear infinite;
}

/* 祝福语 */
.greeting {
    position: absolute;
    bottom: 20px;
    text-align: center;
    animation: fadeIn 2s ease-in-out;
}

.greeting h1 {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.greeting p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.8;
}

.music-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 30px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.music-player button {
    background: none;
    border: 2px solid gold;
    color: gold;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.3s;
}

.music-player button:hover {
    transform: scale(1.1);
}

/* 添加全局光照 */
.container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, 
        rgba(255,240,158,0.2) 0%,
        transparent 40%);
    pointer-events: none;
    animation: lightRotate 20s linear infinite;
}

@keyframes lightRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 装饰球高光增强 */
.ball::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, white 30%, transparent 70%);
    top: 20%;
    left: 20%;
    filter: blur(2px);
}

/* 动画 */


@keyframes twinkle {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 0.8; }
}

@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes fall {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
