/* 基础样式 */
body {
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    background-color: #f8f9fa;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-x: hidden;
    overflow-y: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 123, 255, 0.5) rgba(0, 0, 0, 0.1);
}

/* 调整侧边栏宽度和主内容区域 (大屏幕) */
@media (min-width: 768px) {
    .sidebar {
        width: 240px !important;
    }
    
    main.col-md-10, main.col-lg-10 {
        margin-left: 240px !important;
        width: calc(100% - 240px) !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
}

/* 自定义滚动条样式 - WebKit 浏览器 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 123, 255, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 123, 255, 0.7);
}

/* 折叠菜单样式 - 确保子菜单也能滚动 */
.sidebar .collapse {
    overflow: hidden;
    transition: height 0.3s ease;
}

.sidebar .collapse.show {
    overflow: visible;
}

.sidebar .nav-sm {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 123, 255, 0.3) rgba(0, 0, 0, 0.05);
}

.sidebar .nav-sm::-webkit-scrollbar {
    width: 4px;
}

.sidebar .nav-sm::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar .nav-sm::-webkit-scrollbar-thumb {
    background-color: rgba(0, 123, 255, 0.3);
    border-radius: 2px;
}

.sidebar .nav-sm::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 123, 255, 0.5);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
}

.sidebar .nav-link .feather {
    margin-right: 4px;
    color: #727272;
}

.sidebar .nav-link.active {
    color: #007bff;
}

.sidebar .nav-link:hover .feather,
.sidebar .nav-link.active .feather {
    color: inherit;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* 增强复选框可视性 - 解决未勾选状态不明显的问题 */
.form-check-input {
    border: 1px solid #adb5bd; /* 加深边框颜色 */
    background-color: #fff; /* 默认白色背景 */
}

/* 针对权限设置页面的复选框增强 */
.module-card .form-check-input {
    border-color: #6c757d; /* 更深的边框 */
    background-color: #f8f9fa; /* 浅灰背景 */
}

.module-card .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 鼠标悬停效果 */
.form-check-input:hover {
    border-color: #0d6efd;
}

/* 表格滚动优化 */
.table-scrollable-container {
    max-height: 600px;
    overflow-y: auto;
    border-bottom: 1px solid #dee2e6;
}

.table-scrollable-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa; /* 与页面背景或表格头背景一致 */
    z-index: 1;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}
