/* ===================== 全局重置 ===================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary:       #2563eb;
    --primary-light: #3b82f6;
    --primary-dark:  #1d4ed8;
    --danger:        #ef4444;
    --success:       #22c55e;
    --warn:          #f59e0b;
    --glass-bg:      rgba(255,255,255,0.95);
    --glass-border:  rgba(255,255,255,0.7);
    --text-1:        #1e293b;
    --text-2:        #475569;
    --text-3:        #94a3b8;
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.16);
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --tr:            all 0.2s cubic-bezier(0.4,0,0.2,1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    overflow: hidden;
    background: #1e3a5f;
}

/* ===================== 地图 ===================== */
#map { width: 100vw; height: 100vh; z-index: 1; }

/* ===================== 搜索区域 ===================== */
.search-container {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: calc(100vw - 28px);
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), 0 1px 2px rgba(0,0,0,0.05);
    border: 1.5px solid var(--glass-border);
    padding: 0 6px 0 14px;
    height: 48px;
    transition: var(--tr);
    width: 400px; /* 固定宽度 */
    max-width: calc(100vw - 28px);
}
.search-box:focus-within {
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(37,99,235,0.18);
    border-color: var(--primary-light);
}
.search-box input {
    border: none; outline: none;
    font-size: 15px; flex: 1;
    background: transparent;
    color: var(--text-1);
    min-width: 0;
}
.search-box input::placeholder { color: var(--text-3); }

#searchBtn {
    width: 38px; height: 38px;
    border: none; border-radius: 10px;
    background: var(--primary);
    color: white; cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr); flex-shrink: 0;
}
#searchBtn:hover { background: var(--primary-dark); transform: scale(1.05); }
#searchBtn:active { transform: scale(0.97); }

#routeQuickBtn {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: transparent;
    color: var(--text-3); cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr); flex-shrink: 0;
    margin-right: 2px;
}
#routeQuickBtn:hover { color: var(--primary); background: rgba(37,99,235,0.08); }

/* 搜索历史 */
.search-history {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    padding: 10px 0;
    animation: slideDown 0.22s ease;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1100;
    position: relative;
}
.search-history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px 8px;
    font-size: 12px; color: var(--text-3);
    font-weight: 600;
}
#clearHistoryBtn {
    background: none; border: none; color: var(--primary);
    font-size: 12px; cursor: pointer; font-weight: 500;
}
#clearHistoryBtn:hover { text-decoration: underline; }
.search-history-list { padding: 0 6px; }
.search-history-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    font-size: 13px; color: var(--text-1);
}
.search-history-item:hover { background: rgba(37,99,235,0.06); }
.search-history-item .hist-icon { font-size: 14px; color: var(--text-3); flex-shrink: 0; }
.search-history-item .hist-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== 路线规划面板 ===================== */
.route-panel {
    position: absolute;
    top: 70px; left: 14px;
    z-index: 1000;
    display: none; flex-direction: column; gap: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    padding: 12px 14px 14px;
    animation: slideDown 0.22s ease;
    max-width: calc(100vw - 28px);
    width: 400px; /* 与搜索框保持一致宽度 */
}
.route-panel.show { display: flex; }

.route-panel-header {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 6px;
}
.route-panel-header button {
    width: 30px; height: 30px;
    border: none; border-radius: 8px;
    background: transparent; color: var(--text-2);
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr);
}
.route-panel-header button:hover { background: #f1f5f9; color: var(--text-1); }
.route-panel-header span {
    flex: 1; font-size: 15px; font-weight: 700; color: var(--text-1);
    text-align: center;
}

/* 出行模式 */
.route-modes {
    display: flex; gap: 2px;
    padding: 3px; background: #f1f5f9; border-radius: 10px;
}
.route-mode-btn {
    flex: 1; padding: 7px 2px; font-size: 12px;
    border: none; border-radius: 8px;
    cursor: pointer; background: transparent;
    color: var(--text-2); transition: var(--tr); font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 3px;
}
.route-mode-btn.active {
    background: white; color: var(--primary);
    box-shadow: 0 1px 6px rgba(0,0,0,0.12); font-weight: 600;
}

/* 起点终点输入 */
.route-inputs {
    display: flex; flex-direction: column;
    gap: 0; position: relative;
    padding-right: 36px;
}
.route-input-row {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
}
.route-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.route-dot.start { background: var(--success); }
.route-dot.end   { background: var(--danger); }

.route-panel input {
    flex: 1; padding: 9px 10px;
    border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm);
    font-size: 14px; outline: none; background: white;
    color: var(--text-1); transition: var(--tr);
}
.route-panel input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

