/* 基础样式 */
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: 80px;
    text-align: center;
    animation: fadeIn 2s ease-in-out;
    width: 100%;
    max-width: 90%;
}

.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;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 调整祝福语字体大小 */
    .greeting h1 {
        font-size: 1.8rem;
    }
    
    .greeting p {
        font-size: 1rem;
    }
    
    /* 调整音乐播放器 */
    .music-player {
        top: 10px;
        padding: 8px 16px;
        gap: 10px;
        font-size: 0.9rem;
    }
    
    .music-player button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* 确保页面在手机上不溢出 */
    body {
        overflow: hidden;
        height: 100vh;
    }
    
    /* 保持圣诞树大小不变 */
    .tree {
        width: 200px;
        height: 400px;
        transform: scale(1);
    }
}

.music-player {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(20,40,60,0.9) 100%);
    padding: 12px 24px;
    border-radius: 40px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 20px rgba(255,215,0,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,215,0,0.2);
    transition: all 0.3s ease;
}

.music-player:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.4), 0 0 30px rgba(255,215,0,0.2);
    transform: translateX(-50%) translateY(2px);
}

.music-player .now-playing {
    font-size: 0.95rem;
    font-weight: 500;
    color: gold;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.music-player .now-playing span {
    color: #fff;
    font-weight: 400;
    margin-left: 5px;
}

.music-player button {
    background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%);
    border: 2px solid gold;
    color: gold;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
    outline: none;
}

.music-player button:hover {
    transform: scale(1.15);
    background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, transparent 70%);
    box-shadow: 0 6px 20px rgba(255,215,0,0.5);
    border-color: #ffd700;
}

.music-player button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .music-player {
        padding: 10px 20px;
        gap: 12px;
        max-width: 90%;
    }
    
    .music-player .now-playing {
        font-size: 0.85rem;
        max-width: 150px;
    }
    
    .music-player button {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* 添加全局光照 */
.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); }
}
