/* 顶栏语言切换：紧凑触发器 + 常用语 / More 展开 */

.xy-header-extra-nav {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	height: 100%;
}

.xy-header-lang {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.xy-header-lang-switcher,
.xy-header-lang-switcher #gt_float_wrapper {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

/* 覆盖 GTranslate 默认大白块 */
.xy-header-lang-switcher .gt_float_switcher {
	font-family: inherit !important;
	font-size: 12px !important;
	line-height: 1 !important;
	color: #fff !important;
	background: transparent !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	overflow: visible !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected {
	background: rgba(0, 0, 0, 0.18) !important;
	border: 1px solid rgba(255, 255, 255, 0.35) !important;
	border-radius: 18px !important;
	overflow: hidden !important;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected:hover {
	background: rgba(0, 0, 0, 0.28) !important;
	border-color: rgba(255, 255, 255, 0.55) !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 5px 10px 5px 8px !important;
	color: #fff !important;
	font-weight: 600 !important;
	font-size: 12px !important;
	letter-spacing: 0.04em !important;
	text-transform: uppercase !important;
	white-space: nowrap !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang img {
	width: 18px !important;
	height: 12px !important;
	margin: 0 !important;
	border-radius: 2px !important;
	object-fit: cover !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang .gt-lang-code {
	top: 0 !important;
	max-width: 2.4em;
	overflow: hidden;
	text-overflow: clip;
}

.xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang .gt_float_switcher-arrow {
	width: 12px !important;
	height: 12px !important;
	margin-left: 2px !important;
	opacity: 0.9;
	filter: brightness(0) invert(1);
}

/* 下拉面板 */
.xy-header-lang-switcher .gt_float_switcher .gt_options {
	background: #fff !important;
	border: 1px solid rgba(15, 23, 32, 0.08) !important;
	border-radius: 10px !important;
	box-shadow: 0 12px 32px rgba(15, 23, 32, 0.16) !important;
	padding: 8px !important;
	z-index: 10050 !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	transform: none !important;
	opacity: 0;
	pointer-events: none;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options.gt-open {
	opacity: 1 !important;
	pointer-events: auto;
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px;
	align-content: start;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options.gt-open.gt-expanded {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 8px 10px !important;
	margin: 0 !important;
	border-radius: 6px !important;
	color: #2c3340 !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	transition: background 0.15s ease, color 0.15s ease;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a:hover {
	background: #fff4e0 !important;
	color: #c97800 !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a img {
	width: 18px !important;
	height: 12px !important;
	margin: 0 !important;
	border-radius: 2px !important;
	object-fit: cover !important;
	flex: 0 0 auto;
}

/* 默认只显示常用语；点 More 再出全部 */
.xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-extra {
	display: none !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded a.gt-lang-extra {
	display: flex !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more {
	grid-column: 1 / -1;
	justify-content: center;
	margin-top: 4px !important;
	padding: 9px 10px !important;
	border-top: 1px solid #eee !important;
	border-radius: 0 0 6px 6px !important;
	color: #c97800 !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em;
	background: #fffaf2 !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more:hover {
	background: #ffe8c2 !important;
	color: #a86300 !important;
}

.xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more .gt-more-arrow {
	margin-left: 4px;
	font-size: 10px;
}

@media (max-width: 991px) {
	.xy-header-lang-switcher .gt_float_switcher .gt_options.gt-open {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
