/* =========================================
   1. 全局重置与变量 (Global Reset & Vars)
   ========================================= */
:root {
    /* 核心色调 - 保持一致的行政蓝 */
    --primary-color: #0056b3;
    --primary-light: #e6f0fa;
    --hover-color: #003d80;
    --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. 头部与导航 (Header & Nav - 保持不变)
   ========================================= */
.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);
}

/* 热门推荐列表 */
.hot-list { padding: 10px 0; }
.hot-item {
    display: flex; gap: 10px; padding: 10px 15px;
    border-bottom: 1px dashed #eee;
}
.hot-item:last-child { border-bottom: none; }
.hot-icon {
    width: 20px; height: 20px; background: #eee;
    color: #888; text-align: center; line-height: 20px;
    font-size: 12px; border-radius: 2px; flex-shrink: 0;
}
.hot-item:nth-child(1) .hot-icon { background: #ff4757; color: #fff; }
.hot-item:nth-child(2) .hot-icon { background: #ffa502; color: #fff; }
.hot-item:nth-child(3) .hot-icon { background: #2ed573; color: #fff; }

.hot-title {
    font-size: 13px; color: #444; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.hot-item:hover .hot-title { color: var(--primary-color); }

/* --- 右侧列表区 (List Content) --- */
.main-list-area {
    flex: 1;
    background: var(--white);
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    min-width: 0; /* 防止溢出 */
}

/* 列表筛选头 */
.list-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}
.list-title {
    font-size: 20px; font-weight: bold; color: var(--primary-color);
    display: flex; align-items: center; gap: 8px;
}
.filter-search input {
    border: 1px solid #ddd; padding: 5px 10px; font-size: 12px;
    border-radius: 3px; outline: none;
}

/* 列表项 (News Item) */
.news-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px dashed #eee;
    transition: all 0.3s;
}

.news-item:hover {
    background-color: #fcfcfc;
}

.news-thumb {
    width: 220px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #e9ecef; /* 无图时的底色 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.news-item:hover .news-thumb img { transform: scale(1.05); }

/* 无图占位符样式 */
.no-img-placeholder {
    color: #adb5bd;
    font-size: 40px; /* 图标大小 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* 关键：文本截断必需 */
}

.news-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    
    /* 单行省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item:hover .news-title { color: var(--primary-color); }

.news-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    
    /* 多行省略 (兼容性写法) */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 显示2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 20px;
}
.meta-item { display: flex; align-items: center; gap: 4px; }

/* 分页 (Pagination) */
.pagination {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 4px;
    font-size: 14px;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f9f9f9;
}

/* =========================================
   4. 底部 (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; }

/* =========================================
   5. 响应式适配 (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-bottom: 1px solid #eee;
        border-left: none;
        white-space: nowrap;
    }
    .vertical-menu a.active {
        border-bottom: 3px solid var(--primary-color);
        border-left: none;
    }
    
    /* 热门推荐改为横向 Grid */
    .hot-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 15px;
    }
    .hot-item { border: 1px solid #eee; border-radius: 4px; }
}

/* 手机 (小于 768px) */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: flex-start; gap: 15px; }
    .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-list-area { padding: 20px; }

    /* 列表项改为垂直堆叠 */
    .news-item { flex-direction: column; }
    .news-thumb {
        width: 100%;
        height: 180px; /* 手机端图片高度 */
        margin-bottom: 10px;
    }
    
    .news-title { font-size: 16px; white-space: normal; /* 手机端标题换行 */ }
    .news-desc { display: none; /* 手机端隐藏简介，节省空间 */ }
    
    /* 热门推荐回退为单列 */
    .hot-list { grid-template-columns: 1fr; }
}