/* ==========================================================================
   Taimei 申请试用 (Request a Trial) — 响应式适配（仅 trial.html 引入）
   设计稿基准 1440px；≤979px 的规则不影响 PC 端渲染，
   980–1439px 仅修正顶部出血层（见下）。
   导航汉堡菜单由共享 common/css/header.css 负责，此处只处理页面内容与页脚。
   ========================================================================== */

/* ==========================================================================
   980px–1439px：窄屏 PC
   此时 .page(1440px) 宽于视口，CSS 会把 margin:auto 解析为 0（不产生负边距），
   .page 左边缘在 0 而非居中，style.css 里为居中场景准备的
   left:50% + translateX(-50%) 无法被抵消，会把 .tr-decor 整体右移、顶部左侧露出白边。
   这里把出血层直接钉在左边缘即可铺满视口。
   ========================================================================== */

@media (min-width: 980px) and (max-width: 1439px) {
  .tr-decor {
    left: 0;
    transform: none;
  }
}

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

  .page {
    width: 100%;
  }

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

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

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

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

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

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

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

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

  .tr-subtitle {
    font-size: clamp(20px, 5.5vw, 26px);
    line-height: 1.4;
  }

  /* ---------- 表单：双列改单列 ---------- */

  .tr-form {
    width: auto;
    margin-top: 24px;
  }

  .tr-row {
    flex-direction: column;
    gap: 20px;
  }

  .tr-field--name,
  .tr-field--phone,
  .tr-field--position,
  .tr-field--captcha,
  .tr-field--company {
    width: 100%;
  }

  .tr-row--last {
    margin-top: 20px;
  }

  .tr-field--company {
    margin-top: 20px;
  }

  .tr-label {
    font-size: 16px;
    line-height: 26px;
  }

  .tr-input {
    height: 52px;
    font-size: 16px;
  }

  .tr-input--captcha {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .tr-captcha__img {
    flex: 0 0 120px;
  }

  .tr-agree {
    margin-top: 24px;
    height: auto;
    min-height: 30px;
  }

  .tr-agree__text {
    font-size: 16px;
    line-height: 26px;
  }

  .tr-submit {
    margin-top: 40px;
  }

  /* ---------- 页脚（复用 contact 页已验证方案，共享 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;
  }
}
