/* =========================================================
   企业林 qiyelin.com 移动端适配 (mobile.css) v2
   设计原则：
   1. 仅在小屏（<=768px / <=480px）生效，桌面端零影响。
   2. 全部规则按 class 精准命中；页面没有对应 class 时自动无效果，安全。
   3. 头部汉堡导航为核心修复：桌面端完全不注入，仅在 <=768px 由 mobile.js 动态组装。
   v2 修复（2026-07-23 真机测试后）：
     - 卡片价格字号收敛（28px→20px），避免溢出。
     - 筛选标签增大触摸目标（min-height:38px）。
     - 右侧浮动客服按钮缩进不遮挡内容。
     - 字体基线提升（正文最低13px，标题16px+）。
     - 图片统一 max-width:100% + 自适应高度。
     - 搜索栏/头部在移动端更紧凑。
   ========================================================= */

/* 全局安全网：杜绝横向滚动 + 图片自适应 */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }
  img, video, iframe, canvas, svg { max-width: 100%; height: auto; }
}

/* ---------- 汉堡导航切换按钮：桌面隐藏，移动显示 ---------- */
.hdr-menu-toggle { display: none; }

/* ---------- 筛选栏折叠触发按钮：默认（桌面）隐藏，仅手机显示 ---------- */
.filter-toggle-btn { display: none; }

