:root {
    --bg: #141826;
    --panel: #f4f3ff;
    --ink: #1e2147;
    --muted: #646a97;
    --line: rgba(24, 27, 58, 0.14);
    --accent: #5d77e6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(110, 129, 228, 0.24), transparent 30%),
        linear-gradient(135deg, #111522, #1c2032);
}

body { padding: clamp(12px, 2vw, 20px); }

.admin-hub {
    width: min(100%, 1840px);
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.admin-hub-header {
    background: color-mix(in srgb, #f4f3ff 94%, #ffffff 6%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-hub-title h1 {
    margin: 0 0 6px;
}

.admin-hub-title .sub {
    margin: 0;
}

.admin-tabbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e9e7f8;
    border: 1px solid rgba(31, 37, 78, 0.14);
    border-radius: 12px;
    padding: 6px;
    flex-wrap: wrap;
    max-width: 100%;
}

.tab-btn {
    min-height: 36px;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: #495080;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 800;
}

.tab-btn:hover {
    color: #1f2550;
}

.tab-btn.is-active {
    background: linear-gradient(135deg, #5d77e6, #3f59c8);
    color: #fff;
    box-shadow: 0 8px 20px rgba(51, 84, 197, 0.28);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.admin-shell {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.skin-admin-shell,
.params-admin-shell,
.analytics-admin-shell {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sfx-admin-shell {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sfx-admin-shell-single {
    grid-template-columns: minmax(0, 1fr);
}

.controls, .preview {
    background: var(--panel);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

h1, h2 { margin: 0 0 8px; }
.sub { margin: 0 0 16px; color: var(--muted); }

.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field span { font-size: 13px; color: #555b86; font-weight: 700; }

.field input,
.field select,
.field textarea {
    width: 100%;
}

.level-panel-card {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(74, 88, 170, 0.14);
    background: linear-gradient(180deg, rgba(248, 249, 255, 0.96), rgba(241, 243, 255, 0.92));
    display: grid;
    gap: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.level-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.level-panel-head h3 {
    margin: 0;
    font-size: 15px;
    color: #27356a;
}

.level-panel-head span {
    font-size: 12px;
    font-weight: 700;
    color: #737ca9;
    white-space: nowrap;
}

.level-panel-card > .field,
.level-panel-card > .level-inline-grid,
.level-panel-card > .level-score-stack {
    margin-bottom: 0;
}

.level-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.level-inline-grid .field,
.level-score-stack .field {
    margin-bottom: 0;
}

.level-score-stack {
    display: grid;
    gap: 10px;
}

.level-reward-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.level-reward-card {
    min-height: 78px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(68, 81, 150, 0.12);
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    align-content: center;
    gap: 4px;
    box-shadow: 0 8px 16px rgba(60, 74, 150, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.level-reward-card span {
    font-size: 12px;
    font-weight: 800;
    color: #5c6597;
}

.level-reward-card strong {
    font-size: 20px;
    line-height: 1.05;
    color: #223063;
    letter-spacing: 0.01em;
}

.catalog-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.catalog-item {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(70, 84, 161, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

.catalog-item > span {
    font-size: 12px;
    color: #59608c;
    font-weight: 700;
}

.catalog-control {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 6px;
}

.catalog-control input {
    min-width: 0;
    padding: 0;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    color: #223063;
    appearance: textfield;
    -moz-appearance: textfield;
}

.catalog-control input::-webkit-outer-spin-button,
.catalog-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.catalog-control button {
    padding: 0;
    font-size: 20px;
    line-height: 1;
    min-height: 42px;
}

#btnSaveLevelCatalog {
    justify-self: end;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: #eef2ff;
    color: #3648a1;
}

input, select, button, .links a {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    padding: 0 12px;
}

textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    padding: 10px 12px;
    font-family: "Consolas", "SFMono-Regular", "Microsoft YaHei", monospace;
    line-height: 1.45;
    resize: vertical;
}

.meta {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #ece9fb;
    color: #444a79;
    display: grid;
    gap: 4px;
}

.actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

button { cursor: pointer; }
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.primary {
    background: linear-gradient(135deg, var(--accent), #3b4ea8);
    color: #fff;
    border: 0;
}

.gen-progress {
    margin-top: 10px;
}

.gen-progress-text {
    font-size: 12px;
    font-weight: 800;
    color: #59608c;
    margin-bottom: 6px;
}

.gen-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #d9ddef;
}

.gen-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5d77e6, #31b4ff);
    transition: width 0.18s ease;
}

.links { margin-top: 10px; }
.links a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.status { margin: 14px 0 8px; color: #4f5482; font-weight: 700; }
#stats { margin: 0; padding-left: 18px; color: #3f4470; }

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.preview-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hidden {
    display: none !important;
}

.hit-area-preview {
    margin-top: 4px;
    border: 1px solid rgba(35, 44, 88, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(239, 245, 255, 0.95), rgba(231, 241, 255, 0.92));
    display: grid;
    gap: 8px;
}

.hit-area-preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: #2f3c74;
    font-size: 12px;
}

.hit-area-preview-head strong {
    font-size: 13px;
}

.hit-area-preview-stage {
    height: 112px;
    border-radius: 10px;
    border: 1px dashed rgba(67, 88, 175, 0.38);
    background:
        radial-gradient(circle at 50% 50%, rgba(110, 144, 255, 0.16), rgba(110, 144, 255, 0) 60%),
        repeating-linear-gradient(
            0deg,
            rgba(50, 71, 160, 0.08) 0px,
            rgba(50, 71, 160, 0.08) 1px,
            transparent 1px,
            transparent 18px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(50, 71, 160, 0.08) 0px,
            rgba(50, 71, 160, 0.08) 1px,
            transparent 1px,
            transparent 18px
        );
    display: grid;
    place-items: center;
    overflow: hidden;
}

.hit-area-preview-hit {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    border: 2px solid rgba(83, 123, 255, 0.86);
    background: rgba(84, 126, 255, 0.2);
    display: grid;
    place-items: center;
    transition: width 120ms ease, height 120ms ease;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42) inset;
}

.hit-area-preview-body {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 2px solid rgba(31, 41, 94, 0.75);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 8px rgba(23, 34, 86, 0.2);
}

.hit-area-preview-meta {
    color: #4f5d98;
    font-size: 12px;
    font-weight: 700;
}

.combo-score-multiplier-panel {
    margin-top: 4px;
    border: 1px solid rgba(35, 44, 88, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(239, 245, 255, 0.95), rgba(231, 241, 255, 0.92));
    display: grid;
    gap: 8px;
}

.combo-score-multiplier-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.combo-score-multiplier-head strong {
    font-size: 13px;
    color: #2f3c74;
}

.combo-score-multiplier-head span {
    font-size: 12px;
    color: #4f5d98;
    font-weight: 700;
}

.combo-score-multiplier-table-wrap {
    max-height: 240px;
}

.combo-score-multiplier-table {
    min-width: 0;
}

.combo-score-multiplier-actions {
    margin-top: 0;
}

.icon-btn {
    background: transparent;
    border: none;
    padding: 4px;
    min-height: auto;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.icon-btn:hover {
    color: var(--accent);
}

.icon-btn svg { width: 22px; height: 22px; }

.level-preview-stage {
    margin-top: 6px;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.level-preview-shell {
    position: relative;
    width: min(100%, 430px);
    aspect-ratio: 430 / 932;
    border-radius: 24px;
    overflow: hidden;
    background:
    url('../assets/ui/home/ui_app_bg.png') center top / cover no-repeat;
    border: 1px solid rgba(255, 246, 222, 0.22);
    box-shadow:
        inset 0 0 0 1px rgba(255, 244, 226, 0.08),
        0 12px 30px rgba(48, 55, 102, 0.2);
}

.level-preview-bottom-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 108px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(98, 63, 40, 0.12) 0%, rgba(80, 51, 33, 0.86) 42%, rgba(68, 44, 29, 0.96) 100%);
    border-top: 1px solid rgba(255, 219, 167, 0.2);
}

.level-preview-board {
    position: absolute;
    z-index: 2;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #765234 0%, #5e3f28 100%);
    border: 2px solid rgba(255, 221, 172, 0.35);
    box-shadow: inset 0 0 0 1px rgba(84, 53, 32, 0.3), 0 10px 22px rgba(36, 23, 15, 0.28);
}

.level-preview-grid-host {
    position: absolute;
    overflow: hidden;
    border-radius: 18px;
}

.preview canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
}

.game-frame-preview-meta {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ece9fb;
    color: #42508d;
    font-size: 12px;
    font-weight: 800;
}

.skin-fit-panel,
.params-json-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.sfx-controls-panel,
.sfx-library-panel,
.skin-sfx-controls-panel,
.skin-sfx-list-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.sfx-param-grid {
    display: grid;
    gap: 8px;
}

.sfx-param-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 84px;
    align-items: center;
    gap: 8px;
}

.sfx-param-row label {
    font-size: 12px;
    font-weight: 800;
    color: #556094;
}

.sfx-param-row input[type='range'] {
    min-height: 34px;
    border: 0;
    background: transparent;
    padding: 0;
    accent-color: #4f74ea;
}

.sfx-param-row input[type='number'] {
    min-height: 36px;
    padding: 0 8px;
    border-radius: 10px;
}

.sfx-actions {
    margin-top: 4px;
}

.sfx-custom-editor {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed rgba(50, 65, 143, 0.24);
    display: grid;
    gap: 8px;
}

.sfx-custom-editor h3 {
    margin: 0;
    font-size: 15px;
    color: #2f386f;
}

.sfx-source-workbench {
    margin-top: 6px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(57, 77, 182, 0.24);
    background: #eef1ff;
    display: grid;
    gap: 8px;
}

.sfx-source-workbench h3 {
    margin: 0;
    font-size: 15px;
    color: #2f386f;
}

.sfx-source-panel {
    display: none;
    gap: 8px;
}

.sfx-source-panel.is-active {
    display: grid;
}

.sfx-source-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    gap: 8px;
}

.sfx-source-result-list {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    padding-right: 2px;
}

.sfx-source-result-item {
    border: 1px solid rgba(60, 78, 184, 0.2);
    border-radius: 10px;
    background: #f8f9ff;
    padding: 8px;
    display: grid;
    gap: 6px;
}

.sfx-source-result-item h5 {
    margin: 0;
    font-size: 13px;
    color: #2e376f;
}

.sfx-source-result-meta {
    font-size: 12px;
    color: #586393;
}

.sfx-source-result-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sfx-source-result-actions button {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
}

.sfx-audio-preview-panel {
    margin: 8px 0;
    border: 1px solid rgba(65, 83, 187, 0.22);
    border-radius: 12px;
    background: #f7f9ff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.sfx-audio-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.sfx-audio-preview-head strong {
    font-size: 13px;
    line-height: 1.35;
    color: #25306b;
}

.sfx-audio-preview-state {
    font-size: 12px;
    font-weight: 800;
    color: #456016;
    white-space: nowrap;
}

.sfx-audio-preview-panel audio {
    display: none;
}

.sfx-audio-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #5d6895;
    font-weight: 700;
}

.sfx-audio-seek {
    width: 100%;
    min-height: auto;
    margin: 0;
}

.sfx-audio-load {
    display: grid;
    gap: 4px;
}

.sfx-audio-load-track {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(91, 107, 196, 0.14);
}

.sfx-audio-load-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6f82ff 0%, #4c6ff6 100%);
    transition: width 0.12s ease;
}

.sfx-audio-load-text {
    font-size: 12px;
    color: #5d6895;
}

.audio-library-list {
    display: grid;
    gap: 8px;
    max-height: 640px;
    overflow: auto;
    padding-right: 2px;
}

.audio-library-table-wrap {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(48, 57, 114, 0.12);
    background: rgba(255, 255, 255, 0.96);
}

.audio-library-table {
    min-width: 860px;
}

.audio-library-table tr {
    cursor: pointer;
}

.audio-library-table tr.is-active td {
    background: rgba(88, 112, 226, 0.12);
}

.audio-library-sort-btn.is-active {
    color: #3d55c7;
}

.audio-library-name-cell {
    min-width: 190px;
    max-width: 280px;
    font-weight: 800;
    color: #283066;
    word-break: break-word;
}

.audio-library-source-cell {
    min-width: 150px;
    max-width: 260px;
    word-break: break-word;
}

.audio-library-card {
    width: 100%;
    min-height: auto;
    border-radius: 12px;
    border: 1px solid rgba(49, 61, 134, 0.2);
    background: #f7f8ff;
    padding: 10px;
    display: grid;
    gap: 6px;
    text-align: left;
}

.audio-library-card:hover {
    border-color: rgba(65, 85, 196, 0.42);
}

.audio-library-card.is-active {
    border-color: rgba(65, 85, 196, 0.72);
    box-shadow: 0 10px 20px rgba(61, 86, 199, 0.18);
}

.audio-library-card strong {
    font-size: 13px;
    color: #283066;
}

.audio-library-card-meta,
.sfx-audio-library-meta {
    font-size: 12px;
    line-height: 1.45;
    color: #535d8f;
}

.audio-library-card-keywords {
    font-size: 11px;
    color: #30408f;
    font-weight: 700;
}

.sfx-external-preview {
    border-top: 1px dashed rgba(58, 80, 191, 0.24);
    padding-top: 8px;
    display: grid;
    gap: 8px;
}

.sfx-external-preview audio {
    width: 100%;
}

.sfx-preset-library-list {
    display: grid;
    gap: 8px;
    max-height: 560px;
    overflow: auto;
    padding-right: 2px;
}

.sfx-preset-card {
    min-height: auto;
    border-radius: 12px;
    border: 1px solid rgba(49, 61, 134, 0.2);
    background: #f7f8ff;
    padding: 10px;
    display: grid;
    gap: 6px;
    text-align: left;
}

.sfx-preset-card:hover {
    border-color: rgba(65, 85, 196, 0.42);
}

.sfx-preset-card.is-active {
    border-color: rgba(65, 85, 196, 0.72);
    box-shadow: 0 10px 20px rgba(61, 86, 199, 0.18);
}

.sfx-preset-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sfx-preset-title strong {
    font-size: 13px;
    color: #283066;
}

.sfx-preset-id {
    font-size: 11px;
    color: #5a6293;
    font-weight: 700;
}

.sfx-preset-desc {
    font-size: 12px;
    color: #535d8f;
    line-height: 1.35;
}

.sfx-preset-tag {
    justify-self: start;
    font-size: 11px;
    font-weight: 800;
    color: #30408f;
    background: #e6ebff;
    border-radius: 999px;
    padding: 3px 8px;
}

.skin-sfx-binding-list {
    display: grid;
    gap: 8px;
    max-height: 640px;
    overflow: auto;
    padding-right: 2px;
}

.skin-sfx-binding-row {
    border: 1px solid rgba(52, 69, 151, 0.2);
    border-radius: 12px;
    background: #f6f7ff;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 10px;
    align-items: center;
}

.skin-sfx-binding-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.skin-sfx-binding-meta strong {
    font-size: 13px;
    color: #2c3569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-sfx-binding-meta span {
    font-size: 12px;
    color: #596394;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-sfx-binding-row select {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
}

.skin-sfx-binding-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.skin-sfx-preview-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(52, 69, 151, 0.36);
    background: #eef1ff;
    color: #27316b;
    font-weight: 700;
    cursor: pointer;
}

.skin-sfx-preview-btn:hover {
    background: #e4e9ff;
}

.game-sfx-binding-list {
    display: grid;
    gap: 10px;
}

.game-sfx-event-card {
    border: 1px solid rgba(52, 69, 151, 0.2);
    border-radius: 12px;
    background: #f6f7ff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.game-sfx-event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.game-sfx-event-head strong {
    font-size: 13px;
    color: #2c3569;
}

.game-sfx-event-head .sub {
    margin: 0;
}

.game-sfx-option-list {
    display: grid;
    gap: 8px;
}

.game-sfx-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
}

.game-sfx-option-row select {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
}

.game-sfx-loop-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(52, 69, 151, 0.2);
    border-radius: 10px;
    background: #ffffff;
    font-size: 12px;
    color: #344080;
    font-weight: 700;
    white-space: nowrap;
}

.game-sfx-loop-label input[type='checkbox'] {
    margin: 0;
}

.game-sfx-mini-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(52, 69, 151, 0.36);
    background: #eef1ff;
    color: #27316b;
    font-weight: 700;
    cursor: pointer;
}

.game-sfx-mini-btn:hover {
    background: #e4e9ff;
}

.game-sfx-mini-btn.is-danger {
    border-color: rgba(194, 31, 78, 0.35);
    color: #8f2244;
    background: #fff0f4;
}

.game-sfx-mini-btn.is-danger:hover {
    background: #ffe8ef;
}

.music-sfx-shell {
    display: grid;
    gap: 12px;
}

.music-sfx-subtabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.music-sfx-subpanel {
    display: none;
}

.music-sfx-subpanel.is-active {
    display: block;
}

.sfx-meta {
    margin-top: 4px;
}

.skin-fit-inline {
    width: 100%;
}

.skin-fit-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.skin-fit-controls {
    border-radius: 16px;
    border: 1px solid rgba(88, 104, 205, 0.35);
    background: linear-gradient(160deg, #1a1730, #120f26);
    color: #f2f4ff;
    padding: 16px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.skin-fit-controls h3 {
    margin: 0;
    font-size: 18px;
}

.skin-fit-controls .hint {
    margin: 0 0 2px;
    color: #b8bfeb;
    font-size: 13px;
    line-height: 1.45;
}

.skin-fit-controls label {
    margin-top: 6px;
    color: #c6ccf4;
    font-size: 13px;
    font-weight: 700;
}

.skin-fit-controls input,
.skin-fit-controls select,
.skin-fit-controls textarea,
.skin-fit-controls button {
    background: #121028;
    color: #f4f6ff;
    border: 1px solid rgba(117, 129, 220, 0.35);
}

.skin-fit-controls textarea {
    min-height: 148px;
}

.skin-fit-controls .row {
    display: grid;
    grid-template-columns: 1fr 88px;
    gap: 10px;
}

.skin-fit-controls input[type='range'] {
    min-height: 36px;
    padding: 0;
    border: 0;
    accent-color: #4d8ff5;
    background: transparent;
}

.fit-actions {
    margin-top: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.skin-fit-preview-wrap {
    border: 1px solid rgba(35, 43, 83, 0.18);
    border-radius: 14px;
    background: #1b1a30;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.skin-fit-preview-wrap .hint {
    margin: 0;
    color: #d4d8f8;
    font-size: 13px;
    line-height: 1.45;
}

#fitPreviewCanvas {
    width: 100%;
    max-width: none;
    aspect-ratio: 960 / 620;
    border-radius: 14px;
    border: 1px solid rgba(123, 138, 229, 0.35);
    box-shadow: none;
    background: #0f1421;
    cursor: default;
}

.skin-gen-panel {
    margin-top: 12px;
    border-radius: 16px;
    border: 1px solid rgba(26, 32, 62, 0.18);
    background: #f8f7ff;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.skin-gen-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.skin-gen-header .hint {
    margin: 0;
    color: #4f5786;
    line-height: 1.5;
    font-size: 13px;
}

.skin-gen-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.skin-gen-controls,
.skin-gen-annotate {
    border-radius: 14px;
    border: 1px solid rgba(96, 109, 188, 0.24);
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.skin-gen-inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.skin-gen-style-preview {
    border-radius: 12px;
    border: 1px dashed rgba(71, 84, 162, 0.38);
    min-height: 88px;
    display: grid;
    place-items: center;
    background: #f2f4ff;
}

.skin-gen-style-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    display: block;
}

.field-inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(41, 49, 98, 0.16);
    background: #f4f5ff;
}

.field-inline-check input[type='checkbox'] {
    min-height: auto;
    width: 18px;
    height: 18px;
    padding: 0;
}

.field-inline-check code {
    font-family: "Consolas", "SFMono-Regular", "Microsoft YaHei", monospace;
    font-size: 12px;
}

.skin-gen-actions {
    margin-top: 0;
}

.skin-gen-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.skin-gen-tools button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.skin-gen-tools button.is-active {
    background: linear-gradient(135deg, #5d77e6, #3f59c8);
    color: #fff;
    border: 0;
}

.tool-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(31, 37, 78, 0.18);
    background: #f4f6ff;
    font-size: 12px;
    font-weight: 700;
    color: #4f5788;
}

.tool-size input[type='range'] {
    min-height: auto;
    width: 110px;
    padding: 0;
    border: 0;
    background: transparent;
}

.skin-gen-canvas-wrap {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(25, 30, 61, 0.2);
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    width: 100%;
    max-width: 540px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

#skinGenBaseCanvas,
#skinGenOverlayCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#skinGenBaseCanvas {
    pointer-events: none;
}

#skinGenOverlayCanvas {
    cursor: crosshair;
}

.skin-gen-annotate .hint {
    margin: 0;
    color: #4f5786;
    font-size: 13px;
    line-height: 1.4;
}

.skin-gen-controls .hint {
    margin: 0;
    color: #4f5786;
    font-size: 13px;
    line-height: 1.4;
}

.skin-gen-result {
    border-radius: 14px;
    border: 1px solid rgba(69, 82, 155, 0.22);
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.skin-gen-result h4 {
    margin: 0;
}

.skin-gen-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.skin-gen-result-item {
    min-height: auto;
    border-radius: 10px;
    border: 1px solid rgba(48, 58, 113, 0.18);
    background: #f4f6ff;
    padding: 8px;
    position: relative;
    display: grid;
    gap: 6px;
    justify-items: center;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.skin-gen-result-item:hover {
    border-color: rgba(71, 87, 193, 0.44);
    transform: translateY(-1px);
}

.skin-gen-result-item.is-active {
    border-color: rgba(61, 87, 215, 0.68);
    box-shadow: 0 8px 20px rgba(59, 79, 181, 0.22);
}

.skin-gen-result-item strong {
    font-size: 12px;
    color: #323a6f;
}

.skin-gen-result-item img {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.skin-gen-result-regen-btn {
    position: absolute;
    right: 6px;
    bottom: 6px;
    min-height: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(52, 72, 170, 0.35);
    background: rgba(255, 255, 255, 0.95);
    color: #31408e;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    z-index: 2;
}

.skin-gen-result-regen-btn:hover {
    border-color: rgba(52, 72, 170, 0.62);
    background: #ffffff;
}

.skin-gen-result-regen-btn:disabled {
    opacity: 0.56;
    cursor: default;
}

/* Skin management V2 */
.skin-manage-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
}

.skin-library-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.skin-library-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.skin-library-list {
    max-height: 720px;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.skin-library-item {
    border: 1px solid rgba(37, 48, 109, 0.18);
    border-radius: 12px;
    background: #f4f6ff;
    padding: 8px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
    min-height: auto;
}

.skin-library-item:hover {
    border-color: rgba(61, 81, 186, 0.4);
}

.skin-library-item.is-active {
    border-color: rgba(66, 95, 226, 0.72);
    box-shadow: 0 8px 20px rgba(66, 95, 226, 0.18);
}

.skin-library-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(62, 75, 142, 0.2);
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.skin-library-name {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.skin-library-name strong {
    font-size: 13px;
    color: #252d62;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-library-name span {
    font-size: 12px;
    color: #59608c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-hidden-select {
    display: none;
}

.skin-workspace-panel {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.skin-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.skin-workspace-view {
    display: none;
    min-width: 0;
}

.skin-workspace-view.is-active {
    display: block;
}

.skin-detail-grid {
    display: grid;
    grid-template-columns: minmax(330px, 380px) minmax(0, 1fr);
    gap: 12px;
}

.skin-meta-card,
.skin-parts-card {
    border-radius: 14px;
    border: 1px solid rgba(72, 86, 164, 0.2);
    background: #fff;
    padding: 12px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.skin-meta-card h3,
.skin-parts-card h3 {
    margin: 0;
}

.skin-meta-card .hint,
.skin-parts-card .hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #525b8a;
}

.skin-meta-card .actions {
    grid-template-columns: 1fr 1fr;
}

.skin-advanced {
    border: 1px solid rgba(53, 67, 141, 0.16);
    border-radius: 12px;
    background: #f8f8ff;
    padding: 6px 10px 10px;
}

.skin-advanced summary {
    cursor: pointer;
    font-weight: 800;
    color: #3a447a;
    list-style: none;
    user-select: none;
}

.skin-advanced summary::-webkit-details-marker {
    display: none;
}

.skin-parts-head {
    display: grid;
    gap: 4px;
    margin-bottom: 2px;
}

.skin-part-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
    gap: 8px;
}

.skin-part-item {
    border: 1px solid rgba(53, 66, 140, 0.2);
    border-radius: 11px;
    background: #f5f7ff;
    padding: 8px;
    display: grid;
    gap: 7px;
    min-height: auto;
}

.skin-part-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    border: 1px solid rgba(69, 85, 163, 0.22);
    display: grid;
    place-items: center;
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.skin-part-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.skin-part-meta {
    display: grid;
    gap: 2px;
}

.skin-part-meta strong {
    font-size: 12px;
    color: #2f3768;
}

.skin-part-meta span {
    font-size: 11px;
    color: #60689a;
}

.skin-part-fit-btn {
    min-height: 34px;
    font-size: 12px;
}

.skin-fit-modal[hidden] {
    display: none;
}

.skin-fit-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
}

.skin-fit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 16, 32, 0.62);
    backdrop-filter: blur(2px);
}

.skin-fit-modal-dialog {
    position: relative;
    width: min(1240px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(111, 126, 211, 0.3);
    background: #17182a;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
    padding: 12px;
}

.skin-fit-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.skin-fit-modal-head h3 {
    margin: 0;
    color: #f3f5ff;
}

.skin-fit-modal-head button {
    min-height: 34px;
    background: #111326;
    color: #f3f5ff;
    border: 1px solid rgba(117, 129, 220, 0.35);
}

@media (max-width: 980px) {
    .admin-hub-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-shell,
    .skin-admin-shell,
    .skin-manage-shell,
    .params-admin-shell,
    .sfx-admin-shell {
        grid-template-columns: 1fr;
    }
    .catalog-row { grid-template-columns: 1fr; }
    .skin-fit-grid {
        grid-template-columns: 1fr;
    }
    .skin-gen-grid {
        grid-template-columns: 1fr;
    }
    .skin-gen-inline-fields {
        grid-template-columns: 1fr;
    }
    .sfx-param-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .sfx-source-inline {
        grid-template-columns: 1fr;
    }
    .skin-sfx-binding-row {
        grid-template-columns: 1fr;
    }
    .game-sfx-option-row {
        grid-template-columns: 1fr;
    }
    .game-sfx-loop-label {
        justify-content: center;
    }
    .skin-workspace-head {
        flex-direction: column;
        align-items: stretch;
    }
    .skin-detail-grid {
        grid-template-columns: 1fr;
    }
    .skin-fit-modal {
        padding: 8px;
    }
    .skin-fit-modal-dialog {
        width: min(1240px, calc(100vw - 16px));
        max-height: calc(100vh - 16px);
    }
}

@media (max-width: 420px) {
    .level-inline-grid,
    .level-reward-preview,
    .catalog-row {
        grid-template-columns: 1fr;
    }

    .level-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    #btnSaveLevelCatalog {
        width: 100%;
        justify-self: stretch;
    }
}

/* Skin gen workflow redesign */
.skin-gen-panel {
    margin-top: 0;
    gap: 10px;
}

.skin-gen-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.skin-gen-close-btn {
    min-height: 34px;
    width: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(48, 65, 156, 0.24);
    background: #eef1ff;
    color: #3c4da1;
    font-size: 20px;
    line-height: 1;
    flex: 0 0 auto;
}

.skin-gen-close-btn:hover {
    background: #e0e7ff;
}

.skin-gen-card {
    border-radius: 14px;
    border: 1px solid rgba(70, 85, 168, 0.22);
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.skin-gen-card h4 {
    margin: 0;
    font-size: 18px;
}

.skin-gen-queue-strip {
    gap: 8px;
}

.skin-gen-queue-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.skin-gen-queue-head .hint {
    margin: 0;
    font-size: 13px;
    color: #565f91;
}

.skin-gen-task-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 4px;
    min-height: 110px;
}

.skin-gen-task-item {
    flex: 0 0 248px;
    min-height: auto;
    padding: 8px;
    position: relative;
    border-radius: 11px;
    border: 1px solid rgba(55, 72, 160, 0.24);
    background: #f5f7ff;
    display: grid;
    gap: 8px;
    text-align: left;
}

.skin-gen-task-info-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(58, 79, 181, 0.48);
    background: #f3f6ff;
    color: #30408f;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
}

.skin-gen-task-info-btn:hover {
    background: #e9efff;
    border-color: rgba(58, 79, 181, 0.72);
}

.skin-gen-task-item:hover {
    border-color: rgba(68, 88, 190, 0.5);
}

.skin-gen-task-item.is-active {
    border-color: rgba(62, 89, 216, 0.72);
    box-shadow: 0 8px 22px rgba(58, 81, 183, 0.2);
}

.skin-gen-task-item.is-running {
    background: linear-gradient(180deg, #f1f4ff, #e9f0ff);
}

.skin-gen-task-item.is-failed {
    border-color: rgba(194, 31, 78, 0.45);
}

.skin-gen-task-main {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.skin-gen-task-info {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.skin-gen-task-cover {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 9px;
    border: 1px solid rgba(59, 74, 151, 0.2);
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.skin-gen-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.skin-gen-task-head strong {
    color: #2d3462;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-gen-task-sub {
    font-size: 12px;
    color: #50598c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-gen-task-badge {
    font-size: 11px;
    font-weight: 800;
    color: #3343a3;
    background: #e1e7ff;
    border: 1px solid rgba(51, 67, 163, 0.22);
    border-radius: 999px;
    padding: 2px 8px;
    flex: 0 0 auto;
}

.skin-gen-task-progress {
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(74, 91, 181, 0.24);
    background: #ecf0ff;
    overflow: hidden;
}

.skin-gen-task-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5b78ea, #3f59cc);
    transition: width 0.25s ease;
}

.skin-gen-task-item.is-running .skin-gen-task-progress-fill {
    background: linear-gradient(90deg, #5f80ff, #4e66d6, #5f80ff);
    background-size: 220px 100%;
    animation: skinGenProgressFlow 1.2s linear infinite;
}

.skin-gen-task-error {
    font-size: 12px;
    color: #c21f4e;
    line-height: 1.35;
}

.skin-gen-task-empty {
    font-size: 13px;
    color: #5e658f;
    padding: 8px;
}

@keyframes skinGenProgressFlow {
    from { background-position: 0 0; }
    to { background-position: 220px 0; }
}

.skin-gen-workflow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.skin-gen-actions-single {
    grid-template-columns: 1fr;
    margin-top: -2px;
}

.skin-gen-style-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

button.skin-gen-style-preview {
    min-height: auto;
    width: 96px;
    height: 96px;
    padding: 0;
    border-radius: 10px;
    border: 1px dashed rgba(71, 84, 162, 0.5);
    background: #f3f5ff;
    display: grid;
    place-items: center;
    overflow: hidden;
}

button.skin-gen-style-preview:hover {
    border-color: rgba(61, 84, 198, 0.62);
    background: #edf1ff;
}

.skin-gen-style-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

#skinGenStylePreviewEmpty {
    font-size: 12px;
    color: #606999;
}

.skin-gen-style-buttons {
    display: grid;
    gap: 8px;
    width: 128px;
}

.skin-gen-variant-ref-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
}

.skin-gen-variant-ref-item {
    border-radius: 10px;
    border: 1px solid rgba(67, 81, 160, 0.22);
    background: #f6f7ff;
    padding: 6px;
    display: grid;
    gap: 4px;
    justify-items: center;
}

.skin-gen-variant-ref-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(68, 84, 166, 0.24);
}

.skin-gen-variant-ref-item span {
    width: 100%;
    font-size: 11px;
    color: #565f91;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skin-gen-post {
    gap: 10px;
}

.skin-gen-task-meta {
    font-size: 13px;
    color: #4f5786;
    border-radius: 10px;
    background: #f3f6ff;
    border: 1px solid rgba(45, 59, 128, 0.15);
    padding: 8px 10px;
}

.skin-gen-post-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    min-width: 0;
}

.skin-gen-post-settings {
    display: grid;
    gap: 10px;
    align-content: start;
}

.skin-gen-post-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.skin-gen-post-actions {
    grid-template-columns: 1fr;
    gap: 8px;
}

.skin-gen-preview-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}

