/**
 * Zhimiao Login Skin - 公共骨架
 * 所有规则挂 body.zls-on（前台弹窗）或 body.login（wp-login）命名空间。
 * 只覆盖"皮肤属性"（颜色/圆角/阴影/背景/间距），不 reset 主题结构属性。
 * 兼容：不使用 :has() / :is() / dvh；backdrop-filter 由各风格文件自行 @supports 回退。
 */

body.zls-on {
	/* ---------- 变量默认值（各风格文件覆盖） ---------- */
	--zls-primary: #0099ff;
	--zls-primary-hover: #0084e8;
	--zls-on-primary: #ffffff;
	--zls-bg: #f4f6fb;
	--zls-card: #ffffff;
	--zls-card-radius: 16px;
	--zls-shadow: 0 12px 40px rgba(31, 41, 55, .14);
	--zls-text: #1f2937;
	--zls-text-sub: #6b7280;
	--zls-line: #e5e7eb;
	--zls-input-bg: #f2f4f7;
	--zls-input-border: transparent;
	--zls-input-radius: 12px;
	--zls-input-ring: 0 0 0 3px rgba(0, 153, 255, .18);
	--zls-btn-radius: 999px;
	--zls-mask: rgba(15, 23, 42, .45);
	--zls-link: var(--zls-primary);
}

/* ======================================================================
   一、前台 B2 登录/注册弹窗（Vue 模态框）
   ====================================================================== */

/* 遮罩层：B2 的弹窗根容器（modal / user-Modal 通用遮罩） */
body.zls-on .modal,
body.zls-on .user-Modal,
body.zls-on .b2-modal {
	background: var(--zls-mask) !important;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* 登录卡片本体（B2 实际结构：.modal > .modal-content.login-box-content） */
body.zls-on .modal .login-box-content,
body.zls-on .login-form,
body.zls-on .user-Modal .box {
	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);
}

/* 卡片头部（Logo / 欢迎语区） */
body.zls-on .login-box-top {
	background: transparent !important;
	border-bottom: 1px solid var(--zls-line);
}

/* B2 浮动 label 叠在输入框上边缘，改为普通"上方 label"避免与
   输入框背景交界产生穿字线 */
/* B2 用 span::after 画 3px 白条给浮动 label 遮边框，皮肤下必须隐藏 */
body.zls-on .login-form-item span::after {
	display: none !important;
}

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 .login-form-item .login-box-des {
	flex: 0 0 100%;
}

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

body.zls-on .login-logo {
	color: var(--zls-text);
	letter-spacing: 2px;
}

/* ---------- 输入框（B2 弹窗输入框直接挂在 form 下） ---------- */
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"],
body.zls-on .login-form-item {
	position: relative;
}

body.zls-on .login-form-item input[type="text"],
body.zls-on .login-form-item input[type="password"],
body.zls-on .login-form-item input[type="tel"],
body.zls-on .login-form-item input[type="email"],
body.zls-on .login-form-item input[type="number"],
body.zls-on .login-form-item input[type="search"],
body.zls-on .login-form-item 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;
	transition: border-color .18s, box-shadow .18s, background .18s;
	min-height: 44px;
}

body.zls-on .modal .box input:focus,
body.zls-on .login-form-item 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: .7;
}

/* ---------- 主按钮 ---------- */
body.zls-on .login-form-item button,
body.zls-on .login-form .login-btn,
body.zls-on .login-box-content button {
	background: var(--zls-primary) !important;
	color: var(--zls-on-primary) !important;
	border: 0 !important;
	border-radius: var(--zls-btn-radius) !important;
	min-height: 44px;
	font-weight: 600;
	letter-spacing: .5px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	transition: background .18s, transform .15s, box-shadow .18s;
}

body.zls-on .login-form-item button:hover,
body.zls-on .login-form .login-btn:hover,
body.zls-on .login-box-content button:hover {
	background: var(--zls-primary-hover) !important;
	transform: translateY(-1px);
}

body.zls-on .login-form-item button:active {
	transform: translateY(0);
}

/* ---------- 选项卡 / 链接 / 复选 ---------- */
body.zls-on .login-form a,
body.zls-on .login-box-des a {
	color: var(--zls-link);
}

body.zls-on .login-check-input input[type="checkbox"],
body.zls-on .login-check input[type="checkbox"] {
	accent-color: var(--zls-primary);
}

/* ---------- 关闭按钮 ---------- */
body.zls-on .close-button,
body.zls-on .login-form .close,
body.zls-on .modal .user-Modal-close {
	color: var(--zls-text-sub);
}

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

body.login {
	--zls-primary: #0099ff;
	--zls-primary-hover: #0084e8;
	--zls-bg: #f4f6fb;
	--zls-card: #ffffff;
	--zls-card-radius: 16px;
	--zls-shadow: 0 12px 40px rgba(31, 41, 55, .14);
	--zls-text: #1f2937;
	--zls-text-sub: #6b7280;
	--zls-line: #e5e7eb;
	--zls-input-bg: #f2f4f7;
	--zls-input-radius: 12px;
	--zls-input-ring: 0 0 0 3px rgba(0, 153, 255, .18);
	--zls-btn-radius: 999px;
}

/* 页面背景（风格文件会覆盖背景渐变） */
body.login {
	background: var(--zls-bg);
}

/* Logo：默认 WP logo 替换为站点名文字（各风格文件给 SVG） */
body.login #login h1 a {
	background-size: contain !important;
	background-position: center bottom !important;
	width: 100%;
	max-width: 240px;
	height: 60px;
	margin-bottom: 18px;
}

/* 登录卡片 */
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;
}

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"],
body.login #loginform input[type="checkbox"] {
	background: var(--zls-input-bg) !important;
	border: 1px solid transparent !important;
	border-radius: var(--zls-input-radius) !important;
	color: var(--zls-text) !important;
	box-shadow: none !important;
	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; /* ≥16px 防 iOS 聚焦放大 */
	margin-top: 4px;
}

/* 提交按钮 */
body.login #loginform .wp-submit,
body.login #loginform #wp-submit {
	background: var(--zls-primary) !important;
	border: 0 !important;
	border-radius: var(--zls-btn-radius) !important;
	min-height: 44px;
	font-weight: 600;
	letter-spacing: 1px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	text-shadow: none !important;
	transition: background .18s, transform .15s;
}

body.login #loginform .wp-submit,
body.login #loginform #wp-submit:hover {
	background: var(--zls-primary-hover) !important;
	transform: translateY(-1px);
}

/* 底部导航链接 */
body.login #nav,
body.login #backtoblog {
	text-align: center;
}

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-primary) !important;
}

/* 语言切换器 */
body.login .language-switcher label {
	color: var(--zls-text-sub);
}

/* 错误 / 提示 notice */
body.login .notice,
body.login #login_error,
body.login .message {
	border-radius: 12px !important;
	box-shadow: none !important;
}

/* ======================================================================
   三、响应式
   ====================================================================== */

/* 平板与窄桌面 */
@media screen and (min-width: 769px) and (max-width: 1200px) {
	body.zls-on .modal .login-box-content {
		max-width: 92vw;
	}
}

/* 手机 */
@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: 14px !important;
	}

	body.zls-on .login-form-item input {
		font-size: 16px; /* 防 iOS 聚焦自动放大 */
	}

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

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