/* [本佳 2026-10-28] 自托管地图 · 样式
 *
 * 只被联系页引用，不进整站公共样式。
 * 依赖：public/Home/vendor/maplibre/maplibre-gl.css
 *
 * 布局：沿用公共样式 .main .lx01 .left 的 600×430 槽位（手机 230px），
 *       地图 378px + 操作条，总高约 430，不破坏原有排版。
 *       地图不可用时 .sh-map 收起，地址卡片自动接管，不留空白。
 */

.main .lx01 .left.sh-card {
    box-sizing: border-box;
    height: auto;
    min-height: 430px;
    display: block;
    overflow: hidden;
}

/* ---------- 地图 ---------- */
.main .lx01 .left.sh-card .sh-map {
    position: relative;
    z-index: 0;            /* 建立层叠上下文，防止 MapLibre 内部 z-index 盖住站点头部 */
    isolation: isolate;
    width: 100%;
    height: 378px;
    background-color: #f4f2ee;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.main .lx01 .left.sh-card .sh-map[hidden] {
    display: none !important;
}

/* 加载中：虚线占位 + 文案（文案由 data-loading 提供，中英文各一） */
.main .lx01 .left.sh-card .sh-map.is-loading {
    border-style: dashed;
    border-color: #d8d8d8;
    background-color: #fafafa;
}

.main .lx01 .left.sh-card .sh-map.is-loading::after {
    content: attr(data-loading);
    position: absolute;
    left: 0; right: 0; top: 50%;
    margin-top: -9px;
    font-size: 13px;
    line-height: 18px;
    color: #b0b0b0;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

/* MapLibre 容器 */
.main .lx01 .left.sh-card .sh-map .maplibregl-map,
.main .lx01 .left.sh-card .sh-map .maplibregl-canvas {
    width: 100%;
    height: 100%;
}

.main .lx01 .left.sh-card .sh-map .maplibregl-canvas {
    outline: none;
}

/* 缩放控件：放大一点，手机上也好点 */
.main .lx01 .left.sh-card .sh-map .maplibregl-ctrl-group button {
    width: 32px;
    height: 32px;
}

/* 版权署名必须清晰（OSM ODbL 要求署名） */
.main .lx01 .left.sh-card .sh-map .maplibregl-ctrl-attrib {
    font-size: 11px;
    line-height: 15px;
    background: rgba(255, 255, 255, .85);
    color: #555;
}

.main .lx01 .left.sh-card .sh-map .maplibregl-ctrl-attrib a {
    color: #1a6ab8;
    text-decoration: none;
}

.main .lx01 .left.sh-card .sh-map .maplibregl-ctrl-attrib-button {
    width: 24px;
    height: 24px;
}

/* ---------- 地图上的公司标记（HTML 元素，不依赖字形服务） ---------- */
.sh-marker {
    position: relative;
    width: 26px;
    height: 34px;
    cursor: pointer;
    pointer-events: auto;
}

.sh-marker__pin {
    position: absolute;
    left: 50%;
    top: 0;
    width: 26px;
    height: 26px;
    margin-left: -13px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #9b2136;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.sh-marker__dot {
    position: absolute;
    left: 50%;
    top: 9px;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #fff;
}

/* 标记旁的公司名：用系统字体，不需要下载任何字形 */
.sh-marker__label {
    position: absolute;
    left: 30px;
    top: -2px;
    width: max-content;
    max-width: 220px;
    white-space: nowrap;
    padding: 3px 8px;
    font-size: 12px;
    line-height: 16px;
    color: #333;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e2ddd5;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    pointer-events: none;
}

/* ---------- 地名标签（OSM 数据，HTML 渲染） ---------- */
.sh-label {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #6b6257;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 1px 2px #fff;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.sh-label--major {
    font-size: 12px;
    font-weight: 600;
    color: #55503f;
}

.sh-label--minor {
    font-size: 11px;
    color: #7d7466;
}

@media screen and (max-width: 768px) {
    .sh-label--major { font-size: 11px; }
    .sh-label--minor { font-size: 10px; }
}

/* ---------- 操作条 ---------- */
.main .lx01 .left.sh-card .sh-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 0 0;
}

.main .lx01 .left.sh-card .sh-bar[hidden] {
    display: none !important;
}

.main .lx01 .left.sh-card .sh-bar > #shNav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.main .lx01 .left.sh-card .sh-bar > #shNav[hidden] {
    display: none !important;
}