.skin-gen-existing-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 10px;
    align-items: end;
}

.skin-gen-variant-step {
    gap: 10px;
}

.skin-gen-variant-save-toggle {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(64, 81, 168, 0.22);
    background: #f7f8ff;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #3f4777;
}

.skin-gen-variant-save-toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #5d77e6;
}

.skin-gen-variant-result-wrap {
    border-top: 1px dashed rgba(63, 79, 170, 0.28);
    padding-top: 10px;
    display: grid;
    gap: 8px;
}

.skin-gen-variant-result-wrap h5 {
    margin: 0;
    font-size: 14px;
    color: #31375f;
}

.skin-gen-variant-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.skin-gen-variant-result-item {
    min-height: auto;
    border-radius: 10px;
    border: 1px solid rgba(57, 73, 160, 0.28);
    background: #f5f7ff;
    padding: 6px;
    display: grid;
    gap: 4px;
    justify-items: center;
    align-content: start;
    cursor: pointer;
    position: relative;
}

.skin-gen-variant-result-item.is-active {
    border-color: rgba(61, 88, 218, 0.72);
    box-shadow: 0 8px 18px rgba(56, 79, 180, 0.18);
}

.skin-gen-variant-result-item img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(66, 81, 164, 0.24);
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.skin-gen-variant-result-meta {
    width: 100%;
    display: grid;
    gap: 2px;
    justify-items: center;
}

