/* ============================================================
 * 顶端导航（位于主导航上方的横向快捷入口条）
 * 整条横跨页面宽度，视觉上是「顶部快捷条」；字号刻意小于主导航，避免抢主菜单的视觉重心。
 * 桌面与移动端均显示；入口过多时横向滚动。
 * ============================================================ */
.es-topnav {
	background: #f8fafc;
	border-bottom: 1px solid #e7e9ef;
}

.es-topnav__inner {
	display: flex;
}

.es-topnav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.es-topnav__list::-webkit-scrollbar {
	display: none;
}

.es-topnav__item {
	flex: 0 0 auto;
}

.es-topnav__link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 11px;
	color: #475569;
	font-size: 12.5px;
	font-weight: 500;
	border-radius: 7px;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease;
}

.es-topnav__link:hover {
	background: #f1f5f9;
	color: #4338ca;
}

.es-topnav__item.is-active .es-topnav__link {
	color: #4338ca;
	background: color-mix(in srgb, #4338ca 10%, #fff);
}

.es-topnav__link .es-nav-icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

/* ============================================================
 * 导航项「小标识 / 角标」：文字右上角的小圆角胶囊
 * 后台导航项编辑器可自填文字（如 HOT / NEW / 最新 / Vip）+ 选配色。
 * 配色由 PHP 注入 --nb-bg（白名单色值），此处只管形状与排版。
 * ============================================================ */
.es-nav-badge {
	flex: 0 0 auto;
	display: inline-block;
	margin-left: 3px;
	padding: 0 4px;
	border-radius: 3px;
	background: var(--nb-bg, #2563eb);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .2px;
	white-space: nowrap;
	transform: translateY(-6px);
}

/* 底栏是「图标在上、文字在下」的竖排，角标改为贴在图标右上角 */
.es-botnav__link {
	position: relative;
}

.es-botnav .es-nav-badge {
	position: absolute;
	top: 2px;
	left: 50%;
	margin-left: 5px;
	transform: none;
}

/* ============================================================
 * 底部导航（移动端固定底栏 Tab）
 * 仅在 ≤767px 显示；桌面端隐藏。固定在视口底部，并预留安全间距。
 * ============================================================ */
.es-botnav {
	display: none;
}

@media (max-width: 767px) {
	.es-botnav {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 60;
		background: rgba(255, 255, 255, .96);
		-webkit-backdrop-filter: saturate(180%) blur(10px);
		backdrop-filter: saturate(180%) blur(10px);
		border-top: 1px solid #e7e9ef;
		box-shadow: 0 -6px 20px -16px rgba(15, 23, 42, .4);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.es-botnav__list {
		display: flex;
		width: 100%;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.es-botnav__item {
		flex: 1 1 0;
		min-width: 0;
	}

	.es-botnav__link {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 3px;
		padding: 7px 4px 8px;
		color: #64748b;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.2;
	}

	.es-botnav__link .es-nav-icon {
		width: 22px;
		height: 22px;
	}

	.es-botnav__item.is-active .es-botnav__link {
		color: #4338ca;
	}

	/* 给固定底栏预留安全间距，避免遮挡内容 / 页脚 */
	body.has-es-botnav {
		padding-bottom: calc(56px + env(safe-area-inset-bottom));
	}
}
