
:root {
    --primary: #a30001;
    --primary-hover: #ab0101;
    --text-main: #333;
    --text-light: #999;
    --border: #e6e6e6;
    --bg-light: #f9f9f9;
    --width: 1200px;
    --gap: 24px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--text-main); line-height: 1.6; background: #fff; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--width); margin: 0 auto; padding: 0 var(--space-md); }

/* 顶部 Banner & 面包屑 */
.page-header .banner { margin: var(--space-lg) 0; }
.page-header .banner img { width: 100%; height: auto; max-height: 280px; object-fit: cover; border-radius: 4px; }
.breadcrumb { font-size: 14px; color: var(--text-light); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border); margin-bottom: var(--space-lg); }
.breadcrumb .sep { margin: 0 var(--space-sm); }

/* 主布局 Flexbox */
.content-layout {
  display: flex;
  gap: var(--gap, 24px);
  margin-bottom: var(--space-lg, 32px);
  align-items: flex-start; /* 防止子项被拉伸 */
}
.main-content {
  flex: 1;
  min-width: 0; /* 关键：防止长文本/表格撑破 flex 容器 */
}

/* 侧边栏容器 */
.sidebar { width: 280px; flex-shrink: 0; }
/* 右侧导航视觉优化 */
.category-nav {
  background: #fff;
  border: 1px solid var(--border, #e6e6e6);
  border-left: 3px solid var(--primary, #a30001); /* 左侧强调线，区分主次 */
  border-radius: 6px;
  overflow: hidden;
  box-shadow: -2px 0 12px rgba(0,0,0,0.04); /* 轻微左阴影，增强层级 */
}

/* 一级标题 */
.nav-title {
    margin: 0; padding: 16px 20px;
    background: var(--primary, #a30001); color: #fff;
    font-size: 20px; font-weight: 600;
    text-align: center; letter-spacing: 1px;
}

/* 导航列表 */
.nav-list { list-style: none; margin: 0; padding: 0; }

/* 二级按钮（带 + 号） */
.nav-toggle {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 14px 20px;
    border: none; border-bottom: 1px solid var(--border, #e6e6e6);
    background: #fff; cursor: pointer;
    font-size: 16px; font-weight: 500; color: #333;
    transition: all 0.2s ease;
}
.nav-toggle:hover { background: #f8f9fa; color: var(--primary, #a30001); }
.toggle-icon {
    font-size: 18px; font-weight: bold; color: #999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1; display: inline-block;
}
.nav-item.active .toggle-icon { transform: rotate(45deg); color: var(--primary, #a30001); }

/* 三级列表（核心修改：双列网格） */
.nav-sublist {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease;
    opacity: 0;
    background: #fafafa;
    /* 网格布局：强制一行两个 */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 0; /* 行间距 4px，列间距由 padding 控制 */
    box-sizing: border-box;
}
.nav-item.active .nav-sublist {
    max-height: 1500px; /* 足够容纳所有子项 */
    padding-bottom: 12px;
    opacity: 1;
}

/* 三级链接 */
.nav-sublist li a {
    display: flex;
    align-items: center;
    padding: 9px 12px 9px 22px;
    color: #555;
    font-size: 14px;
    position: relative;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 100%;
}
.nav-sublist li a::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.2s ease;
}
.nav-sublist li a:hover,
.nav-sublist li a.active {
    color: var(--primary, #a30001);
    background: #fff5f5;
}
.nav-sublist li a:hover::before,
.nav-sublist li a.active::before {
    background: var(--primary, #a30001);
}

/* 新闻列表 */
.news-list { padding-bottom:20px;}
.news-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px dashed var(--border);
    transition: background-color 0.25s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background-color: #fafafa; border-radius: 6px; padding: 20px 10px; margin: 0 -10px; }

/* 左侧日期卡片 */
.news-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 10px 8px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.25s;
}
.news-item:hover .news-date-block {
    background: #fff5f5;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(163, 0, 1, 0.1);
}
.date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    display: block;
}
.date-ym {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    display: block;
    letter-spacing: 0.5px;
}

/* 右侧内容区 */
.news-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}
.news-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    line-height: 1.45;
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}
.news-title:hover { color: var(--primary); }

.news-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 分页组件 */
.pagination-wrapper { text-align: center; padding: var(--space-lg) 0; }
.pagination-wrapper ul { display: inline-flex; gap: 8px; align-items: center; }
.pagination-wrapper li { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; 
    background: #d86f6f; color: #fff; font-size: 14px; border-radius: 4px; }
.pagination-wrapper li.fli, .pagination-wrapper li.lli { width: auto; padding: 0 16px; background: #e29090; }
.pagination-wrapper li a, .pagination-wrapper li span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; }
.pagination-wrapper li.current, .pagination-wrapper li a:hover { background: var(--primary); }

/* 轮播区域 */
.partners-carousel { padding: var(--space-lg) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: var(--space-lg) 0; }
.carousel-container { position: relative; display: flex; align-items: center; gap: var(--space-md); max-width: var(--width); margin: 0 auto; }
.carousel-track { flex: 1; overflow: hidden; }
.carousel-list { display: flex; gap: var(--space-md); }
.carousel-item { flex: 0 0 calc((100% - 3 * var(--space-md)) / 4); max-width: 280px; height: 120px; 
    border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { width: 40px; height: 40px; border: 1px solid var(--border); background: #fff; border-radius: 50%; 
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #666; transition: all 0.2s; }
.carousel-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== Footer ========== */
.site-footer { width: 100%; background: #1a1a1a; color: #bbb; padding: 40px 0 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.footer-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-bottom: 28px; border-bottom: 1px solid #333; gap: 30px; flex-wrap: wrap;
}
.footer-brand { flex-shrink: 0; max-width: 320px; }
.footer-brand h4 { font-size: 20px; color: #fff; margin-bottom: 10px; font-weight: bold; letter-spacing: 1px; }
.footer-brand p { font-size: 13px; line-height: 24px; color: #888; }
.footer-links { display: flex; gap: 50px; }
.footer-links-col h5 {
    font-size: 15px; color: #ddd; margin-bottom: 12px; font-weight: bold;
    position: relative; padding-bottom: 8px;
}
.footer-links-col h5::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 24px; height: 2px; background: #a30001; border-radius: 1px;
}
.footer-links-col a {
    display: block; font-size: 13px; color: #888; line-height: 28px;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-links-col a:hover { color: #e8a0a0; padding-left: 4px; }
.footer-hotwords { padding: 20px 0; text-align: center; font-size: 12px; color: #777; line-height: 28px; }
.footer-hotwords a {
    color: #999; margin: 3px 4px; padding: 3px 12px; border: 1px solid #444;
    border-radius: 3px; transition: all 0.2s ease; display: inline-block;
}
.footer-hotwords a:hover { color: #fff; border-color: #a30001; background: #a30001; }
.footer-bottom {
    text-align: center; padding: 16px 0 20px; font-size: 12px;
    color: #666; line-height: 22px; border-top: 1px solid #2a2a2a;
}
.footer-bottom a { color: #888; margin: 0 4px; transition: color 0.2s ease; }
.footer-bottom a:hover { color: #e8a0a0; }

#ph_footer { display: none; }

/* 详情页容器 */
.rightbar2 .detail-content {
    background: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 32px;
}

/* 标题区 */
.detail-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border, #e6e6e6);
}
.detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin: 0 0 16px 0;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
    color: #888;
}
.detail-meta span { display: flex; align-items: center; gap: 6px; }

/* =========================================
   核心：富文本通用排版样式 (自动适配后台)
   ========================================= */
.rich-content {
    font-size: 16px;
    line-height: 1.85;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
/* 1. 仅对「直接包含图片」的 div 消除间距 */
.rich-content div:has(> img:only-child),
.rich-content div:has(> a > img:only-child) {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important; /* 只对纯图片容器生效 */
    font-size: 0 !important;   /* 双重保险消除间隙 */
}
/* 2. 其他所有 div 恢复正常文字排版 */
.rich-content div:not(:has(> img:only-child)):not(:has(> a > img:only-child)) {
    line-height: inherit !important; /* 继承父级 1.85 的行高 */
    font-size: inherit !important;
    margin-bottom: 0.8em; /* 恢复合理的段落间距 */
}

/* 段落与文本 */
.rich-content p { margin-bottom: 1.2em; text-align: justify; }
.rich-content strong, .rich-content b { font-weight: 600; color: #111; }
.rich-content em, .rich-content i { font-style: italic; color: #555; }
/* 3. 隐藏编辑器产生的纯空白段落 */
.rich-content p:has(> br:only-child),
.rich-content p:empty {
    display: none !important;
    margin: 0 !important;
}
/* 标题层级 */
.rich-content h2, .rich-content h3, .rich-content h4,
.rich-content h5, .rich-content h6 {
    margin: 2.2em 0 0.9em;
    line-height: 1.35;
    font-weight: 600;
    color: #111;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #eee;
}
.rich-content h2 { font-size: 22px; }
.rich-content h3 { font-size: 19px; }
.rich-content h4 { font-size: 17px; border-bottom: none; }
.rich-content h5 { font-size: 16px; border-bottom: none; }
.rich-content h6 { font-size: 15px; border-bottom: none; color: #444; }

/* 链接 */
.rich-content a { 
    color: var(--primary, #a30001); 
    text-decoration: none; 
    border-bottom: 1px dashed transparent; 
    transition: all 0.2s; 
}
.rich-content a:hover { border-bottom-color: var(--primary, #a30001); }

/* 3. 图片样式保持不变 */
.rich-content img {
    height: auto !important;
    width: 80% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 auto !important;
    vertical-align: bottom;
}
.rich-content img.alignleft, .rich-content img[style*="float: left"] { 
    float: left; margin: 0 1.5em 1em 0; max-width: 45%; 
}
.rich-content img.alignright, .rich-content img[style*="float: right"] { 
    float: right; margin: 0 0 1em 1.5em; max-width: 45%; 
}

/* 列表 */
.rich-content ul, .rich-content ol { margin-bottom: 1.2em; padding-left: 1.8em; }
.rich-content li { margin-bottom: 0.5em; }
.rich-content ul { list-style-type: disc; }
.rich-content ol { list-style-type: decimal; }
.rich-content ul ul, .rich-content ol ol { margin-top: 0.5em; margin-bottom: 0; }

/* 引用块 */
.rich-content blockquote {
    margin: 1.5em 0;
    padding: 16px 20px;
    background: #f8f9fa;
    border-left: 4px solid var(--primary, #a30001);
    border-radius: 0 6px 6px 0;
    color: #555;
    font-style: italic;
}

/* 表格 */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 15px;
    overflow-x: auto;
}
.rich-content th, .rich-content td {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}
.rich-content th { background: #f5f7fa; font-weight: 600; }
.rich-content tr:nth-child(even) td { background: #fafafa; }

/* 代码块 */
.rich-content code, .rich-content pre {
    background: #f4f5f7;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    color: #c7254e;
}
.rich-content pre {
    padding: 16px;
    overflow-x: auto;
    margin: 1.5em 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #e0e0e0;
}

/* 分割线 */
.rich-content hr {
    border: none;
    border-top: 1px solid #e6e6e6;
    margin: 2em 0;
}

/* 底部声明 */
.detail-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}
.disclaimer {
    font-size: 12px;
    line-height: 1.6;
    color: #888;
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 24px;
    border-left: 3px solid #ddd;
    text-align: justify;
}

/* 上下页组件容器 */
.pagination-wrapper { text-align: center; padding: 10px 0; }

/* =========================================
   推荐新闻模块样式
   ========================================= */

/* 模块标题：与侧边栏nav-title及富文本h3保持视觉统一 */
.rightbar2 .title5 {
    font-size: 20px;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    margin: 40px 0 20px;
    padding-left: 12px;
    border-left: 4px solid var(--primary, #a30001);
    position: relative;
}

/* 推荐新闻列表容器 */
.rightbar2 .list_news4 {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 单条新闻项 */
.rightbar2 .list_news4 li {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 14px 12px;
    border-bottom: 1px dashed var(--border, #e6e6e6);
    transition: all 0.25s ease;
    border-radius: 4px;
}

.rightbar2 .list_news4 li:last-child {
    border-bottom: none;
}

/* 悬停效果：仅在支持hover的设备上生效，避免移动端粘滞 */
@media (hover: hover) {
    .rightbar2 .list_news4 li:hover {
        background-color: #fff5f5;
        padding-left: 18px; /* 轻微右移产生动效 */
    }
    
    .rightbar2 .list_news4 li:hover a {
        color: var(--primary, #a30001);
    }
    
    .rightbar2 .list_news4 li:hover span {
        color: var(--primary, #a30001);
        font-weight: 600;
    }
}

/* 日期标签 */
.rightbar2 .list_news4 li span {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-light, #999);
    font-family: "DIN Alternate", "Arial", sans-serif; /* 数字字体更精致 */
    min-width: 85px;
    transition: color 0.2s ease;
}

/* 新闻标题链接 */
.rightbar2 .list_news4 li a {
    flex: 1;
    min-width: 0; /* 关键：防止长标题撑破flex容器 */
    font-size: 15px;
    color: var(--text-main, #333);
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
    
    /* 单行文本截断 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .content-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .carousel-item { flex: 0 0 calc((100% - 2 * var(--space-md)) / 3); }
}
@media (max-width: 768px) {
    .carousel-item { flex: 0 0 calc(50% - 8px); } /* 假设容器 gap 为 16px，单边减 8px 防换行 */
    .page-header .banner { margin: 16px 0; }
    .carousel-btn { display: none; } /* 移动端隐藏箭头，支持滑动 */
     /* 补充：隐藏箭头后需支持手势滑动 */
  .carousel-track {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
  }
  .carousel-track::-webkit-scrollbar { display: none; } /* Chrome/Safari 隐藏滚动条 */
  .carousel-item { scroll-snap-align: start; }
  .content-layout {
    flex-direction: column; /* 上下堆叠，内容自然在上 */
    gap: 16px;
  }
    .sidebar { width: 100%; display: none;}
    .category-nav { border-left: none; box-shadow: none; }
    .nav-toggle { padding: 12px 16px; }
    .nav-sublist { grid-template-columns: repeat(2, 1fr); padding: 6px 8px; }
    .nav-sublist li a { padding: 8px 10px 8px 20px; font-size: 13px; }
    
    .nav-grid.level-2 { grid-template-columns: repeat(2, 1fr); } /* 移动端仍保持双列 */
    .news-item { gap: 14px; padding: 16px 0; }
    .news-date-block { min-width: 52px; padding: 8px 6px; }
    .date-day { font-size: 22px; }
    .date-ym { font-size: 12px; }
    .news-title { font-size: 16px; }
    .news-excerpt { font-size: 13px; }
    
    .rightbar2 .detail-content { padding: 20px 16px; }
    .detail-title { font-size: 22px; }
    .detail-meta { flex-direction: column; gap: 8px; }
    .rich-content { font-size: 15px; line-height: 1.8; }
    .rich-content img.alignleft, .rich-content img.alignright { 
        float: none; max-width: 100%; margin: 1em 0; 
    }
    .rich-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .footer-keywords{ display: none;}
    
    .rightbar2 .title5 {
        font-size: 18px;
        margin: 28px 0 16px;
        padding-left: 10px;
        border-left-width: 3px;
    }
    
    .rightbar2 .list_news4 li {
        flex-direction: column-reverse; /* 移动端标题在上，日期在下 */
        align-items: flex-start;
        gap: 4px;
        padding: 12px 8px;
    }
    
    .rightbar2 .list_news4 li a {
        font-size: 15px;
        white-space: normal; /* 移动端允许换行显示完整标题 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .rightbar2 .list_news4 li span {
        font-size: 12px;
        min-width: auto;
    }
    .site-footer { padding: 24px 0 0; }
}
@media (max-width: 480px) 
{/* ★ 小屏也保持隐藏 */
    .topic-box { display: none !important; }
    .footer-top { display: none !important; }
}
/* 仅在有悬停设备的设备上保留 hover 效果（防移动端粘滞） */
@media (hover: hover) {
  .news-item:hover { background-color: #fafafa; border-radius: 6px; padding: 20px 10px; margin: 0 -10px; }
  .news-item:hover .news-date-block { background: #fff5f5; border-color: var(--primary, #a30001); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(163, 0, 1, 0.1); }
}
