/* ============ 小剧场 · 复古剧院重制版 ============ */
.th-view{display:flex;flex-direction:column;height:100%;color:var(--ink);background:radial-gradient(140% 46% at 50% -8%,rgba(178,34,52,.14),transparent 62%),radial-gradient(90% 40% at 100% 0%,rgba(212,175,105,.14),transparent 55%),var(--bg)}
html[data-theme="dark"] .th-view{background:radial-gradient(140% 46% at 50% -8%,rgba(210,60,80,.22),transparent 62%),#000}
.th-head{display:flex;align-items:center;gap:8px;padding:calc(10px + env(safe-area-inset-top,0px)) 12px 6px;flex:0 0 auto}
.th-head h1{flex:1;margin:0;text-align:center;font-size:17px;font-weight:800;letter-spacing:.35em;text-indent:.35em;font-family:Cinzel,"Noto Sans SC",serif}
.th-head h1::after{content:"THEATER";display:block;font-size:9px;letter-spacing:.5em;text-indent:.5em;color:var(--gray-2);font-weight:600;margin-top:2px}
.th-head .icon-btn,.th-head .back-btn{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--hairline);background:var(--card);color:var(--ink);box-shadow:0 2px 10px rgba(0,0,0,.06)}
.th-head .icon-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.th-head .icon-btn#thHistBtn{margin-left:auto}
.th-head #thForwardBtn:not(:disabled){background:linear-gradient(135deg,#C1273B,#8E1626);border-color:transparent;color:#fff;box-shadow:0 6px 18px rgba(178,34,52,.35)}
.th-body{flex:1;min-height:0;overflow:auto;padding:6px 16px 28px;display:flex;flex-direction:column;gap:14px}
.th-body::before{content:"NOW SHOWING";align-self:center;font-size:10px;font-weight:700;letter-spacing:.28em;text-indent:.28em;color:#B22234;background:rgba(178,34,52,.09);border:1px solid rgba(178,34,52,.22);padding:6px 12px 6px 14px;border-radius:999px}
.th-pair{display:grid;grid-template-columns:1fr 30px 1fr;gap:6px;align-items:stretch}
.th-sel{position:relative;display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--hairline);border-radius:20px;background:var(--card);text-align:left;color:var(--ink);cursor:pointer;min-width:0;box-shadow:0 4px 18px rgba(0,0,0,.05);overflow:hidden}
.th-sel::before{content:"";position:absolute;top:0;left:12px;right:12px;height:3px;border-radius:0 0 6px 6px;background:linear-gradient(90deg,#D4AF69,#B22234,#D4AF69)}
.th-sel:active{transform:scale(.97)}
.th-col-label{display:flex;align-items:center;gap:6px;font-size:10px;letter-spacing:.24em;color:var(--gray-2);font-weight:700;margin:2px 0 0}
.th-col-label::after{content:"";flex:1;height:1px;background:var(--hairline)}
.th-sel-main{display:flex;align-items:center;gap:10px;min-width:0}
.th-sel-main img{width:46px;height:46px;border-radius:50%;object-fit:cover;background:var(--fill);flex:0 0 auto;border:2px solid #E8D9B8;box-shadow:0 0 0 3px rgba(212,175,105,.22)}
.th-sel-main span{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-x{align-self:center;justify-self:center;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#D4AF69,#B98A2F);color:#fff;font-weight:800;font-size:14px;box-shadow:0 4px 12px rgba(185,138,47,.4)}
.th-prompt{width:100%;min-height:132px;resize:vertical;border:1px solid rgba(212,175,105,.45);border-radius:18px;padding:16px 15px;background:var(--card);color:var(--ink);font-family:inherit;font-size:13.5px;line-height:1.8;outline:none;box-shadow:0 6px 24px rgba(0,0,0,.06)}
.th-prompt:focus{border-color:#C9A24B;box-shadow:0 0 0 3px rgba(212,175,105,.25)}
.th-prompt::placeholder{color:var(--gray-3)}
.th-actions{display:flex;gap:8px}
.th-gen,.th-cont,.th-arch{height:46px;border-radius:15px;font-size:14.5px;font-weight:800;cursor:pointer;border:none}
.th-gen{flex:1.4;background:linear-gradient(135deg,#D63A4E 0%,#A31629 60%,#7E1020 100%);color:#fff;letter-spacing:.2em;text-indent:.2em;box-shadow:0 10px 24px rgba(178,34,52,.35),inset 0 1px 0 rgba(255,255,255,.35)}
.th-gen:active{transform:scale(.97)}
.th-cont,.th-arch{flex:1;background:var(--card);color:var(--ink);border:1px solid var(--hairline)}
.th-cont.on{background:rgba(212,175,105,.18);border-color:#C9A24B}
.th-gen:disabled,.th-cont:disabled,.th-arch:disabled{opacity:.45;cursor:default;box-shadow:none}
.th-trunc-tip{padding:11px 13px;border-radius:14px;background:linear-gradient(135deg,rgba(178,34,52,.12),rgba(212,175,105,.14));border:1px dashed rgba(178,34,52,.4);color:var(--ink);font-size:12.5px;line-height:1.6}
.th-stage{position:relative;min-height:230px;border-radius:22px;overflow:hidden;background:var(--card);border:1px solid rgba(212,175,105,.45);box-shadow:0 14px 40px rgba(0,0,0,.1)}
.th-stage.has-play{cursor:pointer}
.th-stage-tap{display:block;width:100%;padding:0;border:none;background:transparent;color:inherit;cursor:pointer;text-align:left;position:relative}
.th-stage-tap .th-frame{pointer-events:none}
.th-stage-hint{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);padding:7px 16px;border-radius:999px;background:rgba(20,8,10,.72);color:#F6E7C6;font-size:12px;font-weight:700;pointer-events:none;border:1px solid rgba(212,175,105,.5);white-space:nowrap}
.th-placeholder,.th-empty{padding:52px 24px 40px;text-align:center;color:var(--gray-2);font-size:13px;line-height:2}
.th-frame,.th-msg-frame{width:100%;border:0;display:block;background:#fff}
.th-frame{height:min(62vh,560px)}
.th-msg-frame{height:280px;border-radius:12px}
.th-hist-view .th-head .head-spacer{width:36px;flex:0 0 auto}
.th-hist-body{flex:1;min-height:0;overflow:auto;padding:4px 16px calc(24px + env(safe-area-inset-bottom,0px))}
.th-hist-list{display:flex;flex-direction:column;gap:12px;padding:4px 0 16px}
.th-hist-card{position:relative;display:flex;flex-direction:column;gap:10px;width:100%;padding:15px 16px 14px 22px;border-radius:16px;border:1px solid var(--hairline);background:var(--card);text-align:left;color:var(--ink);box-shadow:0 4px 16px rgba(0,0,0,.05);overflow:hidden}
.th-hist-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:linear-gradient(#D4AF69,#B22234)}
.th-hist-card.on{border-color:#C9A24B;box-shadow:0 0 0 2px rgba(212,175,105,.4)}
.th-hist-main{display:flex;flex-direction:column;gap:4px;width:100%;border:0;background:transparent;padding:0;margin:0;text-align:left;color:inherit;font:inherit;cursor:pointer}
.th-hist-card b{font-size:15px}
.th-hist-card span,.th-hist-card small{font-size:12.5px;color:var(--gray-2)}
.th-hist-acts{display:flex;gap:8px;width:100%}
.th-hist-acts button{flex:1;height:36px;border:0;border-radius:11px;font:700 13px/1 var(--font-body);cursor:pointer;background:var(--fill);color:var(--ink)}
.th-hist-acts button.pri{background:linear-gradient(135deg,#D63A4E,#8E1626);color:#fff}
.th-hist-acts button.danger{color:#C0392B;background:rgba(192,57,43,.1)}
.th-pick-card{max-width:340px;max-height:72%;padding-bottom:12px}
.th-pick-list-scroll{margin:8px 12px 8px;max-height:min(52vh,420px);overflow:auto;display:flex;flex-direction:column;gap:2px}
.th-fs{position:fixed;inset:0;z-index:13000;background:var(--bg);display:flex;flex-direction:column}
.th-fs[hidden]{display:none!important}
html.th-fs-lock,html.th-fs-lock body{overflow:hidden}
.th-fs-close{position:absolute;z-index:2;top:calc(10px + env(safe-area-inset-top,0px));left:10px;width:40px;height:40px;border:none;border-radius:50%;background:rgba(0,0,0,.45);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;backdrop-filter:blur(8px)}
.th-fs-close svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.th-fs-frame{flex:1;width:100%;border:0;background:#fff;display:block}
html[data-theme="dark"] .th-fs-close{background:rgba(255,255,255,.16)}
.msg-theater{padding:0!important;overflow:hidden;min-width:210px;max-width:260px;background:linear-gradient(160deg,#3B1220,#17131c)!important;color:#f6f1ea!important;cursor:pointer;border:1px solid rgba(212,175,105,.5)!important}
.th-card-top{padding:13px 14px 8px;border-top:3px solid #D4AF69}
.th-card-top b{display:block;font-size:14px}
.th-card-top span{display:block;margin-top:4px;font-size:11px;opacity:.7}
.th-card-foot{padding:0 14px 12px;font-size:11px;opacity:.55}
.th-card-body{padding:0 10px 12px}
.mine .msg-theater{background:linear-gradient(160deg,#4A1A1A,#231c18)!important}
.msg-photo{padding:4px!important;overflow:hidden;cursor:zoom-in;background:transparent!important;box-shadow:none!important}
.msg-photo img{display:block;max-width:180px;max-height:240px;border-radius:12px;object-fit:cover}
.photo-viewer{position:fixed;inset:0;z-index:12000;background:rgba(0,0,0,.94);display:flex;flex-direction:column;color:#fff}
.photo-viewer[hidden]{display:none!important}
.photo-viewer-top{display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top,0px)) 14px 8px;flex:0 0 auto}
.photo-viewer-top button{border:none;background:transparent;color:#fff;font-family:inherit;font-size:15px;cursor:pointer;padding:6px 4px}
.photo-viewer-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;position:relative;padding:8px 12px}
.photo-viewer-stage img{max-width:100%;max-height:100%;object-fit:contain;border-radius:4px}
.photo-viewer-tip{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;font-size:13px;opacity:.75;pointer-events:none}
.photo-viewer-nav{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;pointer-events:none;padding:0 4px}
.photo-viewer-nav button{pointer-events:auto;width:44px;height:44px;border:none;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:28px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.photo-viewer-bar{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;padding:10px 14px calc(14px + env(safe-area-inset-bottom,0px))}
.photo-viewer-bar button{height:36px;padding:0 14px;border:none;border-radius:18px;background:rgba(255,255,255,.14);color:#fff;font-family:inherit;font-size:13px;cursor:pointer}
.photo-viewer-idx{font-size:12px;opacity:.7;align-self:center;min-width:48px;text-align:center}
