* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

:root {
    --night: #0b1220;
    --night-2: #101a2e;
    --night-3: #16233d;
    --line: #22314f;
    --line-soft: #1a2740;
    --moon: #e8e4d8;
    --moon-soft: #a8b2c8;
    --moon-faint: #6b7899;
    --accent: #e07b39;
    --accent-soft: #f09a5e;
    --accent-dim: rgba(224, 123, 57, .1);
    --accent-faint: rgba(224, 123, 57, .05);
    --accent-border: rgba(224, 123, 57, .4);
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 8px;
    --r-pill: 999px;
    --prism-r: 115px;
}

.theme-fire {
    --accent: #e07b39;
    --accent-soft: #f09a5e;
    --accent-dim: rgba(224, 123, 57, .1);
    --accent-faint: rgba(224, 123, 57, .05);
    --accent-border: rgba(224, 123, 57, .4)
}

.theme-draw {
    --accent: #3d8b8b;
    --accent-soft: #55a8a8;
    --accent-dim: rgba(61, 139, 139, .08);
    --accent-faint: rgba(61, 139, 139, .05);
    --accent-border: rgba(61, 139, 139, .4)
}

.theme-wish {
    --accent: #d4a017;
    --accent-soft: #e8b93a;
    --accent-dim: rgba(212, 160, 23, .08);
    --accent-faint: rgba(212, 160, 23, .05);
    --accent-border: rgba(212, 160, 23, .35)
}

.theme-anti {
    --accent: #c1272d;
    --accent-soft: #e0353b;
    --accent-dim: rgba(193, 39, 45, .1);
    --accent-faint: rgba(193, 39, 45, .05);
    --accent-border: rgba(193, 39, 45, .45)
}

.theme-gallery {
    --accent: #7a6fa8;
    --accent-soft: #9689c4;
    --accent-dim: rgba(122, 111, 168, .1);
    --accent-faint: rgba(122, 111, 168, .05);
    --accent-border: rgba(122, 111, 168, .4)
}

body {
    font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
    background: var(--night);
    color: var(--moon);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text
}

button {
    user-select: none;
    font-family: inherit
}

svg {
    display: block;
    flex-shrink: 0
}

.conn-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--moon-soft);
    background: var(--night-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    opacity: 0;
    transform: translateY(8px);
    transition: .25s;
    pointer-events: none;
    max-width: calc(100vw - 40px);
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif
}

.conn-bar.show {
    opacity: 1;
    transform: translateY(0)
}

.conn-bar.error {
    border-color: #c1272d;
    color: #e0353b
}

.conn-bar.warn {
    border-color: #c9a227;
    color: #c9a227
}

.conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5a8f6a;
    flex-shrink: 0
}

.conn-bar.error .conn-dot {
    background: #c1272d
}

.conn-bar.warn .conn-dot {
    background: #c9a227
}

.credit {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 16px;
    color: var(--moon-faint);
    opacity: .6;
    pointer-events: auto;
    transition: opacity .3s;
    letter-spacing: 1px;
    cursor: default
}

.credit:hover {
    opacity: 1
}

.credit svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: skewX(-20deg)
}

.layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh
}

.left {
    flex: 1;
    height: 100vh;
    height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--night)
}

.left-tabs {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    z-index: 10;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center
}

.left-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--moon-faint);
    font-size: 13px;
    cursor: pointer;
    transition: .2s;
    letter-spacing: 1px;
    white-space: nowrap;
    flex: 0 0 auto;
    line-height: 1
}

.left-tab svg {
    width: 14px;
    height: 14px
}

.left-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--night)
}

.left-tab:hover:not(.active) {
    color: var(--moon);
    border-color: var(--moon-soft)
}

.left-tab.info-tab {
    padding: 8px 0;
    width: 38px;
    min-width: 38px;
    max-width: 100%;
    min-height: 36px;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: width .35s ease, padding .35s ease, border-color .2s, background .2s
}

.left-tab.info-tab .info-i {
    font-size: 15px;
    font-weight: 600;
    font-style: italic;
    font-family: Georgia, serif;
    color: var(--moon-faint);
    transition: opacity .35s ease;
    flex-shrink: 0;
    opacity: 1;
    line-height: 1;
    align-self: center
}

.left-tab.info-tab:hover .info-i {
    color: var(--moon)
}

.left-tab.info-tab .info-text {
    font-size: 12px;
    color: var(--moon-soft);
    opacity: 0;
    transition: opacity .35s ease, width .35s ease;
    letter-spacing: .5px;
    white-space: nowrap;
    text-align: left;
    width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    align-self: center
}

