* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#toggle-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.main-container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

#sidebar {
    width: 280px;
    background: #f5f6fa;
    border-right: 1px solid #ddd;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
    transition: left 0.3s ease;
}

#sidebar.collapsed {
    left: -280px;
}

.month-section {
    margin: 10px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.month-title {
    padding: 12px 15px;
    background: #3498db;
    color: white;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-title::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
}

.month-title.collapsed::after {
    transform: rotate(-90deg);
}

.month-links {
    padding: 10px;
    display: block;
}

.month-title.collapsed + .month-links {
    display: none;
}

.month-links a {
    display: block;
    padding: 8px 12px;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    margin: 2px 0;
    transition: background-color 0.2s;
}

.month-links a:hover {
    background: #ecf0f1;
}

.month-links a.active {
    background: #3498db;
    color: white;
}

#content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    transition: margin-left 0.3s ease;

}

#content.full-width {
    margin-left: 0;
}

@media (max-width: 768px) {
    #sidebar {
        left: -280px;
    }

    #content {
        margin-left: 0;
    }

    #sidebar.expanded {
        left: 0;
    }
}

.year-section {
    margin: 15px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.year-title {
    padding: 15px;
    background: #2c3e50;
    color: white;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-title::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
}

.year-title.collapsed::after {
    transform: rotate(-90deg);
}

.year-content {
    display: block;
    padding: 5px;
}

.year-title.collapsed + .year-content {
    display: none;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
}

.search-container {
    position: relative;
    margin-right: 20px;
    -webkit-tap-highlight-color: transparent;
}

#search-icon {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.search-box {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1001;
}

.search-box.active {
    display: block;
}

#search-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    outline: none;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #eee;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
}

.search-result-item:hover {
    background-color: #f5f6fa;
}

/* 新闻内容样式 */
.news-content {
    line-height: 1.8;
}

.news-content h1 {
    text-align: center;
    margin-bottom: 20px;
}

.news-content h2 {
    margin: 20px 0;
    padding-left: 10px;
    border-left: 4px solid #3498db;
}

.news-content h3 {
    color: #666;
    margin: 15px 0;
}

.news-content p {
    text-indent: 2em;
    margin-bottom: 1em;
}

/* 目录样式 */
#toc {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

#toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

#toc-content {
    display: block;
}

#toc-content.collapsed {
    display: none;
}

#toc-toggle {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 16px;
}

#toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#toc li {
    margin: 5px 0;
}

#toc a {
    color: #2c3e50;
    text-decoration: none;
    display: block;
    padding: 3px 0;
}

#toc a:hover {
    color: #3498db;
}

#toc .toc-h2 {
    padding-left: 20px;
}

#toc .toc-h3 {
    padding-left: 40px;
    color: #666;
}