body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/background_day.gif');
    background-size: cover;
    background-position: center;
    transition: transform 2s ease-in-out;
    z-index: 1; /* 确保背景图在最底层 */
}

#tree-container {
    position: absolute;
    width: 50%;
    height: 50%;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    top: 35%; /* 调整顶部位置向上移动 */
    left: 50%; /* 水平居中 */
    transform: translate(-50%, 0) skew(1deg); /* 增加倾斜幅度 */
    z-index: 4; /* 确保树木在背景图和星空效果之上 */
}

#energy-balls-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 5; /* 确保能量球在树木之上 */
}

.energy-ball {
    position: absolute;
    width: 76px;
    height: 76px;
    background-image: url('../assets/images/energy_ball.png');
    background-size: contain;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
}

/* 被保护的能量球样式 */
.energy-ball.protected::after {
    content: '🛡️';  /* 使用盾牌表情 */
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.energy-ball.protected {
    background-image: url('../assets/images/energy_ball_protected.png');
}

.floating-text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: float-up 1s forwards;
}

@keyframes float-up {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

#ui-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 6; /* 确保UI容器在能量球之上 */
}

#stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#stats span {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}

#buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

button {
    background-color: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#task-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    overflow-y: auto;
}

.task {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 255, 0, 0.8);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    animation: fade-in-out 3s forwards;
    z-index: 7; /* 确保成就通知在所有元素之上 */
}

@keyframes fade-in-out {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* ... 保留之前的样式 ... */

#achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.achievement {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
    transition: background-color 0.3s;
}

.achievement.completed {
    background-color: rgba(0, 255, 0, 0.2); /* 已完成的成就背景色 */
}

.achievement h4 {
    margin: 0 0 5px 0;
}

.achievement p {
    margin: 0 0 5px 0;
    font-size: 0.9em;
}

.achievement .status {
    font-weight: bold;
}

#visiting-player-ui {
    position: fixed;
    top: 50px;
    left: 35px;
    right: 35px;
    bottom: 35px;
    z-index: 1000;
}

#visiting-player-ui .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2; /* 确保覆盖层在背景图和星空效果之上 */
}

#visiting-player-ui .player-info {
    position: relative;
    width: 80%;
    max-width: 600px;
    margin: 50px auto;
    background-color: rgba(47, 79, 79, 0.6);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 3; /* 确保玩家信息在覆盖层之上 */
}

#visiting-tree-container {
    position: absolute;
    width: 50%;
    height: 50%;
    top: calc(50% + 228px);
    left: 25%;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    z-index: 4;
    transform: translateY(-50%) scale(2.2); /* 添加 scale(1.5) 来放大 1.5 倍 */
}

#visiting-energy-balls-container {
    position: absolute;
    width: 100%;
    height: 50%; /* 调整高度为上半部分 */
    top: 0; /* 将能量球容器移到顶部 */
    left: 0;
    z-index: 5; /* 确保能量球在树之上 */
}

#visiting-player-ui #return-to-own-tree {
    position: absolute !important;
    top: 220px !important; /* 使用 !important 来确保这个值被应用 */
    left: 10px;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
    animation: pulse 2s infinite;
}

#return-to-own-tree img {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

/* 浇水动画 */
@keyframes watering {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

#tree-container.watering {
    animation: watering 0.9s ease-in-out;
}

.fertilizer-conversion {
    animation: fertilizer-glow 2s ease-in-out infinite;
}

@keyframes fertilizer-glow {
    0%, 100% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.2) saturate(1.2); }
}

button.active {
    background-color: rgba(0, 255, 0, 0.5);
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 20px;
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;  /* 确保内容不会溢出 */
}

.calendar-day.today {
    background-color: rgba(0, 255, 0, 0.3);
}

.calendar-day.completed {
    background-color: rgba(0, 255, 0, 0.5);
}

.calendar-day.available {
    background-color: rgba(255, 255, 0, 0.3);
}

.calendar-day.locked {
    background-color: rgba(255, 0, 0, 0.3);
}

#ranking-ui {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
}

