/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation - With collapsible sections */
.sidebar {
    width: auto;
    background-color: #f5f5f5;
    border-right: 1px solid #ddd;
    padding: 25px 15px 25px 25px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-x: hidden;
    white-space: nowrap;
}

.sidebar-header {
    padding: 0 15px 15px 5px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2px;
}

.nav-section {
    margin-bottom: 8px; /* 从15px减小 */
}

.nav-header {
    display: flex;
    cursor: pointer;
    padding: 8px 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-header:hover {
    background-color: #e6e6e6;
}

.nav-header h2 {
    white-space: nowrap;
    padding-right: 15px;
    margin: 0; /* 移除默认外边距 */
    line-height: 1.3; /* 从默认1.6调整为1.3 */
    padding: 6px 0; /* 调整垂直内边距 */
}

.sidebar ul {
    list-style: none;
    margin-left: 5px;
    margin-top: 5px;
}
/* 导航标题样式 - 确保链接文本与原来一致 */

.nav-header h2 a {
    font-size: 1.25rem; /* 与原来相同的字体大小 */
    font-weight: 600;   /* 与原来相同的字重 */
    color: inherit;     /* 继承父元素颜色 */
    display: block;     /* 使链接填充整个区域 */
    width: 100%;        /* 确保宽度一致 */
    padding: 2px 2px;   /* 与原来相同的内边距 */
    white-space: nowrap; /* 防止文字换行 */
}

/* 移除链接的下划线效果（虽然已经内联设置，但CSS中再确保一次） */
.nav-header h2 a {
    text-decoration: none !important;
}

/* 导航标题链接样式 */
.nav-header-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 确保其他导航项样式一致 */
.nav-section {
    margin-bottom: 15px;
}

.sidebar li {
    margin-bottom: 6px;
}

.sidebar a {
    display: block;
    padding: 3px 10px;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar a:hover {
    background-color: #e6e6e6;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 25px 40px;
/*    max-width: 900px;*/
}

.content-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 18px;
    margin-bottom: 25px;
}

.content-header h1 {
    font-size: 1.85rem;
    color: #222;
    font-weight: 500;
}

.version-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

/* Content Sections */
h2 {
    font-size: 1.2rem;
    margin: 10px 0 18px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 7px;
}

h3 {
    font-size: 1.3rem;
    margin: 22px 0 12px;
    color: #444;
}

p {
    margin-bottom: 18px;
    font-size: 1.05rem;
    line-height: 1.7;
    white-space: normal; /* 确保自动换行 */
    word-wrap: break-word; /* 允许长单词换行 */
    overflow-wrap: break-word; /* 更现代的属性 */
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 25px;
}

.breadcrumb {
    font-size: 0.95rem;
    color: #666;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}
.collapsible li {
    margin-bottom: 4px; /* 从6px减小 */
}

.collapsible a {
    padding: 4px 10px; /* 从6px减小 */
    line-height: 1.4; /* 微调行高 */
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px 15px;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .main-content {
        padding: 20px;
    }
}
/* 图片容器样式 */
.content-image {
    margin: 25px 0;
    text-align: center;
    border: 1px solid #eee;
    padding: 2px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* 图片本身样式 */
.content-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 图片说明文字 */
.image-caption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* 文件浏览器容器 */
.file-browser {
    margin: 20px 0;
    width: 100%;
}

/* 横向滚动容器 */
.table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-left: -15px;
    padding-left: 15px;
    margin-right: -40px;
    padding-right: 40px;
}

/* 表格样式 */
.file-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    table-layout: auto;
}

.file-table th {
    background-color: #f5f5f5;
    white-space: nowrap;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
}

.file-table td {
    padding: 10px 15px;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

/* 名称列 */
.col-name {
    white-space: nowrap;
}

/* 描述列 */
.col-desc {
    white-space: normal;
    max-width: 300px;
    overflow: visible;
}

/* 大小列 */
.col-size {
    text-align: left;
    font-family: monospace;
    white-space: nowrap;
}

/* 修改时间列 */
.col-modified {
    white-space: nowrap;
}

/* 目录行样式 */
.file-table tr.directory {
    background-color: #f9f9f9;
}

.file-table tr.directory td {
    font-weight: 500;
}

.file-table tr:hover {
    background-color: #f0f0f0;
}

/* 错误提示 */
.error {
    color: #d32f2f;
    padding: 15px;
    background-color: #ffebee;
    border-radius: 4px;
}

/* 主内容区防止挤压侧边栏 */
.main-content {
    flex: 1;
    padding: 25px 40px;
    min-width: 0;
    overflow: hidden;
}

/* 下载按钮样式 */
.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2c974b; /* GitHub绿色 */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: 1px solid rgba(27, 31, 36, 0.15);
}

.download-btn:hover {
    background-color: #2a8f47; /* 稍深的绿色 */
    color: white;
}

.download-btn i {
    margin-right: 8px;
}
