/* 页面标题区域 */
.page-header {
    padding-top: 10rem;
    padding-bottom: 4rem;
    text-align: center;
    background-color: #0f1a2a;
    background-image: linear-gradient(to top, #0f1a2a 0%, transparent 100%),
    url('../../images/banner/banner-background4.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
    background-attachment: unset;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 26, 42, 0);
    z-index: 1;
}

.ie11 .page-header::before {
    background-color: rgba(15, 26, 42, 0);
}

.page-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 2rem;
    margin-bottom: 1rem;
    color: #f0f4f8;
}

.page-subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* 内容布局 */
.content-layout {
    display: flex;
    gap: 2rem;
}

.main-content {
    flex: 1;
    padding-bottom: 50px;
    min-width: 300px;
    max-width: 800px;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 新闻列表容器 */
.news-list-container {
    background: #16253d;
    border-radius: 12px;
    border: 1px solid #2d3748;
    overflow: hidden;
}

/* 新闻列表头部 */
.news-list-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #2d3748;
    background-color: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-list-header h3 {
    font-size: 1.3rem;
    color: #cbd5e1; /* 调整为更柔和的颜色 */
    display: flex;
    align-items: center;
}

.news-list-header h3 i {
    margin-right: 0.8rem;
    color: #1bba9a;
}

/* 新闻列表项 - 优化版 */
.news-list-items {
    list-style: none;
}

.news-list-item {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid #2d3748;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
}

.news-list-item:last-child {
    border-bottom: none;
}

.news-list-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 新闻内容区域 */
.news-content {
    flex: 1;
}

.news-meta {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.news-date {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
    font-size: 0.9rem;
}

.news-date i {
    font-size: 0.85rem;
    margin-right: 0.4rem;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #cbd5e1; /* 调整为更柔和的颜色，原为#f0f4f8 */
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-title a {
    color: #cbd5e1; /* 调整为更柔和的颜色 */
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #1bba9a;
}

.news-excerpt {
    color: #cbd5e1;
    margin-bottom: 0.85rem;
    line-height: 1.6;
}

.read-more {
    color: #1bba9a;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.read-more i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
}

.pagination-list {
    display: flex;
    list-style: none;
}

.pagination-item {
    margin: 0 0.2rem;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: #16253d;
    color: #cbd5e1;
    border: 1px solid #2d3748;
    transition: all 0.3s ease;
    padding: 0 0.5rem;
}

.pagination-link:hover {
    border-color: #1bba9a;
    color: #1bba9a;
}

.pagination-link.active {
    background-color: #1bba9a;
    border-color: #1bba9a;
    color: white;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-link.disabled:hover {
    border-color: #2d3748;
    color: #cbd5e1;
}

/* 侧边栏 */
.sidebar-section {
    background: #16253d;
    border-radius: 12px;
    border: 1px solid #2d3748;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #cbd5e1; /* 调整为更柔和的颜色 */
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2d3748;
    display: flex;
    align-items: center;
}

.sidebar-title i {
    margin-right: 0.5rem;
    color: #1bba9a;
}

/* 新闻搜索框样式 */
.search-box {
    margin-bottom: 1.5rem;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3rem;
    background-color: #1e2a3f;
    border: 1px solid #2d3748;
    border-radius: 8px;
    color: #f0f4f8;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1bba9a;
    box-shadow: 0 0 0 3px rgba(27, 186, 154, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

.search-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.7rem;
    background-color: #1bba9a;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: #169c80;
}

.search-btn i {
    margin-right: 0.5rem;
}

/* 分类目录 */
.categories-list {
    list-style: none;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 6px;
}

.category-item.active {
    background-color: rgba(27, 186, 154, 0.1);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 6px;
}

.category-item:last-child {
    border-bottom: none;
}

.category-name {
    color: #cbd5e1;
    font-weight: 500;
    transition: color 0.3s ease;
    flex: 1;
}

.category-item.active .category-name {
    color: #1bba9a;
    font-weight: 600;
}

.category-name:hover {
    color: #1bba9a;
}

.category-count {
    background-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    min-width: 2.5rem;
    text-align: center;
}

.category-item.active .category-count {
    background-color: rgba(27, 186, 154, 0.2);
    color: #1bba9a;
}

/* 热门文章 */
.popular-articles {
    list-style: none;
}

.popular-article {
    display: flex;
    align-items: flex-start;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popular-article:last-child {
    border-bottom: none;
}

.popular-rank {
    width: 24px;
    height: 24px;
    background-color: rgba(27, 186, 154, 0.1);
    color: #1bba9a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.8rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.popular-rank.top {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.popular-content {
    flex: 1;
}

.popular-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1; /* 调整为更柔和的颜色 */
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.popular-title a {
    color: #cbd5e1; /* 调整为更柔和的颜色 */
}

.popular-title a:hover {
    color: #1bba9a;
}

.popular-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud a {
    display: inline-block;
    background-color: rgba(27, 186, 154, 0.1);
    color: #1bba9a;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background-color: rgba(27, 186, 154, 0.2);
    transform: translateY(-2px);
}

/* 内容页面标题区域 */
.article-title h1 {
    font-size: 2.2rem;
    line-height: 2rem;
}

.article-category {
    display: inline-block;
    background-color: rgba(27, 186, 154, 0.1);
    color: #1bba9a;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
}

.meta-item i {
    margin-right: 0.5rem;
    color: #1bba9a;
}

.article-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.article-tag {
    background-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.article-tag:hover {
    background-color: rgba(27, 186, 154, 0.1);
    color: #1bba9a;
}

/* 文章内容区域 */
.article-content {
    background: #16253d;
    border-radius: 12px;
    border: 1px solid #2d3748;
    padding: 2.5rem; /* 调整为更紧凑的内边距 */
    margin-bottom: 2rem;
}

/* 文章正文样式 */
.article-body {
    color: #cbd5e1;
}

.article-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 2.2rem 0 1rem; /* 调整间距 */
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2d3748;
}

.article-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 1.8rem 0 0.8rem; /* 调整间距 */
}

.article-body p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    font-size: 1.05rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.2rem; /* 调整为更紧凑的间距 */
    padding-left: 1.5rem;
    list-style-type: unset;
}

.article-body li {
    margin-bottom: 0.5rem;
    list-style-type: unset;
}

.article-body blockquote {
    border-left: 4px solid #1bba9a;
    padding-left: 1.5rem;
    margin: 1.5rem 0; /* 调整间距 */
    font-style: italic;
    color: #94a3b8;
    background-color: rgba(27, 186, 154, 0.05);
    padding: 1.2rem; /* 调整内边距 */
    border-radius: 0 8px 8px 0;
}

.article-body code {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ff6b6b;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.article-body pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid #2d3748;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #cbd5e1;
    overflow-x: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(148, 163, 184, 0.6) rgba(255, 255, 255, 0.05); /* Firefox */
}

/* Webkit浏览器滚动条 */
.article-body pre::-webkit-scrollbar {
    height: 12px;
    width: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.article-body pre::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: 4px;
}

.article-body pre::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.6); /* #94a3b8 60%不透明度 */
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
    transition: all 0.3s ease;
}

.article-body pre::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.8); /* 悬停时加深 */
}

