* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 确保body不会溢出 */
    overflow-x: hidden;
    width: 100%;
}

.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    flex: 1;
    align-items: flex-start;
    /* 添加最小高度防止布局塌陷 */
    min-height: 1px;
    /* 确保容器不会溢出 */
    width: 100%;
}

.content-area {
    flex: 1;
    min-width: 0; /* 防止flex项目溢出 */
    min-height: 0;
    /* 确保内容区域不会溢出 */
    width: 100%;
}

.sidebar {
    width: 300px;
    flex-shrink: 0; /* 防止侧边栏被压缩 */
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.page-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a2980;
    position: relative;
    /* 确保标题不会溢出 */
    width: 100%;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background: linear-gradient(to bottom, #8e2de2, red);
    border-radius: 2px;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
    color: #1a2980;
    margin-left: 15px;
    /* 确保标题文本不会溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-list {
    list-style: none;
    /* 确保列表不会溢出 */
    width: 100%;
}

.news-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    /* 确保新闻项不会溢出 */
    width: 100%;
}

.news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 3px;
    background: linear-gradient(to bottom, #8e2de2, red);
    border-radius: 1.5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.news-item:hover::before {
    opacity: 1;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.news-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    margin-left: 5px;
    /* 确保标题文本不会溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-title a {
    color: #1a2980;
    text-decoration: none;
    transition: color 0.3s;
    /* 确保链接文本不会溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-title a:hover {
    color: red;
    text-decoration: none;
}

.news-meta {
    color: red;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 900;
    margin-left: 5px;
}

.news-excerpt {
    color: #444;
    font-size: 15px;
    line-height: 1.6;
    margin-left: 5px;
    /* 确保摘要文本不会溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.no-news {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* 确保无新闻提示不会溢出 */
    width: 100%;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a2980;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.index-data-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.index-data-item:last-child {
    border-bottom: none;
}

.index-name {
    font-weight: bold;
}

.index-value {
    color: #666;
}

.load-more-container {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    clear: both;
    /* 确保加载更多容器不会溢出 */
    width: 100%;
}

.load-more-btn {
    padding: 12px 24px;
    background: linear-gradient(to right, #8e2de2, red);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

.breadcrumb {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    /* 确保面包屑不会溢出 */
    width: 100%;
}

.breadcrumb a {
    color: #1a2980;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 修复响应式布局 */
@media (max-width: 768px) {
    body {
        /* 确保移动端body不会溢出 */
        overflow-x: hidden;
        width: 100%;
    }
    
    .main-container {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
        width: 100%;
        max-width: 100%;
        /* 确保移动端容器不会溢出 */
        box-sizing: border-box;
    }

    .sidebar {
        width: 100%;
        order: 2;
        position: static;
        margin-top: 20px;
        /* 确保移动端侧边栏不会溢出 */
        box-sizing: border-box;
    }

    .content-area {
        order: 1;
        width: 100%;
        /* 确保移动端内容区域不会溢出 */
        box-sizing: border-box;
    }

    .page-title {
        font-size: 20px;
        /* 确保移动端标题不会溢出 */
        padding: 0 10px;
    }

    .news-title {
        font-size: 16px;
    }
    
    /* 确保新闻列表项在小屏幕上正常显示 */
    .news-item {
        padding: 12px;
        margin-bottom: 12px;
        /* 确保移动端新闻项不会溢出 */
        box-sizing: border-box;
    }
    
    /* 确保面包屑在移动端正常显示 */
    .breadcrumb {
        padding: 0 10px;
        font-size: 13px;
    }
    
    /* 确保加载更多按钮在移动端正常显示 */
    .load-more-btn {
        width: 90%;
        max-width: 300px;
    }
    
    /* 确保无新闻提示在移动端正常显示 */
    .no-news {
        padding: 20px;
        margin: 0 10px;
    }
}

/* 针对小屏幕手机的额外优化 */
@media (max-width: 480px) {
    .main-container {
        padding: 10px;
    }
    
    .page-title {
        font-size: 18px;
        margin-left: 10px;
    }
    
    .news-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .news-title {
        font-size: 15px;
    }
    
    .news-excerpt {
        font-size: 14px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
}

/* 添加打印样式 */
@media print {
    .sidebar, .load-more-container, .load-more-btn {
        display: none !important;
    }
    
    .main-container {
        display: block;
    }
    
    .content-area {
        width: 100%;
    }
}