/* 站点扩展 UI：留言、语言、今日一句、主题、分享 */

.corner-tools {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.corner-tool-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.corner-tool-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--site-accent, rgba(251, 113, 133, 0.6));
    transform: translateY(-1px);
}

.lang-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.lang-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.lang-btn.is-active {
    background: var(--site-accent-soft, rgba(251, 113, 133, 0.25));
    color: #fff;
}

.daily-quote-wrap {
    margin-top: 10px;
    margin-bottom: 14px;
    max-width: 420px;
}

.daily-quote-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 4px;
    text-shadow: var(--text-on-bg-shadow-soft, 0 1px 3px rgba(0, 0, 0, 0.82));
}

.daily-quote {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.94);
    font-style: italic;
    letter-spacing: 0.5px;
    text-shadow: var(--text-on-bg-shadow, 0 1px 2px rgba(0, 0, 0, 0.92), 0 4px 18px rgba(0, 0, 0, 0.68));
}

#guestbook-panel {
    position: fixed;
    left: 16px;
    bottom: 72px;
    width: min(340px, calc(100vw - 32px));
    max-height: min(420px, 60vh);
    z-index: 901;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(18, 8, 28, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#guestbook-panel.hidden {
    display: none;
}

.guestbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
    font-size: 14px;
}

.guestbook-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#guestbook-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    font-size: 13px;
}

.guestbook-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guestbook-item header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.guestbook-item time {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.guestbook-item p {
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
}

.guestbook-empty {
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 24px 8px;
}

#guestbook-form {
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#guestbook-form input,
#guestbook-form textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
}

#guestbook-form textarea {
    min-height: 64px;
    resize: vertical;
}

#guestbook-form button {
    align-self: flex-end;
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    background: var(--site-accent, rgb(251, 113, 133));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.shiloku-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    z-index: 9999;
    padding: 10px 18px;
    border-radius: 20px;
    background: rgba(18, 8, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

.shiloku-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.in-music-room .corner-tools,
body.in-music-room #guestbook-panel {
    opacity: 0;
    pointer-events: none;
}

/* 音乐室：主题 + 分享 */
.theme-picker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.aether-sidebar-theme.theme-picker-wrap {
    margin-left: 0;
    justify-content: center;
    width: 100%;
}

.aether-sidebar-theme .theme-picker-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 76px;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(90deg);
    transform-origin: center center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: rgba(148, 163, 184, 0.45);
    gap: 0;
}

.aether-sidebar-theme .theme-picker-toggle:hover,
.aether-sidebar-theme.theme-picker-wrap.is-open .theme-picker-toggle {
    color: var(--aether-accent, rgba(51, 209, 255, 0.95));
    background: transparent;
}

.aether-sidebar-theme .theme-picker-panel {
    top: auto;
    bottom: 0;
    left: calc(100% + 10px);
    min-width: 148px;
}

.theme-picker-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(148, 163, 184, 0.85);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.theme-picker-toggle:hover,
.theme-picker-wrap.is-open .theme-picker-toggle {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.06);
}

.theme-picker-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.theme-picker-wrap.is-open .theme-picker-toggle::after {
    transform: rotate(180deg);
}

.theme-picker-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(4, 8, 16, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    max-width: calc(100vw - 24px);
}

.theme-picker-wrap.is-open .theme-picker-panel {
    display: flex;
}

#theme-picker {
    gap: 5px;
    flex-wrap: wrap;
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
    background: rgb(var(--swatch, 251, 113, 133));
    transition: transform 0.15s, border-color 0.15s;
}

.theme-swatch[data-theme-id="auto"] {
    background: conic-gradient(from 120deg, #fb7185, #33d1ff, #a78bfa, #fb7185);
}

.theme-swatch.is-active {
    border-color: #fff;
    transform: scale(1.12);
}

#music-room[data-theme="cyan"] .music-viz-ambient {
    filter: hue-rotate(40deg);
}

#music-room[data-theme="violet"] .music-viz-ambient {
    filter: hue-rotate(80deg);
}

#music-room[data-theme="amber"] .music-viz-ambient {
    filter: hue-rotate(-30deg) saturate(1.1);
}

#music-room[data-theme="emerald"] .music-viz-ambient {
    filter: hue-rotate(100deg) saturate(0.95);
}

