/**
 * wxhc.me 语言切换器样式
 * 适配深色（index.html）和浅色（wxhc.html / learn*.html）两种主题
 */

/* ─── 切换器容器 ─── */
.wxhc-lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* ─── 切换按钮 ─── */
.wxhc-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(217, 177, 90, .24);
  border-radius: 999px;
  background: rgba(244, 236, 214, .06);
  color: inherit;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
}

.wxhc-lang-btn:hover {
  border-color: rgba(217, 177, 90, .5);
  background: rgba(217, 177, 90, .1);
}

.wxhc-lang-globe {
  width: 15px;
  height: 15px;
  opacity: .8;
  flex-shrink: 0;
}

.wxhc-lang-current {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
}

.wxhc-lang-caret {
  width: 10px;
  height: 10px;
  transition: transform .2s ease;
  opacity: .7;
  flex-shrink: 0;
}

.wxhc-lang-switch.is-open .wxhc-lang-caret {
  transform: rotate(180deg);
}

/* ─── 下拉菜单 ─── */
.wxhc-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(18, 16, 26, .96);
  border: 1px solid rgba(217, 177, 90, .22);
  box-shadow: 0 20px 48px -16px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .06) inset;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 100;
  pointer-events: none;
}

.wxhc-lang-switch.is-open .wxhc-lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ─── 选项 ─── */
.wxhc-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
  -webkit-appearance: none;
  appearance: none;
}

.wxhc-lang-option:hover {
  background: rgba(217, 177, 90, .12);
}

.wxhc-lang-option.is-active {
  color: #f0cd7e;
}

.wxhc-lang-check {
  width: 16px;
  flex-shrink: 0;
  font-size: 12px;
  text-align: center;
  opacity: .9;
}

.wxhc-lang-name {
  flex: 1;
}

/* ─── 浅色主题适配（wxhc.html, learn*.html）─── */
.wxhc-lang-switch.light .wxhc-lang-btn {
  border-color: rgba(21, 25, 24, .15);
  background: rgba(21, 25, 24, .04);
  color: var(--ink, #151918);
}

.wxhc-lang-switch.light .wxhc-lang-btn:hover {
  border-color: rgba(21, 25, 24, .3);
  background: rgba(21, 25, 24, .08);
}

.wxhc-lang-switch.light .wxhc-lang-dropdown {
  background: rgba(253, 247, 231, .97);
  border-color: rgba(21, 25, 24, .14);
  box-shadow: 0 20px 48px -16px rgba(20, 24, 23, .3), 0 1px 0 rgba(255, 255, 255, .7) inset;
}

.wxhc-lang-switch.light .wxhc-lang-option:hover {
  background: rgba(166, 64, 50, .08);
}

.wxhc-lang-switch.light .wxhc-lang-option.is-active {
  color: #a64032;
}

/* ─── 阳明页面深色主题适配 ─── */
.wxhc-lang-switch.ym-theme .wxhc-lang-btn {
  border-color: rgba(201, 168, 95, .3);
  background: rgba(246, 239, 222, .08);
  color: #f6efde;
}

.wxhc-lang-switch.ym-theme .wxhc-lang-btn:hover {
  border-color: rgba(201, 168, 95, .55);
  background: rgba(201, 168, 95, .15);
}

.wxhc-lang-switch.ym-theme .wxhc-lang-dropdown {
  background: rgba(29, 27, 22, .97);
  border-color: rgba(201, 168, 95, .25);
}

.wxhc-lang-switch.ym-theme .wxhc-lang-option.is-active {
  color: #c9a85f;
}

/* ─── 移动端适配 ─── */
@media (max-width: 720px) {
  .wxhc-lang-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .wxhc-lang-globe {
    width: 14px;
    height: 14px;
  }
  .wxhc-lang-dropdown {
    right: 0;
    min-width: 130px;
  }
}