.main .lx01 .left.sh-card .sh-btn {
    display: inline-block;
    margin: 0;
    padding: 8px 18px;
    font-size: 14px;
    line-height: 20px;
    color: #555;
    background-color: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.main .lx01 .left.sh-card .sh-btn-primary {
    color: #fff;
    background-color: #9b2136;
    border-color: #9b2136;
}

.main .lx01 .left.sh-card .sh-btn:active { opacity: .85; }

.main .lx01 .left.sh-card .sh-btn.is-ok {
    color: #1f7a3d; border-color: #9ed3b0; background-color: #f2fbf5;
}

.main .lx01 .left.sh-card .sh-btn.is-fail {
    color: #a12626; border-color: #e2b6b6; background-color: #fdf5f5;
}

/* ---------- 安卓导航选择面板 ----------
 * 安卓上无法判断装了哪个地图，所以不直接跳转，改为展开这个面板让用户选。
 * 系统入口（geo:）排第一，厂商直达链接在后，末尾给出"没反应怎么办"的提示。 */
.main .lx01 .left.sh-card .sh-navpanel {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e2ddd5;
    border-radius: 3px;
    box-sizing: border-box;
}

.main .lx01 .left.sh-card .sh-navpanel[hidden] {
    display: none !important;
}

.main .lx01 .left.sh-card .sh-navitem {
    display: block;
    padding: 9px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 20px;
    color: #333;
    text-decoration: none;
    background-color: #faf9f7;
    border: 1px solid #e6e1d9;
    border-radius: 3px;
}

.main .lx01 .left.sh-card .sh-navitem:last-of-type {
    margin-bottom: 10px;
}

.main .lx01 .left.sh-card .sh-navitem:active {
    opacity: .75;
}

.main .lx01 .left.sh-card .sh-navhint {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: #8a8378;
}

/* ---------- 降级卡片 ---------- */
.main .lx01 .left.sh-card .sh-fallback {
    padding: 26px 30px;
    background-color: #f7f7f7;
    border: 1px solid #e6e6e6;
    box-sizing: border-box;
}

.main .lx01 .left.sh-card .sh-fallback[hidden] {
    display: none !important;
}

.main .lx01 .left.sh-card .sh-fallback .sh-name {
    margin: 0 0 6px;
    font-size: 20px; line-height: 1.4; font-weight: bold; color: #333;
}

.main .lx01 .left.sh-card .sh-fallback .sh-tip {
    margin: 0 0 18px;
    font-size: 12px; line-height: 18px; color: #999;
}

.main .lx01 .left.sh-card .sh-fallback dl { margin: 0; padding: 0; }

.main .lx01 .left.sh-card .sh-fallback dt {
    margin-top: 12px; font-size: 13px; line-height: 20px; color: #999;
}

.main .lx01 .left.sh-card .sh-fallback dd {
    margin: 2px 0 0; font-size: 15px; line-height: 24px; color: #333;
}

.main .lx01 .left.sh-card .sh-fallback dd.sh-addr {
    width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.main .lx01 .left.sh-card .sh-fallback dd a { color: #333; text-decoration: none; }

/* ---------- 窄屏 ---------- */
@media screen and (max-width: 768px) {
    .main .lx01 .left.sh-card {
        min-height: 0;
        margin-bottom: 18px;
    }

    .main .lx01 .left.sh-card .sh-map,
    .main .lx01 .left.sh-card .sh-map.is-loading {
        height: 230px;
    }

    .main .lx01 .left.sh-card .sh-bar {
        padding-top: 10px;
        display: block;           /* 窄屏改成竖排两块，避免三个按钮挤成一团 */
    }

    /* 复制地址独占一行 */
    .main .lx01 .left.sh-card .sh-bar > #shCopy {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* 查看位置 / 开始导航 并排，各占一半 */
    .main .lx01 .left.sh-card .sh-bar > #shNav {
        display: flex;
        width: 100%;
        margin-top: 10px;
        gap: 8px;
    }

    .main .lx01 .left.sh-card .sh-bar > #shNav .sh-btn {
        flex: 1 1 0;
        min-width: 0;
        padding-left: 6px;
        padding-right: 6px;
        text-align: center;
    }

    .main .lx01 .left.sh-card .sh-fallback {
        padding: 18px 16px;
    }

    .main .lx01 .left.sh-card .sh-fallback .sh-name { font-size: 17px; }

    /* 窄屏标记标签收窄，避免超出地图 */
    /* 注意：标签是 .sh-marker（26px 宽）里的绝对定位子元素，
       如果不给 width:max-content，宽度会被父级压成 0 导致逐字竖排 */
    .sh-marker__label {
        left: 24px;
        max-width: 140px;
        font-size: 11px;
        line-height: 15px;
        padding: 2px 6px;
    }
}
