/**
 * Zhimiao Login Skin - 风格三：极光霓虹（炫酷）
 * 深空极光流动背景、玻璃拟态卡片、霓虹渐变发光按钮。
 * 作用域：body.zls-on（前台弹窗）+ body.login（wp-login）。
 * 兼容：不用 :has()/:is()；backdrop-filter 由 @supports 回退；
 *       动画尊重 prefers-reduced-motion。
 */

/* ---------- 变量 ---------- */
body.zls-on,
body.login {
	--zls-primary: #22d3ee;
	--zls-primary-hover: #67e8f9;
	--zls-on-primary: #061021;
	--zls-bg: #0a0118;
	--zls-card: rgba(17, 12, 40, .72);
	--zls-card-radius: 20px;
	--zls-shadow: 0 0 0 1px rgba(124, 58, 237, .45), 0 0 32px rgba(124, 58, 237, .35), 0 24px 70px rgba(0, 0, 0, .6);
	--zls-text: #eef2ff;
	--zls-text-sub: #9aa3c0;
	--zls-line: rgba(124, 58, 237, .35);
	--zls-input-bg: rgba(255, 255, 255, .06);
	--zls-input-border: rgba(124, 58, 237, .5);
	--zls-input-radius: 12px;
	--zls-input-ring: 0 0 0 3px rgba(34, 211, 238, .25), 0 0 18px rgba(34, 211, 238, .35);
	--zls-btn-radius: 14px;
	--zls-mask: rgba(6, 2, 20, .82);
	--zls-link: #67e8f9;
}

/* ======================================================================
   一、前台 B2 登录弹窗
   ====================================================================== */

/* 遮罩层：深空底色 + 两团流动极光 */
body.zls-on .modal,
body.zls-on .user-Modal,
body.zls-on .b2-modal {
	background:
		radial-gradient(560px 420px at 18% 22%, rgba(34, 211, 238, .28), transparent 65%),
		radial-gradient(640px 480px at 82% 78%, rgba(168, 85, 247, .32), transparent 65%),
		radial-gradient(420px 360px at 70% 12%, rgba(236, 72, 153, .16), transparent 60%),
		var(--zls-mask) !important;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: zls-aurora-shift 14s ease-in-out infinite alternate;
}

@keyframes zls-aurora-shift {
	0%   { background-position: 0% 0%, 100% 100%, 50% 0%, 0 0; }
	100% { background-position: 12% 10%, 86% 88%, 42% 8%, 0 0; }
}

/* 玻璃卡片：半透明 + 霓虹描边光晕 */
body.zls-on .modal .login-box-content,
body.zls-on .login-form {
	background: var(--zls-card) !important;
	border-radius: var(--zls-card-radius) !important;
	box-shadow: var(--zls-shadow) !important;
	border: 0 !important;
	overflow: hidden;
	color: var(--zls-text);
	-webkit-backdrop-filter: blur(18px) saturate(1.3);
	backdrop-filter: blur(18px) saturate(1.3);
}

/* 卡片顶部霓虹扫光 */
body.zls-on .modal .login-box-content::before,
body.zls-on .login-form::before {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, #22d3ee, #7c3aed, #ec4899, #22d3ee);
	background-size: 300% 100%;
	animation: zls-neon-slide 6s linear infinite;
}

@keyframes zls-neon-slide {
	0%   { background-position: 0% 50%; }
	100% { background-position: 300% 50%; }
}

body.zls-on .login-box-top {
	background: transparent !important;
	border-bottom: 1px solid var(--zls-line);
}

body.zls-on .login-logo {
	color: var(--zls-text) !important;
	letter-spacing: 2px;
	text-shadow: 0 0 18px rgba(34, 211, 238, .8), 0 0 40px rgba(124, 58, 237, .6);
}

body.zls-on .login-title b,
body.zls-on .login-box-title {
	color: var(--zls-text);
}

body.zls-on .login-box-des {
	color: var(--zls-text-sub);
}

/* 上方 label */
body.zls-on .login-form-item span {
	position: static !important;
	order: -1;
	flex: 0 0 100%;
	padding: 0 2px 5px;
	line-height: 1.2;
	font-size: 13px;
	color: var(--zls-text-sub);
}

