* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #333;
}

/* 图片广告 */
.banner-ad {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px 0;
}

.banner-ad .banner-wrapper {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.banner-ad .banner-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-ad img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    padding: 40px 20px 15px;
    font-size: 1rem;
    text-align: center;
}

/* 文字广告 */
.text-ad {
    text-align: center;
    padding: 15px 40px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.text-ad div {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.text-ad .auto-link {
    color: #ff0000;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
}

.text-ad .auto-link:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* 滚动公告栏 */
.scrolling-bar {
    background: #111;
    color: #fff;
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
}

.scrolling-content {
    display: inline-block;
    padding-left: 100%;
    animation: scroll linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 极简头部 - 固定在顶部 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #eee;
    z-index: 100;
    height: 60px;
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 400;
    color: #111;
    letter-spacing: 0.5px;
}

/* 广告区域容器 */
.ads-container {
    padding-top: 60px;
}

/* 画廊容器 - 基础 */
.gallery-container {
    padding: 40px 40px 60px;
    max-width: 1800px;
    margin: 0 auto;
}

/* ==================== 相册列表样式 ==================== */

.albums-view {
    display: block;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.album-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.album-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-no-cover {
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.album-info {
    padding: 16px;
}

.album-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-count {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.album-description {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 相册详情样式 ==================== */

.album-detail-view {
    display: none;
}

.album-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #e8e8e8;
}

.album-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 4px;
}

.album-desc {
    font-size: 0.9rem;
    color: #888;
}

/* 相册详情照片网格布局 - 固定3列 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #e0e0e0;
    aspect-ratio: 1;
    border-radius: 8px;
}

.photo-item img,
.photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s, transform 0.3s;
}

.photo-item:hover img,
.photo-item:hover video {
    opacity: 0.9;
    transform: scale(1.02);
}

.photo-item.video::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid rgba(255,255,255,0.9);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    z-index: 2;
}

.photo-item.video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .gallery-container { padding-left: 20px; padding-right: 20px; }
    .header { padding: 18px 20px; }
    .banner-ad { padding: 15px 20px 0; }
    .text-ad { padding: 12px 20px; }
    .albums-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
    .photos-grid { gap: 12px; }
}

@media (max-width: 768px) {
    .photos-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 8px; 
    }
    .photo-item.video::before {
        border-left: 14px solid rgba(255,255,255,0.9);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }
    .photo-item.video::after {
        width: 36px;
        height: 36px;
    }
    .header { 
        padding: 12px 15px;
        height: 48px;
    }
    .header h1 {
        font-size: 1rem;
    }
    .ads-container {
        padding-top: 48px;
    }
    .banner-ad { padding: 10px; }
    .banner-ad .banner-image-wrapper { max-height: 200px; }
    .banner-text { font-size: 0.8rem; padding: 20px 15px 10px; }
    .text-ad { padding: 10px; }
    .text-ad div { font-size: 0.8rem; }
    .scrolling-bar { padding: 8px 0; font-size: 0.85rem; }
    .gallery-container { padding: 20px 10px 40px; }
    .albums-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .album-info { padding: 12px; }
    .album-name { font-size: 1rem; }
    .album-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .photos-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 4px; 
    }
    .photo-item {
        border-radius: 4px;
    }
    .gallery-container { padding-left: 8px; padding-right: 8px; }
    .banner-ad .banner-image-wrapper { max-height: 160px; }
    .albums-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* 加载和空状态 */
.loading, .empty {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 0.95rem;
    font-weight: 300;
}

/* 预览模态框 */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

.preview-modal.active {
    display: flex;
}

.close-preview {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    z-index: 301;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-preview:hover {
    opacity: 1;
}

.preview-content {
    max-width: 95%;
    max-height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 90vh;
    display: block;
}

/* 广告大图预览 */
.ad-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 500;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.ad-lightbox.active {
    display: flex;
}

.ad-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 501;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ad-lightbox-close:hover {
    opacity: 1;
}

.ad-lightbox-img {
    max-width: 95%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.ad-lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

.ad-lightbox-text {
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.ad-lightbox-link {
    display: inline-block;
    padding: 10px 28px;
    background: #fff;
    color: #111;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.ad-lightbox-link:hover {
    background: #f0f0f0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .close-preview {
        top: 15px;
        right: 20px;
        font-size: 1.8rem;
    }
    
    .ad-lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 2rem;
    }
    
    .ad-lightbox-img {
        max-width: 100%;
        padding: 0 10px;
    }
}
