/* 安静小树页面样式 */

/* 设置面板样式 */
.settings-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    flex-wrap: wrap;
}

.settings-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider {
    width: 150px;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #d3d3d3;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid #000;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid #000;
}

/* 树木容器样式 */
.tree-container {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #87CEEB;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

/* 分贝显示样式 */
.decibel-display {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Minecraft', 'Arial', sans-serif;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.decibel-value {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

#currentDecibel {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 0 5px;
    min-width: 40px;
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-light {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid #333;
}

.status-light.green {
    background-color: #4CAF50;
}

.status-light.yellow {
    background-color: #FFC107;
}

.status-light.red {
    background-color: #F44336;
}

/* 树木场景样式 */
.tree-scene {
    position: relative;
    width: 100%;
    height: 100%;
}

.mountains {
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(180deg, rgba(121,85,72,0) 0%, rgba(121,85,72,0.8) 100%);
    z-index: 1;
    background-image: 
        url('../images/mountains.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

.sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);
    z-index: 0;
}

.sun {
    position: absolute;
    top: 50px;
    right: 100px;
    width: 80px;
    height: 80px;
    background-color: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    animation: sun-move 60s linear infinite;
}

@keyframes sun-move {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(30px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

.cloud {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.cloud1 {
    top: 70px;
    left: 100px;
    width: 100px;
    height: 60px;
    animation: cloud-move-1 40s linear infinite;
}

.cloud1::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

.cloud1::after {
    width: 80px;
    height: 80px;
    top: -10px;
    left: 60px;
}

.cloud2 {
    top: 120px;
    left: 400px;
    width: 120px;
    height: 70px;
    animation: cloud-move-2 50s linear infinite;
}

.cloud2::before {
    width: 70px;
    height: 70px;
    top: -35px;
    left: 25px;
}

.cloud2::after {
    width: 90px;
    height: 90px;
    top: -15px;
    left: 70px;
}

@keyframes cloud-move-1 {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(100vw + 200px));
    }
}

@keyframes cloud-move-2 {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(100vw + 300px));
    }
}

.grass-field {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: #8BC34A;
    z-index: 2;
    background-image: linear-gradient(0deg, #8BC34A 0%, #689F38 100%);
}

/* 树木样式 */
.tree {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto;
    z-index: 2;
    bottom: 0; /* 确保树从底部开始 */
}

/* 树干样式 */
.tree-trunk {
    position: absolute;
    bottom: 0; /* 确保树干从底部开始 */
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 120px;
    background: linear-gradient(to right, #8B4513, #A0522D, #8B4513);
    border-radius: 10px 10px 5px 5px;
    box-shadow: 
        -2px 0 4px rgba(0, 0, 0, 0.2),
        2px 0 4px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: height 1s ease, width 1s ease, opacity 1s ease; /* 添加树干生长的过渡动画 */
}

/* 树叶 - 基本样式 */
.tree-leaves {
    position: absolute;
    width: 200px;
    height: 160px;
    background-color: var(--leaf-color);
    border-radius: 50%;
    z-index: 10; /* 确保基本树叶层在额外树叶层上面 */
    transition: all 1s ease-in-out; /* 将过渡时间从0.5s增加到1s，使动画更明显 */
    left: 50%; /* 确保水平居中 */
    transform: translateX(-50%); /* 水平居中调整 */
}

/* 额外的树叶层，创造更丰富的树冠 */
.tree-leaves-extra {
    position: absolute;
    width: 230px;
    height: 180px;
    background-color: var(--leaf-color);
    border-radius: 50%;
    z-index: 5; /* 确保额外树叶层在基本树叶层下面 */
    transition: all 1s ease-in-out; /* 将过渡时间从0.5s增加到1s，使动画更明显 */
    left: 50%; /* 确保水平居中 */
    transform: translateX(-50%); /* 水平居中调整 */
}

/* 树叶随风摆动的动画 */
@keyframes leafSway {
    0% {
        transform: translateX(-50%) rotate(-2deg) scale(1);
    }
    100% {
        transform: translateX(-50%) rotate(2deg) scale(1);
    }
}

@keyframes leafSwayExtra {
    0% {
        transform: translateX(-50%) rotate(1deg) scale(0.85);
    }
    100% {
        transform: translateX(-50%) rotate(-1deg) scale(0.85);
    }
}

/* 树叶光影变化的动画 */
@keyframes leafShadow {
    0% {
        box-shadow: 
            0 0 20px rgba(76, 175, 80, 0.4),
            inset -5px -10px 10px rgba(0, 0, 0, 0.1),
            0 10px 20px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 
            0 0 20px rgba(76, 175, 80, 0.4),
            inset 5px -10px 10px rgba(0, 0, 0, 0.1),
            0 10px 20px rgba(0, 0, 0, 0.2);
    }
}

@keyframes leafShadowExtra {
    0% {
        box-shadow: 
            0 0 30px rgba(76, 175, 80, 0.5),
            inset -8px -15px 15px rgba(0, 0, 0, 0.1),
            0 15px 25px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(76, 175, 80, 0.5),
            inset 8px -15px 15px rgba(0, 0, 0, 0.1),
            0 15px 25px rgba(0, 0, 0, 0.15);
    }
}

/* 花朵样式 */
.tree-flowers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
}

.tree-flower {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #FFF9C4;
    border-radius: 50%;
    box-shadow: 
        0 0 5px rgba(255, 249, 196, 0.7),
        0 0 10px rgba(255, 249, 196, 0.5);
    z-index: 15;
    animation: flowerBloom 1.5s ease-out forwards;
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
}

.tree-flower::before,
.tree-flower::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #FFF9C4;
    border-radius: 50%;
    top: 0;
    left: 0;
}

.tree-flower::before {
    transform: rotate(45deg);
}

.tree-flower::after {
    background: #FFEB3B;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    box-shadow: 0 0 3px rgba(255, 235, 59, 0.5);
}

/* 花朵绽放动画 */
@keyframes flowerBloom {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 果实样式 */
.tree-fruits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.tree-fruit {
    position: absolute;
    width: 14px;
    height: 14px;
    background: linear-gradient(to bottom right, #F44336, #D32F2F);
    border-radius: 50%;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(244, 67, 54, 0.5);
    z-index: 20;
    animation: fruitGrow 2s ease-out forwards;
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
}

.tree-fruit.orange {
    background: linear-gradient(to bottom right, #FF9800, #F57C00);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 152, 0, 0.5);
}

.tree-fruit::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 2px;
    height: 4px;
    background: #4CAF50;
    transform: translateX(-50%);
}

/* 果实生长动画 */
@keyframes fruitGrow {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 树木的生长阶段 */
/* 阶段0 - 种子 */
.tree-stage-0 .tree-trunk {
    height: 0;
    opacity: 0;
}
.tree-stage-0 .tree-leaves,
.tree-stage-0 .tree-leaves-extra {
    opacity: 0;
    transform: scale(0);
}

/* 阶段1 - 小苗 */
.tree-stage-1 .tree-trunk {
    height: 30px;
    opacity: 1;
}
.tree-stage-1 .tree-leaves,
.tree-stage-1 .tree-leaves-extra {
    opacity: 0;
    transform: translateX(-50%) scale(0); /* 修改transform确保水平居中 */
}

/* 阶段2 - 幼树 */
.tree-stage-2 .tree-trunk {
    height: 80px;
    opacity: 1;
}
.tree-stage-2 .tree-leaves {
    opacity: 0.8;
    transform: translateX(-50%) scale(0.5); /* 修改transform确保水平居中 */
    bottom: 70px;
}
.tree-stage-2 .tree-leaves-extra {
    opacity: 0;
    transform: translateX(-50%) scale(0); /* 修改transform确保水平居中 */
}

/* 阶段3 - 成长中的树 */
.tree-stage-3 .tree-trunk {
    height: 120px;
    opacity: 1;
}
.tree-stage-3 .tree-leaves {
    opacity: 1;
    transform: translateX(-50%) scale(0.7); /* 修改transform确保水平居中 */
    bottom: 100px;
    z-index: 10; /* 确保主树叶在额外树叶上面 */
}
.tree-stage-3 .tree-leaves-extra {
    opacity: 0.7;
    transform: translateX(-50%) scale(0.5); /* 修改transform确保水平居中 */
    bottom: 140px;
    z-index: 5; /* 额外树叶在下面 */
}

/* 阶段4 - 接近成熟的树 */
.tree-stage-4 .tree-trunk {
    height: 160px;
    opacity: 1;
}
.tree-stage-4 .tree-leaves {
    opacity: 1;
    transform: translateX(-50%) scale(0.9); /* 修改transform确保水平居中 */
    bottom: 130px;
    z-index: 10; /* 确保主树叶在额外树叶上面 */
}
.tree-stage-4 .tree-leaves-extra {
    opacity: 0.9;
    transform: translateX(-50%) scale(0.7); /* 修改transform确保水平居中 */
    bottom: 180px;
    z-index: 5; /* 额外树叶在下面 */
}

/* 阶段5 - 完全成熟的树 */
.tree-stage-5 .tree-trunk {
    height: 200px;
    opacity: 1;
}
.tree-stage-5 .tree-leaves {
    opacity: 1;
    transform: translateX(-50%) scale(1); /* 修改transform确保水平居中 */
    bottom: 160px;
    z-index: 10; /* 确保主树叶在额外树叶上面 */
}
.tree-stage-5 .tree-leaves-extra {
    opacity: 1;
    transform: translateX(-50%) scale(0.85); /* 修改transform确保水平居中 */
    bottom: 220px;
    z-index: 5; /* 额外树叶在下面 */
}

/* 树的光照效果 - 添加阳光照射的感觉 */
.tree::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(255, 255, 200, 0.2) 0%, rgba(255, 255, 200, 0) 70%);
    pointer-events: none;
    z-index: 2;
    animation: sunlightEffect 10s infinite alternate;
}

@keyframes sunlightEffect {
    0% {
        opacity: 0.4;
        transform: translateX(-60%) scale(1);
    }
    100% {
        opacity: 0.7;
        transform: translateX(-40%) scale(1.1);
    }
}

/* 树被噪音影响时的样式 */
.tree-withered .tree-leaves,
.tree-withered .tree-leaves-extra {
    background: #A5D6A7;
    opacity: 0.7;
    filter: saturate(50%);
}

.tree-withered .tree-flower {
    opacity: 0.5;
    filter: grayscale(30%);
}

.tree-withered .tree-fruit {
    opacity: 0.6;
    filter: saturate(70%);
}

/* 小草样式 */
.small-grass {
    position: absolute;
    bottom: 100px;
    width: 30px;
    height: 40px;
    background-image: url('../images/grass.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
}

.grass1 {
    left: 20%;
}

.grass2 {
    left: 40%;
}

.grass3 {
    left: 80%;
}

/* 生长进度条 */
.growth-progress {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    font-family: 'Minecraft', 'Arial', sans-serif;
}

.progress-label {
    font-size: 1rem;
}

.progress-bar-container {
    width: 200px;
    height: 20px;
    background-color: #444;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #000;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
}

.progress-percentage {
    font-size: 1rem;
    min-width: 50px;
    text-align: center;
}

/* 使用说明样式 */
.instructions {
    background-color: var(--card-background);
    border: 4px solid #000;
    border-image: url('../images/border.png') 4 repeat;
    padding: 20px;
    margin-bottom: 40px;
}

.instructions h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
}

/* 全屏模式样式 */
.tree-container.fullscreen-mode {
    border-radius: 0;
}

/* 树木点击效果 */
.tree.clicked {
    animation: tree-shake 0.5s ease;
}

@keyframes tree-shake {
    0% { transform: rotate(0); }
    15% { transform: rotate(-3deg); }
    30% { transform: rotate(3deg); }
    45% { transform: rotate(-2deg); }
    60% { transform: rotate(2deg); }
    75% { transform: rotate(-1deg); }
    90% { transform: rotate(1deg); }
    100% { transform: rotate(0); }
}

/* 落叶效果 */
.falling-leaf {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #8bc34a;
    border-radius: 50%;
    opacity: 0.8;
    animation: leaf-fall 5s ease-in-out forwards;
    z-index: 1;
}

@keyframes leaf-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(300px) rotate(360deg);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tree-container {
        height: 400px;
    }

    .progress-bar-container {
        width: 150px;
    }

    .settings-panel {
        flex-direction: column;
        align-items: center;
    }

    .settings-group {
        width: 100%;
        justify-content: space-between;
    }

    .tree {
        transform: scale(0.9);
        bottom: 0; /* 确保在响应式布局中树也贴近底部 */
    }
    
    .tree-container.fullscreen-mode .tree {
        transform: translateX(-50%) scale(0.9); /* 保持缩放同时确保居中 */
        bottom: 80px; /* 在中等屏幕上相应调整位置 */
    }
}

@media (max-width: 576px) {
    .tree-container {
        height: 350px;
    }

    .decibel-display {
        left: 10px;
        top: 10px;
        padding: 10px;
    }

    .growth-progress {
        flex-wrap: wrap;
        justify-content: center;
        width: 90%;
    }

    .progress-bar-container {
        width: 100%;
    }

    .tree {
        transform: scale(0.8);
        bottom: 0; /* 确保在响应式布局中树也贴近底部 */
    }
    
    .tree-container.fullscreen-mode .tree {
        transform: translateX(-50%) scale(0.8); /* 保持缩放同时确保居中 */
        bottom: 60px; /* 在小屏幕上相应调整位置 */
    }
}

/* 移除树枝样式，只保留树干 */
.tree-branches {
    display: none !important;
}

.tree-branch {
    display: none !important;
}

/* 树木生长阶段 - 确保阶段正确显示 */
.tree-stage-0 .tree-trunk {
    height: 20px;
    width: 10px;
    background-image: linear-gradient(90deg, #795548 30%, #8D6E63 50%, #795548 70%);
}

.tree-stage-1 .tree-trunk {
    height: 50px;
    width: 16px;
}

.tree-stage-2 .tree-trunk {
    height: 100px;
    width: 22px;
}

.tree-stage-3 .tree-trunk {
    height: 150px;
    width: 30px;
}

.tree-stage-4 .tree-trunk {
    height: 180px;
    width: 36px;
}

.tree-stage-5 .tree-trunk {
    height: 200px;
    width: 40px;
}

/* 树根样式 */
.tree-roots {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
    pointer-events: none;
}

.tree-stage-3 .tree-roots,
.tree-stage-4 .tree-roots,
.tree-stage-5 .tree-roots {
    opacity: 1;
}

.tree-root {
    position: absolute;
    background-color: #5d4037;
    border-radius: 40%;
    transform-origin: top center;
    transition: transform 1.5s ease, opacity 1.5s ease;
    opacity: 0;
}

.tree-stage-2 .tree-root, 
.tree-stage-3 .tree-root, 
.tree-stage-4 .tree-root, 
.tree-stage-5 .tree-root {
    opacity: 1;
}

.tree-root-1 {
    width: 10px;
    height: 30px;
    bottom: 0;
    left: 40%;
    transform: rotate(-45deg) scale(0);
}

.tree-stage-2 .tree-root-1 { transform: rotate(-45deg) scale(0.5); }
.tree-stage-3 .tree-root-1 { transform: rotate(-45deg) scale(0.7); }
.tree-stage-4 .tree-root-1, .tree-stage-5 .tree-root-1 { transform: rotate(-45deg) scale(1); }

.tree-root-2 {
    width: 10px;
    height: 30px;
    bottom: 0;
    right: 40%;
    transform: rotate(45deg) scale(0);
}

.tree-stage-2 .tree-root-2 { transform: rotate(45deg) scale(0.5); }
.tree-stage-3 .tree-root-2 { transform: rotate(45deg) scale(0.7); }
.tree-stage-4 .tree-root-2, .tree-stage-5 .tree-root-2 { transform: rotate(45deg) scale(1); }

/* 枯萎状态 */
.tree-withered .tree-trunk {
    background-color: #5D4037;
    background-image: linear-gradient(90deg, #4E342E 10%, #5D4037 50%, #4E342E 90%);
}

.tree-withered .tree-leaves {
    background-color: #A1887F;
    background-image: radial-gradient(
        ellipse at center, 
        #BCAAA4 10%, 
        #A1887F 40%, 
        #8D6E63 70%,
        #6D4C41 100%
    );
    opacity: 0.7;
    transform: translateX(-50%) scale(0.9);
}

.tree-withered .tree-leaves::before,
.tree-withered .tree-leaves::after {
    background-image: radial-gradient(
        ellipse at center, 
        #BCAAA4 10%, 
        #A1887F 40%, 
        #8D6E63 70%,
        #6D4C41 100%
    );
    opacity: 0.6;
}

.tree-withered .tree-flowers,
.tree-withered .tree-fruits {
    opacity: 0;
}

.tree-withered .tree-branches .tree-branch {
    background-color: #6D4C41;
}

/* 确保更加逼真的树叶效果 */
.tree-stage-1 .tree-leaves {
    background-image: 
        radial-gradient(
            ellipse at center, 
            rgba(162, 217, 164, 0.95) 10%, 
            rgba(129, 199, 132, 0.9) 40%, 
            rgba(102, 187, 106, 0.85) 80%,
            rgba(76, 175, 80, 0.8) 100%
        ),
        linear-gradient(
            to bottom, 
            rgba(178, 223, 180, 0.2) 0%,
            rgba(129, 199, 132, 0.3) 50%, 
            rgba(102, 187, 106, 0.4) 100%
        );
}

.tree-stage-2 .tree-leaves {
    background-image: 
        radial-gradient(
            ellipse at center, 
            rgba(129, 199, 132, 0.95) 10%, 
            rgba(102, 187, 106, 0.9) 40%, 
            rgba(76, 175, 80, 0.85) 80%,
            rgba(56, 142, 60, 0.8) 100%
        ),
        linear-gradient(
            to bottom, 
            rgba(129, 199, 132, 0.2) 0%,
            rgba(102, 187, 106, 0.3) 50%, 
            rgba(76, 175, 80, 0.4) 100%
        );
}

.tree-stage-3 .tree-leaves,
.tree-stage-4 .tree-leaves {
    background-image: 
        radial-gradient(
            ellipse at center, 
            rgba(102, 187, 106, 0.95) 10%, 
            rgba(76, 175, 80, 0.9) 40%, 
            rgba(56, 142, 60, 0.85) 80%,
            rgba(46, 125, 50, 0.8) 100%
        ),
        linear-gradient(
            to bottom, 
            rgba(76, 175, 80, 0.2) 0%,
            rgba(56, 142, 60, 0.3) 50%, 
            rgba(46, 125, 50, 0.4) 100%
        );
}

.tree-stage-5 .tree-leaves {
    background-image: 
        radial-gradient(
            ellipse at center, 
            rgba(76, 175, 80, 0.95) 10%, 
            rgba(56, 142, 60, 0.9) 40%, 
            rgba(46, 125, 50, 0.85) 80%,
            rgba(27, 94, 32, 0.8) 100%
        ),
        linear-gradient(
            to bottom, 
            rgba(56, 142, 60, 0.2) 0%,
            rgba(46, 125, 50, 0.3) 50%, 
            rgba(27, 94, 32, 0.4) 100%
        );
}

/* 添加光影动画效果 */
@keyframes leaves-shadow-movement {
    0% {
        box-shadow: 
            inset 5px 5px 15px rgba(255, 255, 255, 0.3),
            inset -5px -5px 15px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 
            inset 7px 7px 18px rgba(255, 255, 255, 0.35),
            inset -3px -3px 12px rgba(0, 0, 0, 0.25),
            0 0 22px rgba(0, 0, 0, 0.18);
    }
    100% {
        box-shadow: 
            inset 5px 5px 15px rgba(255, 255, 255, 0.3),
            inset -5px -5px 15px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(0, 0, 0, 0.2);
    }
}

.tree-stage-4 .tree-leaves,
.tree-stage-5 .tree-leaves {
    animation: leaves-shadow-movement 8s infinite ease-in-out;
}

/* 改进花朵的生长动画 */
@keyframes flower-bloom {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 改进果实的生长动画 */
@keyframes fruit-grow {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
    80% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 全屏模式下的树位置修复 */
.tree-container.fullscreen-mode .tree {
    position: absolute;
    bottom: 100px; /* 将树的位置从底部向上调整100px */
    left: 50%;
    transform: translateX(-50%);
}

/* 树木生长阶段样式 - 添加过渡动画 */
.tree-stage-0 .tree-trunk,
.tree-stage-1 .tree-trunk,
.tree-stage-2 .tree-trunk,
.tree-stage-3 .tree-trunk,
.tree-stage-4 .tree-trunk,
.tree-stage-5 .tree-trunk {
    transition: height 1s ease, width 1s ease, opacity 1s ease;
}

.tree-stage-0 .tree-leaves,
.tree-stage-1 .tree-leaves,
.tree-stage-2 .tree-leaves,
.tree-stage-3 .tree-leaves,
.tree-stage-4 .tree-leaves,
.tree-stage-5 .tree-leaves {
    transition: transform 1s ease, opacity 1s ease, bottom 1s ease;
}

.tree-stage-0 .tree-leaves-extra,
.tree-stage-1 .tree-leaves-extra,
.tree-stage-2 .tree-leaves-extra,
.tree-stage-3 .tree-leaves-extra,
.tree-stage-4 .tree-leaves-extra,
.tree-stage-5 .tree-leaves-extra {
    transition: transform 1s ease, opacity 1s ease, bottom 1s ease;
}

/* 树根过渡动画 */
.tree-root {
    transition: transform 1.5s ease, opacity 1.5s ease;
}

/* 修复树的生长阶段动画，确保树叶正确定位 */
.tree-stage-0 .tree-leaves,
.tree-stage-0 .tree-leaves-extra {
    opacity: 0;
    transform: translateX(-50%) scale(0);
    bottom: 0;
} 