/* 移动端侧边栏样式 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background-color: white;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 在大屏幕上使用默认布局 */
@media (min-width: 1024px) {
    .mobile-sidebar {
        position: static;
        width: 256px;
        height: auto;
        transform: translateX(0) !important;
        box-shadow: none;
    }
}

/* 侧边栏遮罩层样式 */
#sidebar-overlay {
    transition: opacity 0.3s ease-in-out;
}

/* 移动端侧边栏动画优化 */
.mobile-sidebar, #sidebar-overlay {
    will-change: transform, opacity;
}

/* 防止页面内容被固定定位的侧边栏遮挡 */
@media (max-width: 1023px) {
    body.overflow-hidden {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* 侧边栏头部样式 */
.mobile-sidebar > div:first-child {
    background-color: #f8f9fa;
}

/* 优化触摸目标大小 */
#close-sidebar-button {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 确保侧边栏内容不会被顶部导航栏遮挡 */
.mobile-sidebar nav {
    padding-top: 0;
}