/* 定制剧场 · 小剧场插件页与舞台展示样式 */

/* —— 全屏页：与 love咪 手机屏幕（#custom-theater-app）等大 —— */
#custom-theater-app .ctmt-page {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background: var(--ct-paper, #efe9e2);
}

#custom-theater-app .ctmt-topbar {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-height: calc(54px + var(--ct-safe-top));
    padding: var(--ct-safe-top) max(12px, var(--ct-safe-right)) 0 max(12px, var(--ct-safe-left));
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    border-bottom: 1px solid rgba(49, 56, 68, 0.1);
    background: linear-gradient(180deg, rgba(240, 230, 220, 0.97), rgba(240, 230, 220, 0.86));
}

#custom-theater-app .ctmt-topbar-title { min-width: 0; text-align: center; }
#custom-theater-app .ctmt-topbar-title span {
    display: block;
    margin-bottom: 3px;
    color: #9a6b68;
    font: 700 9px/1.2 "Courier New", monospace;
    letter-spacing: 0.15em;
}
#custom-theater-app .ctmt-topbar-title strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    letter-spacing: 0.14em;
    color: var(--ct-ink);
}

#custom-theater-app .ctmt-topbar-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--ct-ink);
    background: rgba(255, 250, 243, 0.5);
    font-size: 0;
    cursor: pointer;
    touch-action: manipulation;
}
#custom-theater-app .ctmt-topbar-btn svg { width: 22px; height: 22px; }
#custom-theater-app .ctmt-topbar-add { background: var(--ct-blush, #f4cece); }
#custom-theater-app .ctmt-topbar-blank { width: 44px; height: 44px; }

#custom-theater-app .ctmt-body {
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px max(18px, calc(var(--ct-safe-right) + 18px)) calc(24px + var(--ct-safe-bottom)) max(18px, calc(var(--ct-safe-left) + 18px));
    scrollbar-width: none;
}
#custom-theater-app .ctmt-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

#custom-theater-app .ctmt-loading {
    padding: 40px 0;
    display: grid;
    justify-items: center;
    gap: 12px;
    color: var(--ct-ink-soft);
    font-size: 12px;
}
#custom-theater-app .ctmt-loading span {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(49, 56, 68, 0.2);
    border-top-color: var(--ct-ink);
    border-radius: 50%;
    animation: ctmt-spin 0.9s linear infinite;
}
@keyframes ctmt-spin { to { transform: rotate(360deg); } }

#custom-theater-app .ctmt-intro {
    margin: 0 0 12px;
    padding: 11px 13px;
    border: 1px solid rgba(49, 56, 68, 0.12);
    border-radius: 14px;
    background: rgba(247, 241, 234, 0.92);
    color: var(--ct-ink-soft);
    font-size: 11px;
    line-height: 1.7;
}
#custom-theater-app .ctmt-intro strong { color: var(--ct-ink); }

#custom-theater-app .ctmt-summary {
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
#custom-theater-app .ctmt-summary > div {
    padding: 9px 12px;
    border: 1px solid rgba(49, 56, 68, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
}
#custom-theater-app .ctmt-summary span { display: block; color: var(--ct-ink-soft); font-size: 9px; letter-spacing: 0.08em; }
#custom-theater-app .ctmt-summary strong { display: block; margin-top: 2px; font-size: 16px; color: var(--ct-ink); }

#custom-theater-app .ctmt-rows { display: grid; gap: 9px; }
#custom-theater-app .ctmt-empty {
    padding: 26px 12px;
    border: 1px dashed rgba(49, 56, 68, 0.25);
    border-radius: 14px;
    color: var(--ct-ink-soft);
    font-size: 11px;
    text-align: center;
}