#ranking-ui ol {
    padding-left: 20px;
}

#ranking-ui button {
    display: block;
    margin-top: 10px;
}

#player-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#player-stats div {
    color: #fff;
    margin: 5px;
    font-size: 14px;
}

#achievements-value {
    width: 100%;
    margin-top: 5px;
    font-style: italic;
}

.button-container {
    position: relative;
    display: inline-block;
}

.steal-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: bold;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-button:hover {
    transform: scale(1.1);
}

.image-button:active {
    transform: scale(0.95);
}

.image-button img {
    width: 100px; /* 调整图片大小 */
    height: auto;
}

.image-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fixed-bottom {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.fixed-bottom img {
    width: 80px; /* 调整图片大小，使其更适合底部固定位置 */
    height: auto;
}

.offline-reward-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
    animation: glow 2s infinite alternate;
}

.offline-reward-notification img {
    width: 80px;
    height: 80px;
    margin-right: 20px;
}

.offline-reward-notification .notification-text {
    color: white;
    font-size: 16px;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ffdd00, 0 0 35px #ffdd00, 0 0 40px #ffdd00, 0 0 50px #ffdd00, 0 0 75px #ffdd00;
    }
    to {
        box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #ffdd00, 0 0 70px #ffdd00, 0 0 80px #ffdd00, 0 0 100px #ffdd00, 0 0 150px #ffdd00;
    }
}

.floating-text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: float-up 1s forwards;
}

.floating-text.gold-text {
    color: gold;
    font-size: 20px;
    animation: float-up 1s forwards;
}

@keyframes float-up {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

#visiting-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/beijing.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1; /* 确保背景图在最底层 */
}

#visiting-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 2; /* 确保星空效果在背景图之上 */
}

#visiting-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/images/baby.gif') repeat;
    animation: moveStars 1826s linear infinite;
    z-index: 3; /* 确保星星在星空效果之上 */
}

@keyframes moveStars {
    from { background-position: 0 0; }
    to { background-position: 10000px 10000px; }
}

/* 添加动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 应用动画到切换任务页面的按钮 */
#switch-task img {
    animation: pulse 2s infinite;
}

/* 游戏控制按钮样式 */
#game-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
}

.control-button {
    width: 20%;
    max-width: 80px;
    aspect-ratio: 1 / 1;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.control-button:hover {
    transform: scale(1.1);
}

.control-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #game-controls {
        max-width: 100%;
        padding: 5px;
    }

    .control-button {
        width: 22%;
        max-width: 70px;
    }
}

@media (max-width: 480px) {
    #game-controls {
        padding: 3px;
    }

    .control-button {
        width: 24%;
        max-width: 60px;
    }
}

/* 修改底部切换任务按钮样式 */
.fixed-bottom {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.fixed-bottom img {
    width: 60px;
    height: auto;
}

@media (max-width: 768px) {
    .fixed-bottom img {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .fixed-bottom img {
        width: 40px;
    }
}

@keyframes flyIn {
    0% { transform: translate(-50%, -1000%); }
    60% { transform: translate(-50%, 20%); }
    100% { transform: translate(-50%, -50%); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, -50%); }
    40% { transform: translate(-50%, -100%); }
    60% { transform: translate(-50%, -75%); }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.5); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translate(-52%, -50%); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-54%, -50%); }
    20%, 40%, 60%, 80% { transform: translate(-48%, -50%); }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
}

#countdown {
    color: gold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#countdown.fly-in { animation: flyIn 1s ease-out; }
#countdown.bounce { animation: bounce 1s ease-in-out; }
#countdown.spin { animation: spin 1s linear; }
#countdown.pulse { animation: pulse 1s ease-in-out; }
#countdown.shake { animation: shake 0.5s ease-in-out; }
#countdown.fade-out { animation: fadeOut 1s ease-in-out; }

.steal-limit-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
    animation: popup-appear 0.5s ease-out;
}

.steal-limit-popup p {
    font-size: 18px;
    margin-bottom: 10px;
}

.steal-limit-popup .emoji-container {
    font-size: 24px;
    line-height: 1.5;
}

