/* 全局样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 页眉样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    color: white;
    text-decoration: none;
}

/* 主要内容容器 */
.main-container {
    display: flex;
    flex: 1;
    max-width: 1200px;
    margin: 20px auto;
    width: 100%;
}

/* 左侧树状菜单 */
.sidebar {
    width: 250px;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    border-radius: 5px;
    margin-right: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.tree-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree-menu li {
    margin-bottom: 5px;
}

.tree-menu a {
    display: block;
    padding: 8px 10px;
    color: #34495e;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.tree-menu a:hover {
    background-color: #f5f5f5;
    border-left: 3px solid #3498db;
}

.tree-menu a.active {
    background-color: #ebf5fb;
    border-left: 3px solid #3498db;
    color: #2980b9;
    font-weight: bold;
}

.tree-menu ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    display: none;
}

.tree-menu li.active > ul {
    display: block;
}

.tree-menu .has-children > a:after {
    content: "▾";
    float: right;
    transition: transform 0.3s;
}

.tree-menu .has-children.active > a:after {
    transform: rotate(180deg);
}

/* 右侧内容区域 */
.content {
    flex: 1;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    border-radius: 5px;
    padding: 30px;
}

h1 {
    font-size: 2.2em;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.update-date {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.5em;
    color: #34495e;
    margin: 30px 0 15px;
    padding-top: 10px;
    scroll-margin-top: 80px; /* 为锚点链接提供偏移 */
}

p, li {
    margin: 15px 0;
}

ul {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: #2c3e50;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
    margin-top: 50px;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-section h3 {
    color: #ecf0f1;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    margin-top: 20px;
    color: #bdc3c7;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container, .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .main-container {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        position: static;
    }
    
    .content {
        padding: 20px;
    }
    
    .footer-section {
        margin-bottom: 30px;
        text-align: center;
    }
    
    h2 {
        scroll-margin-top: 20px;
    }
}