/* ==========================================================================
   1. 基础重置 & 全局背景系统 (继承主页)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f4f0;
    font-family: 'Arial', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333333;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* 粒子细微网格背景 */
    background-image: radial-gradient(rgba(0,0,0,.015) 1px, transparent 1px);
    background-size: 4px 4px;
}

/* 🎯 继承：ARCHIVES 巨大浅红水印大字 */
body::before {
    content: "MEME";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16vw;
    font-weight: 900;
    color: #e53935;
    opacity: .025;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ==========================================================================
   2. 极其丝滑的返回按钮
   ========================================================================== */
.back-home-btn {
    position: fixed;
    top: 24px;
    left: auto;
    right: 24px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(248, 244, 240, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(194, 24, 7, 0.15);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #c21807;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
text-align: right;
}

.back-home-btn:hover {
    background: #e53935;
    color: #ffffff;
    border-color: #e53935;
    transform: translateX(-4px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.15);
}

.back-icon {
    font-size: 16px;
}

/* ==========================================================================
   3. 页面骨架与标题组件
   ========================================================================== */
.gallery-page-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 110px 24px 80px 24px; /* 顶部留足返回按钮空间 */
    position: relative;
    z-index: 1;
}

.gallery-page-header {
    border-bottom: 2px solid rgba(194, 24, 7, 0.15);
    padding-bottom: 16px;
    margin-bottom: 32px;
}

.gallery-page-header h1 {
    font-size: 26px;
    color: #c21807;
    letter-spacing: 2px;
}

.en-title {
    font-size: 18px;
    color: #99867a;
    font-weight: 700;
}

.gallery-page-desc {
    font-size: 13px;
    color: #7a6e67;
    margin-top: 6px;
}

/* ==========================================================================
   4. ⚡ 纯 CSS 高性能瀑布流核心控制流
   ========================================================================== */
.waterfall-grid {
    /* 默认移动端：1列 */
    column-count: 1;
    column-gap: 20px;
    width: 100%;
}

.waterfall-item {
    break-inside: avoid; /* 绝不允许卡片在中间断开流转 */
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.waterfall-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(194, 24, 7, 0.06);
}

.waterfall-img-box {
    position: relative;
    width: 100%;
    cursor: pointer;
    background: #1c1714;
    display: block;
    overflow: hidden;
}

.waterfall-img-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.waterfall-item:hover .waterfall-img-box img {
    transform: scale(1.03);
}

/* 遮罩悬浮层 */
.waterfall-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(194, 24, 7, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.waterfall-img-box:hover .waterfall-overlay {
    opacity: 1;
}

.view-tag {
    color: #fff;
    background: #c21807;
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 卡片文字信息 */
.waterfall-info {
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.02);
}

.waterfall-info h4 {
    font-size: 14px;
    color: #222;
    margin-bottom: 4px;
}

.waterfall-info .author {
    font-size: 12px;
    color: #baa79c;
}

/* ==========================================================================
   5. 灯箱弹窗 (Lightbox)
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(13, 13, 13, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: galleryZoom 0.25s ease-out;
}

@keyframes galleryZoom {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 24px; right: 32px;
    color: #baa79c;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #fff; }

.lightbox-caption {
    margin-top: 16px;
    color: #baa79c;
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
}

/* ==========================================================================
   6. 🧱 页脚与彩蛋 (完全一致)
   ========================================================================== */
.main-footer {
    background-color: #f8f4f0; 
    width: 100%;
    padding: 40px 0 60px 0; 
    border-top: 1px solid rgba(194, 24, 7, 0.05);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;         
    flex-wrap: wrap;               
    gap: 24px;
    max-width: 1300px;             
    padding: 0 40px;
    margin: 0 auto;                
}

.footer-text {
    flex: 1;
    min-width: 300px;              
}

.footer-text p {
    text-align: left;              
    margin: 4px 0;                 
    font-size: 12px;               
    color: #333333;                
}

.main-footer .social-links {
    display: flex;
    justify-content: flex-end;     
    margin-top: 0 !important;      
    flex-shrink: 0;                
}

.dc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #e53935; 
    color: #ffffff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.2);
    transition: all 0.3s ease;
}

.dc-btn:hover {
    background-color: #c21807; 
    box-shadow: 0 6px 20px rgba(194, 24, 7, 0.4);
    transform: translateY(-2px);
}

.hidden-egg-link {
    color: #baa79c;
    text-decoration: none;
    font-size: 10px;
    margin: 0 4px;
    cursor: default;
    transition: color 0.3s;
}
.hidden-egg-link:hover { color: #c21807; }

/* ==========================================================================
   7. 📱 响应式平板与大屏手机适配断点
   ========================================================================== */
/* 平板端 (两列瀑布流) */
@media (min-width: 600px) {
    .waterfall-grid {
        column-count: 2;
        column-gap: 24px;
    }
    .gallery-page-container {
        padding: 120px 40px 80px 40px;
    }
}

/* 电脑PC大屏端 (三列瀑布流) */
@media (min-width: 1024px) {
    .waterfall-grid {
        column-count: 3;
        column-gap: 28px;
    }
    .gallery-page-header h1 {
        font-size: 32px;
    }
}