* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 30px 20px 10px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 20px;
    border: 1px solid #444;
    background: transparent;
    color: #aaa;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab:hover {
    border-color: #888;
    color: #fff;
}

.tab.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery.hidden {
    display: none;
}

/* 9:14 图片比例 + 高清渲染 */
.gallery-item {
    position: relative;
    aspect-ratio: 9 / 14;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #1a1a1a;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    /* 高清抗模糊 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.badge.wushuang { background: rgba(255, 50, 50, 0.85); }
.badge.jingpin { background: rgba(50, 150, 255, 0.85); }
.badge.chouxiang { background: rgba(150, 50, 255, 0.85); }

/* 灯箱样式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox.hidden {
    display: none;
}

.lightbox img {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    /* 大图高清优化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2.5rem;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

#prev-btn { left: 15px; }
#next-btn { right: 15px; }

.lb-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px;
    border-radius: 12px;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
        padding: 12px;
    }
}