/**
 * Sidebar Component Styles
 * Fixed sidebar with responsive behavior
 */

/* 固定侧边栏样式 */
.fixed-sidebar {
  position: fixed;
  left: 20px;
  top: 120px; /* 调整这个值以适应你的header高度 */
  width: 250px;
  max-height: calc(100vh - 140px); /* 保证不会超出屏幕 */
  overflow-y: auto; /* 如果内容太多，允许滚动 */
  z-index: 1000;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* 响应式设计：在小屏幕上隐藏侧边栏 */
@media (max-width: 1200px) {
  .fixed-sidebar {
    display: none;
  }
  
  /* 在小屏幕上重置主内容的左边距 */
  .main-content-with-sidebar {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 当侧边栏存在时，调整主内容的左边距 */
@media (min-width: 1201px) {
  .main-content-with-sidebar {
    margin-left: 290px; /* 250px sidebar + 40px gap */
    width: calc(100% - 290px);
    max-width: calc(100% - 290px);
    padding-right: 30px; /* 确保右侧有留白 */
  }
  
  /* 当有侧边栏时，调整容器的左侧留白 */
  .main-content-with-sidebar .container-fluid,
  .main-content-with-sidebar .contents {
    padding-left: 20px;
  }
}

/* 侧边栏标题样式 */
.fixed-sidebar h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #00438F;
  border-bottom: 2px solid #00438F;
  padding-bottom: 8px;
}

/* 侧边栏链接样式 */
.fixed-sidebar a {
  display: block;
  padding: 10px 12px;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

/* 链接hover效果 */
.fixed-sidebar a:hover {
  background-color: #e9ecef;
  color: #00438F;
  border-left-color: #00438F;
  text-decoration: none;
}

/* 当前激活项样式 */
.fixed-sidebar a.active {
  background-color: #e3f2fd;
  color: #00438F;
  border-left-color: #00438F;
  font-weight: 500;
}

/* 兼容性：原有的 e-sidebar 类保留 */
.e-sidebar {
  margin-left: 30px;
  margin-right: 10px;
}

/* 侧边栏滚动条样式（可选美化） */
.fixed-sidebar::-webkit-scrollbar {
  width: 6px;
}

.fixed-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.fixed-sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.fixed-sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