#custom-theater-app .ctmt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(49, 56, 68, 0.13);
    border-radius: 15px;
    background: rgba(247, 241, 234, 0.92);
    box-shadow: 5px 5px 12px rgba(73, 62, 55, 0.05), -3px -3px 10px rgba(255, 255, 255, 0.35);
}
#custom-theater-app .ctmt-row.is-enabled { border-color: rgba(154, 107, 104, 0.5); background: rgba(250, 240, 236, 0.95); }

#custom-theater-app .ctmt-switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; cursor: pointer; }
#custom-theater-app .ctmt-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
#custom-theater-app .ctmt-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(49, 56, 68, 0.22);
    transition: background 0.18s ease;
}
#custom-theater-app .ctmt-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fffaf3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}
#custom-theater-app .ctmt-switch input:checked + span { background: #9a6b68; }
#custom-theater-app .ctmt-switch input:checked + span::after { transform: translateX(16px); }

#custom-theater-app .ctmt-row-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
/* 内置小剧场：主体不可点击，只保留左侧开关 */
#custom-theater-app .ctmt-row-main--static { cursor: default; user-select: none; }
#custom-theater-app .ctmt-row-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--ct-ink);
}
#custom-theater-app .ctmt-row-meta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--ct-ink-soft);
    font-size: 9px;
}
#custom-theater-app .ctmt-row-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#custom-theater-app .ctmt-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(70, 81, 96, 0.12);
    color: var(--ct-navy, #465160);
    font-size: 9px;
    letter-spacing: 0.06em;
}
#custom-theater-app .ctmt-badge--builtin { background: rgba(154, 107, 104, 0.16); color: #9a6b68; }
#custom-theater-app .ctmt-badge--readonly { background: rgba(49, 56, 68, 0.08); color: var(--ct-ink-soft); }

#custom-theater-app .ctmt-row-delete {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(178, 82, 82, 0.35);
    border-radius: 10px;
    background: rgba(255, 245, 243, 0.7);
    color: #b25252;
    font-size: 11px;
    cursor: pointer;
}

#custom-theater-app .ctmt-format-hint {
    margin: 14px 0 0;
    color: var(--ct-ink-soft);
    font-size: 10px;
    line-height: 1.7;
    word-break: break-all;
}

#custom-theater-app .ctmt-error {
    padding: 18px 14px;
    border: 1px solid rgba(178, 82, 82, 0.35);
    border-radius: 14px;
    background: rgba(255, 245, 243, 0.8);
    color: #8c4040;
    font-size: 12px;
}
#custom-theater-app .ctmt-error strong { display: block; margin-bottom: 6px; }
#custom-theater-app .ctmt-error p { margin: 0; line-height: 1.6; }

/* —— 编辑器 —— */
#custom-theater-app .ctmt-editor { display: grid; gap: 12px; }
#custom-theater-app .ctmt-field { display: grid; gap: 6px; }
#custom-theater-app .ctmt-field > span { color: var(--ct-ink-soft); font-size: 10px; letter-spacing: 0.04em; }
#custom-theater-app .ctmt-field input,
#custom-theater-app .ctmt-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(49, 56, 68, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ct-ink);
    font-size: 12px;
    line-height: 1.6;
    font-family: inherit;
}
#custom-theater-app .ctmt-field textarea { resize: vertical; }
#custom-theater-app .ctmt-field textarea[name="pattern"],
#custom-theater-app .ctmt-field input[name="flags"] { font-family: "Courier New", monospace; word-break: break-all; }
#custom-theater-app .ctmt-field input[readonly] { opacity: 0.65; }

#custom-theater-app .ctmt-editor-hint {
    margin: 0;
    color: var(--ct-ink-soft);
    font-size: 10px;
    line-height: 1.7;
    word-break: break-all;
}