.ai-now-playing {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    padding: 6px 12px 0;
    line-height: 1.35;
}

.ai-music-actions {
    display: flex;
    gap: 6px;
    padding: 6px 12px 0;
    flex-wrap: wrap;
}

.ai-music-actions button {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    cursor: pointer;
}

.ai-music-actions button:hover {
    border-color: var(--site-accent, rgba(251, 113, 133, 0.5));
    color: #fff;
}

.listen-stats-wrap {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-width: min(320px, 100%);
    text-align: right;
}

.right-column > .top-area.right-top-stats {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 2vh;
    flex-shrink: 0;
}

.listen-stats-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px 8px;
    font-size: 10px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.82), 0 2px 10px rgba(0, 0, 0, 0.45);
}

.listen-stats-label {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
    margin: 0;
}

.listen-stats-chip strong {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.96);
}

.listen-stats-extra {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.68);
    text-align: right;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.82), 0 2px 10px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
    .right-column > .top-area.right-top-stats {
        padding-top: 0;
        justify-content: flex-end;
    }

    .listen-stats-wrap {
        max-width: 100%;
    }

    .listen-stats-inline {
        justify-content: flex-end;
    }

    .listen-stats-extra {
        text-align: right;
    }
}

.playlist-category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.playlist-category-btn {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.playlist-category-btn:hover {
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.playlist-category-btn.is-active {
    border-color: color-mix(in srgb, var(--site-accent, #fb7185) 55%, rgba(255, 255, 255, 0.2));
    background: color-mix(in srgb, var(--site-accent, #fb7185) 18%, rgba(255, 255, 255, 0.06));
    color: #fff;
}

#playlist .playlist-empty-hint {
    padding: 24px 8px;
    text-align: center;
    color: rgba(255, 255, 255, 0.42);
    font-size: 13px;
    font-style: italic;
    cursor: default;
}

#playlist .playlist-empty-hint:hover {
    background: transparent;
}

.playlist-category-btn-add {
    min-width: 28px;
    padding-inline: 8px;
    font-size: 14px;
    line-height: 1;
}

.playlist-category-panel {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.playlist-category-panel.hidden {
    display: none;
}

.playlist-category-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

.playlist-category-panel-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.playlist-category-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}

.playlist-category-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.playlist-category-list-item:last-child {
    border-bottom: none;
}

.playlist-category-list-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
}

.playlist-category-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.playlist-category-action {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    cursor: pointer;
    font-family: inherit;
}

.playlist-category-action.danger {
    border-color: rgba(251, 113, 133, 0.35);
    color: rgba(251, 113, 133, 0.92);
}

.playlist-category-add-btn {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.playlist-category-add-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

@media (max-width: 768px) {
    .daily-quote-wrap {
        margin-top: 10px;
        margin-bottom: 14px;
    }

    .daily-quote-label {
        margin-bottom: 6px;
    }

    .corner-tools {
        left: max(12px, env(safe-area-inset-left));
        bottom: max(12px, env(safe-area-inset-bottom));
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        max-width: calc(100vw - 88px);
    }

    .lang-switcher {
        flex-shrink: 0;
    }

    .corner-tool-btn {
        padding: 7px 12px;
        font-size: 11px;
        white-space: nowrap;
    }

    #guestbook-panel {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: max(64px, calc(env(safe-area-inset-bottom) + 56px));
        width: auto;
        max-height: min(380px, 52vh);
    }

    .shiloku-toast {
        bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
        max-width: calc(100vw - 32px);
        text-align: center;
    }
}

/* ---------- 画作集 ---------- */
body.gallery-open {
    overflow: hidden;
}

@keyframes galleryModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes galleryCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2.5vw, 28px);
    background:
        radial-gradient(circle at 20% 10%, rgba(251, 113, 133, 0.12), transparent 42%),
        radial-gradient(circle at 80% 90%, rgba(129, 140, 248, 0.1), transparent 38%),
        rgba(4, 2, 10, 0.72);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.gallery-modal.hidden {
    display: none;
}

.gallery-modal-panel {
    position: relative;
    width: min(1180px, 96vw);
    max-height: min(90vh, 920px);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(145deg, rgba(24, 14, 34, 0.92), rgba(10, 6, 18, 0.96));
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: galleryModalIn 0.42s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.gallery-modal-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(251, 113, 133, 0.45),
        rgba(255, 255, 255, 0.08) 38%,
        rgba(129, 140, 248, 0.28)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.gallery-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 14px;
}

.gallery-modal-heading {
    min-width: 0;
}

.gallery-modal-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(251, 113, 133, 0.82);
}

.gallery-modal-header h3 {
    font-size: clamp(22px, 2.4vw, 28px);
    letter-spacing: 0.12em;
    margin: 0;
}

.gallery-modal-meta {
    margin: 8px 0 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.48);
}

