/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #fff;
    color: #495057;
    line-height: 1.6;
}

/* 主页面布局 */
.main-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* 左侧目录样式 */
.sidebar {
    width: 25%;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px 0;
    overflow-y: auto;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 10;
}

.sidebar-header {
    padding: 0 20px 15px;
    border-bottom: 3px solid #165DFF;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    color: #165DFF;
    font-size: 1.3rem;
}

.nav-section {
    margin-bottom: 15px;
}

.nav-title {
    padding: 10px 25px;
    font-weight: bold;
    color: #333;
    background-color: #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title::after {
    content: '+';
    font-size: 1.2rem;
}

.nav-title.active::after {
    content: '-';
}

.nav-items {
    list-style: none;
    display: none;
}

.nav-items.show {
    display: block;
}

.nav-item a {
    display: block;
    padding: 8px 35px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item a:hover, .nav-item a.active {
    background-color: #d0e1ff;
    color: #165DFF;
}

/* 右侧内容容器 */
.content-wrapper {
    width: 75%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.content-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 子页面通用样式 */
.page-container {
    padding: 30px 50px;
}

.page-title {
    font-size: 1.8rem;
    color: #165DFF;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* 纯文字页面样式 */
.text-content {
    // max-width: 800px;
    margin: 0 auto;
}

.text-content p {
    margin-bottom: 15px;
    text-indent: 2em; /* 首行缩进 */
}

.text-highlight {
    color: #165DFF;
    font-weight: 600;
}

/* 图文混合页面样式 */
.mixed-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.mixed-text p {
    margin-bottom: 15px;
}

.mixed-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 纯图片排版页面样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.03);
}

/* 图片放大效果样式 */
.zoom-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.zoom-item {
    cursor: pointer;
}

.zoom-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

/* 图片放大模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.show {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* 响应式样式 */
@media (max-width: 992px) {
    .sidebar {
        width: 300px;
        position: absolute;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .content-wrapper {
        width: 100%;
    }
    .mixed-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 20px 15px;
    }
    .page-title {
        font-size: 1.5rem;
    }
    .image-gallery, .zoom-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .image-gallery, .zoom-gallery {
        grid-template-columns: 1fr;
    }
}

/* 响应式菜单按钮 */
.menu-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background-color: #165DFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    z-index: 20;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }
}

/* 主页面布局 - 强制横向排列 */
.main-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    /* 强制子元素不换行 */
    flex-wrap: nowrap;
}

/* 左侧目录样式 */
.sidebar {
    width: 25%;
    /* 固定宽度，不被压缩 */
    flex-shrink: 0;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px 0;
    overflow-y: auto;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 10;
}

/* 右侧内容容器 - 占满剩余宽度 */
.content-wrapper {
    width: 75%;
    /* 自动填充剩余空间 */
    flex-grow: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 确保iframe充满容器 */
.content-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* 消除可能的间隙 */
}

/* 响应式调整 - 大屏保持横向 */
@media (min-width: 993px) {
    .sidebar {
        transform: translateX(0) !important; /* 强制显示 */
    }
}

/* 小屏样式 */
@media (max-width: 992px) {
    .sidebar {
        width: 300px;
        position: absolute;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .content-wrapper {
        width: 100%;
    }
}

