/* 定制剧场 · 小剧场插件页与舞台展示样式 */

/* —— 全屏页：与 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;
}
#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-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; }