.left-tab.info-tab.open {
    width: 300px;
    max-width: 100%;
    padding: 8px 16px 8px 0;
    border-color: var(--moon-soft);
    background: rgba(255, 255, 255, .04)
}

.left-tab.info-tab.open .info-i {
    opacity: 0
}

.left-tab.info-tab.open .info-text {
    opacity: 1;
    width: 248px;
    max-width: calc(100vw - 130px)
}

.fireworks-area {
    flex: 1;
    position: relative;
    cursor: crosshair;
    min-height: 0;
    background: var(--night)
}

#fireworks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.draw-area {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 30px 24px;
    overflow: hidden;
    min-height: 0
}

.draw-area.active {
    display: flex
}

.canvas-wrap {
    flex: 1 1 auto;
    width: 100%;
    max-width: 600px;
    min-height: 0;
    aspect-ratio: 1/1;
    max-height: 100%;
    border: 1px solid var(--accent-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #f5f2ec;
    position: relative;
    margin: 0 auto
}

#drawCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair
}

.draw-controls {
    flex: 0 0 auto;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px
}

.draw-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center
}

.draw-name {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--moon);
    font-size: 13px;
    outline: none;
    font-family: inherit
}

.draw-name:focus {
    border-color: var(--accent)
}

.draw-name::placeholder {
    color: var(--moon-faint)
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: .15s
}

.color-dot:hover {
    transform: scale(1.12)
}

.color-dot.active {
    border-color: var(--accent);
    transform: scale(1.12)
}

.brush-dot {
    border-radius: 50%;
    background: var(--moon-faint);
    cursor: pointer;
    transition: .15s
}

.brush-dot.active {
    background: var(--accent)
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--moon-soft);
    font-size: 13px;
    cursor: pointer;
    transition: .2s;
    letter-spacing: 1px
}

.tool-btn svg {
    width: 14px;
    height: 14px
}

.tool-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.tool-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--night)
}

.tool-btn.primary:hover {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: var(--night)
}

.tool-btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

.sidebar {
    width: 400px;
    height: 100vh;
    height: 100dvh;
    background: var(--night-2);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 2;
    min-height: 0
}

.side-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 10px 0;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    z-index: 3;
    background: var(--night-2)
}

.side-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: 13px;
    color: var(--moon-faint);
    cursor: pointer;
    transition: .2s;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    letter-spacing: 1px;
    border-radius: var(--r-sm) var(--r-sm) 0 0
}

.side-tab svg {
    width: 14px;
    height: 14px
}

.side-tab[data-panel="panelWish"].active {
    color: #d4a017;
    border-bottom-color: #d4a017;
    background: rgba(212, 160, 23, .08)
}

.side-tab[data-panel="panelAnti"].active {
    color: #e0353b;
    border-bottom-color: #c1272d;
    background: rgba(193, 39, 45, .1)
}

.side-tab[data-panel="panelGallery"].active {
    color: #9689c4;
    border-bottom-color: #7a6fa8;
    background: rgba(122, 111, 168, .1)
}

.side-tab:hover:not(.active) {
    color: var(--moon-soft)
}

.side-content {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--night-2);
    perspective: 1600px;
    perspective-origin: 50% 50%
}

.cube-stage {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1);
    transform: rotateY(0deg)
}

.panel {
    position: absolute;
    inset: 0;
    background: var(--night-2);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: pan-y
}

.panel[data-face="0"] {
    transform: rotateY(0deg) translateZ(var(--prism-r))
}

.panel[data-face="1"] {
    transform: rotateY(120deg) translateZ(var(--prism-r))
}

.panel[data-face="2"] {
    transform: rotateY(240deg) translateZ(var(--prism-r))
}

.panel-fixed {
    flex: 0 0 auto;
    padding: 36px 20px 8px;
    background: var(--night-2)
}

.panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    touch-action: pan-y
}

.panel-list::-webkit-scrollbar {
    width: 3px
}

.panel-list::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: var(--r-pill)
}

.title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 22px;
    margin: 4px 0 6px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--moon)
}

.title svg {
    width: 20px;
    height: 20px;
    color: var(--accent)
}

.subtitle {
    text-align: center;
    font-size: 12px;
    color: var(--moon-faint);
    margin-bottom: 22px;
    letter-spacing: 1px
}

.field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--moon);
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    transition: .2s;
    font-family: inherit
}

.field:focus {
    border-color: var(--accent);
    background: var(--accent-faint)
}

.field::placeholder {
    color: var(--moon-faint)
}

