::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 隱藏輪播圖滾動條但保持滾動功能 */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Lead Gen 書本漂浮動畫 */
@keyframes bookFloat {
    0%, 100% { transform: perspective(800px) rotateY(-8deg) rotateX(2deg) translateY(0px); }
    50%       { transform: perspective(800px) rotateY(-8deg) rotateX(2deg) translateY(-9px); }
}
.animate-book-float { animation: bookFloat 3.5s ease-in-out infinite; }

/* ══════════════════════════════════════════════════════════════════════════
   文章內頁排版系統
   ─ 選擇器策略：.fow-article-content .wp-block-* (特異度 0,2,0)
     > WP 內建 block CSS (0,1,0)，確保覆蓋 WP 預設 quote 邊框、separator 寬度等
   ─ 此 CSS 也被 enqueue_block_editor_assets 載入，同步改善後台編輯器預覽
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Wrapper 基礎設定 ─────────────────────────────────────────────────── */
.fow-article-content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #475569;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── 段落 ─────────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-paragraph {
    font-size: 1.0625rem;
    line-height: 1.85;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #475569;
}

/* ── 標題 ─────────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-heading {
    color: #083A4F;
    line-height: 1.28;
    letter-spacing: 0.01em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.fow-article-content h1.wp-block-heading {
    font-size: clamp(2rem, 1.55rem + 1.3vw, 2.5rem);
    font-weight: 800;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.22;
}
.fow-article-content h2.wp-block-heading {
    font-size: clamp(1.62rem, 1.35rem + 0.75vw, 2rem);
    font-weight: 760;
    margin-top: 2.4rem;
    margin-bottom: 0.9rem;
    line-height: 1.25;
}
.fow-article-content h3.wp-block-heading {
    font-size: clamp(1.32rem, 1.18rem + 0.45vw, 1.58rem);
    font-weight: 700;
    margin-top: 1.9rem;
    margin-bottom: 0.7rem;
}
.fow-article-content h4.wp-block-heading {
    font-size: clamp(1.12rem, 1.03rem + 0.2vw, 1.25rem);
    font-weight: 680;
    color: #0f4b63;
    margin-top: 1.45rem;
    margin-bottom: 0.45rem;
}
.fow-article-content h5.wp-block-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #1f3b4a;
    margin-top: 1.2rem;
    margin-bottom: 0.35rem;
    opacity: 0.95;
}
.fow-article-content .wp-block-heading:first-child {
    margin-top: 0;
}

/* ── 清單 ─────────────────────────────────────────────────────────────── */
.fow-article-content ul.wp-block-list {
    list-style: disc;
    padding-left: 1.75rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.85;
}
.fow-article-content ol.wp-block-list {
    list-style: decimal;
    padding-left: 1.75rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.85;
}
.fow-article-content .wp-block-list li {
    margin-bottom: 0.5rem;
}
.fow-article-content .wp-block-list ul { list-style: circle; padding-left: 1.5rem; margin: 0.375rem 0; }
.fow-article-content .wp-block-list ol { list-style: lower-alpha; padding-left: 1.5rem; margin: 0.375rem 0; }