#startLocateBtn {
    width: 28px; height: 28px;
    border: none; border-radius: 6px;
    background: transparent; color: var(--text-3);
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr); flex-shrink: 0;
}
#startLocateBtn:hover { color: var(--primary); background: rgba(37,99,235,0.08); }

#swapRouteBtn {
    position: absolute; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 30px; height: 30px;
    border: 1.5px solid #e2e8f0; border-radius: 50%;
    background: white; color: var(--text-2);
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr);
}
#swapRouteBtn:hover { border-color: var(--primary-light); color: var(--primary); }

/* 快捷按钮 */
.route-shortcuts {
    display: flex; gap: 8px;
    padding-top: 4px;
}
.route-shortcut {
    flex: 1; padding: 8px 0;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px; color: var(--text-2);
    transition: var(--tr); font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.route-shortcut:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* 路线历史 */
.route-history { margin-top: 4px; }
.route-history-header {
    font-size: 12px; color: var(--text-3); font-weight: 600;
    padding: 4px 2px 6px;
}
.route-history-list { padding: 0 2px; }
.route-history-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    font-size: 13px; color: var(--text-1);
}
.route-history-item:hover { background: rgba(37,99,235,0.06); }
.route-history-item .rh-icon { font-size: 14px; color: var(--text-3); flex-shrink: 0; }
.route-history-item .rh-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-history-item .rh-del {
    background: none; border: none; cursor: pointer;
    color: #cbd5e1; font-size: 16px; opacity: 0; transition: var(--tr);
    padding: 2px 6px; border-radius: 4px;
}
.route-history-item:hover .rh-del { opacity: 1; color: var(--danger); }
.route-history-item .rh-del:hover { background: #fee2e2; }

/* 规划按钮 */
#routeBtn {
    width: 100%; padding: 11px 0;
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: var(--tr);
    display: flex; align-items: center; justify-content: center;
    margin-top: 4px;
}
#routeBtn:hover { background: var(--primary-dark); }
#routeBtn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ===================== 底部工具栏 ===================== */
.bottom-toolbar {
    position: absolute;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    gap: 2px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    padding: 4px;
}
.bottom-toolbar button {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    min-width: 56px; padding: 6px 8px;
    border: none; border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: var(--tr);
    color: var(--text-2);
}
.bottom-toolbar button:hover {
    background: rgba(37,99,235,0.08);
    color: var(--text-1);
}
.bottom-toolbar button.active {
    background: var(--primary);
    color: white;
}
.bottom-toolbar button .bt-icon { font-size: 16px; }
.bottom-toolbar button .bt-label { font-size: 11px; font-weight: 500; }

/* ===================== 地图控制组件（右侧） ===================== */
.map-controls {
    position: absolute;
    top: 50%; right: 14px;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 指南针 */
.compass-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--tr);
    position: relative;
}
.compass-ring:hover { box-shadow: var(--shadow-lg); }
.compass-inner {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: white;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.08);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}
.compass-arrow {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 14px solid #ef4444;
    position: absolute;
    top: 4px;
}
.compass-n {
    position: absolute;
    bottom: 5px;
    font-size: 9px; font-weight: 700;
    color: var(--text-3);
}

/* 定位按钮 */
#locateBtn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--tr);
    color: var(--text-2);
}
#locateBtn:hover { background: white; color: var(--primary); }
#locateBtn.active { color: var(--primary); }

/* 缩放控制 */
.zoom-controls {
    display: flex; flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.zoom-controls button {
    width: 40px; height: 40px;
    border: none; background: transparent;
    color: var(--text-1); font-size: 20px;
    cursor: pointer; transition: var(--tr);
    display: flex; align-items: center; justify-content: center;
    font-weight: 300;
}
.zoom-controls button:hover { background: rgba(37,99,235,0.08); }
.zoom-controls button:first-child { border-bottom: 1px solid rgba(0,0,0,0.06); }

/* ===================== 3D / 全景 按钮 ===================== */
.extra-controls {
    position: absolute;
    bottom: 110px; right: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

#tilt3dBtn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--tr);
    color: var(--text-2);
    font-size: 11px; font-weight: 700;
}
#tilt3dBtn:hover { background: white; color: var(--primary); }
#tilt3dBtn.active { background: var(--primary); color: white; border-color: var(--primary); }

#panoramaBtn {
    display: flex; flex-direction: column;
    align-items: center;
    width: 56px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--glass-border);
    cursor: pointer;
    transition: var(--tr);
    overflow: hidden;
    padding: 0;
}
#panoramaBtn:hover { box-shadow: var(--shadow-lg); }
.panorama-thumb {
    width: 100%; height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.panorama-label {
    font-size: 11px; font-weight: 500;
    color: var(--text-2);
    padding: 3px 0 4px;
}

/* ===================== 工具栏（右上） ===================== */
.toolbar {
    position: absolute; top: 14px; right: 14px;
    z-index: 1000;
    display: flex; flex-direction: column; gap: 6px;
}
.toolbar button {
    width: 46px; height: 46px;
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    cursor: pointer; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--tr); color: var(--text-2); position: relative;
}
.toolbar button:hover {
    background: white; box-shadow: var(--shadow-md);
    transform: translateX(-2px); color: var(--text-1);
}
.toolbar button.active {
    background: var(--primary); color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}
