
body {
    /* 防止水平滚动 */
    /* overflow-x: hidden;  */
}
/* 标题颜色渐变和对齐方式 */
h1 {
    color: #1a3ba8;
    margin-left: -6em;  /* 向左偏移，与正文对齐 */
    text-align: center;
}

h2 {
    color: #2C56DE;
    padding-left: 1.1rem;
}

h3 {
    color: #4371f5;
    padding-left: 1.5rem;
}

h4 {
    color: #6389f7;
    padding-left: 2rem;
}

h5 {
    color: #82a1f9;
    padding-left: 2.5rem;
}
/* 正文样式 */
p {
    text-indent: 1.5rem;    /* 首行缩进 */
    line-height: 1.6;       /* 行高 */
    margin: 1em 2em;        /* 上下间距1em，左右间距2em */
    max-width: 1400px;      /* 限制最大宽度 */
    padding-right: 2rem;    /* 右侧内边距 */
}



/* 注释文字样式 */
.note {
    text-indent: 0rem;
    margin: 0.6em 2em;
    line-height: 1.2;       /* 行高 */
    font-size: 0.9em;  /* 字体大小为正文的90% */
    color: #666;       /* 可选：使用稍浅的颜色 */
}
/* 普通表样式-三线表 */
.tb1 {
    border-collapse: collapse;
    /* 上下间距1em，左边距-2em抵消正文缩进，右边距0 */
    /* margin: 1em 1em 1em 4em;   */
    margin-top: 1em;
    margin-bottom: 1em;
    margin-right: auto;
    margin-left: auto;
     /* 自适应宽度 */
    /* width: auto;                   */
    max-width: 90%;             /* 防止溢出 */
    min-width: 50%;               /* 最小宽度 */
    /* 上下间距1em，左右自动居中 */
    /* margin: 1em auto;              */
    border-top: 2px solid #1a3ba8;    /* 顶部蓝色粗线 */
    border-bottom: 2px solid #1a3ba8; /* 底部蓝色粗线 */
    table-layout: fixed;          /* 添加固定表格布局 */
    /* 移除可能导致定位问题的属性 */
    position: static;         /* 移除relative定位 */
    left: auto;              /* 移除左偏移 */
    transform: none;         /* 移除变换 */
}

.tb1 thead {
    border-bottom: 1px solid #1a3ba8; /* 表头下方蓝色细线 */
}

.tb1 th {
    background-color: #839ad8;     /* 蓝色背景 */
    color: white;                  /* 白色文字 */
    padding: 12px 5px;           /* 增加内边距确保内容不会太挤 */
    text-align: center;           /* 表头文字居中 */
    white-space: normal;          /* normal允许文字换行；nowrap防止文字换行 */
    word-wrap: break-word;        /* 允许长单词换行 */
    overflow-wrap: break-word;    /* 确保所有内容都能换行 */
    min-width: 30px;   /* 设置最小宽度 */
    max-width: 150px;   /* 设置最大宽度 */
}

.tb1 td {
    padding: 12px 5px;           /* 单元格内边距 */
    border: none;                 /* 移除单元格边框 */
    text-align: center;           /* 单元格文字居中 */
    white-space: normal;          /* normal允许文字换行；nowrap防止文字换行 */
    word-wrap: break-word;        /* 允许长单词换行 */
    overflow-wrap: break-word;    /* 确保所有内容都能换行 */
    min-width: 30px;   /* 设置最小宽度 */
    max-width: 150px;   /* 设置最大宽度 */

}
.tb1 tr:hover {
    background-color: #f5f5f5;    /* 鼠标悬停效果 */
}

/* 移除小屏幕上的滚动条样式 */
@media screen and (max-width: 600px) {
    .tb1 {
        width: 95%;          /* 小屏幕上占据更多宽度 */
        min-width: auto;     /* 移除最小宽度限制 */
        margin: 1em auto;    /* 保持居中 */
    }
}


/* 侧边导航栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-top: 1rem;
    background-color: #8cb8e4;
    width: 200px;
}

/* 确保主内容区域不被固定导航栏遮挡 */
.main-content {
    margin-left: 200px; /* 与sidebar宽度相同 */
    padding: 2rem;
    width: calc(100% - 200px); /* 确保主内容区域不会超出视窗 */
}
    
/* 在小屏幕上调整样式 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.chart-container { margin: 20px 0; }
.nav-tree {
    padding-left: 0;
    border-left: none;
    /* border-left: 1px solid #dee2e6; */
}
.nav-item {
    transition: all 0.2s;
    cursor: pointer;
    width: 100%; /* 确保项目占满宽度 */
    margin: 0;
    padding: 0;
}
.nav-item:hover {
    background-color: rgba(0,0,0,0.05);
}
.nav-link {
    padding: 0.1rem 0.1rem;
    color: #333;
    text-decoration: none;
    white-space: normal; /* 允许文本换行 */
    word-wrap: break-word; /* 确保长单词也能换行 */
    line-height: 1.4; /* 优化行高 */
    display: block; /* 确保链接占满容器 */
}
/* 明确的层级缩进 */
.nav-link[data-level="1"] {
    padding-left: 0.5rem !important; /* 使用!important确保优先级 */
}

