/* ===================== */
/* 首页内容区域样式 - 紧凑版 */
/* ===================== */
.home-content {
    display: flex;
    gap: 30px;
    margin: 30px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.home-latest {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

.section-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
    font-weight: normal;
}

/* 分类标签样式 - 更紧凑 */
.category-tabs {
    margin-top: 10px;
}

.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab-nav li {
    background: #f5f7fa;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border: none;
}

.tab-nav li.active {
    background: #3498db;
    color: white;
}

.tab-nav li:hover:not(.active) {
    background: #e1f0ff;
}

.tab-nav li a {
    text-decoration: none;
    color: #555;
    font-weight: normal;
    display: block;
}

.tab-nav li.active a {
    color: white;
}

/* 最新文章网格布局 - 紧凑版 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    position: relative;
}

.article-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.article-item:hover {
    background: #f0f7ff;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 文章序号样式 */
.article-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-weight: normal;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* 文章内容样式 */
.article-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.article-title {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.article-title a:hover {
    color: #3498db;
    text-decoration: underline;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.article-tags a {
    display: inline-block;
    background: #f0f8ff;
    color: #3498db;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}

.article-tags a:hover {
    background: #3498db;
    color: white;
}

.article-author {
    font-size: 0.8rem;
    color: #666;
}

/* 右侧热门文章区域 - 紧凑版 */
.home-popular {
    flex: 0 0 300px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.popular-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.popular-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-thumbnail {
    flex: 0 0 100px;
}

.popular-thumbnail img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.popular-content {
    flex: 1;
}

.popular-title {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    font-weight: normal;
}

.popular-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.popular-title a:hover {
    color: #3498db;
    text-decoration: underline;
}

.popular-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* 优化后的筛选器样式 */
.optimized-filter {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.total-count {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.filter-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 5px;
}

.filter-card {
    flex: 0 0 auto;
    min-width: 100px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f9f9f9;
}

.filter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-card.active {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.filter-card.active .filter-name,
.filter-card.active .filter-count {
    color: white;
}

.filter-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #444;
}

.filter-count {
    font-size: 16px;
    font-weight: bold;
    color: #0073aa;
}

/* 滚动条样式 */
.filter-scroll::-webkit-scrollbar {
    height: 6px;
}

.filter-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.filter-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* 分页指示器 */
.pagination-indicator {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ========================================= */
/* 响应式调整 */
/* ========================================= */
@media (max-width: 992px) {
    .home-content {
        flex-direction: column;
        gap: 20px;
        margin: 20px auto;
    }
    
    .home-popular {
        flex: 1;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-item {
        flex-direction: row;
        padding: 8px;
    }
    
    .article-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    
    .popular-item {
        flex-direction: row;
        gap: 10px;
    }
    
    .popular-thumbnail {
        flex: 0 0 80px;
    }
    
    .popular-thumbnail img {
        height: 60px;
    }

    /* 移动端分页内边距优化 */
    .pagination {
        padding: 8px 0;
    }
}

/* ===================== */
/* 炫彩数字序号样式 */
/* ===================== */
.article-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    transform: scale(1);
}

/* 悬停动画效果 */
.article-number:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 为每个序号分配独特颜色 */
.article-item:nth-child(12n+1) .article-number {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
}

.article-item:nth-child(12n+2) .article-number {
    background: linear-gradient(135deg, #4ECDC4, #556270);
    color: white;
}

.article-item:nth-child(12n+3) .article-number {
    background: linear-gradient(135deg, #45B7D1, #8BD3E6);
    color: white;
}

.article-item:nth-child(12n+4) .article-number {
    background: linear-gradient(135deg, #FFBE0B, #FF9A00);
    color: #333;
}

.article-item:nth-child(12n+5) .article-number {
    background: linear-gradient(135deg, #FB5607, #FF006E);
    color: white;
}

.article-item:nth-child(12n+6) .article-number {
    background: linear-gradient(135deg, #8338EC, #3A86FF);
    color: white;
}

.article-item:nth-child(12n+7) .article-number {
    background: linear-gradient(135deg, #3A86FF, #00BBF9);
    color: white;
}

.article-item:nth-child(12n+8) .article-number {
    background: linear-gradient(135deg, #FF006E, #F15BB5);
    color: white;
}

.article-item:nth-child(12n+9) .article-number {
    background: linear-gradient(135deg, #1A936F, #88D18A);
    color: white;
}

.article-item:nth-child(12n+10) .article-number {
    background: linear-gradient(135deg, #FF9F1C, #FFD166);
    color: #333;
}

.article-item:nth-child(12n+11) .article-number {
    background: linear-gradient(135deg, #E71D36, #FF5A5F);
    color: white;
}

.article-item:nth-child(12n+12) .article-number {
    background: linear-gradient(135deg, #9B5DE5, #F15BB5);
    color: white;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .article-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
}  

/* ========================================= */
/* 文章标题防溢出处理 */
/* ========================================= */
.article-title, .popular-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s;
}

/* 鼠标悬停显示完整标题 */
.article-title:hover, .popular-title:hover {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* 移动端标题优化 */
@media (max-width: 768px) {
    .article-title, .popular-title {
        font-size: 0.9rem;
        font-weight: 500;
    }
}
/*js 交互相关***/
/* 分类切换active状态 */
.tab-nav li.active {
    /* 这里需要根据实际需求补充样式，JS中进行了添加/移除active类的操作 */
    /* 示例样式 */
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

/* 加载状态样式 */
.articles-grid.loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 6px;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
}

.articles-container {
    position: relative;
    transition: min-height 0.3s ease;
}

.articles-grid {
    transition: opacity 0.3s ease;
}

/* 通知提示样式 */
.action-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 已收藏状态样式 */
.favorite-btn.favorited {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
}

.favorite-btn.favorited:hover {
    background-color: #fecaca;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: -50px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: bottom 0.3s ease-in-out, background-color 0.3s;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    bottom: 200px;
}

.back-to-top:hover {
    background-color: #2980b9;
}

/* 纯CSS箭头 */
.arrow-up {
    display: block;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 16px solid white;
    transform: translateY(-2px);
}

/* 搜索框交互样式 */
.search-box {
    position: fixed;
    left: 0;
    right: 0;
    top: -100px;
    z-index: 9998;
    padding: 6.5px 0;
    background: #fff;
    transition: top 0.3s cubic-bezier(.4, 0, .2, 1);
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box.show {
    top: 0;
    display: block;
}

.search-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    text-decoration: none;
}

.search-close .iconfont {
    font-size: 24px;
    padding: 5px;
}

.search-input {
    text-align: center;
    float: left;
    font-size: 20px;
    font-weight: 700;
    border: none;
    width: 100%;
    height: 50px;
    padding: 4px 12px;
    border-right: none;
    font-size: 16px;
    border-radius: 2px 0 0 2px;
    outline: none;
    border-bottom: 2px solid #007bff;
}

.search-box-form a {
    margin-left: 20px;
    color: #999
}

.search-box-form a:hover {
    color: #0d7ffa
}

/* 移动端菜单交互样式 */
@media (max-width: 992px) {
    .hua-navbar .nav-list {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        padding-top: 70px;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .hua-navbar .nav-list.show {
        right: 0;
    }
    
    .menu-btn {
        display: block;
    }
    
    .menu-btn:before,
    .menu-btn:after,
    .menu-btn span {
        display: block;
        height: 2px;
        background-color: #000;
        content: '';
        transition: all 0.3s;
    }
    
    .hua-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .canvas-close {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 1001;
        cursor: pointer;
    }
}

/* 分页交互样式 */
.pagination .page-numbers.current {
    background: linear-gradient(135deg, #3498db, #1a6ca9);
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}
/* 文章容器包装器 */
.articles-container-wrapper {
  position: relative;
}

/* 文章容器 - 默认隐藏 */
.articles-container {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 激活的文章容器 */
.articles-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* 无文章提示 */
.no-articles {
  text-align: center;
  padding: 30px;
  color: #666;
  font-size: 1.1rem;
}

/* 分类标签激活状态 */
.tab-nav li.active {
  background: #3498db;
  color: white;
}

.tab-nav li.active a {
  color: white;
}