.toolbar-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 2px 4px; }

/* tooltip */
.toolbar button::before {
    content: attr(title);
    position: absolute; right: calc(100% + 8px); top: 50%;
    transform: translateY(-50%);
    background: rgba(15,23,42,0.88); color: white;
    padding: 5px 10px; border-radius: 6px; font-size: 12px;
    white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity 0.18s; font-weight: 400;
}
.toolbar button:hover::before { opacity: 1; }

/* ===================== 底图切换菜单 ===================== */
.map-switch-menu {
    position: absolute; top: 68px; right: 14px;
    z-index: 1100;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--glass-border);
    width: 200px;
    display: none;
    animation: slideDown 0.18s ease;
    overflow: hidden;
}
.map-switch-menu.show { display: block; }

.map-switch-header {
    padding: 10px 14px 8px;
    font-size: 12px; font-weight: 700;
    color: var(--text-2);
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.map-switch-list { padding: 6px 4px; }

.map-switch-group { margin-bottom: 4px; }
.map-switch-group-label {
    font-size: 11px; color: var(--text-3);
    font-weight: 600; padding: 4px 10px 2px;
    letter-spacing: 0.3px;
}
.map-switch-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    font-size: 13px; color: var(--text-1);
}
.map-switch-item:hover { background: rgba(37,99,235,0.08); }
.map-switch-item.active {
    background: rgba(37,99,235,0.1);
    color: var(--primary); font-weight: 600;
}
.map-switch-item-icon { font-size: 16px; flex-shrink: 0; }
.map-switch-item-name { flex: 1; font-size: 13px; }
.map-switch-check {
    color: var(--primary); font-size: 14px;
    font-weight: 700; flex-shrink: 0;
}

/* ===================== 搜索结果 ===================== */
.results-list {
    position: absolute; top: 70px; left: 14px;
    z-index: 1100;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--glass-border);
    max-width: calc(100vw - 28px); max-height: 50vh;
    overflow-y: auto;
    animation: slideDown 0.18s ease;
}
.results-list::-webkit-scrollbar { width: 4px; }
.results-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.result-item {
    padding: 11px 16px; cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.15s;
    display: flex; align-items: flex-start; gap: 10px;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: rgba(37,99,235,0.05); }
.result-icon { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.result-text { flex: 1; min-width: 0; }
.result-item .name {
    font-weight: 600; color: var(--text-1); font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-item .address {
    font-size: 12px; color: var(--text-3); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-empty { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ===================== 信息面板（路线结果）===================== */
.info-panel {
    position: absolute; top: 220px; left: 14px;
    z-index: 2100; /* 确保在加载遮罩之上 */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--glass-border);
    display: none;
    flex-direction: column;
    animation: slideDown 0.22s ease;
    white-space: nowrap;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 240px);
    min-width: 320px;
    width: 400px; /* 与搜索框保持一致 */
    overflow: hidden;
}
.info-panel.show { display: flex; }

/* 信息面板头部 */
.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--glass-border);
    gap: 16px;
}
.info-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-2);
}
.info-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-3);
    font-size: 12px;
    padding: 4px 10px;
    transition: all 0.2s;
}
.info-toggle:hover {
    background: rgba(37,99,235,0.1);
    color: var(--primary);
}
.info-panel:not(.detail-show) .info-toggle {
    transform: rotate(-90deg);
}

/* 详情区域 */
.info-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
.info-detail.show {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
}
.info-panel.detail-show .info-detail {
    border-top: 1px solid var(--glass-border);
}

