/* Dashboard 样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
}

.dashboard-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.navbar {
    height: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
    background-color: #343a40;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    height: calc(100vh - 40px);
    margin-top: 40px;
}

/* 左侧导航栏 */
.sidebar {
    width: 180px;
/*    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #4e73df, #224abe);
    color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1020;
}

.sidebar-header {
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar .nav {
    padding: 0.01rem 0;
}

.sidebar .nav-item {
    margin: 0.25rem 0;
}
.sidebar .menu-toggle {
    width: 180px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-style: normal;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left-color: rgba(255,255,255,0.5);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.15);
/*    border-left-color: white;*/
/*    border-left-color: rgba(255,255,255,0.5);*/
    border-left-color: white;
    font-weight: 500;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    overflow: hidden;
}

/* 标签页导航 */
.tab-navigation {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 30px;
}

.tab-navigation .nav-tabs {
    border-bottom: none;
    padding: 0 1rem;
    margin: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-navigation .nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.tab-navigation .nav-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tab-navigation .nav-tabs::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.tab-navigation .nav-tabs::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.tab-navigation .nav-link {
    border: none;
    border-radius: 0;
    padding: 0.25rem 1rem;
    color: #6c757d;
    background-color: transparent;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 120px;
    max-width: 200px;
}

.tab-navigation .nav-link:hover {
/*    color: #495057;*/
/*    background-color: #f8f9fa;*/
/*    border-color: transparent;*/
    background-color: #e2e3e5;
}

.tab-navigation .nav-link.active {
    color: #0d6efd;
    background-color: white;
    border-color: transparent;
    border-bottom: 0px solid #0d6efd;
    font-weight: 500;
}

.tab-navigation .nav-link .tab-title {
    flex: 1;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.tab-navigation .nav-link .tab-close {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tab-navigation .nav-link .tab-close:hover {
    background-color: #e9ecef;
    color: #dc3545;
}

.tab-navigation .nav-link.active .tab-close {
    color: #0d6efd;
}

.tab-navigation .nav-link.active .tab-close:hover {
    color: #dc3545;
}

/* 标签页内容 */
.tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-pane {
    height: 100%;
    overflow: hidden;
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -180px;
        top: 60px;
        height: calc(100vh - 60px);
        transition: left 0.3s ease;
        z-index: 1040;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content-area {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block !important;
    }
}

.mobile-toggle {
    display: none;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* 标签页动画 */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 16px;
    margin-right: 0.5rem;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
    padding: 2rem;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    margin-bottom: 0;
    font-size: 1rem;
} 



.nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
  transition: transform 0.2s;
}

.nav-link[data-bs-toggle="collapse"].collapsed .bi-chevron-down {
  transform: rotate(-90deg);
}

/* 二级菜单样式 */
.btn-toggle-nav a {
  display: block;
  padding: 0.25rem 1.5rem;
  color: #495057;
  text-decoration: none;
  border-radius: 0.25rem;
}

.btn-toggle-nav a:hover,
.btn-toggle-nav a:focus {
  background-color: #e9ecef;
  color: #0d6efd;
}

.btn-toggle-nav a.nav-link.ps-4 {
  padding-left: 2.25rem !important;
}



/*********************/
/* Tab 容器基础样式 */
#mainTabs {
  display: flex;
  overflow-x: auto;
  background-color: #f8f9fa; /* 可选：给 tab 区域加底色 */
  border-bottom: 1px solid #dee2e6;
  padding: 0 8px;
}

/* 所有 Tab 项 */
#mainTabs .nav-link.tab-link {
  display: flex;
  align-items: center;
  padding: 3px 12px;
/*  border-radius: 6px 6px 0 0;*/
/*  margin: 0 2px;*/
  margin: 0 4px;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  color: #495057;
  background-color: #e9ecef; /* 非激活态：浅灰背景 */
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* 激活态 Tab：整体高亮 */
#mainTabs .nav-link.tab-link.active {
  background-color: #ffffff; /* 白色高亮背景 */
  color: #0d6efd;            /* 主题蓝色文字 */
  border: 1px solid #dee2e6;
  border-bottom: 1px solid #ffffff; /* 覆盖底部边框，与内容区融合 */
  font-weight: 600;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

/* 鼠标悬停效果（可选） */
#mainTabs .nav-link.tab-link:hover {
  background-color: #dde0e3;
}

#mainTabs .nav-link.tab-link.active:hover {
  background-color: #ffffff;
}

/* 关闭按钮样式 */
.tab-close {
  margin-left: 8px;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: #6c757d;
  cursor: pointer;
  padding: 2px;
  border-radius: 2px;
}

.tab-close:hover {
  background-color: #ced4da;
  color: #343a40;
}



/* 默认情况下显示侧边栏 */
.sidebar {
    width: 180px;
    transition: width 0.3s ease;
}

/* 当侧边栏被收起时应用的样式 */
.sidebar.collapsed {
    width: 60px; /* 或者其他你希望的宽度 */
}

/* 如果需要，调整侧边栏内元素的样式 */
.sidebar.collapsed .sidebar-header h5,
.sidebar.collapsed .nav-link span {
    display: none; /* 隐藏文字 */
}