/* ==================== 基础重置 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #0d0d0d;
    color: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* ==================== 欢迎弹窗 ==================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.welcome-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.welcome-title {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.welcome-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    font-size: 15px;
    color: #ccc;
    margin-bottom: 32px;
}

.enter-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #0d0d0d;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.enter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

.enter-btn:active {
    transform: translateY(0);
}

/* ==================== 音乐控制面板 ==================== */
.music-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.music-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.music-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: background 0.2s ease, color 0.2s ease;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.volume-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.music-panel:hover .volume-wrap,
.music-panel:focus-within .volume-wrap {
    width: 90px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    margin: 0 5px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

/* ==================== 页面头部 ==================== */
.site-header {
    padding: 120px 20px 60px;
    text-align: center;
}

.site-title {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 12px;
    margin-bottom: 12px;
}

.site-desc {
    font-size: 14px;
    color: #777;
    letter-spacing: 3px;
}

/* ==================== 照片墙 ==================== */
.gallery-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 120px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1400px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    }
}

.photo-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    cursor: pointer;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

.photo-item.loaded {
    transform: translateY(0);
    opacity: 1;
}

.photo-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.4s ease;
    opacity: 0;
}

.photo-item img.lazyloaded {
    opacity: 1;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, #1a1a1a 8%, #252525 18%, #1a1a1a 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.photo-item.loaded .photo-placeholder {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.empty-state p:first-child {
    font-size: 18px;
    margin-bottom: 12px;
    color: #999;
}

.empty-tip {
    font-size: 13px;
}

/* ==================== 灯箱 ==================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 60px;
    overflow: hidden;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-img.zoomed {
    transition: transform 0.3s ease;
    cursor: grab;
}

.lightbox-img.zoomed:active {
    cursor: grabbing;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

.lightbox-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ddd;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.zoom-level,
.image-counter {
    font-size: 13px;
    color: #aaa;
    min-width: 46px;
    text-align: center;
}

/* ==================== 页脚 ==================== */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 14px 20px;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.site-footer p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    letter-spacing: 1px;
}

.beian-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    opacity: 0.8;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 767px) {
    .site-header {
        padding: 100px 16px 40px;
    }

    .site-title {
        font-size: 28px;
        letter-spacing: 8px;
    }

    .site-desc {
        font-size: 12px;
    }

    .gallery-wrap {
        padding: 0 12px 100px;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .music-panel {
        top: 12px;
        right: 12px;
    }

    .volume-wrap {
        display: none;
    }

    .lightbox-stage {
        padding: 70px 10px 90px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-toolbar {
        gap: 8px;
        padding: 8px 14px;
    }

    .welcome-content {
        padding: 36px 28px;
    }

    .welcome-title {
        font-size: 24px;
    }

    .site-footer p {
        font-size: 11px;
        letter-spacing: 0;
    }
}

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