#custom-theater-app .ctmt-test {
    padding: 12px;
    border: 1px dashed rgba(49, 56, 68, 0.25);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.35);
    display: grid;
    gap: 8px;
}
#custom-theater-app .ctmt-test-head strong { display: block; font-size: 12px; color: var(--ct-ink); }
#custom-theater-app .ctmt-test-head small { display: block; margin-top: 2px; color: var(--ct-ink-soft); font-size: 9px; }
#custom-theater-app .ctmt-test textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(49, 56, 68, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
}
#custom-theater-app .ctmt-test-run {
    justify-self: start;
    padding: 7px 16px;
    border: 1px solid rgba(49, 56, 68, 0.2);
    border-radius: 999px;
    background: rgba(244, 206, 206, 0.55);
    color: var(--ct-ink);
    font-size: 11px;
    cursor: pointer;
}
#custom-theater-app .ctmt-test-result { display: grid; gap: 8px; }
#custom-theater-app .ctmt-test-hit { margin: 0; color: #4d6b4f; font-size: 11px; }
#custom-theater-app .ctmt-test-miss { margin: 0; color: #8c4040; font-size: 11px; }

#custom-theater-app .ctmt-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
#custom-theater-app .ctmt-btn {
    padding: 9px 18px;
    border: 1px solid rgba(49, 56, 68, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--ct-ink);
    font-size: 12px;
    cursor: pointer;
    touch-action: manipulation;
}
#custom-theater-app .ctmt-btn--primary { border-color: rgba(154, 107, 104, 0.6); background: #9a6b68; color: #fffaf3; }
#custom-theater-app .ctmt-btn:disabled { opacity: 0.55; cursor: default; }

/* —— 舞台上的小剧场卡片（正文气泡之后） —— */
#custom-theater-app .ctmt-stage-block {
    margin: 12px 0 0;
    border: 1px solid rgba(49, 56, 68, 0.14);
    border-radius: 16px;
    background: rgba(247, 241, 234, 0.94);
    box-shadow: 6px 6px 14px rgba(73, 62, 55, 0.06), -4px -4px 13px rgba(255, 255, 255, 0.38);
    overflow: hidden;
}
#custom-theater-app .ctmt-stage-block summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    cursor: pointer;
    user-select: none;
}
#custom-theater-app .ctmt-stage-block summary::-webkit-details-marker { display: none; }
#custom-theater-app .ctmt-stage-tag {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(154, 107, 104, 0.16);
    color: #9a6b68;
    font-size: 9px;
    letter-spacing: 0.12em;
}
#custom-theater-app .ctmt-stage-block summary strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--ct-ink);
}
#custom-theater-app .ctmt-stage-caret {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 1.6px solid var(--ct-ink-soft);
    border-bottom: 1.6px solid var(--ct-ink-soft);
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}
#custom-theater-app .ctmt-stage-block[open] .ctmt-stage-caret { transform: rotate(-135deg); }
#custom-theater-app .ctmt-stage-content {
    padding: 0 12px 12px;
    font-size: 12px;
    line-height: 1.75;
    color: var(--ct-ink);
    word-break: break-word;
}
#custom-theater-app .ctmt-plain { margin: 0; white-space: pre-wrap; font-family: inherit; }

/* —— 微博博文详情页（内置「微博热榜」结构） —— */
#custom-theater-app .ctmt-stage-content .wb-page {
    display: block;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}
#custom-theater-app .ctmt-stage-content .wb-post { padding: 13px 13px 11px; }
#custom-theater-app .ctmt-stage-content .wb-author { display: flex; align-items: center; gap: 9px; }
#custom-theater-app .ctmt-stage-content .wb-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8140, #f5c343);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    position: relative;
}
#custom-theater-app .ctmt-stage-content .wb-avatar::after {
    content: "V";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: #ff8200;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}
