/* 定制剧场 · 舞台总结中心（仅作用于 #custom-theater-app）。 */
#custom-theater-app .cts-center {
    position: absolute;
    z-index: 42;
    left: 0;
    right: 0;
    bottom: 0;
    top: calc(-1 * (var(--ct-safe-top) + 54px));
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: var(--ct-ink, #313844);
    background:
        radial-gradient(circle at 88% 4%, rgba(174, 117, 110, .12), transparent 30%),
        linear-gradient(180deg, rgba(248, 244, 239, .99), rgba(237, 230, 223, .99));
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

#custom-theater-app .cts-header {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-height: calc(var(--ct-safe-top) + 58px);
    padding: calc(var(--ct-safe-top) + 8px) max(14px, calc(var(--ct-safe-right) + 14px)) 8px max(14px, calc(var(--ct-safe-left) + 14px));
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(49, 56, 68, .11);
    background: rgba(248, 244, 239, .88);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

#custom-theater-app .cts-header > button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--ct-ink, #313844);
    background: rgba(255, 255, 255, .5);
    font: 400 28px/1 Arial, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
}

#custom-theater-app .cts-header > div { min-width: 0; text-align: center; }
#custom-theater-app .cts-header span { display: block; color: #9a6b68; font-size: 7px; font-weight: 900; letter-spacing: .32em; }
#custom-theater-app .cts-header h2 { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; letter-spacing: .09em; }

#custom-theater-app .cts-body {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 0;
    box-sizing: border-box;
    padding: 15px max(16px, calc(var(--ct-safe-right) + 16px)) calc(18px + var(--ct-safe-bottom)) max(16px, calc(var(--ct-safe-left) + 16px));
    overflow-y: scroll;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-y;
    outline: 0;
}
#custom-theater-app .cts-body::-webkit-scrollbar { display: none; width: 0; height: 0; }

#custom-theater-app .cts-loading,
#custom-theater-app .cts-error {
    box-sizing: border-box;
    width: min(100%, 520px);
    margin: 22px auto;
    padding: 18px;
    border: 1px solid rgba(49, 56, 68, .13);
    border-radius: 17px;
    background: rgba(255, 255, 255, .6);
    color: #766d68;
    text-align: center;
    font-size: 11px;
    line-height: 1.7;
}
#custom-theater-app .cts-error { color: #7f4842; border-color: rgba(127, 72, 66, .24); }
#custom-theater-app .cts-error strong { display: block; color: #623e3e; font-size: 14px; }
#custom-theater-app .cts-error p { margin: 7px 0 0; }

#custom-theater-app .cts-overview {
    box-sizing: border-box;
    width: min(100%, 620px);
    margin: 0 auto 13px;
    padding: 6px 2px 13px;
    display: grid;
    gap: 3px;
    border-bottom: 1px solid rgba(49, 56, 68, .12);
}
#custom-theater-app .cts-overview > span { color: #9a6b68; font-size: 8px; font-weight: 900; letter-spacing: .2em; }
#custom-theater-app .cts-overview > strong { overflow-wrap: anywhere; font-size: 17px; letter-spacing: .07em; }
#custom-theater-app .cts-overview > small { color: #766d68; font-size: 9px; line-height: 1.55; }

#custom-theater-app .cts-menu {
    width: min(100%, 620px);
    margin: 0 auto;
    display: grid;
    gap: 9px;
}
#custom-theater-app .cts-menu > button {
    min-width: 0;
    min-height: 62px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    border: 1px solid rgba(49, 56, 68, .13);
    border-radius: 16px;
    color: var(--ct-ink, #313844);
    background: rgba(255, 255, 255, .65);
    box-shadow: 0 8px 22px rgba(75, 68, 62, .07);
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}
#custom-theater-app .cts-menu > button > span { grid-column: 1; font-size: 12px; font-weight: 900; letter-spacing: .07em; }
#custom-theater-app .cts-menu > button > small { grid-column: 1; color: #766d68; font-size: 8px; line-height: 1.55; }
#custom-theater-app .cts-menu > button > b { grid-column: 2; grid-row: 1 / 3; color: #9a6b68; font: 400 22px/1 Arial, sans-serif; }

