/* AI Context Translator —— 前台语言切换菜单 */

.aict-switcher {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 99999;
	font-size: 13px;
	line-height: 1.4;
	cursor: move;
	user-select: none;
}

.aict-switcher[hidden] {
	display: none;
}

/* 挂进主题容器后就不再浮动，跟着版式走 */
.aict-switcher.is-docked {
	position: static;
	cursor: default;
	display: inline-block;
}

.aict-switcher-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 7px 12px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 4px;
	background: #fff;
	color: #1d2327;
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.aict-switcher.is-docked .aict-switcher-btn {
	box-shadow: none;
}

.aict-switcher-btn:hover {
	background: #f6f7f7;
}

.aict-switcher-caret {
	font-size: 10px;
	opacity: .6;
}

/* 旗帜图标：高度按原图比例走，不同国旗高度不一，写死会变形 */
.aict-switcher-flag {
	display: inline-block;
	width: 22px;
	height: auto;
	vertical-align: middle;
	border: 0;
	border-radius: 2px;
	flex: 0 0 auto;
}

.aict-switcher-menu {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 100%;
	max-height: 320px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.aict-switcher.is-open .aict-switcher-menu {
	display: block;
}

/* 菜单往左出容易被视口切掉，贴边时改成向左展开 */
.aict-switcher.is-flipped .aict-switcher-menu {
	right: auto;
	left: 0;
}

.aict-switcher-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	color: #1d2327;
	text-decoration: none;
	white-space: nowrap;
}

.aict-switcher-item:hover,
.aict-switcher-item:focus {
	background: #f0f0f1;
	color: #135e96;
}

.aict-switcher-item.is-active {
	font-weight: 600;
	background: #f6f7f7;
}

@media screen and (max-width: 768px) {
	/* 小屏不给拖，固定在角落，免得挡住内容又找不回来 */
	.aict-switcher:not(.is-docked) {
		top: auto !important;
		left: auto !important;
		right: 10px !important;
		bottom: 10px;
		cursor: default;
	}

	.aict-switcher:not(.is-docked) .aict-switcher-menu {
		top: auto;
		bottom: calc(100% + 4px);
	}
}
