:root {
            --primary-color: #4f46e5; /* 更现代的靛蓝色 */
            --primary-hover: #4338ca;
            --bg-glass: rgba(255, 255, 255, 0.85);
            --bg-glass-dark: rgba(255, 255, 255, 0.95);
            --text-main: #1f2937;
            --text-sub: #6b7280;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --radius: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #ffffff;
            color: var(--text-main);
            overflow: hidden; /* 防止页面滚动 */
        }

        /* 地图容器 */
        .map-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1;
        }

        #mapContainer {
            width: 100%;
            height: 100%;
            /* 尽量避免瓦片出现细小缝隙 */
            background-color: #ffffff;
        }

        /* 天地图瓦片常见的细白缝：通过让瓦片略微放大 1px 来掩盖 */
        .tdt-tile-pane img,
        .tdt-tile img {
            image-rendering: optimizeSpeed;
            -ms-interpolation-mode: nearest-neighbor;
            border: none;
            /* 将每个瓦片放大 1px，覆盖住可能出现的缝隙 */
            transform: scale(1.01);
            transform-origin: center center;
        }

        /* 覆盖天地图默认样式：防止缩放动画阶段把覆盖物（特别是 Marker）整体隐藏 */
        .tdt-zoom-hide {
            visibility: visible !important;
            opacity: 1 !important;
        }

        /* 通用面板样式 (毛玻璃) */
        .glass-panel {
            background: var(--bg-glass);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.6);
            border-radius: var(--radius);
            box-shadow: var(--shadow-md);
            transition: all 0.3s ease;
        }

        /* 左上角筛选：三个并排的灰色圆角矩形 */
        .controls {
            position: absolute;
            top: 12px;
            left: 12px;
            z-index: 1000;
            display: flex;
            flex-direction: row;
            gap: 8px;
            align-items: center;
        }

        .control-group {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 999px;
            background: rgba(243, 244, 246, 0.96); /* 浅灰色圆角矩形 */
            box-shadow: var(--shadow-md);
            max-width: 140px;
        }

        /* 仅隐藏每个筛选块最外层的说明文字（如“底图模式”“景区星级”），保留内部的“显示铁路”等文字 */
        .control-group > label {
            display: none;
        }

        /* 自定义 Select 样式（紧凑版，文本交给原生渲染，展开部分用自定义菜单） */
        .custom-select-wrapper {
            position: relative;
        }

        .control-group select {
            width: auto;
            max-width: 90px;
            appearance: none;
            -webkit-appearance: none;
            background-color: transparent;
            border: none;
            border-radius: 0;
            padding: 2px 14px 2px 0;
            font-size: 11px;
            color: var(--text-main);
            cursor: pointer;
            pointer-events: none; /* 禁用原生下拉交互，只用自定义菜单 */
        }

        .control-group select:focus {
            outline: none;
        }

        /* 自定义下拉箭头（缩小版本） */
        .custom-select-wrapper::after {
            content: '';
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            width: 8px;
            height: 8px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
            pointer-events: none;
        }

        /* 自定义下拉菜单面板 */
        .custom-select-menu {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 4px;
            background: #ffffff;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.4);
            box-shadow: var(--shadow-md);
            padding: 4px 0;
            min-width: 100%;
            max-height: 240px;
            overflow-y: auto;
            z-index: 1200;
            display: none;
        }

        .custom-select-wrapper.open .custom-select-menu {
            display: block;
        }

        .custom-select-option {
            padding: 4px 10px;
            font-size: 11px;
            color: var(--text-main);
            cursor: pointer;
            white-space: nowrap;
            display: flex;
            align-items: center;
            min-height: 24px;
        }

        .custom-select-option:hover {
            background: #eef2ff;
            color: var(--primary-color);
        }

        .custom-select-option.active {
            background: #e0e7ff;
            color: var(--primary-color);
            font-weight: 500;
        }

        /* 铁路开关在同一圆角矩形中做成小滑块 */
        .toggle-group {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 6px;
            background: transparent;
            border: none;
            padding: 0;
            margin-top: 0;
        }

        .toggle-group label {
            margin: 0;
            font-size: 11px;
            color: var(--text-main);
            text-transform: none;
            cursor: pointer;
        }

        .toggle-switch {
            position: relative;
            width: 32px;
            height: 18px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #e5e7eb;
            transition: .2s;
            border-radius: 18px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 14px;
            width: 14px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: .2s;
            border-radius: 50%;
            box-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }

        input:checked + .slider {
            background-color: var(--primary-color);
        }

        input:checked + .slider:before {
            transform: translateX(14px);
        }

        /* 底部图例容器 */
        .bottom-panel-container {
            position: absolute;
            bottom: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            z-index: 1000;
            align-items: flex-end;
        }

        /* 图例 */
        .legend {
            padding: 12px;
            min-width: 160px;
        }

        .legend-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-sub);
            margin-bottom: 8px;
            text-transform: uppercase;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 6px 0;
            font-size: 12px;
            color: var(--text-main);
        }

        .legend-color {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
        }

        /* 左下角按钮（帮助 & 全屏） */
        .fullscreen-btn {
            position: absolute;
            bottom: 12px;
            left: 12px;
            background: rgba(255, 255, 255, 0.9);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            box-shadow: var(--shadow-md);
            cursor: pointer;
            z-index: 1100;
            font-size: 20px;
            line-height: 1;
            display: none; /* 由 JS 控制显示 */
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
        }

        .fullscreen-btn:hover {
            background: #ffffff;
            transform: scale(1.03);
        }

        .fullscreen-btn:active {
            transform: scale(0.97);
            box-shadow: var(--shadow-sm);
        }

        .help-btn {
            position: absolute;
            bottom: 12px;
            left: 64px; /* 紧挨着全屏按钮右侧 */
            background: rgba(255, 255, 255, 0.9);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            box-shadow: var(--shadow-md);
            cursor: pointer;
            z-index: 1100;
            font-size: 22px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
            font-weight: bold;
        }

        .help-btn:hover {
            background: #ffffff;
            transform: scale(1.03);
        }

        .help-btn:active {
            transform: scale(0.97);
            box-shadow: var(--shadow-sm);
        }

        /* 详情弹窗 */
        #detailPopup {
            position: fixed;
            z-index: 99999;
            pointer-events: none;
            opacity: 0;
            transform: translateY(-90%) scale(0.95);
            transition: opacity 0.2s, transform 0.2s;
        }

        #detailPopup.show {
            opacity: 1;
            transform: translateY(-100%) scale(1);
        }

        .detail-content {
            pointer-events: auto;
            width: 210px; /* 稍微加宽一些，减少换行 */
            background: #fff;
            border-radius: 10px;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            border: 1px solid rgba(0,0,0,0.05);
        }

        .detail-header {
            padding: 8px 10px 6px;
            border-bottom: 1px solid #f3f4f6;
        }

        .detail-title {
            font-size: 14px;
            font-weight: 600;
            color: #111;
            line-height: 1.3;
        }

        .detail-body {
            padding: 6px 10px 8px; /* PC 默认：原来的单列布局 */
        }

        .detail-item {
            display: flex;
            align-items: flex-start;
            gap: 4px;
            margin-bottom: 2px;
            font-size: 11px;
            line-height: 1.4;
            color: #4b5563;
        }

        .detail-icon {
            flex-shrink: 0;
            width: 10px;
            text-align: center;
            font-size: 10px;
        }

        .detail-footer {
            padding: 6px 10px 8px;
            background: #fafafa;
            border-top: 1px solid #f3f4f6;
        }

        .detail-button button {
            width: 100%;
            background: #ff2442; /* 小红书红 */
            color: white;
            border: none;
            padding: 6px 8px;
            border-radius: 99px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 3px 8px rgba(255, 36, 66, 0.25);
            transition: transform 0.1s, box-shadow 0.1s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .detail-button button:active {
            transform: scale(0.98);
            box-shadow: 0 2px 6px rgba(255, 36, 66, 0.2);
        }

        /* 使用帮助弹层：沿用参考页面样式的精简版 */
        .welcome-guide {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.8);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .welcome-guide.show {
            display: flex;
        }

        .welcome-content {
            background: #ffffff;
            padding: 24px;
            border-radius: 12px;
            max-width: 480px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        }

        .welcome-content h2 {
            margin: 0 0 16px 0;
            color: #111827;
            font-size: 20px;
            text-align: center;
        }

        .welcome-steps {
            margin: 12px 0 8px;
            padding-left: 18px;
        }

        .welcome-steps li {
            margin: 8px 0;
            color: #4b5563;
            font-size: 14px;
            line-height: 1.6;
        }

        .welcome-steps strong {
            color: var(--primary-color);
        }

        .welcome-btn {
            display: block;
            width: 100%;
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
            border: none;
            padding: 10px 0;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 12px;
            transition: transform 0.15s, box-shadow 0.15s;
        }

        .welcome-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
        }

        .welcome-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
        }

        /* 移动端适配：缩小整体控件并允许换行 */
        @media (max-width: 768px) {
            .controls {
                top: 10px;
                left: 10px;
                right: 10px;
                flex-wrap: wrap;
            }

            .control-group {
                max-width: none;
            }

            .bottom-panel-container {
                bottom: 16px;
                right: 10px;
                align-items: flex-end;
            }

            .legend {
                padding: 6px 8px;
                min-width: auto;
                max-width: 140px;
            }

            .legend-title {
                font-size: 10px;
                margin-bottom: 4px;
            }

            .legend-item {
                margin: 2px 0;
                gap: 4px;
                font-size: 10px;
            }

            /* 移动端详情：使用 2×N 网格布局，字体稍微放大一点 */
            .detail-body {
                padding: 4px 8px 6px;
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                column-gap: 4px;
                row-gap: 2px;
            }

            .detail-item {
                gap: 3px;
                margin-bottom: 2px;
                font-size: 12px; /* 比 PC 稍大一点 */
                line-height: 1.35;
            }

            .detail-icon {
                width: 12px;
                font-size: 11px;
            }

            .fullscreen-btn {
                bottom: 8px;
                left: 8px;
                width: 36px;
                height: 36px;
                font-size: 20px;
            }

            .help-btn {
                bottom: 8px;
                left: 56px;
                width: 36px;
                height: 36px;
                font-size: 20px;
            }
        }
