/*!
 * qds-responsive.css — 移动端 / 窄屏适配层
 *
 * 原站 PC 样式（qds-home-20260630.css 与 about.html、contact.html 内联 style）保持原样不动，
 * 这里只在窄屏下追加规则，桌面端视觉效果完全不受影响。
 *
 * 主要解决：
 *   1. 顶部导航 < 900px 折叠为汉堡菜单（原站在窄屏会强制跳转 H5 站，已取消跳转）
 *   2. 页脚 1200px 固定宽在窄屏改为自适应多行
 *   3. 首页检索卡片、快捷入口在窄屏不再被裁切
 */

/* ================= 汉堡按钮（默认不显示） ================= */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #101318;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-burger--open .nav-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger--open .nav-burger__bar:nth-child(2) { opacity: 0; }
.nav-burger--open .nav-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================= 抽屉菜单（默认不显示） ================= */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
}
.nav-drawer--open { display: block; }
.nav-drawer__mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, .45);
}
.nav-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(80vw, 320px);
  height: 100%;
  padding: 88px 20px 28px;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, .16);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: navDrawerIn .22s ease;
}
@keyframes navDrawerIn { from { transform: translateX(100%) } to { transform: translateX(0) } }
.nav-drawer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #101318;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.nav-drawer__close:hover { background: #f4f5f7; }
.nav-drawer__link {
  display: block;
  padding: 15px 2px;
  border-bottom: 1px solid #f0f1f3;
  color: #101318;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.nav-drawer__link:last-child { border-bottom: 0; }
.nav-drawer__link:active { color: #ff7200; }
body.nav-drawer-open { overflow: hidden; }

/* ================= 导航折叠 ================= */
@media (max-width: 900px) {
  .site-nav__inner {
    position: relative;
    grid-template-columns: auto 1fr !important;
    column-gap: 12px;
    padding-left: 16px !important;
    padding-right: 56px !important;
  }
  .site-nav__menu { display: none !important; }
  /* 绝对定位，避免被 .site-nav__inner 的 grid 推到第二行 */
  .nav-burger {
    display: inline-flex;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
  .site-nav__logo img { max-width: 132px; }
}


/* ================= 全球商标数据卡片（首页） ================= */
@media (max-width: 900px) {
  /* 单列纵向堆叠：覆盖桌面 2x2 固定网格(280px 列/150px 行/576x316)，否则展开的列表会溢出叠压 */
  .home-coverage-regions,
  .home-coverage-regions:has(.home-coverage-region:is(:hover,:focus-within)),
  .home-coverage-regions:has(.home-coverage-region:nth-child(1):is(:hover,:focus-within)),
  .home-coverage-regions:has(.home-coverage-region:nth-child(2):is(:hover,:focus-within)),
  .home-coverage-regions:has(.home-coverage-region:nth-child(3):is(:hover,:focus-within)),
  .home-coverage-regions:has(.home-coverage-region:nth-child(4):is(:hover,:focus-within)) {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    width: 100% !important;
    height: auto !important;
    gap: 12px !important;
  }
  /* 原站卡片靠 hover 展开，触屏没有 hover，直接展开国家标签更实用 */
  .home-coverage-region {
    min-height: 0 !important;
    padding: 20px 18px !important;
    overflow: visible !important;
    /* container-type:size 会让网格自动行高按 0 计算，关闭后卡片才能按内容增高 */
    container-type: normal !important;
  }
  .home-coverage-preview {
    max-height: none !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: visible !important;
  }
  .home-coverage-list {
    opacity: 1 !important;
    transform: none !important;
    margin-top: 12px !important;
    overflow: visible !important;
    max-height: none !important;
  }
}

/* 触屏设备：卡片默认就是展开态 */
@media (hover: none) and (max-width: 900px) {
  .home-coverage-preview { display: none !important; }
  .home-coverage-region h3 { overflow: visible !important; }
}

/* ================= 装饰元素 / 弹窗兜底 ================= */
@media (max-width: 900px) {
  .cta { overflow: hidden; }
  .contact-modal { width: 100% !important; padding-left: 16px !important; padding-right: 16px !important; }
  .contact-modal-panel { width: 100% !important; max-width: 360px; }
}

/* ================= 首页首屏标题 ================= */
@media (max-width: 900px) {
  /* 原站在 #hero 内给 .hero-h1 加了 white-space:nowrap，窄屏会把标题顶出屏幕 */
  #hero .hero-h1 {
    white-space: normal !important;
    font-size: 32px !important;
    letter-spacing: 0 !important;
    max-width: 100%;
    word-break: break-word;
  }
}
@media (max-width: 480px) {
  #hero .hero-h1 { font-size: 27px !important; }
  #hero .hero-sub { font-size: 14px !important; }
}

/* ================= 首页检索卡片 ================= */
@media (max-width: 760px) {
  .search-wrap {
    flex-wrap: wrap;
    align-items: center;
    height: auto !important;
    padding: 7px 7px 7px 14px !important;
    row-gap: 8px;
  }
  .search-wrap .search-input,
  .search-wrap input[type="text"] { flex: 1 1 120px; min-width: 0; }
  #hero .search-in {
    height: 40px;
    line-height: 40px;
    font-size: 15px;
  }
  .search-btn,
  #hero .search-btn {
    flex: 0 0 auto;
    width: 76px;
    min-width: 76px;
    height: 38px;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    font-size: 14px;
  }
  .card-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .dock-entry { min-width: 0; }
  .hero-in { padding-left: 0; padding-right: 0; }
  .hero-copy, .hero-visual, .hero-stats, .hero-card { width: 100%; min-width: 0; }
}

/* ================= 窄屏通用 ================= */
@media (max-width: 900px) {
  /* 原站只给 body 加了 overflow-x:hidden，html 仍可能被装饰元素（伪元素）撑出横向滚动 */
  html, body { overflow-x: hidden !important; }
}

@media (max-width: 760px) {
  .wrap { padding-left: 16px !important; padding-right: 16px !important; }
  #cta, .cta, .cta-box { overflow: hidden; }
  .home-coverage-board { overflow-x: auto; }
}
