/* =========================================================
   查56首页/列表页 搜索区重构 + 城市选择器 + PC/WAP 自适应
   与 sui.css 并行使用，独立命名避免冲突
   ========================================================= */

/* ---------- 搜索 Hero 区（PC 默认） ---------- */
.home-hero {
  background: linear-gradient(135deg, #0a8ddf 0%, #0f7cc8 55%, #0a6fb5 100%);
  padding: 46px 16px 40px;
  position: relative;
}
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.home-hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.home-hero-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.home-hero-sub {
  color: rgba(255,255,255,.88);
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* 搜索卡片 */
.city-search-card {
  max-width: 860px;
  margin: 26px auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 22px 24px 18px;
}
.city-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.city-field {
  flex: 1;
  position: relative;
  min-width: 0;
}
.city-field-label {
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  padding-left: 2px;
}
.city-field-box {
  display: flex;
  align-items: center;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  height: 50px;
  padding: 0 12px;
  transition: border-color .2s, box-shadow .2s;
}
.city-field-box:hover,
.city-field-box.open { border-color: #0a8ddf; box-shadow: 0 0 0 3px rgba(10,141,223,.12); background: #fff; }
.city-field-box .city-val {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-field-box .city-val.placeholder { color: #bbb; font-weight: 400; }
.city-field-box .city-arrow {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-left: 6px;
  background: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23999%22%20d%3D%22M5.5%207.5l4.5%204.5%204.5-4.5z%22%2F%3E%3C%2Fsvg%3E) no-repeat center/contain;
}
/* 交换按钮 */
.city-swap {
  flex-shrink: 0;
  width: 44px; height: 44px;
  margin-top: 18px;
  border-radius: 50%;
  border: 2px solid #d9e2ea;
  background: #fff;
  color: #0a8ddf;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s, background .2s;
}
.city-swap:hover { background: #eaf4fc; transform: rotate(180deg); }
.city-swap.rotated { transform: rotate(180deg); }
/* 搜索按钮 */
.city-search-btn {
  flex-shrink: 0;
  width: 130px;
  height: 50px;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 4px;
  box-shadow: 0 6px 18px rgba(255,107,53,.35);
  transition: transform .15s, box-shadow .15s;
}
.city-search-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,107,53,.45); }
.city-search-btn:active { transform: translateY(0); }

/* 热门城市标签 */
.hot-city-tags {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.hot-city-tags .hc-label {
  font-size: 12.5px;
  color: #999;
  flex-shrink: 0;
}
.hot-city-tags .hc-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 14px;
  background: #f0f6fb;
  color: #0a8ddf;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid #d9ecf9;
  transition: background .2s, color .2s;
}
.hot-city-tags .hc-tag:hover { background: #0a8ddf; color: #fff; border-color: #0a8ddf; }

/* ---------- 城市选择面板 ---------- */
.city-picker-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 9990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.city-picker-mask.show { display: flex; }
.city-picker-panel {
  width: 520px;
  max-width: 100%;
  height: 560px;
  max-height: 82vh;
  background: #fff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: cp-pop .18s ease-out;
}
@keyframes cp-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 面板头部：标题 + 搜索框 */
.cp-head {
  flex-shrink: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f0;
}
.cp-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cp-title .cp-close {
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: #f2f3f5;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  line-height: 26px;
  text-align: center;
}
.cp-search-box {
  display: flex;
  align-items: center;
  background: #f2f3f5;
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
}
.cp-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #333;
}
.cp-search-box .cp-search-clear {
  flex-shrink: 0;
  border: none;
  background: #d8dade;
  color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  line-height: 18px;
  text-align: center;
  display: none;
}
.cp-search-box .cp-search-clear.show { display: block; }

/* 快捷区：最近 + 热门 */
.cp-quick {
  flex-shrink: 0;
  padding: 10px 16px 6px;
  border-bottom: 1px solid #f5f5f5;
}
.cp-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.cp-quick-row .cpq-label {
  flex-shrink: 0;
  font-size: 12.5px;
  color: #999;
  line-height: 26px;
  width: 44px;
}
.cp-quick-row .cpq-tag {
  padding: 4px 11px;
  border-radius: 13px;
  background: #f7f8fa;
  color: #444;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #eee;
  transition: background .2s, color .2s;
}
.cp-quick-row .cpq-tag:hover { background: #0a8ddf; color: #fff; border-color: #0a8ddf; }

/* 字母索引 + 城市列表 */
.cp-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.cp-cities {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.cp-group { margin-bottom: 4px; }
.cp-group .cpg-letter {
  position: sticky;
  top: 0;
  background: #f7f8fa;
  color: #0a8ddf;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  z-index: 1;
}
.cp-group .cpg-list {
  display: flex;
  flex-wrap: wrap;
}
.cp-group .cpg-item {
  width: 25%;
  padding: 8px 6px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-group .cpg-item:hover,
.cp-group .cpg-item.active { background: #e8f4fd; color: #0a8ddf; font-weight: 600; }
.cp-index {
  flex-shrink: 0;
  width: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-left: 1px solid #f0f0f0;
  overflow-y: auto;
}
.cp-index span {
  font-size: 10.5px;
  color: #0a8ddf;
  cursor: pointer;
  line-height: 16px;
  padding: 0 2px;
  border-radius: 3px;
  width: 18px;
  text-align: center;
}
.cp-index span:hover { background: #e8f4fd; font-weight: 700; }
.cp-empty {
  text-align: center;
  color: #bbb;
  font-size: 13px;
  padding: 50px 0;
}

/* 定位：绑到触发框下方（PC） */
.city-picker-mask.anchor {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  background: transparent;
  pointer-events: none;
}
.city-picker-mask.anchor .city-picker-panel {
  pointer-events: auto;
  position: absolute;
  margin: 0;
}

/* ---------- 列表页搜索条 ---------- */
.home-top-search {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 16px 18px 12px;
  margin-bottom: 18px;
}
.home-top-search .city-search-row { flex-wrap: wrap; }
.home-top-search .city-field { flex: 1 1 220px; }
.home-top-search .city-swap { margin-top: 18px; }
.home-top-search .city-search-btn { width: 130px; }
.home-top-search .hot-city-tags { margin-top: 12px; }
.home-top-search .hc-label { width: 44px; }
.home-top-search .hc-tag { padding: 3px 11px; font-size: 12px; }

/* ---------- 内容区响应式（复用类） ---------- */
@media (max-width: 767px) {
  /* 统一 border-box，避免 width:100% + padding 撑破视口 */
  * { box-sizing: border-box; }
  /* sui-layout 侧栏/内容区堆叠 */
  .sui-layout .sidebar { float: none; width: 100%; }
  .sui-layout .content { margin-left: 0; width: 100%; float: none; }
  .home-hero { padding: 24px 12px 20px; }
  .home-hero-title { font-size: 21px; }
  .home-hero-sub { font-size: 12.5px; }
  .city-search-card { padding: 16px 14px 14px; margin-top: 18px; }
  .city-search-row { flex-wrap: wrap; }
  .city-field { flex: 1 1 100%; }
  .city-swap {
    width: 34px; height: 34px;
    font-size: 15px;
    margin: -4px auto 0;
    transform: rotate(90deg);
  }
  .city-swap:hover { transform: rotate(90deg); }
  .city-swap.rotated { transform: rotate(-90deg); }
  .city-search-btn { width: 100%; margin-top: 8px; }
  .city-field-box { height: 46px; }
  .city-field-box .city-val { font-size: 16px; }

  /* 面板全屏（WAP） */
  .city-picker-mask { padding: 0; align-items: flex-end; }
  .city-picker-panel {
    width: 100%;
    height: 86vh;
    max-height: 86vh;
    border-radius: 16px 16px 0 0;
  }
  .cp-group .cpg-item { width: 33.333%; }

  /* 内容卡片：热门物流园/全国专线推荐 单列全宽（手机端两列 165px 装不下完整信息，改单列保证可读性） */
  .cha-new .span3 {
    width: 100%;
    height: auto;
    margin: 0 0 12px;
    overflow: hidden;
  }
  .cha-new .span3 .cha-new-pic { height: 140px; margin: 0; padding: 0; }
  .cha-new .span3 .cha-new-pic img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
  }
  .cha-new .span3 p {
    height: auto;
    min-height: 22px;
    line-height: 1.5;
    margin: 0 10px;
    padding: 2px 0;
    overflow: visible; /* 允许文字换行，不再单行截断 */
  }
  .cha-new .span3 .cha-new-company {
    flex-wrap: wrap;
    min-height: 24px;
    padding: 4px 0;
  }
  .cha-new .span3 .cha-new-company a { max-width: 100%; }
  .cha-rec .span3 { width: 48%; margin-left: 1%; margin-bottom: 6px; }
  .sui-layout .sidebar.index-left { width: 100%; height: auto; font-size: 18px; margin-bottom: 8px; }
  .sui-layout .content { width: 100%; }
  .sui-page { width: 100%; padding: 12px 8px; }
  /* 区域 Tab 横向滚动 */
  .cha-list .sui-nav.nav-tabs { white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; display: flex; }
  .cha-list .sui-nav.nav-tabs > li { float: none; flex-shrink: 0; }

  /* 列表页左右栏堆叠 */
  .LinesWapper .leftWapper { width: 100%; float: none; }
  .LinesWapper .rightWapper { width: 100%; float: none; margin-top: 14px; }

  /* 专线推荐卡片（手机端重构为 flex 布局）：
     第一行 = 图片(92x76) + 公司名/起止地址(占余宽)，
     第二/三行 = 联系信息、价格信息整行堆叠 */
  .lineList { display: flex; flex-wrap: wrap; padding: 12px 8px; }
  .lineList .photoLeft {
    flex-shrink: 0;
    width: 92px; height: 76px;
    margin: 0 10px 6px 0;
    overflow: hidden;
  }
  .lineList .photoLeft .lineImg,
  .lineList .photoLeft .lineImg img {
    width: 92px; height: 76px;
    object-fit: cover;
  }
  /* 手机端无 hover，隐藏悬浮大图，避免溢出 */
  .lineList .photoLeft .photoBig { display: none !important; }
  .lineList .lineInfo1 { flex: 1; min-width: 0; width: auto; padding: 0; }
  .lineList .lineInfo1 .companyName { max-width: 100%; }
  .lineList .lineInfo2 {
    flex: 0 0 100%;
    display: block;
    width: 100%;
    padding: 6px 0 0;
    list-style: none;
  }
  .lineList .lineInfo2 + .lineInfo2 { margin-top: 4px; border-top: 1px dashed #eee; }
  /* 列表标题栏：条数统计换行显示，避免与浮动标题重叠 */
  .basicTitleBox .sumTip {
    float: none;
    display: block;
    width: 100%;
    height: auto;
    line-height: 1.8;
    clear: both;
  }

  /* 顶部 fixed 条在手机端取消悬浮，恢复正常文档流，避免遮挡 logo */
  .sui-navbar { position: static; }
  .sui-navbar .navbar-inner { padding: 0; }
  /* 头部简化（overflow:hidden 清除 logo 浮动，避免塌陷压住导航） */
  .sui-head { height: auto; padding: 10px 8px 6px; margin: 0; width: 100%; overflow: hidden; }
  .sui-head .logo { width: 160px; height: 40px; background-size: contain; background-position: left center; }
  .logoRight { display: none; }
  .top-line { width: 100%; padding: 0 8px; }
  .top-line .sui-brand { font-size: 11px; }
  /* 导航横向滚动（width:100% 防止 ul 收缩/右移） */
  .nav { height: auto; line-height: 40px; }
  .nav-container { width: 100%; padding: 0 6px; }
  .nav .sui-nav.nav-tabs.nav-pills { display: flex; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; width: 100%; }
  .nav .sui-nav.nav-tabs.nav-pills > li { margin: 0 6px; float: none; flex-shrink: 0; }
  .nav .sui-nav.nav-tabs.nav-pills > li > a { padding: 8px 6px; font-size: 13px; }
  /* 内容卡片区：清除浮动塌陷（.tab-pane 内 .span3 float），避免与后续区块重叠 */
  .cha-list .tab-content { overflow: hidden; }
  /* footer */
  .footerCont { width: 100%; padding: 14px 10px; }
  .footer .footer_l { display: none; }
  .footer .footer_r { width: 100%; float: none; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .sui-page { width: 100%; padding: 16px 12px; }
  .cha-new .span3 { width: 32%; margin: 0 0.66% 14px; }
}

/* 工具栏/列表页顶部搜索在窄屏下换行 */
@media (max-width: 560px) {
  .home-top-search .city-search-row .city-field { flex: 1 1 100%; }
  .home-top-search .city-search-btn { width: 100%; margin-top: 8px; }
  .home-top-search .city-swap { margin: -2px auto 0; transform: rotate(90deg); }
  .home-top-search .city-swap:hover { transform: rotate(90deg); }
  .home-top-search .city-swap.rotated { transform: rotate(-90deg); }
}
