@charset "utf-8";
/* ==========================================================================
   lang-switch.css · 语言切换器组件（中英双语共用，中英文页都要加载）
   --------------------------------------------------------------------------
   形态：国旗 + 语言名，两行竖排，右侧一条细分隔线。
   位置：桌面端贴在两行电话号码的正右边，垂直居中于电话块。

   实现：桌面把 .had 改成 flex —— logo 靠左，电话块 margin-left:auto 靠右，
   切换器紧随其后成为右端最后一个元素。这样切换器与电话号码在同一个
   水平带上，间距由布局保证，不依赖任何像素硬编码；窗口宽度变化时
   也不会错位（absolute + 固定 right 值在 1200 容器下会随缩放漂移）。

   ≤1199px 电话块被 fidelity.css 隐藏（display:none），父容器不渲染，
   里面的东西一律不可见，所以切换器必须留在 .hot 外面，这里退回
   绝对定位贴在右上角，落在菜单圆钮上方那条空白里。

   国旗用内联 SVG：Windows 版 Chrome 不渲染 emoji 国旗，
   用 🇬🇧/🇨🇳 会退化成 "GB" 两个字母。见 blocks.py 的 FLAG_CN / FLAG_GB。
   ========================================================================== */

/* ------------------------------------------------------------ 切换器本体 */
.lang-switch {
  display: flex;
  flex-direction: column;
  /* 左对齐：两行国旗才能落在同一竖列上 */
  align-items: flex-start;
  gap: 8px;
  z-index: 10003;
  line-height: 1;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 27px;
  padding: 0;
  color: #7d858f;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.lang-option:hover,
.lang-option:focus-visible {
  color: #084499;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.lang-option.is-current {
  color: #084499;
  font-weight: 700;
  cursor: default;
}
.lang-option.is-current:hover {
  text-decoration: none;
}

.lang-flag {
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 19px;
  border-radius: 1px;
  /* 浅色底上白边旗容易糊，加一圈极淡描边 */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------- 桌面：切换器落在电话块右侧 */
@media (min-width: 1200px) {
  /* 头部容器原来是 1200px 居中，右边离视口边缘还有 120px 空白。
     这里把右边界放宽到「视口右边 - 24px」，左边界仍与导航条对齐，
     于是电话块 + 切换器整组贴着页面右边框。
     注意：flex 的 auto margin 会吃掉所有剩余空间，负 margin 推不出去，
     只能改容器本身的宽度。 */
  .had {
    width: auto;
    margin-left: max(0px, calc((100% - 1200px) / 2));
    margin-right: 24px;
    display: flex;
    align-items: center;
    overflow: visible;
  }
  .logo {
    float: none;
    flex: 0 0 auto;
    margin: 0;
  }
  /* margin-left:auto 把电话块连同切换器一起推到容器最右 */
  .hot.header-phone-preview {
    float: none;
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    height: 76px;
  }
  .lang-switch {
    position: relative;
    flex: 0 0 auto;
    align-self: center;
    margin-left: 22px;
    padding-left: 22px;
  }
  /* 细分隔线：上下各留 2px，整体 58px 高，不顶到边界 */
  .lang-switch::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: #dddddd;
  }
}

/* ≤1199px：退回单行贴右上角，落在汉堡按钮上方那条空白里 */
@media (max-width: 1199px) {
  .lang-switch {
    position: absolute;
    top: 2px;
    right: 10px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .lang-option {
    height: auto;
    gap: 4px;
    font-size: 13px;
  }
  .lang-flag {
    flex-basis: 18px;
    width: 18px;
    height: 12px;
  }
}
@media (max-width: 520px) {
  .lang-option {
    font-size: 12px;
  }
  .lang-flag {
    flex-basis: 16px;
    width: 16px;
    height: 11px;
  }
}
