/* ============================================================================
 * 檔案名稱：css/styles.css（自訂區塊框樣式與行內文字樣式）
 * 對應腳本：styles.js
 * 載入順序：CSS 第 6 順位（最後載入，確保自訂樣式框能覆蓋預設段落與區塊背景／邊框）
 * ----------------------------------------------------------------------------
 * 【包含內容（前台閱讀頁與後台編輯器共用）】
 *   1. 工具列「自訂樣式」多層下拉子選單（.bs-menu）與右側樣式選擇面板卡片
 *   2. 區塊框樣式（.bk-box-style / .bk-st-block-* / .bk-st-box-*：重點框、警告框、便利貼、對話框、羊皮紙等 40+ 種）
 *   3. 行內文字樣式（.bk-st-*：彩色螢光筆、標籤徽章、鍵盤按鍵 kbd、劇透防雷遮罩 .bk-st-spoiler 等）
 * ============================================================================ */

/* ============================================================
   三、樣式選單（工具列「自訂樣式」：分組 → 子選單）
   ============================================================ */
.bs-menu {
    position: fixed;
    z-index: 300010;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 196px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    overflow-y: auto;
    box-sizing: border-box;
    border-radius: var(--ed-radius-lg, 12px);
    background: var(--ed-panel-bg, #0f172a);
    border: 1px solid var(--ed-border, rgba(255, 255, 255, 0.1));
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: var(--ed-text, #e2e8f0);
    font-size: 13px;
}

.bs-sub {
    min-width: 220px;
}

.bs-it,
.bs-grp {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--ed-radius-md, 8px);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    flex-shrink: 0;
}

.bs-it:hover,
.bs-grp:hover,
.bs-grp.on {
    background: var(--ed-accent-soft, rgba(56, 189, 248, 0.15));
}

.bs-it.on {
    color: var(--ed-accent, #38bdf8);
    background: var(--ed-accent-soft, rgba(56, 189, 248, 0.15));
}

.bs-it:disabled {
    opacity: 0.4;
    cursor: default;
    background: transparent;
}

.bs-tx {
    flex: 1;
    white-space: nowrap;
}

.bs-grp > i {
    font-size: 10px;
    opacity: 0.55;
}

.bs-grp.has > .bs-tx::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--ed-accent, #38bdf8);
    vertical-align: middle;
}

.bs-sep {
    height: 1px;
    margin: 4px 6px;
    background: var(--ed-border, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

/* 每一項前面的小預覽：直接套用該樣式的 class，只取顏色與邊框 */
.bs-pv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 20px;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
}

.bs-pv.bk-doc {
    margin: 0;
    font-size: 12px;
    line-height: 1;
}

.bs-pv--box > [class*="bk-st-"] {
    display: block !important;
    width: 26px !important;
    height: 16px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 2px !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    box-shadow: none !important;
    transform: none !important;
}

.bs-pv > [class*="bk-st-"]::before,
.bs-pv > [class*="bk-st-"]::after {
    content: none !important;
}

.bs-pv--text > [class*="bk-st-"] {
    margin: 0 !important;
    padding: 0 2px !important;
    font-size: 12px !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
}

/* 預覽裡的劇透不要整塊遮住 */
.bs-pv--text > .bk-st-inline-spoiler {
    color: var(--ed-panel-bg, #0f172a) !important;
}

.ed-theme-light .bs-menu,
.light-mode .bs-menu {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

/* ============================================================
   四、框樣式套在區塊上的補充
   ============================================================ */
/* 清單套框：符號收進框內 */
:is(.bk-doc, .bk-editor-root) :is(ul, ol)[class*="bk-st-"] {
    list-style-position: inside;
}

.bk-editor-root :is(ul, ol).has-lv[class*="bk-st-"] > li::before {
    position: static;
}

/* 劇透防雷：前台點一下顯示（block_styles.js 事件委派切換 .is-open） */
:is(.bk-doc, .bk-editor-root) .bk-st-inline-spoiler.is-open {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--bk-st-text-color);
    user-select: text;
}

/* 編輯器內劇透文字要看得到、選得到 */
.bk-editor-root .bk-st-inline-spoiler {
    background-color: rgba(128, 128, 128, 0.25);
    color: inherit;
    user-select: text;
    cursor: text;
}

/* ============================================================
   五、自訂樣式外觀
   ============================================================ */
/* 複製自 legacy/tinymce_editor.css（由樣式設定表對照產生，選擇器改為 .bk-st-<id>；TinyMCE 版不受影響） */
:root, .ed-page, .bk-doc {
    --bk-st-bg-color: #222222;
    --bk-st-border-color: #444444;
    --bk-st-box-accent-error: #dc3545;
    --bk-st-box-accent-highlight: #ffffff;
    --bk-st-box-accent-info: #0dcaf0;
    --bk-st-box-accent-note: #adb5bd;
    --bk-st-box-accent-success: #28a745;
    --bk-st-box-accent-tag: #6f42c1;
    --bk-st-box-accent-thinking: #2196f3;
    --bk-st-box-accent-warning: #ffc107;
    --bk-st-box-bg-error: rgba(220, 53, 69, 0.15);
    --bk-st-box-bg-highlight: rgba(255, 255, 255, 0.12);
    --bk-st-box-bg-info: rgba(13, 202, 240, 0.15);
    --bk-st-box-bg-note: rgba(128, 128, 128, 0.15);
    --bk-st-box-bg-success: rgba(40, 167, 69, 0.15);
    --bk-st-box-bg-tag: rgba(111, 66, 193, 0.15);
    --bk-st-box-bg-thinking: rgba(33, 150, 243, 0.15);
    --bk-st-box-bg-warning: rgba(255, 193, 7, 0.15);
    --bk-st-code-bg: #1e1e1e;
    --bk-st-code-header-bg: #2d2d2d;
    --bk-st-hover-bg: rgba(255, 255, 255, 0.08);
    --bk-st-kbd-bg: #2d3748;
    --bk-st-text-color: #ffffff;
    --bk-st-text-muted: #aaaaaa;
}

.ed-theme-light, .ed-theme-light .bk-doc, [data-theme="light"] .bk-doc, .bk-doc.theme-light {
    --bk-st-bg-color: #ffffff;
    --bk-st-border-color: #dddddd;
    --bk-st-box-accent-error: #dc2626;
    --bk-st-box-accent-highlight: #333333;
    --bk-st-box-accent-info: #0284c7;
    --bk-st-box-accent-note: #64748b;
    --bk-st-box-accent-success: #16a34a;
    --bk-st-box-accent-tag: #7c3aed;
    --bk-st-box-accent-thinking: #2563eb;
    --bk-st-box-accent-warning: #d97706;
    --bk-st-box-bg-error: rgba(239, 68, 68, 0.1);
    --bk-st-box-bg-highlight: rgba(0, 0, 0, 0.05);
    --bk-st-box-bg-info: rgba(14, 165, 233, 0.1);
    --bk-st-box-bg-note: rgba(100, 116, 139, 0.1);
    --bk-st-box-bg-success: rgba(34, 197, 94, 0.1);
    --bk-st-box-bg-tag: rgba(139, 92, 246, 0.1);
    --bk-st-box-bg-thinking: rgba(59, 130, 246, 0.1);
    --bk-st-box-bg-warning: rgba(245, 158, 11, 0.1);
    --bk-st-code-bg: #f8fafc;
    --bk-st-code-header-bg: #f1f5f9;
    --bk-st-hover-bg: rgba(0, 0, 0, 0.04);
    --bk-st-kbd-bg: #e2e8f0;
    --bk-st-text-color: #1a1a1a;
    --bk-st-text-muted: #666666;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-code {
    background-color: rgba(128, 128, 128, 0.15) !important;
    color: var(--bk-st-box-accent-warning) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 0.9em !important;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-sticky {
    padding: 1.2em 1.4em;
    margin: 1.2em 0;
    border-radius: 6px;
    position: relative;
    color: var(--bk-st-text-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    background: transparent;
    transition: all 0.2s ease;
    min-height: 1.5em;
    box-sizing: border-box;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-highlight {
    border-left: 5px solid var(--bk-st-box-accent-highlight);
    background-color: var(--bk-st-box-bg-highlight);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-warning {
    border-left: 8px double var(--bk-st-box-accent-warning);
    background-color: var(--bk-st-box-bg-warning);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-info {
    border-left: 5px solid var(--bk-st-box-accent-info);
    background-color: var(--bk-st-box-bg-info);
    border-top-right-radius: 16px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-success {
    border: 1px solid rgba(40, 167, 69, 0.25);
    border-left: 6px solid var(--bk-st-box-accent-success);
    background-color: var(--bk-st-box-bg-success);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-error {
    border-left: 5px solid var(--bk-st-box-accent-error);
    background-color: var(--bk-st-box-bg-error);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-thinking {
    border-left: 5px dashed var(--bk-st-box-accent-thinking);
    background-color: var(--bk-st-box-bg-thinking);
    font-style: italic;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-tag {
    border-left: 5px solid var(--bk-st-box-accent-tag);
    background-color: var(--bk-st-box-bg-tag);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-note {
    border: 1px solid var(--bk-st-border-color);
    border-left: 4px solid var(--bk-st-box-accent-note);
    background-color: var(--bk-st-box-bg-note);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-hot {
    border-left: 5px solid #ff5722;
    background: linear-gradient(to right, rgba(255, 87, 34, 0.12), transparent);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-data {
    background: var(--bk-st-code-bg);
    border-left: 5px solid var(--bk-st-box-accent-success);
    font-family: monospace;
    color: var(--bk-st-box-accent-success);
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-text {
    background: var(--bk-st-hover-bg);
    border: 2px dashed var(--bk-st-border-color);
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-border {
    background: transparent;
    border: 2px dashed var(--bk-st-border-color);
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-custom {
    border: 2px dashed var(--bk-st-text-muted);
    background-color: var(--bk-st-box-bg-note);
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-question {
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-answer {
    background-color: rgba(23, 162, 184, 0.1);
    border: 2px dashed #17a2b8;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-todo {
    background-color: rgba(173, 181, 189, 0.1);
    border: 2px dashed #adb5bd;
    border-radius: 12px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-reminder {
    background-color: rgba(255, 193, 7, 0.1);
    border: 2px dashed #ffc107;
    border-radius: 12px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-tag {
    border: 2px dashed var(--bk-st-box-accent-tag);
    background-color: var(--bk-st-box-bg-tag);
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-cyan {
    background-color: rgba(13, 202, 240, 0.08);
    border: 2px dashed #0dcaf0;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-pink {
    background-color: rgba(232, 62, 140, 0.08);
    border: 2px dashed #e83e8c;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-orange {
    background-color: rgba(253, 126, 20, 0.08);
    border: 2px dashed #fd7e14;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-green {
    background-color: rgba(40, 167, 69, 0.08);
    border: 2px dashed #28a745;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-red {
    background-color: rgba(220, 53, 69, 0.08);
    border: 2px dashed #dc3545;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-brown {
    background-color: rgba(139, 69, 19, 0.08);
    border: 2px dashed #8b4513;
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-award {
    border: 2px solid var(--bk-st-box-accent-warning);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bk-st-box-bg-warning) 0%, transparent 100%);
    position: relative;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-award::before {
    content: "🏆";
    position: absolute;
    top: -12px;
    right: -10px;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-step {
    border-left: 6px dotted var(--bk-st-box-accent-info);
    background-color: var(--bk-st-box-bg-info);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-summary {
    border-top: 4px solid var(--bk-st-box-accent-thinking);
    background: var(--bk-st-box-bg-thinking);
    border-radius: 0 0 6px 6px;
    font-weight: 500;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-code {
    font-family: Consolas, Monaco, monospace;
    background-color: var(--bk-st-code-bg);
    border: 1px solid var(--bk-st-border-color);
    border-top: 3px solid var(--bk-st-box-accent-thinking);
    border-radius: 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-meeting {
    border-top: 3px double var(--bk-st-box-accent-success);
    border-bottom: 3px double var(--bk-st-box-accent-success);
    background-color: rgba(40, 167, 69, 0.03);
    border-radius: 0;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-quote {
    background-color: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.1);
    border-radius: 6px;
    font-style: italic;
    padding: 1.5em 2.5em;
    position: relative;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-target {
    border: 1px dashed rgba(13, 202, 240, 0.4);
    border-left: 6px solid var(--bk-st-box-accent-info);
    background-image: linear-gradient(135deg, rgba(13, 202, 240, 0.08) 0%, rgba(33, 150, 243, 0.02) 100%);
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-secret {
    border: 1px dashed var(--bk-st-box-accent-tag);
    background: repeating-linear-gradient(45deg, rgba(111, 66, 193, 0.03), rgba(111, 66, 193, 0.03) 10px, rgba(111, 66, 193, 0.06) 10px, rgba(111, 66, 193, 0.06) 20px);
    border-radius: 6px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-sticky {
    background-color: rgba(255, 235, 59, 0.07);
    border-left: 5px solid var(--bk-st-box-accent-warning);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.08);
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-story {
    font-family: Georgia, serif;
    border-top: 2px solid var(--bk-st-border-color);
    border-bottom: 2px solid var(--bk-st-border-color);
    background: rgba(128, 128, 128, 0.05);
    border-radius: 0;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-dialogue {
    background: var(--bk-st-hover-bg);
    border-radius: 16px;
    border-bottom-left-radius: 0;
    display: inline-block;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-caution {
    border: 2px solid var(--bk-st-box-accent-error);
    background: repeating-linear-gradient(45deg, var(--bk-st-box-bg-error), var(--bk-st-box-bg-error) 10px, transparent 10px, transparent 20px);
    border-radius: 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-box-parchment {
    background: rgba(245, 222, 179, 0.1);
    color: var(--bk-st-text-color);
    border: 4px double var(--bk-st-box-accent-warning);
    font-family: Georgia, serif;
    border-radius: 2px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-pros {
    border-top: 4px solid var(--bk-st-box-accent-success);
    background-color: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-cons {
    border-top: 4px solid var(--bk-st-box-accent-error);
    background-color: rgba(220, 53, 69, 0.05);
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-done {
    border: 2px solid var(--bk-st-box-accent-success);
    background: repeating-linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0px, rgba(40, 167, 69, 0.05) 10px, transparent 10px, transparent 20px);
    border-radius: 8px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-block-alert {
    border: 3px solid var(--bk-st-box-accent-error);
    border-top: 12px solid var(--bk-st-box-accent-error);
    background-color: var(--bk-st-box-bg-error);
    border-radius: 6px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-yellow {
    background: linear-gradient(to top, rgba(255, 235, 59, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-green {
    background: linear-gradient(to top, rgba(74, 222, 128, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-blue {
    background: linear-gradient(to top, rgba(56, 189, 248, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-red {
    background: linear-gradient(to top, rgba(248, 113, 113, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-purple {
    background: linear-gradient(to top, rgba(192, 132, 252, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-orange {
    background: linear-gradient(to top, rgba(251, 146, 60, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-half-brown {
    background: linear-gradient(to top, rgba(162, 114, 82, 0.6) 40%, transparent 40%); color: inherit; padding: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-yellow {
    background-color: rgba(255, 235, 59, 0.35); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-green {
    background-color: rgba(74, 222, 128, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-blue {
    background-color: rgba(56, 189, 248, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-red {
    background-color: rgba(248, 113, 113, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-purple {
    background-color: rgba(192, 132, 252, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-orange {
    background-color: rgba(251, 146, 60, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-brown {
    background-color: rgba(162, 114, 82, 0.3); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-mark-gray {
    background-color: rgba(148, 163, 184, 0.25); color: inherit; border-radius: 4px; padding: 1px 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-kbd {
    background-color: var(--bk-st-kbd-bg);
    color: var(--bk-st-text-color);
    border: 1px solid var(--bk-st-border-color);
    border-bottom: 2px solid var(--bk-st-border-color);
    padding: 2px 6px;
    font-size: 0.85em;
    border-radius: 4px;
    font-family: inherit;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-code {
    background-color: rgba(128, 128, 128, 0.15);
    color: var(--bk-st-box-accent-warning);
    padding: 2px 6px;
    font-size: 0.9em;
    border-radius: 4px;
    font-family: monospace;
}

:is(.bk-doc, .bk-editor-root) .bk-st-line-wavy {
    text-decoration: underline wavy var(--bk-st-box-accent-error);
}

:is(.bk-doc, .bk-editor-root) .bk-st-line-dashed {
    text-decoration: underline dashed var(--bk-st-text-muted);
    text-underline-offset: 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-spoiler {
    background-color: var(--bk-st-text-color);
    color: transparent;
    border-radius: 4px;
    padding: 0 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-spoiler:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--bk-st-text-color);
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-rainbow {
    background-image: linear-gradient(to right, #ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    display: inline-block;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-sunset {
    background-image: linear-gradient(to right, #f43f5e, #f97316, #eab308);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    display: inline-block;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-aurora {
    background-image: linear-gradient(to right, #06b6d4, #3b82f6, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    display: inline-block;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-badge {
    padding: 2px 8px;
    border-radius: 12px;
    background-color: var(--bk-st-hover-bg);
    border: 1px solid var(--bk-st-border-color);
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-neon {
    color: #fff;
    text-shadow: 0 0 5px var(--bk-st-box-accent-info), 0 0 10px var(--bk-st-box-accent-info), 0 0 20px var(--bk-st-box-accent-info);
    background-color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-engraved {
    color: var(--bk-st-bg-color);
    text-shadow: 1px 1px 1px var(--bk-st-text-muted), -1px -1px 1px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    background-color: var(--bk-st-text-color);
    padding: 2px 4px;
    border-radius: 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-btn {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bk-st-code-header-bg);
    border: 1px solid var(--bk-st-border-color);
    border-radius: 6px;
    box-shadow: 0 3px 0 var(--bk-st-border-color);
    font-weight: bold;
    transform: translateY(-2px);
    margin: 0 2px;
}

:is(.bk-doc, .bk-editor-root) .bk-st-inline-zoom {
    font-size: 1.25em;
    font-weight: 900;
    color: var(--bk-st-box-accent-error);
    letter-spacing: 1px;
    display: inline-block;
    transform: scale(1.05);
}

/* 文字標籤圖示（TinyMCE 版用 data-icon，這裡寫死在 class） */
:is(.bk-doc, .bk-editor-root) .bk-st-inline-highlight::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-warning::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-info::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-success::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-error::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-thinking::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-tag::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-note::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-question::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-answer::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-reminder::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-alert::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-search::before,
:is(.bk-doc, .bk-editor-root) .bk-st-inline-category::before {
    margin-right: 0.5em;
    font-style: normal;
}
:is(.bk-doc, .bk-editor-root) .bk-st-inline-highlight::before { content: "💡 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-warning::before { content: "⚠️ "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-info::before { content: "📘 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-success::before { content: "✅ "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-error::before { content: "❌ "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-thinking::before { content: "🧠 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-tag::before { content: "📎 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-note::before { content: "📝 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-question::before { content: "❓ "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-answer::before { content: "🧪 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-reminder::before { content: "🔔 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-alert::before { content: "🚨 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-search::before { content: "🔍 "; }
:is(.bk-doc, .bk-editor-root) .bk-st-inline-category::before { content: "📂 "; }



/* ============================================================
   五、套用區塊樣式後，內容與框線之間固定留 10px（上下左右）
   ============================================================ */
:is(.bk-doc, .bk-editor-root) :is([class*="bk-st-box-"], [class*="bk-st-block-"]) {
    padding: 10px;
    box-sizing: border-box;
}

/* 套用區塊樣式的區塊：不顯示「輸入文字…」提示 */
.bk-editor-root > [data-style][data-placeholder]::before,
.bk-editor-root > [data-style] > li[data-placeholder]::before {
    content: none !important;
}

/* ☀️ 亮色紙張：資料框、行內程式碼文字加深，白底才看得清楚 */
:is(.ed-theme-light, [data-theme="light"], .bk-doc.theme-light) .bk-st-box-data { color: #15803d; }
:is(.ed-theme-light, [data-theme="light"], .bk-doc.theme-light) .bk-st-inline-code { color: #b45309 !important; }
