/* gallery.css — 相册画廊 + lightbox */

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-item { margin: 0; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; background: var(--card-bg); border: 1px solid var(--card-border); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.18); }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; display: block; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption { padding: 8px 12px; font-size: 0.78rem; color: var(--text-soft); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center; z-index: 400; opacity: 0; visibility: hidden; transition: opacity 0.25s ease; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 86vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lb-cap { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 0.85rem; }
.lb-close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; opacity: 0.8; }
.lb-close:hover { opacity: 1; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 2.5rem; cursor: pointer; width: 56px; height: 56px; border-radius: 50%; line-height: 1; }
.lb-nav:hover { background: rgba(255,255,255,0.2); }
.lb-prev { left: 24px; } .lb-next { right: 24px; }

@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .lb-nav { width: 40px; height: 40px; font-size: 1.8rem; }
    .lb-prev { left: 8px; } .lb-next { right: 8px; }
}
