/* ==========================================
   新闻列表页面样式 - 暗色主题
   ========================================== */


/* ---- Hero 区域 ---- */
.news-hero-section {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.news-hero-container {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 359px;
    margin-top: 6px;
}

.news-hero-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url(../images/首屏配图@2x.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1;
}

.news-hero-title {
    font-size: 44px;
    font-weight: 600;
    background: linear-gradient(270deg, #165DFF 0%, #C98FF7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

/* ---- 分类筛选按钮 ---- */
.news-section {
    padding: 0 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.news-container {
    width: 100%;
}
.news-hero-content
{
    max-width: var(--container-max-width);
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    margin-top: 100px;
}

.news-category-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.category-btn {
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 0em;
    text-decoration: none;
    color: #FFFFFF;
    position: static;
    left: 112px;
    top: 0px;
    height: 31px;
    border-radius: 12px;
    opacity: 1;

    /* 自动布局 */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 6px 20px;
    gap: 16px;
    background: rgba(255, 255, 255, 0.2);
    
    
}

.category-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-btn.active {
    background: #165DFF;

}

/* ---- 文章列表 ---- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.news-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 0px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item-link {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.news-item-link:hover {
    opacity: 0.92;
}

.news-item-link:hover .news-item-title {
    color: #165DFF;
}

/* 文章文字内容 */
.news-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item-title {
    font-size: 20px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 0em;
    color: #FFFFFF;
}

.news-item-excerpt {
    font-size: 16px;
    font-weight: normal;
    line-height: normal;
    letter-spacing: 0em;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 元信息：标签 + 日期 */
.news-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.news-item-tag {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #165DFF;
    background: rgba(68, 125, 255, 0.15);
    height: 24px;
    border-radius: 4px;
    padding: 4px 16px;

}

.news-item-date {
    font-family: MiSans, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}

/* 文章缩略图 */
.news-item-thumbnail {
    flex-shrink: 0;
    width: 380px;
    height: 192px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.news-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.news-item-link:hover .news-item-thumbnail img {
    transform: scale(1.05);
}

.news-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(130, 50, 219, 0.08));
}

/* ---- 空状态 ---- */
.news-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-family: MiSans, sans-serif;
    font-size: 16px;
}

/* ---- 分页 ---- */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.page-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: MiSans, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* ---- 淡入动画 ---- */
.news-page .fade-in-up {
    opacity: 0;
    transform: translateY(16px);
    animation: newsItemFadeIn 0.5s ease forwards;
}

@keyframes newsItemFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item:nth-child(1) { animation-delay: 0.05s; }
.news-item:nth-child(2) { animation-delay: 0.10s; }
.news-item:nth-child(3) { animation-delay: 0.15s; }
.news-item:nth-child(4) { animation-delay: 0.20s; }
.news-item:nth-child(5) { animation-delay: 0.25s; }
.news-item:nth-child(6) { animation-delay: 0.30s; }

/* ==========================================
   文章详情页样式
   ========================================== */
.single-post-template {
    background: var(--bg-primary);
    min-height: calc(100vh - 60px);
}

.single-post-template .content-wrapper {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 80px 20px 60px;
}

/* 文章详情头部 */
.single-post-template .post-item {
    background: transparent;
    box-shadow: none;
    border: none;
}
.post-item:hover {
    transform: translateY(0px);
}

.single-post-template .entry-header {
    margin-bottom: 40px;
    padding-bottom: 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.single-post-template .entry-title {
    font-family: MiSans, sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    background: linear-gradient(270deg, #165DFF 0%, #C98FF7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-align: left;
    
}

.single-post-template .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: MiSans, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 500;
    align-items: center;
}
.single-post-template .entry-meta .cat-links {
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    /* color: #165DFF; */
    background: rgba(68, 125, 255, 0.15);
    height: 24px;
    border-radius: 4px;
    padding: 4px 16px;
}

.single-post-template .entry-meta a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.single-post-template .entry-meta a:hover {
    color: #165DFF;
}

.single-post-template .entry-meta i {
    margin-right: 6px;
    opacity: 0.6;
}

/* 文章缩略图 */
.single-post-template .post-thumbnail {
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    display: none; /* 注释掉文章顶部图片显示 */
}

.single-post-template .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* 文章正文 */
.single-post-template .entry-content {
    font-family: MiSans, sans-serif;
    font-size: 16px;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.8);
}

.single-post-template .entry-content h1,
.single-post-template .entry-content h2,
.single-post-template .entry-content h3,
.single-post-template .entry-content h4,
.single-post-template .entry-content h5,
.single-post-template .entry-content h6 {
    color: #ffffff;
    margin-top: 1em;
    margin-bottom: 0.8em;
    font-weight: 600;
}

.single-post-template .entry-content h2 { font-size: 24px; }
.single-post-template .entry-content h3 { font-size: 20px; }

.single-post-template .entry-content p {
    margin-bottom: 0em;
}

.single-post-template .entry-content strong {
    font-weight: 700;
}

.single-post-template .entry-content a {
    color: #165DFF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.single-post-template .entry-content a:hover {
    color: #9B7DFF;
}

.single-post-template .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

.single-post-template .entry-content blockquote {
    border-left: 3px solid #165DFF;
    padding: 12px 20px;
    margin: 1.5em 0;
    background: rgba(124, 92, 252, 0.06);
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.65);
}

.single-post-template .entry-content ul,
.single-post-template .entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.2em;
}

.single-post-template .entry-content li {
    margin-bottom: 0.5em;
}

.single-post-template .entry-content pre,
.single-post-template .entry-content code {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.single-post-template .entry-content code {
    padding: 2px 6px;
    font-size: 0.9em;
}

.single-post-template .entry-content pre {
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 1.2em;
}

.single-post-template .entry-content pre code {
    padding: 0;
    background: transparent;
}

/* 表格样式 - 暗色主题美化 */
.single-post-template .entry-content table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1.5em 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.single-post-template .entry-content table td,
.single-post-template .entry-content table th {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    vertical-align: middle;
    line-height: 1.6;
    transition: background 0.2s ease;
}

/* 移除最后一列和最后一行的边框 */
.single-post-template .entry-content table td:last-child,
.single-post-template .entry-content table th:last-child {
    border-right: none;
}

.single-post-template .entry-content table tr:last-child td {
    border-bottom: none;
}

/* 表头样式：th 元素和 thead 中的 td */
.single-post-template .entry-content table th,
.single-post-template .entry-content table thead td {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.15), rgba(155, 125, 255, 0.10));
    font-weight: 600;
    color: #ffffff;
    text-align: left;
    border-bottom: 2px solid rgba(22, 93, 255, 0.3);
}