#custom-theater-app .cts-alert {
    box-sizing: border-box;
    width: min(100%, 620px);
    margin: 0 auto 11px;
    padding: 11px 12px;
    border: 1px solid rgba(78, 102, 125, .2);
    border-radius: 14px;
    background: rgba(224, 235, 242, .55);
    font-size: 9px;
    line-height: 1.6;
}
#custom-theater-app .cts-alert.is-warn { border-color: rgba(138, 75, 70, .24); background: rgba(244, 222, 216, .58); }
#custom-theater-app .cts-alert strong { display: block; font-size: 11px; }
#custom-theater-app .cts-alert p { margin: 4px 0 0; color: #6f6762; }
#custom-theater-app .cts-alert button { min-height: 34px; margin-top: 8px; padding: 0 11px; border: 0; border-radius: 10px; color: #fff; background: #45596d; font: 800 9px/1 inherit; cursor: pointer; }

#custom-theater-app .cts-form {
    box-sizing: border-box;
    width: min(100%, 620px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#custom-theater-app .cts-form-intro { padding-bottom: 10px; border-bottom: 1px solid rgba(49, 56, 68, .12); }
#custom-theater-app .cts-form-intro strong { font-size: 15px; letter-spacing: .08em; }
#custom-theater-app .cts-form-intro p { margin: 5px 0 0; color: #766d68; font-size: 9px; line-height: 1.65; }
#custom-theater-app .cts-form > label:not(.cts-switch):not(.cts-check) { display: grid; gap: 6px; color: #615955; font-size: 9px; font-weight: 800; }
#custom-theater-app .cts-form input[type="text"],
#custom-theater-app .cts-form input[type="number"],
#custom-theater-app .cts-form textarea,
#custom-theater-app .cts-form select {
    box-sizing: border-box;
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid rgba(49, 56, 68, .16);
    border-radius: 12px;
    outline: 0;
    color: var(--ct-ink, #313844);
    background: rgba(255, 255, 255, .78);
    font: 11px/1.55 inherit;
}
#custom-theater-app .cts-form textarea { min-height: 230px; resize: vertical; }
#custom-theater-app .cts-form.is-busy { opacity: .7; }

#custom-theater-app .cts-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; }
#custom-theater-app .cts-range > label,
#custom-theater-app .cts-number { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
#custom-theater-app .cts-range > label { box-sizing: border-box; min-height: 48px; padding: 4px 9px; border: 1px solid rgba(49, 56, 68, .14); border-radius: 13px; background: rgba(255, 255, 255, .65); }
#custom-theater-app .cts-range input { min-width: 0; padding-left: 6px !important; padding-right: 3px !important; border: 0 !important; background: transparent !important; text-align: center; font-weight: 900 !important; }
#custom-theater-app .cts-range span,
#custom-theater-app .cts-range b,
#custom-theater-app .cts-number b { color: #766d68; font-size: 9px; }
#custom-theater-app .cts-range > em { color: #9a6b68; font-size: 9px; font-style: normal; font-weight: 900; }

#custom-theater-app .cts-facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
#custom-theater-app .cts-facts > div { min-width: 0; padding: 9px; display: grid; gap: 3px; border: 1px solid rgba(49, 56, 68, .11); border-radius: 12px; background: rgba(255, 255, 255, .48); }
#custom-theater-app .cts-facts dt { color: #817873; font-size: 7px; }
#custom-theater-app .cts-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 9px; font-weight: 900; }

#custom-theater-app .cts-target { margin: 0; padding: 10px 11px; display: grid; gap: 4px; border-left: 3px solid #71859a; border-radius: 4px 12px 12px 4px; background: rgba(224, 235, 242, .46); color: #5e6872; font-size: 8px; line-height: 1.55; overflow-wrap: anywhere; }
#custom-theater-app .cts-target.is-error { border-left-color: #9a6b68; color: #7f4842; background: rgba(244, 222, 216, .48); }
#custom-theater-app .cts-target b { color: var(--ct-ink, #313844); font-size: 9px; }
#custom-theater-app .cts-privacy { margin: 0; color: #766d68; font-size: 8px; line-height: 1.65; }

#custom-theater-app .cts-primary,
#custom-theater-app .cts-secondary {
    min-height: 44px;
    padding: 9px 12px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: #45596d;
    font: 900 10px/1.35 inherit;
    letter-spacing: .06em;
    cursor: pointer;
    touch-action: manipulation;
}
#custom-theater-app .cts-secondary { color: #45596d; border: 1px solid rgba(69, 89, 109, .25); background: rgba(255, 255, 255, .65); }
#custom-theater-app .cts-primary:disabled,
#custom-theater-app .cts-secondary:disabled { opacity: .5; cursor: default; }
#custom-theater-app .cts-link { min-height: 36px; padding: 5px; border: 0; color: #8a4b46; background: transparent; font: 800 8px/1.4 inherit; text-decoration: underline; cursor: pointer; }
#custom-theater-app .cts-form-status { min-height: 18px; color: #4b6e5d; font-size: 9px; line-height: 1.55; text-align: center; }
#custom-theater-app .cts-form-status.is-error { color: #8a4b46; }

