/* 夏日留言板 v3 - 图片灯箱、Toast 提示、页脚 */
/* ==================== ĺžççŻçŽą ==================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    /* 阻止滚动穿透与橡皮筋拉出黑边（第 30 条）。
       body 的锁定对触摸滚动并不总是有效，需要在弹层自身再拦一次。
       与心情弹层 10-mood-status.css:361 的处理保持一致。 */
    overscroll-behavior: contain;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-close svg,
.lightbox-nav svg {
    width: 22px;
    height: 22px;
}

.lightbox-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-nav:active {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    object-fit: contain;
    transition: transform 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-counter {
    position: absolute;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

/* çŻçŽąĺć˘ĺ¨çť */
.lightbox-content img.swiping-left {
    animation: swipeLeft 0.25s ease;
}
.lightbox-content img.swiping-right {
    animation: swipeRight 0.25s ease;
}

@keyframes swipeLeft {
    from { transform: translateX(50px); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes swipeRight {
    from { transform: translateX(-50px); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== Toast ćç¤ş ==================== */
.toast {
    position: fixed;
    /* 跟随头部实测高度，心情栏高度变化时不会被压在头部下面 */
    top: calc(var(--header-h, 156px) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    padding: 10px 22px;
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.35s var(--transition-spring);
    box-shadow: var(--shadow-card);
    pointer-events: none;
    white-space: nowrap;
}

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

.toast.success {
    background: rgba(77, 208, 225, 0.15);
    border-color: rgba(77, 208, 225, 0.25);
    color: var(--mdb-dark);
}

.toast.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #e74c3c;
}

.toast.info {
    background: rgba(100, 181, 246, 0.15);
    border-color: rgba(100, 181, 246, 0.25);
    color: #3498db;
}

/* ==================== éĄľč ==================== */
.footer {
    position: relative;
    padding: 24px 0 32px;
    text-align: center;
    z-index: 1;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }
}

.footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

