/* 自定义样式 */

/**
 * 表格内容过长时自动省略，且小屏限制最大字数
 * 适用于所有 .table 表格
 */

.table td, .table th {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .table td, .table th {
    max-width: 120px;
  }
}

.table td, .table th {
  position: relative;
  cursor: pointer;
}
.table.no-hover td:hover, .table.no-hover th:hover {
  overflow: hidden !important;
  white-space: nowrap !important;
  background: inherit !important;
  z-index: auto !important;
}
.table td:hover, .table th:hover {
  overflow: visible;
  white-space: normal;
  background: #f8f9fa;
  z-index: 10;
}

.nav-treeview .nav-link {
  padding-left: 30px !important; /* AdminLTE默认缩进基础上增加 */
}

/**
 * 固定左侧菜单，防止跟随页面滚动
 */
.main-sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

/* 确保侧边栏在顶部导航栏下方 */
.main-sidebar {
  top: 57px; /* AdminLTE默认导航栏高度 */
  height: calc(100vh - 57px);
}

/* 调整主要内容区域的左边距，避免被固定菜单遮挡 */
.content-wrapper {
  margin-left: 250px; /* AdminLTE默认侧边栏宽度 */
}

/* 响应式设计：小屏幕时的处理 */
@media (max-width: 991.98px) {
  .sidebar-mini.sidebar-collapse .content-wrapper {
    margin-left: 0;
  }
  
  .sidebar-mini:not(.sidebar-collapse) .content-wrapper {
    margin-left: 250px;
  }
}

/* 当侧边栏收起时调整内容区域边距 */
.sidebar-mini.sidebar-collapse .content-wrapper {
  margin-left: 4.6rem; /* AdminLTE收起状态的侧边栏宽度 */
}

.sidebar-mini.sidebar-collapse .main-sidebar {
  width: 4.6rem;
}

/* 确保页脚也有正确的边距 */
.main-footer {
  margin-left: 250px;
}

.sidebar-mini.sidebar-collapse .main-footer {
  margin-left: 4.6rem;
}

/* 响应式：小屏幕时页脚边距 */
@media (max-width: 991.98px) {
  .sidebar-mini.sidebar-collapse .main-footer {
    margin-left: 0;
  }
  
  .sidebar-mini:not(.sidebar-collapse) .main-footer {
    margin-left: 250px;
  }
}


/* 在文件开头添加本地字体定义 */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/SourceSansPro-Light.otf') format('opentype');
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/SourceSansPro-Regular.otf') format('opentype');
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/SourceSansPro-Bold.otf') format('opentype');
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: italic;
  font-weight: 400;
  src: url('../fonts/SourceSansPro-It.otf') format('opentype');
}

.sidebar {
  height: 100vh;
  overflow-y: auto;
  position: relative;
}