/* =====================
   page wrapper
===================== */

.article-page {
    padding: 0px 0 40px;
}


/* =====================
   page header
===================== */

.article-page .page-header {
    margin-bottom: 10px;
    padding: 0px 0 10px;
}

.article-page .page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.3;
}

.article-page .page-header p {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.7;
}


/* =====================
   category bar
===================== */

.article-category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.category-btn.active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
}


/* =====================
   article list
===================== */

.article-list-wrap {
    width: 100%;
}


/* =====================
   article card
===================== */

.article-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}


/* =====================
   cover
===================== */

.article-cover {
    width: 220px;
    flex-shrink: 0;
    display: block;
}

.article-cover img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}


/* =====================
   info
===================== */

.article-info {
    flex: 1;
    min-width: 0;
}

.article-info h2 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.4;
}

.article-info a {
    color: #222;
    text-decoration: none;
}

.article-info a:hover {
    color: #1677ff;
}

.article-meta {
    color: #888;
    margin-bottom: 12px;
    font-size: 14px;
}

.article-info p {
    margin: 0;
    color: #555;
    line-height: 1.8;
    font-size: 15px;
}


/* =====================
   empty / loading / error
===================== */

.loading,
.empty,
.error {
    padding: 40px;
    text-align: center;
    color: #777;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}


/* =====================
   tablet
===================== */

@media (max-width: 992px) {

    .article-page {
        padding: 16px 0 32px;
    }

    .article-page .page-header {
        padding: 16px 0 8px;
        margin-bottom: 18px;
    }

    .article-page .page-header h1 {
        font-size: 28px;
    }

    .article-card {
        gap: 16px;
        padding: 16px;
    }

    .article-cover {
        width: 180px;
    }

    .article-info h2 {
        font-size: 20px;
    }
}


/* =====================
   mobile
===================== */

@media (max-width: 768px) {

    .article-page {
        padding: 12px 0 28px;
    }

    .article-page .page-header {
        padding: 10px 0 8px;
        margin-bottom: 16px;
    }

    .article-page .page-header h1 {
        font-size: 26px;
    }

    .article-page .page-header p {
        font-size: 14px;
        line-height: 1.6;
    }

    /* 分类按钮手机横向滚动 */
    .article-category-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        margin-bottom: 18px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .article-category-bar::-webkit-scrollbar {
        display: none;
    }

    .category-btn {
        flex: 0 0 auto;
        padding: 7px 14px;
        font-size: 13px;
    }

    .article-card {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .article-cover {
        width: 100%;
    }

    .article-cover img {
        aspect-ratio: 16 / 9;
    }

    .article-info h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .article-meta {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .article-info p {
        font-size: 14px;
        line-height: 1.7;
    }

    .loading,
    .empty,
    .error {
        padding: 28px 12px;
    }
}


/* =====================
   small mobile
===================== */

@media (max-width: 480px) {

    .article-page {
        padding: 8px 0 24px;
    }

    .article-page .page-header h1 {
        font-size: 24px;
    }

    .article-card {
        padding: 12px;
        border-radius: 6px;
    }

    .article-info h2 {
        font-size: 17px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* =========================
   Mobile Article Page Spacing
   技术资料页手机端留白 + 分类全部显示
========================= */

@media (max-width: 768px) {

    .article-page,
    .articles-page,
    .news-page {
        padding: 24px 14px 28px !important;
    }

    .article-header,
    .page-header {
        margin-top: 14px;
        margin-bottom: 18px;
        padding: 0 2px;
    }

    .article-header h1,
    .page-header h1,
    .page-header h2 {
        font-size: 24px;
        line-height: 1.35;
        margin-bottom: 8px;
    }

    .article-header p,
    .page-header p {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 14px;
    }

    /* 分类筛选：全部显示，自动换行 */
    .article-categories,
    .category-filter,
    .filter-tags,
    #articleCategories {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;

        overflow: visible !important;
        white-space: normal !important;

        margin-top: 14px;
        margin-bottom: 18px;
        padding: 0 2px;
    }

    .article-categories button,
    .category-filter button,
    .filter-tags button,
    #articleCategories button,
    .article-categories a,
    .category-filter a,
    .filter-tags a,
    #articleCategories a {
        flex: 0 0 auto;
        max-width: 100%;

        height: 32px;
        padding: 0 14px;

        border-radius: 6px;
        white-space: nowrap;
    }

}

/* =========================
   Article Category Bar
   手机端分类按钮全部显示，不横向拖动
========================= */

.article-category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow: visible;
    white-space: normal;
}

.article-category-bar .category-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 手机端 */
@media (max-width: 768px) {

    .article-page {
        padding: 24px 14px 28px !important;
    }

    .page-header {
        margin-top: 14px;
        margin-bottom: 16px;
    }

    .article-category-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;

        overflow: visible !important;
        overflow-x: visible !important;

        white-space: normal !important;

        margin: 14px 0 18px;
        padding: 0 2px;
    }

    .article-category-bar .category-btn {
        flex: 0 0 auto !important;

        height: 32px;
        padding: 0 14px;

        border-radius: 6px;
        white-space: nowrap !important;
    }

}