/* 文章積木排版的前台樣式（2026-10-01 從沂恩 static/css/style-site-article.css 的積木段複製）
   只在文章頁載入（themes/drycleaner/library/html_header.lbi 的 {if $pname eq 'article'}）。
   要改外觀請改沂恩那份，再重新鋪過來，不要只改這一站。 */

/* ==========================================================================
   文章積木排版（2026-09-30）
   後台用積木編輯的文章，存檔時由 includes/lib_article_blocks.php 輸出成
   <div class="ab-doc ab-theme-xxx"> 包著的 HTML，外觀全部在這裡。
   配色用變數：換配色只改 .ab-theme-* 這幾組，所有積木文章一起變。
   字級用 em，跟著文章頁的「字級切換」一起放大縮小。
   ========================================================================== */
.ab-doc {
    --ab-ink: var(--en-text, #283d42);
    --ab-muted: #5f6c6e;
    --ab-accent: var(--en-brand, #147486);
    --ab-accent-dk: var(--en-brand-dk, #103f49);
    --ab-soft: #eef6f7;
    --ab-paper: #ffffff;
    --ab-line: #d8e0e0;
    --ab-gold: #9a7232;
    --ab-gold-bg: #fbf6ea;
    --ab-gold-line: #ead9b4;
    --ab-alert: #b3392d;
    --ab-alert-bg: #fdf3f1;
    --ab-alert-line: #f0cfca;
    --ab-deep: #103f49;
    --ab-deep-ink: #f2f7f7;
    --ab-deep-accent: #ecd29c;
    --ab-radius: 12px;
}
.ab-doc.ab-theme-plum {
    --ab-ink: #2f2430; --ab-muted: #6d5f6b; --ab-accent: #6b2d5c; --ab-accent-dk: #4a1d40;
    --ab-soft: #f6eef3; --ab-paper: #fffdf9; --ab-line: #e5d6df;
    --ab-gold: #8f6d33; --ab-gold-bg: #faf4e8; --ab-gold-line: #e6d5b0;
    --ab-deep: #4a1d40; --ab-deep-ink: #fbf5f0; --ab-deep-accent: #e7cf9f;
}
.ab-doc.ab-theme-terracotta {
    --ab-ink: #3a2a24; --ab-muted: #6f5d55; --ab-accent: #a6492f; --ab-accent-dk: #7d3522;
    --ab-soft: #fbf1ea; --ab-paper: #fffdfa; --ab-line: #ecd9cc;
    --ab-gold: #8a6a2c; --ab-gold-bg: #fbf5e6; --ab-gold-line: #e8d8b0;
    --ab-deep: #6e2f1f; --ab-deep-ink: #fdf6ef; --ab-deep-accent: #f0d3a4;
}
.ab-doc.ab-theme-olive {
    --ab-ink: #2f3326; --ab-muted: #62674f; --ab-accent: #56662f; --ab-accent-dk: #3f4a25;
    --ab-soft: #f3f5ea; --ab-paper: #fefefa; --ab-line: #dde2cd;
    --ab-gold: #86702f; --ab-gold-bg: #f9f5e6; --ab-gold-line: #e3d9b2;
    --ab-deep: #3f4a25; --ab-deep-ink: #f7f8ef; --ab-deep-accent: #e6d79f;
}
.ab-doc.ab-theme-ink {
    --ab-ink: #2b2521; --ab-muted: #6a615a; --ab-accent: #4a4038; --ab-accent-dk: #2b2521;
    --ab-soft: #f5f1ea; --ab-paper: #fffefb; --ab-line: #e2dacd;
    --ab-gold: #8a6c38; --ab-gold-bg: #f9f3e6; --ab-gold-line: #e4d6b6;
    --ab-deep: #2b2521; --ab-deep-ink: #f7f2ea; --ab-deep-accent: #e3c894;
}

/* 這一站的「網站主色」（後台積木的配色選「網站主色」時用） */
.ab-doc.ab-theme-site {
    --ab-accent: #20486d;
    --ab-accent-dk: #183a58;
    --ab-soft: #eff2f5;
    --ab-line: #d7dee5;
    --ab-deep: #183a58;
}

/* 為什麼選擇器這麼長：
   文章頁既有的樣式用兩個 ID 直接指定內文裡每個 p／li／span／td／h2／h3 的字級與顏色
   （style-fontsize.css 的 body#page_article #article_content p、style-inner.css 的
   body#page_article .box .bd .article_content h2），一般寫法的積木樣式全部會被蓋掉。
   :not(#a):not(#b):not(#c) 不會排除任何元素，只是把權重墊到三個 ID，讓積木樣式在
   任何頁面都贏過那幾條。範圍只限 .ab-doc 裡面；哪天那幾條舊規則拿掉，這段前綴就能改回 .ab-doc。 */
.ab-doc:not(#a):not(#b):not(#c) {
    max-width: 880px;
    color: var(--ab-ink);
    line-height: 1.85;
}
.ab-doc:not(#a):not(#b):not(#c) p,
.ab-doc:not(#a):not(#b):not(#c) li,
.ab-doc:not(#a):not(#b):not(#c) span,
.ab-doc:not(#a):not(#b):not(#c) div,
.ab-doc:not(#a):not(#b):not(#c) td,
.ab-doc:not(#a):not(#b):not(#c) th,
.ab-doc:not(#a):not(#b):not(#c) h2,
.ab-doc:not(#a):not(#b):not(#c) h3,
.ab-doc:not(#a):not(#b):not(#c) figcaption {
    max-width: none;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    text-indent: 0;
}

.ab-doc:not(#a):not(#b):not(#c) .ab-block { margin: 0 0 28px; }
.ab-doc:not(#a):not(#b):not(#c) > .ab-block:last-child { margin-bottom: 0; }

.ab-doc:not(#a):not(#b):not(#c) .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-step-t,
.ab-doc:not(#a):not(#b):not(#c) .ab-notice-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-q {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ab-accent-dk);
    font-weight: 700;
    line-height: 1.5;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-h { font-size: 1.2em; }
.ab-doc:not(#a):not(#b):not(#c) .ab-text > .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-qa > .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-steps > .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-list > .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-table > .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-compare > .ab-h {
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ab-accent);
    margin-bottom: 16px;
}

.ab-doc:not(#a):not(#b):not(#c) p { padding: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-body p { margin: 0 0 0.9em; }
.ab-doc:not(#a):not(#b):not(#c) .ab-body p:last-child { margin-bottom: 0; }
/* 高砂的深色主題用 !important 把內文連結全改成金色；按鈕白字、深色卡片裡的連結要蓋回來，所以下面三處帶 !important */
.ab-doc:not(#a):not(#b):not(#c) a { color: var(--ab-accent); text-decoration: underline; text-underline-offset: 3px; }
.ab-doc:not(#a):not(#b):not(#c) strong { color: var(--ab-accent-dk); font-weight: 700; }

/* 前情摘要 */
.ab-doc:not(#a):not(#b):not(#c) .ab-summary {
    padding: 20px 22px;
    border-left: 5px solid var(--ab-accent);
    border-radius: 0 var(--ab-radius) var(--ab-radius) 0;
    background: var(--ab-soft);
}

/* 圖片 */
.ab-doc:not(#a):not(#b):not(#c) .ab-fig { position: relative; margin: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-fig img { display: block; width: 100%; height: auto; border-radius: var(--ab-radius); }
.ab-doc:not(#a):not(#b):not(#c) .ab-fig figcaption { margin-top: 8px; color: var(--ab-muted); font-size: 0.88em; line-height: 1.6; text-align: center; }
.ab-doc:not(#a):not(#b):not(#c) .ab-fig-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--ab-deep);
    color: var(--ab-deep-ink);
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.6;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-fig-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    border: 2px dashed var(--ab-line);
    border-radius: var(--ab-radius);
    background: var(--ab-soft);
    color: var(--ab-muted);
    font-size: 0.9em;
}

/* 圖文 */
.ab-doc:not(#a):not(#b):not(#c) .ab-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.ab-doc:not(#a):not(#b):not(#c) .ab-media-right .ab-media-pic { order: 2; }
.ab-doc:not(#a):not(#b):not(#c) .ab-media-top { grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* 前後對照 */
.ab-doc:not(#a):not(#b):not(#c) .ab-compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ab-doc:not(#a):not(#b):not(#c) .ab-cap { margin-top: 12px; color: var(--ab-muted); font-size: 0.94em; }

/* Q&A */
.ab-doc:not(#a):not(#b):not(#c) .ab-qa-item {
    margin: 0 0 12px;
    padding: 16px 18px;
    border: 1px solid var(--ab-line);
    border-radius: var(--ab-radius);
    background: var(--ab-paper);
}
.ab-doc:not(#a):not(#b):not(#c) .ab-qa-item:last-child { margin-bottom: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-q,
.ab-doc:not(#a):not(#b):not(#c) .ab-a { display: flex; gap: 12px; align-items: flex-start; }
.ab-doc:not(#a):not(#b):not(#c) .ab-q { margin: 0; font-size: 1.06em; }
.ab-doc:not(#a):not(#b):not(#c) .ab-a { margin-top: 12px; }
.ab-doc:not(#a):not(#b):not(#c) .ab-a > .ab-body { flex: 1; min-width: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-mark {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ab-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-a > .ab-mark { background: var(--ab-gold); }

/* 步驟拆解 */
.ab-doc:not(#a):not(#b):not(#c) .ab-steps-list { margin: 0; padding: 0; list-style: none; counter-reset: ab-step; }
.ab-doc:not(#a):not(#b):not(#c) .ab-steps-list > li {
    position: relative;
    margin: 0 0 18px;
    padding: 0 0 0 50px;
    list-style: none;
    counter-increment: ab-step;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-steps-list > li:last-child { margin-bottom: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-steps-list > li::before {
    content: counter(ab-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ab-soft);
    border: 2px solid var(--ab-accent);
    color: var(--ab-accent-dk);
    font-size: 15px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
    box-sizing: border-box;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-step-t { margin-bottom: 4px; padding-top: 3px; font-size: 1.06em; }

/* 提醒框 */
.ab-doc:not(#a):not(#b):not(#c) .ab-notice {
    padding: 16px 20px;
    border: 1px solid var(--ab-gold-line);
    border-left: 5px solid var(--ab-gold);
    border-radius: var(--ab-radius);
    background: var(--ab-gold-bg);
}
.ab-doc:not(#a):not(#b):not(#c) .ab-notice-h { margin-bottom: 6px; font-size: 1.06em; }
.ab-doc:not(#a):not(#b):not(#c) .ab-tone-warn .ab-notice-h { color: var(--ab-gold); }
.ab-doc:not(#a):not(#b):not(#c) .ab-tone-info { border-color: var(--ab-line); border-left-color: var(--ab-accent); background: var(--ab-soft); }
.ab-doc:not(#a):not(#b):not(#c) .ab-tone-alert { border-color: var(--ab-alert-line); border-left-color: var(--ab-alert); background: var(--ab-alert-bg); }
.ab-doc:not(#a):not(#b):not(#c) .ab-tone-alert .ab-notice-h { color: var(--ab-alert); }

/* 清單 */
.ab-doc:not(#a):not(#b):not(#c) .ab-list-items { margin: 0; padding: 0; list-style: none; }
.ab-doc:not(#a):not(#b):not(#c) .ab-list-items > li { position: relative; margin: 0 0 8px; padding: 0 0 0 28px; list-style: none; }
.ab-doc:not(#a):not(#b):not(#c) .ab-list-items > li:last-child { margin-bottom: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-list-check > li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--ab-accent); font-weight: 700; }
.ab-doc:not(#a):not(#b):not(#c) .ab-list-dot > li::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0.85em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ab-accent);
}
.ab-doc:not(#a):not(#b):not(#c) ol.ab-list-num { counter-reset: ab-num; }
.ab-doc:not(#a):not(#b):not(#c) ol.ab-list-num > li { counter-increment: ab-num; }
.ab-doc:not(#a):not(#b):not(#c) ol.ab-list-num > li::before { content: counter(ab-num) "."; position: absolute; left: 2px; top: 0; color: var(--ab-accent); font-weight: 700; }

/* 表格 */
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap { overflow-x: auto; border: 1px solid var(--ab-line); border-radius: var(--ab-radius); }
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap table { display: table; width: 100%; max-width: none; margin: 0; border-collapse: collapse; background: var(--ab-paper); }
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap th,
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap td { padding: 11px 14px; border: 0; border-bottom: 1px solid var(--ab-line); font-size: 0.94em; line-height: 1.6; text-align: left; vertical-align: top; }
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap th { background: var(--ab-soft); color: var(--ab-accent-dk); font-weight: 700; white-space: nowrap; }
.ab-doc:not(#a):not(#b):not(#c) .ab-table-wrap tbody tr:last-child td { border-bottom: 0; }

/* 總結小叮嚀 */
.ab-doc:not(#a):not(#b):not(#c) .ab-tips { padding: 22px 24px; border-radius: var(--ab-radius); background: var(--ab-deep); color: var(--ab-deep-ink); }
.ab-doc:not(#a):not(#b):not(#c) .ab-tips .ab-h,
.ab-doc:not(#a):not(#b):not(#c) .ab-tips strong { color: var(--ab-deep-accent); }
.ab-doc:not(#a):not(#b):not(#c) .ab-tips a { color: var(--ab-deep-ink) !important; }
.ab-doc:not(#a):not(#b):not(#c) .ab-tips .ab-body + .ab-list-items { margin-top: 12px; }
.ab-doc:not(#a):not(#b):not(#c) .ab-tips .ab-list-check > li::before { color: var(--ab-deep-accent); }

/* 聯絡按鈕 */
.ab-doc:not(#a):not(#b):not(#c) .ab-cta { padding: 24px 20px; border: 1px solid var(--ab-line); border-radius: var(--ab-radius); background: var(--ab-soft); text-align: center; }
.ab-doc:not(#a):not(#b):not(#c) .ab-cta-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0 0; max-width: none; }
.ab-doc:not(#a):not(#b):not(#c) .ab-cta > .ab-cta-btns:first-child { margin-top: 0; }
.ab-doc:not(#a):not(#b):not(#c) .ab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 8px 28px;
    border: 2px solid var(--ab-accent);
    border-radius: 999px;
    background: var(--ab-accent);
    color: #fff !important;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    box-sizing: border-box;
}
.ab-doc:not(#a):not(#b):not(#c) .ab-btn-2 { background: transparent; color: var(--ab-accent) !important; }

.ab-doc:not(#a):not(#b):not(#c) hr.ab-divider { height: 0; margin: 34px 0; border: 0; border-top: 1px solid var(--ab-line); background: none; }

@media (max-width: 720px) {
    .ab-doc:not(#a):not(#b):not(#c) .ab-block { margin-bottom: 24px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-media { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-media-right .ab-media-pic { order: 0; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-summary,
    .ab-doc:not(#a):not(#b):not(#c) .ab-tips { padding: 16px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-qa-item { padding: 14px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-notice { padding: 14px 16px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-cta { padding: 18px 14px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-compare-grid { gap: 8px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-steps-list > li { padding-left: 46px; }
    .ab-doc:not(#a):not(#b):not(#c) .ab-cta-btns .ab-btn { flex: 1 1 100%; }
}