/* 方案选择器 */
.info-plans {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.info-plan {
    flex-shrink: 0;
    background: rgba(37,99,235,0.06);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}
.info-plan:hover {
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.3);
}
.info-plan.active {
    background: rgba(37,99,235,0.15);
    border-color: var(--primary);
}
.info-plan-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 12px;
    margin-bottom: 4px;
}
.info-plan-distance {
    font-size: 14px;
    color: var(--text-1);
    font-weight: 500;
}
.info-plan-duration {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}
.info-plan-tag {
    display: inline-block;
    background: rgba(37,99,235,0.15);
    color: var(--primary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

/* 导航步骤 */
.info-steps {
    padding: 0 18px 12px;
}
.info-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-2);
}
.info-step:not(:last-child) {
    border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.info-step-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37,99,235,0.1);
    border-radius: 50%;
    font-size: 12px;
}
.info-step-content {
    flex: 1;
}
.info-step-instruction {
    color: var(--text-1);
    line-height: 1.4;
}
.info-step-distance {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}
.info-step-road {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

.info-item { display: flex; align-items: center; gap: 5px; }
.info-icon { font-size: 15px; }
.info-sep { width: 1px; height: 18px; background: rgba(0,0,0,0.1); }

/* slideUp 已废弃，info-panel 使用 slideDown */

.info-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-3); font-size: 16px;
    padding: 0 0 0 4px; transition: color 0.15s;
    margin-left: 4px;
}
.info-close:hover { color: var(--text-2); }

/* ===================== 测量提示 ===================== */
.measure-tip {
    position: absolute; bottom: 100px; left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(15,23,42,0.88); color: #fff;
    padding: 8px 20px; border-radius: 20px; font-size: 13px;
    display: none;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-md);
}

/* ===================== 加载遮罩 ===================== */
.loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(4px);
    z-index: 2000; display: none;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 12px;
    font-size: 14px; color: var(--text-2);
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== 右键菜单 ===================== */
.context-menu {
    position: absolute; z-index: 2000;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--glass-border);
    padding: 5px 0; min-width: 160px;
    display: none; animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity:0; transform:scale(0.96); }
    to   { opacity:1; transform:scale(1); }
}
.context-menu-item {
    padding: 9px 16px; cursor: pointer;
    font-size: 13px; color: var(--text-1);
    display: flex; align-items: center; gap: 10px;
    transition: background 0.12s;
}
.context-menu-item:hover { background: rgba(37,99,235,0.07); }
.context-menu-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 0; }

/* ===================== 标注管理面板 ===================== */
.marks-panel {
    position: absolute; top: 14px; right: 68px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--glass-border);
    width: 264px; max-height: calc(100vh - 100px);
    overflow: hidden; display: none; flex-direction: column;
    animation: slideDown 0.22s ease;
}
.marks-panel.show { display: flex; }

.marks-panel-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; align-items: center; justify-content: space-between;
}
.marks-panel-title {
    font-size: 15px; font-weight: 700; color: var(--text-1);
    display: flex; align-items: center; gap: 6px;
}
.marks-count {
    background: var(--primary); color: white;
    font-size: 11px; font-weight: 600;
    border-radius: 10px; padding: 1px 7px;
    min-width: 20px; text-align: center;
}
.marks-panel-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-3); font-size: 18px; transition: color 0.15s;
}
.marks-panel-close:hover { color: var(--text-2); }

.marks-panel-actions { padding: 8px 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
#clearAllMarksBtn {
    width: 100%; padding: 7px;
    background: #fef2f2; color: var(--danger);
    border: 1px solid #fecaca; border-radius: 8px;
    cursor: pointer; font-size: 13px; font-weight: 500; transition: var(--tr);
}
#clearAllMarksBtn:hover { background: #fee2e2; }

.marks-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.marks-list::-webkit-scrollbar { width: 4px; }
.marks-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.mark-item {
    padding: 8px 14px; display: flex; align-items: center;
    gap: 10px; cursor: pointer; transition: background 0.12s;
    border-radius: 8px; margin: 1px 6px;
}
.mark-item:hover { background: rgba(37,99,235,0.07); }
.mark-item-icon { font-size: 18px; flex-shrink: 0; }
.mark-item-info { flex: 1; min-width: 0; }
.mark-item-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark-item-coords { font-size: 11px; color: var(--text-3); }
.mark-item-del {
    background: none; border: none; cursor: pointer;
    color: #cbd5e1; font-size: 14px; opacity: 0; transition: var(--tr);
}
.mark-item:hover .mark-item-del { opacity: 1; color: var(--danger); }

.marks-empty {
    padding: 32px 16px; text-align: center;
    color: var(--text-3); font-size: 13px;
}
.marks-empty-icon { font-size: 32px; display: block; margin-bottom: 8px; }

