html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;     /* 防止移动端缩放 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

#map-container {
    width: 100vw;
    height: 100vh;
    cursor: grab;
    position: relative;
    overflow: hidden;
    touch-action: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-overflow-scrolling: touch;
}

/* 地图网格样式 */
.cell {
    position: absolute;
    box-sizing: border-box;
}

.cell.square {
    width: 40px;
    height: 40px;
    background-color: transparent;
    background-image: url('../img/unknown.png');
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 1;
}

.cell.wall {
    z-index: 2;
}

.cell.wall.vertical {
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    width: 11px;
    height: 40px;
}

.cell.wall.horizontal {
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    width: 40px;
    height: 11px;
}

.cell.center {
    cursor: pointer;
    width: 11px;
    height: 11px;
    background-image: url('../img/walls/corner.png');
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 3;
}

/* 附着图层样式 */
.attachment-layer {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 3;
}

/* 标记图层样式 */
.marker-container {
    z-index: 5;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}

/* 标记样式 */
.marker {
    font-size: 14px;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .cell.square {
        width: 30px;
        height: 30px;
    }

    .cell.wall.vertical {
        width: 9px;
        height: 30px;
    }
    .cell.wall.horizontal {
        width: 30px;
        height: 9px;
    }

    .cell.center {
        width: 9px;
        height: 9px;
    }

    .marker {
        font-size: 12px;
    }
}
