/* ===== Notanote 全局维护横幅 =====
   Nano 与 Main 共用这一份，由 static.notanote.cn 下发；alert.js 取数并插入 DOM。
   横幅固定在视口顶部，靠 --nt-alert-h（JS 实测高度写进 <html>）把各站已有的固定元素
   顶开。站点自己的固定元素归站点自己的 CSS 管 —— Nano home/user 那份在 home.css，
   这里是跨站通用的部分（body 流内下移 + Main 的顶栏/侧栏/整屏高度）。
   在站点样式之后加载，同权重时靠「后写胜出」。 */

#nt-alert {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	box-sizing: border-box;
	background: #cb3b30;
	color: #fff;
	font-size: 14px;
	line-height: 1.45;
	letter-spacing: 0.2px;
	text-align: left;
	box-shadow: 0 2px 10px rgba(80, 0, 0, 0.3);
}

#nt-alert .nt-alert-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	display: block;
}

#nt-alert .nt-alert-body {
	flex: 1 1 auto;
	min-width: 0;
}

#nt-alert .nt-alert-main {
	display: block;
	font-weight: 700;
}

#nt-alert .nt-alert-sub {
	display: block;
	margin-top: 1px;
	font-size: 13px;
	font-weight: 500;
	opacity: 0.9;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#nt-alert .nt-alert-meta {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 600;
	opacity: 0.85;
	white-space: nowrap;
}

@media (max-width: 640px) {
	#nt-alert {
		padding: 9px 14px;
		gap: 8px;
		font-size: 13px;
	}

	#nt-alert .nt-alert-sub {
		white-space: normal;
	}

	#nt-alert .nt-alert-meta {
		display: none;
	}
}

/* ---------- 让位 ---------- */

html.nt-alert-on {
	--nt-alert-h: 44px;
}

/* 流内内容整体下移（Main 文书页 / Main 首页 / Nano 整屏 grid 页） */
html.nt-alert-on body {
	padding-top: var(--nt-alert-h, 0px);
}

/* Nano：登录/注册/重置/授权的整屏 grid，height:100vh 必须减掉横幅高度才不会溢出 */
html.nt-alert-on .splitLayout {
	height: calc(100vh - var(--nt-alert-h, 0px));
	height: calc(100dvh - var(--nt-alert-h, 0px));
}

/* Nano：右上角滚动百分比指示器 */
html.nt-alert-on .scrollIndicator {
	top: calc(20px + var(--nt-alert-h, 0px));
}

/* Main 文书页：固定顶栏、固定侧栏、整屏高度 */
html.nt-alert-on .Header {
	top: var(--nt-alert-h, 0px);
}

html.nt-alert-on .Sidebar {
	top: calc(var(--header-height, 60px) + var(--nt-alert-h, 0px));
}

html.nt-alert-on .Layout {
	min-height: calc(100vh - var(--nt-alert-h, 0px));
}

/* Main 首页：左侧固定目录栏。桌面端才是「贴顶固定」，
   ≤1024px 它变成底部悬浮 Dock（top:auto / height:64px / bottom:1.5rem），
   高度由 mainpage.css 的移动端规则接管，不参与顶部让位；
   .nt-page-home 限定首页，避免命中 Nano admin 的同名 .sidebar。 */
@media (min-width: 1025px) {
	html.nt-alert-on.nt-page-home .sidebar {
		top: var(--nt-alert-h, 0px);
		height: calc(100vh - var(--nt-alert-h, 0px));
	}
}