#custom-theater-app .cts-switch,
#custom-theater-app .cts-check { display: flex; align-items: flex-start; gap: 9px; color: var(--ct-ink, #313844); cursor: pointer; }
#custom-theater-app .cts-switch { padding: 11px; border: 1px solid rgba(49, 56, 68, .13); border-radius: 14px; background: rgba(255, 255, 255, .58); }
#custom-theater-app .cts-switch input,
#custom-theater-app .cts-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #71859a; }
#custom-theater-app .cts-switch span { display: grid; gap: 3px; }
#custom-theater-app .cts-switch b { font-size: 11px; }
#custom-theater-app .cts-switch small,
#custom-theater-app .cts-check span { color: #6f6762; font-size: 8px; line-height: 1.55; }

#custom-theater-app .cts-auto-progress { padding: 11px; display: grid; gap: 4px; border: 1px solid rgba(49, 56, 68, .12); border-radius: 14px; background: rgba(255, 255, 255, .52); }
#custom-theater-app .cts-auto-progress span { color: #9a6b68; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
#custom-theater-app .cts-auto-progress strong { font-size: 11px; }
#custom-theater-app .cts-auto-progress small { color: #766d68; font-size: 8px; line-height: 1.6; }

#custom-theater-app .cts-prompt-toolbar,
#custom-theater-app .cts-prompt-list { width: min(100%, 620px); margin-left: auto; margin-right: auto; }
#custom-theater-app .cts-prompt-toolbar { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#custom-theater-app .cts-prompt-toolbar p { margin: 0; color: #6f6762; font-size: 8px; line-height: 1.55; }
#custom-theater-app .cts-prompt-toolbar button { flex: 0 0 auto; min-height: 38px; padding: 0 11px; border: 0; border-radius: 11px; color: #fff; background: #45596d; font: 800 9px/1 inherit; cursor: pointer; }
#custom-theater-app .cts-prompt-list { display: grid; gap: 10px; }
#custom-theater-app .cts-prompt { padding: 12px; border: 1px solid rgba(49, 56, 68, .13); border-radius: 15px; background: rgba(255, 255, 255, .62); }
#custom-theater-app .cts-prompt.is-active { border-color: rgba(75, 110, 93, .38); box-shadow: inset 3px 0 0 #5d806e; }
#custom-theater-app .cts-prompt.is-builtin { background: rgba(237, 232, 225, .74); }
#custom-theater-app .cts-prompt > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
#custom-theater-app .cts-prompt > header > div { min-width: 0; display: grid; gap: 3px; }
#custom-theater-app .cts-prompt > header strong { overflow-wrap: anywhere; font-size: 11px; }
#custom-theater-app .cts-prompt > header small { color: #766d68; font-size: 7px; }
#custom-theater-app .cts-prompt > header b { color: #4b6e5d; font-size: 8px; }
#custom-theater-app .cts-prompt > header button,
#custom-theater-app .cts-prompt > footer button { min-height: 32px; padding: 0 10px; border: 1px solid rgba(49, 56, 68, .14); border-radius: 9px; color: #45596d; background: rgba(255, 255, 255, .7); font: 800 8px/1 inherit; cursor: pointer; }
#custom-theater-app .cts-prompt > p { margin: 8px 0 0; color: #766d68; font-size: 8px; line-height: 1.6; }
#custom-theater-app .cts-prompt details { margin-top: 9px; border-top: 1px dashed rgba(49, 56, 68, .14); }
#custom-theater-app .cts-prompt summary { min-height: 35px; display: flex; align-items: center; color: #615955; font-size: 8px; font-weight: 800; cursor: pointer; }
#custom-theater-app .cts-prompt pre { max-height: 240px; margin: 0; padding: 9px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 10px; background: rgba(255, 255, 255, .55); color: #4c4744; font: 9px/1.65 "Microsoft YaHei", sans-serif; }
#custom-theater-app .cts-prompt > footer { margin-top: 9px; display: flex; justify-content: flex-end; gap: 7px; }
#custom-theater-app .cts-prompt > footer button.is-danger { color: #8a4b46; }
#custom-theater-app .cts-prompt-editor { min-height: 100%; }
#custom-theater-app .cts-prompt-editor .is-grow { flex: 1 1 auto; min-height: 250px; }
#custom-theater-app .cts-prompt-editor .is-grow textarea { height: 100%; min-height: 230px; resize: none; }

