:root{color-scheme:dark;font-family:Inter,"Noto Sans SC","PingFang SC",-apple-system,BlinkMacSystemFont,"Microsoft YaHei",sans-serif;background:#101115;color:#f3f3f1}*{box-sizing:border-box}body{margin:0}button,textarea,a{font:inherit}button{cursor:pointer}a{color:inherit;text-decoration:none}.app{display:flex;min-height:100dvh}.sidebar{width:256px;flex:none;background:#17181d;border-right:1px solid #292a31;display:flex;flex-direction:column;padding:23px 16px;z-index:5}.brand{display:flex;align-items:center;gap:10px;padding:2px 8px 30px;font-size:21px;font-weight:700;letter-spacing:.08em}.brand img{width:32px;height:32px}.brand small{display:block;font-size:8px;letter-spacing:.24em;color:#b4a7a0}.new-thread{display:flex;align-items:center;gap:10px;width:100%;height:42px;padding:0 14px;border:1px solid #46474e;border-radius:12px;background:#27282e;color:#f2f2f0;text-align:left}.new-thread:hover,.new-thread:focus-visible{border-color:#e7a98b;background:#303039}.new-thread span{font-size:20px;font-weight:300}.side-caption{margin:30px 9px 12px;color:#85868e;font-size:11px;letter-spacing:.1em}.threads{overflow:auto;flex:1}.threads .muted{color:#8a8a90;font-size:12px;padding:8px}.thread{display:flex;align-items:center;gap:4px;border-radius:10px;margin:2px 0}.thread.active{background:#303139}.thread button.open{border:0;background:none;color:#d9d9db;padding:11px 10px;flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.thread button.delete{display:none;border:0;background:none;color:#8f8f95;padding:6px 10px}.thread:hover button.delete,.thread.active button.delete,.thread button.delete:focus-visible{display:block}.thread button.delete:hover{color:#ffa88a}.sidebar-bottom{display:grid;gap:12px;padding:18px 9px 2px;border-top:1px solid #303138;font-size:12px;color:#aeafb4}.sidebar-bottom a:hover{color:#fff}.main{display:flex;flex:1;flex-direction:column;min-width:0;max-height:100dvh}.topbar{height:68px;flex:none;border-bottom:1px solid #24252a;display:flex;align-items:center;justify-content:center;position:relative;padding:0 24px}.mode-tabs{display:flex;background:#202127;padding:4px;border:1px solid #303138;border-radius:13px;gap:3px}.mode-tabs a{display:block;padding:8px 19px;border-radius:9px;color:#a7a8ae;font-size:13px;white-space:nowrap}.mode-tabs a.active{background:#393b42;color:#fff;box-shadow:0 1px 5px #0005}.mode-tabs a:hover{color:#fff}.account{position:absolute;right:30px;color:#c3c3c8;font-size:12px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account a{display:inline-block;border:1px solid #42444b;border-radius:8px;padding:8px 12px}.account a:hover{border-color:#dfa17f}.workspace{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column}.welcome{width:min(770px,calc(100% - 40px));margin:auto;padding:60px 0 50px;text-align:center}.eyebrow{font-size:11px;letter-spacing:.34em;color:#ce9a80}.welcome h1{font-size:clamp(26px,3vw,42px);font-weight:550;letter-spacing:-.04em;margin:16px 0}.welcome p{font-size:14px;line-height:1.9;color:#999aa2;max-width:570px;margin:0 auto}.suggestions{margin-top:45px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;text-align:left}.suggestions button{min-height:90px;padding:17px;border:1px solid #35363e;background:#1e1f25;color:#f3f1ee;border-radius:14px;text-align:left;font-size:13px}.suggestions button:hover{border-color:#d9a083;background:#28272a}.suggestions span{display:block;margin-top:10px;font-size:11px;color:#a0a0a7}.conversation{width:min(790px,calc(100% - 42px));margin:0 auto;padding:32px 0 52px}.messages{display:grid;gap:22px}.message{margin-left:auto;max-width:min(650px,90%);background:#2a2b32;border:1px solid #3c3d45;border-radius:18px 18px 4px 18px;padding:16px 18px}.message-head{font-size:11px;color:#c1a391;margin-bottom:10px}.message-text{white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.8}.message img{max-height:180px;max-width:100%;border-radius:10px;margin-top:12px;object-fit:contain}.message-foot{margin-top:12px;color:#9b9da5;font-size:11px}.empty-thread{color:#8e8f98;text-align:center;margin:90px 0}.composer-shell{width:min(790px,calc(100% - 42px));margin:0 auto;padding:8px 0 max(22px,env(safe-area-inset-bottom));flex:none}.status{padding:0 6px 11px;color:#c19d85;font-size:11px}.status.ready{color:#9babaa}.composer{background:#27282e;border:1px solid #484950;border-radius:17px;box-shadow:0 15px 45px #0004;padding:12px}.composer:focus-within{border-color:#bc8974}.composer textarea{display:block;width:100%;resize:none;min-height:68px;max-height:180px;outline:0;border:0;background:transparent;color:#f6f4f2;line-height:1.55;padding:5px 7px;font-size:14px}.composer textarea::placeholder{color:#85868d}.composer-actions,.left-actions{display:flex;align-items:center;gap:10px}.composer-actions{justify-content:space-between}.upload{display:inline-flex;align-items:center;min-height:32px;padding:0 10px;border:1px solid #4a4b53;border-radius:8px;color:#c8c7cb;font-size:12px;cursor:pointer}.upload:hover{color:#fff;border-color:#c59a82}.type-switch{display:flex;gap:3px;background:#1d1e22;border-radius:8px;padding:3px}.type-switch button{border:0;border-radius:6px;background:transparent;color:#a1a2a9;padding:6px 10px;font-size:12px}.type-switch button.selected{background:#3c3d45;color:#fff}.submit{min-height:34px;border:0;border-radius:8px;background:#ebaa87;color:#261e1b;font-size:12px;font-weight:700;padding:0 14px}.submit:hover{background:#ffc09b}.submit:disabled{opacity:.5;cursor:wait}.ref-preview{padding:6px 5px 10px}.ref-preview img{width:66px;height:66px;border-radius:9px;object-fit:cover}.ref-preview button{vertical-align:top;background:none;border:0;color:#dedee0}.composer-note{text-align:center;color:#777880;font-size:10px;margin:10px 0 0}.menu-toggle,.mobile-scrim{display:none}.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:20;background:#34353b;border:1px solid #606067;color:#fff;padding:11px 16px;border-radius:10px;font-size:12px;box-shadow:0 10px 30px #0008}@media(max-width:760px){.sidebar{position:fixed;inset:0 auto 0 0;transform:translateX(-100%);transition:transform .2s ease}.sidebar.open{transform:translateX(0)}.mobile-scrim.open{display:block;position:fixed;inset:0;background:#0009;z-index:4}.main{width:100%}.topbar{height:60px}.menu-toggle{display:block;position:absolute;left:15px;border:0;background:none;color:#ddd;font-size:21px}.account{right:12px;max-width:85px;font-size:11px}.account a{padding:7px}.mode-tabs a{font-size:12px;padding:7px 11px}.welcome{padding:30px 0}.welcome p{font-size:13px}.suggestions{grid-template-columns:1fr;gap:8px;margin-top:24px}.suggestions button{min-height:59px;padding:11px 14px}.suggestions span{margin-top:3px}.conversation{width:calc(100% - 28px);padding:20px 0}.composer-shell{width:calc(100% - 20px);padding-bottom:max(10px,env(safe-area-inset-bottom))}.composer textarea{min-height:62px}.composer-note{font-size:9px}.status{line-height:1.4}.submit{padding:0 10px}.left-actions{gap:5px}.upload{padding:0 7px}.type-switch button{padding:6px 7px}}@media(max-width:360px){.mode-tabs a{padding:7px 8px}.account{right:6px}.composer-actions{gap:4px}.submit{font-size:11px}}
:root .composer #model{max-width:180px;min-height:32px;border:1px solid #4a4b53;border-radius:8px;background:#1d1e22;color:#f3f1ee;padding:0 8px;font-size:12px}.composer #model[hidden]{display:none}.message video{display:block;width:min(460px,100%);max-height:400px;border-radius:10px;margin-top:14px}.message .retry{margin-top:12px;padding:8px 12px;border:1px solid #7e685d;border-radius:8px;background:#3c332f;color:#f6d7c5;font-size:12px}@media(max-width:600px){.composer-actions{align-items:flex-end}.left-actions{flex-wrap:wrap}.composer #model{max-width:145px}.message{max-width:100%}}
.composer-shell{position:relative}.ref-popover[hidden],.ref-menu[hidden],.ref-picker[hidden]{display:none}.ref-popover{position:absolute;left:0;bottom:calc(100% - 14px);z-index:25;width:min(390px,calc(100vw - 24px));color:#f2f2f3}.ref-menu,.ref-picker{border:1px solid #3b3c43;border-radius:16px;background:#24252b;box-shadow:0 18px 45px #000a}.ref-menu{padding:8px}.ref-menu button{display:flex;align-items:center;gap:14px;width:100%;min-height:52px;border:0;border-radius:10px;background:transparent;color:#f4f4f5;text-align:left;padding:0 15px;font-size:14px}.ref-menu button:hover,.ref-menu button:focus-visible{background:#383941;outline:0}.ref-menu button::before{display:grid;place-items:center;flex:none;width:22px;color:#f3f3f4;font-size:19px;font-weight:400}.ref-menu [data-ref-action=upload]::before{content:"↑"}.ref-menu [data-ref-action=assets]::before{content:"▱"}.ref-menu [data-ref-action=canvas]::before{content:"⊙"}.ref-picker{padding:12px}.ref-picker-head{display:flex;align-items:center;gap:9px;margin-bottom:12px}.ref-picker-head strong{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.ref-picker-head button{border:0;border-radius:7px;background:#36373d;color:#eee;width:30px;height:30px;font-size:18px}.ref-picker-head button:hover{background:#4d4e56}.ref-picker input[type=search]{width:100%;height:38px;border:1px solid #4a4b53;border-radius:9px;background:#191a20;color:#f5f5f6;padding:0 10px;outline:0;font-size:12px}.ref-picker input[type=search]:focus{border-color:#db9f83}.ref-picker-note{margin:9px 1px;color:#9a9ba2;font-size:11px;line-height:1.5}.ref-list{display:grid;gap:4px;max-height:min(330px,42vh);overflow:auto}.ref-list .ref-empty,.ref-list .ref-error{color:#a9a9af;text-align:center;margin:20px 4px;font-size:12px}.ref-list .ref-error{color:#e6a18f}.ref-option{display:flex;align-items:center;gap:10px;width:100%;min-height:58px;border:1px solid transparent;border-radius:9px;background:#2a2b31;color:#eee;text-align:left;padding:6px 9px}.ref-option:hover,.ref-option:focus-visible{border-color:#dca386;background:#35353c;outline:0}.ref-option:disabled{opacity:.55;cursor:wait}.ref-option img,.ref-option-icon{width:46px;height:46px;border-radius:7px;object-fit:cover;flex:none;background:#42434b}.ref-option-icon{display:grid;place-items:center;color:#ddd;font-size:11px}.ref-option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.upload:focus-visible{outline:2px solid #dca386;outline-offset:2px}@media(max-width:600px){.ref-popover{left:0;bottom:calc(100% - 8px)}.ref-menu button{min-height:48px}.ref-list{max-height:38vh}}
.composer-actions{justify-content:space-between}.composer-expand{border:1px solid #4a4b53;border-radius:8px;background:#202127;color:#c6c6cb;min-width:32px;height:32px;font-size:17px}.composer-expand:hover,.composer-expand:focus-visible{border-color:#dfaa8e;color:#fff}.composer textarea.expanded{min-height:min(32vh,300px)}.composer-options{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:10px}.option-fields{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}.composer #model,.option-label,#mention-trigger,.credit-status{min-height:32px;border:1px solid #4a4b53;border-radius:8px;background:#202127;color:#dedee0;font-size:11px}.composer #model{max-width:220px;margin:0;padding:0 7px}.composer #model:disabled,.option-label:has(select:disabled){opacity:.55}.option-label{display:flex;align-items:center;gap:4px;padding:0 7px;white-space:nowrap}.option-label[hidden]{display:none}.option-label select{border:0;outline:0;background:transparent;color:inherit;font-size:11px;max-width:65px}.option-label select option,.composer #model option{background:#24252b;color:#eee}#mention-trigger{padding:0 9px;cursor:pointer}#mention-trigger:hover,#mention-trigger:focus-visible{border-color:#dca386;color:#fff}.credit-status{display:flex;align-items:center;padding:0 9px;color:#b7b8be;white-space:nowrap}.composer-options .submit{flex:none;white-space:nowrap}.ref-preview{display:flex;flex-wrap:wrap;gap:8px}.ref-preview figure{position:relative;margin:0;width:66px}.ref-preview figure img{display:block;width:66px;height:66px}.ref-preview figure .reference-remove{position:absolute;right:-5px;top:-5px;width:21px;height:21px;border-radius:50%;background:#36373e;border:1px solid #777;color:#fff;padding:0;line-height:19px}.ref-preview figcaption{color:#b9bac0;font-size:10px;text-align:center;margin-top:2px}.mention-popover[hidden]{display:none}.mention-popover{position:absolute;left:10px;bottom:calc(100% - 14px);z-index:26;width:min(275px,calc(100vw - 32px));max-height:250px;overflow:auto;border:1px solid #4a4b53;border-radius:12px;background:#25262c;box-shadow:0 18px 40px #000a;padding:7px}.mention-popover button{display:flex;align-items:center;gap:9px;width:100%;border:0;border-radius:8px;background:transparent;color:#fff;padding:6px;text-align:left;font-size:12px}.mention-popover button:hover,.mention-popover button:focus-visible{background:#393a42}.mention-popover img{width:32px;height:32px;object-fit:cover;border-radius:5px}.message-settings{font-size:11px;color:#8e9098;margin-top:8px}@media(max-width:760px){.composer-options{align-items:flex-end}.option-fields{gap:5px}.composer #model{max-width:160px}.option-label,#mention-trigger,.credit-status{min-height:30px}.credit-status{font-size:10px}.composer-options .submit{padding:0 9px}}@media(max-width:360px){.composer-options{gap:5px}.composer #model{max-width:135px}.option-label{padding:0 5px}.credit-status{padding:0 6px}}

.message-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:12px}.message-actions button{min-height:32px;padding:6px 11px;border:1px solid #66616a;border-radius:8px;background:#35343b;color:#e8e4e1;font-size:12px}.message-actions button:hover,.message-actions button:focus-visible{border-color:#dfa88c;color:#fff}.message-actions .retry{margin-top:0;border-color:#7e685d;background:#3c332f;color:#f6d7c5}.message-actions .message-delete{margin-left:auto;color:#c9a9a4}.message-actions .message-delete:hover,.message-actions .message-delete:focus-visible{border-color:#cb7770;background:#4b3032;color:#fff}.message-actions button:disabled{opacity:.45;cursor:not-allowed}@media(max-width:600px){.message-actions .message-delete{margin-left:0}}

.wallet-balance{position:absolute;left:24px;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:8px;min-height:38px;padding:4px 5px 4px 12px;border:1px solid #765747;border-radius:11px;background:#2e2928;color:#dfc2b0;white-space:nowrap;font-size:12px}.wallet-balance strong{color:#fff4eb;font-size:16px;font-weight:700;font-variant-numeric:tabular-nums}.wallet-balance button{width:28px;height:28px;padding:0;border:0;border-radius:7px;background:#49372f;color:#f6d9c7;font-size:19px;line-height:1}.wallet-balance button:hover,.wallet-balance button:focus-visible{background:#684c3e;color:#fff}.wallet-balance button:disabled{opacity:.45;cursor:default}.credit-status{color:#e6d1c4;border-color:#765747;background:#332a28}
.wallet-balance .wallet-recharge{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-height:28px;padding:0 9px;border-radius:7px;background:#e6a887;color:#281e1a;font-size:12px;font-weight:700}.wallet-balance .wallet-recharge:hover,.wallet-balance .wallet-recharge:focus-visible{background:#ffc29f;color:#211915;outline:2px solid #ffc29f;outline-offset:2px}
@media(max-width:1100px){.topbar{height:96px;padding-bottom:34px}.wallet-balance{left:50%;top:auto;bottom:7px;transform:translateX(-50%);min-height:30px;padding:2px 4px 2px 9px}.wallet-balance strong{font-size:14px}.wallet-balance button{width:24px;height:24px;font-size:17px}.account{top:19px}.menu-toggle{top:13px}}

/* Creation cards and centered progress state. */
.messages{gap:20px;padding-bottom:18px}.message{width:min(680px,100%);max-width:100%;margin-left:auto;padding:22px;border:1px solid #414149;border-radius:20px;background:linear-gradient(150deg,#292a31,#222329 80%);box-shadow:0 12px 30px #0002}.message-head{display:inline-flex;align-items:center;gap:7px;margin-bottom:14px;padding:6px 10px;border:1px solid #7b5a4c66;border-radius:999px;background:#bd8a6e1c;color:#e9b599;font-size:11px;font-weight:650}.message-text{color:#f4f0ec;font-size:14px;line-height:1.85}.message-settings{margin-top:14px;padding-top:12px;border-top:1px solid #ffffff14;color:#a4a3a9;line-height:1.6}.message-reference{width:80px;height:80px;object-fit:cover!important;border:1px solid #ffffff22}.message-media{display:grid;gap:12px;margin-top:16px;overflow:hidden;border-radius:14px;background:#16171b}.message-media img,.message-media video{display:block;width:100%;max-width:100%;max-height:620px;margin:0;border-radius:14px;object-fit:contain}.message-foot{margin-top:16px;padding:10px 12px;border:1px solid #ffffff12;border-radius:9px;background:#ffffff08;color:#c4c2c7;line-height:1.55}.message-completed .message-foot{border-color:#6aa98d44;background:#4f9d7730;color:#b5e3c5}.message-failed .message-foot{border-color:#d2857944;background:#a6534e24;color:#f0aaa0}.message-actions{margin-top:12px}.message-actions button{border-radius:9px;transition:background .15s,border-color .15s,transform .15s}.message-actions button:hover{transform:translateY(-1px)}.message-generation-loading{min-height:210px;margin-top:16px;border:1px dashed #a7827055;border-radius:14px;background:radial-gradient(circle at center,#b8816540,#1b1c21 68%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center}.message-generation-loading strong{color:#f7e7dc;font-size:15px;font-weight:650}.message-generation-loading>span:last-child{color:#aaa4a1;font-size:12px}.qx-loader{display:inline-block;width:34px;height:34px;border:3px solid #e8b29944;border-top-color:#f3bc9f;border-radius:50%;animation:qx-spin .9s linear infinite}@keyframes qx-spin{to{transform:rotate(360deg)}}@media(max-width:600px){.message{padding:16px;border-radius:16px}.message-generation-loading{min-height:180px}}
.message-generation-track{width:min(290px,88%);height:6px;overflow:hidden;border-radius:99px;background:#ffffff24;margin-top:6px}
.message-generation-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#cf8b77,#f7c4a8)}
.message-generation-track .indeterminate{width:36%;animation:qx-progress-slide 1.5s ease-in-out infinite}
@keyframes qx-progress-slide{from{transform:translateX(-110%)}to{transform:translateX(385%)}}
.mj-panel[hidden],.option-label[hidden]{display:none!important}
.mj-panel{margin:11px 2px 0;padding:12px 14px;border:1px solid #6c5660;border-radius:12px;background:linear-gradient(135deg,#302a36,#25272e);color:#ede7ee}
.mj-panel summary{cursor:pointer;font-size:12px;font-weight:700;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px}
.mj-panel summary::-webkit-details-marker{display:none}
.mj-panel summary small{font-size:10px;font-weight:400;color:#cfb8c8;text-align:right}
.mj-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:13px}
.mj-fields>label{display:grid;gap:4px;font-size:11px;color:#cfc6d1}
.mj-fields input:not([type=checkbox]),.mj-fields select{min-width:0;width:100%;padding:7px 8px;border:1px solid #69616d;border-radius:8px;background:#1d1e24;color:#fff;font-size:12px;outline:none}
.mj-fields input:focus,.mj-fields select:focus{border-color:#e8b0a0}
.mj-fields .mj-wide{grid-column:span 3}
.mj-flags{grid-column:span 3;display:flex;gap:16px;flex-wrap:wrap;font-size:11px;color:#e1d8e0}
.mj-flags label{display:inline-flex;align-items:center;gap:5px}
.mj-panel p{margin:11px 0 0;color:#aaa2af;font-size:10px;line-height:1.5}
.message-media.mj-grid{grid-template-columns:repeat(2,minmax(0,1fr));background:transparent}
.message-media.mj-grid img{width:100%;aspect-ratio:1/1;max-height:none;object-fit:cover;background:#15161a}
@media(max-width:600px){.mj-panel{padding:11px}.mj-panel summary{align-items:start;flex-direction:column;gap:3px}.mj-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.mj-fields .mj-wide,.mj-flags{grid-column:span 2}.mj-flags{gap:8px 14px}}

.message-media.is-generating{width:100%;aspect-ratio:16/9;min-height:220px;max-height:620px;grid-template-columns:1fr}
.message-media.is-generating .message-generation-loading{width:100%;height:100%;min-height:0;margin:0;padding:18px;border:0;border-radius:14px}
@media(max-width:600px){.message-media.is-generating{min-height:180px}.message-media.is-generating .message-generation-loading{padding:12px}}

.message-media .message-open{position:relative;display:block;width:100%;max-height:620px;aspect-ratio:var(--output-ratio,16/9);padding:0;border:0;border-radius:14px;overflow:hidden;background:#16171b;color:#fff;cursor:zoom-in}
.message-media .message-open img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;transition:opacity .16s ease}
.message-open.is-loading{background:linear-gradient(110deg,#191a20 20%,#27282f 45%,#191a20 70%);background-size:200% 100%;animation:qx-image-loading 1.5s linear infinite}
.message-open.is-loading img{opacity:0}
.message-open.is-loading::after{content:'图片加载中…';position:absolute;inset:0;display:grid;place-items:center;color:#b7b4b5;font-size:12px}
.message-open.is-error::after{content:'图片加载失败，点击查看原图';position:absolute;inset:0;display:grid;place-items:center;color:#e8a79d;font-size:12px}
.message-open-hint{position:absolute;right:10px;bottom:10px;padding:5px 8px;border-radius:7px;background:#111b;color:#fff;font-size:11px;opacity:.9}
.message-open:hover .message-open-hint,.message-open:focus-visible .message-open-hint{background:#51382e}
.message-open:focus-visible{outline:2px solid #e6a887;outline-offset:3px}
@keyframes qx-image-loading{to{background-position-x:-200%}}
.generated-lightbox{width:min(96vw,1600px);max-width:none;max-height:96dvh;padding:0;border:1px solid #55505a;border-radius:14px;background:#17181d;color:#fff;box-shadow:0 28px 90px #000c}
.generated-lightbox::backdrop{background:#050609e8}
.generated-lightbox-panel{display:flex;flex-direction:column;align-items:center;max-height:96dvh}
.generated-lightbox-toolbar{display:flex;align-items:center;gap:14px;width:100%;min-height:52px;padding:8px 14px;border-bottom:1px solid #ffffff20}
.generated-lightbox-toolbar strong{margin-right:auto;font-size:13px}
.generated-lightbox-toolbar a,.generated-lightbox-toolbar button{padding:7px 10px;border:1px solid #5b555c;border-radius:8px;background:#2a2b31;color:#f1eae7;font-size:12px}
.generated-lightbox-toolbar a:hover,.generated-lightbox-toolbar button:hover{border-color:#e6a887}
.generated-lightbox-toolbar .generated-image-save{background:#ead3c2;color:#251b16;border-color:#ead3c2;font-weight:600;white-space:nowrap}
.generated-lightbox-toolbar a,.generated-lightbox-toolbar button{white-space:nowrap}
.generated-lightbox-toolbar [aria-busy="true"]{opacity:.6;cursor:wait}
.generated-lightbox img{display:block;max-width:100%;max-height:calc(96dvh - 54px);width:auto;height:auto;object-fit:contain}
@media(max-width:600px){.generated-lightbox{width:100vw;max-height:100dvh;border-radius:0}.generated-lightbox-panel{max-height:100dvh}.generated-lightbox-toolbar{flex-wrap:wrap;gap:8px}.generated-lightbox-toolbar strong{flex-basis:100%;font-size:12px}.generated-lightbox img{max-height:calc(100dvh - 100px)}}

/* Current model reference limits and private multimedia previews. */
.reference-support{margin:6px 0 4px;font-size:11px;line-height:1.6;color:#a7a6af;overflow-wrap:anywhere}
.ref-preview figure[data-reference-kind="video"]{width:144px}
.ref-preview figure[data-reference-kind="audio"]{width:220px}
.ref-preview video{display:block;width:144px;height:82px;object-fit:contain;background:#17181d;border-radius:9px}
.ref-preview audio{display:block;width:220px;height:40px;margin-top:24px}
.ref-preview figcaption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ref-option video{width:52px;height:46px;object-fit:cover;background:#17181d;border-radius:6px;flex-shrink:0}
.reference-audio-icon{display:flex;width:52px;height:46px;align-items:center;justify-content:center;background:#343341;color:#e8c6b2;border-radius:6px;font-size:24px;flex-shrink:0}
.message video.message-reference{width:144px;height:96px;object-fit:contain!important;background:#17181d;border-radius:8px}
.message audio.message-reference{width:240px;max-width:100%;height:42px;border:0}
@media(max-width:560px){.reference-support{font-size:10px}.ref-preview figure[data-reference-kind="audio"]{width:190px}.ref-preview audio{width:190px}}

/* Customer-owned chat history assets. */
.history-entry-button,.history-sidebar-entry{font:inherit;color:#e8e8e8;background:#25262b;border:1px solid #42444b;border-radius:10px;cursor:pointer;padding:10px 13px;white-space:nowrap}
.history-entry-button{font-size:12px;flex:0 0 auto}.history-sidebar-entry{text-align:left;margin-top:10px;width:100%;font-size:14px}.history-entry-button:hover,.history-sidebar-entry:hover{border-color:#d79c72;background:#343035}
.history-assets,.history-preview{padding:0;color:#eee;background:#191a1f;border:1px solid #42444b;border-radius:18px;width:min(1100px,calc(100vw - 36px));max-width:none;max-height:calc(100dvh - 36px);overflow:hidden;box-shadow:0 24px 90px #0008}
.history-assets::backdrop,.history-preview::backdrop{background:#000b;backdrop-filter:blur(4px)}.history-panel{padding:24px;max-height:calc(100dvh - 36px);overflow:auto}.history-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.history-head h2{margin:0;font-size:23px;font-weight:600}.history-head p{font-size:13px;color:#a1a1ad;margin:7px 0 0}.history-head button,.history-filters button,.history-footer button,.history-preview button{font:inherit;color:#e7e7eb;background:#2c2d34;border:1px solid #4b4b55;border-radius:9px;padding:9px 12px;cursor:pointer;white-space:nowrap}
.history-filters{display:flex;flex-wrap:wrap;gap:9px;margin-top:22px}.history-filters input,.history-filters select{font:inherit;font-size:13px;min-width:0;color:#eee;background:#24252c;border:1px solid #454650;border-radius:9px;padding:10px}.history-filters input{flex:1 1 250px}.history-filters select{flex:0 1 auto}.history-status{color:#b4b0ad;font-size:12px;min-height:20px;margin:17px 0}.history-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;min-height:80px}.history-card{background:#24252b;border:1px solid #3c3e45;border-radius:13px;overflow:hidden;min-width:0}.history-card-media{position:relative;border:0;padding:0;display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:4/3;background:#101115;color:#cdab90;cursor:pointer}.history-image{display:block;width:100%;height:100%;object-fit:contain}.history-image-error{font-size:12px;padding:10px;box-sizing:border-box}.history-kind-badge{position:absolute;left:9px;bottom:9px;padding:4px 7px;background:#171717c9;border-radius:5px;color:#eee;font-size:11px}.history-media-icon{font-size:40px}.history-card-body{padding:12px}.history-card h3{font-size:13px;line-height:1.5;font-weight:500;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;height:39px;overflow-wrap:anywhere}.history-card-meta,.history-card-model{color:#999ba6;font-size:10px;line-height:1.5;margin:7px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.history-card-actions button{font:inherit;font-size:11px;background:#323039;color:#e1c0a8;border:1px solid #56515a;padding:6px 8px;border-radius:7px;cursor:pointer}.history-card-actions button:disabled,.history-preview button:disabled{opacity:.5;cursor:default}.history-footer{display:flex;justify-content:center;margin-top:20px}.history-preview{width:min(900px,calc(100vw - 32px));z-index:101}.history-preview-panel{padding:20px;max-height:calc(100dvh - 36px);overflow:auto}.history-preview-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.history-preview-head strong{font-size:14px;overflow-wrap:anywhere}.history-preview .history-image{max-height:65dvh;object-fit:contain}.history-player{display:block;width:100%;max-height:62dvh;background:#101115}.history-preview-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px;font-size:12px}.history-preview-actions a{color:#e3b38e}.history-preview-description{white-space:pre-wrap;overflow-wrap:anywhere;color:#bbb;font-size:12px;line-height:1.6}
@media(max-width:950px){.history-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.history-entry-button{padding:7px 9px;font-size:11px}.history-assets{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:13px}.history-panel{padding:16px;max-height:calc(100dvh - 16px)}.history-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.history-head h2{font-size:21px}.history-filters{gap:7px;margin-top:18px}.history-filters input{flex-basis:100%}.history-filters select{flex:1 1 95px;font-size:12px;padding:8px 5px}.history-filters button{font-size:12px;padding:8px}.history-card-body{padding:9px}.history-card-actions{gap:5px}.history-card-actions button{font-size:10px;padding:6px}.history-preview-panel{padding:14px}.history-preview-actions button{padding:8px;font-size:11px}.history-preview-head strong{max-width:75%}}

.history-entry-button{position:absolute;right:210px}
@media(max-width:1100px){.history-entry-button{right:115px}}
@media(max-width:560px){.history-entry-button{right:12px;top:62px;padding:5px 8px;font-size:11px}.topbar .wallet-balance{left:12px;transform:none}}

/* Composer count and reference menu anchored to the current caret. */
.prompt-meter{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:4px 0 8px;min-height:16px;font-size:11px;line-height:1.4;color:#a8a9b2}.prompt-count{flex:none;white-space:nowrap;margin-left:auto;font-variant-numeric:tabular-nums}.prompt-limit-note{min-width:0;overflow-wrap:anywhere}.prompt-meter .is-over-limit{color:#ffb397}.mention-popover.is-caret-positioned{position:fixed;bottom:auto;z-index:100;width:min(275px,calc(100vw - 16px))}


/* Conversation naming, pinning and direct image mention. */
.thread button.pin{display:block;border:0;background:none;color:#81828a;padding:6px 4px;font-size:16px;line-height:1;cursor:pointer}.thread button.pin:hover,.thread button.pin:focus-visible,.thread.pinned button.pin{color:#edb18d}.thread button.pin:disabled{opacity:.45;cursor:wait}.thread.pinned .open::before{content:'置顶 · ';color:#e5a788;font-size:10px}.thread-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 16px;padding:11px 13px;border:1px solid #3f3f48;border-radius:12px;background:#22232a}.thread-toolbar>div:first-child{min-width:0}.thread-toolbar span{display:block;color:#9798a1;font-size:10px;letter-spacing:.08em}.thread-toolbar strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px;color:#f0eeeb;font-size:14px;font-weight:600}.thread-toolbar-actions{display:flex;gap:7px;flex:none}.thread-toolbar button{min-height:30px;border:1px solid #52535b;border-radius:8px;background:#2d2e35;color:#e4e3e4;padding:0 10px;font-size:12px;cursor:pointer}.thread-toolbar button:hover,.thread-toolbar button:focus-visible{border-color:#e0a487;color:#fff}.thread-toolbar button:disabled{opacity:.5;cursor:wait}.thread-name-dialog{width:min(440px,calc(100vw - 28px));padding:0;border:1px solid #4d4e58;border-radius:16px;background:#202127;color:#f2f0ed;box-shadow:0 24px 80px #000b}.thread-name-dialog::backdrop{background:#000a;backdrop-filter:blur(3px)}.thread-name-dialog form{padding:20px}.thread-name-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}.thread-name-dialog h2{margin:0;font-size:19px;font-weight:650}.thread-name-dialog header p{margin:6px 0 0;color:#a9a9b0;font-size:12px;line-height:1.55}.thread-name-dialog header button{width:30px;height:30px;padding:0;border:0;border-radius:8px;background:#35363d;color:#dedee1;font-size:19px;cursor:pointer}.thread-name-dialog label{display:block;margin-bottom:7px;color:#d4d2d1;font-size:12px}.thread-name-dialog input{box-sizing:border-box;width:100%;height:42px;border:1px solid #555661;border-radius:9px;outline:0;background:#16171b;color:#f5f3ef;padding:0 11px;font:inherit;font-size:14px}.thread-name-dialog input:focus{border-color:#e3a78a;box-shadow:0 0 0 3px #d9937522}.thread-name-error{min-height:18px;margin:7px 0 0;color:#f0a69d;font-size:11px}.thread-name-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.thread-name-dialog footer button{min-height:34px;border:1px solid #53545d;border-radius:8px;background:#31323a;color:#eceaec;padding:0 12px;font-size:12px;cursor:pointer}.thread-name-dialog footer button[type=submit]{border-color:#e3a486;background:#e7a788;color:#261d1b;font-weight:700}.thread-name-dialog footer button:disabled{opacity:.5;cursor:wait}.ref-preview figure .reference-mention{position:relative;display:block;width:66px;height:66px;padding:0;border:0;border-radius:9px;background:transparent;overflow:hidden;cursor:pointer}.ref-preview figure .reference-mention::after{content:'@';position:absolute;right:4px;bottom:4px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#17181de6;border:1px solid #f0b18e;color:#ffd6be;font-size:14px;font-weight:700;opacity:.86;transition:opacity .14s}.ref-preview figure .reference-mention:hover::after,.ref-preview figure .reference-mention:focus-visible::after{opacity:1}.ref-preview figure .reference-mention:focus-visible{outline:2px solid #efad8b;outline-offset:2px}.ref-preview figure .reference-mention img{width:66px;height:66px}.ref-preview figure .reference-mention:disabled{cursor:wait;opacity:.55}@media(max-width:600px){.thread-toolbar{margin-bottom:12px;padding:10px}.thread-toolbar-actions{gap:5px}.thread-toolbar button{padding:0 8px}.thread-name-dialog form{padding:17px}.ref-preview figure .reference-mention::after{opacity:1}}

/* Always-visible conversation naming and toolbar while reading long threads. */
.thread button.open{min-width:0}.thread button.rename{display:block;flex:none;min-height:30px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:#c8b3a5;font-size:11px;white-space:nowrap;cursor:pointer}.thread button.rename:hover,.thread button.rename:focus-visible{background:#454049;color:#ffe1cf;outline:1px solid #ad7f66}.thread button.rename:disabled{opacity:.45;cursor:wait}.thread-toolbar{position:sticky;top:10px;z-index:3;box-shadow:0 4px 18px #10111560}.thread-toolbar[hidden]{display:none}.thread-name-dialog button:disabled,.thread-name-dialog input:disabled{opacity:.5;cursor:wait}@media(max-width:760px){.thread button.rename{min-height:36px;font-size:12px}.thread button.pin{min-height:36px;min-width:28px}.thread-toolbar{top:8px}}

/* Reserve action space so hovering a row cannot move the naming hit target. */
.thread button.delete{display:block;flex:none;visibility:hidden}.thread:hover button.delete,.thread.active button.delete,.thread:focus-within button.delete{visibility:visible}@media(max-width:760px){.thread button.delete{visibility:visible;min-height:36px}}

/* Project groups: private conversation organization. */
.side-project-actions{display:flex;align-items:center;gap:6px;margin:23px 4px 8px}.side-project-actions>span{flex:1;color:#a4a4ae;font-size:12px}.side-project-actions button{border:1px solid #44454f;border-radius:7px;background:#24252d;color:#d9c3b5;padding:5px 7px;font-size:11px}.side-project-actions button:disabled{opacity:.45;cursor:default}.project-context{margin:0 6px 12px;color:#92939d;font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.project-group{margin:0 0 10px}.project-heading{padding:3px 5px;border-radius:7px;background:#202127}.project-heading-actions{display:flex;align-items:center;gap:5px;padding:0 2px 3px}.selected-project>.project-heading{background:#302b2b}.project-toggle{display:flex;align-items:center;gap:6px;width:100%;min-width:0;padding:7px 5px;border:0;background:transparent;color:#dcdbdb;text-align:left;font-size:12px}.project-arrow{flex:none;color:#a79487}.project-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-toggle small{flex:none;color:#9596a0;font-size:10px}.project-add,.project-manage,.project-delete-group{flex:none;min-height:28px;padding:0 7px;border:1px solid #46414a;border-radius:5px;background:transparent;color:#bba99d;font-size:11px}.project-delete-group{margin-left:auto;border-color:#6b4846;color:#edab9b}.project-delete-group:hover,.project-delete-group:focus-visible{background:#4c3030;color:#ffcebc}.project-heading-actions button:disabled{opacity:.5;cursor:wait}.project-add:hover,.project-manage:hover,.project-toggle:hover{background:#3c373b}.project-members{padding:2px 0 0 5px}.project-members[hidden]{display:none}.project-empty{margin:8px 5px;color:#8f9099;font-size:11px;line-height:1.7}.thread button.move-group{display:block;flex:none;width:22px;min-height:30px;padding:0;border:0;border-radius:5px;background:transparent;color:#b5a99f;font-size:14px}.thread button.move-group:hover,.thread button.move-group:focus-visible{background:#454049;color:#ffe1cf}.thread button.move-group:disabled{opacity:.45;cursor:wait}.project-dialog{width:min(540px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:0;border:1px solid #4d4e58;border-radius:16px;background:#202127;color:#efeeeb;box-shadow:0 24px 80px #000b}.project-dialog::backdrop{background:#000a;backdrop-filter:blur(3px)}.project-dialog form{display:flex;flex-direction:column;gap:13px;max-height:calc(100dvh - 30px);padding:22px}.project-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.project-dialog h2{margin:0;font-size:19px}.project-dialog header p{margin:7px 0 0;color:#a5a6b0;font-size:12px;line-height:1.6}.project-dialog label{font-size:12px;color:#d8d5d3}.project-dialog input:not([type=checkbox]),.project-dialog select{width:100%;height:40px;margin-top:7px;min-width:0;padding:0 11px;border:1px solid #555661;border-radius:8px;background:#16171c;color:#f5f3ef;font:inherit;font-size:13px}.project-dialog button{min-height:32px;padding:0 10px;border:1px solid #4b4c56;border-radius:7px;background:#30313a;color:#e7e1dc;font:inherit;font-size:12px}.project-dialog header>button{flex:none;width:30px;padding:0;font-size:19px}.project-dialog button:disabled,.project-dialog input:disabled,.project-dialog select:disabled{opacity:.5;cursor:wait}.project-selection-head{display:flex;align-items:center;justify-content:space-between;font-size:12px}.project-selection-head span{font-size:11px;color:#b29e8d}.project-selection-filter{display:flex;align-items:center;gap:8px}.project-selection-filter input:not([type=checkbox]){flex:1;margin:0}.project-selection-filter button{flex:none;font-size:11px;white-space:nowrap}.project-list{overflow:auto;min-height:48px;max-height:min(34dvh,300px);padding:5px;border:1px solid #3e3f48;border-radius:9px;background:#191a20}.project-thread-choice{display:flex;align-items:center;gap:10px;padding:9px 6px;border-radius:7px;cursor:pointer}.project-thread-choice:hover{background:#2d2e36}.project-thread-choice input{width:17px;height:17px;flex:none;accent-color:#d5a182}.project-thread-choice>span{min-width:0}.project-thread-choice b{display:block;font-size:12px;font-weight:500;overflow-wrap:anywhere}.project-thread-choice small{display:block;margin-top:4px;color:#9f9390;font-size:10px}.project-error{margin:0;color:#ffb09a;font-size:12px;line-height:1.5}.project-error:empty{display:none}.project-list .muted{padding:8px;color:#95969f;font-size:12px}.project-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:4px;flex:none}.project-dialog footer>div{display:flex;gap:8px;margin-left:auto}.project-dialog #project-save{background:#dba687;color:#201b18;border-color:#dba687}.project-dialog .project-danger{color:#eea595}.project-dialog [hidden]{display:none!important}@media(max-width:760px){.project-dialog form{padding:16px;gap:11px}.project-dialog{width:calc(100vw - 24px)}.project-heading button,.thread button.move-group{min-height:36px}.side-project-actions button{min-height:34px}.project-dialog footer button{min-height:38px}.thread-toolbar-actions{gap:5px}.thread-toolbar button{padding:0 7px}.project-list{flex:1}.project-dialog label{flex:none}}

/* Keep conversation controls visible and reachable in touch browsers. */
.qx-chat-ui .thread{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;padding:5px 4px 7px;margin:5px 0;min-width:0;border:1px solid #2d414133}.qx-chat-ui .thread button.open{grid-column:1/-1;min-width:0;width:100%;padding:6px 5px;min-height:32px;line-height:1.5}.qx-chat-ui .thread button.rename,.qx-chat-ui .thread button.move-group,.qx-chat-ui .thread button.pin,.qx-chat-ui .thread button.delete{display:block;visibility:visible;opacity:1;position:static;min-width:0;width:100%;height:32px;padding:4px 2px;font-size:11px;border:1px solid #304543;border-radius:5px;background:#142122;color:#a0beb4;white-space:nowrap}.qx-chat-ui .thread button.delete{color:#e1b3a1;border-color:#5b4139;background:#342724}.qx-chat-ui .thread button.delete:hover,.qx-chat-ui .thread button.delete:focus-visible{color:#fff1e6;background:#51362d;border-color:#b38166}.qx-chat-ui .thread button:focus-visible{outline:2px solid #9cdfc5;outline-offset:2px}.qx-chat-ui .thread button:disabled{opacity:.4;cursor:not-allowed}

.qx-chat-ui .composer textarea.expanded{height:min(45dvh,420px);min-height:min(45dvh,420px);max-height:min(58dvh,520px)}.qx-chat-ui .composer-expand{position:relative;z-index:2;cursor:pointer;flex:none}.qx-chat-ui .mention-popover.is-caret-positioned{z-index:100100}.qx-chat-ui .composer:has(textarea.expanded){box-shadow:0 14px 50px #0007}@media(max-width:760px){.qx-chat-ui .composer textarea.expanded{height:38dvh;min-height:38dvh;max-height:48dvh}}

/* Compact mention selector; media players remain in the main attachment tray. */
.mention-popover .mention-thumbnail{display:grid;place-items:center;width:32px;height:32px;min-width:32px;min-height:32px;flex:0 0 32px;overflow:hidden;border-radius:5px;background:#3a3b44;color:#d6c9ff;font-size:14px;line-height:1}
.mention-popover .mention-thumbnail>*{display:block;width:32px!important;height:32px!important;max-width:32px;max-height:32px;object-fit:cover}
.mention-popover button{min-height:44px;overflow:hidden}
.mention-popover button>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Keep long conversation lists inside the viewport on desktop and mobile. */
.qx-chat-ui .app{height:100dvh;min-height:0;overflow:hidden}
.qx-chat-ui .sidebar{height:100dvh;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:#64788e #171b25}
.qx-chat-ui .sidebar>:not(.threads){flex-shrink:0}
.qx-chat-ui .threads{flex:1 0 180px;min-height:180px;min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#64788e #171b25;-webkit-overflow-scrolling:touch}
.qx-chat-ui .threads::-webkit-scrollbar{width:8px}
.qx-chat-ui .threads::-webkit-scrollbar-track{background:#171b25;border-radius:8px}
.qx-chat-ui .threads::-webkit-scrollbar-thumb{background:#64788e;border:2px solid #171b25;border-radius:8px}
.qx-chat-ui .threads::-webkit-scrollbar-thumb:hover{background:#8fa7bd}
.qx-chat-ui .threads:focus-visible{outline:1px solid #8fa7bd;outline-offset:2px}
