/* ==========================================================================
   开利运输冷冻服务站 - H5 样式（移动端优先）
   ========================================================================== */

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

html, body {
    width: 100%;
    height: 100%;
    background: #f5f6f8;
    color: #333;
    font: 14px/1.6 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* 页面布局：顶部（导航+搜索+地图+结果条）固定，只有列表区滚动
   （仅主页启用；nav.html 等页面保持正常文档滚动） */
body.main-page {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
img { border: 0; vertical-align: middle; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input { font-family: inherit; outline: none; }

/* ---------- 顶部导航 ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}
.navbar-title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}
.navbar-back {
    position: absolute;
    left: 12px;
    font-size: 15px;
    color: #1989fa;
}
.city-btn {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    max-width: 55%;
    font-size: 14px;
    color: #1989fa;
    background: none;
}
.city-btn span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.icon-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #1989fa;
}

/* ---------- 搜索 ---------- */
.search-bar {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
}
.search-bar input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e2e2;
    border-radius: 19px;
    background: #f5f6f8;
    font-size: 14px;
}
.search-btn {
    height: 38px;
    margin-left: 10px;
    padding: 0 18px;
    border-radius: 19px;
    background: #1989fa;
    color: #fff;
    font-size: 14px;
}
.search-btn:active { opacity: .85; }

/* ---------- 地图 ---------- */
.map-wrap {
    position: relative;
    z-index: 0;            /* 建立层叠上下文：隔离天地图内部图层，避免盖住城市选择器等弹层 */
    height: 300px;
    background: #fff;
    transition: height .4s ease;
}
.map-box { width: 100%; height: 100%; }
.map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}
/* 右下角圆形图标按钮（并排）：我的位置 / 全屏 / 收起 */
.map-toolbar {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3000;         /* 须高于天地图内部控件（缩放/比例尺等 z-index 1000+）；
                              .map-wrap 已建立层叠上下文，此值不会泄漏到弹层之上 */
    display: flex;
    flex-direction: row;
}
.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    color: #231815;
}
.tool-btn svg {
    display: block;
    width: 22px;
    height: 22px;
}
.tool-btn:active { background: #f0f0f0; }

/* 地图全屏（覆盖列表区域） */
body.map-expanded { overflow: hidden; }
body.map-expanded .map-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    height: 100%;
}
body.map-expanded .map-toolbar { bottom: 30px; }

/* ---------- 结果信息 ---------- */
/* 固定区：下边距常驻（若间隙放在列表上内边距里，滚动后就消失了） */
.result-bar {
    padding: 8px 12px 10px;
    color: #888;
    font-size: 12px;
}
.result-bar b { color: #1989fa; }

/* ---------- 服务站列表 ---------- */
/* 页面唯一滚动区域：顶部与地图固定，仅此容器滚动 */
.list-scroll {
    flex: 1;
    min-height: 0;               /* 允许收缩到内容高度以下，保证只滚列表 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;   /* iOS 惯性滚动 */
}
.company-list {
    padding: 0 12px 30px;   /* 顶部间隙由 .result-bar 下边距常驻提供，不再随列表滚动消失 */
}
.company-item {
    position: relative;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
/* 选中（与地图标注联动高亮）：内发光描边（细）+ 浅色底 */
.company-item.active {
    background: #f0f7ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05),
                inset 0 0 0 1px rgba(25, 137, 250, .55),
                inset 0 0 5px rgba(25, 137, 250, .18);
}
.company-name {
    padding-right: 60px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.tag-self {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #ff5b05;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    vertical-align: 2px;
}
.company-line {
    margin-top: 5px;
    color: #666;
    font-size: 13px;
    word-break: break-all;
}
.company-line.address { color: #333; }
.icon-tel { vertical-align: -2px; }
.tel { color: #1989fa; margin-right: 6px; }
.notice {
    margin-top: 6px;
    color: #f5222d;
    font-size: 12px;
    text-align: center;
}
.item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.distance {
    display: inline-flex;
    align-items: center;
    color: #999;
    font-size: 13px;
}
.icon-add {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    background: url(../assets/images/icon_xsj.png) no-repeat center/contain;
}
.nav-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px;
}
.nav-btn:active { opacity: .7; }

/* ---------- 空态 / 加载 ---------- */
.empty-tip {
    padding: 40px 0;
    color: #999;
    text-align: center;
}
.loading {
    padding: 15px 0;
    color: #999;
    text-align: center;
}

/* ---------- 遮罩 + 城市选择器 ---------- */
/* 显隐动画：由 display 切换改为 .show 类 + 过渡
   （display:none 无法产生过渡效果；visibility 隐藏同时阻止点击） */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.mask.show {
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease;
}
.city-picker {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 310;
    display: flex;
    flex-direction: column;
    width: 82%;
    max-width: 420px;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0, 0, 0, .15);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
}
.city-picker.show {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease;
}
.city-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
}
.city-picker-head h3 { font-size: 16px; }
.city-close {
    width: 30px;
    height: 30px;
    color: #999;
    font-size: 24px;
    line-height: 1;
}
.city-picker-body {
    flex: 1;
    display: flex;
    min-height: 0;
}
.province-list {
    width: 42%;
    overflow-y: auto;
    background: #f5f6f8;
}
.province-item {
    padding: 12px 10px;
    color: #555;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.province-item.active {
    background: #fff;
    border-left-color: #1989fa;
    color: #1989fa;
    font-weight: 600;
}
.city-list {
    flex: 1;
    overflow-y: auto;
}
.city-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
    font-size: 14px;
}
.city-item:active { background: #f5f8ff; }
.region-error { padding: 12px; color: #999; }

/* ---------- 导航页（nav.html） ---------- */
.nav-page .nav-map { height: 55vh; }
.nav-info {
    padding: 14px;
    background: #fff;
}
.nav-info h2 { font-size: 17px; }
.nav-actions {
    display: flex;
    margin-top: 14px;
}
.primary-btn {
    flex: 1;
    height: 42px;
    border-radius: 21px;
    background: #1989fa;
    color: #fff;
    font-size: 15px;
}
.ghost-btn {
    flex: 1;
    height: 42px;
    margin-left: 10px;
    border: 1px solid #1989fa;
    border-radius: 21px;
    color: #1989fa;
    font-size: 15px;
}
.primary-btn:active, .ghost-btn:active { opacity: .85; }
.nav-tip {
    margin-top: 12px;
    color: #999;
    font-size: 12px;
}
