/* ============================================================
   SX language bar + IP language suggestion dialog
   Loaded on every page (static package and dynamic site).
   ============================================================ */

/* ---------- Desktop: language bar always shares the nav row ---------- */
@media (min-width: 923px) {
  .main-header-menu { flex-wrap: nowrap !important; }
  .sx-lang-host-li,
  .sx-lang-item {
    flex: 0 0 auto !important;
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
    display: flex !important;
    align-items: center;
    list-style: none;
  }
  .sx-lang-sw.sx-in-head {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 2px 4px;
    white-space: nowrap !important;
    overflow: visible !important;
    max-width: none !important;
  }
  .sx-lang-sw.sx-in-head ul { flex-wrap: nowrap !important; gap: 0; }
  .sx-lang-sw.sx-in-head li a { padding: 3px 4px; }
  .sx-lang-sw.sx-in-head .sx-lang-code { font-size: 10px; }
}
/* Narrow desktops: compact the menu so 8 codes still fit in one line */
@media (min-width: 923px) and (max-width: 1200px) {
  .main-header-menu > li > a { padding-inline: 8px !important; font-size: 13px; }
  .sx-lang-sw.sx-in-head li a { padding: 3px 3px; }
  .sx-lang-sw.sx-in-head .sx-lang-code { font-size: 9px; letter-spacing: 0; }
}

/* ---------- Mobile / tablet: fixed bar pinned to the TOP of the screen ---------- */
@media (max-width: 922px) {
  /* 动态站的主题内联 <style> 排在本文件之后，故关键属性一律 !important */
  .sx-lang-sw:not(.sx-in-head) {
    position: fixed !important;
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    inset-inline-end: auto !important;
    width: 100% !important;
    max-width: none !important;
    border: 0 !important;
    border-bottom: 1px solid #dde6ef !important;
    border-radius: 0 !important;
    padding: 5px 8px !important;
    display: flex !important;
    justify-content: center !important;
    overflow-x: auto !important;
    box-shadow: 0 2px 10px rgba(6, 24, 44, .12) !important;
  }
  .sx-lang-sw:not(.sx-in-head) ul { flex-wrap: nowrap; justify-content: center; gap: 1px; }
  .sx-lang-sw:not(.sx-in-head) li a { padding: 4px 6px; }
  .sx-lang-sw:not(.sx-in-head) .sx-lang-code { font-size: 11px; }
  /* Reserve room so the fixed bar never covers the header / hero */
  body.sx-lang-topbar { padding-top: 36px !important; }
}

/* ---------- IP language suggestion dialog ---------- */
.sx-geo-mask {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(6, 24, 44, .48);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; box-sizing: border-box;
}
.sx-geo-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 440px;
  padding: 24px 26px 20px; box-shadow: 0 24px 60px rgba(6, 24, 44, .3);
  font-family: inherit; line-height: 1.55;
}
.sx-geo-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #1e88e5; margin: 0 0 8px; }
.sx-geo-title { font-size: 20px; font-weight: 700; color: #0b2e4f; margin: 0 0 8px; }
.sx-geo-text { font-size: 14px; color: #5c6c7c; margin: 0 0 18px; }
.sx-geo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.sx-geo-btn {
  flex: 1 1 150px; border: 1px solid #1e88e5; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #1e88e5; color: #fff; text-align: center;
}
.sx-geo-btn:hover { background: #1469b8; border-color: #1469b8; }
.sx-geo-btn.sx-geo-ghost { background: #fff; color: #28425c; border-color: #dde6ef; }
.sx-geo-btn.sx-geo-ghost:hover { background: #f4f8fc; }
.sx-geo-all { border-top: 1px solid #eef2f6; padding-top: 14px; }
.sx-geo-all-label { font-size: 12px; color: #8a9aa8; margin: 0 0 8px; }
.sx-geo-links { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-geo-links a {
  display: inline-block; padding: 5px 10px; border: 1px solid #dde6ef; border-radius: 999px;
  font-size: 12.5px; color: #28425c; text-decoration: none; background: #fafcfd;
}
.sx-geo-links a:hover { border-color: #1e88e5; color: #1e88e5; }
.sx-geo-links a.sx-geo-current { background: #0b2e4f; border-color: #0b2e4f; color: #fff; }
.sx-geo-close {
  position: absolute; margin: -12px 0 0 0; border: 0; background: none;
  font-size: 22px; line-height: 1; color: #8a9aa8; cursor: pointer;
  inset-inline-end: 34px;
}
.sx-geo-box { position: relative; }
.sx-geo-close:hover { color: #0b2e4f; }
@media (max-width: 480px) {
  .sx-geo-box { padding: 20px 18px 16px; }
  .sx-geo-title { font-size: 18px; }
  .sx-geo-close { inset-inline-end: 26px; }
}
