/* ==========================================================================
   首页样式 —— 复刻自 index.css + search.css + mb-common.css
   ========================================================================== */

/* ==========================================================================
   1. 顶部轮播 (.hm_banner)
   ========================================================================== */
.hm_banner { position: relative; background: var(--bg-white); }
.hm_banner .swiper-container { width: 100%; }
.hm_banner .swiper-slide img { width: 100%; height: 180px; object-fit: cover; display: block; }
.hm_banner .swiper-pagination {
  position: absolute; bottom: 26px; left: 0; right: 0;
  text-align: center; z-index: 5;
}
.hm_banner .swiper-pagination-bullet {
  display: inline-block; width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, .55); margin: 0 3px;
  transition: width .25s;
}
.hm_banner .swiper-pagination-bullet-active { width: 14px; background: #fff; }

/* 城市切换（左上角） */
.hm_banner .city_switch {
  position: absolute; left: 12px; top: 12px; z-index: 6;
  background: rgba(0, 0, 0, .32);
  color: #fff; font-size: var(--fs-sm);
  border-radius: 20px; padding: 4px 12px;
  display: flex; align-items: center; gap: 4px;
}
.hm_banner .city_switch::after {
  content: ""; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid #fff;
}

/* ==========================================================================
   2. 首页搜索栏 (.hm_search)
   ========================================================================== */
.hm_search {
  background: var(--bg-white);
  padding: 10px var(--page-pad);
  position: relative; z-index: 20;
}
.hm_search .search_box {
  height: 40px; line-height: 40px;
  background: var(--bg-body);
  border-radius: 20px;
  padding: 0 16px;
  display: flex; align-items: center;
  color: var(--c-text-weak); font-size: var(--fs-sm);
}
.hm_search .search_box i {
  width: 14px; height: 14px; margin-right: 8px;
  border: 2px solid var(--c-text-weak); border-radius: 50%;
  position: relative; flex-shrink: 0;
}
.hm_search .search_box i::after {
  content: ""; position: absolute; right: -4px; bottom: -3px;
  width: 6px; height: 2px; background: var(--c-text-weak);
  border-radius: 1px; transform: rotate(45deg);
}
.hm_search .search_box .map_btn {
  margin-left: auto; color: var(--c-primary); font-size: var(--fs-sm);
  padding-left: 12px; border-left: 1px solid #ddd;
}

/* ==========================================================================
   3. 指数栏 (.hm_zhishu)
   ========================================================================== */
.hm_zhishu {
  background: var(--bg-white);
  padding: 6px var(--page-pad) 14px;
  display: flex;
  border-bottom: 8px solid var(--bg-body);
}
.hm_zhishu li { flex: 1; text-align: center; position: relative; }
.hm_zhishu li + li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 22px; background: var(--line);
}
.hm_zhishu li em {
  display: block;
  font-size: var(--fs-md); font-weight: 700; color: var(--c-primary);
  line-height: 20px;
}
.hm_zhishu li em.hot { color: var(--c-price); }
.hm_zhishu li span { display: block; font-size: var(--fs-sm); color: var(--c-text-weak); margin-top: 2px; }

/* ==========================================================================
   4. 11 宫格导航 (.hm_m-nv)
   ========================================================================== */
.hm_m-nv {
  background: var(--bg-white);
  padding: 22px 0 0;
  overflow: hidden;
}
.hm_m-nv ul { overflow: hidden; }
.hm_m-nv li {
  float: left; width: 20%;
  text-align: center;
  margin-bottom: 18px;
}
.hm_m-nv li a { display: block; }
.hm_m-nv li i {
  margin: 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  background-color: #eaf7f1;
  background-repeat: no-repeat; background-position: center; background-size: 26px 26px;
  display: block;
}
.hm_m-nv li span {
  display: block;
  font-size: var(--fs-sm); color: var(--c-text-sub);
  margin-top: 6px;
  white-space: nowrap;
}
.hm_m-nv li a:active i { transform: scale(.94); }

/* ==========================================================================
   5. 公告滚动 (.hm_gonggao)
   ========================================================================== */