@media (max-width: 768px) {
  /* ====== 头部区域 ====== */
  header .hdr-inner,
  .pc-header.hdr-inner,
  header.hdr-inner,
  .pc-header > .hdr-inner,
  .pc-header {
    position: relative !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    height: auto !important;
    min-height: 48px;
  }

  /* 兼容 .pc-header 本身是 flex 容器的情况 */
  .pc-header {
    flex-wrap: nowrap !important;
  }

  /* 汉堡按钮 */
  .hdr-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    order: 2 !important;
    width: 44px;
    height: 44px;
    margin-left: auto !important;
    margin-right: 0 !important;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: #333;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }

  /* 移动下拉面板（默认隐藏，由 .mobile-nav-open 控制） */
  .hdr-mobile-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    flex-direction: column;
    padding: 4px 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 面板打开状态——多重选择器覆盖不同 DOM 结构 */
  header.mobile-nav-open > .hdr-inner > .hdr-mobile-panel,
  .pc-header.mobile-nav-open > .hdr-inner > .hdr-mobile-panel,
  header.mobile-nav-open > .hdr-mobile-panel,
  .pc-header.mobile-nav-open > .hdr-mobile-panel,
  .mobile-nav-open > .hdr-inner > .hdr-mobile-panel,
  .hdr-inner > .hdr-mobile-panel.mobile-panel-visible {
    display: flex !important;
  }

  /* 搜索框不放进汉堡菜单，移动端整体隐藏（桌面端不受影响） */
  .hdr-search { display: none !important; }

  /* 详情页招商热线悬浮拨打条（仅移动端、仅详情页，由 mobile.js 注入） */
  .mnav-call-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    background: #05944B;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .18);
    -webkit-tap-highlight-color: transparent;
  }
  .mnav-call-bar .ic { font-size: 18px; }
  body.has-call-bar { padding-bottom: 52px; }

  /* 面板内元素：强制可见 + 竖向全宽 */
  .hdr-mobile-panel .hdr-nav,
  .hdr-mobile-panel .hdr-search,
  .hdr-mobile-panel .hdr-auth,
  .hdr-mobile-panel .hdr-utils,
  .hdr-mobile-panel .hdr-user,
  .hdr-mobile-panel nav {
    display: block !important;
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    border-bottom: 1px solid #f3f3f3;
    padding: 0 !important;
    margin: 0 !important;
  }

  .hdr-mobile-panel .hdr-nav a {
    display: block !important;
    padding: 14px 18px;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    white-space: normal;
    line-height: 1.4;
  }
  .hdr-mobile-panel .hdr-nav a:last-child { border-bottom: none; }

  .hdr-mobile-panel .hdr-search {
    display: flex !important;
    flex-direction: row !important;
    padding: 10px 14px !important;
    gap: 8px;
    align-items: center !important;
    width: 100% !important;
  }
  .hdr-mobile-panel .hdr-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    height: 40px;
  }
  .hdr-mobile-panel .hdr-search button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #05944B;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    height: 40px;
    flex-shrink: 0;
  }

  .hdr-mobile-panel .hdr-auth,
  .hdr-mobile-panel .hdr-utils {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    padding: 10px 14px !important;
  }
  .hdr-mobile-panel .hdr-auth a,
  .hdr-mobile-panel .hdr-utils a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    color: #333;
    text-align: left;
  }

  /* Logo 保持在顶栏 */
  .hdr-logo {
    flex: 0 0 auto !important;
    order: 1 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .hdr-logo img {
    height: 32px !important;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  /* ====== 房源卡片（核心修复区）====== */
  .prop-card {
    flex-direction: column !important;
  }
  .prop-img {
    width: 100% !important;
    height: 180px !important;
    min-height: 160px;
  }
  .prop-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }

  /* 卡片主信息区 */
  .prop-main {
    padding: 14px 16px !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .prop-title {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  .prop-info-row {
    font-size: 12px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }
  .prop-tags-row {
    gap: 6px !important;
  }
  .prop-tag {
    font-size: 11px !important;
    padding: 3px 10px !important;
  }

  /* 卡片右侧/底部价格区 —— 收敛为横排底部条 */
  .prop-side {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    min-width: 0 !important;
    width: 100% !important;
    border-top: 1px solid #f5f5f5;
    gap: 8px;
  }
  .prop-side .price-num {
    font-size: 20px !important;  /* 原始 28px 太大 */
    line-height: 1.2 !important;
  }
  .prop-side .price-unit {
    font-size: 11px !important;
  }
  .prop-side .price-label {
    font-size: 11px !important;
  }
  .prop-footer {
    flex-wrap: wrap !important;
    font-size: 12px !important;
    gap: 4px 12px;
  }
  .prop-footer .contact {
    font-size: 14px !important;
  }

  /* ====== 筛选栏折叠面板（仅手机端，默认收起） ====== */
  .filter-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--c-card-border, #ececec);
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
  }
  .filter-toggle-btn .ft-left { display: flex; align-items: center; gap: 8px; }
  .filter-toggle-btn .ft-icon { font-size: 15px; color: var(--c-green, #05944B); }
  .filter-toggle-btn .ft-label { font-weight: 600; }
  .filter-toggle-btn .ft-arrow { font-size: 13px; color: #999; transition: transform .2s ease; }
  .filter-toggle-btn.open .ft-arrow { transform: rotate(180deg); color: var(--c-green, #05944B); }

  /* 手机端：筛选栏直接展开，标签改为原生下拉，不再折叠 */
  .filter-toggle-btn { display: none !important; }
  .filter-tag-more { display: none !important; }
  /* 产业列表：移动端标签已由下拉替代，隐藏"更多"链接 */
  .filter-more-link { display: none !important; }
  /* 注意：绝不可隐藏 wrapper！mobile.js 会把下拉 select 插进 wrapper 内，
     隐藏会导致产业园区"区域"等下拉在手机端整个不可见。仅隐藏其内部的标签与更多链接即可。 */
  .filter-row-tags-wrapper {
    display: flex !important;
    flex: 1;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-bar {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    padding: 12px 14px !important;
    border: 1px solid var(--c-card-border, #ececec) !important;
    border-radius: 8px;
    margin-bottom: 11px !important;
  }
  .filter-row-tags { display: none !important; }
  .filter-tag, .filter-tag-more { display: none !important; }
  .filter-select {
    display: block !important;
    width: auto;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    padding: 7px 32px 7px 10px;
    margin: 3px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #222;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
  }
  .filter-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    padding: 4px 0 !important;
    flex-wrap: wrap;
  }
  .filter-row-label {
    width: auto !important;
    min-width: 44px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .filter-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-tag {
    padding: 8px 14px !important;  /* 增大触摸目标 */
    font-size: 13px !important;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .filter-tag-more {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }
  .filter-input {
    height: 34px;
    padding: 6px 8px !important;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
  }
  .filter-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 100%;
    margin-top: 2px;
  }
  .filter-select-loc {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* 园区详情页 res-filter：类型标签筛选改为下拉，与列表页统一风格 */
  .res-filter .res-fitem[data-type] { display: none !important; }
  .res-type-select {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    padding: 7px 32px 7px 10px;
    margin: 3px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #222;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
  }

  /* 标签折叠栏 */
  .tag-bar {
    gap: 6px;
  }
  .tag-bar-item {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  /* 结果统计栏 */
  .result-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
    padding: 12px 0 !important;
  }

  /* ====== 右侧浮动客服按钮：移动端缩小 + 移到右下角避免遮挡 ====== */
  .chat-fab {
    width: 28px !important;
    padding: 6px 0 !important;
    border-radius: 14px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 80px !important;
    transform: none !important;
    box-shadow: 0 3px 10px rgba(5,148,75,.35) !important;
    z-index: 9998 !important;
  }
  .chat-fab svg {
    width: 18px !important;
    height: 18px !important;
  }
  .chat-fab-text {
    font-size: 11px !important;
    letter-spacing: 1px !important;
  }

  /* ====== 页脚单列 ====== */
  .sf-main { flex-wrap: wrap; gap: 20px; text-align: center; }
  .sf-left,
  .sf-center,
  .sf-right {
    min-width: 100% !important;
    width: 100% !important;
    align-items: center !important;
    text-align: center !important;
  }
  .sf-bottom { text-align: center; }
  .sf-bottom p { font-size: 11px; }

  /* ====== 双栏 → 单列通用规则 ====== */
  .two-col { flex-direction: column !important; gap: 16px !important; }
  .detail-layout { flex-direction: column !important; }
  .detail-main,
  .detail-sidebar {
    flex: 1 1 auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 网格类 → 单列/少列 */
  .res-list { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .corp-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .spec-grid { gap: 8px; }
  .spec-item { flex: 0 0 calc(33.333% - 6px) !important; }
  .loc-grid { grid-template-columns: 1fr !important; }
  .img-grid-2 { grid-template-columns: 1fr !important; }
  .tf-grid { grid-template-columns: 1fr !important; }
  /* 房源详情：主图加大，只放一张主图 */
  .gallery-wrap { margin-top: 14px !important; }
  .gallery .g-card { flex: 0 0 100% !important; max-width: 100% !important; }
  .gallery .g-card:not(:first-child) { display: none !important; }
  .gallery .g-card::before { padding-bottom: 56% !important; }
  .gallery-wrap .g-nav,
  .gallery-wrap .gallery-dots { display: none !important; }
  .park-row-cards { grid-template-columns: repeat(2, 1fr) !important; }
  .hot-grid { grid-template-columns: 1fr !important; }
  .cat-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* 标题行竖排 */
  .title-row,
  .title-hotline-row { flex-direction: column !important; align-items: stretch !important; gap: 12px; }
  /* 刷新日期 / 浏览次数靠右对齐 */
  .title-meta-col { align-items: flex-end !important; text-align: right !important; }
  /* 去掉内联招商热线小卡片（手机端改由底部悬浮拨打条承担） */
  .hotline-col { display: none !important; }
  .title-col { flex: 1 1 100% !important; padding-right: 0 !important; }
  .qr-col { justify-content: flex-start !important; }

  /* Banner 高度收敛 */
  .banner { height: 150px !important; min-height: 120px; }

  /* 面包屑 */
  .breadcrumb { padding: 10px 14px !important; font-size: 12px; word-break: break-all; }

  /* 容器内边距收敛 */
  .container { padding: 0 14px !important; }

  /* 分类导航横向滚动优化 */
  .cat-inner {
    padding: 0 12px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-inner::-webkit-scrollbar { display: none; }

  /* ====== 发布表单（publish / publish-zone / publish-industry / publish-demand）====== */
  .form-row {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .form-group {
    width: 100% !important;
    min-width: 0 !important;
  }
  .form-label {
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }
  .form-input,
  .form-select,
  .form-textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 10px 12px !important;
  }
  .form-textarea { min-height: 96px !important; }
  .radio-group { flex-wrap: wrap !important; gap: 8px !important; }
  .radio-chip {
    min-height: 40px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .img-upload-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .img-upload-item,
  .img-upload-add {
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
  }
  /* 吸底提交栏 */
  .submit-bar {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    padding: 10px 14px !important;
    border-top: 1px solid #eee !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06) !important;
    z-index: 50 !important;
    margin: 0 -14px !important;
    width: auto !important;
  }
  .submit-bar .btn {
    width: 100% !important;
    min-height: 46px !important;
    font-size: 16px !important;
  }

  /* ====== 会员中心 user-center：侧边栏转顶部横向菜单 ====== */
  .main {
    flex-direction: column !important;
    gap: 14px !important;
    align-items: stretch !important;
  }
  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    order: -1 !important;
  }
  .sidebar-box { width: 100% !important; }
  .sidebar-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 6px !important;
    scrollbar-width: none;
  }
  .sidebar-menu::-webkit-scrollbar { display: none; }
  .sidebar-menu a,
  .sidebar-menu .menu-item {
    white-space: nowrap !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
  }

  /* ====== 详情页 v2 侧栏（.side-col）====== */
  .side-col {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-top: 16px !important;
  }

  /* ====== 画廊 / swiper 图片适配 ====== */
  .swiper { width: 100% !important; overflow: hidden !important; }
  .swiper-slide img,
  .gallery img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    display: block !important;
  }
}

/* ---------- 极小屏微调 ---------- */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .corp-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .park-row-cards { grid-template-columns: repeat(2, 1fr) !important; }
  .spec-item { flex: 0 0 calc(33.333% - 6px) !important; }
  .cat-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* 极小屏进一步收敛价格字号 */
  .prop-side .price-num {
    font-size: 18px !important;
  }
  .prop-title {
    font-size: 15px !important;
  }
  .prop-img {
    height: 150px !important;
  }

  /* 筛选标签进一步紧凑 */
  .filter-tag {
    padding: 7px 12px !important;
    font-size: 12px !important;
    min-height: 34px;
  }
}

/* ====== 工业园区详情页 / 产业园区详情页 手机端调整（2026-07-27） ====== */
@media (max-width: 768px) {

  /* —— 工业园区详情页 pc-zone-detail.html —— */
  body.pg-zone-detail .banner { margin-top: 14px !important; }
  /* banner 园区名称字体按 150px 高度相对应缩小（桌面 52px→手机 22px，收紧字距，长园名不溢出） */
  body.pg-zone-detail .banner .name {
    font-size: 22px !important;
    letter-spacing: 1px !important;
    padding: 0 16px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }
  /* 隐藏内联绿色招商热线大卡（手机端改由底部悬浮拨打条承担，含卡内联系人） */
  body.pg-zone-detail .hotline-card { display: none !important; }
  /* 指标一行三个（仅此页，不影响个人中心等其它 stats-grid） */
  body.pg-zone-detail .stats-grid { grid-template-columns: repeat(3, 1fr) !important; }

  /* —— 产业园区详情页 pc-industry-detail.html —— */
  body.pg-industry-detail .banner { margin-top: 14px !important; }
  /* banner 园区名称字体按 150px 高度相对应缩小（桌面 52px→手机 22px，收紧字距，长园名不溢出） */
  body.pg-industry-detail .banner .name {
    font-size: 22px !important;
    letter-spacing: 1px !important;
    padding: 0 16px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }
  /* 画廊多图横向滑动 → 只显示第一张满宽大图，其余隐藏，箭头隐藏 */
  body.pg-industry-detail .gallery-track { display: block !important; overflow: visible !important; }
  body.pg-industry-detail .gallery-card { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9 !important; }
  body.pg-industry-detail .gallery-card:not(:first-child) { display: none !important; }
  body.pg-industry-detail .gal-arrow { display: none !important; }
  /* 隐藏内联招商热线块（改由底部悬浮拨打条承担，含联系人） */
  body.pg-industry-detail .info-phone { display: none !important; }
  /* 指标一行三个 */
  body.pg-industry-detail .info-left { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  body.pg-industry-detail .info-item { min-width: 0 !important; padding: 8px 6px !important; }
}
