/* ===========================================================================
 * 页头右上角「动作区」布局（source file · 不在 header.css 的生成范围内）
 * ---------------------------------------------------------------------------
 * 这个文件存在的原因：
 *   header.css 由 build-header-css.py 生成，任何手写追加都会在下次构建时丢掉。
 *   页头动作区的规则因此单独成文件，由 shell.php 单独入队，
 *   并依赖 'gpuloom-fu-header'（保证排在 header.css 之后）。
 *
 * 2026-11-24 结构（桌面端）：
 *
 *   [微信] [WhatsApp] [Telegram] [Email]  │  [🌐 English ▾]
 *   Products  Support  About  News                      [Contact Sales]
 *
 *   · 四个联系渠道排在左侧，竖线之后是语言（工具）。
 *   · 主 CTA 在第二行右侧，宽度与语言胶囊完全相同（--gd-col-w），
 *     右边缘对齐 —— 上下两者形成一条竖直的控制列。
 *
 * 移动端结构完全不变：CTA 仍在折叠菜单里（.gd-global-nav-cta）。
 * ========================================================================== */

.gd-head-social { display: none; }

@media (min-width: 1024px) {
  /* 语言胶囊与导航条 CTA 共用一个宽度，右对齐后自然成列 */
  .gd-global-header { --gd-col-w: 128px; }

  .gd-global-actions { gap: 10px; }

  /* 1 · 微信 / WhatsApp（由插件输出，默认在 DOM 最前） */
  html .gpuloom-contact-head {
    order: 1;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  /* 2 · Telegram / Email，竖线收在这一组右边 */
  .gd-head-social {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid #e3e9ee;
  }
  .gd-head-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #cfdbe6;
    border-radius: 50%;
    background: #fff;
    transition: background-color .16s ease, border-color .16s ease;
  }
  .gd-head-social a:hover { background: #f2f8fb; border-color: #9fc3dc; }
  .gd-head-social svg { width: 19px; height: 19px; }
  .gd-head-social .gd-tg { color: #229ed9; }
  .gd-head-social .gd-tg svg { fill: currentColor; }
  .gd-head-social .gd-mail { color: #0e6f60; }
  .gd-head-social .gd-mail svg {
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
  }

  /* 3 · 语言：固定在右侧，宽度与下方 CTA 对齐 */
  .gd-global-header .gd-global-actions > .gd-language {
    order: 3;
    width: var(--gd-col-w) !important;
    min-width: var(--gd-col-w) !important;
    height: 38px !important;
  }
  .gd-global-header .gd-global-actions > .gd-language .gpll-lang,
  .gd-global-header .gd-global-actions > .gd-language .gpll-dd { width: 100%; }
  .gd-global-header .gd-global-actions > .gd-language .gpll-dd__btn {
    width: 100% !important;
    justify-content: center;
  }

  /* 联系球与其它控件同高（38px） */
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwa,
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwc {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwa svg,
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwc svg {
    width: 19px !important;
    height: 19px !important;
  }

  /* 主 CTA：宽度 = 语言胶囊，右边缘对齐成列 */
  .gd-global-nav .gd-global-nav-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--gd-col-w);
    min-width: var(--gd-col-w);
    height: 38px;
    margin-left: auto;
    padding: 0 !important;
    border: 1px solid var(--gd-blue) !important;
    border-radius: 999px !important;
    background: var(--gd-blue) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: -.005em;
    white-space: nowrap;
  }
  .gd-global-nav .gd-global-nav-cta:hover {
    background: #0063b4 !important;
    border-color: #0063b4 !important;
  }
}

/* 1024–1199：动作区收紧，给搜索框留足宽度 */
@media (min-width: 1024px) and (max-width: 1199px) {
  .gd-global-header { --gd-col-w: 118px; }
  .gd-global-header__main { gap: 18px; }
  .gd-global-actions { gap: 8px; }
  .gd-head-social { gap: 8px; padding-right: 10px; }
  .gd-head-social a { width: 34px; height: 34px; }
  .gd-head-social svg { width: 17px; height: 17px; }
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwa,
  html.gpuloom-contacts-moved .gpuloom-contact-head .gpwc {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }
}