.skin-gen-variant-result-meta strong {
    font-size: 11px;
    color: #2f386f;
}

.skin-gen-variant-result-meta span {
    font-size: 11px;
    color: #5b6494;
}

.skin-gen-variant-regen-btn {
    min-height: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(52, 72, 170, 0.35);
    background: rgba(255, 255, 255, 0.95);
    color: #31408e;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.skin-gen-result h5 {
    margin: 0;
    font-size: 14px;
    color: #31375f;
}

.skin-gen-crop-modal[hidden] {
    display: none;
}

.skin-gen-api-log-modal[hidden] {
    display: none;
}

.skin-gen-api-log-modal {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: grid;
    place-items: center;
    padding: 16px;
}

.skin-gen-api-log-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 34, 0.62);
    backdrop-filter: blur(2px);
}

.skin-gen-api-log-dialog {
    position: relative;
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(106, 122, 210, 0.36);
    background: #f7f8ff;
    box-shadow: 0 30px 68px rgba(10, 14, 32, 0.42);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.skin-gen-api-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.skin-gen-api-log-head h3 {
    margin: 0;
    color: #273063;
}

.skin-gen-api-log-dialog .hint {
    margin: 0;
    font-size: 13px;
    color: #586094;
}

.skin-gen-api-log-dialog textarea {
    min-height: 420px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.45;
    resize: vertical;
}

.skin-gen-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 16px;
}

