/* scenery.css */
/* 网站状态元素样式 */
#websiteStatusIndicator {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.5s ease;
}

/* 开启状态 - 太阳 */
.open-mode #websiteStatusIndicator {
    background: #FFD700;
    color: #FF8C00;
    animation: sunGlow 3s infinite alternate;
}

@keyframes sunGlow {
    0% { box-shadow: 0 0 10px #FFD700; }
    100% { box-shadow: 0 0 30px #FF8C00; }
}

/* 关闭状态 - 月亮 */
.closed-mode #websiteStatusIndicator {
    background: #F0F0F0;
    color: #D3D3D3;
    animation: moonGlow 3s infinite alternate;
}

@keyframes moonGlow {
    0% { box-shadow: 0 0 10px #F0F0F0; }
    100% { box-shadow: 0 0 30px #D3D3D3; }
}

/* 云朵动画元素 - 已优化 */
.cloud {
    position: absolute;
    z-index: 5; /* 提升层级到工具卡片之上 */
    opacity: 0.7;
    pointer-events: none; /* 防止阻挡点击事件 */
    /* 默认大小 */
    font-size: 5rem;
    /* 动画持续时间 */
    animation: cloudFloat 30s infinite linear;
    /* 初始位置在左侧画面外 */
    left: -10%;
}

/* 白天模式云朵颜色 - 淡蓝色 */
:not(.dark-mode) .cloud {
    color: rgba(173, 216, 230, 0.9); /* 淡蓝色 */
}

.dark-mode .cloud {
    color: rgba(200, 200, 200, 0.5);
}

/* 云朵动画 */
@keyframes cloudFloat {
    0% { 
        transform: translateX(0); 
        left: -10%;
    }
    100% { 
        transform: translateX(0);
        left: 110%; /* 移动到右侧画面外 */
    }
}

/* 星星动画元素 */
.star {
    position: absolute;
    font-size: 1rem;
    color: #FFFF00;
    z-index: -1;
    animation: starTwinkle 3s infinite alternate;
}

.star-1 { top: 15%; left: 10%; animation-delay: 0s; }
.star-2 { top: 25%; left: 30%; animation-delay: 1s; }
.star-3 { top: 10%; left: 50%; animation-delay: 2s; }
.star-4 { top: 20%; left: 70%; animation-delay: 3s; }
.star-5 { top: 15%; left: 90%; animation-delay: 4s; }
.star-6 { top: 35%; left: 15%; animation-delay: 0.5s; }
.star-7 { top: 40%; left: 40%; animation-delay: 1.5s; }
.star-8 { top: 30%; left: 60%; animation-delay: 2.5s; }
.star-9 { top: 35%; left: 80%; animation-delay: 3.5s; }
.star-10 { top: 45%; left: 95%; animation-delay: 4.5s; }

@keyframes starTwinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* 萤火虫 - 提升层级至最上层 */
.firefly {
    position: absolute;
    z-index: 9999; /* 提升到最上层 */
    font-size: 0.5rem;
    color: #c6ff00;
    opacity: 0;
    animation: fireflyGlow 3s infinite alternate, fireflyMove 15s infinite linear;
    filter: blur(1px);
    text-shadow: 0 0 5px #c6ff00, 0 0 10px #c6ff00;
}

.dark-mode .firefly {
    opacity: 0.8; /* 深色模式下显示 */
    display: block;
    cursor: default; /* 默认光标 */
}

/* 红色萤火虫可点击 */
.dark-mode .firefly-1 {
    cursor: pointer;
    z-index: 10000; /* 确保可点击 */
}

/* 萤火虫对话框样式 */
.firefly-dialog {
    position: absolute;
    background: rgba(20, 20, 40, 0.95);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 191, 255, 0.3);
    font-size: 0.85rem;
    color: #e0f7ff;
    z-index: 10001;
    display: none;
    max-width: 220px;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid rgba(0, 191, 255, 0.5);
    backdrop-filter: blur(3px);
    overflow: visible; /* 确保箭头不会被裁剪 */
}

/* 对话框箭头 - 基础样式 */
.firefly-dialog::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent rgba(20, 20, 40, 0.95);
    z-index: -1; /* 添加此行将箭头置于内容下方 */
}

/* 左侧箭头（指向左方元素） */
.firefly-dialog.left-arrow::before {
    left: -10px; /* 完全移出对话框左侧 */
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 10px 10px 0;
    border-color: transparent rgba(20, 20, 40, 0.95);
}

/* 右侧箭头（指向右方元素） */
.firefly-dialog.right-arrow::before {
    right: -10px; /* 完全移出对话框右侧 */
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent rgba(20, 20, 40, 0.95);
}

.dark-mode .firefly-dialog.left-arrow::before {
    border-color: transparent rgba(20, 20, 40, 0.95);
}

.dark-mode .firefly-dialog.right-arrow::before {
    border-color: transparent transparent transparent rgba(20, 20, 40, 0.95);
}

.dark-mode .firefly-dialog {
    background: rgba(20, 20, 40, 0.95);
    color: #e0f7ff;
    border: 1px solid rgba(0, 191, 255, 0.5);
}

/* 海蓝色星星样式 */
.star-sea-blue {
    position: absolute;
    font-size: 1.2rem;
    color: #00bfff;
    z-index: 9998;
    animation: starTwinkle 3s infinite alternate;
    text-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
}

.firefly-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
    color: #ff4500; /* 火红色 */
    text-shadow: 0 0 5px #ff4500, 0 0 10px #ff4500;
}

