/* ==========================================================================
   全局语言切换器
   位置：
     .vx-switch--footer  复刻页页脚，社交图标下方（整列铺满）
     .vx-switch--nav     移动端左侧导航抽屉最顶端
     .vx-switch--float   其它页面左下角悬浮
   宽度：下拉列表严格对齐「选择器框」（按钮）的宽度，而不是整个 .vx-switch
        （.vx-switch 还含左侧 LANGUAGE 标签，会比按钮宽）。
   ========================================================================== */

.vx-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: Oswald, "Segoe UI", sans-serif;
	font-size: 12px;
	letter-spacing: .1em;
	text-transform: uppercase;
}

/* 悬浮模式（非复刻页页脚） */
.vx-switch--float {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 9500;
	display: inline-block;
}

.vx-switch__label {
	color: rgba(218, 218, 218, .55);
	font-size: 11px;
	letter-spacing: .14em;
}

/* 按钮 + 下拉列表的定位容器：列表宽度 = 这个容器的宽度 = 按钮宽度 */
.vx-switch__select {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
}

.vx-switch__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	background: transparent;
	color: #dadada;
	border: 1px solid rgba(255, 255, 255, .28);
	cursor: pointer;
	line-height: 1;
	transition: border-color .18s ease, color .18s ease;
}

.vx-switch__btn:hover {
	border-color: #9f8561;
	color: #fff;
}

.vx-switch__menu {
	position: absolute;
	left: 0;
	right: 0;
	top: auto;
	bottom: calc(100% + 6px);
	margin: 0;
	padding: 6px 0;
	list-style: none;
	min-width: 0;
	background: #0e0e0e;
	border: 1px solid rgba(255, 255, 255, .18);
	box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
	display: none;
	z-index: 10;
}

/* 页脚 / 抽屉里空间在下方，菜单向下展开 */
.vx-switch--footer .vx-switch__menu,
.vx-switch--nav .vx-switch__menu {
	bottom: auto;
	top: calc(100% + 6px);
}

.vx-switch.is-open .vx-switch__menu {
	display: block;
}

.vx-switch__menu li {
	margin: 0;
}

.vx-switch__menu a {
	display: block;
	padding: 9px 14px;
	color: #dadada;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vx-switch__menu a:hover {
	background: rgba(159, 133, 97, .18);
	color: #fff;
}

.vx-switch__menu a.is-current {
	color: #9f8561;
}

/* ---------- 页脚：整列铺满 ---------- */
.footer__lang {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .08);
}

.footer__lang .vx-switch {
	display: flex;
	width: 100%;
	justify-content: flex-start;
}

.footer__lang .vx-switch__select {
	flex: 1 1 auto;
}

.footer__lang .vx-switch__btn {
	width: 100%;
	justify-content: space-between;
}

/* ---------- 移动端左侧抽屉：桌面隐藏 ---------- */
.vx-switch--nav {
	display: none;
}

/* 抽屉头部栏：与关闭按钮同一行，紧贴其左侧 */
.vx-lang-nav {
	margin: 0;
	padding: 0 12px 0 0;
	white-space: nowrap;
}

@media (max-width: 991px) {
	/* 移动端：抽屉版接管，页脚版隐藏
	   （必须带 .footer__lang 前缀：那条规则权重比单个类高，否则盖不住） */
	.vx-switch--footer,
	.footer__lang .vx-switch--footer {
		display: none;
	}

	.vx-switch--nav {
		display: inline-flex;
		width: auto;
	}

	/* .drawer__header 是 display:table，这里做成右对齐的单元格，
	   让切换器紧贴关闭按钮左侧 */
	.vx-lang-nav {
		display: table-cell;
		vertical-align: middle;
		text-align: right;
		padding: 0 10px 0 0;
		width: 1%;
	}
}

@media (max-width: 768px) {
	.vx-switch--float {
		left: 10px;
		bottom: 10px;
		font-size: 11px;
	}
}

/* 抽屉头部的语言菜单会向下延伸，落进 .drawer__scrollable 区域，
   被列表的背景盖住（实测 elementFromPoint 命中 body，点不到菜单项）。
   抬高头部层级，让菜单显示在滚动区之上。 */
@media (max-width: 991px) {
	#NavDrawer .drawer__fixed-header {
		position: relative;
		z-index: 20;
		background: #111;
	}

	.vx-switch--nav .vx-switch__menu {
		z-index: 30;
		background: #0e0e0e;
	}
}