:root{--bg:#14161b;--panel:#1d2027;--panel-2:#252932;--border:#323743;--text:#e6e3dc;--muted:#8d92a0;--accent:#d9a35b;--accent-text:#1a1408;--user:#2a3342;--danger:#e0685f;--ok:#7cc49a;--quote:#f0c98a;--radius:12px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);-webkit-text-size-adjust:100%;font-family:system-ui,-apple-system,PingFang SC,Microsoft YaHei,Noto Sans SC,sans-serif;font-size:16px;line-height:1.7}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;border:1px solid var(--border);background:var(--panel-2);touch-action:manipulation;border-radius:10px;min-height:40px;padding:8px 14px}button:hover:not(:disabled){border-color:var(--accent)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent);color:var(--accent-text);border-color:var(--accent);font-weight:600}button.ghost{background:0 0;border-color:#0000}button.small{min-height:32px;padding:4px 10px;font-size:14px}button.block{width:100%}button.danger{color:var(--danger)}input,textarea{background:var(--bg);border:1px solid var(--border);border-radius:10px;outline:none;width:100%;padding:9px 12px}input:focus,textarea:focus{border-color:var(--accent)}input[type=file]{padding:6px;font-size:14px}.muted{color:var(--muted)}.small{font-size:13px}.center{flex-direction:column;justify-content:center;align-items:center;gap:12px;min-height:100%;padding:16px;display:flex}.center-text{text-align:center;padding:24px 0}.error{color:var(--danger);background:#e0685f1a;border:1px solid #e0685f59;border-radius:10px;margin:8px 0;padding:8px 12px;font-size:14px}.card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius)}.login{justify-content:center;align-items:center;min-height:100%;padding:16px;display:flex}.login-card{flex-direction:column;gap:14px;width:100%;max-width:360px;padding:24px;display:flex}.login-card h1{text-align:center;margin:0 0 4px;font-size:22px}label{color:var(--muted);flex-direction:column;gap:4px;min-width:0;font-size:14px;display:flex}.topbar{padding:8px 12px;padding-top:max(8px, env(safe-area-inset-top));border-bottom:1px solid var(--border);background:var(--panel);flex-shrink:0;align-items:center;gap:8px;display:flex}.topbar .title{white-space:nowrap;text-overflow:ellipsis;flex:1;font-weight:600;overflow:hidden}.topbar-actions{align-items:center;gap:6px;display:flex}.page{flex-direction:column;min-height:100%;display:flex}.list-main{width:100%;max-width:720px;margin:0 auto;padding:16px}.campaigns{flex-direction:column;gap:10px;margin:16px 0 0;padding:0;list-style:none;display:flex}.campaign-item{align-items:center;padding:4px 8px 4px 4px;display:flex}.campaign-open{text-align:left;background:0 0;border:none;flex:1;min-width:0;padding:10px 12px}.campaign-title{white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}.game{flex-direction:column;max-width:820px;height:100dvh;margin:0 auto;display:flex}.chat{overscroll-behavior:contain;flex:1;padding:16px;overflow-y:auto}.msg{word-break:break-word;margin:0 0 12px}.msg p{margin:0 0 .8em}.msg p:last-child{margin-bottom:0}.msg.assistant{padding:2px}.msg.user{background:var(--user);border-radius:var(--radius);color:#cfd8e8;margin-left:15%;padding:8px 14px}.msg .quote{color:var(--quote)}.msg em{color:#b9bccb}.typing{color:var(--muted);animation:1.4s ease-in-out infinite pulse}@keyframes pulse{50%{opacity:.4}}.changes{flex-wrap:wrap;align-items:center;gap:6px;margin:-2px 0 18px;font-size:13px;display:flex}.changes-mark{color:var(--accent)}.chip{color:var(--accent);background:#d9a35b1f;border:1px solid #d9a35b59;border-radius:999px;padding:1px 10px}.chip.rejected{border-color:var(--border);color:var(--muted);background:0 0;text-decoration:line-through}.usage{color:var(--muted);text-align:right;font-size:12px}.composer{border-top:1px solid var(--border);background:var(--panel);padding:8px 12px;padding-bottom:max(8px, env(safe-area-inset-bottom));flex-shrink:0}.actions{grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:8px;display:grid}.input-row{align-items:stretch;gap:8px;display:flex}.input-row textarea{resize:none;flex:1;min-height:48px;max-height:30vh}.sheet-backdrop{z-index:10;background:#0000008c;justify-content:center;align-items:flex-end;animation:.15s ease-out fade;display:flex;position:fixed;inset:0}.sheet{background:var(--panel);border:1px solid var(--border);width:100%;max-width:640px;max-height:85dvh;padding-bottom:env(safe-area-inset-bottom);border-bottom:none;border-radius:18px 18px 0 0;flex-direction:column;animation:.2s ease-out slide;display:flex}.sheet-handle{background:var(--border);border-radius:2px;width:40px;height:4px;margin:8px auto 0}.sheet-header{justify-content:space-between;align-items:center;padding:4px 8px 4px 18px;display:flex}.sheet-header h2{margin:0;font-size:17px}.sheet-body{padding:4px 18px 20px;overflow-y:auto}@keyframes fade{0%{opacity:0}}@keyframes slide{0%{opacity:.4;transform:translateY(40px)}}.items,.quests{margin:0;padding:0;list-style:none}.items li,.quests li{border-bottom:1px solid var(--border);padding:10px 0}.items li:last-child,.quests li:last-child{border-bottom:none}.item-head{justify-content:space-between;gap:8px;display:flex}.item-name{font-weight:600}.item-qty{color:var(--accent);font-variant-numeric:tabular-nums}.status h3{color:var(--muted);margin:18px 0 4px;font-size:14px;font-weight:600}.hp-label{font-variant-numeric:tabular-nums;justify-content:space-between;display:flex}.hp-bar{background:var(--bg);border-radius:5px;height:10px;margin-top:4px;overflow:hidden}.hp-fill{background:var(--ok);height:100%;transition:width .3s}.hp-fill.mid{background:var(--accent)}.hp-fill.low{background:var(--danger)}.kv{grid-template-columns:auto 1fr;gap:6px 16px;margin:12px 0 0;display:grid}.kv-row{display:contents}.kv dt{color:var(--muted)}.kv dd{word-break:break-word;margin:0}.badge{background:var(--panel-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px;font-size:12px}.quest.done .badge{color:var(--ok)}.quest.failed .badge{color:var(--danger)}.quest.active .badge{color:var(--accent)}.form{flex-direction:column;gap:12px;display:flex}.form .row{grid-template-columns:1fr 1fr;gap:10px;display:grid}.hint{color:var(--ok);align-items:center;gap:6px;margin-top:-6px;font-size:14px;display:flex}select{background:var(--bg);border:1px solid var(--border);width:100%;font:inherit;color:inherit;border-radius:10px;padding:9px 12px}.tabs{border-bottom:1px solid var(--border);gap:4px;margin:4px 0 14px;display:flex;overflow-x:auto}.tabs button{color:var(--muted);white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0}.tabs button.active{color:var(--text);border-bottom-color:var(--accent)}.lib-toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.lib-toolbar select{width:auto}.file-button{border:1px solid var(--border);background:var(--panel-2);min-height:40px;color:var(--text);cursor:pointer;border-radius:10px;flex-direction:row;justify-content:center;align-items:center;padding:8px 14px;font-size:15px;display:inline-flex;position:relative;overflow:hidden}.file-button.small{align-self:flex-start;min-height:32px;padding:4px 10px;font-size:14px}.file-button input{opacity:0;cursor:pointer;position:absolute;inset:0}.section-title{color:var(--muted);margin:22px 0 0;font-size:14px;font-weight:600}.lib-item{flex-direction:column;padding:4px;display:flex}.lib-open{text-align:left;background:0 0;border:none;min-width:0;padding:10px 12px 4px}.lib-actions{justify-content:flex-end;gap:4px;display:flex}.notice{background:var(--panel-2);border:1px solid var(--border);border-radius:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px;padding:8px 12px;font-size:14px;display:flex}.form-gap{margin-bottom:12px}.topbar .primary.small{min-width:64px}.entries{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.entry{border:1px solid var(--border);background:var(--panel);border-radius:10px}.entry.disabled{opacity:.55}.entry-head{text-align:left;background:0 0;border:none;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.entry-title{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.entry-head .muted{text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;max-width:45%;overflow:hidden}.entry-edit{flex-direction:column;gap:10px;padding:4px 12px 12px;display:flex}.checks{align-items:center}label.check{color:var(--text);flex-direction:row;align-items:center;gap:8px;font-size:15px}label.check input{width:auto}label.inline{flex-direction:row;align-items:center;gap:8px}label.inline input{width:80px}.form .row.checks{grid-template-columns:auto auto 1fr}.field{flex-direction:column;gap:6px;display:flex}.field-label{color:var(--muted);font-size:14px}.row-buttons{flex-wrap:wrap;gap:8px;margin-top:14px;display:flex}.unstyled-fieldset{border:0;min-width:0;margin:0;padding:0}.roster-library summary,.roster-editor summary{cursor:pointer;color:var(--accent);padding:6px 0}.roster-item{padding:10px 12px}.roster-heading{overflow-wrap:anywhere;flex-wrap:wrap;align-items:center;gap:8px;display:flex}.roster-actions{margin-left:auto;display:flex}.roster-editor{border-top:1px solid var(--border);margin-top:10px;padding-top:12px}.worldbook-warning{color:var(--accent);overflow-wrap:anywhere;border:1px solid #d9a35b59;border-radius:10px;margin:8px 0;padding:8px 12px;font-size:13px}.worldbook-warning ul{margin:4px 0;padding-left:20px}.warning-badge{color:var(--accent);margin-left:6px}.chosen-book{padding:6px 0}.game-cast{border-bottom:1px solid var(--border);overflow-wrap:anywhere;flex-shrink:0;max-height:100px;padding:6px 16px;font-size:13px;overflow-y:auto}.speaker-label{color:var(--accent);margin-bottom:4px;font-size:12px}.opening-prompt{flex-direction:column;align-items:center;gap:14px;display:flex}