.firefly-2 {
    top: 40%;
    left: 30%;
    animation-delay: 2s;
}

.firefly-3 {
    top: 60%;
    left: 50%;
    animation-delay: 4s;
}

.firefly-4 {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
}

.firefly-5 {
    top: 50%;
    left: 10%;
    animation-delay: 3s;
}

.firefly-6 {
    top: 70%;
    left: 85%;
    animation-delay: 5s;
}

@keyframes fireflyGlow {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes fireflyMove {
    0% { transform: translate(0, 0); }
    25% { transform: translate(40px, 30px); }
    50% { transform: translate(20px, -20px); }
    75% { transform: translate(-30px, 20px); }
    100% { transform: translate(0, 0); }
}

/* 山脉背景 - 三层山脉增强层次感 */
.mountain-range {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: -3; /* 调整为最底层 */
    opacity: 0.3; /* 白天模式默认透明度 */
    transition: opacity 0.5s ease;
}

.dark-mode .mountain-range {
    opacity: 0.8; /* 深色模式下显示 */
}

/* 增强白天模式山脉可见度 */
:not(.dark-mode) .mountain-range {
    opacity: 0.7;
}

.mountain-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 30, 45, 0.8) 0%, transparent 100%);
    clip-path: polygon(0% 100%, 0% 30%, 5% 40%, 10% 20%, 15% 50%, 20% 30%, 25% 60%, 30% 40%, 35% 70%, 40% 50%, 45% 80%, 50% 60%, 55% 90%, 60% 70%, 65% 100%, 70% 80%, 75% 100%, 80% 90%, 85% 100%, 90% 95%, 95% 100%, 100% 100%);
}

.mountain-layer-1 {
    height: 150px;
    opacity: 0.8;
    z-index: 1;
    background: linear-gradient(to top, rgba(25, 40, 65, 0.8) 0%, transparent 100%);
    clip-path: polygon(0% 100%, 0% 40%, 10% 50%, 20% 30%, 30% 60%, 40% 40%, 50% 70%, 60% 50%, 70% 80%, 80% 60%, 90% 90%, 100% 70%, 100% 100%);
}

.mountain-layer-2 {
    height: 180px;
    opacity: 0.6;
    z-index: 2;
    background: linear-gradient(to top, rgba(35, 50, 75, 0.7) 0%, transparent 100%);
    clip-path: polygon(0% 100%, 0% 30%, 5% 40%, 10% 20%, 15% 50%, 20% 30%, 25% 60%, 30% 40%, 35% 70%, 40% 50%, 45% 80%, 50% 60%, 55% 90%, 60% 70%, 65% 100%, 70% 80%, 75% 100%, 80% 90%, 85% 100%, 90% 95%, 95% 100%, 100% 100%);
}

