/* ========== YunYoo Navigation Refactor ========== */

/* --- 隐藏原有侧边栏系统 --- */
.vertical-menu { display: none !important; }
#vertical-menu-btn { display: none !important; }
body.vertical-collpsed .main-content { margin-left: 0 !important; }

/* --- 主内容区重置 --- */
.yn-main-content {
	margin-left: 0 !important;
	margin-top: 60px;
}

/* --- 合并导航栏 --- */
.yn-navbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #fff;
	border-bottom: 1px solid #f0f0f0;
	z-index: 1002;
	display: flex;
	align-items: center;
}

.yn-navbar-inner {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 100%;
	height: 100%;
	padding: 0 24px;
}

/* Logo */
.yn-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	width: 140px;
}
.yn-logo img {
	height: 28px;
	width: auto;
}

/* --- 桌面端横向菜单 --- */
.yn-nav-menu {
	display: flex;
	align-items: center;
	flex: 1;
	height: 100%;
	overflow: visible;
	gap: 4px;
	justify-content: center;
}

.yn-nav-item {
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 2px;
}

/* 下拉菜单 hover 触发区域修复 - 用 padding-bottom 扩展触发区 */
.yn-has-dropdown {
	padding-bottom: 0;
}

.yn-nav-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 14px;
	height: 36px;
	color: #333;
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
	border-radius: 6px;
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}
.yn-nav-link:hover {
	background: var(--bs-global-2, #F5FAFE);
	color: var(--bs-global, #5BB5D5);
	text-decoration: none;
}
.yn-nav-link i:first-child {
	font-size: 16px;
	color: #888;
}
.yn-nav-link:hover i:first-child {
	color: var(--bs-global, #5BB5D5);
}
.yn-arrow {
	font-size: 14px !important;
	transition: transform 0.2s;
}

/* --- 下拉菜单 --- */
.yn-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 180px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
	z-index: 1003;
}
.yn-dropdown-right {
	left: auto;
	right: 0;
}
.yn-has-dropdown:hover > .yn-dropdown,
.yn-has-dropdown.yn-open > .yn-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.yn-has-dropdown:hover > .yn-nav-link .yn-arrow,
.yn-has-dropdown:hover > .yn-action-btn .mdi-chevron-down {
	transform: rotate(180deg);
}
.yn-dropdown-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 16px;
	color: #555;
	font-size: 13px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.yn-dropdown-item:hover {
	background: var(--bs-global-2, #F5FAFE);
	color: var(--bs-global, #5BB5D5);
	text-decoration: none;
}
.yn-dropdown-item i {
	font-size: 17px;
	width: 22px;
	text-align: center;
	color: #999;
}
.yn-dropdown-item:hover i {
	color: var(--bs-global, #5BB5D5);
}
.yn-dropdown-item img {
	border-radius: 2px;
}
.yn-dropdown-divider {
	height: 1px;
	background: #f0f0f0;
	margin: 4px 0;
}

/* --- 右侧功能区 --- */
.yn-nav-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	width: 140px;
	justify-content: flex-end;
}

.yn-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	background: none;
	color: #555;
	font-size: 20px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	position: relative;
	text-decoration: none;
}
.yn-action-btn:hover {
	background: #f5f5f5;
	color: var(--bs-global, #5BB5D5);
	text-decoration: none;
}

.yn-badge {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: #e74c3c;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.yn-bell-active {
	animation: yn-ring 2s ease infinite;
}
@keyframes yn-ring {
	0%, 100% { transform: rotate(0); }
	5%, 15% { transform: rotate(8deg); }
	10%, 20% { transform: rotate(-8deg); }
	25% { transform: rotate(0); }
}

/* 用户按钮 */
.yn-user-btn {
	width: auto;
	padding: 4px 8px;
	gap: 6px;
}
.yn-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}
.yn-username {
	font-size: 13px;
	color: #333;
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 登录/注册链接 */
.yn-login-link {
	font-size: 13px;
	color: #333;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 6px;
}
.yn-login-link:hover {
	background: #f5f5f5;
	text-decoration: none;
	color: #333;
}
.yn-register-link {
	font-size: 13px;
	color: #fff;
	text-decoration: none;
	padding: 6px 16px;
	border-radius: 6px;
	background: var(--bs-global, #5BB5D5);
}
.yn-register-link:hover {
	background: var(--bs-btn-hover-bg, #4A9DBD);
	text-decoration: none;
	color: #fff;
}

.yn-logout {
	color: #e74c3c !important;
}
.yn-logout:hover {
	background: #fef2f2 !important;
}

/* ========== 移动端 FAB + 抽屉 ========== */

/* FAB 按钮 */
.yn-fab {
	display: none; /* 桌面端隐藏 */
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #fff;
	color: #333;
	border: none;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	font-size: 24px;
	cursor: pointer;
	z-index: 1004;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s, box-shadow 0.2s;
}
.yn-fab:active {
	transform: scale(0.92);
}

/* 遮罩 */
.yn-drawer-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.3);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 1005;
	opacity: 0;
	transition: opacity 0.25s;
}
.yn-drawer-overlay.yn-active {
	opacity: 1;
}

/* 抽屉 */
.yn-drawer {
	display: none;
	position: fixed;
	top: 0;
	right: -300px;
	width: 300px;
	height: 100%;
	background: #fff;
	z-index: 1006;
	transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.yn-drawer.yn-active {
	right: 0;
}

.yn-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #f0f0f0;
}
.yn-drawer-logo img {
	height: 24px;
	width: auto;
}
.yn-drawer-title {
	font-size: 15px;
	font-weight: 500;
	color: #333;
}
.yn-drawer-close {
	width: 32px;
	height: 32px;
	border: none;
	background: #f5f5f5;
	border-radius: 50%;
	font-size: 18px;
	color: #666;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}
.yn-drawer-close:hover {
	background: #eee;
}

.yn-drawer-body {
	padding: 12px 0;
}

/* 用户信息 */
.yn-drawer-user {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px 16px;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 8px;
}
.yn-drawer-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
}
.yn-drawer-username {
	font-size: 14px;
	font-weight: 500;
	color: #333;
}
.yn-drawer-email {
	font-size: 12px;
	color: #999;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 200px;
}

/* 菜单分组 */
.yn-drawer-group {
	margin-bottom: 2px;
}
.yn-drawer-group-title {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	cursor: pointer;
	transition: background 0.15s;
	user-select: none;
	text-decoration: none;
	border-left: 3px solid transparent;
}
.yn-drawer-group-title:hover {
	background: #f9f9f9;
	text-decoration: none;
	color: #333;
}
.yn-drawer-group-title i:first-child {
	font-size: 18px;
	width: 22px;
	text-align: center;
	color: #888;
}
.yn-drawer-arrow {
	margin-left: auto;
	font-size: 18px !important;
	color: #bbb;
	transition: transform 0.2s;
	width: auto !important;
}
.yn-drawer-group.yn-open .yn-drawer-arrow {
	transform: rotate(180deg);
}

/* 子菜单 */
.yn-drawer-submenu {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}
.yn-drawer-group.yn-open .yn-drawer-submenu {
	max-height: 500px;
}

.yn-drawer-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 20px 9px 52px;
	font-size: 13px;
	color: #666;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.yn-drawer-link:hover {
	background: var(--bs-global-2, #F5FAFE);
	color: var(--bs-global, #5BB5D5);
	text-decoration: none;
}
.yn-drawer-link i {
	font-size: 16px;
	width: 20px;
	text-align: center;
}
.yn-drawer-link-single {
	font-weight: 400;
}

/* 无子菜单的直接链接不缩进 */
a.yn-drawer-link-single + .yn-drawer-submenu { display: none; }

.yn-drawer-divider {
	height: 1px;
	background: #f0f0f0;
	margin: 8px 20px;
}

/* 当前页面高亮 - 底部线条风格，不用背景色 */
.yn-nav-link.yn-active {
	color: var(--bs-global, #5BB5D5);
	position: relative;
}
.yn-nav-link.yn-active::after {
	content: '';
	position: absolute;
	bottom: -12px;
	left: 50%;
	transform: translateX(-50%);
	width: 60%;
	height: 2px;
	background: var(--bs-global, #5BB5D5);
	border-radius: 1px;
}
.yn-nav-link.yn-active i {
	color: var(--bs-global, #5BB5D5);
}
.yn-drawer-link.yn-active {
	background: var(--bs-global-2, #F5FAFE);
	color: var(--bs-global, #5BB5D5);
	font-weight: 500;
	border-left: 3px solid var(--bs-global, #5BB5D5);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
	/* 隐藏桌面端菜单 */
	.yn-nav-menu { display: none; }
	.yn-username { display: none; }

	/* 显示 FAB */
	.yn-fab { display: flex; }

	/* 显示抽屉相关 */
	.yn-drawer { display: block; }

	/* 导航栏简化 */
	.yn-navbar { height: 52px; }
	.yn-navbar-inner { padding: 0 12px; }
	.yn-logo { margin-right: 0; }
	.yn-logo img { height: 24px; }
	.yn-main-content { margin-top: 52px; }

	/* 隐藏部分右侧按钮，保留关键的 */
	.yn-nav-actions .yn-has-dropdown:first-child { display: none; } /* 语言切换 */
}

@media (max-width: 480px) {
	.yn-navbar-inner { padding: 0 8px; }
	.yn-nav-actions { gap: 0; }
}

/* ========== 隐藏原有 topbar ========== */
#page-topbar { display: none !important; }
.navbar-brand-box { display: none !important; }

/* ========== 页面内容适配 ========== */
.page-content {
	padding: 20px 0 0;
}

/* footer 适配 */
.footer {
	left: 0 !important;
}
