/* 侧边栏基础样式 - 通过CSS变量控制颜色 */
.admin-sidebar {
    color: #1f2937 !important;
}
.nav-link {
    color: #1f2937 !important;
}
.nav-section-title {
    color: #6b7280 !important;
}

/* 优化导航样式 */
.nav-section {
    margin-bottom: 8px; /* 分组间距更紧凑 */
}

.nav-section-title {
    padding: 6px 16px; /* 标题内边距更小 */
    font-size: 14px !important; /* 标题字号稍小 */
    font-weight: 700; /* 加粗标题 */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff !important; /* 标题颜色 - 改为白色 */
    background-color: #0B3868 !important; /* 背景颜色 */
    margin-bottom: 4px; /* 上下间距更紧凑 */
    margin-top: 4px;
    border-radius: 6px; /* 圆角 */
    margin-left: 12px; /* 左边距 */
    margin-right: 12px; /* 右边距 */
    display: flex;
    align-items: center;
}

.nav-section-title:hover {
    color: #ffffff !important; /* 悬停时保持白色 */
    background-color: #0a2d5a !important; /* 悬停时背景稍深 */
}

.nav-item {
    margin: 1px 10px; /* 左右间距略收窄 */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px; /* 进一步减小内边距，更紧凑 */
    color: #1f2937 !important;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px; /* 一级、二级菜单字体稍微放大一点 */
    position: relative;
    line-height: 1.2; /* 更紧凑的行高 */
}

.nav-link small {
    display: block;
    font-size: 10px; /* 副标题同步放大一点，提升可读性 */
    color: #6b7280;
    margin-top: 1px; /* 减少间距 */
    line-height: 1.2;
}

.nav-link.active {
    background-color: #01847E !important;
    color: #ffffff !important;
}

.nav-link.active small {
    color: #ffffff !important;
}

/* 侧边栏导航 */
.sidebar-nav {
    padding: 8px 0;
    padding-bottom: 80px; /* 为底部菜单留出空间，整体更紧凑 */
}

/* ==================== 系统切换小副标题链接（侧边栏Logo下方） ==================== */
.sidebar-subtitle-link {
    display: none; /* 默认隐藏，避免被 sidebar-header 固定高度裁剪 */
}

/* 在侧边栏导航区域展示（由模板放置在 .sidebar-nav 顶部时生效） */
.sidebar-nav .sidebar-subtitle-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 10px 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #0B3868;
    background: rgba(11, 56, 104, 0.08);
    border: 1px dashed rgba(11, 56, 104, 0.25);
    text-decoration: none;
}

.sidebar-nav .sidebar-subtitle-link:hover {
    background: rgba(11, 56, 104, 0.12);
    border-color: rgba(11, 56, 104, 0.35);
    text-decoration: none;
    color: #0B3868;
}

.sidebar-nav .sidebar-subtitle-link i {
    font-size: 14px;
}

/* 侧边栏底部菜单 */
.sidebar-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 260px;
    height: auto;
    background: #e9ecef;
    border-top: 1px solid #ced4da;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
}

.sidebar-footer .nav-item {
    margin: 0;
}

.sidebar-footer .nav-link {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.sidebar-footer .nav-link:hover {
    background: #dee2e6;
}

/* 用户菜单样式 */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.user-menu:hover {
    background-color: #f0f0f0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0d6efd;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* 系统消息通知样式 */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 8px;
}

.notification-bell:hover {
    background-color: #f0f0f0;
}

.notification-bell i {
    font-size: 18px;
    color: #0d6efd;
}

/* 未读消息徽章 */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* 闪烁动画 */
@keyframes pulse-bell {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.notification-bell.has-unread {
    animation: pulse-bell 1.5s ease-in-out infinite;
}

/* 消息列表模态框样式 */
.message-list-modal {
    max-width: 500px;
}

.message-item {
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #ddd;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.message-item.unread {
    background-color: #e3f2fd;
    border-left-color: #2196F3;
}

.message-item.read {
    background-color: #f5f5f5;
    border-left-color: #999;
}

.message-item:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    cursor: pointer;
}

.message-title:hover {
    color: #2196F3;
    text-decoration: underline;
}

.message-content {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.4;
    cursor: pointer;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
}

.message-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-status-badge.unread {
    background-color: #ff5252;
    color: white;
}

.message-status-badge.unread:hover {
    background-color: #ff1744;
}

.message-status-badge.read {
    background-color: #4caf50;
    color: white;
}

.message-full-content {
    background-color: #fafafa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
}

.message-full-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.empty-message {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-message i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ==================== 一级菜单手风琴折叠 ==================== */

/* 一级菜单内容默认折叠（覆盖 admin-dashboard.css 的 display:block 默认行为） */
.nav-section-content {
    display: none !important;
    padding-left: 4px;
}

/* 展开状态：显示内容 */
.nav-section.is-expanded > .nav-section-content {
    display: block !important;
}

/* 一级标题右侧小箭头样式 */
.nav-section-title .section-chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* 展开状态：箭头旋转 180 度 */
.nav-section.is-expanded .nav-section-title .section-chevron {
    transform: rotate(180deg);
}

/* 三级菜单 nav-submenu 样式微调 */
.nav-submenu {
    display: none;
    padding-left: 20px;
    background-color: rgba(0,0,0,0.02);
}

.nav-submenu.show {
    display: block;
}