.skin-gen-crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 34, 0.62);
    backdrop-filter: blur(2px);
}

.skin-gen-crop-dialog {
    position: relative;
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(106, 122, 210, 0.36);
    background: #f7f8ff;
    box-shadow: 0 30px 68px rgba(10, 14, 32, 0.42);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.skin-gen-crop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.skin-gen-crop-head h3 {
    margin: 0;
    color: #273063;
}

.skin-gen-crop-head button {
    min-height: 34px;
}

.skin-gen-crop-dialog .hint {
    margin: 0;
    font-size: 13px;
    color: #586094;
}

.skin-gen-crop-stage-wrap {
    border-radius: 12px;
    border: 1px solid rgba(70, 84, 166, 0.24);
    background:
        linear-gradient(45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(-45deg, #d7d1c7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d7d1c7 75%),
        linear-gradient(-45deg, transparent 75%, #d7d1c7 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    padding: 10px;
    display: grid;
    place-items: center;
}

.skin-gen-crop-stage {
    position: relative;
    width: min(760px, 100%);
    user-select: none;
    cursor: crosshair;
}

.skin-gen-crop-stage img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.skin-gen-crop-selection {
    position: absolute;
    border: 2px solid #4f6df1;
    background: rgba(85, 111, 240, 0.18);
    box-shadow: 0 0 0 9999px rgba(8, 13, 33, 0.35);
    pointer-events: none;
    border-radius: 6px;
}

.skin-gen-crop-actions {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1420px) {
    .skin-gen-workflow {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1120px) {
    .skin-gen-post-controls {
        grid-template-columns: 1fr;
    }
    .skin-gen-post-actions {
        grid-template-columns: 1fr;
    }
    .skin-gen-preview-columns {
        grid-template-columns: 1fr;
    }
    .skin-gen-existing-row {
        grid-template-columns: 1fr;
    }
    .skin-gen-style-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .skin-gen-style-buttons {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }
    .skin-gen-task-item {
        flex-basis: 220px;
    }
}

.events-admin-shell {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(420px, 1fr);
    gap: 14px;
}

.liveops-item-list {
    max-height: 260px;
    overflow: auto;
    border: 1px solid rgba(95, 110, 196, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.52);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.liveops-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(95, 110, 196, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
}

.liveops-item-row.is-active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px rgba(94, 108, 224, 0.35);
}

.liveops-item-row button {
    border: 1px solid rgba(95, 110, 196, 0.3);
    border-radius: 6px;
    background: #fff;
    padding: 4px 8px;
    cursor: pointer;
    font-weight: 700;
}

.game-music-track-list {
    max-height: 220px;
    overflow: auto;
    border: 1px solid rgba(95, 110, 196, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.52);
    padding: 8px;
    display: grid;
    gap: 7px;
}

.game-music-track-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 180px 74px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(95, 110, 196, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.game-music-track-row:hover {
    border-color: rgba(95, 110, 196, 0.4);
}

.game-music-track-row.is-selected {
    border-color: rgba(71, 113, 49, 0.55);
    background: rgba(227, 248, 218, 0.9);
}

.game-music-track-row input[type='checkbox'] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.game-music-track-name {
    font-size: 14px;
    line-height: 1.3;
    color: #2f3768;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-music-track-volume-wrap {
    justify-self: end;
    width: 180px;
    min-width: 180px;
    display: grid;
    grid-template-columns: 1fr 42px;
    align-items: center;
    gap: 8px;
}

.game-music-track-volume:disabled {
    opacity: 0.55;
}

.game-music-track-volume {
    width: 100%;
    margin: 0;
}

.game-music-track-volume-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(95, 110, 196, 0.28);
    background: #fff;
    color: #334182;
    font-weight: 700;
    font-size: 12px;
}

.game-music-preview-btn {
    justify-self: end;
    min-width: 64px;
    height: 30px;
    border: 1px solid rgba(95, 110, 196, 0.35);
    border-radius: 8px;
    background: #ffffff;
    color: #334182;
    font-weight: 700;
    cursor: pointer;
}

.game-music-preview-btn:hover {
    border-color: rgba(95, 110, 196, 0.58);
}

.game-music-preview-btn.is-active {
    background: #334182;
    color: #fff;
    border-color: #334182;
}

@media (max-width: 820px) {
    .game-music-track-row {
        grid-template-columns: 22px minmax(0, 1fr) 138px 64px;
        gap: 8px;
        padding: 7px 8px;
    }

    .game-music-track-volume-wrap {
        width: 138px;
        min-width: 138px;
        grid-template-columns: 1fr 38px;
        gap: 6px;
    }

    .game-music-preview-btn {
        min-width: 64px;
    }
}

.game-music-selection-summary {
    margin-top: 6px;
    margin-bottom: 2px;
    font-size: 12px;
    color: #49507f;
    line-height: 1.45;
}

.events-subtabbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.events-subpanel {
    display: none;
}

.events-subpanel.is-active {
    display: block;
}

.liveops-table-wrap {
    border: 1px solid rgba(95, 110, 196, 0.24);
    border-radius: 10px;
    overflow: auto;
    background: rgba(255, 255, 255, 0.72);
}

.liveops-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.liveops-table th,
.liveops-table td {
    border-bottom: 1px solid rgba(95, 110, 196, 0.2);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.liveops-table th {
    font-size: 12px;
    color: #44508f;
    background: rgba(224, 230, 255, 0.55);
    font-weight: 800;
}

.liveops-table td input,
.liveops-table td select {
    width: 100%;
    min-height: 32px;
    border: 1px solid rgba(95, 110, 196, 0.28);
    border-radius: 8px;
    padding: 4px 8px;
    background: #fff;
}

.liveops-table td button {
    border: 1px solid rgba(95, 110, 196, 0.3);
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.ui-editor-shell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 16px;
}

.ui-editor-controls {
    display: grid;
    align-content: start;
    gap: 10px;
}

.ui-editor-size-info {
    margin-top: -2px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(71, 92, 198, 0.22);
    background: rgba(236, 242, 255, 0.78);
    color: #394783;
    font-size: 12px;
    font-weight: 700;
}

.ui-editor-element-list {
    min-height: 312px;
    max-height: 360px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(71, 92, 198, 0.22);
    background: rgba(248, 250, 255, 0.92);
    padding: 6px;
    display: grid;
    gap: 6px;
}

.ui-editor-element-list:focus-visible {
    outline: 2px solid rgba(93, 119, 230, 0.45);
    outline-offset: 2px;
}

.ui-editor-element-item {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(78, 94, 170, 0.2);
    background: #fff;
    color: #2f396f;
    display: grid;
    grid-template-columns: 22px 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    user-select: none;
    cursor: pointer;
}

.ui-editor-element-item:hover {
    border-color: rgba(74, 95, 190, 0.4);
    background: #f2f6ff;
}

.ui-editor-element-item.is-selected {
    border-color: rgba(74, 95, 190, 0.62);
    background: linear-gradient(180deg, #eaf0ff 0%, #e1eaff 100%);
    box-shadow: 0 5px 12px rgba(56, 76, 172, 0.16);
}

.ui-editor-element-item.is-dragging {
    opacity: 0.55;
}

.ui-editor-element-item.drop-before,
.ui-editor-element-item.drop-after {
    position: relative;
}

.ui-editor-element-item.drop-before::before,
.ui-editor-element-item.drop-after::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    border-radius: 2px;
    background: #4569ec;
}

.ui-editor-element-item.drop-before::before {
    top: -2px;
}

.ui-editor-element-item.drop-after::after {
    bottom: -2px;
}

.ui-editor-element-drag {
    color: #6a74a9;
    font-size: 14px;
    line-height: 1;
    cursor: grab;
}

.ui-editor-element-item:active .ui-editor-element-drag {
    cursor: grabbing;
}

.ui-editor-element-layer {
    color: #59639b;
    font-weight: 800;
    font-size: 11px;
    text-align: right;
}

.ui-editor-element-label {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-editor-element-flag {
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(116, 124, 161, 0.16);
    color: #4d567f;
    font-size: 10px;
    font-weight: 800;
}

.ui-editor-preview-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.ui-editor-preview-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(71, 92, 198, 0.26);
    background: rgba(239, 244, 255, 0.9);
    color: #3a497f;
    font-size: 12px;
    font-weight: 800;
}

.ui-editor-property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ui-editor-property-grid .field {
    margin: 0;
}

.ui-editor-property-grid .field.is-wide {
    grid-column: 1 / -1;
}

.ui-editor-scale-tools {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(45, 59, 128, 0.12);
    background: rgba(245, 247, 255, 0.85);
}

.ui-editor-scale-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ui-editor-preview-panel {
    min-width: 0;
}

.ui-editor-preview-panel .preview-header {
    align-items: flex-start;
    gap: 10px;
}

.ui-editor-preview-viewport {
    position: relative;
    height: calc(100vh - 180px);
    min-height: 640px;
    border-radius: 18px;
    border: 1px solid rgba(45, 59, 128, 0.16);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.85), rgba(240, 242, 255, 0.74) 42%, rgba(231, 235, 251, 0.96) 100%);
    overflow: hidden;
    padding: 16px;
}

.ui-editor-preview-viewport:focus-visible {
    outline: 3px solid rgba(93, 119, 230, 0.55);
    outline-offset: 4px;
}

.ui-editor-preview-stage-wrap {
    position: absolute;
    width: 980px;
    height: 760px;
    transform-origin: top left;
    user-select: none;
}

.ui-editor-preview-frame {
    position: absolute;
    inset: 0;
    width: 980px;
    height: 760px;
    border: 0;
    border-radius: 18px;
    background: #eef1ff;
}

.ui-editor-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.ui-editor-assist-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.ui-editor-guide-line {
    position: absolute;
    pointer-events: none;
}

.ui-editor-guide-line.is-vertical {
    border-left: 1px dashed rgba(66, 91, 226, 0.95);
}

.ui-editor-guide-line.is-horizontal {
    border-top: 1px dashed rgba(66, 91, 226, 0.95);
}

.ui-editor-distance-line {
    position: absolute;
    pointer-events: none;
}

.ui-editor-distance-line.is-horizontal {
    border-top: 1px dashed rgba(233, 132, 26, 0.95);
}

.ui-editor-distance-line.is-vertical {
    border-left: 1px dashed rgba(233, 132, 26, 0.95);
}

.ui-editor-distance-label {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(227, 130, 29, 0.38);
    background: rgba(255, 245, 226, 0.96);
    color: #7f4f15;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(87, 55, 18, 0.15);
}

.ui-editor-element {
    position: absolute;
    background: transparent;
    border: 0;
}

.ui-editor-element.is-selectable {
    cursor: move;
}

.ui-editor-element.is-selected::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px dashed rgba(65, 89, 214, 0.95);
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

.ui-editor-element[data-element-id^="day"][data-element-id$="-icon"].is-selected::after,
.ui-editor-element[data-element-id^="day"][data-element-id$="-badge"].is-selected::after {
    border-radius: 999px;
}

.ui-editor-checkin-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 16px;
    border: 2px solid rgba(176, 126, 71, 0.72);
    background: linear-gradient(180deg, #f9e2b0 0%, #f2cb88 100%);
    color: #7a4c27;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(97, 60, 27, 0.18);
}

.ui-editor-checkin-notebook {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
}

.ui-editor-checkin-notebook::before {
    content: "";
    position: absolute;
    inset: 0;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_sheet_cut.png');
    pointer-events: none;
}

.ui-editor-checkin-ribbon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_ribbon_cut.png');
}

.ui-editor-checkin-ribbon-title {
    color: #8a5427;
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    font-weight: 900;
    line-height: 1;
}

.ui-editor-checkin-day {
    border-radius: 18px;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_day_card_solid.png');
    overflow: visible;
}

.ui-editor-checkin-day.is-claimed:not(.day-7) {
    background-image: url('../assets/ui/checkin/checkin_day_card_claimed_solid.png');
}

.ui-editor-checkin-day.day-7 {
    background-image: url('../assets/ui/checkin/checkin_day7_panel.png');
}

.ui-editor-checkin-day.is-next {
    box-shadow: 0 0 0 6px rgba(248, 213, 143, 0.86), 0 8px 18px rgba(186, 121, 58, 0.24);
}

.ui-editor-checkin-day-title {
    margin: 0;
    color: #8a5427;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 248, 233, 0.8);
    pointer-events: none;
}

.ui-editor-checkin-reward-icon {
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(84, 55, 25, 0.18));
    pointer-events: none;
}

.ui-editor-checkin-reward-amount {
    color: #6f4629;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 248, 233, 0.9);
    pointer-events: none;
}

.ui-editor-checkin-claimed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #8bd85b 0%, #4ca13f 100%);
    border: 2px solid #f5efc4;
    box-shadow: 0 3px 7px rgba(58, 101, 42, 0.28);
    color: #ffffff;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.ui-editor-checkin-status {
    position: absolute;
    left: 300px;
    top: 698px;
    font-size: 13px;
    color: #6f4629;
    opacity: 0.72;
}

.ui-editor-checkin-mascot {
    object-fit: contain;
    pointer-events: none;
}

.ui-editor-follow-mouse-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(72, 86, 154, 0.14);
}

