.tianchao-script-switcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: static;
	z-index: 2;
}

.tianchao-script-switcher button {
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #2271b1;
	font: 600 17px/34px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	cursor: pointer;
}

.tianchao-script-switcher button:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.tianchao-script-error {
	display: none;
	max-width: 220px;
	padding: 5px 8px;
	border-radius: 5px;
	background: #b32d2e;
	color: #fff;
	font-size: 12px;
}

.tianchao-script-switcher.has-error .tianchao-script-error {
	display: block;
}

.tianchao-script-menu-item {
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-width: 38px;
}

.tianchao-script-mobile-slot {
	float: right;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 60px;
	margin-right: 4px;
}

/* Reserve the desktop menu width before the footer controller mounts. */
@media (min-width: 992px) {
	html:not(.tianchao-script-switcher-mounted) #header #nav-menu-item-side {
		position: relative;
		margin-left: 38px;
	}

	html:not(.tianchao-script-switcher-mounted) #header #nav-menu-item-side::before {
		content: "简";
		position: absolute;
		top: 0;
		right: 100%;
		display: block;
		width: 38px;
		height: 60px;
		color: #2271b1;
		font: 400 20px/60px "Open Sans", sans-serif;
		text-align: center;
		pointer-events: none;
	}

	html.tianchao-script-target-traditional:not(.tianchao-script-switcher-mounted) #header #nav-menu-item-side::before {
		content: "繁";
	}
}

@media (max-width: 991px) {
	/* ponytail: 借用头部原有的右侧留白，让整个右侧浮动组多出 10px。 */
	#header .navbar-header .kleo-mobile-switch {
		margin-right: -10px;
	}

	/* 头像跟随汉堡右移，使用腾出的空间；relative 不覆盖现有呼吸动画的 transform。 */
	#header .navbar-header .kleo-mobile-icons {
		position: relative;
		left: 10px;
	}

	html:not(.tianchao-script-switcher-mounted) #header .navbar-header .kleo-mobile-icons {
		margin-left: 28px;
	}

	html:not(.tianchao-script-switcher-mounted) #header .navbar-header .kleo-mobile-icons::before {
		content: "简";
		position: absolute;
		top: 22px;
		left: -28px;
		display: block;
		width: 28px;
		height: 32px;
		color: #2271b1;
		font: 600 16px/32px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
		text-align: center;
		pointer-events: none;
	}

	html.tianchao-script-target-traditional:not(.tianchao-script-switcher-mounted) #header .navbar-header .kleo-mobile-icons::before {
		content: "繁";
	}

	.tianchao-script-switcher button {
		width: 28px;
		height: 32px;
		font-size: 16px;
		line-height: 32px;
	}

	.tianchao-script-mobile-slot {
		position: relative;
		left: -10px;
		width: 28px;
		margin: 0;
	}
}
