.ape-auth {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ape-auth[hidden] {
	display: none;
}

.ape-auth__mask {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(17, 24, 39, .55);
	animation: apeAuthFade .2s ease;
}

.ape-auth__panel {
	position: relative;
	display: flex;
	justify-content: flex-end;
	width: 100%;
	max-width: 880px;
	overflow: hidden;
	background: var(--classB, #f2f3f5);
	border-radius: 10px;
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .4);
	animation: apeAuthUp .26s ease;
}

.ape-auth__media {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	overflow: hidden;
	background: var(--classB, #f2f3f5);
}

.ape-auth__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ape-auth__main {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	width: 400px;
	max-width: calc(100% - 28px);
	max-height: calc(100vh - 76px);
	margin: 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--background, #fff);
	border-radius: 8px;
	box-shadow: 0 12px 40px -14px rgba(0, 0, 0, .3);
}

.ape-auth__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 26px 26px 0;
}

.ape-auth__brand img {
	display: block;
	max-width: 160px;
	max-height: 38px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ape-auth__head {
	position: relative;
	padding: 20px 26px 0;
}

.ape-auth__head h3 {
	margin: 0;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--main, #222);
}

.ape-auth__head h3::after {
	content: '';
	display: block;
	width: 34px;
	height: 4px;
	margin-top: 10px;
	border-radius: 2px;
	background: var(--theme, #3b82f6);
}

.ape-auth__sub {
	display: none;
	margin: 14px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--seat, #999);
}

.ape-auth[data-view="login"] .ape-auth__sub[data-auth-sub="login"],
.ape-auth[data-view="register"] .ape-auth__sub[data-auth-sub="register"],
.ape-auth[data-view="forget"] .ape-auth__sub[data-auth-sub="forget"] {
	display: block;
}

.ape-auth__sub a {
	color: var(--theme, #3b82f6);
	text-decoration: none;
}

.ape-auth__sub a:hover {
	opacity: .8;
}

.ape-auth__sub a i {
	margin-left: 2px;
	font-size: 13px;
}

.ape-auth__dot {
	margin: 0 5px;
	color: var(--classA, #dcdfe4);
}

.ape-auth__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--seat, #b0b4bb);
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: transform .35s ease, background-color .2s, color .2s;
}

.ape-auth__close:hover {
	color: var(--main, #222);
	background: var(--classB, #f5f6f8);
	transform: rotate(180deg);
}

.ape-auth__body {
	padding: 16px 26px 26px;
}

.ape-auth__view {
	display: none;
	margin: 0;
}

.ape-auth__view.is-active {
	display: block;
}

.ape-auth__step {
	display: none;
}

.ape-auth__step.is-active {
	display: block;
}

.ape-auth__field {
	position: relative;
	margin-bottom: 12px;
}

/* 记住登录 / 忘记密码 */
.ape-auth__extra {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: -2px 0 14px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--seat, #999);
}

.ape-auth__remember {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	user-select: none;
}

.ape-auth__remember input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
}

.ape-auth__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border: 1px solid var(--classA, #d8dce3);
	border-radius: 3px;
	background: transparent;
	color: #fff;
	font-size: 9px;
	line-height: 1;
	transition: background-color .2s, border-color .2s;
}

.ape-auth__check .fa {
	opacity: 0;
	transform: scale(.6);
	transition: opacity .15s, transform .15s;
}

.ape-auth__remember input:checked + .ape-auth__check {
	border-color: var(--theme, #3b82f6);
	background: var(--theme, #3b82f6);
}

.ape-auth__remember input:checked + .ape-auth__check .fa {
	opacity: 1;
	transform: scale(1);
}

.ape-auth__forgot {
	color: var(--seat, #999);
	text-decoration: none;
	transition: color .2s;
}

.ape-auth__forgot:hover {
	color: var(--theme, #3b82f6);
}

/* 沿用主题原版输入框：浅色底、圆角、聚焦描边 */
.ape-auth__input {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	padding: 0 12px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: var(--classB, #f6f7f9);
	color: var(--main, #222);
	font-size: 14px;
	line-height: 1.4;
	outline: none;
	box-shadow: none;
	-webkit-appearance: none;
	transition: border-color .2s, background-color .2s;
}

.ape-auth__input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 1000px var(--classB, #f6f7f9) inset;
	-webkit-text-fill-color: var(--main, #222);
}

.ape-auth__input:hover {
	border-color: var(--classA, #e8eaed);
}

.ape-auth__input:focus {
	border-color: var(--theme, #3b82f6);
	background: var(--background, #fff);
}

.ape-auth__input--pwd {
	padding-right: 42px;
}

.ape-auth__input--code {
	padding-right: 94px;
}

/* 浮动标签：聚焦或有内容时上移缩小 */
.ape-auth__float {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 14px;
	line-height: 1;
	color: var(--seat, #b6bac2);
	pointer-events: none;
	transition: top .18s ease, transform .18s ease, font-size .18s ease, color .18s ease;
}

.ape-auth__input:focus ~ .ape-auth__float,
.ape-auth__input.is-filled ~ .ape-auth__float {
	top: 5px;
	transform: none;
	font-size: 11px;
	color: var(--theme, #3b82f6);
}

.ape-auth__input.is-filled:not(:focus) ~ .ape-auth__float {
	color: var(--seat, #999);
}

.ape-auth__eye {
	position: absolute;
	top: 50%;
	right: 7px;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--seat, #a4a8af);
	font-size: 14px;
	cursor: pointer;
}

.ape-auth__eye:hover {
	color: var(--theme, #3b82f6);
}

.ape-auth__send {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--theme, #3b82f6);
	font-size: 13px;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity .2s;
}

.ape-auth__send:hover:not(:disabled) {
	opacity: .75;
}

.ape-auth__send:disabled {
	color: var(--seat, #b6bac2);
	cursor: not-allowed;
}

.ape-auth__gee {
	margin: 14px 0 4px;
}

.ape-auth__gee-box {
	min-height: 44px;
}

.ape-auth__gee-box > div {
	width: 100% !important;
}

.ape-auth__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	margin-top: 22px;
	border: 0;
	border-radius: 999px;
	background-color: var(--theme, #3b82f6);
	background-image: linear-gradient(90deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0));
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: .5px;
	cursor: pointer;
	transition: opacity .2s, filter .2s;
}

.ape-auth__submit i {
	font-size: 14px;
}

.ape-auth__submit:hover:not(:disabled) {
	filter: brightness(.94);
}

.ape-auth__submit:disabled {
	opacity: .7;
	cursor: not-allowed;
}

.ape-auth__terms {
	margin: 13px 0 0;
	text-align: center;
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--seat, #a4a8af);
}

.ape-auth__terms a {
	color: var(--theme, #3b82f6);
	text-decoration: none;
}

.ape-auth__terms a:hover {
	opacity: .8;
}

/* 夜间模式 */
.ape-auth__brand .dark {
	display: none;
}

html[data-night='night'] .ape-auth__brand .light {
	display: none;
}

html[data-night='night'] .ape-auth__brand .dark {
	display: block;
}

html[data-night='night'] .ape-auth__mask {
	background: rgba(0, 0, 0, .72);
}

html[data-night='night'] .ape-auth__panel {
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
}

html[data-night='night'] .ape-auth__main {
	box-shadow: 0 12px 40px -14px rgba(0, 0, 0, .55);
}

html[data-night='night'] .ape-auth__submit {
	box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6);
}

body.ape-auth-open {
	overflow: hidden;
}

/* 弹窗打开时保证提示消息位于最上层 */
.qmsg.qmsg-wrapper {
	z-index: 100010 !important;
}

@keyframes apeAuthFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes apeAuthUp {
	from { opacity: 0; transform: translateY(16px) scale(.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
	.ape-auth__panel {
		max-width: 420px;
		background: var(--background, #fff);
	}

	.ape-auth__media {
		display: none;
	}

	.ape-auth__main {
		width: 100%;
		max-width: 100%;
		margin: 0;
		border-radius: 10px;
		box-shadow: none;
	}
}

@media (max-width: 600px) {
	.ape-auth {
		padding: 16px;
	}

	.ape-auth__panel {
		max-width: 100%;
	}

	.ape-auth__main {
		max-height: calc(100vh - 32px);
	}

	.ape-auth__brand {
		padding: 22px 20px 0;
	}

	.ape-auth__brand img {
		max-height: 34px;
	}

	.ape-auth__head {
		padding: 18px 20px 0;
	}

	.ape-auth__head h3 {
		font-size: 23px;
	}

	.ape-auth__body {
		padding: 14px 20px 22px;
	}

	.ape-auth__input {
		height: 52px;
	}
}