.ui-editor-follow-mouse-header {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.ui-editor-follow-mouse-header h3 {
    margin: 0;
    font-size: 16px;
    color: #243165;
}

.ui-editor-follow-mouse-stage {
    position: relative;
    min-height: 240px;
    border-radius: 18px;
    border: 1px solid rgba(59, 74, 147, 0.18);
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.92), rgba(242, 245, 255, 0.95) 58%, rgba(232, 237, 255, 0.98) 100%);
    overflow: hidden;
}

.ui-editor-follow-mouse-stage::before,
.ui-editor-follow-mouse-stage::after {
    content: "";
    position: absolute;
    background: rgba(94, 111, 191, 0.18);
    pointer-events: none;
}

.ui-editor-follow-mouse-stage::before {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-0.5px);
}

.ui-editor-follow-mouse-stage::after {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-0.5px);
}

.ui-editor-follow-mouse-preview {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.ui-editor-follow-mouse-cursor {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 30px;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
}

.ui-editor-follow-mouse-cursor::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #5169de 0%, #3148b1 100%);
    clip-path: polygon(0 0, 78% 52%, 50% 57%, 63% 100%, 46% 100%, 34% 61%, 0 78%);
    filter: drop-shadow(0 4px 10px rgba(49, 72, 177, 0.22));
}