textarea.field {
    min-height: 80px;
    resize: none;
    font-size: 15px;
    line-height: 1.6
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    background: var(--accent);
    color: var(--night);
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
    margin-bottom: 12px;
    letter-spacing: 2px
}

.submit-btn svg {
    width: 15px;
    height: 15px
}

.submit-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-soft)
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.item {
    background: rgba(255, 255, 255, .02);
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line);
    border-radius: var(--r-md);
    transition: .2s;
    touch-action: pan-y
}

.item:hover {
    background: rgba(255, 255, 255, .04);
    border-left-color: var(--accent)
}

.item.pinned {
    background: var(--accent-dim);
    border-left-color: var(--accent)
}

.item .pin-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    background: var(--accent);
    color: var(--night);
    border-radius: var(--r-sm);
    margin-left: 6px;
    letter-spacing: 1px
}

.item .row-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px
}

.item .content {
    font-size: 14px;
    line-height: 1.7;
    word-break: break-all;
    flex: 1;
    min-width: 0;
    letter-spacing: .3px
}

.item .time {
    font-size: 11px;
    color: var(--moon-faint);
    flex-shrink: 0;
    padding-top: 3px
}

.item .row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.item .name {
    font-size: 12px;
    color: var(--moon-faint)
}

.empty {
    text-align: center;
    color: var(--moon-faint);
    font-size: 13px;
    margin-top: 30px
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    transition: .2s;
    font-size: 12px;
    user-select: none;
    color: var(--moon-faint);
    line-height: 1;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif
}

.like-btn:hover,
.like-btn.liked {
    border-color: var(--accent);
    color: var(--accent-soft)
}

.like-btn svg {
    width: 13px;
    height: 13px
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
}

.g-item {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--night-3);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: .2s;
    position: relative;
    touch-action: pan-y
}

.g-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px)
}

.g-item.pinned {
    border-color: var(--accent)
}

.g-item .pin-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    background: var(--accent);
    color: var(--night);
    border-radius: var(--r-sm);
    z-index: 2;
    letter-spacing: 1px
}

.g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none
}

.g-item .author {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 8px;
    background: linear-gradient(transparent, rgba(11, 18, 32, .85));
    font-size: 11px;
    text-align: right;
    pointer-events: none;
    color: var(--moon)
}

.g-item .like-btn {
    position: absolute;
    bottom: 26px;
    right: 6px;
    z-index: 3;
    background: var(--night-2)
}

.g-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px 20px;
    color: var(--moon-faint);
    font-size: 13px
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, .95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px
}

.lightbox.open {
    display: flex
}

.lb-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center
}

.lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    display: block;
    border: 1px solid rgba(232, 228, 216, .15);
    border-radius: var(--r-lg);
    pointer-events: none
}

.lb-author {
    margin-top: 14px;
    font-size: 13px;
    color: var(--moon-soft);
    letter-spacing: 1px
}

.lb-close {
    position: absolute;
    top: -36px;
    right: 0;
    background: transparent;
    border: none;
    color: var(--moon-faint);
    font-size: 26px;
    cursor: pointer;
    line-height: 1
}

.lb-close:hover {
    color: var(--moon)
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 9px 18px;
    background: var(--accent);
    color: var(--night);
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    letter-spacing: 1px;
    border-radius: var(--r-md)
}

.toast.show,
.toast.error {
    opacity: 1
}

.toast.error {
    background: #c1272d;
    color: var(--moon)
}

.author-popup {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, .85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 450;
    padding: 20px
}

.author-popup.open {
    display: flex
}

.author-popup-inner {
    max-width: 360px;
    width: 100%;
    background: var(--night-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px 22px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5)
}

.author-popup-inner h3 {
    font-size: 18px;
    letter-spacing: 4px;
    color: var(--moon);
    margin-bottom: 10px;
    font-weight: 600
}

.author-popup-inner p {
    font-size: 13px;
    color: var(--moon-soft);
    line-height: 1.8;
    letter-spacing: .5px
}

.author-popup-inner .author-line {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    font-size: 12px;
    color: var(--moon-faint);
    letter-spacing: 1px
}

.author-popup-close {
    margin-top: 18px;
    padding: 8px 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: transparent;
    color: var(--moon-soft);
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 1px;
    font-family: inherit
}

.author-popup-close:hover {
    border-color: var(--accent);
    color: var(--accent)
}