/* 无 thead 表格的第一行作为表头 */
.single-post-template .entry-content table:not(:has(thead)) > tr:first-child td,
.single-post-template .entry-content table:not(:has(thead)) > tbody > tr:first-child td {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.15), rgba(155, 125, 255, 0.10));
    font-weight: 600;
    color: #ffffff;
    text-align: left;
    border-bottom: 2px solid rgba(22, 93, 255, 0.3);
}

.single-post-template .entry-content table tr:hover td {
    background: rgba(22, 93, 255, 0.05);
}

/* 表头行不受 hover 影响 */
.single-post-template .entry-content table thead tr:hover td,
.single-post-template .entry-content table thead tr:hover th,
.single-post-template .entry-content table:not(:has(thead)) > tr:first-child:hover td,
.single-post-template .entry-content table:not(:has(thead)) > tbody > tr:first-child:hover td {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.15), rgba(155, 125, 255, 0.10));
}

/* 文章导航 */
.single-post-template .post-navigation {
    margin-top: 0px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.single-post-template .post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.single-post-template .post-navigation .nav-previous,
.single-post-template .post-navigation .nav-next {
    flex: 1;
    max-width: 48%;
}

.single-post-template .post-navigation a {
    display: block;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.single-post-template .post-navigation a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(22, 93, 255, 0.3);
}

.single-post-template .nav-subtitle {
    display: block;
    font-family: MiSans, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 6px;
}

.single-post-template .nav-title {
    display: block;
    font-family: MiSans, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   响应式设计
   ========================================== */
@media (max-width: 1024px) {
    .news-item-thumbnail {
        width: 200px;
        height: 130px;
    }

    .news-item-link {
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .news-hero {
        padding: 60px 16px 24px;
    }

    .news-hero-container {
        min-height: auto;
    }

    .news-hero-title {
        font-size: 30px;
    }

    .news-section {
        padding: 0 16px 60px;
    }

    .news-category-filter {
        gap: 8px;
        margin-bottom: 32px;
    }

    .category-btn {
        padding: 6px 16px;
        font-size: 13px;
    }

    .news-item {
        padding: 10px 0px;
    }

    .news-item-link {
        flex-direction: column-reverse;
        gap: 16px;
        padding: 24px 0;
    }

    .news-item-thumbnail {
        width: 100%;
        height: 180px;
        border-radius: 10px;
    }

    .news-item-title {
        font-size: 17px;
    }

    .news-item-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .news-pagination {
        margin-top: 32px;
        gap: 12px;
    }

    /* 文章详情响应式 */
    .single-post-template .content-wrapper {
        padding: 60px 16px 40px;
    }

    .single-post-template .entry-title {
        font-size: 24px;
    }

    .single-post-template .entry-content {
        font-size: 15px;
    }

    .single-post-template .post-navigation .nav-links {
        flex-direction: column;
        gap: 12px;
    }

    .single-post-template .post-navigation .nav-previous,
    .single-post-template .post-navigation .nav-next {
        max-width: 100%;
    }
}

/* ==========================================
   文章详情页侧边栏样式
   ========================================== */

.content-with-sidebar {
    display: flex;
    gap: 45px;
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 0 20px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.main-content {
    flex: 1;
    min-width: 0;
}
.post-banner
{

    margin: 2em 0;
}
.post-banner .banner-image
{
    border-radius: 8px;
}
.content-sidebar {
    width: 300px;
    flex-shrink: 0;
    /* position: sticky; */   /*悬浮 */
    top: 80px;
    align-self: flex-start;
    /* max-height: calc(100vh - 100px); */
    overflow-y: auto;
    margin-bottom: 150px;
}

/* 文章导航在PC端横跨整个宽度 */
.single-post-template .post-navigation {
    width: 100%;
    flex-basis: 100%;
}

/* 侧边栏组件 */
.sidebar-widget {
    background: rgba(68, 125, 255, 0.06) ;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-widget:last-child {
    margin-bottom: 0;
}

.widget-title-wrapper{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;

}
.recommended-posts-widget .widget-title {

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
     margin-bottom: 20px;
    padding-bottom: 12px;
}

.widget-more-link {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.25s ease;
}

.widget-more-link:hover {
    color: #165DFF;
}

.widget-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-post-item:first-child {
    padding-top: 0;
}

.widget-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* 最新文章的第一条：图片100%宽度 */
.latest-posts-widget .widget-post-item:first-child {
    flex-direction: column;
    gap: 12px;
}

.latest-posts-widget .widget-post-item:first-child .widget-post-thumb {
    width: 100%;
    height: 160px;
}

.widget-post-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.widget-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.widget-post-thumb:hover img {
    transform: scale(1.05);
}

.widget-post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.widget-post-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.widget-post-title a {
    color: #FFFFFF;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.widget-post-title a:hover {
    color: #165DFF;
}

.widget-post-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* 响应式设计 */
@media screen and (max-width: 992px) {
    .content-with-sidebar {
        flex-direction: column;
    }

    .main-content {
        order: 1;
    }

    .content-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        order: 3;
        margin-bottom: 10px;
    }

    .single-post-template .post-navigation {
        order: 2;
    }

    .sidebar-widget {
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 768px) {
    .content-with-sidebar {
        gap: 24px;
        padding: 0 16px;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .widget-title {
        font-size: 16px;
    }

    .widget-post-thumb {
        width: 60px;
        height: 45px;
    }

    .widget-post-title {
        font-size: 13px;
    }

    .widget-post-date {
        font-size: 11px;
    }

    .single-post-template .entry-meta .cat-links {
        width: 100%;
    }
}

