/* ---------- 表单卡片 ---------- */
.sg-card {
	position: relative;
	width: 100%;
	max-width: 416px;
	margin: 0 auto;
	padding: 32px;
	border-radius: 16px;
	background: #fff;
	text-align: left;
}
.sg-brand {
	margin: 0 0 24px;
	font-size: 22px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	color: var(--o500);
}
.sg-card .sg-title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	color: #202124;
}
.sg-sub {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: #85878a;
}
.sg-note {
	margin: 16px 0 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--o50);
	font-size: 14px;
	line-height: 1.6;
	color: var(--o700);
}
.sg-note[hidden],
.sg-form[hidden],
.sg-method[hidden],
.sg-err[hidden],
.sg-msg[hidden] {
	display: none;
}
.sg-close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: #85878a;
	transition:
		background 0.2s,
		color 0.2s;
}
.sg-close:hover {
	background: #f5f5f5;
	color: #202124;
}

/* ---------- 表单（Vue：mb-4 间距、form-label、form-control-lg） ---------- */
.sg-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-top: 24px;
}
.sg-field label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	color: #85878a;
}
.sg-field input {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 12px 20px;
	border: 1px solid #dce0e5;
	border-radius: 6px;
	background: #fff;
	font-size: 16px;
	line-height: 1.5;
	color: #202124;
	transition:
		border-color 0.15s ease-in-out,
		box-shadow 0.15s ease-in-out;
}
.sg-field input::placeholder {
	color: #96969a;
}
.sg-field input:focus {
	outline: 0;
	border-color: rgba(32, 33, 36, 0.1);
	box-shadow: 0 4px 10px 3px rgba(32, 33, 36, 0.1);
}
.sg-field input[aria-invalid='true'] {
	border-color: #dc3545;
}
.sg-hint,
.sg-err {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.5;
}
.sg-hint {
	color: #85878a;
}
.sg-err {
	color: #dc3545;
}

/* 输入框右侧的密码显隐 / 发送验证码 */
.sg-affix {
	position: relative;
}
.sg-affix input {
	padding-right: 120px;
}
.sg-affix input[type='password'],
.sg-affix input#sg-password {
	padding-right: 52px;
}
.sg-eye {
	position: absolute;
	top: 50%;
	right: 10px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 6px;
	color: #96969a;
	transform: translateY(-50%);
}
.sg-eye:hover,
.sg-eye[aria-pressed='true'] {
	color: #202124;
}
.sg-send {
	position: absolute;
	top: 50%;
	right: 20px;
	font-size: 15px;
	font-weight: 500;
	color: var(--o700);
	white-space: nowrap;
	transform: translateY(-50%);
}
.sg-send:hover:not(:disabled) {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.sg-send:disabled {
	color: #999;
	cursor: not-allowed;
	font-variant-numeric: tabular-nums;
}

.sg-msg {
	margin: 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: #fef2f2;
	font-size: 14px;
	line-height: 1.6;
	color: #b42318;
}
.sg-msg.is-ok {
	background: #ecfdf3;
	color: #067647;
}

/* ---------- 按钮：本站设计语言（胶囊 + 主色 + 投影） ---------- */
.sg-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	border-radius: 999px;
	background: var(--o500);
	font-size: 16px;
	font-weight: 700;
	color: var(--ink);
	box-shadow: 0 10px 24px rgba(240, 146, 43, 0.3);
	transition:
		background 0.15s,
		transform 0.15s,
		box-shadow 0.15s;
}
.sg-submit:hover:not(:disabled) {
	background: #f3a140;
	transform: translateY(-1px);
}
/* 未填完：与 Vue 版一样置灰不可点 */
.sg-submit:disabled {
	background: #f1f2f4;
	color: #9aa1ab;
	box-shadow: none;
	cursor: not-allowed;
}
.sg-submit.is-busy {
	background: var(--o500);
	color: var(--ink);
	cursor: progress;
	opacity: 0.8;
}
.sg-submit.is-busy::before {
	content: '';
	width: 14px;
	height: 14px;
	margin-right: 8px;
	border: 2px solid rgba(18, 23, 31, 0.25);
	border-top-color: var(--ink);
	border-radius: 50%;
	animation: sg-spin 0.7s linear infinite;
}
@keyframes sg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* 或者通过以下方式继续 */
.sg-or {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 28px 0 20px;
	font-size: 14px;
	color: #85878a;
	white-space: nowrap;
}
.sg-or::before,
.sg-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e0e5eb;
}
.sg-methods {
	display: flex;
	gap: 12px;
}
.sg-method {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 20px;
	border: 1.5px solid #e0e5eb;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	color: #181d25;
	transition:
		border-color 0.2s,
		background 0.2s;
}
.sg-method:hover {
	border-color: var(--ink);
	background: #f5f5f5;
}

