/*!
 * modal-polish.css —— 全站弹窗（Xiuno $.alert / $.confirm）统一外观
 * 2026-11-27
 *
 * 背景：
 *   $.alert 生成的对话框（view/js/bootstrap-plugin.js）结构是
 *     .modal > .modal-dialog > .modal-content > .modal-header(.xn-alert-modal__titlewrap > .xn-alert-modal__icon + h4.modal-title) ...
 *   Bootstrap 5 迁移后这套 .xn-alert-modal__* 样式在前台由 mjjzz-modal.css 补过，
 *   但后台没有加载它，于是出现：
 *     1) “✓” 单独占一行，标题被挤到下面；
 *     2) 关闭按钮同时画了 Bootstrap 的 SVG ✕ 和节点里的文字 &times;，重影；
 *     3) 标题文字是 “提示：：”（lang 自带冒号 + 脚本又拼了一个）；
 *     4) 底部按钮退化成无边框的裸 .btn，深色下几乎看不清。
 *   本文件把这一层收口，前台/后台共用，颜色走 --mjj-* 令牌，深浅两套都成立。
 *   直角由 square.css 统一处理，这里不再写 border-radius。
 *
 * 加载：
 *   前台 plugin/jan/hook/header_meta_before.htm
 *   后台 plugin/jan/hook/admin_header_css_after.htm
 */

/* ---------- 1. 容器：令牌色 + 细边 + 柔和投影 ---------- */
html body .modal-content {
	border: 1px solid var(--mjj-border, #e9edf5);
	background-color: var(--mjj-surface, #fff);
	color: var(--mjj-text, #1f2937);
	box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}

/* ---------- 2. 头部：标题左、关闭右，单行 ---------- */
html body .modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 15px 18px;
	border-bottom: 1px solid var(--mjj-border, #e9edf5);
	background-color: transparent;
}

html body .modal-header .modal-title {
	flex: 0 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--mjj-text-strong, #111827);
	letter-spacing: .2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

html body .xn-alert-modal__titlewrap {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}

/* 原来的 “✓” 只是个装饰，且在错误/普通提示里语义不对，直接收掉 */
html body .xn-alert-modal__icon {
	display: none !important;
}

/* ---------- 3. 关闭按钮：去掉重影的 &times; ---------- */
html body .modal .btn-close {
	float: none;
	margin: 0 0 0 auto;
	padding: 6px;
	flex: 0 0 auto;
	opacity: .5;
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	transition: opacity .15s ease, background-color .15s ease;
}

html body .modal .btn-close > span {
	display: none !important;
}

html body .modal .btn-close:hover {
	opacity: 1;
	background-color: var(--mjj-surface-3, #f3f6fb);
}

html body .modal .btn-close:focus-visible {
	opacity: 1;
	outline: 0;
	box-shadow: 0 0 0 2px var(--mjj-brand, #1294d7);
}

/* 深色下 Bootstrap 的 ✕ 是深色 SVG，反白才看得见 */
html[data-theme="dark"] .modal .btn-close,
html[data-bs-theme="dark"] .modal .btn-close {
	filter: invert(1) brightness(1.9);
}

/* ---------- 4. 正文 ---------- */
html body .modal-body {
	padding: 16px 18px;
}

html body .xn-alert-modal__message {
	font-size: 14.5px;
	line-height: 1.8;
	color: var(--mjj-text, #1f2937);
	word-break: break-word;
}

/* ---------- 5. 底部与按钮 ---------- */
html body .modal-footer {
	padding: 12px 18px;
	gap: 10px;
	border-top: 1px solid var(--mjj-border, #e9edf5);
	background-color: transparent;
}

html body .xn-alert-modal__btn {
	min-width: 84px;
	height: 34px;
	padding: 0 18px;
	border: 1px solid var(--mjj-border, #e9edf5);
	background-color: var(--mjj-surface-2, #f8fafc);
	color: var(--mjj-text-strong, #111827);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 32px;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

html body .xn-alert-modal__btn:hover {
	border-color: var(--mjj-brand, #1294d7);
	background-color: var(--mjj-surface, #fff);
	color: var(--mjj-brand, #1294d7);
}

html body .xn-alert-modal__btn:active {
	background-color: var(--mjj-surface-3, #f3f6fb);
}

html body .xn-alert-modal__btn:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 2px var(--mjj-brand, #1294d7);
}

/* ---------- 6. $.confirm 的按钮与 $.alert 同规格 ---------- */
html body .xn-confirm-modal .modal-footer .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 84px;
	height: 34px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

html body .xn-confirm-modal .modal-footer .btn-primary {
	background-color: #0f7fb8 !important;
	background-image: none !important;
	border-color: #0f7fb8 !important;
	color: #fff !important;
}

html body .xn-confirm-modal .modal-footer .btn-primary:hover {
	background-color: #0c6fa2 !important;
	border-color: #0c6fa2 !important;
}

html body .xn-confirm-modal .modal-footer .btn-secondary,
html body .xn-confirm-modal .modal-footer .btn-light {
	background-color: var(--mjj-surface-2, #f8fafc) !important;
	background-image: none !important;
	border-color: var(--mjj-border, #e9edf5) !important;
	color: var(--mjj-text-strong, #111827) !important;
}

html body .xn-confirm-modal .modal-footer .btn-secondary:hover,
html body .xn-confirm-modal .modal-footer .btn-light:hover {
	border-color: var(--mjj-brand, #1294d7) !important;
	color: var(--mjj-brand, #1294d7) !important;
}

html[data-theme="dark"] .xn-confirm-modal .modal-footer .btn-primary,
html[data-bs-theme="dark"] .xn-confirm-modal .modal-footer .btn-primary {
	background-color: #1d6fb8 !important;
	border-color: #1d6fb8 !important;
	color: #fff !important;
}

html[data-theme="dark"] .xn-confirm-modal .modal-footer .btn-primary:hover,
html[data-bs-theme="dark"] .xn-confirm-modal .modal-footer .btn-primary:hover {
	background-color: #2580cc !important;
	border-color: #2580cc !important;
}

/* ---------- 7. 窄屏 ---------- */
@media (max-width: 575.98px) {
	html body .modal-header {
		padding: 13px 14px;
		gap: 8px;
	}
	html body .modal-header .modal-title {
		font-size: 15px;
	}
	html body .modal-body {
		padding: 14px;
	}
	html body .modal-footer {
		padding: 10px 14px;
	}
}