/* 横向滚动条 */
.article-body pre::-webkit-scrollbar:horizontal {
    height: 10px;
}

.code-block {
    position: relative;
    margin: 20px 0;
    border-radius: 5px;
    overflow: hidden;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    z-index: 10;
}

.copy-button:hover {
    background: #0056b3;
}

.copy-button.copied {
    background: #28a745;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.2rem 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0; /* 调整间距 */
}

.article-body th,
.article-body td {
    padding: 0.7rem 1rem; /* 调整内边距 */
    border: 1px solid #2d3748;
    text-align: left;
}

.article-body th {
    background-color: rgba(27, 186, 154, 0.1);
    color: #e2e8f0;
    font-weight: 600;
}

.article-body tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* 文章操作栏 */
.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0; /* 调整内边距 */
    border-top: 1px solid #2d3748;
    border-bottom: 1px solid #2d3748;
    margin: 1.5rem 0; /* 调整间距 */
}

.social-share {
    display: flex;
    align-items: center;
    gap: 0.8rem; /* 调整间距 */
}

.share-text {
    color: #94a3b8;
    font-size: 0.9rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background-color: #1bba9a;
    color: white;
    transform: translateY(-2px);
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem; /* 调整间距 */
}

.nav-btn {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.2rem; /* 调整内边距 */
    background-color: #16253d;
    border: 1px solid #2d3748;
    border-radius: 8px;
    color: #cbd5e1;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    border-color: #1bba9a;
    color: #1bba9a;
    transform: translateY(-2px);
}