#custom-theater-app .ctmt-stage-content .wb-author-main { display: block; min-width: 0; }
#custom-theater-app .ctmt-stage-content .wb-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #eb7350;
    font-size: 13px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .wb-verify {
    display: block;
    margin-top: 2px;
    color: #ff8200;
    font-size: 9.5px;
}
#custom-theater-app .ctmt-stage-content .wb-meta { margin-top: 7px; color: #939393; font-size: 10px; }
#custom-theater-app .ctmt-stage-content .wb-text { margin-top: 8px; color: #333; font-size: 12.5px; line-height: 1.8; }
#custom-theater-app .ctmt-stage-content .wb-stats {
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 18px;
    color: #808080;
    font-size: 10.5px;
}
#custom-theater-app .ctmt-stage-content .wb-comments { border-top: 8px solid #f5f5f5; }
#custom-theater-app .ctmt-stage-content .wb-comments-head {
    padding: 10px 13px 6px;
    color: #333;
    font-size: 11.5px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .wb-comment {
    padding: 9px 13px;
    border-top: 1px solid #f5f5f5;
}
#custom-theater-app .ctmt-stage-content .wb-cname { display: block; color: #5b7ba9; font-size: 11px; font-weight: 700; }
#custom-theater-app .ctmt-stage-content .wb-ctext { margin: 4px 0 0; color: #333; font-size: 11.5px; line-height: 1.7; }
#custom-theater-app .ctmt-stage-content .wb-clike { display: block; margin-top: 4px; color: #939393; font-size: 9.5px; text-align: right; }

/* —— 百度贴吧热门贴页面（内置「百度热帖」结构） —— */
#custom-theater-app .ctmt-stage-content .tb-page {
    display: block;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    background: #f5f6f7;
    overflow: hidden;
    color: #333;
}
#custom-theater-app .ctmt-stage-content .tb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    background: linear-gradient(135deg, #4a86e8, #3b6fd0);
    color: #fff;
}
#custom-theater-app .ctmt-stage-content .tb-bar-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
#custom-theater-app .ctmt-stage-content .tb-bar-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #fff;
    color: #3b6fd0;
    font-size: 18px;
    font-weight: 800;
}
#custom-theater-app .ctmt-stage-content .tb-bar-info { display: block; min-width: 0; }
#custom-theater-app .ctmt-stage-content .tb-bar-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .tb-bar-stats { display: block; margin-top: 2px; font-size: 9.5px; opacity: 0.85; }
#custom-theater-app .ctmt-stage-content .tb-bar-sign {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 10px;
}
#custom-theater-app .ctmt-stage-content .tb-tabs {
    display: flex;
    gap: 18px;
    padding: 0 13px;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    font-size: 11.5px;
    color: #666;
}
#custom-theater-app .ctmt-stage-content .tb-tabs span { padding: 9px 0 7px; border-bottom: 2px solid transparent; }
#custom-theater-app .ctmt-stage-content .tb-tabs .is-active { color: #3b6fd0; font-weight: 700; border-bottom-color: #3b6fd0; }
#custom-theater-app .ctmt-stage-content .tb-thread {
    display: block;
    margin-top: 8px;
    background: #fff;
    border-top: 1px solid #e8eaed;
    border-bottom: 1px solid #e8eaed;
}
#custom-theater-app .ctmt-stage-content .tb-thread-head {
    display: block;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
}
#custom-theater-app .ctmt-stage-content .tb-thread-head::-webkit-details-marker { display: none; }
#custom-theater-app .ctmt-stage-content .tb-tag {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 9px;
    line-height: 15px;
    color: #fff;
    background: #8a8f99;
}
#custom-theater-app .ctmt-stage-content .tb-tag--hot { background: #f24e4e; }
#custom-theater-app .ctmt-stage-content .tb-tag--good { background: #f28c1e; }
#custom-theater-app .ctmt-stage-content .tb-tag--top { background: #3b6fd0; }
#custom-theater-app .ctmt-stage-content .tb-title {
    vertical-align: middle;
    color: #1f2a44;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}
