/* news.css - 新闻页面专用样式 */

/* 页面头部样式 */
.page-header {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #0a1929 0%, #142d4c 100%);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    z-index: 0;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
  color: #ffffff;
}

/* 新闻主区块样式 */
.news-content {
    padding-top: 3rem;
    padding-bottom: 4rem;
    background-color: #f8f9fa;
}

/* 置顶文章区块 */
.featured-news {
    margin-bottom: 3rem;
}

/* 最新文章列表区块 */
.latest-news {
    margin-bottom: 2.5rem;
}

/* 新闻卡片间距 */
.news-card {
    margin-bottom: 2rem;
    height: 100%;
    /* 确保卡片高度一致 */
}

/* 推荐文章卡片间距 */
.recommended-article {
    margin-bottom: 1.5rem;
    height: 100%;
    /* 确保卡片高度一致 */
}

/* 最新文章标题区域 */
.latest-news-header {
    margin-bottom: 2rem;
}

/* 热门标签区块 */
.tags-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* 热门标签标题区域 */
.tags-section-header {
    margin-bottom: 1.5rem;
}

/* 标签容器样式 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 筛选和排序 */
.filter-sort {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* 修复最新发布下拉框过长问题 */
.sort-options select {
    max-width: 180px;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #ffffff;
}

/* 推荐阅读区块 */
.recommended-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* 推荐阅读标题区域 */
.recommended-header {
    margin-bottom: 2rem;
}

/* 标签筛选样式 */
.tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tag-filter:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tag-filter.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* 新闻文章列表样式 */
.news-article {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem; /* 添加上下间隔 */
    padding: 1.25rem; /* 添加内部边距 */
    border-radius: 8px;
    background-color: #ffffff;
}

.news-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), #4080ff);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.news-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.news-article:hover::before {
    opacity: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
}

.article-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.article-date {
    font-size: 0.875rem;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.article-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.45;
    letter-spacing: -0.015em;
}

.article-title a {
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary);
}

.article-excerpt {
    line-height: 1.7;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #495057;
    font-size: 0.95rem;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fa;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-tags .tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background-color: #f8f9fa;
    color: #495057;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.article-tags .tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.read-more {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.read-more i {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.read-more:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

.read-more:hover i {
    transform: translateX(2px);
}

/* 缩略图样式 */
.article-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    transition: transform 0.3s ease;
    margin-bottom: 1rem;
    height: 200px;
}

.news-article:hover .article-thumbnail {
    transform: scale(1.03);
}

.thumbnail-placeholder {
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumbnail-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* 分页样式 */
.pagination-wrapper {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.pagination {
    justify-content: center;
    gap: 0.5rem;
    display: inline-flex;
}

.pagination .page-link {
    color: #495057;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: #ffffff;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* 侧边栏样式 */
.sidebar-section {
    position: sticky;
    top: 92px;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f3f5;
    position: relative;
}

.sidebar-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

/* 搜索框样式 */
.search-box .input-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-box .form-control {
    border-right: none;
    border-radius: 12px 0 0 12px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-box .btn {
    border-radius: 0 12px 12px 0;
    padding: 0.75rem 1.25rem;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.2s ease;
}

.search-box .btn:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* 标签云样式 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.tag-cloud-item {
    font-size: 0.875rem;
    padding: 0.45rem 0.95rem;
    border-radius: 25px;
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tag-cloud-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

/* 最新文章样式 */
.latest-articles {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.latest-article {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    padding-left: 1rem;
}

.latest-article:last-child {
    border-bottom: none;
}

.latest-article::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1rem;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--primary-color);
    transition: all 0.2s ease;
}

.latest-article h4 {
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.latest-article:hover {
    transform: translateX(5px);
}

.latest-article:hover::before {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
}

.latest-article:hover h4 {
    color: var(--primary-color);
}

/* 相关链接样式 */
.related-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.related-link {
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid transparent;
}

.related-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
    background-color: #ffffff;
    border-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.related-link i {
    transition: transform 0.2s ease;
    font-size: 1rem;
    color: var(--primary-color);
}

.related-link:hover i {
    transform: translateX(3px) scale(1.1);
}

/* 订阅表单样式 */
.subscribe-form .form-control {
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

/* 文章详情页样式 */
.breadcrumb-container {
    margin-top: 72px;
    /* 为固定导航栏留出空间 */
    border-bottom: 1px solid #e9ecef;
}

.article-main {
    position: relative;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.article-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-excerpt {
    font-size: 1.125rem;
    line-height: 1.6;
    background-color: rgba(var(--primary-rgb), 0.05);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
}

/* 文章内容样式 */
.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #343a40;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.2);
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #343a40;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

/* 文章高亮区块 */
.article-highlight,
.article-tips {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.article-highlight ul,
.article-tips ul,
.article-highlight ol,
.article-tips ol {
    margin-bottom: 0;
}

/* 文章图片 */
.article-image {
    margin: 2rem 0;
}

.article-image img {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: auto;
}

/* 文章作者 */
.article-author {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.author-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-name {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* 相关文章 */
.related-articles {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.related-article-card {
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.related-article-card:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.related-article-card h4 {
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.related-article-card:hover h4 {
    color: var(--primary);
}

/* 推荐阅读 */
.recommended-article {
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.recommended-article:last-child {
    border-bottom: none;
}

.recommended-article:hover {
    transform: translateX(5px);
}

.recommended-article h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.recommended-article:hover h4 {
    color: var(--primary);
}

.recommended-article .article-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

/* 分享按钮 */
.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 评论区 */
.comments-placeholder {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

/* 文章目录 */
.toc-list {
    list-style: none;
    padding-left: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
    padding-left: 0;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    display: block;
}

.toc-item:hover {
    color: var(--primary);
    padding-left: 5px;
}

.toc-sublist {
    list-style: none;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.toc-subitem {
    margin-bottom: 0.25rem;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
    display: block;
}

.toc-subitem:hover {
    color: var(--primary);
    padding-left: 3px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5000;
    max-width: 350px;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .article-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .sidebar-section {
        position: static;
    }

    .article-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .article-header .article-tags {
        margin-top: 1rem;
    }

    .article-author {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.25rem;
    }

    .article-excerpt {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .article-body h2 {
        font-size: 1.35rem;
    }

    .article-body h3 {
        font-size: 1.15rem;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}