/**
 * 繁简随心 Hanzi Switch — 样式
 *
 * 只给切换按钮上样式，不动页面其他任何元素。
 * 颜色全部走 CSS 变量，主题里覆盖变量即可换肤，不需要 !important。
 *
 * @package Hanzi_Switch
 */

.hansw-toggle {
	--hansw-bg: rgba(16, 20, 19, 0.82);
	--hansw-fg: #fff;
	--hansw-gap: 24px;
	--hansw-size: 44px;

	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	margin: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.06em;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.hansw-toggle[hidden] {
	display: none;
}

/* 浮动按钮 */

button.hansw-toggle.hansw-float {
	position: fixed;
	z-index: 9998;
	bottom: var(--hansw-gap);
	display: -webkit-inline-box;
	display: inline-flex;
	-webkit-box-align: center;
	align-items: center;
	-webkit-box-pack: center;
	justify-content: center;
	min-width: var(--hansw-size);
	height: var(--hansw-size);
	padding: 0 15px;
	border: 0;
	border-radius: 999px;
	background-color: var(--hansw-bg);
	color: var(--hansw-fg);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: background-color 0.18s ease, -webkit-transform 0.18s ease, transform 0.18s ease;
}

button.hansw-toggle.hansw-float:hover,
button.hansw-toggle.hansw-float:focus-visible {
	background-color: rgba(16, 20, 19, 0.94);
	-webkit-transform: translateY(-1px);
	transform: translateY(-1px);
}

button.hansw-toggle.hansw-float:active {
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

button.hansw-toggle.hansw-float:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.hansw-float.hansw-right {
	right: var(--hansw-gap);
}

.hansw-float.hansw-left {
	left: var(--hansw-gap);
}

/* 短代码里的内联按钮 */

button.hansw-toggle.hansw-inline {
	display: -webkit-inline-box;
	display: inline-flex;
	-webkit-box-align: center;
	align-items: center;
	padding: 0.4em 0.95em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background-color: transparent;
	color: inherit;
	font-size: 0.86em;
	opacity: 0.78;
	transition: opacity 0.18s ease, background-color 0.18s ease;
}

button.hansw-toggle.hansw-inline:hover,
button.hansw-toggle.hansw-inline:focus-visible {
	opacity: 1;
	background-color: rgba(127, 127, 127, 0.12);
}

/* 短代码 / 小工具里的链接形式（侧边栏、页脚这类纯文字场景） */

a.hansw-toggle.hansw-link {
	display: inline;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-decoration: underline;
	-webkit-text-decoration-thickness: 1px;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	opacity: 0.85;
	transition: opacity 0.18s ease;
}

a.hansw-toggle.hansw-link:hover,
a.hansw-toggle.hansw-link:focus-visible {
	opacity: 1;
	text-decoration-thickness: 2px;
}

a.hansw-toggle.hansw-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* 小工具容器里的多留一点呼吸感 */

.hansw-widget .hansw-toggle {
	display: inline-block;
}

/* 小屏幕收一点，别挡住内容 */

@media screen and (max-width: 600px) {
	.hansw-toggle {
		--hansw-gap: 16px;
		--hansw-size: 40px;
	}

	button.hansw-toggle.hansw-float {
		padding: 0 12px;
		font-size: 12px;
	}
}