#custom-theater-app .ctmt-stage-content .tb-thread[open] .tb-title { color: #3b6fd0; }
#custom-theater-app .ctmt-stage-content .tb-thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 6px;
    color: #999;
    font-size: 10px;
}
#custom-theater-app .ctmt-stage-content .tb-thread-body { border-top: 1px solid #f0f1f3; }
#custom-theater-app .ctmt-stage-content .tb-floor { padding: 11px 13px; border-top: 1px solid #f0f1f3; }
#custom-theater-app .ctmt-stage-content .tb-floor--op { border-top: 0; background: #fbfcfe; }
#custom-theater-app .ctmt-stage-content .tb-floor-user { display: flex; align-items: center; gap: 7px; min-width: 0; }
#custom-theater-app .ctmt-stage-content .tb-avatar {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: linear-gradient(135deg, #7fa7ea, #4a86e8);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .tb-floor--op .tb-avatar { background: linear-gradient(135deg, #a3a9b5, #6f7784); }
#custom-theater-app .ctmt-stage-content .tb-uname {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #3b6fd0;
    font-size: 11.5px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .tb-floor--op .tb-uname { color: #666; }
#custom-theater-app .ctmt-stage-content .tb-lz,
#custom-theater-app .ctmt-stage-content .tb-level {
    flex: 0 0 auto;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 9px;
    line-height: 15px;
}
#custom-theater-app .ctmt-stage-content .tb-lz { background: #3b6fd0; color: #fff; }
#custom-theater-app .ctmt-stage-content .tb-level { background: #eef3fc; color: #3b6fd0; }
#custom-theater-app .ctmt-stage-content .tb-floor-no { flex: 0 0 auto; color: #999; font-size: 10px; }
#custom-theater-app .ctmt-stage-content .tb-floor-text { margin-top: 8px; color: #333; font-size: 12.5px; line-height: 1.8; }
#custom-theater-app .ctmt-stage-content .tb-floor-text p { margin: 0; }
#custom-theater-app .ctmt-stage-content .tb-floor-text p + p { margin-top: 8px; }
#custom-theater-app .ctmt-stage-content .tb-floor--op .tb-floor-text { font-size: 13px; }
#custom-theater-app .ctmt-stage-content .tb-lzl {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 6px;
    background: #f5f6f7;
    color: #555;
    font-size: 11px;
    line-height: 1.65;
}
#custom-theater-app .ctmt-stage-content .tb-lzl + .tb-lzl { margin-top: 4px; }
#custom-theater-app .ctmt-stage-content .tb-lzl b { color: #3b6fd0; font-weight: 700; }
#custom-theater-app .ctmt-stage-content .tb-floor-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: #999;
    font-size: 9.5px;
}
#custom-theater-app .ctmt-stage-content .tb-thread-end {
    padding: 10px 13px;
    border-top: 1px solid #f0f1f3;
    text-align: center;
    color: #999;
    font-size: 10.5px;
}

