.ui-check {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 24px;
	padding: 2px 0;
	font-size: 14px;
	line-height: 20px;
	color: var(--k700);
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.ui-check > input {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	display: grid;
	place-content: center;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	border: 1.5px solid #c4c9d0;
	border-radius: 5px;
	background: #fff;
	color: var(--ink);
	cursor: inherit;
	transition:
		background 0.15s,
		border-color 0.15s,
		box-shadow 0.15s;
}
/* 勾 / 圆点 / 横杠都画在 ::before 里，未选中时缩到 0 */
.ui-check > input::before {
	content: '';
	width: 10px;
	height: 10px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
		center / contain no-repeat;
	transform: scale(0);
	transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ui-check > span {
	min-width: 0;
}

/* 悬停 */
.ui-check:hover > input:not(:disabled):not(:checked) {
	border-color: var(--k600);
}

/* 选中 */
.ui-check > input:checked,
.ui-check > input:indeterminate {
	border-color: var(--o500);
	background: var(--o500);
}
.ui-check > input:checked::before {
	transform: scale(1);
}
.ui-check:hover > input:checked:not(:disabled) {
	border-color: #f3a140;
	background: #f3a140;
}
.ui-check > input:checked + span {
	color: var(--ink);
}

/* 半选（复选框 indeterminate） */
.ui-check > input:indeterminate::before {
	height: 2px;
	border-radius: 1px;
	-webkit-mask: none;
	mask: none;
	transform: scale(1);
}

/* 单选：圆形 + 圆点 */
.ui-check > input[type='radio'] {
	border-radius: 50%;
}
.ui-check > input[type='radio']::before {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	-webkit-mask: none;
	mask: none;
}

/* 键盘聚焦 */
.ui-check > input:focus-visible {
	outline: 2px solid var(--i600);
	outline-offset: 2px;
}

/* 校验失败 */
.ui-check > input[aria-invalid='true'] {
	border-color: #d92d20;
	box-shadow: 0 0 0 3px #fee4e2;
}

/* 禁用 */
.ui-check:has(> input:disabled) {
	color: #9aa1ab;
	cursor: not-allowed;
}
.ui-check > input:disabled {
	border-color: #dce0e5;
	background: #f5f6f7;
}
.ui-check > input:disabled:checked {
	border-color: #dce0e5;
	background: #dce0e5;
	color: #9aa1ab;
}

/* 小号 */
.ui-check-sm {
	gap: 8px;
	font-size: 13px;
	line-height: 18px;
}
.ui-check-sm > input {
	width: 16px;
	height: 16px;
	border-radius: 4px;
}
.ui-check-sm > input::before {
	width: 9px;
	height: 9px;
}
.ui-check-sm > input[type='radio']::before {
	width: 6px;
	height: 6px;
}

@media (prefers-reduced-motion: reduce) {
	.ui-check > input,
	.ui-check > input::before {
		transition: none;
	}
}

/* 切换语言时语言按钮文字前的小转圈（assets/js/site.js 插入 .lang-spin） */
.lang-spin {
	flex: none;
	width: 12px;
	height: 12px;
	margin-right: 2px;
	border: 2px solid var(--o100, #fde6c8);
	border-top-color: var(--o500, #f0922b);
	border-radius: 50%;
	animation: lang-spin 0.7s linear infinite;
}
[aria-busy='true'].lang,
[aria-busy='true'].mnav-lang {
	cursor: progress;
}
@keyframes lang-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.lang-spin {
		animation-duration: 1.6s;
	}
}
