/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }
body { font: 14px/1.6 "Microsoft YaHei", Arial, sans-serif; color: #333; background: #f5f7fa; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
a:hover { color: #c11d1c; }
ul { list-style: none; }
img { max-width: 100%; display: block; border: 0; }
.clearfix::after { content: ""; display: block; clear: both; }

/* ==================== 核心容器 1200px ==================== */
.mainbody { 
    width: 1200px; 
    margin: 0 auto; 
    padding: 20px 0; 
    background: transparent; 
}

/* Banner 优化 */
#banner2 { margin-bottom: 20px; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
#banner2 img { width: 100%; height: auto; min-height: 240px; object-fit: cover; }

/* 面包屑导航 */
.position { 
    padding: 12px 20px; 
    margin-bottom: 20px; 
    background: #fff; 
    border-radius: 6px; 
    font-size: 13px; 
    color: #888; 
    border-left: 4px solid #c11d1c;
}
.position a { color: #666; margin: 0 5px; }
.position a:hover { color: #c11d1c; }

/* ==================== 通用板块标题 ==================== */
.section-title { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 20px; 
    padding-bottom: 12px; 
    border-bottom: 2px solid #eee; 
}
.section-title h3 { 
    font-size: 20px; 
    font-weight: 700; 
    color: #222; 
    padding-left: 12px; 
    border-left: 4px solid #c11d1c; 
    line-height: 1; 
}
.section-title .more { 
    font-size: 13px; 
    color: #999; 
    background: url(../images/index_78.png) no-repeat right center; 
    padding-right: 15px; 
}
.section-title .more:hover { color: #c11d1c; }

/* ==================== 新闻区域重构 ==================== */
.xgxx { 
    display: flex; 
    gap: 30px; 
    background: #fff; 
    padding: 25px; 
    border-radius: 8px; 
    margin-bottom: 30px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
}
.xgxx_pic { flex: 0 0 480px; border-radius: 6px; overflow: hidden; }
.xgxx_pic img { width: 100%; height: 300px; object-fit: cover; transition: transform 0.5s; }
.xgxx_pic:hover img { transform: scale(1.03); }
.xgxx_news { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.xgxx_news li { 
    padding: 10px 15px; 
    border-bottom: 1px dashed #eee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    border-left: 3px solid transparent; 
    transition: all 0.2s; 
}
.xgxx_news li:last-child { border-bottom: none; }
.xgxx_news li.current, .xgxx_news li:hover { 
    background: #fdf5f5; 
    border-left-color: #c11d1c; 
}
.xgxx_news li span { color: #999; font-size: 13px; flex-shrink: 0; margin-left: 15px; }
.xgxx_news li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }

/* ==================== 网格卡片系统 (替代原kbxx) ==================== */
.kbxx { margin-bottom: 35px; }
.card-grid { 
    display: grid; 
    /* 【核心修改】从6列改为5列，完美匹配5条数据，消除右侧空白 */
    grid-template-columns: repeat(5, 1fr); 
    gap: 24px; /* 适当增大间距，使视觉更舒展 */
}
.card-item { 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    transition: all 0.3s ease; 
    border: 1px solid #eee; 
    /* 确保卡片填满网格单元格 */
    width: 100%; 
}
.card-item:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(193, 29, 28, 0.12); 
    border-color: #f5d5d5; 
}
/* 【核心修改】图片高度随宽度等比增加，保持比例协调 */
.card-item img { 
    width: 100%; 
    height: 160px; /* 从130px提升至160px，配合更宽的卡片 */
    object-fit: cover; 
}
.card-item h3 { 
    padding: 14px 12px; 
    font-size: 15px; /* 卡片变宽后，标题字号微调 */
    text-align: center; 
    line-height: 1.4; 
    min-height: 48px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #333; 
}

/* ==================== 底部友情链接轮播区 (Swiper版) ==================== */
.quicklink { 
    background: #fff; 
    padding: 25px 0; 
    border-radius: 8px; 
    margin-top: 20px; 
    border: 1px solid #eee; 
}

.quicklink .carousel { 
    width: 1200px; 
    margin: 0 auto; 
    position: relative; 
    display: flex;
    align-items: center;
}

/* Swiper 可视区域宽度 */
.quicklink .swiper { 
    width: 1100px; 
    overflow: hidden; 
}

/* 固定轮播项尺寸 */
.quicklink .swiper-slide { 
    width: 205px; 
    height: 120px; 
    border-radius: 6px; 
    overflow: hidden; 
    border: 1px solid #eee; 
    background: #f9f9f9; 
    transition: all 0.3s ease;
}

/* 图片自适应填充 */
.quicklink .swiper-slide img { 
    width: 100%; 
    height: 100%; 
    display: block; 
    object-fit: cover; 
    object-position: center center; 
    transition: transform 0.3s ease;
}

/* 悬停微动效 */
.quicklink .swiper-slide:hover {
    border-color: #f5d5d5;
    box-shadow: 0 4px 10px rgba(193, 29, 28, 0.1);
}
.quicklink .swiper-slide:hover img {
    transform: scale(1.05);
}

/* 左右切换按钮样式 */
.quicklink .swiper-button-prev,
.quicklink .swiper-button-next {
    position: static; /* 取消Swiper默认的绝对定位 */
    width: 19px;
    height: 19px;
    margin-top: 0;
    background-size: contain;
    background-repeat: no-repeat;
}
.quicklink .swiper-button-prev {
    background-image: url(../images/index_124.png);
    margin-right: 20px;
}
.quicklink .swiper-button-next {
    background-image: url(../images/index_127.png);
    margin-left: 20px;
}
/* 隐藏 Swiper 默认的箭头图标（因为使用了自定义背景图） */
.quicklink .swiper-button-prev::after,
.quicklink .swiper-button-next::after {
    display: none;
}

/* ==================== Footer ==================== */
#footer { padding: 30px 0; text-align: center; color: #999; font-size: 13px; line-height: 2; }
#footer a { color: #888; margin: 0 3px; }
#footer a:hover { color: #c11d1c; }
#ph_footer { display: none; }

/* ==================== 响应式适配 ==================== */
@media (max-width: 1240px) {
    .mainbody, .quicklink .carousel { width: 96%; }
    /* 中等屏幕保持5列，卡片自然缩放 */
    .card-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
    .card-item img { height: 140px; }
    .xgxx_pic { flex: 0 0 380px; }
}
@media (max-width: 992px) {
    /* 平板横屏/小笔记本：切换为4列 */
    .card-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    body { background: #fff; }
    .mainbody { width: 100%; padding: 10px; }
    #banner2 { border-radius: 0; margin: -10px -10px 15px; }
    
    .position { 
        border-radius: 0; 
        margin: 0 -10px 15px; 
        padding: 10px 15px; 
        white-space: nowrap; 
        overflow-x: auto; 
        background: #fafafa; 
        border-bottom: 1px solid #eee; 
    }
    
    .xgxx { flex-direction: column; padding: 15px; gap: 15px; }
    .xgxx_pic { flex: none; width: 100%; }
    .xgxx_pic img { height: 200px; }
    .xgxx_news li a { font-size: 14px; }
    
    .section-title h3 { font-size: 18px; }
    /* 手机端保持2列不变 */
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .card-item img { height: 110px; }
    .card-item h3 { font-size: 13px; padding: 10px 6px; min-height: 40px; }
    
    .quicklink { display: none; }
    #footer { display: none; }
    #ph_footer { display: block; padding: 20px 10px; text-align: center; font-size: 12px; color: #999; border-top: 1px solid #eee; }
}