:root{--bg:#121016;--surface:#1c1922;--surface-2:#26222e;--line:#34303d;--text:#ece8f2;--muted:#9a93a6;--accent:#c8a0ff;--accent-ink:#1a1222;--user:#2f2640;--danger:#ff7a8a;--speech:#f3d9a4;--radius:14px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;-webkit-text-size-adjust:100%;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Noto Sans SC,Helvetica Neue,sans-serif;font-size:16px}*{box-sizing:border-box}html,body{background:var(--bg);color:var(--text);overscroll-behavior:none;margin:0;padding:0;overflow:hidden}#root{height:var(--app-height,100dvh);transform:translateY(var(--app-top,0px));position:fixed;top:0;left:0;right:0}button,input,textarea{font:inherit;color:inherit}button{background:var(--surface-2);border:1px solid var(--line);cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;border-radius:10px;justify-content:center;align-items:center;gap:6px;min-height:36px;padding:8px 14px;display:inline-flex}button svg{flex:none}.list-item,.bubble,.radio,.tl-item,.msg.ops,.title-edit,.sheet-backdrop,.title-card,.toggle-row{cursor:pointer;touch-action:manipulation}.sheet{cursor:auto}input[type=checkbox],input[type=radio],select,label{touch-action:manipulation}button:active{transform:scale(.97)}button:disabled{opacity:.5}button.primary{background:var(--accent);color:var(--accent-ink);border-color:#0000;font-weight:600}button.danger{color:var(--danger)}button.wide{width:100%;padding:12px}button.icon{width:40px;height:40px;min-height:40px;color:var(--muted);background:0 0;border:none;flex:none;padding:0}button.icon.subtle{font-size:14px}button.link{min-height:0;color:var(--accent);background:0 0;border:none;align-self:flex-start;padding:4px 0;font-size:14px}button.chip{min-height:32px;color:var(--muted);border-radius:999px;align-self:flex-start;padding:4px 14px;font-size:14px}input,textarea{background:var(--surface);border:1px solid var(--line);border-radius:10px;outline:none;width:100%;padding:10px 12px;font-size:16px}input:focus,textarea:focus{border-color:var(--accent)}textarea{resize:none;line-height:1.5}.screen{flex-direction:column;height:100%;display:flex}.topbar{padding:calc(env(safe-area-inset-top) + 6px) 8px 6px;border-bottom:1px solid var(--line);background:var(--bg);align-items:center;gap:4px;display:flex}.topbar h2{flex-direction:column;flex:1;align-items:center;min-width:0;margin:0 4px;font-size:17px;font-weight:600;line-height:1.25;display:flex}.topbar h2>*{white-space:nowrap;text-overflow:ellipsis;max-width:100%;overflow:hidden}.title-edit{text-align:center}.bottombar{padding:12px 16px calc(env(safe-area-inset-bottom) + 12px);border-top:1px solid var(--line)}.empty,.hint{color:var(--muted);font-size:14px;line-height:1.6}.empty{text-align:center;margin-top:30vh;padding:0 24px}.error{color:var(--danger);font-size:14px}.error.inline{padding:0 16px}.login{flex-direction:column;justify-content:center;gap:8px;height:100%;padding:32px;display:flex}.login-mark{color:var(--accent)}.login h1{margin:0 0 24px;font-size:26px;font-weight:600}.login form{flex-direction:column;gap:12px;display:flex}.login button{padding:12px}.list{flex:1;padding:8px 0;overflow-y:auto}.list-item{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:14px 16px;display:flex}.list-item:active{background:var(--surface)}.list-title{text-overflow:ellipsis;white-space:nowrap;font-size:16px;overflow:hidden}.list-item.column .list-title{white-space:normal}.list-sub{color:var(--muted);margin-top:4px;font-size:12px}.messages{-webkit-overflow-scrolling:touch;flex:1;padding:12px 0 20px;overflow-y:auto}.msg{flex-direction:column;padding:6px 14px;display:flex}.msg.user{align-items:flex-end}.bubble{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;line-height:1.75;font-size:var(--msg-font,16px);min-width:0}.msg.assistant .bubble{padding:4px 2px}.msg.user .bubble{background:var(--user);border-radius:var(--radius) var(--radius) 4px var(--radius);max-width:85%;padding:10px 14px}.action{color:var(--muted);font-style:italic}.speech{color:var(--speech)}.cursor{background:var(--accent);vertical-align:-2px;width:8px;height:1em;margin-left:2px;animation:1s steps(2,end) infinite blink;display:inline-block}@keyframes blink{50%{opacity:0}}.msg-actions{flex-wrap:wrap;gap:8px;margin-top:8px;display:flex}.msg-actions button{padding:6px 12px;font-size:13px}.msg.user .msg-actions{justify-content:flex-end}.edit-box{width:100%}.composer{padding:8px 10px calc(env(safe-area-inset-bottom) + 8px);border-top:1px solid var(--line);background:var(--bg);flex-direction:column;gap:8px;display:flex;position:relative}.composer-row{align-items:flex-end;gap:8px;display:flex}.composer textarea{border-radius:20px;max-height:160px;padding:9px 14px}.send{background:var(--accent);width:40px;height:40px;min-height:40px;color:var(--accent-ink);border:none;border-radius:50%;flex:none;padding:0}.send.stop{background:var(--surface-2);color:var(--text)}.sheet-backdrop{z-index:10;background:#00000080;align-items:flex-end;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);width:100%;max-height:85%;padding:18px 16px calc(env(safe-area-inset-bottom) + 16px);border-radius:18px 18px 0 0;flex-direction:column;gap:10px;display:flex;overflow-y:auto}.sheet h3,.sheet .hint{margin:0}.form{padding:16px 16px calc(env(safe-area-inset-bottom) + 24px);flex-direction:column;flex:1;gap:18px;display:flex;overflow-y:auto}.form label{color:var(--muted);flex-direction:column;gap:8px;font-size:14px;display:flex}.form small{font-size:12px}.form h3{margin:12px 0 0;font-size:15px}.form .hint{margin:0}.row{flex-wrap:wrap;gap:10px;display:flex}.row button{flex:1;min-width:0}input[type=range]{accent-color:var(--accent);background:0 0;border:none;padding:0}.tabbar{border-top:1px solid var(--line);background:var(--bg);padding-bottom:env(safe-area-inset-bottom);display:flex}.tabbar button{color:var(--muted);background:0 0;border:none;border-radius:0;flex-direction:column;flex:1;align-items:center;gap:3px;min-height:0;padding:8px 0 6px;font-size:11px;display:flex}.tabbar button.active{color:var(--accent)}.tabs{gap:6px;padding:8px 12px 0;display:flex}.tabs button{min-width:0;min-height:32px;color:var(--muted);white-space:nowrap;text-overflow:ellipsis;border-radius:999px;flex:1;padding:6px 10px;font-size:14px;display:block;overflow:hidden}.tabs button.active{background:var(--accent);color:var(--accent-ink);border-color:#0000}.avatar{background:var(--surface-2);width:44px;height:44px;color:var(--accent);border-radius:50%;flex:none;justify-content:center;align-items:center;margin-right:12px;font-size:18px;font-weight:600;display:flex;overflow:hidden}.avatar img{object-fit:cover;width:100%;height:100%}.avatar.large{border:1px dashed var(--line);width:80px;height:80px;min-height:80px;margin-right:0;padding:0;font-size:30px}.avatar-row{align-items:center;gap:16px;display:flex}.avatar-fields{flex-direction:column;flex:1;gap:10px;min-width:0;display:flex}.field-group{flex-direction:column;gap:8px;display:flex}.form-label{color:var(--muted);font-size:14px}.avatar-fields label{gap:4px}.list-body{flex:1;min-width:0}.list-sub{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.badge{color:var(--accent-ink);background:var(--accent);vertical-align:middle;border-radius:6px;margin-left:8px;padding:1px 6px;font-size:11px}.alt-greeting{flex-direction:column;gap:4px;margin-bottom:10px;display:flex}.msg-name{color:var(--accent);margin-bottom:2px;padding:0 2px;font-size:12px}.title-sub{color:var(--muted);margin-top:1px;font-size:11px;font-weight:400;display:block}.title-sub:empty{display:none}.swipe{color:var(--muted);align-items:center;gap:4px;margin-top:2px;font-size:12px;display:flex}.swipe button{width:32px;height:32px;font-size:18px}.swipe button:disabled{opacity:.25}select{background:var(--surface);border:1px solid var(--line);width:100%;color:var(--text);border-radius:10px;padding:10px 12px;font-size:16px}.sheet label{color:var(--muted);flex-direction:column;gap:6px;font-size:14px;display:flex}.changes{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}.changes.column{flex-direction:column}.change{background:var(--surface-2);max-width:100%;color:var(--muted);border:1px solid var(--line);white-space:normal;overflow-wrap:anywhere;text-align:left;border-radius:12px;padding:3px 9px;font-size:12px}.change.title,.change.event{color:#f3d9a4;background:#3a2d12;border-color:#5a4720}.change.stage{color:var(--accent);background:#2a1f3d;border-color:#4a3a66}.change.num{color:var(--text)}.change.error{color:var(--danger)}.msg.ops{align-items:center;padding:2px 14px}.ops-chip{flex-wrap:wrap;justify-content:center;gap:6px;max-width:100%;display:flex}.ops-chip .change{text-align:center;background:0 0;border-style:dashed}.msg-actions.center{justify-content:center}.msg.ooc .bubble{border:1px dashed var(--line);color:var(--muted);border-radius:12px;padding:8px 12px;font-size:15px}.msg-name.ooc{color:var(--muted)}.hint.busy{padding:0 16px}.hint.busy:after{content:"";background:var(--accent);border-radius:50%;width:6px;height:6px;margin-left:6px;animation:1s steps(2,end) infinite blink;display:inline-block}.quick{scrollbar-width:none;gap:6px;padding-bottom:2px;display:flex;overflow-x:auto}.quick::-webkit-scrollbar{display:none}.quick .chip{white-space:nowrap;flex:none}.chip.on{background:var(--accent);color:var(--accent-ink);border-color:#0000}.chip.static{pointer-events:none}.chips{flex-wrap:wrap;gap:6px;display:flex}.palette{z-index:5;background:var(--surface);border:1px solid var(--line);border-radius:12px;max-height:36vh;position:absolute;bottom:calc(100% + 4px);left:10px;right:10px;overflow:hidden auto;box-shadow:0 -4px 20px #0006}.palette-item{text-align:left;border:none;border-bottom:1px solid var(--line);background:0 0;border-radius:0;align-items:baseline;gap:10px;width:100%;padding:10px 12px;display:flex}.palette-item:last-child{border-bottom:none}.palette-item b,.palette.hint-only b{color:var(--accent);flex:none;font-weight:600}.palette-item span,.palette.hint-only span{color:var(--muted);overflow-wrap:anywhere;min-width:0;font-size:13px}.palette.hint-only{flex-wrap:wrap;gap:10px;padding:8px 12px;font-size:13px;display:flex}.sheet.panel{max-height:90%}.panel-head{justify-content:space-between;align-items:flex-start;gap:10px;display:flex}.panel-head>div{min-width:0}.panel-head .hint{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.panel-head .chip{flex:none}.panel-head h3{margin-bottom:2px}.tabs.scroll{scrollbar-width:none;padding:0;overflow-x:auto}.tabs.scroll button{flex:none;padding:6px 14px}.entity h4{color:var(--muted);margin:14px 0 6px;font-size:14px;font-weight:500}.fields{flex-direction:column;gap:10px;display:flex}.field-row{justify-content:space-between;align-items:baseline;gap:10px;font-size:14px;display:flex}.field-label{text-overflow:ellipsis;white-space:nowrap;flex:none;align-items:center;gap:4px;max-width:45%;display:inline-flex;overflow:hidden}.field-val{color:var(--muted);text-align:right;overflow-wrap:anywhere;min-width:0}.field.hidden .field-row span:last-child{letter-spacing:2px;color:var(--muted)}.bar{background:var(--surface-2);border-radius:3px;height:6px;margin-top:5px;overflow:hidden}.bar-fill{background:var(--accent);border-radius:3px;height:100%;transition:width .3s}.lock{color:var(--muted)}.title-wall{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px;display:grid}.title-card{border:1px solid var(--line);opacity:.35;border-radius:10px;min-height:48px;padding:8px}.title-card.owned{opacity:1;background:#2a2112;border-color:#5a4720}.title-card.owned .title-name{color:#f3d9a4}.title-card.hidden{background:var(--surface-2);border-style:dashed}.title-name{overflow-wrap:anywhere;font-size:13px;font-weight:600}.title-desc{color:var(--muted);margin-top:3px;font-size:11px}.timeline{flex-direction:column;gap:10px;display:flex}.tl-item{cursor:pointer;gap:10px;display:flex}.tl-no{background:var(--surface-2);width:22px;height:22px;color:var(--muted);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:11px;display:flex}.tl-body{overflow-wrap:anywhere;flex-direction:column;flex:1;gap:3px;min-width:0;font-size:13px;display:flex}.tl-change.title,.tl-change.event{color:#f3d9a4}.tl-change.stage{color:var(--accent)}.tl-src{color:var(--muted);font-size:12px}.list-item.column{flex-direction:column;align-items:stretch;gap:10px}.list-sub.wrap{white-space:normal}.row.small button{flex:none;min-height:32px;padding:6px 12px;font-size:13px}.badge.dim{background:var(--surface-2);color:var(--muted)}textarea.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5}.radio-list{flex-direction:column;gap:8px;max-height:50vh;display:flex;overflow-y:auto}.radio{border:1px solid var(--line);border-radius:12px;align-items:center;gap:12px;padding:10px 12px;display:flex}.radio>div{min-width:0}.radio .list-sub,.radio .list-title{white-space:normal}.radio.on{border-color:var(--accent);background:var(--surface-2)}.radio input{width:20px;height:20px;accent-color:var(--accent);flex:none}.toggle-row{justify-content:space-between;align-items:center;gap:12px;color:var(--text)!important;flex-direction:row!important}.toggle-row>div{min-width:0}.toggle-row small{color:var(--muted);margin-top:2px;display:block}.toggle-row input{width:22px;height:22px;accent-color:var(--accent);flex:none}.sync-status{margin:-8px 0 0;font-size:12px}.spin{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.debug-msg{font-size:12px}.debug-msg b{color:var(--accent)}.debug-msg pre{white-space:pre-wrap;word-break:break-word;background:var(--surface-2);border-radius:8px;max-height:40vh;margin:4px 0 10px;padding:8px;overflow-y:auto}.toasts{top:calc(env(safe-area-inset-top) + 12px);pointer-events:none;z-index:100;flex-direction:column;align-items:center;gap:8px;display:flex;position:fixed;left:0;right:0}.toast{background:var(--surface-2);color:var(--text);border:1px solid var(--line);overflow-wrap:anywhere;border-radius:14px;align-items:center;gap:6px;max-width:calc(100vw - 32px);padding:8px 16px;font-size:14px;animation:.25s ease-out pop;display:flex;box-shadow:0 4px 16px #0006}.toast svg{flex:none}.toast.title{color:#f3d9a4;background:#3a2d12;border-color:#5a4720}.toast.error{color:var(--danger)}@keyframes pop{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:none}}.alias{opacity:.6;margin-left:6px;font-style:normal}.lore-entry{border:1px solid var(--line);border-radius:12px;overflow:hidden}.lore-entry.off{opacity:.55}.lore-head{cursor:pointer;align-items:center;gap:10px;padding:10px 12px;display:flex}.lore-head input{width:22px;height:22px;accent-color:var(--accent);flex:none}.lore-body{border-top:1px solid var(--line);flex-direction:column;gap:10px;padding:10px 12px 12px;display:flex}.lore-body label{color:var(--muted);flex-direction:column;gap:6px;font-size:13px;display:flex}.grow{flex:1}.check-list{flex-direction:column;gap:6px;display:flex}.check-list label{color:var(--text);flex-direction:row;align-items:center;gap:10px;font-size:15px;display:flex}.check-list input{width:20px;height:20px;accent-color:var(--accent);flex:none}.portrait-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px;display:grid}.portrait-card{border:1px solid var(--line);background:var(--surface);border-radius:12px;flex-direction:column;display:flex;overflow:hidden}.portrait-card img{aspect-ratio:3/4;object-fit:cover;width:100%;display:block}.portrait-card .ph{aspect-ratio:3/4;color:var(--muted);justify-content:center;align-items:center;display:flex}.portrait-card span{text-align:center;text-overflow:ellipsis;white-space:nowrap;padding:6px 8px;font-size:12px;overflow:hidden}.portrait-card button.link{align-self:center}.datalist-row{gap:8px;display:flex}.datalist-row input{flex:1}.avatar.topbar-avatar{border:none;flex:none;width:34px;height:34px;min-height:34px;margin:0 2px 0 0;padding:0;font-size:14px;transition:opacity .3s}.msg-name{align-items:center;gap:6px;display:flex}.msg-name .avatar{width:22px;height:22px;margin:0;font-size:11px}.portrait-viewer{flex-direction:column;align-items:center;gap:8px;display:flex}.portrait-viewer img{object-fit:contain;border-radius:14px;max-width:100%;max-height:60vh}.mode-btn{border-radius:20px;flex:none;height:40px;min-height:40px;padding:0 12px;font-size:13px;font-weight:600}.mode-btn.do{color:var(--accent);border-color:var(--accent)}.mode-btn.say{color:var(--speech);border-color:#5a4720}.mode-btn.story{color:var(--muted);border-style:dashed}.mode-tag{color:var(--accent);border:1px solid var(--accent);vertical-align:2px;border-radius:6px;margin-right:6px;padding:0 5px;font-size:11px;font-style:normal;display:inline-block}.msg.user.do .bubble{border:1px solid var(--line);color:var(--muted);background:0 0;font-style:italic}.msg.user.do .bubble .speech{font-style:normal}.bubble.narration{color:var(--muted);border-left:2px solid var(--line);padding-left:10px;font-style:italic}.msg-name.narr{color:var(--muted)}.chip.choice{color:var(--text);background:#221b2e;border-color:#4a3a66}.chip.more{color:var(--muted)}.chip.tiny{min-height:26px;padding:2px 10px;font-size:12px}.chip.tiny.exit{color:var(--accent)}.scene-bar{border-bottom:1px dashed var(--line);flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:6px;padding:8px 14px 10px;font-size:13px;display:flex}.scene-name{font-weight:600}.scene-time{color:var(--muted)}.scene-time:before{content:"·";margin-right:6px}.hidden-scene{align-items:stretch}.hidden-toggle{background:var(--surface);border:1px dashed var(--line);color:var(--muted);justify-content:center;font-size:12px}.drawer-h{color:var(--muted);margin:6px 0 2px;font-size:13px;font-weight:500}.drawer-grid{grid-template-columns:1fr 1fr;gap:8px;display:grid}.drawer-item{text-align:left;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px}.drawer-item b{font-size:14px}.drawer-item{min-width:0}.drawer-item span{color:var(--muted);white-space:normal;overflow-wrap:anywhere;max-width:100%;font-size:11px;font-weight:400;line-height:1.35}.chip.choice.explored{color:var(--muted);background:0 0;border-style:dashed}.chip.choice.explored svg{color:var(--accent)}.empty button{margin-top:14px}.empty p{margin:0}.radio.disabled{opacity:.45}.sheet-backdrop.confirm{z-index:50;justify-content:center;align-items:center}.confirm-box{background:var(--surface);border-radius:16px;flex-direction:column;gap:14px;width:min(86vw,360px);padding:20px 18px 14px;display:flex}.confirm-box p{margin:0;line-height:1.6}.confirm-box .msg-actions{justify-content:flex-end;margin:0}button.danger.solid{background:var(--danger);color:#1a0d10;border-color:#0000;font-weight:600}.rot-down{transform:rotate(-90deg)}.fix-row{align-items:center;gap:6px;display:flex}.fix-row .change{flex:1}.form-body{flex-direction:column;gap:14px;display:flex}.form-body h3{margin:10px 0 0;font-size:15px}.field-card{border:1px solid var(--line);border-radius:12px;flex-direction:column;gap:8px;padding:10px;display:flex}.field-card>.row.small{cursor:pointer;align-items:center}.field-card label{color:var(--muted);flex-direction:column;gap:4px;font-size:13px;display:flex}.field-card label.toggle-row{flex-direction:row!important}.stage-row{border:1px dashed var(--line);border-radius:10px;flex-direction:column;gap:6px;padding:8px;display:flex}.wrap-row{flex-wrap:wrap;align-items:center}.wrap-row input,.wrap-row select{min-width:90px}.form .tabs{padding:0}.to-bottom{background:var(--surface-2);z-index:3;border-radius:50%;width:38px;height:38px;min-height:38px;padding:0;position:absolute;bottom:120px;right:14px;box-shadow:0 4px 14px #0006}.screen{position:relative}.list-sub.dim{opacity:.7;font-size:11px}.form>*,.form-body>*,.sheet>*,.lore-body>*,.field-card>*,.composer>*,.entity>*,.radio-list>*,.check-list>*,.tabs.scroll,.radio-list,.quick{flex-shrink:0}
