@font-face{font-family:DragonBubbleTitle;src:url('../public/assets/header-font/MaShanZheng-Title.woff2') format('woff2');font-style:normal;font-weight:400;font-display:swap}
:root{color-scheme:dark;font-family:"Microsoft YaHei",sans-serif;background:#181c21;color:#e8ebef;font-size:14px;--topbar-tail:0px}*{box-sizing:border-box}html{overflow-y:scroll}body{margin:0}
/* 顶部横幅：1 + 3×N1 + 2 + 3×N2 + 4 拼接，占位高度由 --header-height 预留（index.html 内联脚本先算一次）。
   祖先容器不要设 overflow:hidden，否则右端下垂的尾部会被裁掉。 */
.topbar{position:relative;height:var(--header-height,192px);min-height:84px;padding:0;background:none;border-bottom:0;display:block;overflow:visible;z-index:10}
#topbar-canvas{position:absolute;left:0;top:0;display:block;width:100%;pointer-events:none}
.topbar-bar{position:absolute;left:0;right:0;top:0;z-index:2;display:flex;align-items:center;gap:16px;padding:14px 24px 14px 230px}
.topbar-title{margin:0;color:#f2f5f8;text-shadow:0 2px 6px #000a;pointer-events:none;font-family:DragonBubbleTitle,"Microsoft YaHei",sans-serif;font-weight:400;font-size:36px}
.topbar-title strong{font-size:24px;letter-spacing:-1px}
.topbar-title span{margin-left:20px;color:#cdd8e2}
@media (max-width:900px){.topbar-bar{padding-left:24px}}
.export-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:14px 0 4px}
.export-bar #export{flex:1 1 auto}
.export-bar .export-hint{color:#8e9aa6;font-size:12px}
html[data-topbar-ready=true] .topbar-title{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-header-fallback=true] .topbar{background:#20262d;border-bottom:1px solid #39404a;height:auto;min-height:70px}
html[data-header-fallback=true] .topbar-bar{position:static}
html[data-header-fallback=true] #topbar-canvas{display:none}button,.file-button,select,input:not([type=checkbox]):not([type=range]){font:inherit}button,.file-button{border:1px solid #53606e;padding:10px 14px;background:#303a46;color:#f1f4f8;cursor:pointer;text-align:center}button:hover,.file-button:hover{background:#415268}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid #58c5ed;outline-offset:3px}#export{background:#087cab;border-color:#36b6e7;font-weight:bold}main{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:24px;padding:24px;max-width:1800px;margin:auto}.preview{min-width:0}.preview-heading,.preview-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 0;color:#acbac8;font-size:12px}.canvas-wrap{background:#0d1117;border:1px solid #4b5661;aspect-ratio:16/9;overflow:hidden;box-shadow:0 12px 35px #0004}canvas{width:100%;height:100%;display:block;touch-action:none}.preview-footer label{white-space:nowrap}#status{line-height:1.7;color:#bdc8d3}aside{background:#20262d;border:1px solid #39434d;padding:0 18px;padding-top:var(--topbar-tail,0px);align-self:start}details{padding:18px 0;border-bottom:1px solid #39434d}details:last-child{border-bottom:0}summary{font-weight:bold;cursor:pointer;margin-bottom:14px}label{display:block;margin:10px 0;color:#cad3dc}label input:not([type=checkbox]),select{display:block;width:100%;margin-top:7px}input:not([type=range]):not([type=checkbox]),select{border:1px solid #53606e;background:#151b22;color:#fff;padding:9px}input[type=range]{accent-color:#30b4e8}.file-button{display:block;margin:9px 0;background:#087cab;border-color:#2d94bd}.file-button input{display:none!important}.secondary{background:#303a46;border-color:#53606e}.plain{background:transparent;width:100%;font-size:12px;color:#adb9c5}.button-row{display:flex;gap:8px;margin-top:12px}.button-row>*{flex:1;min-width:0;margin:0;font-size:12px}.hint{color:#9eacbb;font-size:12px;line-height:1.7}.check{display:flex;gap:8px}input[type=checkbox]{accent-color:#1cafe4}#fields{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}#fields label:first-child,#fields label:last-child{grid-column:1/-1}@media(max-width:1000px){main{grid-template-columns:1fr}aside{display:grid;grid-template-columns:1fr 1fr;gap:24px}header span{display:none}}@media(max-width:600px){main{padding:12px;gap:12px}aside{display:block}.preview-footer{flex-wrap:wrap}header{padding:0 16px}}
.scene-gallery{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-height:420px;overflow:auto}.scene-card{padding:0;border:1px solid #53606e;background:#18212a;text-align:left}.scene-card img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover}.scene-card span{display:block;padding:7px;font-size:12px}.scene-card.active{border-color:#30b4e8;box-shadow:inset 0 0 0 1px #30b4e8}.scene-card[hidden]{display:none}button:disabled{opacity:.5;cursor:wait}

textarea{font:inherit;display:block;width:100%;resize:vertical;margin-top:7px;border:1px solid #53606e;background:#151b22;color:#fff;padding:9px}.dialogue-field{grid-column:1/-1}#notice-fields{display:grid;grid-template-columns:1fr 1fr}

/* Align desktop columns; the decorative header tail may overlap the export area. */
@media(min-width:1001px){main{padding-top:36px;align-items:start}}
/* Compact settings: use the workspace height on desktop, scroll only when needed. */
main>aside{display:block;min-width:0;padding:12px 14px;margin-top:var(--workspace-canvas-offset,0px);max-height:calc(var(--workspace-height,80vh) - var(--workspace-canvas-offset,0px));overflow:auto;scrollbar-width:thin;scrollbar-gutter:stable}
aside .export-bar{margin:0 0 10px;gap:6px}
aside .export-bar button{padding:9px 12px}
aside .export-hint{font-size:11px}
aside .motion-controls{padding-bottom:8px;border-bottom:1px solid #39434d}
aside .check{margin:4px 0;align-items:center;font-size:12px}
aside .hint{margin:4px 0;font-size:11px}
aside h2{font-size:13px;margin:10px 0 6px;font-weight:600}
aside #fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 10px;margin:9px 0}
aside #fields label{min-width:0;margin:0;font-size:12px}
aside #fields label:first-child,aside #fields label:last-child{grid-column:auto}
aside #fields .dialogue-field{grid-column:1/-1}
aside #fields input,aside #fields textarea{min-width:0;margin-top:4px;padding:6px 7px;font-size:12px;line-height:1.4}
aside #fields textarea{min-height:48px;max-height:100px;resize:vertical}
aside #reset{padding:7px}
@media(max-width:1000px){main>aside{margin-top:0;max-height:none;padding:14px 16px}aside #fields{grid-template-columns:repeat(3,minmax(0,1fr))}aside #fields .dialogue-field{grid-column:1/-1}}
@media(max-width:600px){aside #fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

.workspace-scroll-space{height:0;pointer-events:none}

html.notice-open{overflow:hidden;scrollbar-gutter:stable}
#site-notice{width:min(720px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0;border:1px solid #59666b;border-top:3px solid #78b6ac;background:#20262c;color:#e8ebef;box-shadow:0 24px 100px #0008;border-radius:6px}
#site-notice[open]{display:flex;flex-direction:column}
#site-notice::backdrop{background:#080d13bb;backdrop-filter:blur(5px)}
.notice-heading{padding:22px 28px 16px;border-bottom:1px solid #39434d;flex-shrink:0}
.notice-heading h2{font-size:21px;margin:0 0 6px;line-height:1.4}
.notice-heading p{font-size:12px;color:#9dabae;margin:0}
#notice-content{padding:20px 28px;overflow-y:auto;overscroll-behavior:contain;min-height:0;line-height:1.9;font-size:14px;scrollbar-width:thin}
#notice-content:focus-visible{outline:2px solid #78b6ac;outline-offset:-3px}
#notice-content section+section{margin-top:22px}
#notice-content h3{font-size:16px;margin:0 0 8px;color:#d9e9e5}
#notice-content p{margin:0 0 10px}
#notice-content .notice-date{font-size:12px;color:#9dabae}
#notice-content .notice-intro{color:#cedbd9;margin-bottom:22px}
#notice-content a{color:#91d0c4;text-underline-offset:3px}
.notice-links{display:flex;flex-wrap:wrap;gap:4px 18px;font-size:12px}
.notice-actions{padding:14px 28px 20px;border-top:1px solid #39434d;flex-shrink:0;background:#1c2228}
.notice-actions p{font-size:12px;color:#a7bab7;margin:0 0 10px}
.notice-actions label{display:flex;align-items:center;gap:7px;font-size:13px;margin:0 0 12px}
.notice-actions input:disabled{opacity:.45}
#notice-close{width:100%;text-align:center;background:#467d75;border-color:#81b4a9;font-weight:600}
#notice-close:disabled{background:#303a40;border-color:#465158;opacity:.6;cursor:not-allowed}
@media(max-width:600px){#site-notice{width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}.notice-heading{padding:16px 18px 12px}.notice-heading h2{font-size:18px}#notice-content{padding:16px 18px;font-size:13px}.notice-actions{padding:12px 18px 14px}}

.playback-toggles{display:flex;align-items:center;justify-content:space-between;gap:6px 10px;flex-wrap:wrap}.playback-toggles .check{white-space:nowrap}

/* Larger notice copy on desktop and mobile. */
#notice-content{font-size:16px;line-height:1.95}
#notice-content h3{font-size:18px}
#notice-content .notice-date,.notice-links{font-size:14px}
.notice-actions label{font-size:14px}
@media(max-width:600px){#notice-content{font-size:15px;line-height:1.9}#notice-content h3{font-size:17px}}

/* Quiet author credit below the workspace. */
.site-footer{max-width:1752px;margin:8px auto 0;padding:20px 24px 30px;border-top:1px solid #ffffff12;color:#a2adb8;font-size:12px;line-height:1.9;text-align:center}
.site-footer p{margin:3px 0}
.site-footer a{color:#b9ced5;text-decoration:underline;text-decoration-color:#b9ced54d;text-underline-offset:3px}
.site-footer a:hover{color:#e0f0f4;text-decoration-color:currentColor}
.site-footer a:focus-visible{outline:2px solid #58c5ed;outline-offset:4px}
.footer-domain{color:#8e9eaa;margin-left:6px;white-space:nowrap}
@media(max-width:600px){.site-footer{margin:8px 12px 0;padding:16px 8px 24px;font-size:12px}.footer-domain{display:inline-block}}

html.tip-open{overflow:hidden;scrollbar-gutter:stable}
.tip-dialog{width:calc(100% - 32px);max-width:620px;max-height:88dvh;overflow-y:auto;padding:22px 26px;border:0;border-radius:12px;background:#fff;color:#242832;text-align:center;color-scheme:light;box-shadow:0 24px 100px #0005}
.tip-dialog::backdrop{background:rgba(20,24,34,.55)}
.tip-dialog h2{margin:0 0 12px;font-size:18px}
.tip-dialog>p{font-size:14px;line-height:1.8;margin:0 0 20px}
.tip-qrs{display:flex;flex-wrap:wrap;justify-content:center;gap:28px}
.tip-qrs figure{margin:0}
.tip-qrs img{display:block;width:200px;height:200px;object-fit:contain;background:#fff}
.tip-qrs figcaption{margin-top:10px;font-size:14px}
.tip-close{position:sticky;bottom:-22px;padding:18px 0 2px;background:#fff}
.tip-close button{min-height:44px;min-width:100px;background:#303a46;border-radius:5px}
.site-footer .footer-tip{display:inline;padding:0;border:0;background:none;color:#b9ced5;font:inherit;text-decoration:underline;text-underline-offset:3px}
.site-footer .footer-tip:hover{color:#e0f0f4;background:none}
@media(max-width:640px){.tip-dialog{padding:20px 16px}.tip-qrs{gap:20px}.tip-qrs img{width:min(180px,42vw);height:auto;aspect-ratio:1}.tip-close{bottom:-20px}}

/* Settings share the canvas bounds and never own an internal scrollbar. */
main>aside{overflow:visible;scrollbar-gutter:auto;max-height:none}
@media(min-width:1001px){main>aside{height:var(--workspace-canvas-height,auto)}}
@media(max-width:1000px){main>aside{height:auto}.settings-content{zoom:1!important}}

/* Small, closely spaced footer credits. */
.site-footer{margin-top:6px;padding:12px 24px 20px;font-size:10px;line-height:1.45;color:#89939d}
.site-footer p{margin:0}
@media(max-width:600px){.site-footer{padding:10px 8px 16px;font-size:10px;line-height:1.45}}

.account-visibility{display:flex;align-items:center;justify-content:space-between;gap:6px 10px;flex-wrap:wrap}.account-visibility .check{white-space:nowrap}