.hm_gonggao {
  background: var(--bg-white);
  margin-top: 8px;
  padding: 10px var(--page-pad);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}
.hm_gonggao .gg_tag {
  flex-shrink: 0;
  color: var(--c-price); font-size: var(--fs-sm); font-weight: 700;
  padding-right: 10px; margin-right: 10px;
  border-right: 1px solid var(--line);
}
.hm_gonggao .vTicker {
  flex: 1; height: 20px; overflow: hidden; position: relative;
}
.hm_gonggao .vTicker li {
  height: 20px; line-height: 20px;
  font-size: var(--fs-sm); color: var(--c-text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==========================================================================
   6. 广告位
   ========================================================================== */
.hm_ad { background: var(--bg-white); padding: 10px var(--page-pad); }
.hm_ad img { width: 100%; border-radius: var(--r-md); }

/* ==========================================================================
   7. 推荐房源区块 (.hm_block)
   ========================================================================== */
.hm_block { background: var(--bg-white); margin-top: 8px; }
.hm_block .block_head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--page-pad) 6px;
}
.hm_block .block_head h3 {
  font-size: 16px; font-weight: 700; color: var(--c-title);
  position: relative; padding-left: 10px;
}
.hm_block .block_head h3::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 15px; background: var(--c-primary); border-radius: 1px;
}
.hm_block .block_head .more {
  font-size: var(--fs-sm); color: var(--c-text-weak);
  display: flex; align-items: center; gap: 2px;
}
.hm_block .block_head .more::after {
  content: ""; width: 5px; height: 5px;
  border-top: 1px solid var(--c-text-weak); border-right: 1px solid var(--c-text-weak);
  transform: rotate(45deg);
}
.hm_block .block_body { padding: 0 var(--page-pad); }
.hm_block .block_body .pictext { padding: 12px 0; border-bottom: 1px solid var(--line-card); }
.hm_block .block_body .pictext:last-child { border-bottom: 0; }
.hm_block .block_body .mod_media,
.hm_block .block_body .mod_media .media_main { width: var(--thumb-w); }
.hm_block .block_body .mod_media .media_main { height: 81px; background: var(--bg-body); }

/* 区块内的「查看全部」按钮 */
.hm_block .block_all {
  display: block;
  margin: 4px var(--page-pad) 14px;
  height: 38px; line-height: 38px; text-align: center;
  border: 1px solid var(--c-primary-87);
  color: var(--c-primary);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
}

/* ==========================================================================
   8. 经纪人轮播 (.hm_jjr)
   ========================================================================== */
.hm_jjr { background: var(--bg-white); margin-top: 8px; padding-bottom: 14px; }
.hm_jjr .swiper-container { padding: 0 var(--page-pad); }
.hm_jjr .swiper-slide {
  width: 120px;
  text-align: center;
  background: var(--bg-panel);
  border-radius: var(--r-lg);
  padding: 14px 8px;
}
.hm_jjr .swiper-slide .avatar {
  width: 50px; height: 50px; border-radius: 50%;
  margin: 0 auto 8px; overflow: hidden; background: #ddd;
}
.hm_jjr .swiper-slide .avatar img { width: 100%; height: 100%; object-fit: cover; }
.hm_jjr .swiper-slide .name {
  font-size: var(--fs-md); color: var(--c-title); font-weight: 700;
  margin-bottom: 3px;
}
.hm_jjr .swiper-slide .shop {
  font-size: 11px; color: var(--c-text-weak);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hm_jjr .swiper-slide .num {
  font-size: 11px; color: var(--c-primary); margin-top: 3px;
}

/* ==========================================================================
   9. 搜索面板弹层 (.indexmainsearch)
   ========================================================================== */
.mask-layer {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .45);
}
.mask-layer.show { display: block; }

.indexmainsearch {
  display: none;
  position: fixed; left: 50%; top: 0; bottom: 0;
  transform: translateX(-50%);
  width: 100%; max-width: 640px;
  background: var(--bg-white);
  z-index: 100;
  overflow-y: auto;
  padding-bottom: 70px;
}
.indexmainsearch.show { display: block; }

