/* =========================================================
   萬花筒劇團 前台樣式（依 public/html/front 設計稿套用）
   ========================================================= */

:root {
    --f-font: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
    --f-font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;

    /* 品牌色 */
    --f-primary: #9b2c4a;
    --f-primary-hover: #7f2039;
    --f-primary-soft: #f8e8ee;
    --f-gold: #b9871f;
    --f-gold-soft: #fbf2dc;
    --f-teal: #1f7a8c;
    --f-teal-soft: #e1f1f4;
    --f-purple: #6d4c9f;
    --f-purple-soft: #eee8f7;
    --f-green: #2f7d4f;
    --f-green-soft: #e3f3e8;
    --f-danger: #c62828;
    --f-danger-soft: #fdecec;
    --f-warning: #b45309;
    --f-warning-soft: #fff4e0;

    /* 中性色 */
    --f-bg: #faf8f4;
    --f-surface: #ffffff;
    --f-surface-2: #f4f1ea;
    --f-border: #e8e3da;
    --f-border-strong: #d6cfc3;
    --f-ink: #1f2233;
    --f-ink-2: #2b3047;
    --f-text: #2a2d3d;
    --f-text-2: #5f6474;
    --f-text-3: #8c9099;

    --f-radius: 12px;
    --f-radius-sm: 8px;
    --f-shadow: 0 1px 2px rgba(31, 34, 51, 0.04), 0 2px 8px rgba(31, 34, 51, 0.06);
    --f-shadow-lg: 0 16px 40px rgba(31, 34, 51, 0.14);
    --f-header-height: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--f-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--f-text);
    background: var(--f-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--f-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--f-primary-hover); }

h1, h2, h3, h4 { color: var(--f-ink); font-weight: 700; line-height: 1.35; margin: 0; }

.f-serif { font-family: var(--f-font-display); }

:focus-visible { outline: 3px solid rgba(155, 44, 74, .35); outline-offset: 2px; border-radius: 4px; }

.f-lucide, [data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; vertical-align: -3px; flex-shrink: 0; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.75; vertical-align: -3px; flex-shrink: 0; }
.icon-lg svg.lucide, svg.lucide.icon-lg { width: 22px; height: 22px; }
.icon-xl svg.lucide, svg.lucide.icon-xl { width: 32px; height: 32px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ---------- 版面容器 ---------- */
.f-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 575.98px) { .f-container { padding: 0 16px; } }

/* ---------- 頂列 ---------- */
.f-header {
    position: sticky; top: 0; z-index: 100;
    height: var(--f-header-height);
    background: rgba(250, 248, 244, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--f-border);
}
.f-header .f-container { height: 100%; display: flex; align-items: center; gap: 24px; }

.f-brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.f-brand-logo { display: block; height: 52px; width: auto; }

.f-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.f-nav a {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px;
    color: var(--f-text-2); font-weight: 500; font-size: 15px; transition: background .2s, color .2s;
}
.f-nav a:hover { background: var(--f-surface-2); color: var(--f-ink); }
.f-nav a.active { color: var(--f-primary); background: var(--f-primary-soft); font-weight: 700; }
.f-nav .f-nav-divider { width: 1px; height: 22px; background: var(--f-border-strong); margin: 0 8px; }

