* { box-sizing: border-box; }
body { margin: 0; background: #f0f4f8; color: #2c3e50; font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif; }
.gallery-header { display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px; background: #fff; border-bottom: 1px solid #dce4eb; }
.gallery-header a { color: #4a6d8c; text-decoration: none; }
.gallery-header span { color: #5a707d; }
.gallery-main { max-width: 1160px; margin: 0 auto; padding: 32px 24px 48px; min-height: calc(100vh - 180px); }
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.gallery-tabs a { padding: 9px 22px; border-radius: 24px; color: #4a6d8c; background: #fff; text-decoration: none; border: 1px solid #cbd8e2; }
.gallery-tabs a[aria-current='page'] { background: #4a6d8c; color: #fff; border-color: #4a6d8c; }
h1 { font-size: 30px; margin: 0 0 10px; color: #4a6d8c; }
.gallery-description { color: #5a707d; line-height: 1.8; margin: 0 0 24px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.gallery-card { display: block; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: #fff; color: #2c3e50; font: inherit; text-align: left; cursor: zoom-in; box-shadow: 0 3px 15px #4a6d8c12; transition: transform .2s, box-shadow .2s; }
.gallery-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-card span { display: block; padding: 14px 16px; }
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 7px 22px #4a6d8c24; }
.gallery-card:focus-visible, .gallery-tabs a:focus-visible, .gallery-header a:focus-visible { outline: 3px solid #4a6d8c; outline-offset: 4px; }
.photo-viewer { width: min(1200px, 96vw); max-width: 96vw; max-height: 94vh; padding: 52px 16px 16px; border: 0; border-radius: 12px; background: #15212d; color: #fff; }
.photo-viewer::backdrop { background: #000d; }
.photo-viewer figure { margin: 0; text-align: center; }
.photo-viewer__image { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.photo-viewer figcaption { padding: 12px 0 0; line-height: 1.6; }
.photo-viewer__close { position: absolute; top: 10px; right: 12px; padding: 8px 16px; border: 1px solid #fff8; border-radius: 6px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
.photo-viewer__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 600px) {
    .gallery-header { padding: 16px; }
    .gallery-main { padding: 24px 16px 36px; }
    .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
    .gallery-tabs a { padding: 8px 20px; }
    h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .gallery-card { transition: none; } }

.gallery-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 300px; padding: 32px 20px; border: 1px dashed #b8cbd9; border-radius: 14px; background: #ffffffaa; text-align: center; }
.gallery-empty__icon { font-size: 44px; }
.gallery-empty h2 { margin: 0; color: #4a6d8c; font-size: 22px; }
.gallery-empty p { margin: 0; color: #5a707d; line-height: 1.8; }