/* ---------- 输入框：暗色玻璃 + 霓虹聚焦 ---------- */
body.zls-on .modal .box input[type="text"],
body.zls-on .modal .box input[type="password"],
body.zls-on .modal .box input[type="tel"],
body.zls-on .modal .box input[type="email"],
body.zls-on .modal .box input[type="number"],
body.zls-on .modal .box input[type="search"],
body.zls-on .modal .box input[type="url"] {
	background: var(--zls-input-bg) !important;
	border: 1px solid var(--zls-input-border) !important;
	border-radius: var(--zls-input-radius) !important;
	color: var(--zls-text) !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	caret-color: #22d3ee;
	transition: border-color .18s, box-shadow .18s, background .18s;
	min-height: 44px;
}

body.zls-on .modal .box input:focus {
	outline: none !important;
	border-color: var(--zls-primary) !important;
	box-shadow: var(--zls-input-ring) !important;
}

body.zls-on .modal .box input::placeholder,
body.zls-on .login-form-item input::placeholder {
	color: var(--zls-text-sub);
	opacity: .75;
}

/* ---------- 主按钮：霓虹渐变 + 流光 + 发光 ---------- */
body.zls-on .modal .box button,
body.zls-on .login-box-content button,
body.zls-on .login-form-item button {
	background: linear-gradient(90deg, #06b6d4, #7c3aed, #ec4899, #06b6d4) !important;
	background-size: 300% 100% !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: var(--zls-btn-radius) !important;
	min-height: 44px;
	font-weight: 700;
	letter-spacing: 1px;
	box-shadow: 0 0 22px rgba(124, 58, 237, .55), 0 6px 18px rgba(0, 0, 0, .35) !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
	transition: background-position .4s, transform .15s, box-shadow .18s;
	animation: zls-neon-slide 5s linear infinite;
}

body.zls-on .modal .box button:hover,
body.zls-on .login-box-content button:hover,
body.zls-on .login-form-item button:hover {
	background-position: 150% 50% !important;
	transform: translateY(-2px);
	box-shadow: 0 0 34px rgba(34, 211, 238, .7), 0 8px 22px rgba(0, 0, 0, .4) !important;
}

/* ---------- 链接 / 关闭按钮 ---------- */
body.zls-on .modal .box a,
body.zls-on .login-form a {
	color: var(--zls-link);
}

body.zls-on .close-button {
	color: var(--zls-text-sub);
}

body.zls-on .close-button:hover {
	color: var(--zls-primary);
}

/* ======================================================================
   二、wp-login.php 后台登录页
   ====================================================================== */

/* 深空底 + 流动极光（铺满整屏的伪元素层） */
body.login {
	background: var(--zls-bg) !important;
	position: relative;
}

body.login::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(700px 520px at 20% 25%, rgba(34, 211, 238, .22), transparent 65%),
		radial-gradient(760px 560px at 80% 75%, rgba(168, 85, 247, .26), transparent 65%),
		radial-gradient(460px 380px at 72% 10%, rgba(236, 72, 153, .14), transparent 60%);
	animation: zls-aurora-shift 14s ease-in-out infinite alternate;
}

body.login #login {
	position: relative;
	z-index: 1;
}

body.login #login h1 a {
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='60' viewBox='0 0 240 60'%3E%3Cpath d='M10 14 L26 46 M26 14 L10 46 M8 30 L28 30' stroke='%2322d3ee' stroke-width='4.5' stroke-linecap='round' fill='none'/%3E%3Ctext x='42' y='39' font-family='-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif' font-size='24' font-weight='700' fill='%2367e8f9'%3E%E6%B1%81%E5%96%B5%E7%A4%BE%E5%8C%BA%3C/text%3E%3C/svg%3E") !important;
	filter: drop-shadow(0 0 10px rgba(34, 211, 238, .9)) drop-shadow(0 0 22px rgba(124, 58, 237, .7));
}

/* 玻璃卡片 */
body.login #loginform {
	background: var(--zls-card) !important;
	border: 0 !important;
	border-radius: var(--zls-card-radius) !important;
	box-shadow: var(--zls-shadow) !important;
	padding: 26px 24px 28px !important;
	overflow: hidden;
	-webkit-backdrop-filter: blur(18px) saturate(1.3);
	backdrop-filter: blur(18px) saturate(1.3);
}