@keyframes popup-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.steal-limit-popup.fade-out {
    animation: popup-fadeout 0.5s ease-in forwards;
}

@keyframes popup-fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#tree-container.watering::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 266px;  /* 根据精灵图的实际尺寸调整 */
    height: 158px; /* 根据精灵图的实际尺寸调整 */
    background-image: url('../assets/images/watering_sprite.png');
    background-repeat: no-repeat;
    animation: watering-sprite 0.9s steps(4) infinite;  /* 假设精灵图有8帧 */
}

@keyframes watering-sprite {
    from { background-position: 0 0; }
    to { background-position: -528px 0; }  /* 假设精灵图总宽度为800px */
}

/* 修改现有的浇水动画 */
#tree-container.watering {
    animation: tree-shake 0.9s ease-in-out;
}

@keyframes tree-shake {
    0%, 100% { transform: translate(-50%, 0) skew(1deg); }
    25% { transform: translate(-52%, 0) skew(0.5deg); }
    75% { transform: translate(-48%, 0) skew(1.5deg); }
}

/* 为浇水按钮添加样式 */
#water-tree {
    display: flex;
    align-items: center;
    justify-content: center;
}

#water-tree img {
    width: 100%;
    height: 100%;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #fff, 0 0 20px #ff00de, 0 0 35px #ff00de, 0 0 40px #ff00de, 0 0 50px #ff00de, 0 0 75px #ff00de;
    }
    100% {
        box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #ff00de, 0 0 70px #ff00de, 0 0 80px #ff00de, 0 0 100px #ff00de, 0 0 150px #ff00de;
    }
}

.calendar-day.glow {
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
}

.calendar-day.glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
    animation: glow 2s ease-in-out infinite alternate;
}

.calendar-day.today.glow {
    animation: glow 1s ease-in-out infinite alternate;
}

.reward-button {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 25%;  /* 增加大小以便更容易看到 */
    height: 25%;
    padding: 0;
    background: none;
    border: none;
    font-size: 20px;  /* 增加字体大小 */
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.reward-button:hover {
    transform: scale(1.2);
}

.reward-button::after {
    content: '🎁';
    font-size: 100%;
}

/* 为化肥转换按钮添加相对定位 */
#convert-fertilizer {
    position: relative;
}

/* 调整浮动文本的样式 */
.floating-text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: float-up 1s forwards;
    pointer-events: none; /* 确保文本不会干扰点击事件 */
}

@keyframes float-up {
    0% { 
        transform: translateY(0);
        opacity: 1; 
    }
    100% { 
        transform: translateY(-30px);
        opacity: 0; 
    }
}

/* 为活跃状态的按钮添加样式 */
.control-button.active {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.remaining-steal-count {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
}

.remaining-steal-count.active {
    background-color: red;
    color: white;
}

.remaining-steal-count.inactive {
    background-color: gray;
    color: white;
}

#find-player {
    position: relative;
    transition: opacity 0.3s ease;
}

#find-player.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#find-player.disabled img {
    filter: grayscale(100%);
}

.remaining-steal-count {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
}

.remaining-steal-count.active {
    background-color: red;
    color: white;
}

.remaining-steal-count.inactive {
    background-color: gray;
    color: white;
}

#gift-emoji-container {
    margin-top: 10px;
}