/* —— 弹幕视频播放页（内置「网剧热播」结构） —— */
#custom-theater-app .ctmt-stage-content .bl-page {
    display: block;
    border: 1px solid #e3e5e7;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    color: #18191c;
}
#custom-theater-app .ctmt-stage-content .bl-player { background: #000; }
/* 16:9 小窗；用 padding 撑高以兼容不支持 aspect-ratio 的旧内核 */
#custom-theater-app .ctmt-stage-content .bl-screen {
    position: relative;
    height: 0;
    padding-top: 56.25%;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a1d 0%, #000 72%);
}
#custom-theater-app .ctmt-stage-content .bl-ended {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #f1f2f3;
    text-align: center;
    z-index: 1;
}
#custom-theater-app .ctmt-stage-content .bl-ended b { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; }
#custom-theater-app .ctmt-stage-content .bl-ended small { font-size: 9.5px; color: rgba(255, 255, 255, 0.62); }
#custom-theater-app .ctmt-stage-content .bl-replay {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}
#custom-theater-app .ctmt-stage-content .bl-replay::before { content: "\21BB"; font-size: 20px; line-height: 1; color: #fff; }
#custom-theater-app .ctmt-stage-content .bl-danmaku {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
#custom-theater-app .ctmt-stage-content .bl-dm {
    position: absolute;
    left: 100%;
    top: 4%;
    white-space: nowrap;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    text-shadow: 0 0 2px #000, 1px 1px 1px rgba(0, 0, 0, 0.9);
    animation: ctmt-bl-fly 10s linear infinite;
    will-change: transform, left;
}
@keyframes ctmt-bl-fly {
    from { left: 100%; transform: translateX(0); }
    to { left: 0; transform: translateX(-100%); }
}
#custom-theater-app .ctmt-stage-content .bl-dm--hl { color: #ffd54f; }
#custom-theater-app .ctmt-stage-content .bl-dm--pink { color: #ff8fb1; }
#custom-theater-app .ctmt-stage-content .bl-dm--blue { color: #7fd0ff; }
/* 十条轨道：按序号轮流分配纵向位置 */
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+1) { top: 4%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+2) { top: 13%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+3) { top: 22%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+4) { top: 31%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+5) { top: 40%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+6) { top: 49%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+7) { top: 58%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+8) { top: 67%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n+9) { top: 76%; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(10n) { top: 85%; }
/* 速度分三档，与轨道错位组合出不同节奏 */
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(3n+1) { animation-duration: 9s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(3n+2) { animation-duration: 12s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(3n) { animation-duration: 15s; }
/* 负延迟：加载瞬间屏幕上就已经有弹幕在飘，而不是全部从右侧同时冒出 */
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+1) { animation-delay: -1s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+2) { animation-delay: -6.5s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+3) { animation-delay: -3s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+4) { animation-delay: -10s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+5) { animation-delay: -4.5s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n+6) { animation-delay: -12s; }
#custom-theater-app .ctmt-stage-content .bl-dm:nth-child(7n) { animation-delay: -8s; }
/* 折叠块收起时停掉动画，避免几十个元素在看不见的地方持续重排 */
#custom-theater-app .ctmt-stage-block:not([open]) .bl-dm { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    #custom-theater-app .ctmt-stage-content .bl-screen { height: auto; padding-top: 0; min-height: 120px; }
    #custom-theater-app .ctmt-stage-content .bl-ended { position: relative; padding: 18px 0 10px; }
    #custom-theater-app .ctmt-stage-content .bl-danmaku { position: relative; display: flex; flex-wrap: wrap; gap: 3px 8px; padding: 6px 10px 10px; }
    #custom-theater-app .ctmt-stage-content .bl-dm { position: static; animation: none; white-space: normal; }
}
#custom-theater-app .ctmt-stage-content .bl-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 10px;
    background: #1c1c1f;
    color: #d8d9dc;
    font-size: 9px;
}
#custom-theater-app .ctmt-stage-content .bl-play {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 9px;
    border-color: transparent transparent transparent #fff;
}
#custom-theater-app .ctmt-stage-content .bl-progress {
    position: relative;
    flex: 1 1 auto;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    overflow: visible;
}
#custom-theater-app .ctmt-stage-content .bl-progress::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: #fb7299;
}
#custom-theater-app .ctmt-stage-content .bl-progress::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fb7299;
    box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.35);
}
#custom-theater-app .ctmt-stage-content .bl-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
#custom-theater-app .ctmt-stage-content .bl-dm-toggle {
    flex: 0 0 auto;
    padding: 1px 6px;
    border: 1px solid #fb7299;
    border-radius: 999px;
    color: #fb7299;
}
#custom-theater-app .ctmt-stage-content .bl-quality { flex: 0 0 auto; color: #fff; font-weight: 700; }
#custom-theater-app .ctmt-stage-content .bl-info { padding: 11px 13px 10px; border-bottom: 1px solid #f1f2f3; }
#custom-theater-app .ctmt-stage-content .bl-title {
    margin: 0;
    color: #18191c;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
}
#custom-theater-app .ctmt-stage-content .bl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 10px;
    margin-top: 6px;
    color: #9499a0;
    font-size: 9.5px;
}
#custom-theater-app .ctmt-stage-content .bl-tag {
    padding: 0 5px;
    border-radius: 3px;
    background: #fb7299;
    color: #fff;
    font-size: 8.5px;
    line-height: 14px;
}
#custom-theater-app .ctmt-stage-content .bl-up {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
#custom-theater-app .ctmt-stage-content .bl-up-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #fb7299, #ff9db5);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .bl-up-main { display: block; flex: 1 1 auto; min-width: 0; }
#custom-theater-app .ctmt-stage-content .bl-up-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fb7299;
    font-size: 12px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .bl-up-desc { display: block; margin-top: 1px; color: #9499a0; font-size: 9.5px; }
#custom-theater-app .ctmt-stage-content .bl-follow {
    flex: 0 0 auto;
    padding: 4px 11px;
    border-radius: 6px;
    background: #f1f2f3;
    color: #61666d;
    font-size: 10px;
}
#custom-theater-app .ctmt-stage-content .bl-actions {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid #f1f2f3;
    color: #61666d;
    font-size: 10px;
}
#custom-theater-app .ctmt-stage-content .bl-comments { padding: 0 13px 6px; }
#custom-theater-app .ctmt-stage-content .bl-comments-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0 6px;
    font-size: 11.5px;
}
#custom-theater-app .ctmt-stage-content .bl-comments-head b { color: #18191c; font-weight: 700; }
#custom-theater-app .ctmt-stage-content .bl-comments-head span { color: #9499a0; font-size: 10px; }
#custom-theater-app .ctmt-stage-content .bl-comment {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 0;
    border-top: 1px solid #f1f2f3;
}
#custom-theater-app .ctmt-stage-content .bl-avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ec5ff, #5b9bff);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .bl-comment:nth-child(3n) .bl-avatar { background: linear-gradient(135deg, #ffb37a, #ff8a5c); }
#custom-theater-app .ctmt-stage-content .bl-comment:nth-child(3n+1) .bl-avatar { background: linear-gradient(135deg, #b39ddb, #8e7cc3); }
#custom-theater-app .ctmt-stage-content .bl-comment-main { flex: 1 1 auto; min-width: 0; }
#custom-theater-app .ctmt-stage-content .bl-cuser { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
#custom-theater-app .ctmt-stage-content .bl-cname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #61666d;
    font-size: 11px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .bl-level {
    padding: 0 4px;
    border-radius: 2px;
    background: #f1f2f3;
    color: #9499a0;
    font-size: 8.5px;
    line-height: 13px;
    font-weight: 700;
}
#custom-theater-app .ctmt-stage-content .bl-ctag {
    padding: 0 5px;
    border: 1px solid #fb7299;
    border-radius: 3px;
    color: #fb7299;
    font-size: 8.5px;
    line-height: 13px;
}
#custom-theater-app .ctmt-stage-content .bl-ctext { margin: 5px 0 0; color: #18191c; font-size: 11.5px; line-height: 1.75; }
#custom-theater-app .ctmt-stage-content .bl-cfoot { display: flex; gap: 12px; margin-top: 5px; color: #9499a0; font-size: 9.5px; }
#custom-theater-app .ctmt-stage-content .bl-reply {
    margin-top: 7px;
    padding: 6px 9px;
    border-radius: 6px;
    background: #f6f7f8;
    color: #61666d;
    font-size: 10.5px;
    line-height: 1.65;
}
#custom-theater-app .ctmt-stage-content .bl-reply + .bl-reply { margin-top: 4px; }
#custom-theater-app .ctmt-stage-content .bl-reply b { color: #61666d; font-weight: 700; }