.mountain-layer-3 {
    height: 200px;
    opacity: 0.4;
    z-index: 3;
    background: linear-gradient(to top, rgba(45, 60, 85, 0.6) 0%, transparent 100%);
    clip-path: polygon(0% 100%, 0% 20%, 10% 30%, 20% 10%, 30% 40%, 40% 20%, 50% 50%, 60% 30%, 70% 60%, 80% 40%, 90% 70%, 100% 50%, 100% 100%);
}

/* 优化后的森林小屋 - 位于按钮下一层 */
.cabin-container {
    position: fixed;
    bottom: 20px; /* 垂直位置调整 */
    right: -85px; /* 水平位置调整（向右移动） */
    z-index: 1; /* 提高层级确保可以接收点击 */
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.6));
    pointer-events: none; /* 防止阻挡点击事件 */
}

.cabin {
    position: relative;
    width: 200px;
    height: 170px; /* 增加高度以容纳灯光 */
}

/* 小屋主体 */
.cabin-body {
    position: absolute;
    bottom: 30px; /* 为灯光留出空间 */
    left: 30px;
    width: 140px;
    height: 100px;
    background: #8B4513; /* 白天模式 - 深棕色 */
    border-radius: 8px 8px 0 0;
    z-index: 2;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.7),
        0 5px 20px rgba(0, 0, 0, 0.4);
    /* 新增：防止山峦穿透 */
    overflow: hidden;
    
    /* 深色模式 - 小屋主体颜色 */
    transition: background-color 0.5s ease;
}

/* 深色模式 - 小屋主体颜色 */
.dark-mode .cabin-body {
    background: #000; /* 纯黑色剪影 */
}

/* 屋顶 - 上移20px */
.cabin-roof {
    position: absolute;
    top: -20px; /* 上移20px */
    left: 0;
    width: 200px;
    height: 80px;
    background: #A52A2A; /* 白天模式 - 红棕色 */
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    z-index: 3;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
    /* 新增：防止山峦穿透 */
    overflow: hidden;
    
    /* 过渡效果统一放在基础选择器中 */
    transition: background-color 0.5s ease;
}

/* 深色模式 - 屋顶颜色 */
.dark-mode .cabin-roof {
    background: #000; /* 纯黑色剪影 */
    /* 移除重复的transition属性，避免语法错误 */
}

/* 门 - 改为心形 */
.cabin-door {
    position: absolute;
    bottom: 30px; /* 与cabin-body底部对齐 */
    left: 85px; /* 居中位置 */
    width: 40px; /* 心形宽度 */
    height: 36px; /* 心形高度 */
    background: none; /* 移除背景 */
    z-index: 3;
    /* 添加心形门的光效 */
    animation: doorGlow 5s infinite alternate;
    /* 新增：防止山峦穿透 */
    overflow: hidden;
}

/* 心形门的光效动画 */
@keyframes doorGlow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(245, 215, 66, 0.4),
                    inset 0 0 8px rgba(200, 150, 30, 0.6); 
    }
    50% { 
        box-shadow: 0 0 15px rgba(245, 215, 66, 0.8),
                    inset 0 0 10px rgba(200, 150, 30, 0.8); 
    }
}

/* 心形门 */
.cabin-door::before,
.cabin-door::after {
    content: '';
    position: absolute;
    top: 0;
    width: 20px; /* 每个半圆宽度 */
    height: 32px; /* 高度 */
    background: #CD5C5C; /* 白天模式 - 浅红棕色 */
    border-radius: 20px 20px 0 0;
    /* 新增：防止山峦穿透 */
    overflow: hidden;
    transition: background-color 0.5s ease;
}

.dark-mode .cabin-door::before,
.dark-mode .cabin-door::after {
    background: #000; /* 纯黑色剪影 */
}