/* ── 引述 ─────────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-quote {
    border-left: 4px solid #407E8C;
    border-right: none;
    border-top: none;
    border-bottom: none;
    background-color: #f0f6f7;
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}
.fow-article-content .wp-block-quote p {
    font-size: 1.0625rem;
    line-height: 1.85;
    font-style: italic;
    margin-bottom: 0;
    color: #1e293b;
}
.fow-article-content .wp-block-quote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    font-style: normal;
}

/* ── Pullquote ────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-pullquote {
    border-top: 4px solid #407E8C;
    border-bottom: 4px solid #407E8C;
    border-left: none;
    border-right: none;
    padding: 2rem 1.5rem;
    margin: 2.5rem 0;
    text-align: center;
    background: transparent;
}
.fow-article-content .wp-block-pullquote p {
    font-size: 1.25rem;
    line-height: 1.7;
    font-style: italic;
    color: #083A4F;
    font-weight: 600;
    margin-bottom: 0;
}
.fow-article-content .wp-block-pullquote cite {
    font-size: 0.875rem;
    color: #64748b;
    font-style: normal;
    margin-top: 0.75rem;
    display: block;
}

/* ── 圖片 ─────────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-image {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.fow-article-content .wp-block-image img {
    border-radius: 0.75rem;
    max-width: 100%;
    height: auto;
    display: block;
}
.fow-article-content .wp-block-image figcaption {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #64748b;
    text-align: center;
    margin-top: 0.625rem;
}

/* ── 圖片集 ───────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-gallery { margin: 2rem 0; }
.fow-article-content .wp-block-gallery img { border-radius: 0.5rem; }
.fow-article-content .wp-block-gallery figcaption { font-size: 0.875rem; color: #64748b; }

/* ── 表格 ─────────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-table {
    margin: 2.1rem 0 2.4rem;
    display: block;
    overflow-x: auto;
    border: 1px solid #e6edf2;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding: 0;
}
.fow-article-content .wp-block-table::after {
    display: none;
}
.fow-article-content .wp-block-table table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    background: #ffffff;
}
.fow-article-content .wp-block-table thead th {
    background: #f3f6f9;
    color: #334155;
    font-weight: 700;
    text-align: left;
    padding: 1rem 1.2rem;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #dce5eb;
    white-space: nowrap;
}
.fow-article-content .wp-block-table thead th:first-child {
    border-top-left-radius: 10px;
}
.fow-article-content .wp-block-table thead th:last-child {
    border-top-right-radius: 10px;
}
.fow-article-content .wp-block-table tbody td {
    padding: 1rem 1.2rem;
    color: #334155;
    vertical-align: top;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #ebf1f5;
    background: #ffffff;
}
.fow-article-content .wp-block-table tbody tr:nth-child(even) td {
    background: #f7fafc;
}
.fow-article-content .wp-block-table tbody tr td:first-child {
    font-weight: 700;
    color: #2f3f55;
}
.fow-article-content .wp-block-table tbody tr td small,
.fow-article-content .wp-block-table tbody tr td .fow-subtext {
    color: #64748b;
    font-size: 0.86em;
    font-weight: 400;
}
.fow-article-content .wp-block-table tbody tr:hover td {
    background: #f2f7fb;
}
.fow-article-content .wp-block-table tbody tr:last-child td {
    border-bottom: none;
}
.fow-article-content .wp-block-table .is-numeric,
.fow-article-content .wp-block-table td[style*="text-align:right"],
.fow-article-content .wp-block-table th[style*="text-align:right"],
.fow-article-content .wp-block-table .has-text-align-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.fow-article-content .wp-block-table .is-actions,
.fow-article-content .wp-block-table .fow-table-actions {
    text-align: right;
    white-space: nowrap;
}

/* 狀態 Badge / Tag */
.fow-article-content .wp-block-table .fow-status,
.fow-article-content .wp-block-table .status-badge,
.fow-article-content .wp-block-table .tag {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.56rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.fow-article-content .wp-block-table .fow-status.active,
.fow-article-content .wp-block-table .status-badge.active,
.fow-article-content .wp-block-table .tag.active {
    color: #166534;
    background: #dcfce7;
}
.fow-article-content .wp-block-table .fow-status.pending,
.fow-article-content .wp-block-table .status-badge.pending,
.fow-article-content .wp-block-table .tag.pending {
    color: #92400e;
    background: #fef3c7;
}
.fow-article-content .wp-block-table .fow-status.failed,
.fow-article-content .wp-block-table .status-badge.failed,
.fow-article-content .wp-block-table .tag.failed {
    color: #991b1b;
    background: #fee2e2;
}
.fow-article-content .wp-block-table figcaption {
    font-size: 0.8rem;
    color: #5f7386;
    text-align: left;
    margin-top: 0.7rem;
    padding-left: 0.2rem;
}

/* ── 程式碼區塊 ───────────────────────────────────────────────────────── */
.fow-article-content .wp-block-code {
    background-color: #f1f5f9;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}
.fow-article-content .wp-block-code code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: pre;
    color: #1e293b;
    border: none;
}

/* ── 預格式化（深色背景）────────────────────────────────────────────── */
.fow-article-content .wp-block-preformatted {
    background-color: #0f172a;
    color: #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    white-space: pre;
}

/* ── 分隔線 ───────────────────────────────────────────────────────────── */
.fow-article-content .wp-block-separator {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    border: none;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
}

/* ── 行內 code（非區塊）──────────────────────────────────────────────── */
.fow-article-content code:not(pre code):not(.wp-block-code code) {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background-color: #f1f5f9;
    color: #0f172a;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

/* ── 超連結 ───────────────────────────────────────────────────────────── */
.fow-article-content a:not(.wp-element-button) {
    color: #407E8C;
    text-decoration: underline;
    text-decoration-color: rgba(64, 126, 140, 0.35);
    text-underline-offset: 2px;
    transition: color 0.15s, text-decoration-color 0.15s;
}
.fow-article-content a:not(.wp-element-button):hover {
    color: #083A4F;
    text-decoration-color: rgba(8, 58, 79, 0.5);
}

@media (max-width: 768px) {
    .fow-article-content h1.wp-block-heading {
        font-size: 1.78rem;
        margin-bottom: 0.85rem;
    }

    .fow-article-content h2.wp-block-heading {
        font-size: 1.46rem;
        margin-top: 2rem;
    }

    .fow-article-content h3.wp-block-heading {
        font-size: 1.24rem;
    }

    .fow-article-content h4.wp-block-heading {
        font-size: 1.08rem;
    }

    .fow-article-content h5.wp-block-heading {
        font-size: 0.97rem;
    }

    .fow-article-content .wp-block-table {
        border-radius: 10px;
        margin: 1.45rem 0 1.8rem;
        padding: 0;
    }

    .fow-article-content .wp-block-table table {
        min-width: 620px;
        font-size: 0.88rem;
    }

    .fow-article-content .wp-block-table thead th,
    .fow-article-content .wp-block-table tbody td {
        padding: 0.78rem 0.82rem;
    }

    .fow-article-content .wp-block-table thead th:first-child,
    .fow-article-content .wp-block-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 3;
    }

    .fow-article-content .wp-block-table thead th:first-child {
        background: #f3f6f9;
    }

    .fow-article-content .wp-block-table tbody td:first-child {
        background: #ffffff;
    }

    .fow-article-content .wp-block-table tbody tr:nth-child(even) td:first-child {
        background: #f7fafc;
    }
}