body {
    font-family: 'Courier New', monospace;
    background-color: #333;
    margin: 0;
    padding: 10px;
    color: #fff;
}

/* 新手引导样式 */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.tutorial-content {
    background-color: rgba(68, 68, 68, 0.85);
    border-radius: 8px;
    padding: 20px;
    max-width: 100vw;
    max-height: 80%;
    width: 75vw;
    min-width: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
    animation: slideIn 0.3s ease-out;
    z-index: 1001;
}

/* 大屏幕上使用自适应宽度 */
@media (min-width: 1200px) {
    .tutorial-content {
        width: fit-content;
        max-width: 800px;
    }
}

/* 中等屏幕上使用80%宽度 */
@media (min-width: 768px) and (max-width: 1199px) {
    .tutorial-content {
        width: 80vw;
        max-width: 700px;
    }
}

/* 小屏幕上保持75vw */
@media (max-width: 767px) {
    .tutorial-content {
        width: 75vw;
        min-width: 280px;
    }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.tutorial-header h3 {
    margin: 0;
    color: #4CAF50;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

.skip-btn {
    background-color: #666;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(12px, 2.5vw, 14px);
    transition: background-color 0.2s;
}

.skip-btn:hover {
    background-color: #777;
}

.tutorial-body {
    margin-bottom: 20px;
    color: #ddd;
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.5;
    text-align: left;
}

.tutorial-step h4 {
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 10px;
}

.tutorial-step p {
    margin-bottom: 15px;
}

.tutorial-step ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tutorial-step li {
    margin-bottom: 8px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group p {
    margin-bottom: 8px;
    color: #4CAF50;
    font-weight: bold;
}

.tips {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    padding: 10px;
    margin: 15px 0;
    border-radius: 4px;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #555;
    padding-top: 15px;
}

.tutorial-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(14px, 3vw, 16px);
    transition: background-color 0.2s;
}

.tutorial-btn:hover {
    background-color: #45a049;
}

.prev-btn {
    background-color: #666;
}

.prev-btn:hover {
    background-color: #777;
}

.step-indicator {
    color: #aaa;
    font-size: clamp(12px, 2.5vw, 14px);
}

.tutorial-highlight {
    position: fixed;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 999;
    display: none;
    transition: all 0.3s ease;
}

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

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

.game-container {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 5px;
}

h1 {
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 5px 0;
}

.difficulty-selection {
    margin: 8px auto;
    font-size: clamp(14px, 3vw, 18px);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
    padding: 0 2px;
    width: fit-content;
    max-width: 95vw;
    box-sizing: border-box;
}

.difficulty-selection label {
    color: #4CAF50;
    font-weight: bold;
}

.difficulty-btn {
    background-color: #555;
    color: white;
    border: 1px solid #777;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: clamp(12px, 2.5vw, 16px);
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 45px;
    margin: 0 1px;
    flex: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.difficulty-btn:hover {
    background-color: #666;
}

.difficulty-btn.active {
    background-color: #4CAF50;
    border-color: #45a049;
    font-weight: bold;
}

.instructions {
    margin: 10px 0;
    font-size: clamp(12px, 2.5vw, 16px);
    color: #ccc;
}

.controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

button {
    background-color: #555;
    color: white;
    border: 1px solid #777;
    padding: 8px 12px;
    margin: 3px;
    cursor: pointer;
    border-radius: 4px;
    font-size: clamp(10px, 2.5vw, 14px);
    min-width: 50px;
    transition: all 0.2s;
}

button:hover {
    background-color: #666;
}

button:active {
    background-color: #444;
}

/* 移动设备上的触摸优化 */
@media (hover: none) {
    button {
        padding: 12px 15px;
        font-size: clamp(14px, 3vw, 16px);
        min-width: 60px;
    }
}

.game-info {
    margin: 10px 0;
    font-size: clamp(11px, 2.5vw, 14px);
    color: #ff9999;
}

/* 响应式媒体查询 */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .game-container {
        padding: 3px;
    }
    
    .controls {
        gap: 3px;
    }
    
    .stats {
        gap: 5px;
        max-width: 90vw;
    }
    
    .stat-item {
        padding: 3px 6px;
        font-size: clamp(10px, 2.5vw, 13px);
    }
}

@media (max-width: 480px) {
    .difficulty-selection {
        gap: 2px;
        padding: 0 5px;
    }
    
    .difficulty-btn {
        padding: 8px 5px;
        font-size: clamp(12px, 3vw, 14px);
        min-width: 40px;
        margin: 0;
        flex: 1;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 80%;
        max-width: 200px;
    }
    
    .stats {
        gap: 4px;
        max-width: 85vw;
    }
}

@media (max-width: 320px) {
    .difficulty-selection {
        padding: 0 2px;
        gap: 1px;
    }
    
    .difficulty-btn {
        padding: 6px 3px;
        font-size: 11px;
        min-width: 35px;
    }
    
    .player::before {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .player::before {
        font-size: 18px;
    }
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px auto;
    font-size: clamp(11px, 2.5vw, 15px);
    width: fit-content;
    max-width: 95vw;
}

.stat-item {
    display: flex;
    align-items: center;
    background-color: #444;
    padding: 4px 8px;
    border-radius: 5px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 2px;
    min-width: 0;
    flex: 0 1 auto;
}

.stat-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 3px;
    box-shadow: inset 2px 2px 4px rgba(255,255,255,0.2), 
                inset -2px -2px 4px rgba(0,0,0,0.2),
                1px 1px 2px rgba(0,0,0,0.5);
}

.game-board {
    display: grid;
    gap: 1px;
    margin: 0 auto;
    border: 2px solid #555;
    background-color: #555;
    width: fit-content;
    max-width: 95vw;
    min-height: 200px;
    overflow: visible;
}

.cell {
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.cell:hover {
    background-color: #666;
}

/* 方块类型样式 */
.stone {
    background-color: #808080;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23808080'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%23606060'/%3E%3Ccircle cx='25' cy='15' r='2.5' fill='%23606060'/%3E%3Ccircle cx='30' cy='30' r='2' fill='%23606060'/%3E%3C/svg%3E");
}

.iron-ore {
    background-color: #c0c0c0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23c0c0c0'/%3E%3Ccircle cx='15' cy='15' r='6' fill='%23a0a0a0'/%3E%3Ccircle cx='20' cy='20' r='1.5' fill='%23808080'/%3E%3C/svg%3E");
}

.diamond-ore {
    background-color: #b0e0e6;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23b0e0e6'/%3E%3Cpolygon points='20,14 26,20 20,26 14,20' fill='%2387ceeb'/%3E%3C/svg%3E");
}

/* 部分挖掘的钻石矿 */
.diamond-ore.partially-mined {
    background-color: #87ceeb;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%2387ceeb'/%3E%3Cpolygon points='20,14 26,20 20,26 14,20' fill='%235a9fc2'/%3E%3Crect x='0' y='0' width='40' height='20' fill='%23808080' opacity='0.5'/%3E%3C/svg%3E");
}

.lava {
    background-color: #ff4500;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23ff4500'/%3E%3Ccircle cx='10' cy='10' r='3' fill='%23ff8c00'/%3E%3Ccircle cx='25' cy='15' r='3.5' fill='%23ff8c00'/%3E%3Ccircle cx='30' cy='30' r='3' fill='%23ff8c00'/%3E%3C/svg%3E");
}

.wood {
    background-color: #8B4513;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%238B4513'/%3E%3Crect x='5' y='5' width='30' height='3' fill='%235D2906'/%3E%3Crect x='5' y='15' width='30' height='3' fill='%235D2906'/%3E%3Crect x='5' y='25' width='30' height='3' fill='%235D2906'/%3E%3C/svg%3E");
}

.tnt {
    background-color: #FF4500;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23FF4500'/%3E%3Crect x='11' y='11' width='18' height='18' fill='%23000'/%3E%3Ctext x='20' y='24' font-family='Arial' font-size='12' fill='%23FFF' text-anchor='middle'%3ET%3C/text%3E%3C/svg%3E");
    box-shadow: inset 3px 3px 6px rgba(255,255,255,0.2),
                inset -3px -3px 6px rgba(0,0,0,0.3),
                0 3px 6px rgba(0,0,0,0.3);
}

.antimatter-tnt {
    background-color: #9932CC;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%239932CC'/%3E%3Crect x='11' y='11' width='18' height='18' fill='%23000'/%3E%3Ctext x='20' y='24' font-family='Arial' font-size='12' fill='%23FFF' text-anchor='middle'%3EA%3C/text%3E%3C/svg%3E");
    box-shadow: inset 3px 3px 6px rgba(255,255,255,0.2),
                inset -3px -3px 6px rgba(0,0,0,0.3),
                0 3px 6px rgba(0,0,0,0.3);
    animation: antimatterGlow 1s infinite alternate;
}

@keyframes antimatterGlow {
    from {
        box-shadow: inset 3px 3px 6px rgba(255,255,255,0.2),
                    inset -3px -3px 6px rgba(0,0,0,0.3),
                    0 0 5px rgba(153, 50, 204, 0.5);
    }
    to {
        box-shadow: inset 3px 3px 6px rgba(255,255,255,0.2),
                    inset -3px -3px 6px rgba(0,0,0,0.3),
                    0 0 15px rgba(153, 50, 204, 0.8);
    }
}

.water {
    background-color: #1E90FF;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%231E90FF'/%3E%3Ccircle cx='8' cy='8' r='2.5' fill='%2387CEEB'/%3E%3Ccircle cx='20' cy='15' r='3' fill='%2387CEEB'/%3E%3Ccircle cx='30' cy='25' r='2.5' fill='%2387CEEB'/%3E%3C/svg%3E");
}

.cobblestone {
    background-color: #696969;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23696969'/%3E%3Cpolygon points='0,0 10,0 0,10' fill='%23555'/%3E%3Cpolygon points='10,0 20,0 20,10 0,10' fill='%23777'/%3E%3Cpolygon points='20,0 30,0 30,10 10,10' fill='%23555'/%3E%3Cpolygon points='30,0 40,0 40,10 20,10' fill='%23777'/%3E%3Cpolygon points='0,10 10,10 0,20' fill='%23777'/%3E%3Cpolygon points='10,10 20,10 20,20 0,20' fill='%23555'/%3E%3Cpolygon points='20,10 30,10 30,20 10,20' fill='%23777'/%3E%3Cpolygon points='30,10 40,10 40,20 20,20' fill='%23555'/%3E%3C/svg%3E");
}

.monster {
    background-color: #32CD32;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%2332CD32'/%3E%3Ccircle cx='14' cy='14' r='3' fill='%23000'/%3E%3Ccircle cx='26' cy='14' r='3' fill='%23000'/%3E%3Cpath d='M14 24 Q20 27 26 24' stroke='%23000' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    border: 3px solid #000000;
    animation: monsterGlow 1.5s infinite alternate;
}

.zombie {
    background-color: #9ACD32;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%239ACD32'/%3E%3Ccircle cx='20' cy='14' r='5.5' fill='%23228B22'/%3E%3Crect x='17' y='23' width='6' height='6' fill='%23228B22'/%3E%3C/svg%3E");
    border: 3px solid #000000;
    animation: monsterGlow 1.5s infinite alternate;
}



/* 怪物红色闪光动画 */
@keyframes monsterGlow {
    from {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    to {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    }
}

.glass {
    background-color: #87CEEB;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%2387CEEB'/%3E%3Cline x1='0' y1='0' x2='40' y2='40' stroke='%23FFF' stroke-width='1'/%3E%3Cline x1='40' y1='0' x2='0' y2='40' stroke='%23FFF' stroke-width='1'/%3E%3C/svg%3E");
}

.dirt {
    background-color: #8B4513;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%238B4513'/%3E%3Ccircle cx='10' cy='10' r='2' fill='%235D2906'/%3E%3Ccircle cx='25' cy='15' r='2.5' fill='%235D2906'/%3E%3Ccircle cx='30' cy='30' r='2' fill='%235D2906'/%3E%3C/svg%3E");
}

.wool {
    background-color: #FF69B4;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23FF69B4'/%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23FF1493'/%3E%3Ccircle cx='20' cy='15' r='2' fill='%23FF1493'/%3E%3Ccircle cx='30' cy='10' r='1.5' fill='%23FF1493'/%3E%3Ccircle cx='15' cy='25' r='2' fill='%23FF1493'/%3E%3Ccircle cx='25' cy='30' r='1.5' fill='%23FF1493'/%3E%3C/svg%3E");
}

.golden-apple {
    background-color: #FFD700;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23FFD700'/%3E%3Ccircle cx='20' cy='20' r='8' fill='%23DAA520'/%3E%3Cpath d='M18 10 Q20 7 22 10' stroke='%238B4513' stroke-width='0.8' fill='none'/%3E%3C/svg%3E");
}

.player {
    background: radial-gradient(circle, #00ff00 0%, #00cc00 50%, #008800 100%);
    border: 4px solid #005500;
    z-index: 10;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.9), 
                0 0 25px rgba(0, 255, 0, 0.6),
                inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: playerPulse 2s infinite alternate;
    position: relative;
}

.player::before {
    content: '😊';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    z-index: 11;
}

/* 玩家在空方块上（可以移动） */
.cell.empty.player,
.cell.mined.player {
    background: radial-gradient(circle, #00ff00 0%, #00cc00 50%, #008800 100%);
    border: 4px solid #005500;
}

.cell.empty.player::before,
.cell.mined.player::before {
    content: '😊';
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* 玩家在非空方块上（需要挖掘） */
.cell:not(.empty):not(.mined).player {
    background: radial-gradient(circle, #ff9800 0%, #ff6f00 50%, #e65100 100%);
    border: 4px solid #bf360c;
    animation: playerNeedsMinePulse 1.5s infinite alternate;
}

.cell:not(.empty):not(.mined).player::before {
    content: '⛏️';
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: pickaxeSwing 1s infinite ease-in-out;
}

@keyframes playerNeedsMinePulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 152, 0, 0.9), 
                    0 0 25px rgba(255, 152, 0, 0.6),
                    inset 0 0 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 1), 
                    0 0 35px rgba(255, 152, 0, 0.8),
                    inset 0 0 15px rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }
}

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

@keyframes playerPulse {
    0% {
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.9), 
                    0 0 25px rgba(0, 255, 0, 0.6),
                    inset 0 0 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 1), 
                    0 0 35px rgba(0, 255, 0, 0.8),
                    inset 0 0 15px rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }
}

.mined {
    background-color: #222;
    border: 1px solid #444;
}

.empty, .mined {
    background-color: #222;
    border: 1px solid #444;
}

/* 怪物攻击玩家时的动画效果 */
@keyframes attackFlash {
    0% { background-color: #00ff00; box-shadow: 0 0 5px rgba(0, 255, 0, 0.8); }
    25% { background-color: #ff4444; box-shadow: 0 0 20px rgba(255, 68, 68, 1); }
    50% { background-color: #00ff00; box-shadow: 0 0 5px rgba(0, 255, 0, 0.8); }
    75% { background-color: #ff4444; box-shadow: 0 0 20px rgba(255, 68, 68, 1); }
    100% { background-color: #00ff00; box-shadow: 0 0 8px rgba(0, 255, 0, 0.8); }
}

/* TNT爆炸动画效果 */
@keyframes tntExplosion {
    0% { background-color: #FF4500; box-shadow: 0 0 10px rgba(255, 69, 0, 0.8); transform: scale(1); }
    25% { background-color: #FF8C00; box-shadow: 0 0 20px rgba(255, 140, 0, 1); transform: scale(1.1); }
    50% { background-color: #FF4500; box-shadow: 0 0 15px rgba(255, 69, 0, 0.9); transform: scale(1.05); }
    75% { background-color: #FF8C00; box-shadow: 0 0 25px rgba(255, 140, 0, 1); transform: scale(1.15); }
    100% { background-color: initial; box-shadow: initial; transform: scale(1); }
}

/* 反物质TNT爆炸动画效果 */
@keyframes antimatterExplosion {
    0% { background-color: #9932CC; box-shadow: 0 0 10px rgba(153, 50, 204, 0.8); transform: scale(1); }
    25% { background-color: #DA70D6; box-shadow: 0 0 30px rgba(218, 112, 214, 1); transform: scale(1.2); }
    50% { background-color: #9932CC; box-shadow: 0 0 20px rgba(153, 50, 204, 0.9); transform: scale(1.1); }
    75% { background-color: #DA70D6; box-shadow: 0 0 40px rgba(218, 112, 214, 1); transform: scale(1.3); }
    100% { background-color: initial; box-shadow: initial; transform: scale(1); }
}

/* 触控活动状态样式 */
.cell.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    z-index: 10;
}

/* 挖掘动画效果 */
@keyframes mineAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); background-color: #ffff00; }
    100% { transform: scale(1); }
}

/* 移动提示动画 */
@keyframes moveHint {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
    100% { opacity: 0.3; }
}

/* 帮助按钮样式 */
.help-container {
    margin: 15px auto;
    text-align: center;
}

.help-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: clamp(12px, 2.5vw, 14px);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    z-index: 10;
}

.help-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.help-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

/* 帮助弹窗样式 */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    animation: fadeIn 0.15s ease;
    -webkit-overflow-scrolling: touch;
}

.help-modal.show {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.help-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 500px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideIn 0.15s ease;
}

.help-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    padding: 6px 12px 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.help-header h3 {
    margin: 0;
    font-size: clamp(13px, 2.4vw, 16px);
    line-height: 1.0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.help-body {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    color: #fff;
    text-align: left; /* 确保整体内容居左对齐 */
}

.help-section {
    margin-bottom: 20px;
}

.help-section h4 {
    color: #4CAF50;
    margin-bottom: 10px;
    font-size: clamp(14px, 2.5vw, 16px);
}

.help-section p {
    margin: 5px 0;
    font-size: clamp(12px, 2.5vw, 14px);
    line-height: 1.4;
}

.control-group {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.control-group p {
    color: #87CEEB;
    font-weight: bold;
    margin-bottom: 8px;
}

.control-group ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    text-align: left;
}

.control-group li {
    margin: 6px 0;
    font-size: clamp(11px, 2.5vw, 13px);
    line-height: 1.4;
    text-align: left;
}

.help-section ul {
    margin: 8px 0;
    padding-left: 20px;
    text-align: left;
}

.help-section li {
    margin: 6px 0;
    font-size: clamp(11px, 2.5vw, 13px);
    line-height: 1.4;
    text-align: left;
}

.help-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
    text-align: center;
    color: #888;
    font-size: clamp(11px, 2.5vw, 13px);
}

.author-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #81C784;
    font-weight: 500;
    text-shadow: 0 0 3px rgba(129, 199, 132, 0.3);
    font-size: clamp(12px, 2.5vw, 14px);
    margin: 0;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(129, 199, 132, 0.05), rgba(129, 199, 132, 0.02));
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.author-info:hover {
    color: #A5D6A7;
    text-shadow: 0 0 5px rgba(129, 199, 132, 0.5);
    background: linear-gradient(135deg, rgba(129, 199, 132, 0.08), rgba(129, 199, 132, 0.04));
}

.author-icon {
    font-size: clamp(13px, 2.5vw, 15px);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.author-info:hover .author-icon {
    opacity: 1;
    transform: scale(1.05);
}

.author-name {
    position: relative;
    z-index: 1;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.author-info:hover .author-name {
    opacity: 1;
}

.version-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64B5F6;
    font-weight: 500;
    text-shadow: 0 0 3px rgba(100, 181, 246, 0.3);
    font-size: clamp(11px, 2.2vw, 13px);
    margin: 8px 0 0 0;
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.05), rgba(100, 181, 246, 0.02));
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.version-info:hover {
    color: #90CAF9;
    text-shadow: 0 0 5px rgba(100, 181, 246, 0.5);
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.08), rgba(100, 181, 246, 0.04));
}

.version-icon {
    font-size: clamp(12px, 2.2vw, 14px);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.version-info:hover .version-icon {
    opacity: 1;
    transform: scale(1.05);
}

.version-text {
    position: relative;
    z-index: 1;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.version-info:hover .version-text {
    opacity: 1;
}

/* 方块预览网格 */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.block-item:hover {
    transform: translateY(-2px);
    background-color: rgba(255,255,255,0.1);
}

.block-preview {
    width: 30px;
    height: 30px;
    border: 1px solid #333;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 方块预览样式 */
.block-preview.stone {
    background-color: #808080;
}

.block-preview.diamond-ore {
    background-color: #b0e0e6;
}

.block-preview.lava {
    background-color: #ff4500;
}

.block-preview.wood {
    background-color: #8B4513;
}

.block-preview.tnt {
    background-color: #FF4500;
}

.block-preview.antimatter-tnt {
    background-color: #9932CC;
}

.block-preview.water {
    background-color: #1E90FF;
}

.block-preview.cobblestone {
    background-color: #696969;
}

.block-preview.glass {
    background-color: #87CEEB;
}

.block-preview.dirt {
    background-color: #8B4513;
}

.block-preview.golden-apple {
    background-color: #FFD700;
}

.block-preview.empty {
    background-color: #222;
}

.block-preview.monster {
    background-color: #32CD32;
}

.block-preview.zombie {
    background-color: #9ACD32;
}

.player-on-empty {
    background: radial-gradient(circle, #00ff00 0%, #00cc00 50%, #008800 100%);
    border: 2px solid #005500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.player-on-empty::after {
    content: '😊';
    color: white;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.player-on-block {
    background: radial-gradient(circle, #ff9800 0%, #ff6f00 50%, #e65100 100%);
    border: 2px solid #bf360c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.player-on-block::after {
    content: '⛏️';
    color: white;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.block-item span {
    font-size: clamp(10px, 2vw, 12px);
    line-height: 1.2;
    color: #ccc;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .help-content {
        width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .help-body {
        padding: 15px;
        -webkit-overflow-scrolling: touch;
        text-align: left;
    }
    
    .help-header {
        padding: 5px 10px 5px 14px;
    }
    
    .help-header h3 {
        font-size: clamp(12px, 2.3vw, 15px);
        line-height: 1.0;
    }
    
    .close-btn {
        font-size: 13px;
        width: 16px;
        height: 16px;
        padding: 1px;
    }
    
    .control-group li,
    .help-section li {
        margin: 8px 0;
        font-size: clamp(10px, 2.5vw, 12px);
    }
    
    .help-section {
        margin-bottom: 15px;
    }
    
    .help-container {
        margin: 10px auto;
    }
    
    .help-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* 确保触控区域足够大 */
    }
}

@media (max-width: 480px) {
    .help-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
        min-width: 120px;
    }
    
    .help-content {
        width: 98vw;
        border-radius: 8px;
        max-height: 98vh;
    }
    
    .help-header {
        padding: 4px 8px 4px 12px;
    }
    
    .help-header h3 {
        font-size: clamp(11px, 2.2vw, 13px);
        line-height: 1.0;
    }
    
    .close-btn {
        font-size: 12px;
        width: 14px;
        height: 14px;
        padding: 1px;
    }
    
    .help-body {
        padding: 12px;
        -webkit-overflow-scrolling: touch;
        text-align: left;
    }
    
    .control-group li,
    .help-section li {
        margin: 10px 0;
        font-size: clamp(9px, 2.5vw, 11px);
    }
    
    .control-group {
        padding: 8px;
    }
    
    .help-container {
        margin: 8px auto;
    }
    
    .blocks-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .block-item {
        padding: 6px;
    }
    
    .block-preview {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}

/* 触控设备上的特殊样式 */
@media (hover: none) and (pointer: coarse) {
    .cell {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .cell:hover {
        background-color: inherit; /* 禁用悬停效果 */
    }
    
    /* 移除闪烁动画，改为更平滑的提示 */
    .cell:not(.player):not(.empty) {
        animation: none;
        opacity: 0.9;
    }
    
    .cell:not(.player):not(.empty):hover {
        opacity: 1;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
    }
}