/* 照片模块：地图 + 缩略图瀑布流 + 大图灯箱（2026-11-16） */

/* ---- 地图页 ---- */
.photo-map-page .page-header { margin-bottom: 18px; }
#photo-map {
    width: 100%;
    height: calc(100vh - 170px);
    min-height: 520px;
    border: 1px solid #e8ddcc;
    border-radius: 14px;
    overflow: hidden;
    filter: sepia(.14) saturate(1.14) hue-rotate(-6deg);
    background: #f5efe4;
}
.photo-map-notice {
    padding: 26px 28px;
    background: #fffaf0;
    border: 1px solid #e8d5b8;
    border-left: 4px solid #e09015;
    border-radius: 12px;
    color: #6f5a45;
    line-height: 1.9;
}
.photo-map-notice code { background: #f2e7d6; padding: 1px 6px; border-radius: 4px; }

.album-pop {
    position: fixed;
    z-index: 80;
    display: none;
    width: 216px;
    background: #fffaf2;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(120, 80, 40, .22);
    border: 1px solid #f0dfc4;
    transform: translate(-50%, -100%);
    margin-top: -14px;
}
.album-pop.show { display: block; }
.album-pop img { width: 100%; height: 108px; object-fit: cover; display: block; background: #eee; }
.album-pop .meta { padding: 9px 12px 11px; }
.album-pop .t { font-size: 14px; font-weight: 500; color: #222; }
.album-pop .s { font-size: 12px; color: #999; margin-top: 2px; }
.album-pop .enter { font-size: 12px; color: #e09015; margin-top: 7px; }

/* ---- 相册页 ---- */
.photo-album-page .back-link { display: inline-block; margin-bottom: 14px; color: #c8811a; font-size: 14px; }
.photo-album-page .back-link:hover { text-decoration: underline; }
.album-intro {
    margin: 0 0 22px;
    padding: 14px 18px;
    max-width: 780px;
    background: #fffaf0;
    border: 1px solid #f0dfc4;
    border-left: 4px solid #e09015;
    border-radius: 12px;
    color: #7a6350;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-line;
}
.photo-empty {
    padding: 42px 20px;
    text-align: center;
    color: #9a8264;
    background: #fffaf0;
    border: 1px dashed #e0cdb0;
    border-radius: 12px;
}

/* 分区标题 */
.media-section { margin-top: 26px; }
.media-section:first-child { margin-top: 0; }
.media-section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid #f0dfc4;
    color: #6b5335; font-size: 16px; font-weight: 500;
}
.media-section-count {
    display: inline-block; min-width: 20px; padding: 1px 7px;
    background: #f6e7cc; border-radius: 10px;
    color: #a06a15; font-size: 12px; text-align: center;
}

/* 瀑布流：按图片真实宽高比显示，绝不拉伸 */
.media-grid { columns: 4 220px; column-gap: 14px; }
.media-grid figure {
    margin: 0 0 14px;
    break-inside: avoid;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f0e6d8;
    position: relative;
}
.media-grid figure:hover img,
.media-grid figure:hover .video-cover { filter: brightness(.94); }
.media-grid img { width: 100%; height: auto; display: block; transition: filter .18s; }
.media-grid .video-cover { width: 100%; display: block; position: relative; transition: filter .18s; }
.video-cover .play {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px;
    border: 2px solid rgba(255, 255, 255, .85);
}
.video-cover .dur {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0, 0, 0, .68); color: #fff;
    font-size: 11px; padding: 2px 6px; border-radius: 3px;
}
.video-badge {
    position: absolute; left: 8px; top: 8px;
    background: rgba(224, 144, 21, .92); color: #fff;
    font-size: 11px; padding: 2px 7px; border-radius: 3px;
}
.has-text {
    position: absolute; right: 8px; top: 8px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255, 250, 242, .94);
    color: #d08a17;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    pointer-events: none;
}
.cap-peek {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 30px 12px 12px;
    color: #fff8ee; font-size: 12px; line-height: 1.55;
    background: linear-gradient(180deg, rgba(60, 45, 30, 0) 0%, rgba(60, 45, 30, .84) 100%);
    opacity: 0; transition: opacity .2s; pointer-events: none;
}
.media-grid figure:hover .cap-peek { opacity: 1; }

/* ---- 大图灯箱 ---- */
.photo-lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .93);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox img { max-width: 92vw; max-height: 76vh; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.photo-lightbox video { max-width: 86vw; max-height: 74vh; border-radius: 4px; background: #111; }
.photo-lightbox .cap {
    max-width: min(680px, 88vw);
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.photo-lightbox .cap-text { color: #f0ece6; font-size: 15px; line-height: 1.75; }
.photo-lightbox .cap-meta { color: #a89e93; font-size: 12px; }
.photo-lightbox .cap-meta span { margin-right: 14px; }
.photo-lightbox .cap-meta strong { color: #d9b98a; font-weight: 500; }
.photo-lightbox .close {
    position: absolute; top: 22px; right: 28px;
    color: #fff; font-size: 30px; cursor: pointer; line-height: 1;
}
.photo-lightbox .nav {
    position: absolute; top: 50%;
    transform: translateY(-50%);
    color: #fff; font-size: 40px;
    cursor: pointer; user-select: none; opacity: .7;
}
.photo-lightbox .nav:hover { opacity: 1; }
.photo-lightbox .prev { left: 24px; }
.photo-lightbox .next { right: 24px; }

/* 触屏手势：图片/视频可被拖动，移动端用滑动取代左右箭头 */
.photo-lightbox img,
.photo-lightbox video {
    will-change: transform, opacity;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
@media (hover: none) and (pointer: coarse) {
    .photo-lightbox .nav { display: none; }
}
.video-stage {
    width: min(86vw, 1000px);
    aspect-ratio: 16 / 9;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #eee; gap: 16px;
}
.video-stage .big-play {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: 2px solid rgba(255, 255, 255, .6);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px;
}
.video-stage .vt { font-size: 16px; }
.video-stage .vh { font-size: 12px; color: #999; max-width: 70%; text-align: center; line-height: 1.8; }

@media (max-width: 640px) {
    #photo-map { height: calc(100vh - 150px); min-height: 420px; }
    .media-grid { columns: 2 140px; column-gap: 10px; }
    .media-grid figure { margin-bottom: 10px; }
    .photo-lightbox .prev { left: 8px; }
    .photo-lightbox .next { right: 8px; }
}