/* 搜索框 */
.indexmainsearch .s_head {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-white);
  padding: 10px var(--page-pad);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.indexmainsearch .s_head input {
  flex: 1; height: 36px; background: var(--bg-body);
  border-radius: 18px; padding: 0 16px; font-size: var(--fs-sm);
}
.indexmainsearch .s_head .s_cancel { color: var(--c-text-sub); font-size: var(--fs-sm); }

/* Tab 切换 */
.indexmainsearch .s_tabs {
  display: flex; padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--line);
}
.indexmainsearch .s_tabs a {
  padding: 12px 0; margin-right: 22px;
  font-size: var(--fs-md); color: var(--c-text-sub);
  position: relative;
}
.indexmainsearch .s_tabs a.on { color: var(--c-primary); font-weight: 700; }
.indexmainsearch .s_tabs a.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--c-primary); border-radius: 1px;
}

/* 选项组标题 */
.xuanxiang-title {
  font-size: var(--fs-lg);
  color: var(--c-text);
  padding-top: 16px;
  padding-left: 20px;
  font-weight: 700;
}
.xuanxiang-content {
  padding: 10px 20px 4px;
  display: flex; flex-wrap: wrap;
}
.xuanxiang-content > span {
  background-color: var(--bg-body);
  color: var(--c-text-weak);
  font-size: var(--fs-md);
  border-radius: var(--r-lg);
  padding: 5px 0;
  width: calc(25% - 9px);
  text-align: center;
  margin-right: 7px;
  margin-bottom: 9px;
  box-sizing: border-box;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xuanxiang-content > span:nth-child(4n) { margin-right: 0; }
.xuanxiang-content > span.on {
  background-color: var(--c-primary); color: #fff; font-weight: 700;
}
/* 三列变体 */
.xuanxiang-content.col3 > span { width: calc(33.33% - 6px); }
.xuanxiang-content.col3 > span:nth-child(4n) { margin-right: 7px; }
.xuanxiang-content.col3 > span:nth-child(3n) { margin-right: 0; }
/* 两列变体 */
.xuanxiang-content.col2 > span { width: calc(50% - 4px); }
.xuanxiang-content.col2 > span:nth-child(4n) { margin-right: 7px; }
.xuanxiang-content.col2 > span:nth-child(2n) { margin-right: 0; }

/* 总价滑块 */
.price-slider { padding: 6px 20px 16px; }
.price-slider .slider-label {
  display: flex; justify-content: space-between;
  font-size: var(--fs-sm); color: var(--c-text-weak);
  margin-bottom: 8px;
}
.price-slider .slider-label em { color: var(--c-price); font-weight: 700; }
.range-track {
  position: relative; height: 4px;
  background: #ddd; border-radius: 2px;
  margin: 18px 0 8px;
}
.range-track .range-fill {
  position: absolute; top: 0; height: 100%;
  background: var(--c-primary); border-radius: 2px;
}
.range-handle {
  position: absolute; top: 50%;
  width: 20px; height: 20px;
  margin-left: -10px;
  transform: translateY(-50%);
  background: #fff; border: 2px solid var(--c-primary);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  cursor: pointer;
  z-index: 2;
}

/* 搜索按钮（吸底） */
.searchstart {
  position: sticky; bottom: 0;
  padding: 10px 20px 14px;
  background: var(--bg-white);
  border-top: 1px solid var(--line);
}
.searchstart a {
  display: block; height: 44px; line-height: 44px;
  text-align: center;
  background: var(--c-primary); color: #fff;
  border-radius: var(--r-lg);
  font-size: 16px; font-weight: 700;
}

/* ==========================================================================
   10. 客服浮层
   ========================================================================== */
.kefu-float {
  position: fixed; right: 12px; bottom: calc(var(--nav-h) + 20px);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 3px 10px rgba(3, 172, 101, .4);
  z-index: 70;
  display: flex; align-items: center; justify-content: center;
}
.kefu-float::before {
  content: ""; width: 20px; height: 20px;
  border: 2px solid #fff; border-radius: 50%;
  border-bottom-color: transparent;
  position: relative;
}
.kefu-float::after {
  content: ""; position: absolute;
  width: 6px; height: 6px; background: #fff; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
