/* UniShelf slider captcha styles
 * 2026-09-25（金刚定默认方案：自建滑块，替代硬 429）
 */

.usx-captcha {
	color-scheme: only light;
	margin: 14px 0 16px;
	max-width: 340px;
}

.usx-captcha[hidden] {
	display: none !important;
}

.usx-captcha__head {
	font-size: 13px;
	font-weight: 600;
	color: #1a3a3a;
	margin-bottom: 8px;
}

.usx-captcha__stage {
	position: relative;
	width: 300px;
	max-width: 100%;
	overflow: hidden;
	border-radius: 8px;
	border: 1px solid rgba(26, 58, 58, 0.14);
	background: #f4f2ef;
	line-height: 0;
	touch-action: none;
}

.usx-captcha__board {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	-webkit-user-drag: none;
}

.usx-captcha__piece {
	position: absolute;
	left: 0;
	top: 0;
	width: auto;
	height: auto;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.usx-captcha__bar {
	position: relative;
	height: 42px;
	margin-top: 10px;
	border-radius: 8px;
	background: #efedea;
	border: 1px solid rgba(26, 58, 58, 0.14);
	overflow: hidden;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.usx-captcha__txt {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	color: rgba(26, 58, 58, 0.62);
	pointer-events: none;
	user-select: none;
}

.usx-captcha__handle {
	position: absolute;
	left: 0;
	top: 0;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #d2451f;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: grab;
	touch-action: none;
	transition: background 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.usx-captcha.is-dragging .usx-captcha__handle {
	cursor: grabbing;
}

.usx-captcha.is-ok .usx-captcha__bar {
	background: rgba(46, 160, 67, 0.12);
	border-color: rgba(46, 160, 67, 0.5);
}

.usx-captcha.is-ok .usx-captcha__handle {
	background: #2ea043;
}

.usx-captcha.is-ok .usx-captcha__txt {
	color: #1a7f37;
	font-weight: 600;
}

.usx-captcha.is-fail .usx-captcha__bar {
	background: rgba(210, 69, 31, 0.1);
	border-color: rgba(210, 69, 31, 0.5);
	animation: usx-cap-shake 0.4s ease;
}

.usx-captcha.is-fail .usx-captcha__txt {
	color: #b23a1a;
}

@keyframes usx-cap-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
	.usx-captcha.is-fail .usx-captcha__bar { animation: none; }
}
