﻿/* ===== 移动端全屏导航 + 底部悬浮栏（不影响 PC） ===== */
.mob-tabbar {
  display: none;
}

@media (max-width: 992px) {
  :root {
    --mob-nav-bg: #353a4d;
  }

  body.has-mob-tabbar {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  body.nav-open {
    overflow: hidden;
    overflow-x: hidden;
    max-width: 100vw;
  }

  body.nav-open .mob-tabbar {
    display: none;
  }

  /* 展开导航时顶栏 LOGO 区域白底 */
  body.nav-open .site-hd {
    background: #fff !important;
    border-bottom-color: rgba(0, 0, 0, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.has-index-mob-banner.nav-open .site-hd,
  body.has-index-mob-banner.nav-open .site-hd .hd-inner {
    background: #fff !important;
  }

  body.has-index-mob-banner.nav-open .site-hd .logo-img,
  body.has-index-mob-banner.nav-open .site-hd:not(.scrolled) .logo-img {
    filter: none !important;
  }

  body.has-index-mob-banner.nav-open .site-hd .menu-btn span {
    background: #353a4d !important;
  }

  body.nav-open .site-hd .hd-inner {
    background: #fff;
  }

  body.nav-open .site-hd .logo-img {
    filter: none !important;
  }

  body.nav-open .site-hd:not(.scrolled) .logo-img {
    filter: none !important;
  }

  body.nav-open .site-hd .menu-btn span {
    background: #353a4d;
  }

  .nav-overlay.active {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
  }

  .site-nav.open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    height: calc(100vh - 70px);
    height: calc(100dvh - 70px);
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px);
    background: var(--mob-nav-bg) !important;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    overflow-x: hidden;
    box-sizing: border-box;
    z-index: 998;
  }

  .site-hd:not(.scrolled) .site-nav.open ul.nav-ul > li > a,
  .site-hd:not(.scrolled) .site-nav.open ul.nav-ul > li.on > a,
  .site-hd:not(.scrolled) .site-nav.open .nav-drop li a {
    color: #fff !important;
  }

  .site-hd:not(.scrolled) .site-nav.open .nav-drop li a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }

  .site-nav.open .nav-ul {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 4px 0 0;
    margin: 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav.open .nav-ul > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    min-width: 0;
    max-width: 100%;
  }

  .site-nav.open .nav-ul > li > a {
    display: block;
    padding: 16px 22px;
    font-size: 18px;
    font-weight: 500;
    color: #fff !important;
    border-radius: 0;
    background: transparent;
  }

  .site-nav.open .nav-ul > li > a::after {
    display: none !important;
  }

  .site-nav.open .nav-ul > li.on > a,
  .site-nav.open .nav-ul > li > a:active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
  }

  /* 服务项目子项提升为一级导航（不用 display:contents，兼容百度/UC 等 WebView） */
  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) {
    display: block;
    position: static;
    border-bottom: 0;
    padding: 0;
    margin: 0;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop)::after {
    display: none !important;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) > a {
    display: none !important;
  }

  /* 小程序开发：移动端由「服务项目」子项展示入口，专题走折叠面板 */
  .site-nav.open .has-miniapp-drop,
  .site-nav.open .has-drop > a[href*="hefei-miniapp.html"] {
    display: none !important;
  }

  .site-nav.open .has-miniapp-drop .nav-drop,
  .site-nav.open .has-drop > a[href*="hefei-miniapp.html"] + .nav-drop {
    display: none !important;
  }

  /* 网站建设专题：移动端隐藏桌面下拉，走折叠面板 */
  .site-nav.open .has-website-drop,
  .site-nav.open .has-drop > a[href*="hefei-website.html"] {
    display: none !important;
  }

  .site-nav.open .has-website-drop .nav-drop,
  .site-nav.open .has-drop > a[href*="hefei-website.html"] + .nav-drop {
    display: none !important;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    pointer-events: all !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    white-space: normal !important;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    list-style: none;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a {
    display: block !important;
    padding: 16px 22px !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    color: #fff !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a:hover,
  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a:active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }

  .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a::after {
    display: none !important;
  }

  /* 覆盖各页面 CSS 残留的旧版展开菜单（服务项目米色底、深色字等） */
  .site-hd:not(.scrolled) .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop,
  .site-hd.scrolled .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .site-hd:not(.scrolled) .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a,
  .site-hd.scrolled .site-nav.open .has-drop:not(.has-miniapp-drop):not(.has-website-drop) .nav-drop li a {
    color: #fff !important;
    background: transparent !important;
  }

  /* 小程序开发专题折叠面板（仅移动端） */
  .nav-mob-topic-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-mob-topic-panel {
    display: none;
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
  }

  .nav-mob-topic-group.is-open .nav-mob-topic-panel {
    display: block;
  }

  .nav-mob-topic-overview {
    display: block;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
  }

  .nav-mob-topic-overview:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-mob-topic-divider {
    height: 1px;
    margin: 0 22px;
    background: rgba(255, 255, 255, 0.1);
  }

  .nav-mob-topic-subtitle {
    margin: 0;
    padding: 12px 22px 6px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.4px;
  }

  .nav-mob-topic-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 22px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
    touch-action: manipulation;
  }

  .nav-mob-topic-toggle:active,
  .nav-mob-topic-group.is-open .nav-mob-topic-toggle {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-mob-topic-arrow {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid rgba(255, 255, 255, 0.75);
    border-bottom: 2px solid rgba(255, 255, 255, 0.75);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .nav-mob-topic-group.is-open .nav-mob-topic-arrow {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  /* 覆盖 site-common 的 .site-nav ul{display:flex}，专题列表必须纵向排列 */
  .site-nav.open ul.nav-mob-topic-list {
    display: block !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 0 4px !important;
    list-style: none !important;
    overflow: hidden;
  }

  .site-nav.open .nav-mob-topic-group:not(.is-open) ul.nav-mob-topic-list {
    display: none !important;
  }

  .site-nav.open .nav-mob-topic-list li {
    display: block !important;
    width: 100% !important;
    float: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    list-style: none !important;
  }

  .site-nav.open .nav-mob-topic-list li a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 12px 22px 12px 28px !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.92) !important;
    text-decoration: none;
    white-space: normal !important;
    word-break: break-all;
    writing-mode: horizontal-tb !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .site-nav.open .nav-mob-topic-list li a::after {
    display: none !important;
  }

  .site-nav.open .nav-mob-topic-list li a:active,
  .site-nav.open .nav-mob-topic-list li.on a {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }

  .site-nav.open .nav-mob-topic-list .nav-drop-dot {
    color: rgba(255, 255, 255, 0.55);
    margin-right: 4px;
  }

  /* 底部电话咨询 / 座机热线（固定在导航面板底部，菜单列表单独滚动） */
  .nav-mob-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: var(--mob-nav-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
  }

  .nav-mob-tel-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 8px;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    color: var(--dark, #1a1a1a);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(24, 77, 196, 0.15);
    touch-action: manipulation;
  }

  .nav-mob-tel-card:active {
    transform: scale(0.98);
    background: #f8f9fc;
  }

  .nav-mob-tel-ico {
    width: 22px;
    height: 22px;
    color: var(--blue, #184dc4);
    flex-shrink: 0;
  }

  .nav-mob-tel-ico svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .nav-mob-tel-lbl {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-mob-tel-num {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 12px;
    font-weight: 700;
    color: var(--dark, #1a1a1a);
    line-height: 1.3;
    word-break: break-all;
    overflow-wrap: anywhere;
    hyphens: auto;
    letter-spacing: -0.4px;
  }

  @media (max-width: 360px) {
    .nav-mob-contact {
      gap: 6px;
      padding: 10px 8px calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .nav-mob-tel-card {
      padding: 8px 6px;
      border-radius: 8px;
    }
    .nav-mob-tel-ico {
      width: 20px;
      height: 20px;
    }
    .nav-mob-tel-lbl {
      font-size: 10px;
    }
    .nav-mob-tel-num {
      font-size: 11px;
      letter-spacing: -0.5px;
    }
  }

  /* 底部悬浮导航 */
  .mob-tabbar {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 997;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mob-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 3px 11px;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    transition: color 0.2s;
    min-width: 0;
  }

  .mob-tabbar-item:active,
  .mob-tabbar-item.is-active {
    color: var(--blue, #184dc4);
  }

  .mob-tabbar-ico {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mob-tabbar-ico svg {
    width: 26px;
    height: 26px;
    display: block;
  }

  .mob-tabbar-lbl {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  @media (max-width: 360px) {
    .mob-tabbar-item {
      font-size: 11px;
      gap: 4px;
      padding: 8px 2px 10px;
    }
    .mob-tabbar-ico {
      width: 26px;
      height: 26px;
    }
    .mob-tabbar-ico svg {
      width: 24px;
      height: 24px;
    }
  }

  /* 有底部栏时隐藏右侧悬浮按钮，避免遮挡 */
  body.has-mob-tabbar .side-float {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    top: auto;
    transform: none;
    animation: none;
  }
}

@media (min-width: 993px) {
  .nav-mob-contact,
  .mob-tabbar,
  .nav-mob-topic-group {
    display: none !important;
  }
}

/* ===== 页脚移动端适配（全站，由 foot.html 引入） ===== */
@media (max-width: 992px) {
  .ft-top {
    flex-direction: column;
    align-items: stretch;
    padding: 28px 18px 22px;
    gap: 18px;
  }

  .ft-brand {
    text-align: center;
  }

  .ft-brand h4 {
    font-size: 16px;
    line-height: 1.4;
  }

  .ft-brand p {
    font-size: 12px;
    margin-top: 6px;
  }

  .ft-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 4px;
    width: 100%;
  }

  .ft-nav a {
    padding: 9px 4px;
    font-size: 12px;
    text-align: center;
    line-height: 1.35;
    border-radius: 6px;
  }

  .ft-main {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 4px 18px 28px !important;
  }

  .ft-main > div {
    padding: 22px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .ft-main > div:last-child {
    border-bottom: none;
    padding-bottom: 4px;
  }

  .ft-col-t {
    font-size:16px !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
  }

  .ft-tel {
    font-size: 20px !important;
    letter-spacing: 0 !important;
    margin-bottom: 10px !important;
    word-break: break-all;
  }

  .ft-addr,
  .ft-links a,
  .ft-qr-txt {
    font-size: 13px !important;
    line-height: 1.75 !important;
  }

  .ft-addr {
    word-break: break-word;
  }

  .ft-links {
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  .ft-links a {
    word-break: normal !important;
  }

  .ft-qr {
    gap: 16px !important;
    margin-top: 16px !important;
  }

  .ft-qr img {
    width: 76px !important;
    height: 76px !important;
    flex-shrink: 0;
  }

  .ft-badges {
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .ft-badges span {
    font-size: 12px !important;
    padding: 5px 11px !important;
  }

  .ft-col-desc {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.7 !important;
  }

  .ft-btm {
    padding: 18px 18px 22px !important;
    font-size: 11px;
    line-height: 1.85;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .ft-btm a {
    font-size: 11px;
    margin: 0 3px;
    word-break: break-all;
  }
}

@media (max-width: 992px) and (min-width: 769px) {
  .ft-main {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 20px !important;
    padding: 28px 24px 36px !important;
  }

  .ft-main > div {
    padding: 0;
    border-bottom: none;
  }

  .ft-main > div:first-child {
    grid-column: 1 / -1;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 4px;
  }
}