@media (max-width:900px) {
    :root {
        --prism-r: 14.43vw
    }

    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom)
    }

    .layout {
        flex-direction: column
    }

    .left {
        height: 50vh;
        height: 50dvh
    }

    .sidebar {
        width: 100%;
        height: 50vh;
        height: 50dvh;
        border-left: none;
        border-top: 1px solid var(--line)
    }

    .left-tabs {
        top: 10px;
        left: 10px;
        right: 10px;
        gap: 4px
    }

    .left-tab {
        padding: 5px 10px;
        min-height: 28px;
        font-size: 11px;
        gap: 4px
    }

    .left-tab svg {
        width: 11px;
        height: 11px
    }

    .left-tab.info-tab {
        width: 28px;
        min-width: 28px;
        min-height: 28px;
        padding: 5px 0
    }

    .left-tab.info-tab .info-i {
        font-size: 13px
    }

    .left-tab.info-tab.open {
        width: auto;
        max-width: calc(100vw - 20px)
    }

    .left-tab.info-tab.open .info-text {
        width: auto;
        max-width: calc(100vw - 90px);
        font-size: 11px
    }

    .draw-area {
        padding: 40px 6px 6px;
        justify-content: flex-start
    }

    .canvas-wrap {
        max-height: 34vh;
        max-height: 34dvh
    }

    .draw-controls {
        margin-top: 6px;
        gap: 6px
    }

    .draw-name {
        padding: 6px 9px;
        font-size: 11px
    }

    .color-dot {
        width: 18px;
        height: 18px
    }

    .tool-btn {
        padding: 5px 10px;
        font-size: 11px;
        gap: 4px
    }

    .tool-btn svg {
        width: 12px;
        height: 12px
    }

    .side-tabs {
        padding: 8px 8px 0;
        gap: 3px
    }

    .side-tab {
        padding: 7px 6px;
        font-size: 11px;
        gap: 4px
    }

    .side-tab svg {
        width: 12px;
        height: 12px
    }

    .panel-fixed {
        padding: 20px 12px 4px
    }

    .panel-list {
        padding: 0 12px 12px
    }

    .title {
        font-size: 16px;
        letter-spacing: 2px;
        gap: 5px;
        margin: 2px 0 4px
    }

    .title svg {
        width: 15px;
        height: 15px
    }

    .subtitle {
        font-size: 11px;
        margin-bottom: 10px
    }

    .field {
        padding: 7px 9px;
        font-size: 12px;
        margin-bottom: 7px
    }

    textarea.field {
        min-height: 50px;
        font-size: 13px
    }

    .submit-btn {
        padding: 8px;
        font-size: 12px;
        margin-bottom: 8px;
        letter-spacing: 1px
    }

    .submit-btn svg {
        width: 12px;
        height: 12px
    }

    .item {
        padding: 9px 11px;
        border-left-width: 2px
    }

    .item .content {
        font-size: 12px;
        line-height: 1.55
    }

    .item .time {
        font-size: 10px
    }

    .item .name {
        font-size: 11px
    }

    .item .pin-badge {
        font-size: 9px;
        padding: 1px 5px
    }

    .like-btn {
        padding: 2px 6px;
        font-size: 11px;
        gap: 3px
    }

    .like-btn svg {
        width: 11px;
        height: 11px
    }

    .list {
        gap: 6px
    }

    .gallery {
        gap: 6px
    }

    .g-item .author {
        font-size: 10px;
        padding: 3px 6px
    }

    .g-item .pin-badge {
        font-size: 9px;
        padding: 1px 5px;
        top: 4px;
        left: 4px
    }

    .g-item .like-btn {
        bottom: 20px;
        right: 4px
    }

    .g-empty,
    .empty {
        font-size: 12px;
        padding: 24px 12px;
        margin-top: 16px
    }

    .toast {
        top: auto;
        bottom: 60px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 11px;
        padding: 7px 14px
    }

    .conn-bar {
        bottom: 10px;
        left: 10px;
        right: 10px;
        justify-content: center;
        font-size: 11px;
        padding: 6px 10px
    }

    .credit {
        bottom: 6px;
        left: 8px;
        font-size: 11px;
        gap: 2px
    }

    .credit svg {
        width: 11px;
        height: 11px
    }

    .lb-content img {
        max-height: 75vh
    }

    .lb-author {
        font-size: 11px;
        margin-top: 10px
    }

    .lb-close {
        top: -30px;
        font-size: 22px
    }

    .author-popup-inner {
        padding: 20px 18px
    }

    .author-popup-inner h3 {
        font-size: 16px;
        letter-spacing: 3px
    }

    .author-popup-inner p {
        font-size: 12px
    }
}

