/* 语言切换器样式 */
.lang-selected {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  transition: all 0.3s ease;
  min-width: auto;
  height: auto;
  display: inline-block;
  box-shadow: none;
}

.lang-selected:hover {
  transform: translateY(-1px);
}

.lang-dropdown-content {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  min-width: 120px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 5px;
  z-index: 1001;
}

.lang-dropdown-content.show {
  display: block;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .lang-switcher {
    padding: 4px;
  }
  
  .lang-switcher button {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 30px;
    height: 30px;
  }
  
  /* 移动端语言切换器样式 */
.lang-switcher-mobile {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
}

.lang-selected-mobile {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1.5rem; /* text-2xl equivalent */
  font-weight: inherit;
  transition: color 0.3s ease;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.lang-selected-mobile:hover {
  color: #d6d3d1; /* stone-300 equivalent */
}

.lang-dropdown-content-mobile {
  display: none;
  width: 100%;
  margin-top: 1rem;
}

.lang-dropdown-content-mobile.show {
  display: block;
}

.lang-dropdown-content-mobile a {
  transition: all 0.3s ease;
  padding: 0.75rem 0; /* py-3 equivalent */
  text-align: center;
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  text-decoration: none; /* 移除a标签默认下划线 */
}

.lang-dropdown-content-mobile a:hover,
.lang-dropdown-content-mobile a.active {
  color: #d6d3d1; /* stone-300 equivalent */
}

.lang-dropdown-content-mobile a.active {
  font-weight: bold;
  transform: none !important; /* 移除位移 */
}

/* 移除移动端语言切换器链接的下划线和位移效果 */
.lang-dropdown-content-mobile a {
  position: static !important;
  padding: 0.75rem 0 !important;
}

.lang-dropdown-content-mobile a::after {
  display: none !important; /* 移除下边框 */
}

.lang-dropdown-content-mobile a:hover {
  transform: none !important; /* 移除悬停位移 */
}
}

@media (max-width: 480px) {
  .lang-switcher {
    gap: 3px;
  }
  
  .lang-switcher button {
    padding: 5px 8px;
    font-size: 11px;
    min-width: 28px;
    height: 28px;
  }
}

/* 导航栏滚动时的样式调整 */
nav.scrolled ~ .lang-switcher {
  background: rgba(255, 255, 255, 0.95);
}

/* 暗色背景下的语言切换器样式 */
.gradient-bg ~ .lang-switcher,
.bg-gradient-to-r ~ .lang-switcher {
  background: rgba(255, 255, 255, 0.95);
}

.gradient-bg ~ .lang-switcher button,
.bg-gradient-to-r ~ .lang-switcher button {
  color: #333;
}

.gradient-bg ~ .lang-switcher button:hover,
.bg-gradient-to-r ~ .lang-switcher button:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 语言切换动画 */
[data-lang] {
  transition: opacity 0.3s ease;
}

/* 防止语言切换时的布局抖动 */
.nav-container {
  position: relative;
}

/* 确保语言切换器在移动端菜单之上 */
#mobile-menu.active ~ .lang-switcher {
  z-index: 45;
}