/* ===================== Popup 样式 ===================== */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
}
.leaflet-popup-content {
    margin: 14px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--text-2);
    min-width: 180px;
}
.popup-title { font-weight: 700; font-size: 15px; color: var(--text-1); margin-bottom: 3px; }
.popup-addr { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.popup-coords { font-size: 11px; color: var(--text-3); font-family: monospace; }
.popup-actions { display: flex; gap: 6px; margin-top: 10px; }
.popup-btn {
    flex: 1; padding: 6px 0; border: none; border-radius: 7px;
    cursor: pointer; font-size: 12px; font-weight: 500; transition: var(--tr);
}
.popup-btn-route { background: #eff6ff; color: var(--primary); }
.popup-btn-route:hover { background: #dbeafe; }

/* ===================== 地铁模态框 ===================== */
.subway-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.subway-modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 1.5px solid var(--glass-border);
    padding: 32px 36px;
    text-align: center;
    max-width: 320px;
    width: 90%;
}
.subway-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.subway-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 4px;
}
.subway-modal-city {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 16px;
}
.subway-modal-loading {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.subway-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(37,99,235,0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.subway-modal-tip {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 12px;
}
.subway-modal-progress {
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}
.subway-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.1s linear;
}
.subway-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.subway-modal-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.subway-modal-btn.primary {
    background: var(--primary);
    color: white;
}
.subway-modal-btn.primary:hover {
    background: #1d4ed8;
}
.subway-modal-btn.secondary {
    background: rgba(0,0,0,0.05);
    color: var(--text-2);
}
.subway-modal-btn.secondary:hover {
    background: rgba(0,0,0,0.1);
}
.subway-modal-note {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 12px;
}

/* ===================== 公交路线简易方案（站内显示） ===================== */
.transit-simple-result {
    padding: 8px 4px;
}
.transit-simple-result .transit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--text-3);
}
.transit-simple-result .transit-icon {
    font-size: 20px;
}
.transit-simple-result .transit-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}
.transit-simple-result .transit-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.transit-simple-result .transit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.transit-simple-result .transit-row .label {
    color: var(--text-3);
    flex-shrink: 0;
}
.transit-simple-result .transit-row .value {
    color: var(--text-1);
    text-align: right;
    font-weight: 500;
}
.transit-simple-result .transit-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: #fef3c7;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #92400e;
}
.transit-simple-result .transit-tip .tip-icon {
    flex-shrink: 0;
}
.transit-simple-result .transit-actions {
    display: flex;
    gap: 8px;
}
.transit-simple-result .transit-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.transit-simple-result .transit-btn.primary {
    background: var(--primary);
    color: white;
}
.transit-simple-result .transit-btn.primary:hover {
    background: var(--primary-dark);
}
.transit-simple-result .transit-btn.secondary {
    background: #e2e8f0;
    color: var(--text-1);
}
.transit-simple-result .transit-btn.secondary:hover {
    background: #cbd5e1;
}

.popup-btn-del { background: #fef2f2; color: var(--danger); }
.popup-btn-del:hover { background: #fee2e2; }

/* ===================== Leaflet 样式覆盖 ===================== */
.leaflet-draw-toolbar a {
    border-radius: var(--radius-sm) !important;
}
.leaflet-control-zoom {
    display: none !important; /* 使用自定义缩放控件 */
}
.leaflet-control-scale {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 6px !important;
    border: 1px solid var(--glass-border) !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
}
.leaflet-control-mouseposition {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 6px !important;
    border: 1px solid var(--glass-border) !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    color: var(--text-2) !important;
}
.leaflet-draw-tooltip { display: none !important; }

/* ===================== 动画 ===================== */
@keyframes slideDown {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ===================== 移动端适配 ===================== */
@media (max-width: 640px) {
    .search-container {
        left: 10px; top: 10px;
    }
    .search-box {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        height: 42px;
    }
    .results-list {
        left: 10px; top: 60px;
        width: calc(100vw - 20px);
    }
    .route-panel {
        left: 10px;
        top: 60px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }
    .marks-panel {
        width: calc(100vw - 20px);
        right: 10px; left: 10px;
    }
    .info-panel {
        left: 10px; top: 110px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }
    .toolbar { right: 10px; }
    .toolbar button::before { display: none; }
    .map-switch-menu { right: 10px; }
    .bottom-toolbar { bottom: 20px; }
    .map-controls { right: 10px; }
    .extra-controls { right: 10px; bottom: 80px; }
    .bottom-toolbar button .bt-label { font-size: 10px; }
}