@media (max-width:500px) {
    .left {
        height: 46vh;
        height: 46dvh
    }

    .sidebar {
        height: 54vh;
        height: 54dvh
    }

    .left-tabs {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 3px
    }

    .left-tab {
        padding: 4px 8px;
        min-height: 26px;
        font-size: 10px
    }

    .left-tab svg {
        width: 10px;
        height: 10px
    }

    .left-tab.info-tab {
        width: 26px;
        min-width: 26px;
        min-height: 26px;
        padding: 4px 0
    }

    .left-tab.info-tab .info-i {
        font-size: 12px
    }

    .left-tab.info-tab.open {
        width: auto;
        max-width: calc(100vw - 16px)
    }

    .left-tab.info-tab.open .info-text {
        width: auto;
        max-width: calc(100vw - 70px);
        font-size: 10px
    }

    .draw-area {
        padding: 36px 5px 5px
    }

    .canvas-wrap {
        max-height: 30vh;
        max-height: 30dvh
    }

    .tool-btn {
        padding: 4px 8px;
        font-size: 10px
    }

    .color-dot {
        width: 16px;
        height: 16px
    }

    .title {
        font-size: 14px;
        letter-spacing: 1px
    }

    .title svg {
        width: 13px;
        height: 13px
    }

    .panel-fixed {
        padding: 16px 10px 4px
    }

    .panel-list {
        padding: 0 10px 10px
    }

    .gallery {
        gap: 5px
    }

    .item {
        padding: 8px 10px
    }

    .item .content {
        font-size: 11px
    }

    .field {
        padding: 6px 8px;
        font-size: 11px
    }

    textarea.field {
        min-height: 44px;
        font-size: 12px
    }

    .submit-btn {
        padding: 7px;
        font-size: 11px
    }

    .side-tab {
        padding: 6px 5px;
        font-size: 10px
    }

    .side-tab svg {
        width: 11px;
        height: 11px
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --prism-r: 92px
    }

    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right)
    }

    .layout {
        flex-direction: row
    }

    .left {
        height: 100vh;
        height: 100dvh
    }

    .sidebar {
        width: 300px;
        height: 100vh;
        height: 100dvh;
        border-left: 1px solid var(--line);
        border-top: none
    }

    .left-tabs {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 4px
    }

    .left-tab {
        padding: 5px 10px;
        min-height: 26px;
        font-size: 11px
    }

    .left-tab.info-tab {
        width: 28px;
        min-width: 28px;
        min-height: 26px;
        padding: 5px 0
    }

    .left-tab.info-tab.open {
        flex-basis: 100%;
        width: auto;
        max-width: 100%;
        padding: 5px 10px 5px 0;
        order: 10
    }

    .left-tab.info-tab.open .info-text {
        width: auto;
        max-width: 100%;
        font-size: 11px
    }

    .draw-area {
        padding: 38px 10px 8px;
        justify-content: center
    }

    .canvas-wrap {
        max-height: 62vh;
        max-height: 62dvh;
        max-width: 100%
    }

    .draw-controls {
        margin-top: 5px;
        gap: 5px
    }

    .draw-name {
        padding: 5px 8px;
        font-size: 11px
    }

    .panel-fixed {
        padding: 16px 12px 4px
    }

    .panel-list {
        padding: 0 12px 10px
    }

    .title {
        font-size: 14px;
        letter-spacing: 2px;
        gap: 5px;
        margin: 2px 0 4px
    }

    .title svg {
        width: 13px;
        height: 13px
    }

    .subtitle {
        font-size: 10px;
        margin-bottom: 8px
    }

    .field {
        padding: 6px 9px;
        font-size: 12px;
        margin-bottom: 6px
    }

    textarea.field {
        min-height: 42px;
        font-size: 12px
    }

    .submit-btn {
        padding: 7px;
        font-size: 12px;
        margin-bottom: 8px
    }

    .item {
        padding: 8px 10px
    }

    .item .content {
        font-size: 12px
    }

    .gallery {
        gap: 6px
    }

    .side-tab {
        padding: 7px 6px;
        font-size: 11px
    }

    .side-tab svg {
        width: 12px;
        height: 12px
    }

    .toast {
        top: 10px;
        bottom: auto;
        left: auto;
        right: 10px;
        transform: none;
        font-size: 11px;
        padding: 6px 12px
    }

    .conn-bar {
        bottom: 10px;
        right: 10px;
        left: auto;
        justify-content: flex-end;
        font-size: 11px;
        padding: 6px 10px
    }

    .credit {
        bottom: 6px;
        left: 6px;
        font-size: 10px
    }

    .credit svg {
        width: 11px;
        height: 11px
    }
}