/* ============================================
   Lei's Album - 前台样式表
   主色: #FFFFFF (白) | 辅色: #C4A265 (暖金)
   页脚: #2B2B2B (深炭灰) | 分区: #FAFAFA (极浅灰)
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-white: #FFFFFF;
    --color-gold: #C4A265;
    --color-gold-light: #D4B87A;
    --color-dark: #2B2B2B;
    --color-gray-light: #FAFAFA;
    --color-gray: #F0F0F0;
    --color-text: #333333;
    --color-text-light: #888888;
    --color-border: #E8E8E8;
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Header === */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-dark);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color var(--transition);
}

.site-logo:hover {
    color: var(--color-gold);
}

.site-nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-dark);
    border-bottom-color: var(--color-gold);
}

/* === Main Gallery === */
.gallery {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.gallery-empty {
    text-align: center;
    padding: 120px 20px;
    color: var(--color-text-light);
    font-size: 1.125rem;
}

/* === Masonry Grid === */
.masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    grid-auto-flow: dense;
}

.masonry-item {
    overflow: hidden;
}

.photo-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 2px;
    background: var(--color-gray-light);
}

.photo-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition), opacity 0.4s;
}

.photo-card:hover .photo-img {
    transform: scale(1.03);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-title {
    color: var(--color-white);
    font-size: 0.9rem;
    font-weight: 500;
}

.photo-album {
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === About Page === */
.page-about {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.about-content {
    max-width: 640px;
    text-align: center;
}

.about-content h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    color: var(--color-dark);
    margin-bottom: 32px;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 2;
}

.about-intro {
    font-size: 1.125rem;
    color: var(--color-text-light);
}

.about-contact {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.about-contact a {
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 500;
}

.about-contact a:hover {
    color: var(--color-gold-light);
}

/* === Lightbox === */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 4px 40px rgba(0,0,0,0.3);
}

.lightbox-caption {
    color: rgba(255,255,255,0.8);
    margin-top: 16px;
    font-size: 0.9rem;
    text-align: center;
    max-width: 80vw;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 2001;
    transition: color var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--color-white);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 2rem;
    cursor: pointer;
    padding: 16px;
    transition: color var(--transition);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--color-white);
}

/* === Footer === */
.site-footer {
    background: var(--color-dark);
    padding: 20px 0;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.footer-copy {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.footer-beian {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

.footer-beian a {
    color: var(--color-gold);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.footer-beian a:hover {
    color: var(--color-gold-light);
    text-decoration: underline;
}

/* ============================================
   响应式布局
   ============================================ */

/* --- 平板（≤1024px）--- */
@media (max-width: 1024px) {
    .masonry { grid-template-columns: repeat(2, 1fr); }
    .gallery { padding: 24px; }
    .header-inner { padding: 0 24px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* --- 手机横屏 / 小平板（≤768px）--- */
@media (max-width: 768px) {
    .header-inner { padding: 0 20px; height: 60px; }
    .site-logo { font-size: 1.25rem; }
    .site-nav { gap: 20px; }
    .nav-link { font-size: 0.8rem; letter-spacing: 1px; }

    .gallery { padding: 16px; }
    .masonry { gap: 12px; }

    .lightbox-img { max-width: 95vw; max-height: 75vh; }
    .lightbox-close { top: 12px; right: 16px; font-size: 2rem; }
    .lightbox-prev, .lightbox-next { font-size: 1.5rem; padding: 10px; }
    .lightbox-caption { font-size: 0.8rem; max-width: 90vw; }
}

/* --- 手机竖屏（≤480px）--- */
@media (max-width: 480px) {
    .masonry { grid-template-columns: 1fr; gap: 10px; }
    .gallery { padding: 12px; }

    .header-inner { padding: 0 16px; height: 56px; }
    .site-logo { font-size: 1.15rem; }
    .site-nav { gap: 16px; }
    .nav-link {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        padding: 6px 0;
    }

    /* 灯箱更友好的触控体验 */
    .lightbox-img { max-width: 98vw; max-height: 70vh; }
    .lightbox-close {
        top: 10px; right: 10px;
        font-size: 1.75rem;
        width: 44px; height: 44px;
        display: flex; align-items: center; justify-content: center;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 1.25rem;
        padding: 14px 8px;
    }
    .lightbox-prev { left: 2px; }
    .lightbox-next { right: 2px; }

    /* 关闭 hover 缩放效果（触屏无意义） */
    .photo-card:hover .photo-img { transform: none; }
    .photo-card:active .photo-img { transform: scale(1.02); }
    .photo-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
        padding: 12px;
    }
    .photo-title { font-size: 0.8rem; }
    .photo-album { font-size: 0.7rem; }

    /* 页脚 */
    .footer-inner { padding: 0 16px; }
    .footer-copy { font-size: 0.7rem; }
    .footer-beian, .footer-beian a { font-size: 0.7rem; }
}

/* --- 极小屏（≤360px）--- */
@media (max-width: 360px) {
    .header-inner { padding: 0 12px; height: 52px; }
    .site-logo { font-size: 1.05rem; }
    .site-nav { gap: 12px; }
    .nav-link { font-size: 0.7rem; }

    .gallery { padding: 8px; }
    .masonry { gap: 8px; }

    .site-footer { padding: 14px 0; }
    .footer-copy, .footer-beian, .footer-beian a { font-size: 0.65rem; }
}
