/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* ===== 顶部标题栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.logo {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    justify-content: center;
}
.nav-tabs .tab-item {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    background: transparent;
    color: #666;
    border: 1px solid transparent;
    user-select: none;
}
.nav-tabs .tab-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #333;
}
.nav-tabs .tab-item.active {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.25);
}

/* ===== 画廊主体 ===== */
.gallery {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

/* ===== 图片网格（大图） ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.image-grid .grid-item {
    overflow: hidden;
    border-radius: 12px;
    background: #f5f7fa;   /* 留白区域背景色（浅灰） */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s, box-shadow 0.25s;
    /* 去除 aspect-ratio，让高度由内容决定 */
}
.image-grid .grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}
.image-grid .grid-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* 图片完整显示，不裁剪，居中 */
    display: block;
    transition: transform 0.3s;
}
.image-grid .grid-item:hover img {
    transform: scale(1.03);
}
/* 图片文件名悬停显示（可选） */
/*
.image-grid .grid-item .img-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.image-grid .grid-item:hover .img-name {
    opacity: 1;
}
*/

/* ===== 分页控件 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.pagination button {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.pagination button:hover:not(:disabled) {
    background: #f0f3ff;
    border-color: #4a6cf7;
    color: #4a6cf7;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination #pageInfo {
    font-size: 14px;
    color: #555;
}
.pagination .jump-area {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
}
.pagination .jump-area input {
    width: 56px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}
.pagination .jump-area input:focus {
    border-color: #4a6cf7;
    outline: none;
}
.pagination .jump-area button {
    padding: 6px 14px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.pagination .jump-area button:hover {
    background: #3a5bd9;
}

/* 下载按钮 */
.grid-item .download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 18px;
    line-height: 38px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
    z-index: 2;
    user-select: none;
}
.grid-item .download-btn:hover {
    background: rgba(74, 108, 247, 0.92);
    color: #fff;
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.35);
}


/* ===== 图片模态框 ===== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    padding: 20px;
    box-sizing: border-box;
}
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.modal-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
}
.modal-download-btn {
    position: absolute;
    bottom: 20px;
    right: 24px;
    background: rgba(74, 108, 247, 0.92);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.35);
    transition: all 0.25s ease;
    z-index: 3;
}
.modal-download-btn:hover {
    background: #4a6cf7;
    transform: scale(1.05);
}


/* ===== 加载 & 空状态 ===== */
.loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 15px;
}
.empty-tip {
    text-align: center;
    padding: 60px 0;
    color: #bbb;
    font-size: 18px;
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .pagination {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    .pagination .jump-area {
        width: 100%;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}