.gift-emoji-row {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.gift-emoji {
    font-size: 24px;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-emoji:hover {
    transform: scale(1.2);
}

/* 新增被点亮的状态样式 */
.gift-emoji.claimed {
    background: linear-gradient(to right, white, transparent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7); /* 发光效果 */
}

/* 添加到文件末尾 */

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.custom-alert.show {
    opacity: 1;
}

.custom-alert.hide {
    opacity: 0;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

.button-container {
    display: flex; /* 使用 flexbox 布局 */
    justify-content: space-between; /* 按钮之间的间距 */
    margin-bottom: 5px; /* 按钮之间的垂直间距 */
}

.button-container button {
    background-color: rgba(76, 175, 80, 0.8); /* 绿色背景，带透明度 */
    color: white; /* 白色文字 */
    border: none; /* 无边框 */
    padding: 10px 15px; /* 内边距 */
    border-radius: 5px; /* 圆角 */
    cursor: pointer; /* 鼠标悬停时显示手型 */
    transition: background-color 0.3s; /* 添加过渡效果 */
	margin-bottom: 5px; /* 按钮之间的垂直间距 */
}

.button-container button:hover {
    background-color: rgba(76, 175, 80, 0.9); /* 悬停时变为不透明的绿色 */
}

.button-container button:disabled {
    background-color: #ccc; /* 灰色背景 */
    cursor: not-allowed; /* 鼠标悬停时显示禁止手型 */
    opacity: 0.5; /* 半透明效果 */
}

.claimed {
    opacity: 0.5; /* 使按钮变得半透明 */
    cursor: not-allowed; /* 改变光标样式为不可点击 */
    filter: grayscale(100%); /* 使按钮变为灰色 */
}

#convert-fertilizer:active {
    background-color: rgba(255, 255, 0, 0.5); /* 按钮被按下时的背景颜色 */
}

.progress-bar {
    position: absolute;
    height: 10px; /* 进度条高度 */
    background-color: green; /* 进度条颜色 */
    transition: width 0.1s; /* 进度条宽度变化的过渡效果 */
    z-index: 10; /* 确保进度条在按钮上方 */
    top: 50px; /* 根据需要调整进度条的位置 */
    left: 0; /* 水平居中 */
    width: 0; /* 初始宽度为0 */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
}

button.active {
    animation: pulse 1s infinite; /* 添加动画效果 */
}

/* 在文件末尾添加或修改以下样式 */

#sidebar {
    position: fixed;
    top: 50%;
    left: -60px; /* 初始状态下隐藏，只显示切换按钮 */
    transform: translateY(-50%);
    height: auto; /* 改为自适应高度 */
    width: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    transition: left 0.3s ease;
    z-index: 1000; /* 确保侧边栏始终在最上层 */
    border-radius: 0 10px 10px 0; /* 添加圆角 */
    padding: 1px 0; /* 添加一些内边距 */
}

#sidebar.open {
    left: 0;
    width: 100px;
    #sidebar-toggle {
        display: none;
    }
    #sidebar-close {
        opacity: 1; /* 显示关闭按钮 */
        pointer-events: auto; /* 允许点击 */
    }
}

#sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 0;
    cursor: pointer;
    z-index: 1001; /* 确保切换按钮始终可见 */
    animation: glow 3s infinite;
}

#sidebar-toggle:hover {
    transform: translateY(-50%) scale(1.1);
}


#sidebar-content {
    padding: 40px 20px 20px;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#monitor-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    animation: glow 3s infinite;
    border-radius: 50%;
}

#monitor-link img {
    width: 51px;
    height: 51px;
    transition: transform 0.3s ease;
}

#monitor-link:hover img {
    transform: scale(1.1);
}

#sidebar-close {
    position: absolute;
    top: 0;
    right: -2px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 0;
    opacity: 0; /* 初始状态隐藏 */
    pointer-events: none; /* 初始状态不可点击 */
}


#game-container {
    transition: margin-left 0.3s ease;
}

#game-container.sidebar-open {
    margin-left: 200px;
}

@media (max-width: 768px) {
    #sidebar {
        width: 150px;
        left: -150px;
    }

    #game-container.sidebar-open {
        margin-left: 150px;
    }
    #sidebar.open {
        width: 75px;
    }
}

.sidebar-open {
  margin-left: 16rem; /* 当侧边栏打开时，为主内容添加左边距 */
}

@media (max-width: 768px) {
  .sidebar-open {
    margin-left: 4rem; /* 在移动设备上减少边距 */
  }
}


@keyframes glow {
    0% {
        box-shadow: 0 0 5px 0px skyblue;
    }
    50% {
        box-shadow: 0 0 20px 10px skyblue;
    }
    100% {
        box-shadow: 0 0 5px 0px skyblue;
    }
}