.nav-link[data-level="2"] {
    padding-left: 1.5rem !important;
}

.nav-link[data-level="3"] {
    padding-left: 2.5rem !important;
}

.nav-link.active {
    color: #2C56DE;
    font-weight: bold;
    background-color: rgba(0,123,255,0.1);
}
/* .nav-link::before {
    content: "# ";
    color: #6c757d;
    font-weight: 300;
} */

/* 图片导航按钮样式 */
.tab-contents-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 3px;
    transition: background-color 0.3s;
    z-index: 2;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* 轮播图片组样式 */
.tab-group-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center; /* 内部元素居中 */
}

.tab-buttons {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    justify-content: center; /* 按钮居中对齐 */
    flex-wrap: wrap; /* 按钮过多时自动换行 */
}

.tab-btn {
    padding: 5px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.tab-content {
    padding: 15px;
    display: flex; /* 使用flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

.preview-img {
    max-width: 100%;
    height: auto;
    margin: 0 auto; /* 图片本身也居中 */
    display: block; /* 消除图片底部间隙 */
}


/* 表格容器样式 */
.table-responsive {
    display: block;
    margin: 15px 0;
    max-height: 600px;  /* 限制表格最大高度 */
    overflow-y: auto;   /* 垂直滚动 */
    overflow-x: auto;   /* 水平滚动 */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 100%;        /* 确保容器占满父元素宽度 */
    -webkit-overflow-scrolling: touch;
}

/* 表格固定布局 */
.table-fixed {
    width: 100%;        /* 确保表格占满容器 */
    margin-bottom: 0;   /* 移除底部边距 */
}

/* 表格包装器 */
.datatable-wrapper {
    margin: 0 auto;
    width: 100%;        /* 占满容器宽度 */
    min-width: 800px;   /* 设置最小宽度，防止表格过度压缩 */
}
/* 单元格样式 */
.table-fixed td, 
.table-fixed th {
    min-width: 70px;   /* 设置最小宽度 */
    max-width: 180px;   /* 设置最大宽度 */
    padding: 8px;       /* 内边距 */
    vertical-align: top;/* 顶部对齐 */
    word-wrap: break-word; /* 允许长单词换行 */
    overflow-wrap: break-word; /* 确保所有内容都能换行 */
    white-space: normal;   /* 允许文本自动换行 */
}
/* 表格单元格内容样式 */
.table-fixed td {
    font-size: 14px;    /* 设置合适的字体大小 */
    line-height: 1.4;   /* 设置合适的行高 */
}
/* 表头样式 */
.table-fixed thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #dee2e6;
    white-space: normal; /* 允许表头文本换行 */
    word-wrap: break-word; /* 允许长单词换行 */
    overflow-wrap: break-word; /* 确保所有内容都能换行 */
}

/* 奇偶行样式 */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}
.table-bordered {
    border: 1px solid #dee2e6;
}
.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}
/* 鼠标悬停效果 */
.table-fixed tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

/* 表头样式 */
.table-fixed thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #dee2e6;
    white-space: normal; /* 允许表头文本换行 */
}

/* 表格信息样式 */
.table-info {
    padding: 8px;
    margin: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-size: 0.9rem;
    position: sticky;   /* 固定在顶部 */
    top: 0;
    z-index: 2;        /* 确保显示在表格之上 */
}
/* 美化滚动条 */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 确保tab-content容器不会溢出 */
.tab-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;   /* 防止内容溢出 */
}

/* 表格样式优化 */
.table {
    width: 100%;
    margin-bottom: 0;
    background-color: transparent;
}

.table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
}

/* 分页控件样式 */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin-left: 2px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
}



/* 目录结构 */
.directory-structure {
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    margin: 20px 0;
    background-color: #ddd;
}

/* 修改箭头颜色 */
.folder-toggle {
    cursor: pointer;
    margin-right: 5px;
    color: #6389f7; /* 使用与标题相同的蓝色 */
}

/* 可以添加悬停效果 */
.folder-toggle:hover {
    color: #1a3ba8; /* 悬停时颜色加深 */
}

.directory-header {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

.directory-header h2 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.directory-content {
    padding: 15px;
}

.file-tree {
    list-style-type: none;
    padding-left: 20px;
}

.directory {
    margin: 5px 0;
}
.directory-description {
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}
.file {
    margin: 5px 0;
    padding-left: 20px;
}

.folder-toggle {
    cursor: pointer;
    margin-right: 5px;
}

.folder-name {
    cursor: pointer;
    color: #6389f7;
}
.folder-name a {
    color: inherit;
    margin-right: 5px;
    text-decoration: none;
}
.folder-name:hover,
.folder-name a:hover {
    color: #1a3ba8;
    text-decoration: underline;
}

.nested {
    display: none;
}

.nested.active {
    display: block;
}

/* 添加文件链接的样式 */
.file a {
    text-decoration: none;
    color: #6389f7;
}

.file a:hover {
    text-decoration: underline;
    color: #1a3ba8;
}


/* lib目录的特殊样式 */
.lib-directory {
    opacity: 0.8; /* 略微降低透明度 */
}

.lib-directory .folder-toggle {
    visibility: hidden; /* 隐藏lib目录的展开箭头 */
    width: 1em; /* 保持间距 */
    display: inline-block;
}