/* ========== 相册列表页 ========== */

.albums-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 20px;
}

.albums-header {
    text-align: center;
    margin-bottom: 40px;
}

.albums-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.albums-header p {
    color: #666;
    font-size: 14px;
}

/* 相册网格 */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .albums-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .albums-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .albums-grid {
        grid-template-columns: 1fr;
    }
}

/* 相册卡片 */
.album-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.album-cover {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.album-cover-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.album-info {
    padding: 15px;
}

.album-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.album-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.album-locked {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

/* ========== 相册详情页（瀑布流） ========== */

.album-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 20px;
}

.album-detail-header {
    margin-bottom: 30px;
}

.album-detail-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.album-detail-header p {
    color: #666;
    font-size: 14px;
}

/* 分类区块 */
.photo-category-section {
    margin-bottom: 40px;
}

.photo-category-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1890ff;
}

/* 照片信息 */
.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-card:hover .photo-info {
    opacity: 1;
}

/* 推荐标识 */
.photo-recommended-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4d4f;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 瀑布流布局 */
.masonry-grid {
    column-count: 4;
    column-gap: 15px;
}

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.masonry-item:hover {
    transform: scale(1.02);
}

.photo-card {
    position: relative;
}

.photo-thumbnail {
    width: 100%;
    display: block;
    background: #f5f5f5;
    transition: opacity 0.5s ease;
}

/* 渐进式加载 - 模糊效果 */
.photo-thumbnail.blur {
    filter: blur(20px);
    opacity: 0.8;
}

.photo-thumbnail.sharp {
    filter: blur(0);
    opacity: 1;
}

.photo-placeholder {
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========== 灯箱 ========== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

/* 渐进式加载效果 */
.lightbox-image.loading {
    opacity: 0.3;
    filter: blur(30px);
}

.lightbox-image.loaded {
    opacity: 1;
    filter: blur(0);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

.lightbox-info {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.lightbox-actions {
    position: absolute;
    top: -40px;
    left: 0;
    display: flex;
    gap: 10px;
}

.lightbox-action {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.lightbox-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 密码验证弹窗 ========== */

.album-verify-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-verify-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.album-verify-box h2 {
    margin-bottom: 10px;
    color: #333;
}

.album-verify-box p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.album-verify-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.album-verify-box input:focus {
    outline: none;
    border-color: #1890ff;
}

.album-verify-box button {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.album-verify-box button:hover {
    background: #40a9ff;
}

.album-verify-error {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 10px;
}

/* ========== 后台管理样式 ========== */

.admin-albums-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 20px;
}

.admin-albums-header .back-link {
    display: inline-block;
    color: #1890ff;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.admin-albums-header .back-link:hover {
    color: #40a9ff;
}

.admin-albums-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.admin-album-create-btn {
    padding: 10px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.admin-album-create-btn:hover {
    background: #40a9ff;
}

.admin-albums-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-albums-table th,
.admin-albums-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-albums-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.admin-albums-table td {
    color: #666;
}

.admin-album-cover {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-album-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.admin-album-status.public {
    background: #e6f7ff;
    color: #1890ff;
}

.admin-album-status.password {
    background: #fff7e6;
    color: #fa8c16;
}

.admin-album-status.private {
    background: #f5f5f5;
    color: #8c8c8c;
}

.admin-album-actions {
    display: flex;
    gap: 10px;
}

.admin-album-actions a,
.admin-album-actions button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.admin-album-actions .btn-enter {
    background: #1890ff;
    color: #fff;
}

.admin-album-actions .btn-edit {
    background: #f0f0f0;
    color: #666;
}

.admin-album-actions .btn-delete {
    background: #fff1f0;
    color: #ff4d4f;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: #1890ff;
}

.upload-area-icon {
    font-size: 48px;
    color: #1890ff;
    margin-bottom: 10px;
}

.upload-area-text {
    color: #666;
    font-size: 14px;
}

.upload-area-hint {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* 照片管理网格 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

@media (max-width: 1200px) {
    .photos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.photo-item .img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
}

.photo-item:hover .photo-item-actions {
    opacity: 1;
}

.photo-item-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.photo-item-actions .btn-cover {
    background: #1890ff;
    color: #fff;
}

.photo-item-actions .btn-delete {
    background: #ff4d4f;
    color: #fff;
}
