/**
 * 主文章列表 - AJAX加载更多专用完整样式
 * 首页/动态卡片DOM完全一致，统一伪元素文件夹图标
 */
/* ==================== 文章列表基础 ==================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.article-item {
    position: relative;
    padding: 15px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-primary, #e5e7eb);
    border-radius: 12px;
    display: flex;
    gap: 15px;
    /* 常态：阴影预留占位，避免布局跳动 */
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
    transform: translateZ(0);
    /* 重点：进入动画快，退出回弹加 0.12s 延迟 */
    transition: 
        transform 0.3s ease,
        box-shadow 0.3s ease,
        all 0.3s ease 0.12s;
}
.article-item:hover {
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    transform: translateY(-4px) translateZ(0);
    /* hover 状态取消延迟，鼠标一移入立刻生效 */
    transition-delay: 0s;
}
/* 缩略图hover放大 */
.article-item__thumb {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    margin-left: 20px;
    flex-shrink: 0;
    width: 160px;
    height: auto;
    aspect-ratio: 3 / 2;
    background: var(--bg-secondary, #f3f5f8);
}
.article-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-item:hover .article-item__thumb img {
    transform: none;
}

/* Article covers use one 3:2 contract across initial, AJAX, and mobile renders. */
.article-list--image_text .article-item__thumb {
    height: auto;
    aspect-ratio: 3 / 2;
    background: var(--bg-secondary, #f3f5f8);
}
.article-list--image_text .article-item__thumb img {
    object-fit: cover;
    object-position: center;
}
.article-list--image_text .article-item:hover .article-item__thumb img {
    transform: none;
}
/* 标题 */
.article-item__title a {
    transition: color 0.25s ease;
}
.article-item__title a:hover {
    color: var(--theme-color, #3b82f6);
}
.article-item__title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 6px;
}
.article-item__sticky {
    font-size: 12px;
    padding: 2px 6px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 4px;
    margin-right: 6px;
}
.article-item__subtitle {
    font-size: 13px;
    margin-left: 6px;
}
.article-item__new {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    font-size: 11px;
    background: #ef4444;
    color: #fff;
    border-radius: 4px;
}
/* 摘要 */
.article-item__excerpt {
    padding-right: 15px;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.5;
}
.article-item--with-tags .article-item__excerpt,
.article-item--with-categories .article-item__excerpt {
    margin-bottom: 0;
}
/* 标签行容器 */
.sotms-article-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 4px 0;
    flex-wrap: wrap;
}
.sotms-article-categories, .sotms-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}
/* ========== 分类按钮（核心修复：图标位置精准，无裁切） ========== */
.sotms-article-categories {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
/* 分类按钮基础 */
.sotms-article-category {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    position: relative !important;
}
/* 图标强制锁定尺寸、白色线条，不受全局污染 */
.sotms-article-category__icon {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2 !important;
}
/* hover 效果 */
.sotms-article-category:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35) !important;
}
/* 屏蔽全部旧伪元素、冲突样式 */
.sotms-article-category::before,
.sotms-article-category::after {
    display: none !important;
    content: none !important;
}
/* ========== 普通标签样式 ========== */
.sotms-article-tag {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #6b7280 !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    text-decoration: none !important;
    transition: all 0.24s ease !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.sotms-article-tag:hover {
    color: #1f2937 !important;
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
/* 作者、阅读统计栏 */
.article-item__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-right: 15px;
}
.article-item__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.article-item__author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.article-item__stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 10px;
}
.article-item__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}
.article-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}
/* 顶部分类Tab */
.article-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.article-tabs--left {
    justify-content: flex-start;
}
.article-tabs--right {
    justify-content: flex-end;
}
.article-tab {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.24s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.article-tab.active {
    border-color: var(--theme-color);
    background: var(--theme-color);
    color: #fff;
}
.article-tab:hover:not(.active) {
    border-color: var(--theme-color);
    color: var(--theme-color);
}
.article-tab__icon {
    width: 16px;
    height: 16px;
}
/* 加载更多按钮 */
.sotms-ajax-pagination {
    margin: 36px 0;
    text-align: center;
}
.ajax-load-more-btn {
    padding: 8px 34px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--theme-color);
    background: transparent;
    color: var(--theme-color);
    cursor: pointer;
    transition: all 0.24s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ajax-load-more-btn:hover {
    background: var(--theme-color);
    color: #ffffff;
    box-shadow: 0 2px 14px rgba(59, 130, 200, 0.18);
}
.ajax-load-more-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.ajax-load-more-btn.loading {
    pointer-events: none;
}
.load-more-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: transform 0.2s ease;
}
.ajax-load-more-btn:hover .load-more-icon {
    transform: rotate(180deg);
}
.ajax-load-more-btn.loading .load-more-icon {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.ajax-loading-spinner {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}
/* 深色模式 */
html[data-theme="dark"] .article-item {
    background: var(--bg-primary, #1f2937);
    border-color: var(--border-primary, #374151);
}
html[data-theme="dark"] .article-item:hover {
    border-color: var(--theme-color, #60a5fa);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
html[data-theme="dark"] .sotms-article-category {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
}
html[data-theme="dark"] .sotms-article-category:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35) !important;
}
html[data-theme="dark"] .sotms-article-tag {
    color: #d1d5db !important;
    background: #374151 !important;
    border-color: #4b5563 !important;
}
html[data-theme="dark"] .sotms-article-tag:hover {
    color: #f9fafb !important;
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}
html[data-theme="dark"] .ajax-load-more-btn:hover {
    box-shadow: 0 2px 14px rgba(96, 165, 250, 0.22);
}
/* 移动端重写（768px以下手机） */
@media (max-width: 768px) {
    .article-list {
        gap: 6px; /* 文章上下间距缩小 */
        padding: 0;
    }
    .article-item {
        flex-direction: row !important;
        padding: 8px; /* 整体内边距减小，压缩卡片高度 */
        gap: 10px; /* 图文之间间距缩小 */
    }
    .article-item__thumb {
        flex-shrink: 0;
        width: 130px; /* 图片加宽变大 */
        height: auto;
        aspect-ratio: 3 / 2;
        margin-left: 12px; /* 图片左侧留出一点间距 */
    }
    .article-item__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .article-list--image_text .article-item__thumb {
        height: auto;
        aspect-ratio: 3 / 2;
    }
    .article-item__content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding-right: 12px; /* 标题右侧距离边框固定6px */
    }
    .article-item__title {
        font-size: 15px;
        line-height: 1.35; /* 标题行高收窄，减少高度占用 */
    }
    .article-item__excerpt {
        font-size: 13px;
        margin: 2px 0 4px; /* 上下外边距缩小 */
        padding-right: 0;
    }

    .sotms-article-meta-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        gap: 4px;
        padding-bottom: 4px; /* 底部内边距收窄 */
        /* 隐藏滚动条 兼容所有手机 */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    /* webkit浏览器（安卓、苹果手机）隐藏滚动条 */
    .sotms-article-meta-row::-webkit-scrollbar {
        display: none;
    }

    .sotms-article-categories,
    .sotms-article-tags {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        gap: 2px !important;
    }

    .sotms-article-category {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 1px 5px !important;
        font-size: 9px !important;
    }
    .sotms-article-category__icon {
        width: 8px !important;
        height: 8px !important;
    }
    .sotms-article-tag {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 1px 6px !important;
        font-size: 9px !important;
    }

    .article-item__meta {
        margin-top: 4px; /* meta区域上边距缩小 */
    }
    .ajax-load-more-btn {
        padding: 9px 24px;
        font-size: 13px;
    }
    .sotms-ajax-pagination {
        margin: 24px 0;
    }
}
