* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

/* 重置按钮和输入框的默认样式 */
button, input {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    font: inherit;
    color: inherit;
    background: none;
    cursor: pointer;
    line-height: 1;
}

#map-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 0;
    padding: 0;
    z-index: 1;
}

/* 确保body不会出现滚动条 */
body {
    overflow: hidden;
}

#map-container:active {
    cursor: grabbing;
}

#background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: transform 0s;
}

.message-bubble {
    position: absolute;
    background-color: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 60px;
    max-width: 200px;
    width: max-content;
    word-wrap: break-word;
    cursor: pointer;
    z-index: 1;
    font-size: 14px;
    white-space: normal;
    overflow: visible;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.message-bubble:hover {
    transform: scale(1.05);
    z-index: 2;
}

.message-bubble.covered {
    opacity: 0.5;
    z-index: 0;
}

.message-input-box {
    position: absolute;
    background-color: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 60px;
    max-width: 200px;
    word-wrap: break-word;
    z-index: 10000;
    font-size: 14px;
    white-space: normal;
    overflow: hidden;
    line-height: 1.4;
    border: 2px solid #667eea;
    outline: none;
    cursor: text;
    transition: all 0.2s ease;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    touch-action: manipulation;
    -webkit-touch-callout: default;
    resize: none;
    display: block;
    font-family: Arial, sans-serif;
    /* transform-origin: center center; */ /* 移除中心变换原点，配合JS改为左上角对齐 */
}

/* 定位标记动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* 红色定位标记相关样式已移除 */

.message-input-box.locating {
    animation: pulse 1.5s infinite;
    border-color: #f093fb;
    border-width: 2px;
}

.message-input-box::placeholder {
    color: #999;
}

.message-input-box:focus {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    outline: none;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .message-bubble {
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 15px;
        max-width: 160px;
        min-width: 50px;
    }
    
    .message-input-box {
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 16px;
        max-width: 160px;
        min-width: 50px;
        height: 40px;
        line-height: 1.5;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .message-bubble {
        max-width: 140px;
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .message-input-box {
        max-width: 140px;
        font-size: 16px;
        padding: 8px 12px;
        height: 40px;
        line-height: 1.5;
    }
}