/* 共用：前台文章正文 + TinyMCE 編輯器內容 */
:root {
    --article-text: #575148;
    --article-text-strong: #30271b;
    --article-heading: #30271b;
    --article-heading-2: #352e25;
    --article-accent: #a87513;
    --article-accent-soft: #efcf82;
    --article-link: #946308;
    --article-border: #e5dac7;
    --article-soft: #fff9ec;
    --article-soft-blue: #f3f7fb;
    --article-editor-bg: #ffffff;
}

.article-content,
body.article-content,
.mce-content-body.article-content {
    font-family: Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 2;
    color: var(--article-text);
    word-break: break-word;
}

body.article-content,
.mce-content-body.article-content {
    background: var(--article-editor-bg);
    color: var(--article-text);
    padding: 34px 38px 40px;
    margin: 0;
}

.mce-content-body.article-content {
    max-width: 980px;
    margin: 0 auto;
}

.article-content > *:first-child,
body.article-content > *:first-child,
.mce-content-body.article-content > *:first-child {
    margin-top: 0 !important;
}

.article-content > *:last-child,
body.article-content > *:last-child,
.mce-content-body.article-content > *:last-child {
    margin-bottom: 0 !important;
}

.article-content h2,
body.article-content h2,
.mce-content-body.article-content h2 {
    position: relative;
    color: var(--article-heading);
    font-size: 30px;
    font-weight: 900;
    margin: 46px 0 16px;
    padding-left: 16px;
    line-height: 1.45;
    letter-spacing: -.02em;
}

.article-content h2::before,
body.article-content h2::before,
.mce-content-body.article-content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .2em;
    width: 5px;
    height: 1.1em;
    border-radius: 999px;
    background: linear-gradient(180deg,#e4c56f,#a87513);
}

.article-content h3,
body.article-content h3,
.mce-content-body.article-content h3 {
    color: var(--article-heading-2);
    font-size: 21px;
    font-weight: 900;
    margin: 28px 0 12px;
    line-height: 1.55;
}

.article-content h4,
body.article-content h4,
.mce-content-body.article-content h4 {
    color: var(--article-text-strong);
    font-size: 18px;
    font-weight: 850;
    margin: 22px 0 10px;
    line-height: 1.55;
}

.article-content p,
body.article-content p,
.mce-content-body.article-content p {
    color: var(--article-text);
    font-size: 16px;
    line-height: 2;
    margin: 0 0 18px;
}

.article-content ul,
.article-content ol,
body.article-content ul,
body.article-content ol,
.mce-content-body.article-content ul,
.mce-content-body.article-content ol {
    color: var(--article-text);
    padding-left: 1.4rem;
    margin: 0 0 20px;
}

.article-content li,
body.article-content li,
.mce-content-body.article-content li {
    margin-bottom: 8px;
    line-height: 1.9;
}

.article-content a,
body.article-content a,
.mce-content-body.article-content a {
    color: var(--article-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content img,
body.article-content img,
.mce-content-body.article-content img,
.article-content figure img,
body.article-content figure img,
.mce-content-body.article-content figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 20px auto;
}

.article-content .article-image-wide,
body.article-content .article-image-wide,
.mce-content-body.article-content .article-image-wide {
    width: 100%;
}

.article-content figure,
body.article-content figure,
.mce-content-body.article-content figure {
    margin: 24px 0;
}

.article-content figcaption,
body.article-content figcaption,
.mce-content-body.article-content figcaption {
    color: #8b8377;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
}

.article-content hr,
body.article-content hr,
.mce-content-body.article-content hr {
    border: 0;
    height: 1px;
    margin: 30px 0;
    background: linear-gradient(90deg,transparent,#e8ddca,transparent);
}

.article-content table,
body.article-content table,
.mce-content-body.article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    border: 1px solid var(--article-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.article-content table th,
.article-content table td,
body.article-content table th,
body.article-content table td,
.mce-content-body.article-content table th,
.mce-content-body.article-content table td {
    border-bottom: 1px solid #ece3d5;
    padding: 13px 14px;
    vertical-align: top;
    color: var(--article-text);
}

.article-content table th,
body.article-content table th,
.mce-content-body.article-content table th {
    color: #efcb79;
    background: #2a2319;
    font-weight: 850;
}

.article-content table tr:last-child td,
body.article-content table tr:last-child td,
.mce-content-body.article-content table tr:last-child td {
    border-bottom: 0;
}

.article-content blockquote,
body.article-content blockquote,
.mce-content-body.article-content blockquote {
    margin: 24px 0;
    padding: 18px 20px;
    border-left: 4px solid #d1a446;
    background: var(--article-soft);
    border-radius: 0 14px 14px 0;
    color: #5d5446;
}

.article-content pre,
body.article-content pre,
.mce-content-body.article-content pre {
    margin: 22px 0;
    padding: 17px 18px;
    background: #292218;
    color: #f8f5ed;
    border-radius: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.article-content code,
body.article-content code,
.mce-content-body.article-content code {
    font-family: Consolas, Monaco, monospace;
}

.article-content .article-tip-box,
body.article-content .article-tip-box,
.mce-content-body.article-content .article-tip-box {
    background: linear-gradient(145deg,#fff9e9,#fff);
    border: 1px solid #dfc98e;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 22px 0;
    color: #5d5446;
}

.article-content .article-tip-box strong,
body.article-content .article-tip-box strong,
.mce-content-body.article-content .article-tip-box strong {
    color: #8f620d;
}

.article-content .article-note-box,
body.article-content .article-note-box,
.mce-content-body.article-content .article-note-box {
    background: var(--article-soft-blue);
    border: 1px solid #d7e3ef;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 22px 0;
    color: #52606d;
}

.article-content .article-note-box strong,
body.article-content .article-note-box strong,
.mce-content-body.article-content .article-note-box strong {
    color: #315b7d;
}

/* TinyMCE 編輯狀態：保留淡灰外圍，正文與前台同樣為白底 */
html {
    background: #f7f3eb;
}

@media (max-width: 767.98px) {
    body.article-content,
    .mce-content-body.article-content {
        padding: 22px 18px 26px;
    }

    .article-content,
    body.article-content,
    .mce-content-body.article-content {
        font-size: 15px;
    }

    .article-content h2,
    body.article-content h2,
    .mce-content-body.article-content h2 {
        font-size: 24px;
        margin-top: 38px;
    }

    .article-content h3,
    body.article-content h3,
    .mce-content-body.article-content h3 {
        font-size: 19px;
    }

    .article-content p,
    body.article-content p,
    .mce-content-body.article-content p {
        font-size: 15px;
        line-height: 1.95;
    }
}
