/*
 * 苦力怕论坛 升级维护 —— 公告横幅 + 整站关闭页
 * 新 PC 模板下取 klp.css 的变量（跟着夜间模式走），旧模板、手机模板、关站页没有这些变量，落到后面的浅色默认值
 */
.klp-maint {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 2147483000;
	box-sizing: border-box;
	width: 400px;
	max-width: calc(100% - 24px);
	transform: translateX(-50%);
	padding: 12px 14px 10px;
	border: 1px solid var(--line, #e5e7eb);
	border-radius: var(--r-md, 10px);
	background: var(--surface, #fff);
	color: var(--text, #1f2328);
	box-shadow: var(--shadow-pop, 0 8px 28px rgba(15, 23, 42, .16));
	font: 13px/1.5 var(--font, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
	text-align: left;
}
.klp-maint * {
	box-sizing: border-box;
}
.klp-maint-h {
	display: flex;
	align-items: center;
	gap: 8px;
}
.klp-maint-dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--warn, #d97706);
	animation: klp-maint-pulse 1.6s ease-in-out infinite;
}
.klp-maint-t {
	font-size: 14px;
	font-weight: 600;
}
.klp-maint-num {
	color: var(--text-2, #57606a);
	font-family: var(--mono, ui-monospace, Consolas, monospace);
}
.klp-maint-time {
	margin-left: auto;
	color: var(--text-2, #57606a);
	white-space: nowrap;
}
.klp-maint-cd {
	color: var(--text, #1f2328);
	font-family: var(--mono, ui-monospace, Consolas, monospace);
	font-weight: 600;
}
.klp-maint-min {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0 -4px 0 0;
	padding: 0;
	border: 0;
	border-radius: var(--r-sm, 8px);
	background: transparent;
	color: var(--text-3, #8c959f);
	cursor: pointer;
	font: 16px/22px sans-serif;
}
.klp-maint-min:before {
	content: "\2013";
}
.klp-maint-min:hover {
	background: var(--hover, #f3f4f6);
	color: var(--text, #1f2328);
}
.klp-maint-min:focus-visible {
	outline: 0;
	box-shadow: var(--ring, 0 0 0 3px rgba(97, 202, 184, .45));
}
.klp-maint-bar {
	height: 6px;
	margin-top: 10px;
	overflow: hidden;
	border-radius: 3px;
	background: var(--hover, #eef0f2);
}
.klp-maint-bar i {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--brand, #61CAB8);
	transition: width .8s ease;
}
.klp-maint-note {
	margin: 8px 0 0;
	color: var(--text-3, #8c959f);
	font-size: 12px;
}

/* 收起：只剩一行 */
.klp-maint.is-min {
	width: auto;
	padding: 6px 10px;
	border-radius: 999px;
}
.klp-maint.is-min .klp-maint-bar,
.klp-maint.is-min .klp-maint-note,
.klp-maint.is-min .klp-maint-time {
	display: none;
}
.klp-maint.is-min .klp-maint-t {
	font-size: 13px;
}
.klp-maint.is-min .klp-maint-min:before {
	content: "+";
}

.klp-maint.is-done .klp-maint-dot {
	background: var(--ok, #1a7f37);
	animation: none;
}
.klp-maint.is-done .klp-maint-min,
.klp-maint.is-done .klp-maint-note,
.klp-maint.is-done .klp-maint-num {
	display: none;
}

@keyframes klp-maint-pulse {
	50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
	.klp-maint-dot { animation: none; }
	.klp-maint-bar i { transition: none; }
}
/* 手机：让开底部导航栏 */
@media (max-width: 640px) {
	.klp-maint {
		bottom: calc(86px + env(safe-area-inset-bottom, 0px));
	}
}

/* 关站页里的进度块：不浮动、不能收起 */
.klp-maint.is-page {
	position: static;
	width: 100%;
	max-width: none;
	margin: 22px 0 0;
	transform: none;
	box-shadow: none;
}
.klp-maint.is-page .klp-maint-t,
.klp-maint.is-page .klp-maint-note,
.klp-maint.is-page .klp-maint-min,
.klp-maint.is-page .klp-maint-dot {
	display: none;
}
/* 关站页标题、说明已经在卡片里，进度块只剩剩余时间（和进度），居中 */
.klp-maint.is-page .klp-maint-h {
	justify-content: center;
}
.klp-maint.is-page .klp-maint-time {
	margin-left: 0;
}
/* 既没进度也没倒计时：整块不显示 */
.klp-maint.is-page.is-empty {
	display: none;
}

/* 整站关闭页（独立页面，没有 klp.css） */
body.klp-maint-closed {
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f5f3;
	color: #1f2328;
	font: 15px/1.7 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.klp-maint-page {
	box-sizing: border-box;
	width: 460px;
	max-width: calc(100% - 32px);
	padding: 36px 32px 28px;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	background: #fff;
	text-align: center;
}
.klp-maint-page h1 {
	margin: 14px 0 8px;
	font-size: 22px;
}
.klp-maint-page p {
	margin: 0;
	color: #57606a;
}
.klp-maint-logo {
	border-radius: 12px;
}
.klp-maint-login {
	display: inline-block;
	margin-top: 22px;
	color: #8c959f;
	font-size: 12px;
	text-decoration: none;
}
.klp-maint-login:hover {
	color: #1f2328;
}
@media (prefers-color-scheme: dark) {
	body.klp-maint-closed { background: #111413; color: #e6e8e7; }
	.klp-maint-page { background: #1b1f1e; border-color: #2c3230; }
	.klp-maint-page p { color: #a3aaa7; }
	body.klp-maint-closed .klp-maint { --surface: #1b1f1e; --line: #2c3230; --text: #e6e8e7; --text-2: #a3aaa7; --hover: #262b29; }
}
