/* 全局：去掉手机点击时的灰色高亮闪烁 */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 顶部固定返回栏 */
.back-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    z-index: 10;
    display: flex;
    /* 新增：左右两端布局 */
    justify-content: space-between;
    align-items: center;
}

.photo-count {
    color: lightskyblue;
    font-size: 13px;
    font-weight: bold;
}

.back-bar a {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    color: orange;
    font-weight: bold;
}

.back-bar img {
    width: 20px;
    height: 20px;
}

/* 画廊 grid：桌面自适应多列 */
.gallery-grid {
    margin-top: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 16px;
}

/* 画廊项 */
.gallery-item {
    cursor: pointer;
}

.thumb {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    display: block;
    border-radius: 4px 4px 0 0;
}

/* 浅绿色标题条 */
.title-bar {
    background: rgb(96, 113, 52);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 4px;
    text-align: left;
}

/* 浅橙色标签条，左右两文案 */
.tag-bar {
    background: rgb(242, 236, 221);
    padding: 4px 4px;
    display: flex;
    justify-content: space-between;
    border-radius: 0 0 4px 4px;
}

.tag-bar span {
    color: #6b3f1d;
    font-size: 13px;
}

/* 深棕色 */

/* 悬浮放大层：默认隐藏，加 .show 显示 */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 1);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lightbox.show {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    transition: opacity .2s;
}

/* 页面跳转 loading 遮罩 */
.page-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.page-loading.show {
    display: flex;
}

/* 转圈动画 */
.page-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #ddd;
    border-top-color: orange;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 2px;
    }

    .thumb {
        max-height: 80px;
    }
}