/* 自动翻译：默认主题 language-switcher */
.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  z-index: 1080;
}
.language-btn {
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1.2;
}
.header.scrolled .language-btn,
.header:hover .language-btn {
  color: #333;
}
.language-btn .globe-icon {
  display: inline-flex;
  align-items: center;
  color: inherit;
  line-height: 0;
}
.language-btn .globe-icon .globe-svg {
  width: 22px;
  height: 22px;
  display: block;
}
.language-btn .arrow-icon {
  margin-left: 5px;
  font-size: 10px;
  transition: transform 0.3s;
}
.language-btn .current-lang {
  display: inline-block;
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.language-list .hidden { display: none !important; }
.language-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
  width: 400px;
}
.language-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 10px;
  max-height: 230px;
  overflow-y: auto;
}
.language-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  gap: 5px;
  font-size: 13px;
  color: #333;
  height: 30px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.language-item a {
  color: #333;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.language-item:hover { background: #f5f5f5; }
.language-item img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.more-languages {
  text-align: center;
  padding: 8px;
  border-top: 1px solid #eee;
  cursor: pointer;
  color: #666;
  font-size: 13px;
  height: 40px;
  line-height: 24px;
  background: #fff;
}
.more-languages:hover {
  color: #333;
  background: #f5f5f5;
}
.language-dropdown.active {
  display: block;
  background: white;
}
.language-list.show-all { max-height: 400px; }
.language-list::-webkit-scrollbar { width: 6px; }
.language-list::-webkit-scrollbar-track { background: #f1f1f1; }
.language-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.language-list::-webkit-scrollbar-thumb:hover { background: #999; }

@media screen and (max-width: 800px) {
  .language-switcher {
    position: relative !important;
    margin: 10px 0 6px;
    width: auto;
    max-width: 100%;
    text-align: left;
    padding: 0 !important;
  }
  .language-dropdown {
    width: min(400px, 92vw) !important;
    right: 0 !important;
  }
}

/* 手动语言：fast 风格（供无主题自带 .language 样式时使用，如 default） */
.nav-button .language,
.navbar .language,
.language-manual {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}
.nav-button .language > a,
.navbar .language > a,
.language-manual > a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}
.navbar .language > a,
.language-manual > a {
  color: #fff;
  gap: 0.35rem;
  font-size: 0.875rem;
}
.nav-button .language span,
.navbar .language span,
.language-manual span {
  margin-left: 0.75rem;
  margin-right: 0.375rem;
  font-size: 0.875rem;
  white-space: nowrap;
}
.nav-button .language .language-show,
.navbar .language .language-show,
.language-manual .language-show {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 130px;
  opacity: 0;
  visibility: hidden;
  transform-origin: center top;
  background-color: #fff;
  transform: scaleY(0);
  box-shadow: 0 8px 36.8px 3.2px rgba(0, 0, 7, 0.08);
  transition: 0.5s;
  border-radius: 6px;
  overflow: hidden;
}
.nav-button .language:hover .language-show,
.navbar .language:hover .language-show,
.language-manual:hover .language-show {
  opacity: 1;
  visibility: visible;
  transform: scaleY(1);
}
.nav-button .language .language-show a,
.navbar .language .language-show a,
.language-manual .language-show a {
  display: block;
  text-align: left;
  padding: 15px 35px 15px 25px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
}
.nav-button .language .language-show a:hover,
.navbar .language .language-show a:hover,
.language-manual .language-show a:hover {
  color: #fff;
  background: #0863c4;
}