.f-header-actions { display: flex; align-items: center; gap: 10px; }
.f-user-chip {
    display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px;
    background: var(--f-surface); border: 1px solid var(--f-border); color: var(--f-ink); font-size: 14px; font-weight: 600;
}
.f-user-chip .avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px;
    background: linear-gradient(135deg, var(--f-purple), var(--f-primary));
}
.f-user-chip:hover { border-color: var(--f-border-strong); color: var(--f-ink); }
/* 頂列的「會員登入」按鈕：文字一律白色（覆寫 .f-nav a 的灰色文字），hover 底色改為較深的灰色 */
.f-nav .f-header-actions .f-btn-primary { color: #fff; }
.f-nav .f-header-actions .f-btn-primary:hover { background: #6b6f7d; color: #fff; }

.f-menu-toggle {
    display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--f-border); border-radius: 10px;
    background: var(--f-surface); color: var(--f-ink); align-items: center; justify-content: center; cursor: pointer;
}

@media (max-width: 991.98px) {
    .f-menu-toggle { display: inline-flex; }
    .f-nav {
        display: none; position: absolute; top: var(--f-header-height); left: 0; right: 0; margin: 0;
        flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 16px 16px;
        background: var(--f-surface); border-bottom: 1px solid var(--f-border); box-shadow: var(--f-shadow-lg);
    }
    .f-nav.open { display: flex; }
    .f-nav a { height: 46px; }
    .f-nav .f-nav-divider { width: 100%; height: 1px; margin: 6px 0; }
    .f-header-actions { display: none; }
    .f-nav .f-header-actions { display: flex; flex-direction: column; align-items: stretch; margin-top: 8px; }
    .f-nav .f-header-actions .f-btn { width: 100%; justify-content: center; }
}

/* ---------- 按鈕 ---------- */
.f-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
    border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .1s; white-space: nowrap;
    font-family: inherit; line-height: 1;
}
.f-btn:active { transform: translateY(1px); }
.f-btn-primary { background: var(--f-primary); color: #fff; }
.f-btn-primary:hover { background: var(--f-primary-hover); color: #fff; }
.f-btn-outline { background: var(--f-surface); color: var(--f-ink); border-color: var(--f-border-strong); }
.f-btn-outline:hover { border-color: var(--f-ink); color: var(--f-ink); }
.f-btn-ghost { background: transparent; color: var(--f-text-2); }
.f-btn-ghost:hover { background: var(--f-surface-2); color: var(--f-ink); }
.f-btn-soft { background: var(--f-primary-soft); color: var(--f-primary); }
.f-btn-soft:hover { background: #f1d7e0; color: var(--f-primary-hover); }
.f-btn-ink { background: var(--f-ink); color: #fff; }
.f-btn-ink:hover { background: #000; color: #fff; }
.f-btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.f-btn-sm svg.lucide { width: 16px; height: 16px; }
.f-btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.f-btn-block { width: 100%; }
.f-btn-locked { background: var(--f-surface-2); color: var(--f-text-2); border-color: var(--f-border); }
.f-btn-locked:hover { background: #ebe6dc; color: var(--f-ink); }
.f-btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.f-btn-danger-outline { background: var(--f-surface); color: var(--f-danger); border-color: #f1c0c0; }
.f-btn-danger-outline:hover { background: var(--f-danger-soft); }

/* ---------- 頁首橫幅（取代原本的圖片橫幅） ---------- */
.f-page-hero {
    position: relative; overflow: hidden; color: #fff;
    background: var(--f-ink);
    padding: 56px 0 48px;
}
.f-page-hero::before {
    content: ""; position: absolute; inset: 0; opacity: .9;
    background:
        radial-gradient(circle at 12% 30%, rgba(155, 44, 74, .55), transparent 38%),
        radial-gradient(circle at 88% 20%, rgba(109, 76, 159, .55), transparent 40%),
        radial-gradient(circle at 70% 90%, rgba(31, 122, 140, .45), transparent 42%),
        radial-gradient(circle at 30% 100%, rgba(185, 135, 31, .35), transparent 38%);
}
.f-page-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
    background-image:
        linear-gradient(60deg, transparent 49.5%, rgba(255,255,255,.12) 50%, transparent 50.5%),
        linear-gradient(-60deg, transparent 49.5%, rgba(255,255,255,.12) 50%, transparent 50.5%),
        linear-gradient(0deg, transparent 49.5%, rgba(255,255,255,.08) 50%, transparent 50.5%);
    background-size: 120px 208px, 120px 208px, 120px 104px;
    mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.f-page-hero .f-container { position: relative; z-index: 1; }
.f-page-hero.compact { padding: 36px 0 32px; }

.f-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.7); margin: 0 0 14px; padding: 0; list-style: none; }
.f-breadcrumb a { color: rgba(255,255,255,.85); }
.f-breadcrumb a:hover { color: #fff; }
.f-breadcrumb li[aria-current] { color: #fff; font-weight: 600; }
.f-breadcrumb svg.lucide { width: 14px; height: 14px; opacity: .6; }

.f-page-title { font-family: var(--f-font-display); font-size: 40px; font-weight: 700; color: #fff; letter-spacing: .04em; line-height: 1.2; }
.f-page-title small { display: block; font-family: var(--f-font); font-size: 13px; letter-spacing: .3em; font-weight: 500; color: var(--f-gold); text-transform: uppercase; margin-bottom: 10px; }
.f-page-desc { margin: 12px 0 0; max-width: 640px; color: rgba(255,255,255,.78); font-size: 16px; }
.f-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.f-hero-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.f-hero-stat {
    min-width: 128px; padding: 12px 16px; border-radius: 12px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px);
}
.f-hero-stat .v { font-family: var(--f-font-display); font-size: 26px; font-weight: 700; color: #fff; line-height: 1.1; }
.f-hero-stat .v small { font-family: var(--f-font); font-size: 13px; font-weight: 500; margin-left: 3px; color: rgba(255,255,255,.7); }
.f-hero-stat .l { font-size: 12px; color: rgba(255,255,255,.7); letter-spacing: .06em; }

@media (max-width: 767.98px) {
    .f-page-hero { padding: 36px 0 32px; }
    .f-page-title { font-size: 30px; }
    .f-hero-stat { min-width: calc(50% - 7px); }
}

/* ---------- 主要內容區 ---------- */
.f-main { padding: 36px 0 72px; min-height: 50vh; }
.f-section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 16px; }
.f-section-title svg.lucide { color: var(--f-primary); }
.f-section-title .count { font-size: 13px; font-weight: 600; color: var(--f-text-2); background: var(--f-surface-2); padding: 2px 10px; border-radius: 999px; }
.f-section-title .right { margin-left: auto; font-size: 14px; font-weight: 500; }

/* ---------- 卡片 ---------- */
.f-card { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius); box-shadow: var(--f-shadow); }
.f-card-body { padding: 24px; }
.f-card-head { padding: 16px 24px; border-bottom: 1px solid var(--f-border); display: flex; align-items: center; gap: 12px; }
.f-card-head h2, .f-card-head h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.f-card-head h2 svg.lucide, .f-card-head h3 svg.lucide { color: var(--f-primary); }
@media (max-width: 575.98px) { .f-card-body { padding: 18px; } .f-card-head { padding: 14px 18px; } }

/* ---------- 篩選工具列 ---------- */
.f-filter { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius); box-shadow: var(--f-shadow); padding: 18px 20px; margin-bottom: 20px; }
.f-filter-row { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 12px; align-items: end; }
.f-filter-row.cols-3 { grid-template-columns: 2fr 1fr 1fr auto; }
@media (max-width: 991.98px) { .f-filter-row, .f-filter-row.cols-3 { grid-template-columns: 1fr 1fr; } .f-filter-row .f-filter-actions { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .f-filter-row, .f-filter-row.cols-3 { grid-template-columns: 1fr; } }

.f-field label { display: block; font-size: 13px; font-weight: 600; color: var(--f-text-2); margin-bottom: 6px; letter-spacing: .02em; }
.f-field label .req { color: var(--f-danger); margin-left: 2px; }
.f-field .hint { font-size: 12.5px; color: var(--f-text-3); margin-top: 6px; line-height: 1.5; }
.f-field .error { font-size: 13px; color: var(--f-danger); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.f-field .error svg.lucide { width: 14px; height: 14px; }
.f-input, .f-select, .f-textarea {
    width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--f-border-strong);
    background: var(--f-surface); color: var(--f-text); font-size: 15px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.f-textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.f-input:focus, .f-select:focus, .f-textarea:focus { outline: none; border-color: var(--f-primary); box-shadow: 0 0 0 3px rgba(155, 44, 74, .14); }
.f-input.is-invalid, .f-select.is-invalid { border-color: var(--f-danger); }
.f-input::placeholder, .f-textarea::placeholder { color: #b3b7c0; }
.f-select { appearance: none; -webkit-appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6474' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center; }
.f-input-icon { position: relative; }
.f-input-icon > svg.lucide { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--f-text-3); pointer-events: none; }
.f-input-icon .f-input { padding-left: 40px; }
.f-input-group { display: flex; }
.f-input-group .f-input { border-radius: 10px 0 0 10px; }
.f-input-group .f-btn { border-radius: 0 10px 10px 0; height: 44px; }
.f-filter-actions { display: flex; gap: 8px; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--f-text-2); cursor: pointer; }
.f-check input { width: 18px; height: 18px; accent-color: var(--f-primary); margin: 0; }
.f-radio-group { display: flex; gap: 18px; flex-wrap: wrap; min-height: 44px; align-items: center; }

/* 已套用的篩選標籤 */
.f-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--f-border); font-size: 13px; color: var(--f-text-2); }
.f-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--f-primary-soft); color: var(--f-primary); font-size: 13px; font-weight: 600; }
.f-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.f-chip button:hover { background: rgba(155, 44, 74, .15); }
.f-chip button svg.lucide { width: 14px; height: 14px; }
.f-active-filters .clear { margin-left: auto; color: var(--f-text-2); text-decoration: underline; }

/* ---------- 結果列 ---------- */
.f-result-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; color: var(--f-text-2); font-size: 14.5px; }
.f-result-bar strong { color: var(--f-ink); font-size: 18px; font-family: var(--f-font-display); margin: 0 3px; }
.f-result-bar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.f-seg { display: inline-flex; background: var(--f-surface-2); border-radius: 10px; padding: 3px; }
.f-seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--f-text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.f-seg button.active { background: var(--f-surface); color: var(--f-ink); box-shadow: var(--f-shadow); }
.f-seg button svg.lucide { width: 15px; height: 15px; }

/* ---------- 登入提示條 ---------- */
.f-notice { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--f-radius); margin-bottom: 20px; border: 1px solid; font-size: 14.5px; }
.f-notice .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.f-notice .body { flex: 1; min-width: 0; }
.f-notice .body strong { color: var(--f-ink); }
.f-notice .f-btn { flex-shrink: 0; }
.f-notice-gold { background: var(--f-gold-soft); border-color: #eedcb0; color: #6b4d0a; }
.f-notice-gold .ic { background: #f3e1b3; color: var(--f-gold); }
.f-notice-warning { background: var(--f-warning-soft); border-color: #f5d7a8; color: #7a4a05; }
.f-notice-warning .ic { background: #fbe4bf; color: var(--f-warning); }
.f-notice-success { background: var(--f-green-soft); border-color: #bfe3cc; color: #1f5b38; }
.f-notice-success .ic { background: #cbe9d6; color: var(--f-green); }
.f-notice-danger { background: var(--f-danger-soft); border-color: #f3bcbc; color: #7a1d1d; }
.f-notice-danger .ic { background: #f7cfcf; color: var(--f-danger); }
.f-notice-info { background: var(--f-teal-soft); border-color: #bfe0e6; color: #16505c; }
.f-notice-info .ic { background: #cfe8ec; color: var(--f-teal); }
@media (max-width: 575.98px) { .f-notice { flex-wrap: wrap; } .f-notice .f-btn { width: 100%; } }

/* ---------- 標籤 ---------- */
.f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.f-tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1; }
.f-tag svg.lucide { width: 13px; height: 13px; }
.f-tag-theme { background: var(--f-purple-soft); color: var(--f-purple); }
.f-tag-scene { background: var(--f-teal-soft); color: var(--f-teal); }
.f-tag-emotion { background: var(--f-gold-soft); color: #8a6412; }
.f-tag-script { background: var(--f-primary-soft); color: var(--f-primary); }
a.f-tag-script:hover { background: var(--f-primary); color: #fff; }
.f-tag-muted { background: var(--f-surface-2); color: var(--f-text-3); }
.f-tag-type { background: var(--f-ink); color: #fff; letter-spacing: .08em; font-weight: 500; }
.f-tag-outline { background: transparent; border: 1px solid var(--f-border-strong); color: var(--f-text-2); }
.f-tag-success { background: var(--f-green-soft); color: var(--f-green); }
.f-tag-warning { background: var(--f-warning-soft); color: var(--f-warning); }
.f-tag-danger { background: var(--f-danger-soft); color: var(--f-danger); }

/* ---------- 劇本卡片 ---------- */
.f-script-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 991.98px) { .f-script-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .f-script-grid { grid-template-columns: 1fr; } }

.f-script-card {
    display: flex; flex-direction: column; background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius);
    box-shadow: var(--f-shadow); overflow: hidden; color: var(--f-text); transition: transform .2s, box-shadow .2s, border-color .2s; height: 100%;
}
.f-script-card:hover { transform: translateY(-3px); box-shadow: var(--f-shadow-lg); border-color: var(--f-border-strong); color: var(--f-text); }
.f-script-cover {
    height: 112px; position: relative; padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between;
    background: linear-gradient(135deg, #2b3047, #1f2233);
}
.f-script-cover::after { content: ""; position: absolute; inset: 0; opacity: .65;
    background: radial-gradient(circle at 85% 120%, var(--cover-a, #9b2c4a), transparent 55%), radial-gradient(circle at 10% -20%, var(--cover-b, #6d4c9f), transparent 50%); }
.f-script-cover > * { position: relative; z-index: 1; }
/* 有上傳封面圖時：圖片鋪滿頁首區塊，上方疊淡漸層確保編號與圖示清楚 */
.f-script-cover.has-image { height: 168px; }
.f-script-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; display: block; }
.f-script-cover.has-image::after { opacity: 1; z-index: 1;
    background: linear-gradient(180deg, rgba(31,34,51,.35) 0%, rgba(31,34,51,0) 45%, rgba(31,34,51,.45) 100%); }
.f-script-cover.has-image > .mark, .f-script-cover.has-image > .no { z-index: 2; }
.f-script-cover.has-image .mark { background: rgba(31,34,51,.45); }
.f-script-cover.has-image .no { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.f-script-cover .no { font-family: var(--f-font-display); font-size: 13px; letter-spacing: .12em; color: rgba(255,255,255,.7); }
.f-script-cover .mark { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center; color: #fff; }
.f-script-body { padding: 18px 18px 8px; flex: 1; }
.f-script-title { font-family: var(--f-font-display); font-size: 21px; color: var(--f-ink); margin: 0 0 8px; }
.f-script-desc { font-size: 14px; color: var(--f-text-2); margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-script-meta { display: flex; gap: 0; border-top: 1px solid var(--f-border); }
.f-script-meta div { flex: 1; text-align: center; padding: 12px 4px; font-size: 12.5px; color: var(--f-text-3); border-right: 1px solid var(--f-border); }
.f-script-meta div:last-child { border-right: 0; }
.f-script-meta b { display: block; font-family: var(--f-font-display); font-size: 20px; color: var(--f-ink); line-height: 1.1; margin-bottom: 2px; }
.f-script-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--f-surface-2); font-size: 14px; font-weight: 600; color: var(--f-primary); }

/* 列表模式 */
.f-script-list .f-script-card { flex-direction: row; align-items: stretch; }
.f-script-list .f-script-cover { width: 160px; height: auto; flex-shrink: 0; }
.f-script-list .f-script-cover.has-image { width: 200px; height: auto; }
.f-script-list .f-script-meta { border-top: 0; border-left: 1px solid var(--f-border); flex-direction: column; width: 120px; }
.f-script-list .f-script-meta div { border-right: 0; border-bottom: 1px solid var(--f-border); }
.f-script-list .f-script-foot { display: none; }

/* ---------- 音樂列表 ---------- */
.f-music-row {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center;
    background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius); box-shadow: var(--f-shadow);
    padding: 18px 22px; margin-bottom: 12px; transition: border-color .2s, box-shadow .2s;
}
.f-music-row:hover { border-color: var(--f-border-strong); box-shadow: var(--f-shadow-lg); }
.f-music-row.playing { border-color: var(--f-teal); }
.f-music-no { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--f-teal-soft); color: var(--f-teal); position: relative; }
.f-music-no .idx { font-family: var(--f-font-display); font-size: 12px; position: absolute; top: 4px; right: 7px; opacity: .7; }
.f-music-title { font-size: 18px; font-weight: 700; color: var(--f-ink); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-music-title .dur { font-family: var(--f-font-display); font-size: 14px; font-weight: 500; color: var(--f-text-3); font-variant-numeric: tabular-nums; }
.f-music-desc { font-size: 14px; color: var(--f-text-2); margin: 4px 0 8px; }
.f-music-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

/* 精簡播放器（會員） */
.f-player { display: flex; align-items: center; gap: 12px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--f-surface-2); border: 1px solid var(--f-border); min-width: 300px; }
.f-player .play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--f-teal); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.f-player .play:hover { background: #16606f; }
.f-player .track { flex: 1; height: 6px; border-radius: 3px; background: #d9d3c6; position: relative; overflow: hidden; }
.f-player .track span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--f-teal); border-radius: 3px; }
.f-player .time { font-size: 12.5px; color: var(--f-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-player .vol { color: var(--f-text-3); }

@media (max-width: 767.98px) {
    .f-music-row { grid-template-columns: 48px 1fr; padding: 16px; }
    .f-music-no { width: 48px; height: 48px; }
    .f-music-actions { grid-column: 1 / -1; justify-content: stretch; flex-wrap: wrap; }
    .f-player { min-width: 0; flex: 1; }
    .f-music-actions .f-btn { flex: 1; }
}

/* ---------- 劇本詳細頁 ---------- */
.f-detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 991.98px) { .f-detail-grid { grid-template-columns: 1fr; } }
.f-aside-sticky { position: sticky; top: calc(var(--f-header-height) + 20px); }

.f-version { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius); box-shadow: var(--f-shadow); margin-bottom: 14px; overflow: hidden; }
.f-version-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; }
.f-version-head:hover { background: var(--f-surface-2); }
.f-version-no { font-family: var(--f-font-display); font-size: 15px; font-weight: 700; color: #fff; background: var(--f-primary); padding: 4px 12px; border-radius: 8px; white-space: nowrap; }
.f-version-text { flex: 1; min-width: 0; }
.f-version-text .t { font-weight: 700; color: var(--f-ink); font-size: 16px; }
.f-version-text .m { font-size: 13px; color: var(--f-text-3); }
.f-version-count { font-size: 13px; color: var(--f-text-2); background: var(--f-surface-2); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.f-version-toggle { color: var(--f-text-3); transition: transform .2s; }
.f-version.open .f-version-toggle { transform: rotate(180deg); }
.f-version-body { display: none; border-top: 1px solid var(--f-border); }
.f-version.open .f-version-body { display: block; }
.f-file { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--f-border); }
.f-file:last-child { border-bottom: 0; }
.f-file-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.f-file-ic.pdf { background: var(--f-danger-soft); color: var(--f-danger); }
.f-file-ic.doc { background: #e6efff; color: #2b579a; }
.f-file-name { flex: 1; min-width: 0; }
.f-file-name .n { font-weight: 600; color: var(--f-ink); overflow-wrap: anywhere; }
.f-file-name .s { font-size: 12.5px; color: var(--f-text-3); }
.f-file-empty { padding: 18px 20px; font-size: 14px; color: var(--f-text-3); display: flex; align-items: center; gap: 8px; }

.f-role-list { list-style: none; margin: 0; padding: 0; }
.f-role-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--f-border); }
.f-role-list li:last-child { border-bottom: 0; }
.f-role-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--f-purple); }
.f-role-list .n { font-weight: 600; color: var(--f-ink); }
.f-role-list .m { font-size: 12.5px; color: var(--f-text-3); }

.f-kv { list-style: none; margin: 0; padding: 0; }
.f-kv li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--f-border); font-size: 14px; }
.f-kv li:last-child { border-bottom: 0; }
.f-kv .k { color: var(--f-text-3); flex-shrink: 0; }
.f-kv .v { color: var(--f-ink); font-weight: 600; text-align: right; }

/* ---------- 表單頁（廠商登錄、會員） ---------- */
.f-form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 991.98px) { .f-form-grid { grid-template-columns: 1fr; } .f-form-grid > aside { order: -1; } }
.f-form-section { padding: 24px; border-bottom: 1px solid var(--f-border); }
.f-form-section:last-child { border-bottom: 0; }
.f-form-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.f-form-section-title .num { width: 30px; height: 30px; border-radius: 50%; background: var(--f-ink); color: #fff; display: grid; place-items: center; font-family: var(--f-font-display); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.f-form-section-title h3 { font-size: 17px; }
.f-form-section-title p { margin: 0; font-size: 13px; color: var(--f-text-3); }
.f-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.f-form-row .full { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .f-form-row { grid-template-columns: 1fr; } .f-form-section { padding: 18px; } }
.f-form-actions { display: flex; align-items: center; gap: 12px; padding: 20px 24px; background: var(--f-surface-2); border-top: 1px solid var(--f-border); border-radius: 0 0 var(--f-radius) var(--f-radius); flex-wrap: wrap; }
.f-form-actions .note { font-size: 13px; color: var(--f-text-3); margin-right: auto; }
.f-conditional { border: 1px dashed var(--f-border-strong); border-radius: 10px; padding: 16px; background: var(--f-surface-2); }
.f-conditional .lead { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--f-text-2); margin-bottom: 12px; }

/* 步驟說明 */
.f-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.f-steps li { position: relative; padding: 0 0 20px 40px; }
.f-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--f-primary-soft); color: var(--f-primary); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.f-steps li::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--f-border); }
.f-steps li:last-child { padding-bottom: 0; }
.f-steps li:last-child::after { display: none; }
.f-steps .t { font-weight: 700; color: var(--f-ink); font-size: 15px; }
.f-steps .d { font-size: 13.5px; color: var(--f-text-2); }

/* 上傳區 */
.f-upload { border: 2px dashed var(--f-border-strong); border-radius: 12px; padding: 18px; text-align: center; background: var(--f-surface-2); transition: border-color .2s, background .2s; cursor: pointer; }
.f-upload:hover { border-color: var(--f-primary); background: var(--f-primary-soft); }
.f-upload svg.lucide { width: 28px; height: 28px; color: var(--f-text-3); }
.f-upload .t { font-weight: 600; color: var(--f-ink); font-size: 14.5px; margin-top: 8px; }
.f-upload .d { font-size: 12.5px; color: var(--f-text-3); }
.f-upload-preview { border: 1px solid var(--f-border); border-radius: 12px; overflow: hidden; background: var(--f-surface); }
.f-upload-preview .img { aspect-ratio: 16 / 10; background: repeating-linear-gradient(45deg, #ece7dd 0 12px, #f4f1ea 12px 24px); display: grid; place-items: center; color: var(--f-text-3); font-size: 13px; }
.f-upload-preview .bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; border-top: 1px solid var(--f-border); }
.f-upload-preview .bar .name { flex: 1; font-weight: 600; color: var(--f-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* reCAPTCHA 佔位 */
.f-recaptcha { display: inline-flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--f-border-strong); border-radius: 6px; background: #f9f9f9; font-size: 14px; color: var(--f-text); }
.f-recaptcha .box { width: 26px; height: 26px; border: 2px solid #c1c1c1; border-radius: 3px; background: #fff; }
.f-recaptcha .logo { margin-left: 16px; font-size: 10px; color: var(--f-text-3); text-align: center; line-height: 1.3; }

/* ---------- 登入頁 ---------- */
.f-auth { min-height: calc(100vh - var(--f-header-height)); display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 991.98px) { .f-auth { grid-template-columns: 1fr; } .f-auth-side { display: none; } }
.f-auth-side { position: relative; overflow: hidden; background: var(--f-ink); color: #fff; padding: 64px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.f-auth-side::before { content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(155, 44, 74, .6), transparent 45%), radial-gradient(circle at 90% 70%, rgba(109, 76, 159, .55), transparent 45%), radial-gradient(circle at 40% 100%, rgba(31, 122, 140, .45), transparent 45%); }
.f-auth-side > * { position: relative; z-index: 1; }
.f-auth-side h2 { font-family: var(--f-font-display); font-size: 36px; color: #fff; line-height: 1.3; margin: 24px 0 14px; }
.f-auth-side p { color: rgba(255,255,255,.75); font-size: 16px; max-width: 420px; }
.f-auth-perks { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; }
.f-auth-perks li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.f-auth-perks .ic { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex-shrink: 0; }
.f-auth-perks .t { font-weight: 600; }
.f-auth-perks .d { font-size: 13px; color: rgba(255,255,255,.7); }
.f-auth-quote { font-family: var(--f-font-display); font-size: 15px; color: rgba(255,255,255,.6); }
.f-auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.f-auth-card { width: 100%; max-width: 460px; }
.f-auth-card .f-card-body { padding: 32px; }
.f-auth-title { font-family: var(--f-font-display); font-size: 28px; margin-bottom: 6px; }
.f-auth-sub { color: var(--f-text-2); font-size: 14.5px; margin: 0 0 24px; }
.f-tabs { display: flex; gap: 4px; background: var(--f-surface-2); padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.f-tabs button { flex: 1; border: 0; background: transparent; height: 40px; border-radius: 9px; font-weight: 600; color: var(--f-text-2); cursor: pointer; font-size: 14.5px; font-family: inherit; }
.f-tabs button.active { background: var(--f-surface); color: var(--f-ink); box-shadow: var(--f-shadow); }
.f-pane { display: none; }
.f-pane.active { display: block; }
.f-form-stack { display: grid; gap: 16px; }
.f-password { position: relative; }
.f-password .f-input { padding-right: 46px; }
.f-password button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--f-text-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.f-password button:hover { background: var(--f-surface-2); color: var(--f-ink); }
.f-auth-links { display: flex; justify-content: space-between; align-items: center; font-size: 14px; flex-wrap: wrap; gap: 8px; }
.f-auth-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--f-text-2); }
.f-auth-foot a { font-weight: 600; }

/* ---------- 會員中心 ---------- */
.f-member-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 991.98px) { .f-member-grid { grid-template-columns: 1fr; } }
.f-member-side .f-card-body { padding: 16px; }
.f-member-profile { display: flex; align-items: center; gap: 14px; padding: 8px 8px 16px; border-bottom: 1px solid var(--f-border); margin-bottom: 10px; }
.f-member-profile .avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 700; background: linear-gradient(135deg, var(--f-purple), var(--f-primary)); }
.f-member-profile .n { font-weight: 700; color: var(--f-ink); }
.f-member-profile .e { font-size: 13px; color: var(--f-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.f-side-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.f-side-menu a { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--f-text-2); font-weight: 500; }
.f-side-menu a:hover { background: var(--f-surface-2); color: var(--f-ink); }
.f-side-menu a.active { background: var(--f-primary-soft); color: var(--f-primary); font-weight: 700; }
.f-side-menu a.danger { color: var(--f-danger); }
.f-side-menu a.danger:hover { background: var(--f-danger-soft); }
.f-side-menu .sep { height: 1px; background: var(--f-border); margin: 8px 4px; }
.f-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 575.98px) { .f-quick { grid-template-columns: 1fr; } }
.f-quick a { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--f-radius); background: var(--f-surface); border: 1px solid var(--f-border); box-shadow: var(--f-shadow); color: var(--f-text); transition: transform .2s, box-shadow .2s; }
.f-quick a:hover { transform: translateY(-2px); box-shadow: var(--f-shadow-lg); color: var(--f-text); }
.f-quick .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.f-quick .t { font-weight: 700; color: var(--f-ink); }
.f-quick .d { font-size: 13px; color: var(--f-text-3); }

/* ---------- 條款頁 ---------- */
.f-article-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
@media (max-width: 991.98px) { .f-article-grid { grid-template-columns: 1fr; } }
.f-toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--f-border); }
.f-toc a { display: block; padding: 8px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--f-text-2); font-size: 14px; }
.f-toc a:hover { color: var(--f-ink); }
.f-toc a.active { color: var(--f-primary); border-left-color: var(--f-primary); font-weight: 600; }
.f-article { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius); box-shadow: var(--f-shadow); padding: 40px 44px; }
@media (max-width: 575.98px) { .f-article { padding: 24px 20px; } }
.f-article h2 { font-family: var(--f-font-display); font-size: 22px; margin: 32px 0 12px; padding-top: 8px; }
.f-article h2:first-child { margin-top: 0; }
.f-article p, .f-article li { color: var(--f-text); font-size: 15.5px; line-height: 1.9; }
.f-article ol, .f-article ul { padding-left: 24px; }
.f-article .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--f-text-3); padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--f-border); }

