/* ==========================================
   Case Detail Page Styles (案例详情完整版)
   ========================================== */

/* ===== 全局重置 (替代 Tailwind 的基础重置，修复 Footer 样式崩坏问题) ===== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Inter", sans-serif;
    color: #172B4D; 
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* 防止页面出现横向滚动条 */
}

a {
    text-decoration: none;
    color: inherit;
    background-color: transparent;
}

/* 核心修复 1：清除所有列表默认的小圆点和边距 (解决 Footer 出现蓝点的问题) */
ul, ol, li, dl, dt, dd, p, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 核心修复 2：防止 Footer 中的图片尺寸异常撑破布局 */
img {
    display: block;
    max-width: 100%;
    border: none;
}

/* 核心修复 3：补充公共版心容器 (Header 和 Footer 依赖此属性居中) */
.container {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 详情页专属容器 ===== */
.cd-main {
    min-height: calc(100vh - 200px);
}

.cd-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .cd-container {
        padding: 0 40px; 
    }
}

/* ===== 面包屑导航 ===== */
.cd-breadcrumb-sec {
    padding-top: 32px; 
    margin-top: 64px;  
}

.cd-breadcrumb {
    font-size: 14px;
    color: #6b7280; 
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.cd-breadcrumb a {
    transition: color 0.3s ease;
}

.cd-breadcrumb a:hover {
    color: #FF300E; 
}

.cd-breadcrumb i {
    margin: 0 12px; 
    font-size: 14px;
}

.cd-breadcrumb .current {
    color: #FF300E; 
}

/* ===== 详情内容主干 ===== */
.cd-content-sec {
    padding: 32px 0; 
    background-color: #fff;
}

.cd-wrapper {
    width: 100%;
}

/* ----- 标题区域 ----- */
.cd-header {
    margin-bottom: 32px; 
    text-align: center;
}

.cd-header h1 {
    font-size: clamp(24px, 3vw, 40px); 
    font-weight: bold;
    color: #172B4D;
    margin: 0 0 24px; 
    line-height: 1.4;
}

.cd-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

/* ----- 正文内容 ----- */
.cd-article {
    font-size: 20px; 
    color: #374151;  
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 40px; 
}

.cd-article p {
    margin-bottom: 16px; 
    text-indent: 2em;
}

/* ----- 图片画廊网格 ----- */
.cd-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px; 
    margin-bottom: 32px; 
}

@media (min-width: 768px) {
    .cd-gallery {
        grid-template-columns: repeat(2, 1fr); 
    }
}

.cd-img-item {
    width: 100%;
    height: 280px; 
    object-fit: cover;
    border-radius: 12px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
    transition: transform 0.3s ease; 
}

@media (min-width: 768px) {
    .cd-img-item {
        height: 350px; 
    }
}

.cd-img-item:hover {
    transform: scale(1.01); 
}

/* 单张图片居中跨列样式 */
.cd-img-item.single-img {
    height: auto;
    max-height: 600px;
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .cd-img-item.single-img {
        width: 800px; 
        margin: 0 auto; 
    }
}

/* ----- 标签区域 ----- */
.cd-tags-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0; 
    margin-bottom: 40px; 
    border-top: 1px solid #e5e7eb; 
    border-bottom: 1px solid #e5e7eb; 
}

@media (min-width: 768px) {
    .cd-tags-area {
        flex-direction: row;
        align-items: center; 
    }
}

.tags-label {
    color: #6b7280; 
    margin-right: 12px; 
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .tags-label {
        margin-bottom: 0;
    }
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
}

.tag-item {
    display: inline-block;
    background-color: rgba(255, 48, 14, 0.1); 
    color: #FF300E; 
    font-size: 14px; 
    padding: 4px 12px; 
    border-radius: 9999px; 
    transition: all 0.3s ease;
}

.tag-item:hover {
    background-color: #FF300E; 
    color: #ffffff; 
}

/* ----- 底部翻页组件 ----- */
.cd-pagination {
    display: flex;
    flex-direction: column;
    gap: 16px; 
    margin-bottom: 40px; 
}

@media (min-width: 768px) {
    .cd-pagination {
        flex-direction: row; 
        justify-content: space-between; 
    }
}

.cd-page-btn {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 16px; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    transition: all 0.3s ease;
    width: 100%;
}

@media (min-width: 768px) {
    .cd-page-btn {
        width: auto; 
        max-width: 48%; 
    }
}

.cd-page-btn i {
    font-size: 24px;
    color: #FF300E; 
}

.cd-page-btn .fa-angle-left {
    margin-right: 12px; 
}

.cd-page-btn .fa-angle-right {
    margin-left: 12px; 
}

#nextNews.cd-page-btn {
    justify-content: flex-end; 
}

.page-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

.left-info { text-align: left; }
.right-info { text-align: right; }

.page-info .label {
    font-size: 14px; 
    color: #6b7280; 
    margin-bottom: 2px;
}

.page-info .title {
    font-size: 16px;
    color: #1f2937; 
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-page-btn:hover {
    border-color: #FF300E; 
    background-color: rgba(255, 48, 14, 0.05); 
}

.cd-page-btn.disabled {
    pointer-events: none;
    opacity: 0.5; 
    background-color: #fafafa;
}

/* ----- 返回顶部按钮 ----- */
.cd-back-top {
    position: fixed;
    bottom: 32px; 
    right: 32px;  
    width: 48px;  
    height: 48px; 
    background-color: #FF300E; 
    color: #ffffff; 
    border-radius: 50%; 
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 50;
    line-height: 1; /* 修复图标垂直居中可能出现的偏移 */
}

.cd-back-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cd-back-top:hover {
    background-color: #e62b0d; 
}