/* Write your custom CSS here */

/* 修复侧边栏导航菜单间距问题 */
.page-sidebar .accordion-menu li ul li a {
    padding: 8px 15px; /* 统一所有菜单项的上下内边距 */
    line-height: 1.5; /* 统一行高 */
    height: auto; /* 自动高度 */
}

/* 确保图标对齐和大小一致 */
.page-sidebar .accordion-menu li ul li a i.fas,
.page-sidebar .accordion-menu li ul li a i.far {
    font-size: 10px; /* 统一图标大小 */
    width: 14px; /* 统一图标宽度 */
    text-align: center; /* 居中对齐 */
    margin-right: 8px; /* 统一右侧间距 */
    vertical-align: middle; /* 垂直居中 */
    line-height: inherit; /* 继承父元素行高 */
}

/* 移除选中项可能的额外空间 */
.page-sidebar .accordion-menu li ul li a.active {
    font-weight: 500;
    color: #7888fc;
    padding: 8px 15px; /* 确保与非选中项保持一致 */
    line-height: 1.5; /* 统一行高 */
}

/* 品牌自动完成下拉菜单样式 */
.brand-option {
    transition: background-color 0.2s ease;
}

.brand-option:hover,
.brand-option.bg-light {
    background-color: #f8f9fa !important;
}

.brand-option:last-child {
    border-bottom: none !important;
}

#brandDropdown {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

#brandDropdown .brand-option {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
}

#brandDropdown .brand-option:hover {
    background-color: #e9ecef;
}

/* ========================================
   用户头像样式
   ======================================== */

/* 默认首字母头像基础样式 */
.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007bff;
    color: #ffffff;
    font-weight: 500;
    border-radius: 50%;
    text-align: center;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
    vertical-align: middle;
}

/* 小尺寸头像 (≤32px) */
.avatar-initial-sm {
    font-size: 14px;
}

/* 中尺寸头像 (33-50px) */
.avatar-initial-md {
    font-size: 18px;
}

/* 大尺寸头像 (>50px) */
.avatar-initial-lg {
    font-size: 24px;
}

/* 图片头像样式 */
.avatar-image {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* 备用头像（当图片加载失败时显示） */
.avatar-fallback {
    display: none;
}

/* 头像容器样式 */
.avatar-container {
    position: relative;
    display: inline-block;
}

/* 设置页面头像预览样式 */
.avatar-upload .avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.avatar-upload .avatar-preview img,
.avatar-upload .avatar-preview .avatar-initial {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload .avatar-preview .avatar-initial {
    font-size: 40px;
    border-radius: 0;
}

/* 用户列表头像样式 */
.user-avatar-container {
    align-items: center;
    width: 32px;
    height: 32px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .avatar-initial-lg {
        font-size: 20px;
    }
}

/* ========================================
   模块过滤按钮样式
   ======================================== */

/* 模块过滤按钮间距 */
#leftNav .module-filter-btn {
    margin-left: 8px;
    margin-right: 8px;
    padding-left: 12px;
    padding-right: 12px;
}

/* 模块过滤按钮激活状态 */
.module-filter-btn.active {
    color: #7888fc !important;
    font-weight: 500;
    position: relative;
}

.module-filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #7888fc;
}

/* 模块过滤按钮悬停效果 */
.module-filter-btn:hover {
    color: #7888fc !important;
    transition: color 0.2s ease;
}

/* 侧边栏菜单项过渡效果 - 从下往上弹出动画 */
.page-sidebar .accordion-menu li {
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    transform: translateY(0);
    opacity: 1;
    will-change: transform, opacity; /* 优化动画性能 */
}

/* 侧边栏菜单项隐藏状态 - 从下往上弹出动画 */
.page-sidebar .accordion-menu li.sidebar-item-hidden {
    opacity: 0;
    transform: translateY(20px); /* 从下往上弹出效果 */
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none; /* 禁用交互，替代 visibility: hidden */
}