/* =========================================
   1. 全局重置与变量 (Global Reset & Vars)
   ========================================= */
:root {
    /* 核心色调 - 保持一致的行政蓝 */
    --primary-color: #0056b3;
    --primary-light: #e6f0fa;
    --text-main: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #f4f6f9;
    --white: #ffffff;
    --border-color: #ddd;
    
    /* 布局参数 */
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
}

a { text-decoration: none; color: inherit; transition: all 0.3s; }
a:hover { color: var(--primary-color); }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =========================================
   2. 头部与导航 (保持不变)
   ========================================= */
.top-bar {
    background-color: var(--primary-color);
    color: #fff;
    padding: 8px 0;
    font-size: 12px;
}
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; }
.top-links a { margin-right: 15px; color: rgba(255,255,255,0.9); }
.top-links a:hover { color: #fff; text-decoration: underline; }

.header-box {
    background: var(--white);
    padding: 25px 0;
    border-bottom: 3px solid var(--primary-color);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo-group { display: flex; align-items: center; gap: 15px; }
.logo-icon { font-size: 48px; color: var(--primary-color); line-height: 1; }
.site-info h1 { font-size: 26px; color: var(--primary-color); line-height: 1.2; margin-bottom: 2px; }
.site-info p { font-size: 14px; color: #555; letter-spacing: 1px; }

.search-wrap {
    display: flex; border: 1px solid #ddd; border-radius: 4px; overflow: hidden;
}
.search-wrap input { border: none; padding: 8px 10px; outline: none; width: 180px; }
.search-wrap button {
    background: var(--primary-color); color: #fff; border: none; padding: 0 15px; cursor: pointer;
}

/* 导航栏 */
.nav-box {
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.nav-list { display: flex; flex-wrap: wrap; }
.nav-list li { flex: 1; text-align: center; min-width: 90px; }
.nav-list a {
    display: block; color: #fff; padding: 14px 0; font-size: 15px; font-weight: 500;
}
.nav-list a:hover, .nav-list a.active {
    background-color: rgba(255,255,255,0.15); font-weight: bold;
}

/* =========================================
   3. 页面布局 (Page Layout)
   ========================================= */
.crumb-box {
    padding: 15px 0; color: #666; font-size: 13px;
    border-bottom: 1px solid #eee; margin-bottom: 20px;
}
.crumb-box span { color: #999; margin: 0 5px; }
.crumb-box .current { color: var(--primary-color); font-weight: bold; }

.page-layout {
    display: flex;
    gap: 25px;
    margin-bottom: 50px;
    align-items: flex-start;
}

/* --- 左侧边栏 (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--white);
    border: 1px solid #eee;
    border-top: 3px solid var(--primary-color);
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px 20px;
    font-size: 16px; font-weight: bold;
    color: var(--primary-color);
    background: #fcfcfc;
    border-bottom: 1px solid #f0f0f0;
}

.vertical-menu a {
    display: block; padding: 12px 20px;
    border-bottom: 1px solid #f9f9f9;
    color: #555; transition: all 0.2s; font-size: 14px; position: relative;
}
.vertical-menu a:hover {
    color: var(--primary-color); background-color: var(--primary-light); padding-left: 28px;
}
.vertical-menu a.active {
    color: var(--primary-color); font-weight: bold;
    background-color: var(--primary-light); border-left: 4px solid var(--primary-color);
}

/* 最新动态小部件 */
.latest-list { padding: 10px 0; }
.latest-item {
    display: block; padding: 10px 15px; border-bottom: 1px dashed #eee;
    font-size: 13px; color: #444; line-height: 1.4;
}
.latest-item:last-child { border-bottom: none; }
.latest-item:hover { color: var(--primary-color); }

/* =========================================
   4. 右侧正文区 (Article Content) - 核心部分
   ========================================= */
.main-content {
    flex: 1;
    background: var(--white);
    padding: 40px;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    min-width: 0; /* 防止Flex子项溢出 */
}

/* 文章头部 */
.article-header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.article-title {
    font-size: 24px; color: #333; margin-bottom: 15px; line-height: 1.4;
}

.article-meta {
    font-size: 12px; color: #999;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 20px;
}
.meta-item { display: inline-flex; align-items: center; }

/* 文章正文 */
.article-body {
    font-size: 16px; line-height: 1.8; color: #333;
}

.article-body p {
    margin-bottom: 20px;
    text-indent: 2em; /* 首行缩进 */
    text-align: justify; /* 两端对齐 */
    word-wrap: break-word;
}

/* 强调文字 */
.article-body strong { color: #000; font-weight: bold; }

/* 图片样式 */
.article-img-box {
    margin: 20px 0;
    text-align: center;
}
.article-img-box img {
    max-width: 100%; /* 图片自适应宽度 */
    height: auto;
    border: 1px solid #eee;
    padding: 4px;
    border-radius: 4px;
}
.img-caption {
    font-size: 13px; color: #666; margin-top: 8px; text-indent: 0 !important;
}

/* 附件下载区域 */
.attachment-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 20px;
    margin-top: 40px;
}
.attach-title {
    font-size: 14px; font-weight: bold; color: #333; margin-bottom: 10px;
}
.attach-list li {
    margin-bottom: 8px; font-size: 14px;
}
.attach-list a {
    color: var(--primary-color); text-decoration: underline;
}
.attach-icon { margin-right: 5px; text-decoration: none !important; }

/* 底部导航 (上一篇/下一篇) */
.article-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
    font-size: 14px;
}
.nav-prev, .nav-next {
    display: block; margin-bottom: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-label { color: #666; margin-right: 5px; }

/* =========================================
   5. 底部 (Footer)
   ========================================= */
.footer-box {
    background-color: #333; color: #ccc;
    padding: 40px 0; text-align: center; margin-top: auto;
}
.footer-box p { margin-bottom: 8px; font-size: 13px; }

/* =========================================
   6. 响应式适配 (Responsive)
   ========================================= */

/* 平板 (小于 992px) */
@media (max-width: 992px) {
    .page-layout { flex-direction: column; }
    .sidebar { width: 100%; margin-bottom: 20px; }
    
    /* 侧边栏菜单横向排列 */
    .vertical-menu { display: flex; flex-wrap: wrap; }
    .vertical-menu a {
        flex: 1; text-align: center;
        border-right: 1px solid #eee; border-bottom: none; padding-left: 0;
        white-space: nowrap;
    }
}

/* 手机 (小于 768px) */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 15px; align-items: flex-start; }
    .search-wrap { width: 100%; } .search-wrap input { flex: 1; }

    /* 导航栏横向滑动 */
    .nav-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
    .nav-list li { flex: 0 0 auto; padding: 0 10px; }

    /* 正文区调整 */
    .main-content { padding: 20px; }
    .article-title { font-size: 20px; }
    .article-meta { flex-direction: column; gap: 5px; align-items: center; }
    
    .article-body { font-size: 15px; }
}