
: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); margin-bottom: var(--space-lg); }
.sidebar { width: 240px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; }

/* 侧边栏容器 */
.sidebar { width: 280px; flex-shrink: 0; }
.category-nav { background: #fff; border: 1px solid var(--border, #e6e6e6); border-radius: 6px; overflow: hidden; }

/* 一级标题 */
.nav-title {
    margin: 0; padding: 16px 20px;
    background: var(--primary, #a30001); color: #fff;
    font-size: 18px; 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: 15px; 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: 13.5px;
    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-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); }

/* 页脚 */
.site-footer { background: #f5f5f5; padding: var(--space-lg) 0; text-align: center; font-size: 14px; color: var(--text-light); margin-top: var(--space-lg); }
.footer-content p { margin-bottom: var(--space-sm); }
.footer-keywords a { margin: 0 6px; color: #666; }
.footer-keywords a:hover { color: var(--primary); }

/* 详情页容器 */
.rightbar2 .detail-content {
    background: #fff;
    padding: 32px 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;
}

/* 段落与文本 */
.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; }

/* 标题层级 */
.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); }

/* 图片处理（自动居中/限制最大宽度/适配编辑器浮动类） */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 1.5em auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.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; }


/* 响应式适配 */
@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% - var(--space-md)); }
    .page-header .banner { margin: var(--space-md) 0; }
    .carousel-btn { display: none; } /* 移动端隐藏箭头，支持滑动 */
    .sidebar { width: 100%; display: 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; }
}