.cabin-door::before {
    left: 0;
    transform: rotate(-45deg);
    transform-origin: right bottom;
}

.cabin-door::after {
    left: 20px;
    transform: rotate(45deg);
    transform-origin: left bottom;
}

/* 窗户 - 调整位置避免与门重叠 */
.cabin-window {
    position: absolute;
    width: 25px;
    height: 25px;
    background: #f5d742;
    border-radius: 50%;
    z-index: 3;
    /* 添加窗户闪烁动画 */
    animation: windowGlow 5s infinite alternate;
    /* 新增：防止山峦穿透 */
    overflow: hidden;
}

@keyframes windowGlow {
    0%, 100% { 
        opacity: 0.8; 
        box-shadow: 0 0 10px rgba(245, 215, 66, 0.5), 
                    inset 0 0 8px rgba(200, 150, 30, 0.8); 
    }
    50% { 
        opacity: 1; 
        box-shadow: 0 0 20px rgba(245, 215, 66, 0.8), 
                    inset 0 0 10px rgba(200, 150, 30, 1); 
    }
}

.cabin-window-left {
    top: 40px; /* 向上移动 */
    left: 40px; /* 向左移动 */
}

.cabin-window-right {
    top: 40px; /* 向上移动 */
    right: 40px; /* 向右移动 */
}

/* 烟囱 */
.cabin-chimney {
    position: absolute;
    top: 0px; /* 调整位置 */
    right: 40px;
    width: 20px;
    height: 40px;
    background: #5D4037; /* 白天模式 - 深棕色 */
    z-index: 4;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    /* 新增：防止山峦穿透 */
    overflow: hidden;
    
    /* 深色模式 - 烟囱颜色 */
    transition: background-color 0.5s ease;
}

/* 深色模式 - 烟囱颜色 */
.dark-mode .cabin-chimney {
    background: #000; /* 纯黑色剪影 */
}

/* 烟囱烟雾 */
.chimney-smoke {
    position: absolute;
    top: -10px;
    left: 5px;
    width: 10px;
    height: 20px;
    background: rgba(200, 200, 200, 0.3);
    border-radius: 50%;
    animation: smoke 8s infinite linear;
    opacity: 0;
}

.chimney-smoke:nth-child(1) {
    animation-delay: 0s;
}

.chimney-smoke:nth-child(2) {
    animation-delay: 2s;
    top: -15px;
    left: 3px;
    width: 15px;
    height: 25px;
}

.chimney-smoke:nth-child(3) {
    animation-delay: 4s;
    top: -20px;
    left: 8px;
    width: 12px;
    height: 22px;
}

@keyframes smoke {
    0% { 
        transform: translateY(0) scale(1); 
        opacity: 0;
    }
    20% { 
        opacity: 0.4;
    }
    100% { 
        transform: translateY(-100px) scale(3); 
        opacity: 0;
    }
}

/* 树木 - 修复树叶显示问题 */
.cabin-tree {
    position: absolute;
    bottom: 30px; /* 与灯光底部对齐 */
    width: 15px;
    height: 80px;
    background: #5D4037; /* 白天模式 - 深棕色 */
    border-radius: 3px;
    z-index: 1;
    /* 新增：防止山峦穿透 */
    overflow: visible; /* 修复：改为visible避免裁剪树叶 */
    
    /* 深色模式 - 树干颜色 */
    transition: background-color 0.5s ease;
}

/* 深色模式 - 树干颜色 */
.dark-mode .cabin-tree {
    background: #000; /* 纯黑色剪影 */
}

/* 树叶部分 - 完全重写 */
.cabin-tree::before {
    content: '';
    position: absolute;
    top: -50px; /* 向上移动树叶位置 */
    left: -30px; /* 向左移动树叶位置 */
    width: 75px; /* 增加树叶宽度 */
    height: 90px; /* 增加树叶高度 */
    background: #228B22; /* 白天模式 - 森林绿 */
    border-radius: 50%;
    z-index: -1;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(46, 139, 87, 0.3); /* 增加外发光效果 */
    /* 移除 overflow: hidden; 确保树叶完整显示 */
    
    /* 深色模式 - 树叶颜色 */
    transition: background-color 0.5s ease;
}

