/* =========================================
   Mooe 相册通用样式 (合并版)
   包含：album.php (瀑布流) 和 favorites.php (网格)
   ========================================= */

/* -----------------------------------------
   1. 通用组件：灯箱 (Lightbox)
   ----------------------------------------- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
}

.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10000;
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

.lightbox-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 4px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* -----------------------------------------
   2. 通用组件：加载更多按钮
   ----------------------------------------- */
.more-photo-btn {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    background-color: #f8f8f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: border 0.3s ease, background-color 0.3s ease;
    border: 1px solid #e8e8e8;
}

.more-photo-btn:hover {
    border-color: #d0d0d0;
}

.more-photo-btn span {
    font-size: 1.2rem;
    color: #666;
    transition: color 0.3s ease;
}

.more-photo-btn span:last-child {
    font-size: 1rem;
}

/* -----------------------------------------
   3. 独立页面相册 (album.php) - 瀑布流布局
   ----------------------------------------- */
.waterfall-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.waterfall-item {
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    transition: border 0.3s ease;
    position: relative;
    cursor: pointer;
}

.waterfall-item:hover {
    border-color: #d0d0d0;
}

.waterfall-img {
    width: 100%;
    height: 180px;
    display: block;
    object-fit: cover;
}

/* 描述样式：共用 */
.waterfall-desc,
.thumbnail-desc {
    padding: 0.8rem;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    margin: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* -----------------------------------------
   4. 书签页面相册 (favorites.php) - 网格缩略图
   ----------------------------------------- */
.thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
    background-color: transparent; 
}

.thumbnail-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border 0.3s ease, background-color 0.3s ease;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    position: relative;
}

.thumbnail-item:hover {
    border-color: #d0d0d0;
}

.thumbnail-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* -----------------------------------------
   5. 移动端适配
   ----------------------------------------- */
@media screen and (max-width: 768px) {
    .lightbox-img {
        max-height: 70vh;
    }
    .more-photo-btn {
        height: 45px;
    }
}

/* -----------------------------------------
   6. 暗黑模式适配 (Dark Mode)
   ----------------------------------------- */
@media (prefers-color-scheme: dark) {
    /* 容器背景 */
    #photoAlbum, 
    #thumbnailContainer { 
        background-color: #1a1a1a; 
    }
    
    .thumbnail-container,
    .waterfall-container {
        background-color: #1a1a1a;
    }

    /* 分隔线与文字 */
    .friends-note1 ~ div hr {
        border-top-color: #444 !important;
    }
    .friends-note1 ~ div span {
        color: #e0e0e0 !important;
    }

    /* 卡片项 */
    .waterfall-item,
    .thumbnail-item {
        background-color: #2d2d2d !important;
        border-color: #333333 !important;
    }
    
    .waterfall-item:hover,
    .thumbnail-item:hover {
        border-color: #444444 !important;
    }

    /* 描述文字背景微调 */
    .waterfall-desc,
    .thumbnail-desc {
        color: #fff !important; 
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
        background-color: rgba(0, 0, 0, 0.3) !important; /* 加深一点 */
        backdrop-filter: blur(5px) !important;
        -webkit-backdrop-filter: blur(5px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    /* 按钮 */
    .more-photo-btn {
        background-color: #2d2d2d !important;
        border-color: #333333 !important;
    }
    .more-photo-btn:hover {
        border-color: #444444 !important;
    }
    .more-photo-btn span {
        color: #e0e0e0 !important;
    }

    /* 灯箱 */
    .lightbox {
        background-color: rgba(0,0,0,0.95) !important;
    }
    .lightbox-btn:hover {
        background-color: rgba(255,255,255,0.3) !important;
    }
    .close-btn:hover {
        color: #f0f0f0 !important;
    }
}