/* 定制剧场 · 世界书（仅作用于 #custom-theater-app） */
#custom-theater-app.ct-worldbook-view .ct-view-heading { display: none; }
#custom-theater-app.ct-worldbook-view .ct-tool-shell { max-width: none; margin: 0; padding: 0 0 90px; }
#custom-theater-app.ct-worldbook-view .ct-tool-panel { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
#custom-theater-app.ct-worldbook-detail-view .ct-main { overflow-y: auto; }
#custom-theater-app .ctwb-panel { color: #443f3b; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
#custom-theater-app .ctwb-library-head { margin: 2px 0 26px; text-align: center; }
#custom-theater-app .ctwb-library-head > span { color: #7d302e; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
#custom-theater-app .ctwb-library-head p { margin: 7px 0 0; color: #77706a; font-size: 11px; line-height: 1.7; }
#custom-theater-app .ctwb-poster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px 17px; align-items: start; }
#custom-theater-app .ctwb-poster { min-width: 0; padding: 0; border: 0; color: #4e4945; background: transparent; text-align: center; cursor: pointer; }
#custom-theater-app .ctwb-poster-photo { position: relative; display: block; width: min(100%, 92px); aspect-ratio: 5 / 7; margin: 0 auto 9px; overflow: hidden; border-radius: 4px; background: #d5cfc5; box-shadow: 0 5px 12px rgba(29,35,39,.2); }
#custom-theater-app .ctwb-poster-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
#custom-theater-app .ctwb-poster-empty { display: grid; width: 100%; height: 100%; place-content: center; gap: 8px; background: linear-gradient(145deg,#b7aaa0,#e8e0d5 58%,#939da0); }
#custom-theater-app .ctwb-poster-empty b { font: 760 32px/1 "Songti SC",serif; }
#custom-theater-app .ctwb-poster-empty small { font-size: 7px; letter-spacing: .16em; }
#custom-theater-app .ctwb-poster strong { display: block; overflow: hidden; padding: 0 2px 7px; border-bottom: 1px solid rgba(72,65,59,.34); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
#custom-theater-app .ctwb-poster > small { display: block; margin-top: 5px; color: #8a827c; font-size: 9px; }
#custom-theater-app .ctwb-loading,
#custom-theater-app .ctwb-empty,
#custom-theater-app .ctwb-storage-error { grid-column: 1 / -1; padding: 34px 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; }
#custom-theater-app .ctwb-empty strong,
#custom-theater-app .ctwb-storage-error strong { display: block; font-size: 14px; }
#custom-theater-app .ctwb-empty p,
#custom-theater-app .ctwb-storage-error p { margin: 8px 0 0; color: #7e7770; font-size: 11px; line-height: 1.7; }
#custom-theater-app .ctwb-storage-error { border-color: rgba(151,53,47,.45); color: #842e2a; }
#custom-theater-app .ctwb-storage-error code { display: block; margin-top: 9px; font-size: 10px; overflow-wrap: anywhere; }
#custom-theater-app .ctwb-toolbar { position: sticky; z-index: 5; top: calc(var(--ct-safe-top) + 58px); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 0 0 12px; padding: 2px 0 8px; background: linear-gradient(180deg,rgba(239,241,231,.98) 72%,rgba(239,241,231,0)); }
#custom-theater-app .ctwb-toolbar button,
#custom-theater-app .ctwb-entry footer button,
#custom-theater-app .ctwb-editor-card footer button { min-height: 35px; padding: 7px 8px; border: 1px solid rgba(74,65,58,.25); border-radius: 5px; color: #504a45; background: rgba(255,255,255,.58); font-size: 10px; font-weight: 700; cursor: pointer; }
#custom-theater-app .ctwb-toolbar button.is-primary,
#custom-theater-app .ctwb-editor-card footer button.is-primary { border-color: #71312f; color: #fff; background: #71312f; }
#custom-theater-app .ctwb-groups { display: flex; gap: 7px; margin-bottom: 13px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
#custom-theater-app .ctwb-groups::-webkit-scrollbar { display: none; }
#custom-theater-app .ctwb-group-chip { flex: 0 0 auto; padding: 7px 10px; border: 1px solid rgba(74,65,58,.2); border-radius: 999px; color: #655e57; background: rgba(255,255,255,.4); font-size: 10px; cursor: pointer; }
#custom-theater-app .ctwb-group-chip span { margin-left: 5px; opacity: .62; }
#custom-theater-app .ctwb-group-chip.is-active { border-color: #71312f; color: #fff; background: #71312f; }
#custom-theater-app .ctwb-entry-list { display: grid; gap: 10px; }
#custom-theater-app .ctwb-entry { padding: 12px; border: 1px solid rgba(76,66,58,.2); border-radius: 7px; background: rgba(253,251,246,.72); box-shadow: 0 3px 10px rgba(41,35,31,.06); }
#custom-theater-app .ctwb-entry.is-disabled { opacity: .58; }
#custom-theater-app .ctwb-entry header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#custom-theater-app .ctwb-entry header span { color: #8c3935; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
#custom-theater-app .ctwb-entry h4 { margin: 3px 0 0; font-size: 14px; }
#custom-theater-app .ctwb-entry-content { display: -webkit-box; overflow: hidden; margin: 10px 0; color: #5f5953; font-size: 11px; line-height: 1.7; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
#custom-theater-app .ctwb-entry-meta { display: flex; flex-wrap: wrap; gap: 5px; }
#custom-theater-app .ctwb-entry-meta span { padding: 4px 6px; border-radius: 3px; color: #746d66; background: rgba(73,65,59,.06); font-size: 9px; }
#custom-theater-app .ctwb-entry footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
#custom-theater-app .ctwb-entry footer button { min-height: 29px; padding: 5px 12px; }
#custom-theater-app .ctwb-entry footer button.is-danger { color: #922e2a; }
#custom-theater-app .ctwb-switch { position: relative; flex: 0 0 auto; width: 35px; height: 20px; }
#custom-theater-app .ctwb-switch input { position: absolute; opacity: 0; }
#custom-theater-app .ctwb-switch i { display: block; width: 100%; height: 100%; border-radius: 999px; background: #bbb3aa; transition: .18s; }
#custom-theater-app .ctwb-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: .18s; }
#custom-theater-app .ctwb-switch input:checked + i { background: #71312f; }
#custom-theater-app .ctwb-switch input:checked + i::after { transform: translateX(15px); }
#custom-theater-app .ctwb-editor-layer { position: absolute; z-index: 14; inset: 0; box-sizing: border-box; width: 100%; max-width: 100%; height: 100%; max-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: calc(var(--ct-safe-top) + 62px) max(9px,var(--ct-safe-right)) max(16px,calc(var(--ct-safe-bottom) + 16px)) max(9px,var(--ct-safe-left)); background: rgba(28,26,24,.48); backdrop-filter: blur(4px); scrollbar-width: none; -ms-overflow-style: none; }
#custom-theater-app .ctwb-editor-layer::-webkit-scrollbar { width: 0; height: 0; display: none; }
#custom-theater-app .ctwb-editor-layer[hidden] { display: none; }
#custom-theater-app .ctwb-editor-card { box-sizing: border-box; width: min(100%,560px); max-width: 100%; margin: 0 auto; overflow: hidden; border: 1px solid rgba(75,61,51,.22); border-radius: 10px; background: #f2efe7; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
#custom-theater-app .ctwb-editor-card > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border-bottom: 1px solid rgba(75,61,51,.16); }
#custom-theater-app .ctwb-editor-card > header span { color: #80332f; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
#custom-theater-app .ctwb-editor-card > header h3 { margin: 3px 0 0; font-size: 17px; }
#custom-theater-app .ctwb-editor-card > header button { border: 0; color: #4f4944; background: transparent; font-size: 24px; cursor: pointer; }
#custom-theater-app .ctwb-editor-card form { display: grid; gap: 12px; padding: 14px; }
#custom-theater-app .ctwb-editor-card label { display: grid; gap: 5px; color: #554e48; font-size: 10px; font-weight: 700; }
#custom-theater-app .ctwb-editor-card input,
#custom-theater-app .ctwb-editor-card select,
#custom-theater-app .ctwb-editor-card textarea { box-sizing: border-box; width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid rgba(75,61,51,.24); border-radius: 5px; color: #3e3935; background: rgba(255,255,255,.72); font: inherit; font-size: 11px; resize: vertical; }
#custom-theater-app .ctwb-editor-card textarea[name="content"] { min-height: 170px; line-height: 1.65; }
#custom-theater-app .ctwb-editor-card small { color: #8a8179; font-size: 9px; font-weight: 400; line-height: 1.5; }
#custom-theater-app .ctwb-position-field select { cursor: pointer; touch-action: manipulation; }
#custom-theater-app .ctwb-position-field small { min-height: 2.9em; }
#custom-theater-app .ctwb-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
#custom-theater-app .ctwb-keyword-fields { display: grid; gap: 10px; padding: 10px; border: 1px dashed rgba(113,49,47,.27); border-radius: 6px; background: rgba(113,49,47,.035); }
#custom-theater-app .ctwb-keyword-fields[hidden] { display: none; }
#custom-theater-app .ctwb-checks { display: flex; flex-wrap: wrap; gap: 8px 13px; }
#custom-theater-app .ctwb-checks label { display: flex; grid-template-columns: none; align-items: center; gap: 5px; }
#custom-theater-app .ctwb-checks input { width: auto; min-height: 0; }
#custom-theater-app .ctwb-editor-card footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
#custom-theater-app .ctwb-editor-card footer button { min-width: 86px; }
#custom-theater-app .ctwb-panel button:focus-visible,
#custom-theater-app .ctwb-panel input:focus-visible,
#custom-theater-app .ctwb-panel select:focus-visible,
#custom-theater-app .ctwb-panel textarea:focus-visible { outline: 2px solid #8a3532; outline-offset: 2px; }
@media (max-width: 360px) {
    #custom-theater-app.ct-worldbook-view .ct-tool-shell { padding-inline: 14px; }
    #custom-theater-app .ctwb-poster-grid { gap: 22px 10px; }
    #custom-theater-app .ctwb-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    #custom-theater-app .ctwb-form-grid { grid-template-columns: 1fr; }
}
@media (hover:hover) {
    #custom-theater-app .ctwb-poster-photo { transition: transform .18s,box-shadow .18s; }
    #custom-theater-app .ctwb-poster:hover .ctwb-poster-photo { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(29,35,39,.24); }
}
@media (prefers-reduced-motion:reduce) {
    #custom-theater-app .ctwb-poster-photo,
    #custom-theater-app .ctwb-switch i,
    #custom-theater-app .ctwb-switch i::after { transition: none; }
}
