/* 森林塔防游戏样式 - 移动端优化版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
}

.game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 移动端触摸摇杆 */
.touch-controls {
    position: fixed;
    bottom: 60px;
    left: 15px;
    z-index: 100;
    display: none;
}

/* 手机端显示触摸摇杆 */
@media screen and (max-width: 767px) {
    .touch-controls {
        display: block;
    }
}

/* PC端隐藏触摸摇杆 */
@media (min-width: 1024px) {
    .touch-controls {
        display: none !important;
    }
}

.joystick-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.joystick-base {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-stick {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #5a9fd4 0%, #2e7bc4 50%, #1e5a9e 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.05s ease-out;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.joystick-stick:active {
    background: radial-gradient(circle at 30% 30%, #6aafe4 0%, #3e8bd4 50%, #2e6abe 100%);
}

/* iPad等平板设备优化 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .touch-controls {
        bottom: 150px;
        left: 30px;
    }
    
    .dpad-container {
        padding: 20px;
        border-radius: 60px;
    }
    
    .dpad {
        width: 150px;
        height: 150px;
        gap: 10px;
    }
    
    .dpad-btn {
        font-size: 24px;
        border-radius: 15px;
        border-width: 3px;
    }
}

/* 手机设备优化 - 竖屏布局（最大化地图区域） */
@media screen and (max-width: 767px) {
    /* 游戏头部 - 最小化高度 */
    .game-header {
        padding: 2px 4px;
        background: rgba(0, 0, 0, 0.8);
        border-bottom: 1px solid #8b4513;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: 24px;
    }
    
    .game-header h1 {
        display: none;
    }
    
    .status-bar {
        font-size: 0.55em;
        gap: 1px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 1px;
    }
    
    .resource {
        padding: 1px 2px;
        min-width: 40px;
        white-space: nowrap;
    }
    
    /* 游戏容器 - 竖屏布局 */
    .game-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    /* 游戏画布容器 - 最大化竖屏空间 */
    .game-canvas-container {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        background: #87ceeb;
        margin-top: 24px;
        margin-bottom: 0;
        width: 100vw;
        height: calc(100vh - 24px - 40px); /* 头部24px + 控制面板40px */
    }
    
    /* 游戏画布 - 竖屏优化，填满整个可用区域 */
    #game-canvas {
        width: 100vw !important;
        height: calc(100vh - 24px - 40px) !important;
        max-width: 100vw;
        max-height: calc(100vh - 24px - 40px);
        object-fit: fill; /* 填满整个区域，不保持原始比例 */
        display: block;
    }
    
    /* 移除横纵比限制，让画布自适应竖屏 */
    
    /* 智能控制面板 - 最小化高度 */
    .control-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 40px;
        background: rgba(139, 69, 19, 0.95);
        border-top: 1px solid #ffd700;
        z-index: 100;
        padding: 1px;
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    .quick-actions {
        display: flex;
        gap: 0.5px;
        justify-content: space-around;
        width: 100%;
        flex: 1;
    }
    
    .quick-actions.row-1 {
        justify-content: space-between;
        padding: 0 2px;
    }
    
    .quick-actions.row-2 {
        justify-content: space-between;
        padding: 0 2px;
    }
    
    .quick-btn {
        width: 22px;
        height: 22px;
        font-size: 0.45em;
        flex-shrink: 0;
        margin: 0 0.25px;
    }
    
    .quick-btn .icon {
        font-size: 0.65em;
    }
    
    .quick-btn::after {
        font-size: 0.35em;
        bottom: -4px;
    }
    
    /* 触摸控制区域 - 显示并优化位置 */
    .touch-controls {
        display: block !important;
        position: fixed;
        bottom: 65px;
        left: 10px;
        z-index: 100;
    }
    
    .dpad-container {
        padding: 8px;
        border-radius: 35px;
    }
    
    .dpad {
        width: 90px;
        height: 90px;
        gap: 4px;
    }
    
    .dpad-btn {
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* 交互按钮优化 */
    .interaction-btn {
        padding: 5px 10px;
        font-size: 0.8em;
        min-width: 80px;
    }
    
    /* 设置面板优化 */
    .settings-panel {
        width: 90%;
        max-width: 300px;
        padding: 10px;
        font-size: 0.9em;
    }
    
    .settings-panel h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .settings-panel button {
        padding: 5px 8px;
        font-size: 0.8em;
        margin: 0 3px;
    }
    
    /* 结果模态框优化 */
    .result-modal {
        width: 90%;
        max-width: 300px;
        padding: 15px;
    }
    
    .result-modal h2 {
        font-size: 1.3em;
    }
    
    .result-stats {
        font-size: 0.9em;
        gap: 8px;
    }
    
    .result-buttons {
        gap: 8px;
    }
    
    .result-buttons button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    /* 修复列表在移动端的显示 */
    .repair-list {
        right: 10px;
        max-height: 50vh;
        font-size: 0.8em;
    }
    
    .repair-btn {
        min-width: 140px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 游戏头部样式 */
.game-header {
    display: block;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #8b4513;
    z-index: 10;
}

.game-header h1 {
    font-size: 1.5em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    text-align: center;
}

.status-bar {
    display: flex;
    justify-content: space-around;
    font-size: 0.9em;
}

.resource {
    background: rgba(139, 69, 19, 0.8);
    padding: 5px 10px;
    border-radius: 15px;
    border: 1px solid #deb887;
    min-width: 80px;
    text-align: center;
}

.resource .label {
    font-weight: bold;
    color: #ffd700;
    font-size: 0.8em;
}

.wave-info.elite {
    color: #ff4500;
    font-weight: bold;
    text-shadow: 0 0 5px #ff4500;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 全屏按钮样式 */
.fullscreen-btn {
    background: rgba(255, 215, 0, 0.8);
    border: none;
    border-radius: 5px;
    color: #333;
    font-size: 1.2em;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: rgba(255, 215, 0, 1);
    transform: scale(1.1);
}

/* 全屏模式样式 */
.game-container.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.game-container.fullscreen .game-canvas-container {
    width: 100% !important;
    height: calc(100% - 80px) !important;
}

.game-container.fullscreen #game-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 游戏结果提示样式 */
.result-modal {
    display: none;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.result-content {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    border: 3px solid #ffd700;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.result-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

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

.result-content h2 {
    color: #ffd700;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-content p {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 25px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: #ccc;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    color: #ffd700;
    font-size: 1.3em;
    font-weight: bold;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.result-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-btn.primary {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #333;
}

.result-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.result-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid #ffd700;
}

.result-btn.secondary:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.result-btn.restore {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    border: 2px solid #66BB6A;
}

.result-btn.restore:hover {
    background: linear-gradient(135deg, #66BB6A, #4CAF50);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* 时间显示优化 */
.time-display {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.time-display.day {
    background: linear-gradient(135deg, #87CEEB, #4682B4);
    color: #fff;
    box-shadow: 0 2px 5px rgba(135, 206, 235, 0.5);
}

.time-display.night {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    box-shadow: 0 2px 5px rgba(44, 62, 80, 0.5);
    animation: nightGlow 2s infinite;
}

@keyframes nightGlow {
    0%, 100% { box-shadow: 0 2px 5px rgba(44, 62, 80, 0.5); }
    50% { box-shadow: 0 2px 10px rgba(44, 62, 80, 0.8); }
}

/* 时间倒计时 */
.time-countdown {
    font-size: 0.8em;
    margin-top: 2px;
    opacity: 0.8;
}

/* PC端优化 */
@media (min-width: 1024px) {
    .game-container {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .game-canvas-container {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    #game-canvas {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

/* 游戏画布容器（增大占比） */
.game-canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    margin: 0 10px; /* 减少边距 */
    background: linear-gradient(45deg, #228b22, #32cd32);
}

#game-canvas {
    border: 3px solid #8b4513;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: #90c695;
    max-width: 95%; /* 增大画布宽度 */
    max-height: 95%;
    cursor: crosshair;
}

/* 简化控制面板 */
.control-panel {
    background: rgba(139, 69, 19, 0.9);
    padding: 15px;
    border-top: 3px solid #ffd700;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90px; /* 增大高度 */
    z-index: 10;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.quick-actions {
    display: flex;
    gap: 20px; /* 增大间距 */
    align-items: center;
}

.quick-btn {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    border: 2px solid #deb887;
    border-radius: 50%;
    width: 65px; /* 增大尺寸 */
    height: 65px; /* 增大尺寸 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5em; /* 增大字体 */
    color: #fff;
    position: relative;
}

.quick-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    font-size: 0.5em;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quick-btn:hover {
    background: linear-gradient(135deg, #a0522d, #cd853f);
    transform: scale(1.15); /* 增大悬停效果 */
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.5);
}

/* 弹出菜单样式 */
.popup-menu {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.popup-menu-content {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 20px;
    min-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.popup-menu-content h4 {
    color: #ffd700;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.3em;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.menu-item-btn {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    border: 2px solid #deb887;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-item-btn:hover {
    background: linear-gradient(135deg, #a0522d, #cd853f);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.menu-item-btn .icon {
    font-size: 1.8em;
}

.menu-item-btn .label {
    color: #fff;
    font-size: 0.9em;
    font-weight: bold;
}

.menu-item-btn .cost {
    color: #ffd700;
    font-size: 0.75em;
}

.close-menu-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    padding: 10px;
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-menu-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: scale(1.02);
}

.quick-btn.settings-btn {
    background: linear-gradient(135deg, #4169e1, #1e90ff);
    border-color: #87ceeb;
}

.quick-btn.settings-btn:hover {
    background: linear-gradient(135deg, #1e90ff, #00bfff);
}

/* 设置面板 */
.settings-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 30px;
    max-width: 300px;
    text-align: center;
}

.settings-content h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.setting-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.setting-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #ffd700;
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.setting-btn .icon {
    font-size: 1.2em;
}

.setting-btn .label {
    font-size: 0.9em;
}

.close-settings {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-settings:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    margin: 5% auto;
    padding: 20px;
    border: 3px solid #8b4513;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #ffd700;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover {
    color: #fff;
}

.help-sections {
    margin-top: 20px;
}

.help-section {
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
}

.help-section h3 {
    color: #ffd700;
    margin-bottom: 10px;
}

.help-section ul {
    list-style-type: none;
    padding-left: 10px;
}

.help-section li {
    margin: 8px 0;
    padding-left: 10px;
    border-left: 2px solid #ffd700;
}

/* 帮助模态框特殊样式 */
.help-modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.help-modal-content h2 {
    text-align: center;
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.help-modal-content .help-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.help-modal-content .help-section {
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.help-modal-content .help-section h3 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 1em;
}

.help-modal-content .help-section li {
    margin: 5px 0;
    padding-left: 8px;
    font-size: 0.85em;
    line-height: 1.4;
}

/* 响应式设计 - 平板和小屏设备 */
@media (max-width: 768px) and (min-width: 481px) {
    .touch-controls {
        display: block !important;
    }
}

    /* 小屏手机设备优化 */
@media (max-width: 480px) {
    .game-header {
        height: 30px;
        padding: 2px 4px;
    }
    
    .status-bar {
        font-size: 0.6em;
        gap: 2px;
    }
    
    .resource {
        padding: 1px 3px;
        min-width: 45px;
    }
    
    .game-canvas-container {
        margin-top: 30px;
        margin-bottom: 55px;
        height: calc(100vh - 30px - 55px);
    }
    
    #game-canvas {
        height: calc(100vh - 30px - 55px) !important;
    }
    
    @media (max-aspect-ratio: 9/16) {
        #game-canvas {
            width: calc((100vh - 30px - 55px) * 16 / 9) !important;
            height: calc(100vh - 30px - 55px) !important;
        }
    }
    
    .control-panel {
        height: 55px;
        padding: 2px;
    }
    
    .dpad {
        width: 90px;
        height: 90px;
    }
    
    .dpad-btn {
        font-size: 14px;
    }
    
    .touch-controls {
        bottom: 60px;
        left: 8px;
    }
    
    .quick-btn {
        width: 26px;
        height: 26px;
        font-size: 0.5em;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .game-header {
        padding: 5px 10px;
    }
    
    .game-header h1 {
        font-size: 1em;
        margin-bottom: 5px;
    }
    
    .status-bar {
        flex-direction: row;
        gap: 10px;
    }
    
    .control-panel {
        padding: 8px;
    }
    
    .building-grid {
        grid-template-columns: repeat(5, 1fr);
        margin-bottom: 8px;
    }
    
    .action-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .touch-controls {
        bottom: 80px;
    }
}

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

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* 血量条样式 */
.health-bar {
    position: absolute;
    width: 40px;
    height: 4px;
    background: #ff0000;
    border-radius: 2px;
}

.health-bar-fill {
    height: 100%;
    background: #00ff00;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 移动端优化 */
@media (hover: none) and (pointer: coarse) {
    .build-btn:hover,
    .action-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .build-btn:active,
    .action-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* 修复列表容器 */
.repair-list {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 100;
    pointer-events: none; /* 让鼠标事件穿透容器 */
}

/* 修复按钮样式 */
.repair-btn {
    pointer-events: auto; /* 按钮可以点击 */
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: 2px solid #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 160px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.9;
}

.repair-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    opacity: 1;
    z-index: 101;
}

.repair-btn:active {
    transform: scale(0.95);
}

.repair-btn .info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.repair-btn .name {
    font-weight: bold;
    margin-bottom: 2px;
}

.repair-btn .hp-bar {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.repair-btn .hp-fill {
    height: 100%;
    background: #2ecc71;
}

.repair-btn .cost {
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* 自动砍树按钮激活状态 */
.quick-btn.active {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    border-color: #a3e4d7 !important;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
