/* 头部语言切换：中英文 + 国旗图标
   与 base 主题的 #top_nav（黑底 40px 高）对齐，替换原生的 dl.top_lang 下拉。 */

.lang-switch {
	position: relative;
	float: left;
	height: 40px;
	/* 与右侧币种选择留出间距，避免两个控件贴在一起 */
	margin-right: 6px;
}

.lang-switch__btn {
	/* 重置站点全局按钮样式：base 主题的 style.css 里有
	   button:active, button:focus { background-color:#4c6ba9; box-shadow: inset 0 0 10px #4c6ba9 }
	   选择器特异度高于单个 class，所以这里用 .lang-switch 前缀 + :focus/:active 显式压掉。 */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 8px 0 12px;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
	color: #e6e6e6;
	font-family: inherit;
	font-size: 12px;
	font-weight: 400;
	line-height: 40px;
	cursor: pointer;
	outline: none;
}

.lang-switch .lang-switch__btn,
.lang-switch .lang-switch__btn:hover,
.lang-switch .lang-switch__btn:focus,
.lang-switch .lang-switch__btn:active {
	background-color: transparent !important;
	box-shadow: none;
}

.lang-switch__btn:hover,
.lang-switch.is-open .lang-switch__btn {
	color: #fff;
}

/* 键盘聚焦时才显示描边，鼠标点击不出现焦点框 */
.lang-switch .lang-switch__btn:focus-visible {
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
	border-radius: 4px;
}

/* 国旗：固定宽高比，圆角 + 内描边，深色背景下边缘更清晰 */
.lang-switch__flag {
	display: inline-flex;
	flex: 0 0 auto;
	width: 20px;
	height: 14px;
	overflow: hidden;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.lang-switch__flag svg {
	display: block;
	width: 100%;
	height: 100%;
}

.lang-switch__text {
	letter-spacing: .3px;
	white-space: nowrap;
}

.lang-switch__caret {
	flex: 0 0 auto;
	opacity: .7;
	transition: transform .18s ease;
}

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

/* 下拉面板 */
.lang-switch__menu {
	position: absolute;
	top: 40px;
	left: 8px;
	z-index: 99999;
	display: none;
	min-width: 148px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
	line-height: 1.4;
}

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

.lang-switch__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	color: #333;
	font-size: 12px;
	cursor: pointer;
	white-space: nowrap;
	transition: background .12s;
}

.lang-switch__item:hover {
	background: #f4f4f4;
}

.lang-switch__item.is-active {
	color: #111;
	font-weight: 600;
	background: #fafafa;
}

.lang-switch__item:focus-visible {
	outline: 2px solid #111;
	outline-offset: -2px;
}

.lang-switch__check {
	margin-left: auto;
	color: #111;
	opacity: 0;
}

.lang-switch__item.is-active .lang-switch__check {
	opacity: 1;
}