.gallery-close {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.gallery-close:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(251, 113, 133, 0.12);
    box-shadow: 0 8px 24px rgba(251, 113, 133, 0.18);
}

.gallery-close-icon,
.gallery-close-icon::before {
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.gallery-close-icon {
    position: relative;
    transform: rotate(45deg);
}

.gallery-close-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: rotate(90deg);
}

.gallery-toolbar {
    padding: 0 24px 12px;
}

.gallery-filters {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.gallery-filter {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.gallery-filter:hover {
    color: rgba(255, 255, 255, 0.88);
}

.gallery-filter.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.32), rgba(129, 140, 248, 0.22));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding: 8px 24px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.gallery-card {
    position: relative;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.24, 1), box-shadow 0.35s ease;
    animation: galleryCardIn 0.5s cubic-bezier(0.22, 0.8, 0.24, 1) both;
    animation-delay: calc(var(--card-i, 0) * 45ms);
}

.gallery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    transition: border-color 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(251, 113, 133, 0.18);
}

.gallery-card:hover::after {
    border-color: rgba(251, 113, 133, 0.35);
}

.gallery-card.is-featured {
    grid-column: span 2;
}

.gallery-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #120818;
}

.gallery-card.is-featured .gallery-card-media {
    aspect-ratio: 16 / 9;
}

.gallery-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.24, 1), filter 0.45s ease;
}

.gallery-card:hover img {
    transform: scale(1.08);
    filter: saturate(1.08) brightness(1.03);
}

.gallery-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 35%,
        rgba(255, 255, 255, 0.16) 50%,
        transparent 65%
    );
    transform: translateX(-120%);
    transition: transform 0.7s ease;
    pointer-events: none;
}

.gallery-card:hover .gallery-card-shine {
    transform: translateX(120%);
}

.gallery-card-overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px 14px 14px;
    background: linear-gradient(180deg, transparent, rgba(6, 3, 12, 0.88));
    transform: translateY(8px);
    opacity: 0.82;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-card:hover .gallery-card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-card-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.96);
    line-height: 1.35;
    letter-spacing: 0.04em;
}

.gallery-card-draft {
    align-self: flex-start;
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.06em;
}

.gallery-card-index {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    padding: 56px 12px;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at center, rgba(20, 10, 30, 0.35), rgba(0, 0, 0, 0.92) 72%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-lightbox.hidden {
    display: none;
}

.gallery-lightbox-figure {
    margin: 0;
    max-width: min(1240px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.gallery-lightbox-figure img {
    max-width: 100%;
    max-height: calc(90vh - 56px);
    object-fit: contain;
    border-radius: 16px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.gallery-lightbox-figure figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    letter-spacing: 0.06em;
}

#gallery-lightbox-counter {
    color: rgba(255, 255, 255, 0.45);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 113, 133, 0.45);
    background: rgba(251, 113, 133, 0.12);
}

.gallery-lightbox-close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 58px;
    border-radius: 14px;
    font-size: 28px;
}

.gallery-lightbox-nav:hover {
    transform: translateY(calc(-50% - 1px));
}

.gallery-lightbox-prev { left: max(12px, env(safe-area-inset-left)); }
.gallery-lightbox-next { right: max(12px, env(safe-area-inset-right)); }

@media (max-width: 768px) {
    .gallery-modal-header,
    .gallery-toolbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 4px 16px 18px;
    }

    .gallery-card.is-featured {
        grid-column: span 2;
    }

    .gallery-modal {
        padding: 10px;
    }

    .gallery-modal-panel {
        max-height: 92vh;
        border-radius: 20px;
    }

    .gallery-filters {
        width: 100%;
        justify-content: space-between;
    }

    .gallery-filter {
        flex: 1;
        padding-inline: 8px;
    }
}
