/* ==========================================================================
   Taimei Contact Us (联系我们) — 响应式适配（仅 contact.html 引入）
   设计稿基准 1440px；所有规则都包在 ≤979px 媒体查询内，
   PC 端（≥980px，含 980–1439 的既有装饰层修正）一条都不命中，渲染保持不变。
   导航汉堡菜单由共享 common/css/header.css 负责，此处只处理页面内容与页脚。
   ========================================================================== */

@media (max-width: 979px) {
  /* ---------- 页面容器 ---------- */

  .page {
    width: 100%;
  }

  /* ---------- Hero ---------- */

  .ct-hero {
    height: auto;
    padding: 104px 0 48px;
  }

  /* 100vw 出血层改为跟随页面宽度，避免滚动条宽度导致的偏移 */
  .ct-decor {
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
  }

  /* 背景层基础样式写死 800px 高，移动端 hero 变矮后径向渐变中心会落到视口外，
     改为跟随 hero 高度，让白色光晕重新落在底部中央（设计稿的关键视觉） */
  .ct-bg {
    height: 100%;
  }

  /* 三个光晕按 800px 画布坐标定位，hero 变矮后已全部错位到视口外，隐藏 */
  .ct-glow--1,
  .ct-glow--2,
  .ct-glow--3 {
    display: none;
  }

  /* 注意：必须用 relative + z-index，不能退回 static。
     .ct-decor 是绝对定位层（z-index auto），按绘制顺序位于 static 文本之上，
     会把白色标题完全盖住。基础样式带 top，relative 下会真的生效，需一并复位。 */
  .ct-hero__title {
    position: relative;
    top: auto;
    left: auto;
    z-index: 2;
    font-size: clamp(32px, 9vw, 48px);
    line-height: 1.15;
  }

  /* ---------- 白色圆角面板 ---------- */

  .ct-panel {
    width: auto;
    height: auto;
    margin: -28px 16px 0;
    border-radius: 24px;
    padding: 32px 20px 28px;
  }

  .ct-h2 {
    height: auto;
    font-size: clamp(26px, 7vw, 36px);
    line-height: 1.3;
  }

  .ct-h2--china {
    margin-top: 32px;
  }

  /* ---------- 联系块：绝对坐标改为两列网格 ----------
     邮箱行等整宽占两列，两个二维码各占一列并排 */

  .ct-contact {
    position: static;
    height: auto;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ct-contact > *:not(.ct-qr) {
    grid-column: 1 / -1;
  }

  .ct-label {
    position: static;
    font-size: 15px;
    line-height: 24px;
    color: var(--blue);
  }

  .ct-mail {
    position: static;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(10, 71, 237, 0.05);
  }

  .ct-mail__icon {
    position: static;
    width: 24px;
    height: 24px;
  }

  .ct-mail__addr {
    position: static;
    font-size: 17px;
    line-height: 26px;
    white-space: normal;
  }

  .ct-mail__btn {
    position: static;
    margin-left: auto;
    padding: 8px 18px;
    font-size: 14px;
    line-height: 22px;
  }

  .ct-qr {
    position: static;
    width: 100%;
    height: auto;
  }

  .ct-qr img {
    width: 100%;
    max-width: 130px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  /* 说明文字宽度基础样式按 183/168px 写死，这里等特异性覆盖为自适应 */
  .ct-qr figcaption {
    position: static;
    transform: none;
    width: auto;
    margin-top: 8px;
    font-size: 13px;
    line-height: 20px;
  }

  /* ---------- 办公室卡片 ---------- */

  .ct-grid {
    grid-template-columns: 1fr;
    width: auto;
    margin: 12px 16px 0;
    gap: 12px;
  }

  /* 设计稿是白底无缝平铺；移动端堆叠后需要分隔，故加浅描边与圆角。
     卡片内改用两列网格：图标在左、文字在右，标题独占整行 */
  .ct-card {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 18px;
    border: 1px solid rgba(10, 71, 237, 0.12);
    border-radius: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
  }

  .ct-card__title {
    position: static;
    grid-column: 1 / -1;
    font-size: 16px;
    line-height: 24px;
  }

  .ct-card__icon {
    position: static;
    width: 22px;
    height: 22px;
  }

  .ct-card__contact {
    position: static;
    font-size: 18px;
    line-height: 28px;
    white-space: normal;
  }

  .ct-card__addr {
    position: static;
    width: auto;
    font-size: 14px;
    line-height: 22px;
  }

  /* ---------- 海外办公室 ---------- */

  .ct-abroad {
    padding: 0 16px;
  }

  .ct-abroad__item:first-child {
    margin-top: 48px;
  }

  .ct-abroad__item + .ct-abroad__item {
    margin-top: 40px;
  }

  /* 卡片内容左对齐（父级为居中对齐，仅用于标题） */
  .ct-abroad__item .ct-card {
    margin: 20px 0 0;
    text-align: left;
  }

  /* ---------- 页脚（复用 news 页已验证方案，共享 footer.css 不动） ---------- */

  .page .footer {
    margin-top: 56px;
  }

  .footer {
    height: auto;
    padding: 44px 20px 32px;
  }

  /* 移动端 .footer 自身即为全宽且已铺黑，全屏黑底层不再需要；
     同时它 z-index:0 会盖住改为 static 的内容，必须移除 */
  .footer::before {
    display: none;
  }

  /* 必须带上 .footer__brands 前缀：共享 footer.css 中该选择器特异性更高 */
  .footer__brands .footer__logo,
  .footer__logo {
    position: static;
    width: 124px;
    height: 45px;
  }

  .footer__nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
    margin-top: 28px;
  }

  .footer__nav-col a {
    white-space: normal;
  }

  .footer__nav::before,
  .footer__info::before {
    display: none;
  }

  .footer__info {
    position: static;
    width: auto;
    margin-top: 28px;
  }

  .footer__social {
    position: static;
    margin-top: 16px;
    gap: 24px;
  }

  .footer__qr {
    position: static;
    display: inline-block;
    width: 74px;
    height: 74px;
    margin: 18px 12px 0 0;
  }

  .footer__qr--taimei {
    left: auto;
  }

  .footer__badge {
    position: static;
    display: block;
    margin: 24px auto 0;
  }

  .footer__legal {
    position: static;
    left: auto;
    transform: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 16px;
    margin-top: 24px;
    white-space: normal;
  }

  .footer__legal span,
  .footer__legal a.footer__legal-link {
    white-space: normal;
  }
}

/* ==========================================================================
   600px–979px：平板 — 办公室卡片双列
   ========================================================================== */

@media (min-width: 600px) and (max-width: 979px) {
  .ct-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
