/* 语言开关：常驻页面右上，不遮挡头像与搜索框。 */
.lang-switch-host {
  /* 原来占顶栏下方独立一行，会白白吃掉 40px 首屏高度。
     现在收纳成标题行右侧的浮层小胶囊：绝对定位、不参与文档流，
     视觉上仍在右上角，但不挤占任何版面。 */
  /* 参考图标题行只有「菜单 / 居中标题 / 一个图标」，没有第三个控件。
     375 宽下语言开关要占 108px，塞进标题行必然压住标题。
     所以它挪进抽屉底部（见 .h5-drawer-lang），这里只在没有抽屉的场景兜底。 */
  position: absolute;
  top: 50%;
  right: 48px;
  transform: translateY(-50%);
  display: none;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  pointer-events: none;
  z-index: 1;
}

/* 抽屉里的语言开关：整行铺开，三个语言并排等宽 */
.h5-drawer-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid #eceef2;
}
.h5-drawer-lang .lang-switch {
  box-shadow: none;
  width: 100%;
  justify-content: space-between;
}
.h5-drawer-lang .lang-btn {
  flex: 1;
  text-align: center;
}
}

.lang-switch {
  pointer-events: auto;
  display: inline-flex;
  gap: 1px;
  padding: 2px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6e9ef;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: #111827;
  background: #f1f3f6;
}

.lang-btn.active {
  background: #04b488;
  color: #fff;
  font-weight: 600;
}

.dark .lang-switch {
  background: #1c232e;
  border-color: #293240;
  box-shadow: none;
}

.dark .lang-btn {
  color: #9aa4b2;
}

.dark .lang-btn:hover {
  color: #fff;
  background: #242d3a;
}

.dark .lang-btn.active {
  background: #04b488;
  color: #fff;
}

/* 印地语字形较高，行高略放宽避免切字。 */
html[lang="hi-IN"] body {
  line-height: 1.55;
}

@container groww-app (max-width: 900px){
  .lang-switch-host {
    /* 定位以标题行为参照（.h5-head 是 position:relative），这里不需要改。 */
    position: absolute;
  }
  .lang-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
}

/* 业务页仍是宽屏桌面布局，开关回到贴页面右边缘 */
body.biz-mode .lang-switch-host {
  position: fixed;
  top: 76px;
  right: 24px;
  padding: 0;
}
