@charset "utf-8";
/* ==========================================================================
 * 选择城市页（?c=Index&a=changeCity）移动端专项优化 v1
 * 仅在本页加载（新增文件，不改动公共 car_type.css，避免影响其他页面）
 * 只做呈现层调整，不改动任何业务逻辑与接口数据
 *
 * ⚠️ 高度约束：JS 里用 titleHeight=28、itemHeight=54 计算字母索引跳转位置，
 *    所以 .cities .title 必须保持 28px、.cities .item 必须保持 54px。
 *    本文件已刻意锁定这两个高度，改动前请先看模板里的 JS。
 * ========================================================================== */

/* ---------- 0. 基础 ---------- */
.hot,
.city_header,
.city_header_right,
.city_header_right input,
.shortcut .item,
.showLetter {
    box-sizing: border-box;
}
html,
body {
    /* reset.css 里 html,body{font-size:62.5%}=10px，页面大量用 rem，
       这里保持不变，仅补背景色 */
    background: #f5f6f8;
}

/* ---------- 1. 顶部搜索栏 ----------
 * 原为 position:absolute + 无安全区适配；X 是 15px PNG；搜索框是
 * 「左边图标 + 右边输入框」的 float 混排，整块点击跳搜索页。
 * 改为 fixed + 刘海安全区，并做成标准搜索胶囊（图标在左、占位文字在右）。 */
.city_header {
    position: fixed;
    top: 0;
    left: 0;
    height: calc(50px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0;
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .05);
    z-index: 9999;
}
/* 关闭按钮：从 15px PNG 改为 34px 圆形按钮（热区够大、矢量图标不糊） */
.city_header_left {
    float: none;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0 10px 0 0;
    background: #f2f3f5 url(../images/icons/close.svg) no-repeat center;
    background-size: 16px 16px;
    border-radius: 50%;
}
.city_header_left:active {
    background-color: #e6e8eb;
}
/* 搜索胶囊：整体点击跳「搜索城市」页，内部输入框只作占位展示 */
.city_header_right {
    float: none;
    flex: 1 1 auto;
    width: auto;
    height: 36px;
    line-height: 36px;
    margin: 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 18px;
    background: #f5f6f8;
}
.city_header_right:active {
    background: #eef0f3;
}
.city_header_right div.btn {
    float: none;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background: url(../images/icons/search.svg) no-repeat center;
    background-size: 16px 16px;
}
.city_header_right input {
    float: none;
    flex: 1 1 auto;
    width: auto;
    height: 34px;
    line-height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #222;
    /* iOS 聚焦不自动放大：字号 ≥16px 才安全，这里用 transform 规避不划算，
       故保持 14px 但给输入框加 readonly（本框只做跳转入口，不实际输入） */
}
.city_header_right input::placeholder {
    color: #9aa2ad;
}

/* ---------- 2. 列表容器 ----------
 * .city-wrapper 原本 top:50px 写死，刘海屏会被状态栏压住 */
.city .city-wrapper {
    top: calc(50px + env(safe-area-inset-top, 0px));
    background: #f5f6f8;
}
.cities {
    background: #fff;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 3. 字母分组标题（高度必须保持 28px） ---------- */
.city .city-wrapper .cities .title {
    height: 28px;
    line-height: 28px;
    padding-left: 16px;
    background-color: #f2f3f5;
    font-size: 13px;
    font-weight: 600;
    color: #8a94a6;
    letter-spacing: .5px;
}

/* ---------- 4. 城市行（高度必须保持 54px） ---------- */
.city .city-wrapper .cities .item {
    height: 54px;
    line-height: 54px;
    font-size: 16px;
    color: #222;
    transition: background .12s;
}
.city .city-wrapper .cities .item:active {
    background-color: #fff4ea;
}
.city .city-wrapper .cities .item .name {
    padding: 0 44px 0 16px; /* 右侧留出字母索引的宽度，避免长城市名压到索引上 */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* 行分隔线：改为浅灰虚线感（保持原 1px 实线亦可，这里调淡） */
.city .city-wrapper .cities .item .name:after {
    border-top-color: #f0f1f3;
}

/* ---------- 5. 热门城市 / 历史访问的气泡 ----------
 * 原 .hot：22% 宽 + 2% 左间距 + 1px 边框且无 box-sizing，
 * 视觉上像一排白底细框方块；改为浅橙底圆角气泡。
 * ⚠️ 必须保持「一行 4 个」：width 22% + margin-left 2% = 24% × 4 = 96%，
 *    因为该行数参与 JS 的字母索引位置计算，不能改成别的排布。 */
.hot {
    width: 22%;
    height: 30px;
    line-height: 30px;
    margin-left: 2%;
    margin-top: 12px; /* 12 + 30 + 12 = 54，正好在 54px 行内垂直居中 */
    padding: 0 4px;
    text-align: center;
    font-size: 13px;
    color: #ff6e00;
    background: #fff4ea;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.hot:active {
    background: #ffe3ca;
}
/* 只有一个城市时（如「历史访问」）水平居中，不再孤零零贴左边 */
.city .city-wrapper .cities .item .hot:only-child {
    float: none;
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: 34%;
}

/* ---------- 6. 右侧字母索引 ----------
 * 原：宽 40px，item 有 padding-left:24px，字母被推到右侧且偏出中心；
 *     颜色是褐色 #896A0D，与站内橙色主题不搭。 */
.city .city-wrapper .shortcut {
    width: 26px;
    right: 4px;
    padding: 4px 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 6px rgba(31, 39, 51, .1);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.city .city-wrapper .shortcut .item {
    height: 15px;
    line-height: 15px;
    padding: 1px 0 0;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #8a94a6;
}
.city .city-wrapper .shortcut .item:active {
    color: #ff6e00;
}
@media only screen and (max-height: 600px) {
    .city .city-wrapper .shortcut {
        padding: 2px 0;
    }
    .city .city-wrapper .shortcut .item {
        font-size: 9px;
    }
}

/* ---------- 7. 滑动时居中的大写字母提示 ----------
 * 原为褐色 1px 方框、border-radius:10%（几乎看不出圆角） */
.showLetter {
    width: 56px;
    height: 56px;
    line-height: 56px;
    left: 50%;
    top: 42%;
    margin-left: -28px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a3c 0%, #ff6e00 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 110, 0, .35);
    text-align: center;
    z-index: 9999;
}
.showLetter span {
    width: 56px;
    height: 56px;
    line-height: 56px;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}