.nav-btn i {
    margin: 0 0.5rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .content-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main-content {
        padding-bottom: 15px;
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .page-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding-top: 8rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .section-title h1 {
        font-size: 2rem;
    }

    .news-list-item {
        flex-direction: column;
        padding: 1.5rem;
    }

    .category-item:hover,
    .category-item.active {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-left: 0;
        margin-right: 0;
    }

    .article-title h1 {
        font-size: 2rem !important;
    }

    .article-content {
        padding: 1.8rem; /* 调整内边距 */
    }

    .article-body h2 {
        font-size: 1.6rem;
    }

    .article-body h3 {
        font-size: 1.3rem;
    }

    .article-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem; /* 调整间距 */
    }

    .article-body pre::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }

    .article-body pre::-webkit-scrollbar-thumb {
        border: 2px solid transparent;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .news-list-item {
        padding: 1.25rem;
    }

    .news-title {
        font-size: 1.2rem;
    }

    .article-title h1 {
        font-size: 1.8rem !important;
    }

    .article-content {
        padding: 1.2rem; /* 调整内边距 */
    }

    .article-body {
        font-size: 1rem;
    }

    .share-buttons {
        flex-wrap: wrap;
    }
}

/* 确保IE11能正确显示flexbox */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .content-layout {
        display: -ms-flexbox;
        -ms-flex-wrap: nowrap;
    }
}

/* IE11 特定兼容性样式 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* 修复内容布局的间距问题 */
    .content-layout,
    .article-actions,
    .author-info {
        display: -ms-flexbox;
        -ms-flex-wrap: nowrap;
    }

    .main-content {
        -ms-flex: 1 1 auto;
        width: calc(100% - 320px);
        margin-right: 20px;
    }

    .sidebar {
        width: 300px;
        -ms-flex: 0 0 auto;
    }

    /* 在移动端修复 */
    @media (max-width: 1024px) {
        .content-layout {
            -ms-flex-direction: column;
        }

        .main-content {
            width: 100%;
            margin-right: 0;
            margin-bottom: 2rem;
        }

        .sidebar {
            width: 100%;
        }
    }

    /* 修复Flexbox布局 */
    .news-list-item,
    .news-meta,
    .pagination {
        display: -ms-flexbox;
    }

    /* 修复新闻列表项悬停效果 */
    .news-list-item:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }

    /* 修复分类项悬停效果 */
    .category-item:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }

    /* 修复标签云 - 关键修复部分 */
    .tag-cloud {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
        margin: -0.25rem; /* 负边距抵消子元素的边距 */
    }

    .tag-cloud a {
        margin: 0.25rem; /* 使用margin代替gap */
    }

    /* 确保标签云在IE11中正确换行 */
    .tag-cloud::after {
        content: '';
        width: 100%;
        height: 0;
        display: block;
    }

    /* IE11中标题颜色修复 */
    .news-list-header h3,
    .news-title,
    .popular-title,
    .sidebar-title {
        color: #cbd5e1 !important;
    }

    .news-tag {
        margin: 0.25rem;
    }

    /* 修复文章操作栏 */
    .social-share {
        display: -ms-flexbox;
    }

    /* IE11中标题颜色修复 */
    .article-title h1,
    .article-body h2,
    .article-body h3,
    .related-title {
        color: #e2e8f0 !important;
    }
}