/* 卡片顶部霓虹扫光 */
body.login #loginform::before {
	content: "";
	display: block;
	margin: -26px -24px 18px;
	height: 3px;
	background: linear-gradient(90deg, #22d3ee, #7c3aed, #ec4899, #22d3ee);
	background-size: 300% 100%;
	animation: zls-neon-slide 6s linear infinite;
}

body.login #loginform label {
	color: var(--zls-text-sub);
	font-size: 13px;
	margin-bottom: 4px;
}

body.login #loginform input[type="text"],
body.login #loginform input[type="password"],
body.login #loginform input[type="email"],
body.login #loginform input[type="tel"],
body.login #loginform input[type="number"],
body.login #loginform input[type="search"],
body.login #loginform input[type="url"] {
	background: var(--zls-input-bg) !important;
	border: 1px solid var(--zls-input-border) !important;
	border-radius: var(--zls-input-radius) !important;
	color: var(--zls-text) !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	caret-color: #22d3ee;
	transition: border-color .18s, box-shadow .18s;
}

body.login #loginform input[type="text"]:focus,
body.login #loginform input[type="password"]:focus,
body.login #loginform input[type="email"]:focus {
	outline: none !important;
	border-color: var(--zls-primary) !important;
	box-shadow: var(--zls-input-ring) !important;
}

body.login #loginform input:not([type="checkbox"]) {
	min-height: 42px;
	font-size: 16px;
	margin-top: 4px;
}

/* 提交按钮：霓虹渐变流光 */
body.login #loginform .wp-submit,
body.login #loginform #wp-submit {
	background: linear-gradient(90deg, #06b6d4, #7c3aed, #ec4899, #06b6d4) !important;
	background-size: 300% 100% !important;
	border: 0 !important;
	border-radius: var(--zls-btn-radius) !important;
	min-height: 44px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #ffffff !important;
	box-shadow: 0 0 22px rgba(124, 58, 237, .55), 0 6px 18px rgba(0, 0, 0, .35) !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
	transition: background-position .4s, transform .15s, box-shadow .18s;
	animation: zls-neon-slide 5s linear infinite;
}

body.login #loginform .wp-submit,
body.login #loginform #wp-submit:hover {
	background-position: 150% 50% !important;
	transform: translateY(-2px);
	box-shadow: 0 0 34px rgba(34, 211, 238, .7), 0 8px 22px rgba(0, 0, 0, .4) !important;
}

/* 底部链接 */
body.login #nav a,
body.login #backtoblog a {
	color: var(--zls-text-sub) !important;
	text-decoration: none;
	transition: color .15s;
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
	color: var(--zls-link) !important;
}

/* 语言切换器在深色下的可读性 */
body.login .language-switcher label {
	color: var(--zls-text-sub);
}

/* ======================================================================
   三、响应式与降级
   ====================================================================== */

@media screen and (max-width: 768px) {
	body.zls-on .modal .login-box-content {
		width: calc(100vw - 28px) !important;
		max-width: calc(100vw - 28px) !important;
		border-radius: 16px !important;
	}

	body.zls-on .modal .box input {
		font-size: 16px;
	}

	body.login #login {
		padding: 24px 0;
		width: calc(100% - 40px);
	}

	body.login #loginform {
		padding: 22px 18px 24px !important;
	}

	body.login #loginform::before {
		margin: -22px -18px 16px;
	}
}

/* 不支持 backdrop-filter 时：提高卡片不透明度保证可读 */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	body.zls-on .modal .login-box-content,
	body.login #loginform {
		background: rgba(19, 14, 46, .96) !important;
	}
}

/* 用户偏好减弱动效：停止所有动画 */
@media (prefers-reduced-motion: reduce) {
	body.zls-on .modal,
	body.zls-on .modal .login-box-content::before,
	body.zls-on .login-form::before,
	body.zls-on .modal .box button,
	body.zls-on .login-box-content button,
	body.zls-on .login-form-item button,
	body.login::before,
	body.login #loginform::before,
	body.login #loginform .wp-submit,
body.login #loginform #wp-submit {
		animation: none !important;
	}
}
