:root {
    color-scheme: light;
    --paper: #f7f6f1;
    --white: #fffefa;
    --ink: #1b211c;
    --muted: #5c655e;
    --line: #dddeda;
    --lime: #def477;
    --forest: #1c3027;
    font: 16px/1.55 "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #608214; outline-offset: 3px; }
.wrap { max-width: 1240px; width: calc(100% - 88px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-row { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--forest); display: grid; place-items: center; }
.brand-icon i { width: 16px; height: 16px; display: block; background: conic-gradient(var(--lime) 25%, #647847 0 50%, var(--lime) 0 75%, #647847 0); border-radius: 2px; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: .875rem; white-space: nowrap; line-height: 1.35; }
.button.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.button.quiet:hover { background: #eceee7; }
.button.dark { background: var(--ink); color: white; }
.button.dark:hover { background: #364638; }
.button.download { background: var(--lime); color: var(--ink); }
.button.download:hover { background: #d2eb5c; }
.button.danger { background: #faeeeb; color: #8e3024; }
.button.danger:hover { background: #f6dfd8; }
.library { margin: 32px 0 54px; scroll-margin-top: 20px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h1, .section-head h2, .panel h1 { font-size: clamp(25px, 3vw, 36px); line-height: 1.18; letter-spacing: -.05em; }
.section-head p, .panel p { margin-top: 7px; font-size: .9rem; color: var(--muted); }
.set-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.set-tabs a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 35px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: .82rem; }
.set-tabs a:hover { background: #edf0e7; }
.set-tabs a[aria-current="page"] { border-color: #879e56; background: #e8f1d1; font-weight: 750; }
.set-tabs a > span, .asset-set-name { overflow-wrap: anywhere; }
.set-tabs small { flex: none; color: var(--muted); }
.asset-set-name { display: inline-block; margin-top: 4px; padding: 2px 6px; border-radius: 5px; background: #edf2df; font-size: .73rem; color: #3d5131; }
.set-manager { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.set-editor { min-width: 0; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); }
.set-editor h2 { font-size: 1rem; margin-bottom: 12px; }
.set-edit-row { display: flex; gap: 6px; margin-bottom: 7px; }
.set-edit-row input { flex: 1; min-width: 0; }
.set-assignment { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.set-assignment label { font-size: .84rem; }
.set-assignment select { max-width: 100%; }
.set-asset-list { display: grid; gap: 5px; max-height: min(65vh, 640px); overflow-y: auto; padding: 2px; }
.set-asset { display: grid; grid-template-columns: auto 44px minmax(0, 1fr); gap: 9px; align-items: center; padding: 7px; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; }
.set-asset:has(input:checked) { background: #e8f1d1; border-color: #879e56; }
.set-asset input { margin: 0; min-height: auto; accent-color: #557227; }
.set-asset img { width: 44px; height: 34px; object-fit: contain; border-radius: 4px; }
.set-asset strong, .set-asset small { display: block; font-size: .82rem; overflow-wrap: anywhere; }
.set-asset small { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.search { display: flex; gap: 8px; }
input, select { border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); min-height: 40px; padding: 8px 12px; }
input[type="search"] { width: min(32vw, 315px); }
.empty { display: grid; justify-items: center; text-align: center; padding: 44px 20px; gap: 7px; background: var(--white); border: 1px dashed #cbd0c4; border-radius: 14px; }
main > .empty { margin: 40px 0; }
.empty p { color: var(--muted); font-size: .88rem; }
.empty-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #eef2dd; color: #506426; font-size: 22px; margin-bottom: 4px; }
.text-link { color: #38522b; text-decoration: underline; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.asset { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; min-width: 0; background: var(--white); }
.checker { background: conic-gradient(#d9ddd7 25%, #eff1eb 0 50%, #d9ddd7 0 75%, #eff1eb 0) 0 0 / 22px 22px; }
.asset-image { display: flex; align-items: center; justify-content: center; position: relative; aspect-ratio: 4 / 3; padding: 18px; }
.asset-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.asset-image span { position: absolute; top: 9px; left: 9px; padding: 3px 7px; color: var(--ink); background: var(--white); border-radius: 5px; font-size: .72rem; font-weight: 800; }
.asset-info { padding: 13px; }
.asset-info h3 { font-size: .94rem; overflow-wrap: anywhere; }
.asset-info p { font-size: .78rem; color: var(--muted); margin: 4px 0 11px; }
.asset-actions { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.asset-actions > a { flex: 1; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 22px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 25px; margin: 32px 0; }
.panel form { display: grid; gap: 10px; }
.panel label { font-size: .9rem; font-weight: 700; }
.panel input { width: 100%; min-width: 0; }
.panel button { justify-self: start; }
.login { max-width: 440px; margin: 60px auto; }
.login form { margin-top: 22px; }
.upload { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.notice { margin: 22px 0; background: #edf3db; border: 1px solid #d7e2bf; border-radius: 10px; padding: 13px 17px; overflow-wrap: anywhere; }
.footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 20px 0 28px; color: var(--muted); font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 940px) {
    .wrap { width: calc(100% - 56px); }
    .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
    .set-manager { grid-template-columns: 1fr; }
    .set-tabs { gap: 4px; }
    .set-tabs a { min-height: 31px; padding: 3px 5px; gap: 4px; font-size: .75rem; }
    .wrap { width: calc(100% - 32px); }
    .header-row { min-height: 62px; }
    .library { margin: 31px 0; }
    .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .toolbar { align-items: stretch; }
    .search { flex: 1 0 100%; }
    input[type="search"] { flex: 1; width: 0; }
    .upload { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
    .asset-grid { grid-template-columns: 1fr; }
}

.setup { max-width: 720px; }
.setup h2 { font-size: 1.28rem; margin-bottom: 16px; }
.checks { list-style: none; margin: 20px 0; padding: 0; }
.checks li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.checks li p { margin-top: 3px; }
.check-state { flex: 0 0 auto; padding: 3px 8px; border-radius: 5px; font-size: .8rem; font-weight: 700; }
.check-state.passed { color: #365324; background: #edf3db; }
.check-state.failed { color: #8e3024; background: #faeeeb; }

.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button:disabled { opacity: .45; cursor: default; }
dialog { max-height: calc(100dvh - 24px); color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
dialog::backdrop { background: #12201bc2; }
.rename-dialog h2 { font-size: 1.25rem; }
.library-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 320px); gap: 24px; align-items: start; margin: 32px 0 54px; }
.library-workspace .library { margin: 0; min-width: 0; }
.library-workspace .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.library-workspace .toolbar .search { flex: 1; min-width: 0; }
.library-workspace .toolbar input[type="search"] { flex: 1; width: 0; min-width: 0; }
.mobile-workspace-nav { display: none; }
.preview-panel { position: sticky; top: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100dvh - 24px); min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.preview-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 6px; margin-bottom: 7px; }
.preview-head h2 { grid-column: 1 / -1; font-size: 1.14rem; line-height: 1.2; }
.preview-remove { padding: 4px 8px; min-height: 29px; font-size: .76rem; }
.preview-remove:disabled { visibility: hidden; }
.preview-mode { color: var(--muted); font-size: .7rem; }
.preview-layout { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 9px; min-height: 0; }
.stage {
    --stage-height: clamp(160px, calc(100dvh - 295px), 620px);
    --stage-ratio: 9 / 16;
    --background: radial-gradient(ellipse at 40% 30%, #a57562, transparent 66%), linear-gradient(145deg, #28352e 10%, #61423c 60%, #241c21);
    background: var(--background);
    position: relative;
    container-type: inline-size;
    isolation: isolate;
    overflow: hidden;
    width: min(100%, calc(var(--stage-height) * var(--stage-ratio)));
    aspect-ratio: var(--stage-ratio);
    margin-inline: auto;
    border-radius: 12px;
    color: #fff;
}
.stage[data-bg="night"] { --background: radial-gradient(ellipse at 55% 20%, #48569e, transparent 65%), linear-gradient(145deg, #211948, #101526); }
.stage[data-bg="plain"] { --background: #e8ddcc; }
.stage[data-bg="checker"] { --background: conic-gradient(#d9ddd7 25%, #eff1eb 0 50%, #d9ddd7 0 75%, #eff1eb 0) 0 0 / 22px 22px; }
.stage[data-ratio="phone"] { --stage-ratio: 9 / 19.5; }
.stage-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.stage-background ~ .stage-overlays { z-index: 1; }
.stage-background ~ .live-interface { z-index: 2; }
.stage-background ~ .stage-empty { z-index: 3; }
.stage-background[data-fit="contain"] { object-fit: contain; }
.stage-overlays, .live-interface { position: absolute; inset: 0; }
.stage-overlays { isolation: isolate; }
.stage-layer { position: absolute; transform: translate(-50%, -50%); }
.stage-move { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none; user-select: none; }
.stage-move:active { cursor: grabbing; }
.stage-layer img { display: block; width: 100%; height: auto; pointer-events: none; }
.stage-selection { position: absolute; z-index: 4; transform: translate(-50%, -50%); outline: 1px dashed var(--lime); outline-offset: 2px; box-shadow: 0 0 0 1px #1a221d70; pointer-events: none; }
.stage-resize { position: absolute; display: grid; place-items: center; pointer-events: auto; width: 26px; height: 26px; bottom: 0; right: 0; transform: translate(50%, 50%); border: 0; background: transparent; padding: 0; touch-action: none; cursor: nwse-resize; }
.stage-resize::after { content: ''; display: block; margin: auto; width: 10px; height: 10px; border-radius: 3px; background: var(--lime); box-shadow: 0 0 0 1px var(--forest); }
.stage-resize[data-corner="nw"] { top: 0; left: 0; right: auto; bottom: auto; transform: translate(-50%, -50%); }
.stage-remove {
    --remove-size: 36px;
    --remove-margin: calc(var(--remove-size) / 2 + 4px);
    position: absolute;
    z-index: 5;
    left: clamp(var(--remove-margin), var(--selection-right), calc(100% - var(--remove-margin)));
    top: clamp(var(--remove-margin), calc(var(--selection-top) - var(--remove-size) / 2), calc(100% - var(--remove-margin)));
    width: var(--remove-size);
    height: var(--remove-size);
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    touch-action: manipulation;
}
.stage-remove span {
    display: grid;
    place-items: center;
    pointer-events: none;
    width: 24px;
    height: 24px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #9e2b24;
    color: #fff;
    font: 700 21px/1 system-ui, sans-serif;
    box-shadow: 0 2px 5px #0005;
}
.stage-remove:active span { background: #6d1b17; }
.stage-remove:focus-visible { outline-offset: -3px; }
@media (pointer: coarse) {
    .stage-remove { --remove-size: 44px; }
}
.stage-empty { position: absolute; z-index: 2; top: 48%; left: 50%; transform: translate(-50%, -50%); color: white; background: #0e1917c7; border: 1px dashed #ffffff8f; border-radius: 9px; padding: 7px 12px; font-size: .8rem; white-space: nowrap; pointer-events: none; visibility: hidden; }
@media (hover: hover) {
    .stage:hover .stage-empty { visibility: visible; }
}
.stage.drop-active { outline: 3px solid #749326; outline-offset: 2px; }
.stage.drop-active .stage-empty { background: #284319; visibility: visible; }
[data-preview-drag] { user-select: none; cursor: grab; }
.asset-image[data-preview-drag] { width: 100%; border: 0; color: inherit; touch-action: pan-y; }
.preview-add { touch-action: none; }
.preview-drag-ghost { position: fixed; z-index: 10; transform: translate(-50%, -50%); width: 92px; height: 72px; object-fit: contain; pointer-events: none; opacity: .84; background: #e4eacb80; border: 1px solid #608214; border-radius: 7px; }
[hidden] { display: none !important; }
.live-interface {
    --live-surface: #15131870;
    pointer-events: none;
    padding: 5.3cqw 3cqw 0;
    font-size: 3.4cqw;
    line-height: 1.28;
    text-shadow: 0 .1cqw .45cqw #120d17a6;
    background: linear-gradient(#08080b24, transparent 19%, transparent 61%, #08080b65 100%);
}
.live-status-bar { display: flex; justify-content: space-between; margin: 0 5.4cqw 3cqw 7cqw; font-size: 4.5cqw; font-weight: 700; line-height: 1; }
.live-status-bar > span { display: flex; align-items: center; gap: 1.6cqw; }
.live-person { position: relative; width: 2.8cqw; height: 1.3cqw; border-radius: 99px 99px 0 0; background: white; margin-top: 1.5cqw; }
.live-person::before { content: ''; position: absolute; left: 25%; bottom: 120%; background: white; width: 1.4cqw; height: 1.4cqw; border-radius: 50%; }
.live-signal { width: .8cqw; height: .9cqw; margin-right: 2.8cqw; background: #fff; border-radius: .5cqw; box-shadow: 1.2cqw -.4cqw #fff, 2.4cqw -.9cqw #fff, 3.6cqw -1.35cqw #ffffffb0; }
.live-battery { position: relative; padding: .18cqw .9cqw; border-radius: 1.2cqw; background: #fffffff2; color: #645649; font-size: 3cqw; }
.live-battery::after { content: ''; position: absolute; width: .55cqw; height: 1.2cqw; top: 32%; left: 100%; border-radius: 0 99px 99px 0; background: #ffffff9e; }
.live-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 1.4cqw; }
.live-host, .live-viewers, .live-close { display: flex; align-items: center; gap: 1.2cqw; background: var(--live-surface); border-radius: 99px; min-width: 0; }
.live-host { justify-self: start; width: min(100%, 40cqw); padding: .5cqw 1cqw .5cqw .5cqw; }
.live-host-text { flex: 1; min-width: 0; }
.live-host-text strong, .live-host small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-host small { color: #f0edf3; font-size: 2.55cqw; }
.live-avatar, .live-viewer-avatars i { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 750; flex: none; }
.live-avatar { width: 8cqw; height: 8cqw; background: linear-gradient(140deg, #ff816b, #803e84); }
.live-follow { flex: none; padding: 1.7cqw 2cqw; border-radius: 99px; background: #ff2169; font-size: 3.15cqw; font-weight: 750; white-space: nowrap; }
.live-viewers { justify-content: center; min-width: 8.5cqw; height: 7cqw; padding: 0 1.5cqw; }
.live-viewers strong { font-size: 3cqw; font-weight: 500; white-space: nowrap; }
.live-viewer-avatars { display: flex; flex-direction: row-reverse; padding-left: 1.8cqw; }
.live-viewer-avatars i { width: 6.5cqw; height: 6.5cqw; margin-left: -1.8cqw; border: 1px solid #ffffff35; background: radial-gradient(circle at 43% 69%, #357862 34%, #63a798 36%, #63a798 52%, #9cc1c7 54%); }
.live-viewer-avatars i:nth-child(2) { background: radial-gradient(circle at 58% 72%, #c28b31 50%, #dcaa57 52%, #bb8187 54%); }
.live-viewer-avatars i:nth-child(3) { background: radial-gradient(circle at 42% 62%, #7da76b 40%, #a6c29a 42%, #57819a 44%); }
.live-close { justify-content: center; width: 6.5cqw; height: 6.5cqw; font-size: 5.1cqw; font-weight: 650; line-height: 1; }
.live-badges { display: flex; justify-content: space-between; gap: 1.2cqw; margin-top: 2cqw; font-size: 2.85cqw; }
.live-badges span { background: var(--live-surface); border-radius: 99px; padding: 1.1cqw 2.45cqw; }
.live-badges span + span { margin-right: -3cqw; border-radius: 99px 0 0 99px; font-weight: 700; }
.live-badges i { margin-left: 1cqw; font-size: 3.7cqw; font-style: normal; line-height: .7; }
.live-challenge { display: flex; align-items: center; gap: 1.1cqw; width: fit-content; margin: 1.9cqw 0 0 auto; padding: .55cqw 1cqw .55cqw 1.4cqw; border-radius: 1.2cqw; background: #d58a3fbd; font-size: 2.55cqw; }
.live-challenge strong, .live-challenge small { display: block; }
.live-challenge small { opacity: .84; font-size: 2.15cqw; }
.live-challenge b { display: grid; place-items: center; width: 7cqw; height: 7cqw; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #fff9ae, #ffc435 58%, #e88e22); color: #a96810; box-shadow: inset 0 0 0 .56cqw #fff29c9c; font-size: 4.5cqw; }
.live-bottom { position: absolute; left: 3cqw; right: 3cqw; bottom: 7.5cqw; }
.live-interaction { display: flex; gap: 2cqw; align-items: flex-end; margin-bottom: 1.35cqw; }
.live-chat { flex: 1; min-width: 0; }
.live-announcement { width: fit-content; max-width: 100%; padding: 1cqw 1.65cqw; margin-bottom: .65cqw; border-radius: 3cqw; background: #10121c69; }
.live-announcement span { display: block; color: #c1c7d2; font-size: 2.6cqw; }
.live-announcement p { color: #f7f1eb; font-size: 3.15cqw; overflow-wrap: anywhere; }
.live-comments { display: grid; justify-items: start; gap: .55cqw; }
.live-comments p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; background: #11131c80; padding: .6cqw 1.5cqw; border-radius: 3cqw; font-size: 3.3cqw; }
.live-comments b { color: #94e6f9; font-weight: 600; margin-right: .55cqw; }
.live-level { display: inline-flex; align-items: center; gap: .35cqw; border-radius: 99px; padding: .03cqw .75cqw; margin-right: .7cqw; background: linear-gradient(95deg,#637dcf,#6265ce); color: white; font-size: 2.35cqw; vertical-align: .18cqw; font-weight: 800; }
.live-level::before { content: '◆'; color: #c9ddff; font-size: 1.9cqw; }
.live-comments:empty { display: none; }
.live-guest { flex: 0 0 26cqw; min-width: 0; }
.live-join { border-radius: 99px; padding: 1.65cqw .5cqw; margin-bottom: 1.8cqw; text-align: center; white-space: nowrap; background: #1417239c; font-size: 2.85cqw; }
.live-join b { font-size: 3.65cqw; line-height: .8; }
.live-guest-card { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: radial-gradient(ellipse at 55% 92%, #9c766e, #5c617f 56%); }
.live-guest-gifts, .live-guest-name { position: absolute; left: 1cqw; background: #18182455; }
.live-guest-gifts { top: .75cqw; padding: .3cqw 1.1cqw; border-radius: 99px; font-size: 2.3cqw; }
.live-guest-name { bottom: 0; left: 0; right: 0; padding: .65cqw; text-align: center; font-size: 2.35cqw; }
.live-guest-avatar { width: 12.5cqw; height: 12.5cqw; border-radius: 50%; background: radial-gradient(circle at 57% 48%, #fff4d8 4%, transparent 5%), radial-gradient(ellipse at 55% 68%, #d19777 0 36%, transparent 39%), #767d9d; }
.live-gift { display: flex; align-items: center; width: fit-content; max-width: 92%; gap: 1.6cqw; margin-bottom: 2cqw; padding: 1cqw 2cqw 1cqw 1cqw; border-radius: 99px; background: linear-gradient(90deg, #662356ed, #37215add); }
.live-gift div { min-width: 0; }
.live-gift strong, .live-gift small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-gift small { color: #ffe4f2; font-size: 2.7cqw; }
.live-gift b { flex: none; font-size: 4.5cqw; color: #ffe3aa; font-style: italic; white-space: nowrap; }
.live-gift-icon { display: grid; place-items: center; width: 8cqw; height: 8cqw; border-radius: 50%; background: #ffffff29; font-size: 4.5cqw; flex: none; }
.live-gift.is-replaying { animation: gift-enter 420ms ease both; }
@keyframes gift-enter {
    from { transform: translateX(-35%) scale(.9); opacity: 0; }
    65% { transform: translateX(2%) scale(1.04); opacity: 1; }
    to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .live-gift.is-replaying { animation: none; } }
.live-actions { display: flex; align-items: center; gap: 1.45cqw; }
.live-compose, .live-action-icon { display: flex; align-items: center; min-width: 0; height: 9.5cqw; border-radius: 99px; background: #10121b82; }
.live-compose { flex: 1; justify-content: space-between; padding: 0 2.5cqw; color: #efedf2; white-space: nowrap; font-size: 3.25cqw; }
.live-compose i { color: #f0eef3c9; font-size: 5.8cqw; font-style: normal; }
.live-action-icon { flex: none; justify-content: center; width: 9.5cqw; font-size: 5.2cqw; }
.live-link i { width: 3.9cqw; height: 3.9cqw; border: .45cqw solid #ff3c9f; border-radius: 50%; }
.live-link i + i { margin-left: -1.35cqw; border-color: #59bfff; }
.live-heart { color: #ff4a98; text-shadow: .35cqw .35cqw #b14bff, -.25cqw -.25cqw #ff87b9; font-size: 5.5cqw; }
.live-gift-box { position: relative; width: 4.6cqw; height: 4.15cqw; border-radius: .6cqw; background: linear-gradient(90deg,#ff2b78 38%,#ffe5ec 39% 60%,#ff4390 61%); }
.live-gift-box::before { content: ''; position: absolute; left: -.4cqw; right: -.4cqw; top: -.2cqw; height: 1.15cqw; background: linear-gradient(90deg,#ff61a4 39%,#fff1f5 40% 60%,#ff61a4 61%); border-radius: .35cqw; }
.live-share { color: #e5e6ef; font-weight: 800; }
.live-cart { background: #966209e6; font-size: 4.3cqw; }
.preview-controls { display: grid; align-content: start; gap: 7px; min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; padding: 2px; }
.preview-quick { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.preview-quick .button { min-height: 34px; padding: 4px 9px; }
.preview-quick .toggle { font-size: .83rem; white-space: nowrap; }
.toggle { display: inline-flex; gap: 4px; align-items: center; }
.toggle input { min-height: auto; accent-color: #557227; }
.preview-section { border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.preview-controls > details:not([open]) { padding-block: 6px; }
.preview-section h3 { font-size: .98rem; }
.preview-section summary { cursor: pointer; font-size: .84rem; font-weight: 700; }
.preview-section[open] summary { margin-bottom: 8px; }
.preview-note { color: var(--muted); font-size: .82rem; }
.preview-note:empty { display: none; }
.preview-section input[type="search"] { width: 100%; }
.layer-list, .catalog-list { list-style: none; margin: 6px 0; padding: 0; max-height: 160px; overflow-y: auto; }
.layer-list:empty, .catalog-list:empty { display: none; }
.layer-list button { width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; }
.layer-list button[aria-pressed="true"] { background: #e9f0d7; }
.layer-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px; align-items: start; }
.layer-list .layer-row-remove { min-width: 30px; padding: 4px; text-align: center; color: #8e3024; }
.layer-list .layer-row-remove:hover { background: #faeeeb; }
.catalog-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.preview-section .button { min-height: 34px; padding: 5px 8px; }
.preview-background-info { display: contents; }
#preview-background-status { overflow-wrap: anywhere; }
.background-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: .76rem; }
.background-controls select, .background-controls .button { min-height: 30px; padding: 3px 5px; font-size: inherit; }
.preview-layer-tools { display: grid; gap: 4px; }
.live-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 7px; margin-top: 9px; }
.live-settings-grid label { font-size: .78rem; }
.live-settings-grid input:not([type="checkbox"]), .live-settings-grid textarea, .live-settings-grid select { display: block; width: 100%; min-width: 0; min-height: 34px; margin-top: 3px; padding: 5px 7px; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.live-settings-grid textarea { resize: vertical; }
.settings-wide { grid-column: 1 / -1; }
.live-settings-grid button { white-space: normal; }
#layer-tools { min-width: 0; border: 0; padding: 0; margin: 6px 0 0; }
#layer-tools legend { font-size: .84rem; color: var(--muted); }
.size-control { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.size-control input { flex: 1; min-width: 0; accent-color: #557227; padding: 0; min-height: 30px; }
.rename-dialog { width: min(440px, calc(100% - 24px)); }
.rename-dialog form { display: grid; gap: 10px; margin-top: 12px; }
.rename-name { display: flex; gap: 6px; align-items: center; }
.rename-name input { flex: 1; min-width: 0; }
.sort-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.sort-row { display: grid; grid-template-columns: auto 36px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 7px; background: var(--white); }
.sort-row.is-dragging { background: #e9f0d7; }
.sort-row img { width: 36px; height: 36px; object-fit: contain; border-radius: 5px; }
.sort-row button { min-width: 36px; padding-inline: 8px; }
.sort-grip { cursor: grab; font-size: 1.3rem; text-align: center; min-width: 30px; padding: 3px; touch-action: none; user-select: none; }
.sort-name { overflow-wrap: anywhere; }
.sort-save { position: sticky; bottom: 0; padding: 10px 0; background: var(--paper); }
@media (max-width: 1060px) {
    .library-workspace .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
    html:has(.library-workspace[data-mobile-view]) { scroll-padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .library-workspace { display: block; margin: 16px 0 26px; }
    .library-workspace[data-mobile-view] { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .library-workspace[data-mobile-view="library"] > .preview-panel,
    .library-workspace[data-mobile-view="preview"] > .library { display: none; }
    .library-workspace[data-mobile-view] .mobile-workspace-nav {
        position: fixed;
        z-index: 8;
        inset-inline: 12px;
        bottom: max(10px, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 5px;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: var(--white);
        box-shadow: 0 4px 22px #1b211c24;
    }
    .mobile-workspace-nav button {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 1px solid transparent;
        border-radius: 10px;
        background: transparent;
        color: var(--ink);
        font-weight: 750;
        touch-action: manipulation;
    }
    .mobile-workspace-nav button[aria-pressed="true"] { background: var(--forest); color: var(--white); }
    .mobile-workspace-nav button.drop-active { border-color: #749326; background: #e9f0d7; color: var(--ink); }
    .mobile-preview-count { min-width: 1.45rem; padding-inline: 4px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: .75rem; }
    .library-workspace .set-tabs { flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
    .library-workspace .set-tabs a { flex: none; min-height: 44px; padding-inline: 9px; font-size: .85rem; white-space: nowrap; }
    .library-workspace .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .library-workspace .toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 8px; gap: 8px; }
    .library-workspace .toolbar .search { gap: 5px; }
    .library-workspace .toolbar :is(input, select, button) { min-height: 44px; padding-inline: 8px; }
    .library-workspace .toolbar select { max-width: 100%; }
    .library-workspace .asset-image { padding: 10px; }
    .library-workspace .asset-info { padding: 8px; }
    .library-workspace .asset-actions { gap: 5px; }
    .library-workspace .asset-actions .button { min-height: 44px; padding-inline: 6px; gap: 3px; font-size: .79rem; flex: 1 0 auto; }
    .library-workspace .asset-actions .preview-add { background: var(--forest); color: var(--white); }
    .library-workspace .asset-actions .download { background: var(--white); border-color: var(--line); }
    .library-workspace .pagination .button { min-height: 44px; }
    .preview-panel { position: static; max-height: none; margin-top: 12px; padding: 9px; }
    .library-workspace[data-mobile-view] .preview-panel { margin-top: 0; }
    .preview-head h2 { grid-column: auto; font-size: 1rem; }
    .preview-mode { text-align: right; }
    .preview-head .preview-remove { display: none; }
    .preview-layout { grid-template-rows: auto auto; gap: 10px; }
    .preview-controls { overflow: visible; overscroll-behavior: auto; gap: 9px; }
    .stage { --stage-height: clamp(220px, calc(100svh - 172px), 700px); border-radius: 9px; }
    .stage-resize { width: 36px; height: 36px; }
    .live-settings-grid { grid-template-columns: 1fr; }
    .preview-quick { flex-wrap: wrap; }
    .preview-quick .toggle { min-height: 44px; padding-inline: 8px; }
    .preview-quick .toggle input { width: 18px; height: 18px; }
    .preview-controls :is(.button, input[type="search"], select), .layer-list button, .size-control input { min-height: 44px; }
    .preview-controls :is(input[type="search"], .live-settings-grid input:not([type="checkbox"]), textarea, select) { font-size: 1rem; }
    .preview-section summary { min-height: 38px; padding-block: 7px; font-size: .9rem; }
    .layer-list .layer-row-remove { min-width: 44px; }
}