/* ---------- 空狀態與狀態頁 ---------- */
.f-empty { text-align: center; padding: 56px 20px; background: var(--f-surface); border: 1px dashed var(--f-border-strong); border-radius: var(--f-radius); }
.f-empty .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--f-surface-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--f-text-3); }
.f-empty .ic svg.lucide { width: 32px; height: 32px; }
.f-empty h3 { font-size: 18px; margin-bottom: 6px; }
.f-empty p { color: var(--f-text-2); margin: 0 0 18px; font-size: 14.5px; }
.f-state { max-width: 560px; margin: 24px auto; text-align: center; padding: 48px 32px; }
.f-state .ic { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; }
.f-state .ic svg.lucide { width: 40px; height: 40px; }
.f-state h2 { font-family: var(--f-font-display); font-size: 26px; margin-bottom: 10px; }
.f-state p { color: var(--f-text-2); }
.f-state .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------- 分頁 ---------- */
.f-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.f-pagination a, .f-pagination span { min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--f-text-2); background: var(--f-surface); border: 1px solid var(--f-border); }
.f-pagination a:hover { border-color: var(--f-ink); color: var(--f-ink); }
.f-pagination .active { background: var(--f-ink); color: #fff; border-color: var(--f-ink); }
.f-pagination .dots { border: 0; background: transparent; }

/* ---------- 頁尾 ---------- */
.f-footer { background: var(--f-ink); color: rgba(255,255,255,.72); padding: 56px 0 0; margin-top: 40px; }
.f-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
@media (max-width: 767.98px) { .f-footer-grid { grid-template-columns: 1fr; gap: 28px; } }
/* 頁尾為深色底，Logo 以白底圓角框襯托 */
.f-footer .f-brand { background: #fff; border-radius: 14px; padding: 8px 14px; }
.f-footer .f-brand-logo { height: 60px; }
.f-footer p { font-size: 14px; max-width: 380px; margin: 14px 0 0; }
.f-footer h4 { color: #fff; font-size: 14px; letter-spacing: .12em; margin-bottom: 14px; }
.f-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; }
.f-footer ul a { color: rgba(255,255,255,.75); display: inline-flex; align-items: center; gap: 8px; }
.f-footer ul a:hover { color: #fff; }
.f-footer ul svg.lucide { width: 16px; height: 16px; opacity: .7; }
.f-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 13px; color: rgba(255,255,255,.5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.f-footer-bottom a { color: rgba(255,255,255,.6); }

/* 工具類 */
.f-muted { color: var(--f-text-3); }
.f-small { font-size: 13px; }
.f-mt-0 { margin-top: 0 !important; }
.f-mb-0 { margin-bottom: 0 !important; }
.f-flex { display: flex; align-items: center; gap: 10px; }
.f-wrap { flex-wrap: wrap; }
.f-grow { flex: 1; min-width: 0; }
.f-right { margin-left: auto; }
.f-divider { height: 1px; background: var(--f-border); margin: 20px 0; }
.f-tabular { font-variant-numeric: tabular-nums; }

/* ---------- 正式站補充 ---------- */

/* 頁首橫幅：後台「橫幅圖片管理」有設定圖片時，以圖片為底並疊上漸層 */
.f-page-hero.has-image { background-size: cover; background-position: center; }
.f-page-hero.has-image::before { opacity: .82; background-color: rgba(31, 34, 51, .55); background-blend-mode: normal; }

/* 播放器內的 audio 元素不顯示，由 front.js 驅動 */
.f-player audio { display: none; }
.f-player .track { cursor: pointer; }
.f-player.is-loading .play { opacity: .6; }

/* 表單驗證錯誤 */
.f-field .f-input.is-invalid:focus, .f-field .f-select.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .14); }
.f-errors { margin: 0 0 20px; padding: 14px 18px 14px 44px; border-radius: var(--f-radius); background: var(--f-danger-soft); border: 1px solid #f3bcbc; color: #7a1d1d; font-size: 14.5px; position: relative; }
.f-errors::before { content: ""; position: absolute; left: 16px; top: 16px; width: 18px; height: 18px; border-radius: 50%; background: var(--f-danger); }
.f-errors li { margin: 2px 0; }

/* 條款內容（CKEditor 輸出）沿用 view.css，此處僅調整容器間距 */
.f-article .editor-block { font-size: 15.5px; line-height: 1.9; }
.f-article .editor-block img { max-width: 100%; height: auto; }

/* 註冊成功倒數按鈕 */
.f-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 會員選單（有多個錨點時） */
.f-member-side .f-card { position: sticky; top: calc(var(--f-header-height) + 20px); }

/* 訂閱單選 */
.f-radio-group .f-check input[type="radio"] { width: 18px; height: 18px; }
/* 編輯器區塊 - 防止超寬內容跑版 */
.editor-block {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 表格響應式容器 - 類似 Bootstrap table-responsive */
.table-responsive-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 表格捲軸美化 */
.table-responsive-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-responsive-wrapper::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 4px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}

/* 表格滑動提示 - 漸層陰影 */
.table-responsive-wrapper {
  background:
    linear-gradient(to right, white 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), white 70%) 100% 0,
    linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)),
    linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1)) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* 圖片 */
.editor-block img {
  width: 100%;
  max-width: 100%;
}

/* iframe 嵌入內容（如 YouTube 影片） */
.editor-block iframe {
  max-width: 100%;
}

/* 影片元素 */
.editor-block video {
  max-width: 100%;
}