#custom-theater-app .cts-archive { width: min(100%, 620px); margin: 16px auto 0; display: grid; gap: 10px; }
#custom-theater-app .cts-archive > header { display: grid; gap: 3px; padding: 0 2px; }
#custom-theater-app .cts-archive > header strong { font-size: 11px; letter-spacing: .04em; }
#custom-theater-app .cts-archive > header small { color: #766d68; font-size: 8px; line-height: 1.55; }
#custom-theater-app .cts-archive [data-cts-archive-list] { display: grid; gap: 9px; }
#custom-theater-app .cts-archive-empty { padding: 14px 12px; border: 1px dashed rgba(49, 56, 68, .18); border-radius: 13px; color: #766d68; background: rgba(255, 255, 255, .4); font-size: 8px; line-height: 1.65; text-align: center; }
#custom-theater-app .cts-archive-item { border: 1px solid rgba(49, 56, 68, .13); border-radius: 14px; background: rgba(255, 255, 255, .62); overflow: hidden; }
#custom-theater-app .cts-archive-item > summary { min-height: 44px; box-sizing: border-box; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 3px; cursor: pointer; list-style: none; }
#custom-theater-app .cts-archive-item > summary::-webkit-details-marker { display: none; }
#custom-theater-app .cts-archive-item > summary strong { overflow-wrap: anywhere; font-size: 10px; line-height: 1.4; }
#custom-theater-app .cts-archive-item > summary small { color: #766d68; font-size: 7px; letter-spacing: .03em; }
#custom-theater-app .cts-archive-item[open] > summary { border-bottom: 1px dashed rgba(49, 56, 68, .14); }
#custom-theater-app .cts-archive-item > pre { max-height: 320px; margin: 0; padding: 10px 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(255, 255, 255, .5); color: #4c4744; font: 9px/1.7 "Microsoft YaHei", sans-serif; }
#custom-theater-app .cts-archive-item > summary:focus-visible { outline: 2px solid rgba(113, 133, 154, .8); outline-offset: -2px; }

#custom-theater-app .cts-header button:focus-visible,
#custom-theater-app .cts-menu button:focus-visible,
#custom-theater-app .cts-form input:focus-visible,
#custom-theater-app .cts-form textarea:focus-visible,
#custom-theater-app .cts-form select:focus-visible,
#custom-theater-app .cts-form button:focus-visible,
#custom-theater-app .cts-prompt button:focus-visible,
#custom-theater-app .cts-prompt summary:focus-visible {
    outline: 2px solid rgba(113, 133, 154, .8);
    outline-offset: 2px;
}

@media (max-width: 350px) {
    #custom-theater-app .cts-body { padding-left: max(12px, calc(var(--ct-safe-left) + 12px)); padding-right: max(12px, calc(var(--ct-safe-right) + 12px)); }
    #custom-theater-app .cts-facts { grid-template-columns: 1fr; }
    #custom-theater-app .cts-prompt-toolbar { align-items: stretch; flex-direction: column; }
    #custom-theater-app .cts-prompt-toolbar button { align-self: flex-end; }
}

@media (max-height: 560px), (orientation: landscape) and (max-height: 480px) {
    #custom-theater-app .cts-body { padding-top: 10px; }
    #custom-theater-app .cts-overview { padding-bottom: 8px; margin-bottom: 8px; }
    #custom-theater-app .cts-menu { gap: 6px; }
    #custom-theater-app .cts-menu > button { min-height: 51px; padding-top: 7px; padding-bottom: 7px; }
    #custom-theater-app .cts-form textarea { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    #custom-theater-app .cts-center *,
    #custom-theater-app .cts-center *::before,
    #custom-theater-app .cts-center *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (prefers-contrast: more) {
    #custom-theater-app .cts-menu > button,
    #custom-theater-app .cts-form input,
    #custom-theater-app .cts-form textarea,
    #custom-theater-app .cts-form select,
    #custom-theater-app .cts-prompt,
    #custom-theater-app .cts-switch { border-color: rgba(28, 31, 36, .52); }
    #custom-theater-app .cts-privacy,
    #custom-theater-app .cts-menu > button > small { color: #332f2c; }
}