.ui-editor-follow-mouse-proxy {
    position: absolute;
    transform: translate(0, 0);
    cursor: move;
    pointer-events: auto;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip {
    position: absolute;
    min-width: 180px;
    max-width: 250px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid rgba(168, 114, 61, 0.9);
    background: linear-gradient(180deg, rgba(255, 247, 229, 0.98) 0%, rgba(246, 226, 187, 0.98) 100%);
    box-shadow: 0 12px 26px rgba(73, 42, 20, 0.22);
    color: #724425;
    pointer-events: auto;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 900;
    color: #8a5427;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-desc {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #6b4b2f;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.ui-editor-follow-mouse-preview .checkin-reward-tooltip-item-text {
    min-width: 0;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.db-admin-main-panel {
    display: grid;
    gap: 16px;
}

.db-admin-selection {
    padding: 8px 12px;
    border-radius: 999px;
    background: #ece9fb;
    color: #42508d;
    font-size: 12px;
    font-weight: 800;
}

.db-admin-table-wrap {
    max-height: 300px;
    overflow: auto;
}

.db-admin-create-card,
.db-admin-card,
.db-admin-detail-shell {
    border: 1px solid rgba(39, 46, 95, 0.1);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(242, 240, 253, 0.92));
    padding: 16px;
}

.db-admin-detail-shell {
    display: grid;
    gap: 14px;
}

.db-admin-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.db-admin-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    background: #ece9fb;
}

