/* ============================================
   文章/博客模块样式
   ============================================ */

/* Hero 区域（对齐 knowledge_hub / community hub） */
.blog-hero-wrap {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}
.blog-hero {
    background: linear-gradient(
        135deg,
        var(--hero-indigo-from, #667eea) 0%,
        var(--hero-indigo-via, #6366f1) 55%,
        var(--hero-purple-to, #8b5cf6) 100%
    );
    border-radius: 16px;
    padding: 2.25rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.09) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
.blog-hero-inner { max-width: 700px; margin: 0 auto; position: relative; z-index: 1; }
.blog-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 .75rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.blog-hero-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* 文章专栏列表：无渐变 hero，使用全站语义色 */
.blog-hero--plain {
    background: transparent;
}

.blog-hero--plain::before {
    display: none;
}

.blog-hero--plain .blog-hero-title {
    color: var(--text-primary);
}

.blog-hero--plain .blog-hero-desc {
    color: var(--text-secondary);
}

/* 容器 */
.blog-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.blog-detail-container { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }

/* 分类筛选 */
.blog-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.blog-filter-tag {
    padding: .35rem .9rem; border-radius: 9999px; font-size: .85rem; font-weight: 500;
    color: #475569; background: #f1f5f9; text-decoration: none; transition: all .2s;
}
.blog-filter-tag:hover { background: #e2e8f0; color: #1e293b; }
.blog-filter-tag.active { background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to)); color: #fff; }

/* 卡片网格 */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.blog-card {
    border-radius: var(--radius-shell); overflow: hidden;
    transition: all .25s; text-decoration: none; display: flex; flex-direction: column;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.blog-card-cover {
    height: 160px; background-size: cover; background-position: center; background-color: #f1f5f9;
}
.blog-card-cover--default {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.blog-card-cover--default i { font-size: 3rem; color: #94a3b8; }

.blog-card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-cat {
    display: inline-block; background: #eff6ff; color: #2563eb; padding: .15rem .6rem;
    border-radius: 9999px; font-size: .72rem; font-weight: 600; margin-bottom: .6rem; width: fit-content;
}
.blog-card-title { font-size: 1.05rem; font-weight: 700; color: #1f2937; margin-bottom: .5rem; line-height: 1.4; }
.blog-card-excerpt { font-size: .85rem; color: #64748b; line-height: 1.6; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-meta { margin-top: .75rem; display: flex; gap: 1rem; font-size: .78rem; color: #94a3b8; }
.blog-card-meta i { margin-right: .15rem; }

/* 分页导航 */
.blog-pagination {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .75rem;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
}

.pagination-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.pagination-current {
    background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to));
    color: #fff;
    border-color: transparent;
    cursor: default;
}

.pagination-current:hover {
    background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to));
    color: #fff;
}

.pagination-prev,
.pagination-next {
    padding: 0 1rem;
    gap: .25rem;
}

.pagination-ellipsis {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
    cursor: default;
}

.pagination-ellipsis:hover {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
}

.pagination-info {
    text-align: center;
    font-size: .8rem;
    color: #94a3b8;
    margin-top: .75rem;
}

/* 加载更多（已废弃，保留样式兼容性）*/
.blog-load-more { display: flex; justify-content: center; margin-top: 2.5rem; padding-bottom: 1rem; }
.blog-load-more-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .75rem 2rem; background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #475569; border: 1px solid #e2e8f0; border-radius: .5rem;
    font-size: .9rem; font-weight: 500; cursor: pointer; transition: all .2s;
}
.blog-load-more-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #1e293b; border-color: #cbd5e1;
}
.blog-load-more-btn:disabled { opacity: .7; cursor: not-allowed; }
.blog-load-more-btn .ri-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 空状态 */
.blog-empty { text-align: center; padding: 4rem 0; color: #94a3b8; }
.blog-empty i { font-size: 3rem; display: block; margin-bottom: .75rem; }

/* 详情页 */
.blog-detail-meta { display: flex; gap: 1.5rem; justify-content: center; font-size: .85rem; color: #64748b; margin-top: .75rem; }
.blog-detail-meta i { margin-right: .2rem; }

/* 文章详情 Hero（无背景色，沿用正文区文字样式） */
.blog-article-hero {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-primary);
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: var(--spacing-xl);
    border-radius: 0 !important;
}
.blog-hero-cat {
    background: #eff6ff !important;
    color: #2563eb !important;
    margin-bottom: .75rem;
    display: inline-block;
}
.blog-hero-h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: .5rem 0 0;
    line-height: 1.4;
}
.blog-hero-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin: .5rem 0 0;
    line-height: 1.5;
}
.blog-hero-meta {
    color: #64748b !important;
    margin-top: .75rem;
}
.blog-hero-tags { margin-top: .75rem; }
.blog-hero-tag {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: none;
}

[data-theme="dark"] .blog-article-hero.site-hero {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
[data-theme="dark"] .blog-article-hero.site-hero::before {
    display: none !important;
}
[data-theme="dark"] .blog-hero-h1 {
    color: rgba(255, 255, 255, 0.88) !important;
}
[data-theme="dark"] .blog-hero-subtitle {
    color: rgba(255, 255, 255, 0.62) !important;
}
[data-theme="dark"] .blog-hero-meta {
    color: rgba(255, 255, 255, 0.52) !important;
}
[data-theme="dark"] .blog-hero-cat {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .blog-hero-tag {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.blog-article { margin-top: 0; }

/* 详情页正文纸张卡片 */
.blog-article-wrap {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem 2.5rem 1.5rem;
    margin-top: 1.5rem;
}

/* 顶部阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--hero-indigo-from), var(--hero-indigo-to));
    z-index: 9999;
    transition: width 0.08s linear;
    border-radius: 0 2px 2px 0;
}

/* 复制按钮栏 */
.blog-copy-bar {
    display: flex; align-items: center; gap: .75rem; padding: 1rem 0;
    border-top: 1px solid #e5e7eb; margin-top: 2rem;
}
.blog-copy-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
    border-radius: .5rem; font-size: .85rem; cursor: pointer; transition: all .2s;
}
.blog-copy-btn:hover { background: #e2e8f0; color: #1e293b; }
.blog-copy-tip { color: #16a34a; font-size: .85rem; font-weight: 600; }

/* 相关文章 */
.blog-related { margin-top: 3rem; }
.blog-related-title { font-size: 1.1rem; font-weight: 700; color: #1f2937; margin-bottom: 1rem; display: flex; align-items: center; gap: .4rem; }
.blog-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.blog-related-card {
    padding: 1rem; border-radius: var(--radius-shell); text-decoration: none; transition: all .2s;
    border: 1px solid var(--glass-border-subtle);
}
.blog-related-card:hover { border-color: var(--border-color); box-shadow: var(--glass-shadow); }
.blog-related-card h4 { font-size: .9rem; font-weight: 600; color: #1f2937; margin-bottom: .4rem; line-height: 1.4; }

/* ============================================
   搜索框
   ============================================ */
.blog-search {
    margin-bottom: 1.25rem;
}

.blog-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-search-icon {
    position: absolute;
    left: .65rem;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    padding: .5rem .5rem .5rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    font-size: .85rem;
    color: #1f2937;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.blog-search-input:focus {
    border-color: var(--hero-indigo-from);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    background: #fff;
}

.blog-search-input::placeholder {
    color: #94a3b8;
}

.blog-search-clear {
    position: absolute;
    right: .5rem;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    transition: color .15s;
}

.blog-search-clear:hover {
    color: #475569;
}

.blog-search-keyword {
    color: var(--hero-indigo-from);
    font-weight: 700;
}

/* ============================================
   侧边栏布局
   ============================================ */
.blog-layout {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* 侧边栏 */
.blog-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.blog-nav-group {
    margin-bottom: 1.5rem;
}

.blog-nav-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: #64748b;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: .5rem;
}

.blog-nav-items {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.blog-nav-item {
    display: block;
    padding: .4rem .75rem;
    border-radius: .375rem;
    font-size: .85rem;
    color: #475569;
    text-decoration: none;
    transition: all .2s;
}

.blog-nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.blog-nav-item.active {
    background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to));
    color: #fff;
}

.blog-nav-item--soon {
    color: #94a3b8;
    cursor: default;
}

.blog-nav-item--soon:hover {
    background: transparent;
    color: #94a3b8;
}

/* 分类 Tab + 平台 Chip（列表页侧栏） */
.blog-nav-section {
    margin-bottom: 1.5rem;
}

.blog-nav-section--platforms {
    margin-bottom: 0;
}

.blog-cat-tabs {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.blog-cat-tab {
    /* 继承 .blog-nav-item */
}

.blog-platform-chips {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.blog-platform-chips .blog-filter-tag {
    display: block;
    text-align: left;
    border-radius: .375rem;
}

.blog-platform-chips .blog-filter-tag.active {
    background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to));
    color: #fff;
}

.blog-platform-chip--taobao.active { color: #fff; }
.blog-platform-chip--jd.active { color: #fff; }
.blog-platform-chip--pdd.active { color: #fff; }
.blog-platform-chip--douyin.active { color: #fff; }
.blog-platform-chip--kuaishou.active { color: #fff; }
.blog-platform-chip--vip.active { color: #fff; }

.blog-nav-section--muted .blog-nav-header {
    opacity: .7;
}

/* 主内容区 */
.blog-main {
    flex: 1;
    min-width: 0;
}

.blog-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.blog-main-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.blog-main-count-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .2rem;
    flex-shrink: 0;
}

.blog-main-count {
    font-size: .85rem;
    color: #64748b;
}

.blog-main-total-hint {
    font-size: .75rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* 横向列表 */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-list-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: .75rem;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all .2s;
}

.blog-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.blog-list-thumb {
    width: 160px;
    height: 84px;
    flex-shrink: 0;
    border-radius: .5rem;
    overflow: hidden;
    background: #f8fafc;
}

.blog-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #f8fafc;
}

.blog-list-thumb-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.blog-list-thumb-default i {
    font-size: 1.5rem;
    color: #94a3b8;
}

.blog-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-list-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: .5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-list-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .75rem;
    color: #94a3b8;
}

.blog-list-meta i {
    margin-right: .15rem;
}

.blog-list-cat {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    padding: .1rem .5rem;
    border-radius: 9999px;
    font-size: .7rem;
    font-weight: 600;
}

.blog-list-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: .1rem .55rem;
    border-radius: 9999px;
    font-size: .7rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.blog-list-item:hover .blog-list-tag {
    background: #e0e7ff;
    color: #4f46e5;
}

.blog-list-time {
    color: #94a3b8;
}

.blog-list-level {
    font-size: .75rem;
}

.blog-list-level .level-hot {
    color: #dc2626;
    font-weight: 600;
}

.blog-list-level .level-high {
    color: #f59e0b;
}

.blog-list-level .level-med {
    color: #64748b;
}

.blog-list-level .level-low {
    color: #94a3b8;
}

/* ============================================
   响应式
   ============================================ */
@media (min-width: 769px) {
    .blog-cat-tab {
        border: none;
        box-shadow: none;
        font-weight: inherit;
    }

    .blog-platform-chips .blog-filter-tag {
        display: block;
        padding: .4rem .75rem;
        border: none;
        border-radius: .375rem;
        font-size: .85rem;
        font-weight: 500;
        background: transparent;
        color: #475569;
        text-align: left;
    }

    .blog-platform-chips .blog-filter-tag:hover {
        background: #f1f5f9;
        color: #1e293b;
    }

    .blog-platform-chips .blog-filter-tag.active {
        background: linear-gradient(135deg, var(--hero-indigo-from), var(--hero-indigo-to));
        color: #fff;
        box-shadow: none;
    }

    .blog-platform-chips--muted,
    .blog-nav-section--muted .blog-nav-header {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-detail-container { padding: 1rem; }
    .blog-detail-meta { flex-wrap: wrap; gap: .75rem; }
    .blog-related-grid { grid-template-columns: 1fr; }

    /* 移动端侧边栏收起 */
    .blog-layout {
        flex-direction: column;
        padding: 1rem;
    }

    .blog-sidebar {
        width: 100%;
    }

    .blog-search {
        margin-bottom: .75rem;
    }

    .blog-search-input {
        min-height: 44px;
        padding-top: .6rem;
        padding-bottom: .6rem;
        border-radius: 10px;
        font-size: .9rem;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    .blog-search-clear {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        right: .15rem;
    }

    .blog-nav-section {
        margin-bottom: .75rem;
    }

    .blog-nav-header {
        font-size: .75rem;
        padding-bottom: .35rem;
        margin-bottom: .4rem;
    }

    .blog-cat-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: .5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 0;
        padding-bottom: .15rem;
    }

    .blog-cat-tabs::-webkit-scrollbar {
        display: none;
    }

    .blog-cat-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: .5rem 1rem;
        border-radius: 9999px;
        border: 1px solid #e2e8f0;
        background: #fff;
        font-weight: 600;
    }

    .blog-cat-tab:not(.active) {
        background: #f8fafc;
        color: #475569;
    }

    .blog-cat-tab.active {
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    }

    .blog-platform-chips {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: .5rem;
    }

    .blog-platform-chips .blog-filter-tag {
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        text-align: center;
        font-size: .8rem;
        font-weight: 600;
        padding: .45rem .35rem;
        min-height: 2.25rem;
        border-radius: 9999px;
        border: 1px solid #e2e8f0;
        background: #fff;
    }

    .blog-platform-chips .blog-filter-tag:not(.active) {
        background: #f8fafc;
        color: #475569;
    }

    .blog-platform-chips .blog-filter-tag.active {
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    }

    .blog-platform-chips--muted {
        opacity: .55;
    }

    .blog-nav-section--muted .blog-nav-header {
        opacity: .55;
    }

    .blog-article-body table,
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .ac-chart-cta a,
    .ac-cta-block a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .blog-hero-wrap {
        padding: 0 1rem;
        margin-top: 1rem;
    }
    .blog-hero {
        border-radius: 12px;
        padding: 1.75rem 1.25rem 1.5rem;
    }
    .blog-hero-title {
        font-size: 1.5rem;
    }
    .blog-layout {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .blog-platform-chips {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-list-thumb {
        width: 120px;
        height: 63px;
    }

    .blog-list-title {
        font-size: .9rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* 移动端分页导航适配 */
    .pagination-nav {
        gap: .25rem;
    }

    .pagination-btn {
        min-width: 2rem;
        height: 2rem;
        padding: 0 .5rem;
        font-size: .8rem;
    }

    .pagination-prev span,
    .pagination-next span {
        display: none;
    }

    .pagination-info {
        font-size: .75rem;
    }
}
