/* 语言切换器样式（自定义下拉框） */
.lang-switcher {
  position: relative;
  z-index: 30;
  display: inline-flex;
  align-items: center;
}

/* 触发按钮 */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background-color: transparent;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lang-btn:hover {
  border-color: rgba(255, 255, 255, 0.9);
}

.lang-btn:focus,
.lang-btn:focus-visible {
  outline: none;
}

.lang-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s ease;
}

.lang-current {
  white-space: nowrap;
}

/* 下拉箭头 */
.lang-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
  transition: transform 0.2s ease, border-top-color 0.3s ease;
}

/* 下拉菜单 */
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 120px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 70, 160, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.lang-switcher.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher.open .lang-caret {
  transform: rotate(180deg);
}

/* 菜单项 */
.lang-option {
  padding: 8px 12px;
  border-radius: 8px;
  color: #141414;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* 悬停项：灰底 + 黑色文字 */
.lang-option:hover {
  background: #cccccc;
  color: #141414;
}

/* 选中项：纯白文字 100% */
.lang-option.active {
  background: #fff;
  color: #141414;
  font-weight: 600;
}

/* header 固定后（滚动变白底）配色适配 */
.site-header.is-fixed .lang-icon {
  color: rgba(20, 20, 20, 0.85);
}

.site-header.is-fixed .lang-btn {
  border-color: rgba(20, 20, 20, 0.25);
  color: #141414;
}

.site-header.is-fixed .lang-btn:hover {
  border-color: rgba(20, 20, 20, 0.6);
}

.site-header.is-fixed .lang-caret {
  border-top-color: #141414;
}

@media (max-width: 720px) {
  .lang-icon svg {
    width: 16px;
    height: 16px;
  }

  .lang-btn {
    padding: 6px 12px;
    font-size: 14px;
  }
}