.db-admin-subtabs .tab-btn {
    min-height: 34px;
}

.db-admin-subpanel {
    display: none;
}

.db-admin-subpanel.is-active {
    display: grid;
    gap: 14px;
}

.db-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
}

.db-admin-form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-field {
    align-content: end;
}

.checkbox-field input[type="checkbox"] {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 10px 0 0;
}

.db-admin-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.db-admin-card h3 {
    margin: 0 0 10px;
}

.db-admin-list-editor,
.db-admin-object-list {
    display: grid;
    gap: 10px;
}

.db-admin-list-item,
.db-admin-object-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(48, 57, 114, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.db-admin-list-item {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.db-admin-object-item-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.db-admin-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.db-admin-empty {
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed rgba(59, 76, 158, 0.22);
    color: #6a729f;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    background: rgba(255, 255, 255, 0.66);
}

.analytics-panel {
    display: grid;
    gap: 14px;
}

.analytics-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.analytics-metric-card {
    min-height: 86px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(52, 65, 142, 0.14);
    background: linear-gradient(180deg, #ffffff, #f3f5ff);
    display: grid;
    align-content: space-between;
    gap: 10px;
}

.analytics-metric-card span {
    color: #5f6798;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.analytics-metric-card strong {
    color: #24305f;
    font-size: 24px;
    line-height: 1.05;
}

.analytics-section-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.analytics-list,
.analytics-event-list {
    display: grid;
    gap: 8px;
}

.analytics-list-row,
.analytics-event-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(48, 57, 114, 0.1);
}

.analytics-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.analytics-list-row strong,
.analytics-event-row strong {
    color: #253060;
}

.analytics-list-row span,
.analytics-event-row span {
    color: #6670a0;
    font-size: 12px;
    font-weight: 700;
}

.analytics-event-row code,
.analytics-storage-meta code {
    padding: 2px 4px;
    border-radius: 6px;
    background: rgba(40, 49, 104, 0.08);
    color: #303a78;
}

.analytics-event-row pre {
    max-height: 90px;
    margin: 4px 0 0;
    padding: 8px;
    overflow: auto;
    border-radius: 8px;
    background: rgba(32, 38, 80, 0.08);
    color: #303a78;
    font-size: 11px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.assets-admin-shell {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.assets-panel,
.assets-main-panel {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
}

.assets-panel {
    position: sticky;
    top: 12px;
}

.asset-admin-note {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(48, 57, 114, 0.12);
    color: #55608f;
    font-size: 13px;
    font-weight: 700;
}

.asset-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    background: #ece9fb;
    align-items: center;
}

.asset-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.asset-filter-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(48, 57, 114, 0.14);
    background: rgba(255, 255, 255, 0.9);
    color: #4c5787;
    font-size: 12px;
    font-weight: 800;
}

.asset-filter-btn.is-active {
    background: linear-gradient(135deg, #5d77e6, #3f59c8);
    border-color: transparent;
    color: #fff;
}

.asset-subpanel {
    display: none;
    gap: 14px;
}

.asset-subpanel.is-active {
    display: grid;
}

.asset-audit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    align-items: flex-start;
}

.asset-audit-actions button {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 100%;
}

.asset-audit-list {
    display: grid;
    gap: 10px;
    align-content: start;
}

.asset-audit-card {
    display: grid;
    grid-template-columns: auto 84px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(48, 57, 114, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.asset-audit-check {
    width: 18px;
    height: 18px;
}

.asset-audit-check:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.asset-audit-thumb {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 1px solid rgba(56, 68, 145, 0.14);
    background:
        linear-gradient(45deg, rgba(89, 101, 180, 0.08) 25%, transparent 25%, transparent 75%, rgba(89, 101, 180, 0.08) 75%, rgba(89, 101, 180, 0.08)),
        linear-gradient(45deg, rgba(89, 101, 180, 0.08) 25%, transparent 25%, transparent 75%, rgba(89, 101, 180, 0.08) 75%, rgba(89, 101, 180, 0.08));
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
    object-fit: contain;
}

.asset-audit-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.asset-audit-meta strong {
    font-size: 13px;
    color: #2f3768;
    word-break: break-all;
}

.asset-audit-meta span {
    font-size: 12px;
    color: #5c6595;
}

.asset-audit-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.asset-audit-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #37518e;
    background: rgba(94, 118, 232, 0.12);
}

.asset-audit-badge.is-unused {
    color: #8d2442;
    background: rgba(198, 40, 83, 0.12);
}

.asset-audit-badge.is-used {
    color: #2a5b2d;
    background: rgba(79, 166, 88, 0.14);
}

.asset-audit-badge.is-fallback {
    color: #35538d;
    background: rgba(93, 119, 230, 0.12);
}

.asset-audit-badge.is-artifact {
    color: #775218;
    background: rgba(214, 165, 63, 0.16);
}

.asset-audit-actions-inline {
    display: flex;
    gap: 8px;
    align-self: start;
}

.asset-audit-actions-inline button {
    min-height: 34px;
    padding: 0 12px;
}

.asset-table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(48, 57, 114, 0.12);
    background: rgba(255, 255, 255, 0.96);
    max-width: 100%;
}

.asset-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.asset-table th,
.asset-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(48, 57, 114, 0.1);
    vertical-align: top;
    text-align: left;
    font-size: 12px;
    color: #43507d;
}

.asset-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f4ff;
}

