/* ==========================================================================
   news-detail.css - 新闻详情页样式
   ========================================================================== */

/* 主内容区域 */
.news-detail-content {
    padding: 60px 0;
    background-color: var(--background-primary);
}

.container {
    max-width: 1300px; /* 与首页一致的宽度 */
    margin: 0 auto;
    padding: 0 15px;
}

/* 新闻标题和日期 */
.news-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%; /* 确保占据容器的全部宽度 */
}

.news-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.3;
}

.news-date {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

/* 主图样式 */
.news-main-image {
    margin-bottom: 30px;
    border: 1px solid var(--border-color, #eee); /* Use variable or fallback */
    overflow: hidden;
    width: 100%; /* 确保占据容器的全部宽度 */
    border-radius: 4px; /* Optional: slight radius */
}

.news-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 正文内容 */
.news-content {
    margin-bottom: 40px;
    color: var(--text-primary);
    line-height: 1.8;
    width: 100%; /* 确保占据容器的全部宽度 */
    font-size: 16px; /* Explicit base font size for content */
}

.news-content p {
    margin-bottom: 20px;
}

.news-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 30px 0 15px;
    line-height: 1.4; /* Added for better spacing */
}

.news-content img { /* Ensure images within content are responsive */
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px; /* Optional */
}

/* 社交分享 */
.social-share-container {
    border-top: 1px solid var(--border-color, #eee); /* Use variable */
    border-bottom: 1px solid var(--border-color, #eee); /* Use variable */
    padding: 20px 0;
    margin-bottom: 30px;
}

.social-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.social-share span {
    font-size: 16px;
    color: var(--text-dark);
    margin-right: 5px; /* Add some space if icons wrap next to it */
}

/* 修改为圆形样式 */
.share-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%; /* 改为圆形 */
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Added transform */
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
}

.share-icon:hover {
    background-color: var(--primary-dark-blue);
    transform: translateY(-2px); /* 添加悬停时轻微上浮效果 */
}

.share-icon i {
    font-size: 18px;
}

/* 复制链接成功状态 */
.share-icon.copy-link.copied { /* Ensure this selector is specific enough */
    background-color: #28a745; /* 成功时显示绿色 */
}
.share-icon.copy-link.copied:hover {
    background-color: #218838; /* Darker green on hover */
}

/* 上一篇/下一篇导航 */
.news-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 20px;
    gap: 15px; /* Add gap between buttons */
}

.prev-news, .next-news {
    padding: 10px 15px;
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
    display: inline-flex; /* Use inline-flex for better alignment with gap */
    align-items: center;
    justify-content: center; /* Center content within button */
    gap: 8px;
    transition: background-color 0.3s ease;
    border-radius: 4px; /* Add border-radius for consistency */
    font-weight: 500; /* Add font-weight */
    flex-grow: 1; /* Allow buttons to grow and share space */
    text-align: center; /* Ensure text is centered */
}

.prev-news:hover, .next-news:hover {
    background-color: var(--primary-dark-blue);
    color: white; /* Ensure color remains white on hover if not default */
}

.prev-news.disabled, .next-news.disabled {
    background-color: var(--neutral-light-gray, #cccccc); /* Use variable */
    color: var(--text-secondary, #6c757d); /* Dim text color */
    cursor: not-allowed;
    opacity: 0.7; /* Adjusted opacity */
}
.prev-news.disabled:hover, .next-news.disabled:hover {
    background-color: var(--neutral-light-gray, #cccccc); /* Prevent hover effect */
    color: var(--text-secondary, #6c757d);
}

/* Tablet adjustments */
@media (max-width: 991px) {
    .news-detail-content {
        padding: 50px 0;
    }

    .news-title {
        font-size: 30px;
        line-height: 1.35;
    }

    .news-date {
        font-size: 13px;
    }
    
    .news-header {
        margin-bottom: 25px;
    }

    .news-main-image {
        margin-bottom: 25px;
    }

    .news-content {
        font-size: 15px;
        line-height: 1.75;
    }

    .news-content h3 {
        font-size: 20px; /* Slightly smaller than base for tablet */
        margin: 25px 0 12px;
    }
    
    .social-share-container {
        padding: 18px 0;
        margin-bottom: 25px;
    }
    
    .news-navigation {
        margin-top: 30px;
    }
    .prev-news, .next-news {
        padding: 9px 12px;
        font-size: 15px;
    }
}

/* Mobile adjustments (enhancing existing 768px breakpoint) */
@media (max-width: 768px) {
    .news-detail-content {
        padding: 40px 0;
    }
    .container {
        padding: 0 10px; /* Reduce container padding */
    }

    .news-title {
        font-size: 26px; /* Adjusted from your 28px */
        line-height: 1.4;
    }
    
    .news-header {
        margin-bottom: 20px;
    }

    .news-main-image {
        margin-bottom: 20px;
    }
    
    .news-content {
        font-size: 15px; /* Keep readable */
        line-height: 1.7;
        margin-bottom: 30px;
    }

    .news-content h3 {
        font-size: 19px; /* Adjusted from your 20px */
        margin: 22px 0 10px;
    }
    
    .social-share-container {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .social-share {
        gap: 10px; /* Reduce gap */
    }
    .social-share span {
         /* Allow span to wrap if needed, or be on its own line */
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px; /* Space if icons are below */
        margin-right: 0;
    }
    .social-share .share-icon { /* Ensure icons stay centered if span is full width */
        /* flex-grow: 1; /* If you want icons to fill space */
    }

    .news-navigation {
        /* Buttons might start to get squeezed here depending on text length */
        /* Consider stacking them earlier if text is long, or ensure they fit */
        gap: 10px;
    }
    .prev-news, .next-news {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Smaller Mobile adjustments (enhancing existing 576px breakpoint) */
@media (max-width: 576px) {
    .news-detail-content {
        padding: 30px 0;
    }

    .news-title {
        font-size: 22px; /* Adjusted from your 24px */
        line-height: 1.45;
    }

    .news-date {
        font-size: 12px;
    }

    .news-content {
        font-size: 14px;
        line-height: 1.65;
    }
    
    .news-content h3 {
        font-size: 18px;
    }

    .social-share {
        flex-wrap: wrap; /* Existing, ensures wrapping */
        justify-content: center; /* Center items when wrapped */
    }
    .social-share span { /* Already set to block and centered at 768px */
        margin-bottom: 10px; /* Ensure spacing */
    }

    .news-navigation {
        flex-direction: column; /* Stack navigation buttons */
        gap: 10px; /* Gap between stacked buttons */
        margin-top: 25px;
    }
    
    .prev-news, .next-news {
        width: 100%; /* Make buttons full width when stacked */
        flex-grow: 0; /* Reset grow factor */
    }
}
