/* Gallery Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    color: #c0a96e;
}

/* 导航栏 */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c0a96e;
}

.navbar .nav-links {
    display: flex;
    gap: 2rem;
}

.navbar .nav-links a {
    color: #fff;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: #c0a96e;
}

/* 主容器 */
.container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 6rem 1rem 2rem;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    margin-right: 2rem;
    flex-shrink: 0;
}

.sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #c0a96e;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.sidebar-section {
    margin-bottom: 2rem;
}

/* 可折叠分类头 */
.sidebar-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

.sidebar-category-header:hover {
    background: #222;
    color: #c0a96e;
}

.sidebar-category-header.expanded {
    background: #222;
    color: #c0a96e;
}

.sidebar-category-header .toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.sidebar-category-header.expanded .toggle-icon {
    transform: rotate(90deg);
}

.sidebar-category-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 分类标签列表 */
.sidebar-category-items {
    display: none;
    padding-left: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-category-items.show {
    display: block;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0;
    color: #ccc;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #1a1a1a;
    color: #c0a96e;
}

/* 快速筛选链接（总是显示） */
.quick-filters .sidebar-link {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

/* 瀀布流网格 */
.gallery {
    flex: 1;
    column-count: 4;
    column-gap: 1rem;
}

.photo-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.photo-card:hover {
    transform: translateY(-5px);
}

.photo-card img {
    width: 100%;
    display: block;
}

.photo-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-card:hover .overlay {
    opacity: 1;
}

.photo-card .photographer {
    font-size: 0.85rem;
    color: #c0a96e;
}

.photo-card .exif {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    background: #1a1a1a;
    border-radius: 4px;
    color: #fff;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #c0a96e;
    color: #000;
}

.pagination .active {
    background: #c0a96e;
    color: #000;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    max-width: 800px;
}

.lightbox-info h2 {
    margin-bottom: 0.5rem;
    color: #c0a96e;
}

.lightbox-info .meta {
    color: #888;
    font-size: 0.9rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem;
    color: #666;
}

/* 响应式 */
@media (max-width: 1200px) {
    .gallery {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 2rem;
    }

    .gallery {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .gallery {
        column-count: 1;
    }
}