.asset-table tr:hover td {
    background: rgba(93, 119, 230, 0.04);
}

.asset-sort-btn {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 800;
    color: #354271;
    cursor: pointer;
}

.asset-sort-btn.is-active {
    color: #214bc2;
}

.asset-table-thumb {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(56, 68, 145, 0.14);
    background:
        linear-gradient(45deg, rgba(89, 101, 180, 0.08) 25%, transparent 25%, transparent 75%, rgba(89, 101, 180, 0.08) 75%, rgba(89, 101, 180, 0.08)),
        linear-gradient(45deg, rgba(89, 101, 180, 0.08) 25%, transparent 25%, transparent 75%, rgba(89, 101, 180, 0.08) 75%, rgba(89, 101, 180, 0.08));
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
}

.asset-table-path {
    min-width: 260px;
    max-width: 420px;
    word-break: break-all;
}

.asset-table-actions {
    display: grid;
    grid-template-columns: 28px 60px 92px;
    gap: 6px;
    align-items: center;
    min-width: 192px;
}

.asset-scale-input {
    width: 60px;
    min-height: 32px;
    padding: 0 8px;
}

.asset-info-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(71, 92, 185, 0.24);
    background: #eef2ff;
    color: #4658a8;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.asset-info-btn:hover {
    background: #e4eaff;
}

.asset-table-actions button {
    min-height: 32px;
    padding: 0 10px;
}

.asset-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(32, 39, 81, 0.94);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    box-shadow: 0 16px 40px rgba(15, 22, 56, 0.32);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.asset-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.asset-toast.is-error {
    background: rgba(143, 35, 55, 0.96);
}

.font-admin-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
}

.font-admin-panel {
    align-self: start;
    position: sticky;
    top: 16px;
}

.font-main-panel {
    min-width: 0;
}

.font-admin-toolbar {
    display: flex;
    justify-content: flex-end;
    min-width: min(320px, 100%);
}

.font-admin-toolbar input {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(48, 57, 114, 0.18);
    border-radius: 12px;
    color: #24315f;
    background: rgba(255, 255, 255, 0.96);
}

.font-table {
    min-width: 1180px;
}

.font-name {
    font-weight: 900;
    color: #22315f;
}

.font-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #315a28;
    background: #e6f4df;
}

.font-tag.is-system {
    color: #48527d;
    background: #eef1ff;
}

.font-tag.is-none {
    color: #75471f;
    background: #fff2d8;
}

.font-code-list,
.font-usage-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.font-code-list code {
    color: #33447a;
    white-space: nowrap;
}

.liveops-item-table tr.is-active {
    background: rgba(93, 119, 230, 0.08);
}

@media (max-width: 1100px) {
    .assets-admin-shell,
    .analytics-admin-shell,
    .font-admin-shell,
    .events-admin-shell {
        grid-template-columns: 1fr;
    }
    .assets-panel {
        position: static;
    }
    .ui-editor-shell {
        grid-template-columns: 1fr;
    }
    .ui-editor-preview-meta {
        justify-items: start;
    }
    .db-admin-form-grid,
    .db-admin-form-grid.compact,
    .db-admin-card-grid,
    .analytics-metric-grid,
    .analytics-section-grid,
    .db-admin-object-item-grid {
        grid-template-columns: 1fr;
    }
    .asset-audit-card {
        grid-template-columns: 1fr;
    }
    .asset-audit-actions-inline {
        justify-content: flex-start;
    }
}
