html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    overflow: hidden; /* 防止滚动条 */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e0e0e0; /* 浅灰色背景 */
    color: #333; /* 深灰色文本 */
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0; /* 确保地图在底部 */
}

.overlay-controls {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    background-color: rgba(240, 240, 240, 0.9); /* 半透明浅灰色浮层 */
    padding: 20px;
    border-radius: 8px 8px 0px 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 灰色阴影 */
    text-align: center;
    width: 100%;
    max-width: 600px; /* 电脑上最大宽度 */
}

.distance-control {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; /* 重新设置为列方向 */
    align-items: center; /* 确保子元素水平居中 */
    /* 移除了 justify-content: center; 因为在 column 模式下不适用 */
}

.distance-header {
    display: flex;
    justify-content: center; /* 确保内部标签和文本水平居中 */
    align-items: center; /* 确保内部标签和文本垂直居中 */
    margin-bottom: 10px; /* 在头部和滑块之间留出间距 */
}

.distance-control label {
    margin-bottom: 0;
    margin-right: 10px; /* 标签和当前距离显示之间留出间距 */
    font-size: 16px;
    font-weight: bold;
    color: #555;
}

.distance-control input[type="range"] {
    width: 100%;
    max-width: 300px;
    margin-bottom: 0; /* 滑块下方不再需要 margin */
    margin-right: 0; /* 滑块右侧不再需要 margin */
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border-radius: 4px;
    overflow: hidden;
}

/* Webkit (Chrome, Safari, Edge) 轨道 */
.distance-control input[type="range"]::-webkit-slider-runnable-track {
    background: transparent; /* 使轨道透明，让input的背景显示出来 */
    height: 8px;
    border-radius: 4px; /* 添加圆角 */
}

/* Firefox 轨道 */
.distance-control input[type="range"]::-moz-range-track {
    background: transparent; /* 使轨道透明，让input的背景显示出来 */
    height: 8px;
    border-radius: 4px; /* 添加圆角 */
}

/* Webkit (Chrome, Safari, Edge) 滑块 */
.distance-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; /* 移除默认样式 */
    height: 18px;
    width: 18px;
    border-radius: 9px; /* 添加圆角，使其成为圆形 */
    background: #000; /* 黑色滑块 */
    cursor: pointer;
    margin-top: -5px; /* 调整以使滑块在轨道上垂直居中 */
}

/* Firefox 滑块 */
.distance-control input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 9px; /* 添加圆角，使其成为圆形 */
    background: #000; /* 黑色滑块 */
    cursor: pointer;
}

.distance-control #current_distance {
    font-weight: bold;
    color: #444;
}

.buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    color: #222; /* 最深的灰色标题 */
    margin-bottom: 20px;
}

.language-switcher {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
}

#language_button {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #ffffff;
    color: #444;
    border: 1px solid #e5e5e5;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

#language_button:hover {
    background-color: #f7f7f7;
}

#language_menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    min-width: 120px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#language_menu li {
    padding: 6px 10px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    border-radius: 5px;
}

#language_menu li:hover {
    background-color: #f0f0f0;
}

#language_menu li.active {
    background-color: #e8e8e8;
    font-weight: bold;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

button {
    background-color: #222; /* 按钮背景中灰色 */
    color: #f0f0f0; /* 按钮文字浅灰色 */
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #000; /* 按钮悬停时深灰色 */
}

p {
    font-size: 18px;
    color: #333; /* 普通文本颜色 */
}

#destination_display {
    font-weight: bold;
    color: #888; /* 目的地显示最深，以示重要 */
}

/* 媒体查询，用于小屏幕设备 */
@media (max-width: 768px) {
    .overlay-controls {
        padding: 15px;
        bottom: 0px;
        width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    button {
        padding: 8px 15px;
        font-size: 14px;
    }

    p {
        font-size: 16px;
    }
}

/* 表情符号图标样式 */
.emoji-pin {
    width: 60px; /* 增加宽度 */
    height: 60px; /* 增加高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px; /* 增加字体大小 */
    line-height: 1;
    background-color: rgba(255, 255, 0, 0.5); /* 临时背景色，更显眼 */
    border: 3px solid blue; /* 调试边框，更粗 */
    z-index: 1000;
    color: black; /* 显式设置颜色，以防万一 */
    /* animation: emoji-drop-animation 1s ease-out forwards; /* 暂时禁用动画 */ 
}

/* .emoji-icon { /* 已移除，表情符号直接在 .emoji-pin 中 */
/*     font-size: 30px; */
/*     line-height: 1; */
/*     display: block; */
/*     border: 2px solid red; */
/* } */

/* 表情符号动画 */
/* @keyframes emoji-drop-animation { /* 暂时禁用动画 */
/*     0% { */
/*         transform: translateY(-200px) rotate(0deg) scale(0.5); */
/*         opacity: 0; */
/*     } */
/*     50% { */
/*         transform: translateY(0px) rotate(360deg) scale(1.1); */
/*         opacity: 1; */
/*     } */
/*     75% { */
/*         transform: translateY(-20px) rotate(370deg) scale(1.05); */
/*     } */
/*     100% { */
/*         transform: translateY(0px) rotate(360deg) scale(1); */
/*         opacity: 1; */
/*     } */
/* } */
