@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #333468;
    overflow: hidden;
}

.scene-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    height: 100vh;
    z-index: 100;
    position: relative;
    padding: 0 20px;
    box-sizing: border-box;
}

.tree-container {
    width: calc((100% - 600px) / 2);  /* 两侧宽度为剩余空间的一半 */
    height: 100vh;
}

.main-scene {
    width: 600px;
    height: 100vh;
    padding-top: 20px;
    display: flex;
    justify-content: center;
}

canvas {
    display: block;
}

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

.tree-canvas {
    width: 100%;
    height: 100%;
}

.snow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

.meteor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    opacity: 0.8;
}

.greeting-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 215, 0, 0.9);
    font-size: 3rem;
    z-index: 300;
    display: none;
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 5px;
    transition: opacity 1s ease;
}

.greeting-line {
    margin: 30px 0;
    font-weight: bold;
    white-space: nowrap;
}

.char {
    display: inline-block;
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6),
                 0 0 15px rgba(255, 215, 0, 0.4),
                 0 0 20px rgba(255, 140, 0, 0.3),
                 0 0 25px rgba(255, 140, 0, 0.2);
}

.char.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 添加悬浮效果 */
.char.show:hover {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7),
                 0 0 20px rgba(255, 215, 0, 0.5),
                 0 0 30px rgba(255, 215, 0, 0.3),
                 0 0 40px rgba(255, 140, 0, 0.2);
}

.greeting-show {
    opacity: 1;
    display: block;
}

@media screen and (max-width: 1024px) {
    /* 平板设备 */
    .scene-container {
        padding: 0 10px;
    }

    .tree-container {
        width: calc((100% - 500px) / 2); /* 调整两侧树的宽度 */
    }

    .main-scene {
        width: 500px; /* 调整中间场景宽度 */
    }
}

@media screen and (max-width: 768px) {
    .scene-container {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .tree-container {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 1s ease;
        display: none;
    }

    .tree-container:first-child {
        display: block;
        width: 95vw;  /* 增加树的宽度，从80vw改为95vw */
        height: 95vh; /* 增加树的高度，从80vh改为95vh */
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .main-scene {
        width: 100%;
        height: 100vh;
        opacity: 0;
        transition: opacity 1s ease;
    }

    /* 动画类 */
    .tree-show {
        opacity: 1 !important;
    }

    .scene-show {
        opacity: 1 !important;
    }

    .greeting-text {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .greeting-line {
        margin: 20px 0;
    }
}

@media screen and (max-width: 480px) {
    /* 小屏手机 */
    .scene-container {
        padding: 0 3px;
    }

    .tree-container {
        width: calc((100% - 280px) / 2); /* 最小屏幕下的树宽度 */
    }

    .main-scene {
        width: 280px; /* 最小屏幕下的场景宽度 */
    }

    .greeting-text {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .greeting-line {
        margin: 15px 0;
    }

    .tree-container:first-child {
        width: 98vw;  /* 在更小的屏幕上使用更大的宽度 */
        height: 98vh; /* 在更小的屏幕上使用更大的高度 */
    }
}

/* 添加横屏支持 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .scene-container {
        height: auto;
        min-height: 100vh;
    }

    .tree-container {
        height: 100vh;
    }

    .main-scene {
        height: 100vh;
        padding-top: 10px;
    }

    .tree-container:first-child {
        width: 90vh;  /* 横屏时使用视口高度作为参考 */
        height: 90vh;
    }
} 