/* 深色模式 - 树叶颜色 */
.dark-mode .cabin-tree::before {
    background: #000; /* 纯黑色剪影 */
}

/* 左侧树 - 向右移动 */
.cabin-tree-left {
    left: -50px; /* 调整位置避免重叠 */
}

/* 右侧树 - 重新添加 */
.cabin-tree-right {
    right: -50px; /* 调整位置避免重叠 */
}

/* 可点击状态的小屋样式 */
.cabin-container.cabin-active {
    pointer-events: auto;
    cursor: pointer;
    z-index: 2; /* 激活时进一步提高层级 */
}

/* ===== 新增雨滴效果 ===== */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4; /* 提升层级 */
    opacity: 0;
    transition: opacity 1s ease;
}

.dark-mode .rain-container {
    opacity: 0.7; /* 深色模式下显示雨滴 */
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, rgba(200, 220, 255, 0.8), rgba(180, 200, 255, 0.4));
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: fall linear infinite;
    z-index: 4; /* 提升层级 */
}

@keyframes fall {
    from {
        transform: translateY(-50px);
    }
    to {
        transform: translateY(100vh);
    }
}

/* ===== 增强彩虹效果 ===== */
.rainbow {
    position: fixed;
    top: 30%;
    left: -10%;
    width: 120%;
    height: 50%;
    z-index: -2; /* 在山脉前面，但在内容后面 */
    opacity: 0;
    pointer-events: none;
    /* 调整彩虹角度：左端下移，右端上移 */
    transform: rotate(-15deg);
    filter: blur(8px);
}

.rainbow-arc {
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent; /* 增加边框宽度 */
    border-top-color: currentColor;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.85; /* 增加透明度 */
}

/* 增强彩虹颜色 - 更饱和 */
.rainbow-arc:nth-child(1) { color: #ff3333; transform: scale(1.0); } /* 更亮的红色 */
.rainbow-arc:nth-child(2) { color: #ff9933; transform: scale(0.94); } /* 更亮的橙色 */
.rainbow-arc:nth-child(3) { color: #ffff33; transform: scale(0.88); } /* 更亮的黄色 */
.rainbow-arc:nth-child(4) { color: #33ff33; transform: scale(0.82); } /* 更亮的绿色 */
.rainbow-arc:nth-child(5) { color: #3366ff; transform: scale(0.76); } /* 更亮的蓝色 */
.rainbow-arc:nth-child(6) { color: #6633ff; transform: scale(0.70); } /* 更亮的靛色 */
.rainbow-arc:nth-child(7) { color: #cc33ff; transform: scale(0.64); } /* 更亮的紫色 */

/* 彩虹动画 - 修改为纯淡入淡出效果 */
@keyframes rainbowAppear {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes rainbowDisappear {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.rainbow-show {
    animation: rainbowAppear 2s ease-in-out forwards;
}

.rainbow-hide {
    animation: rainbowDisappear 1.5s ease-in-out forwards;
}

/* ===== 新增月亮消息框样式 ===== */
#moonMessage {
    position: fixed;
    top: 90px; /* 在月亮图标下方 */
    left: 20px;
    z-index: 1002; /* 在月亮图标之上 */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-width: 250px;
    display: none;
    color: #1e3a5f;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid rgba(44, 154, 138, 0.3);
    animation: moonMessageFadeIn 0.5s ease-out forwards;
    backdrop-filter: blur(5px);
    transform-origin: top left;
}

.dark-mode #moonMessage {
    background: rgba(26, 45, 59, 0.95);
    color: #e0e0e0;
    border: 1px solid rgba(61, 125, 202, 0.3);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

/* 添加小箭头指向月亮图标 */
#moonMessage::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(255, 255, 255, 0.95);
}

.dark-mode #moonMessage::before {
    border-bottom-color: rgba(26, 45, 59, 0.95);
}

/* 消息框动画 */
@keyframes moonMessageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes moonMessageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}