/*!
 * Ticket #1000014 - shared article table style
 * Scope: rich-text tables inside article/CMS bodies only (web + mobile).
 * Kept intentionally additive: legacy tables with inline styles keep their
 * own borders/padding because inline declarations still win over these rules.
 */
.article-content table,
.acticle-content table,
.news-content table,
.news-main table,
.page-body table,
.page-r table {
    width: 100%;
    max-width: 100%;
    margin: 1.25em 0 1.5em;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: inherit;
    line-height: 1.8;
    color: inherit;
}

.article-content table th,
.article-content table td,
.acticle-content table th,
.acticle-content table td,
.news-content table th,
.news-content table td,
.news-main table th,
.news-main table td,
.page-body table th,
.page-body table td,
.page-r table th,
.page-r table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

/* Header row (thead th, or first row when wangEditor emits tbody-only tables) */
.article-content table thead th,
.acticle-content table thead th,
.news-content table thead th,
.news-main table thead th,
.page-body table thead th,
.page-r table thead th,
.article-content table > tbody > tr:first-child > td,
.article-content table > tbody > tr:first-child > th,
.acticle-content table > tbody > tr:first-child > td,
.acticle-content table > tbody > tr:first-child > th,
.news-content table > tbody > tr:first-child > td,
.news-content table > tbody > tr:first-child > th,
.news-main table > tbody > tr:first-child > td,
.news-main table > tbody > tr:first-child > th,
.page-body table > tbody > tr:first-child > td,
.page-body table > tbody > tr:first-child > th,
.page-r table > tbody > tr:first-child > td,
.page-r table > tbody > tr:first-child > th {
    font-weight: 700;
    background: #f7f8fa;
    border-bottom: 2px solid #d7dbe0;
}

/* Row headers */
.article-content table tbody th,
.acticle-content table tbody th,
.news-content table tbody th,
.news-main table tbody th,
.page-body table tbody th,
.page-r table tbody th {
    font-weight: 600;
    background: #fafbfc;
}

/* First column */
.article-content table tbody td:first-child,
.acticle-content table tbody td:first-child,
.news-content table tbody td:first-child,
.news-main table tbody td:first-child,
.page-body table tbody td:first-child,
.page-r table tbody td:first-child {
    font-weight: 600;
}

.article-content table img,
.acticle-content table img,
.news-content table img,
.news-main table img,
.page-body table img,
.page-r table img {
    max-width: 100%;
    height: auto;
}

/* Phones: scroll wide tables inside the article, never stretch the page */
@media (max-width: 767px) {
    .article-content table,
    .acticle-content table,
    .news-content table,
    .news-main table,
    .page-body table,
    .page-r table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article-content table thead,
    .article-content table tbody,
    .acticle-content table thead,
    .acticle-content table tbody,
    .news-content table thead,
    .news-content table tbody,
    .news-main table thead,
    .news-main table tbody,
    .page-body table thead,
    .page-body table tbody,
    .page-r table thead,
    .page-r table tbody {
        display: table;
        width: auto;
        min-width: 100%;
    }

    .article-content table th,
    .article-content table td,
    .acticle-content table th,
    .acticle-content table td,
    .news-content table th,
    .news-content table td,
    .news-main table th,
    .news-main table td,
    .page-body table th,
    .page-body table td,
    .page-r table th,
    .page-r table td {
        min-width: 7em;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