/* ---------- 登录页（移动端 / 直接访问） ---------- */
.sg-page {
	position: relative;
	overflow: hidden;
	background: var(--k50);
	padding: clamp(40px, 7vw, 96px) 0 clamp(72px, 9vw, 128px);
}
.sg-page-in {
	position: relative;
	z-index: 1;
}
.sg-page .sg-card {
	box-shadow: 0 1px 2px rgba(18, 23, 31, 0.04);
	border: 1px solid #eef0f2;
}
/* 背景装饰（照搬 Vue 登录页：两角有机形状 + 闪烁星形） */
.sg-deco {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.sg-deco svg {
	position: absolute;
}
.sg-deco-tr {
	top: -80px;
	right: -80px;
	width: 420px;
	height: 420px;
}
.sg-deco-bl {
	bottom: -80px;
	left: -80px;
	width: 360px;
	height: 360px;
}
.sg-star {
	animation: sg-star 3.5s ease-in-out infinite;
}
.sg-star1 {
	top: 14%;
	left: 7%;
	width: 40px;
	height: 40px;
}
.sg-star2 {
	top: 68%;
	right: 10%;
	width: 28px;
	height: 28px;
	animation-delay: 1.2s;
}
.sg-star3 {
	top: 32%;
	right: 5%;
	width: 20px;
	height: 20px;
	animation-delay: 2.4s;
}
@keyframes sg-star {
	0%,
	100% {
		transform: scale(1) rotate(0deg);
		opacity: 0.7;
	}
	50% {
		transform: scale(1.25) rotate(18deg);
		opacity: 1;
	}
}
@media (max-width: 560px) {
	.sg-page {
		background: #fff;
		padding-top: 24px;
	}
	.sg-page .sg-card {
		padding: 8px 0;
		border: 0;
		box-shadow: none;
	}
	.sg-deco {
		display: none;
	}
}

/* ---------- 桌面端登录弹窗（<dialog>） ---------- */
/* 不要给 dialog 加 transform：验证码弹层挂在 dialog 里、用 position: fixed，transform 会改变它的定位参照 */
.sg-dialog {
	width: calc(100% - 32px);
	max-width: 416px;
	max-height: calc(100dvh - 32px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: transparent;
	overflow: auto;
	overscroll-behavior: contain;
}
.sg-dialog[open] {
	animation: sg-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sg-dialog::backdrop {
	background: rgba(18, 23, 31, 0.5);
	animation: sg-fade 0.2s ease-out;
}
.sg-dialog .sg-card {
	box-shadow: 0 24px 64px rgba(18, 23, 31, 0.24);
}
.sg-lock {
	overflow: hidden;
}
@keyframes sg-in {
	from {
		opacity: 0;
	}
}
@keyframes sg-fade {
	from {
		opacity: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.sg-star,
	.sg-dialog[open],
	.sg-dialog::backdrop {
		animation: none;
	}
}

/* ---------- 登录 / 注册切换（parts/signin-form.php 的 data-view） ---------- */
.sg-view[hidden] {
	display: none;
}
.sg-switch {
	margin: 24px 0 0;
	font-size: 14px;
	text-align: center;
	color: #85878a;
}
.sg-switch button {
	margin-left: 6px;
	font-weight: 600;
	color: var(--o700);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: rgba(180, 83, 9, 0.35);
}
.sg-switch button:hover {
	text-decoration-color: currentColor;
}
.sg-gift {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 12px 0 0;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--o50);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--o700);
}
.sg-gift svg {
	flex: none;
}
.sg-form .ui-check a {
	color: var(--o700);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- 滑块验证码弹窗（assets/js/captcha.js） ---------- */
.cp-open {
	overflow: hidden;
}
.cp-mask {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(18, 23, 31, 0.5);
	animation: cp-fade 0.2s ease-out;
}
.cp-box {
	padding: 16px 16px 12px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 48px rgba(18, 23, 31, 0.24);
	animation: cp-pop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.cp-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}
.cp-icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: var(--k500);
}
.cp-icon:hover {
	background: var(--k100);
	color: var(--ink);
}
/* 拼图按后端给的像素尺寸原样显示（x 以背景像素为单位提交），不能缩放 */
.cp-stage {
	position: relative;
	width: 320px;
	height: 180px;
	border-radius: 10px;
	background: var(--k100);
	overflow: hidden;
	user-select: none;
}
.cp-bg {
	display: block;
}
.cp-piece {
	position: absolute;
	left: 0;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.cp-stage.is-loading .cp-bg,
.cp-stage.is-loading .cp-piece {
	visibility: hidden;
}
.cp-status {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 6px 10px;
	font-size: 13px;
	text-align: center;
	color: #fff;
	transform: translateY(100%);
	transition: transform 0.2s;
}
.cp-status.is-ok,
.cp-status.is-fail {
	transform: none;
}
.cp-status.is-ok {
	background: rgba(6, 118, 71, 0.9);
}
.cp-status.is-fail {
	background: rgba(217, 45, 32, 0.9);
}
.cp-status.is-loading {
	top: 0;
	display: grid;
	place-items: center;
	color: var(--k500);
	transform: none;
}
.cp-track {
	position: relative;
	width: 320px;
	height: 44px;
	margin-top: 12px;
	border-radius: 999px;
	background: var(--k100);
	touch-action: none;
	user-select: none;
}
.cp-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	border-radius: 999px;
	background: var(--o100);
}
.cp-tip {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding-left: 40px;
	font-size: 13px;
	color: var(--k500);
	pointer-events: none;
}
.cp-tip[hidden] {
	display: none;
}
.cp-handle {
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(18, 23, 31, 0.18);
	color: var(--ink);
	cursor: grab;
	touch-action: none;
	transition:
		background 0.2s,
		color 0.2s;
}
.cp-handle.is-active {
	cursor: grabbing;
	background: var(--o500);
}
.is-ok .cp-handle {
	background: #12b76a;
	color: #fff;
}
.is-fail .cp-handle {
	background: #f04438;
	color: #fff;
}
.cp-foot {
	display: flex;
	justify-content: flex-end;
	margin-top: 6px;
}
@keyframes cp-fade {
	from {
		opacity: 0;
	}
}
@keyframes cp-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}
@media (prefers-reduced-motion: reduce) {
	.cp-mask,
	.cp-box {
		animation: none;
	}
}
