/* ================= 语言切换器样式 ================= */

/* 语言下拉菜单容器 */
.s-nav-lang-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 16px;
}

/* 语言切换按钮样式 - 与导航链接样式保持一致 */
.s-nav-link_zwpweb {
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  padding: 0;
  position: relative;
  padding: 8px 0;
}

/* 按钮悬停效果 - 与导航链接一致 */
.s-nav-link_zwpweb:hover {
  color: #3b82f6;
}

/* 添加底部下划线动画 - 与导航链接一致 */
.s-nav-link_zwpweb::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 4px;
  left: 0;
  background-color: #3b82f6;
  transition: width 0.3s ease;
}

.s-nav-link_zwpweb:hover::before {
  width: 100%;
}

/* 添加下拉箭头指示器 */
.s-nav-link_zwpweb::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.3s ease;
}

/* 箭头旋转动画(菜单打开时) */
.s-nav-link_zwpweb.active::after {
  transform: rotate(180deg);
}

/* 按钮激活状态(下拉菜单打开时) - 仅改变文字颜色 */
.s-nav-link_zwpweb.active {
  color: #3b82f6;
}

/* 激活状态时显示完整下划线 */
.s-nav-link_zwpweb.active::before {
  width: 100%;
}

/* 下拉菜单面板 */
.s-el-dropdown-popper {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 8px;
  min-width: 140px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1002;
}

/* 下拉菜单显示状态 */
.s-el-dropdown-popper.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 语言列表项样式 */
.s-el-dropdown-popper li {
  margin: 0;
  padding: 0;
}

/* 语言链接样式 */
.s-el-dropdown-popper a {
  display: block;
  padding: 10px 16px;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 语言链接悬停效果 */
.s-el-dropdown-popper a:hover {
  background: #f1f5f9;
  color: #3b82f6;
}

/* 选中语言的高亮状态 */
.s-el-dropdown-popper a.active {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  font-weight: 600;
}

/* 在选中语言前显示对勾图标 */
.s-el-dropdown-popper a.active::before {
  content: "✓";
  display: inline-block;
  margin-right: 8px;
  font-weight: bold;
}

/* ================= 移动端适配 - 语言切换器 ================= */
@media (max-width: 768px) {
  /* 在移动菜单中,语言切换器全宽显示 */
  .s-nav-lang-dropdown {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f8fafc;
    box-sizing: border-box; /* 确保padding不超出容器 */
  }

  /* 移动端按钮样式 - 与导航链接保持一致 */
  .s-nav-link_zwpweb {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
    gap: 8px;
    box-sizing: border-box; /* 确保padding不超出容器 */
  }

  /* 移动端隐藏下划线效果(与导航链接一致) */
  .s-nav-link_zwpweb::before {
    display: none;
  }

  /* 移动端下拉菜单样式 */
  .s-el-dropdown-popper {
    position: static;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 100%; /* 确保不超出容器 */
    margin-top: 0;
    box-shadow: none;
    border-radius: 0;
    border-top: 1px solid #f8fafc;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    box-sizing: border-box; /* 确保padding不超出容器 */
  }

  /* 移动端下拉菜单显示 */
  .s-el-dropdown-popper.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* 移动端语言选项样式 */
  .s-el-dropdown-popper a {
    padding: 14px 24px;
    font-size: 16px;
    border-radius: 0;
    text-align: center;
    box-sizing: border-box; /* 确保padding不超出容器 */
  }
}

/* ================= 深色模式支持(可选) ================= */
@media (prefers-color-scheme: dark) {
  .s-el-dropdown-popper {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .s-el-dropdown-popper a {
    color: #cbd5e1;
  }

  .s-el-dropdown-popper a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}
