/* ============================================================
   第三部分 · 光影群像（照片墙）— 对齐整合站视觉规范
   暖米白底 + 中国红 + 烫金 · 宋体标题 · 深红暗底灯箱
   变量继承自 style.css（--red/--gold/--paper/--mat/--muted/--line）
   ============================================================ */
:root { --card-w: 280px; }

.lm-wall {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--paper);
  padding: 32px 0 64px;
  user-select: none;
}

/* 每条流：章节小标（复用整合站 serif 语言） */
.lm-stream { margin-top: 40px; }
.lm-stream-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 14px; padding: 0 var(--pad,56px); margin-bottom: 22px; }
.lm-stream-head .s-no {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(24px,3.5vw,32px); font-weight: 700; color: var(--gold); letter-spacing: 2px;
}
.lm-stream-head .s-tag {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(22px,3vw,28px); font-weight: 700; color: var(--red); letter-spacing: 2px;
}
.lm-stream-head .s-tag-main, .lm-stream-head .s-tag-sub { display: inline; }
.lm-stream-head .s-tag-sep { display: inline; }
.lm-stream-head .s-name { font-size: 15px; color: var(--muted); letter-spacing: 1px; white-space: nowrap; }

/* 视口 + 箭头 */
.lm-viewport { position: relative; cursor: grab; }
.lm-viewport.dragging { cursor: grabbing; }
.lm-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: opacity .15s ease;
}
.lm-arrow:hover:not(:disabled) { opacity: .85; }
.lm-arrow svg { width: 20px; height: 20px; pointer-events: none; }
.lm-arrow.prev { left: 16px; background: rgba(255,255,255,.85); backdrop-filter: blur(6px); border: 1px solid var(--line); }
.lm-arrow.next { right: 16px; background: var(--red); }
.lm-arrow[disabled] { opacity: .25; cursor: default; pointer-events: none; }

/* 轨道：连续虚拟位置 + 取模回卷（由 wall.js 驱动 transform） */
.lm-track { position: relative; overflow: hidden; height: 460px; touch-action: pan-y pinch-zoom; }

/* 卡片：绝对定位，由 JS 取模排布 */
.lm-card {
  position: absolute; top: 0; left: 0; width: var(--card-w);
  display: flex; flex-direction: column; gap: 12px; will-change: transform;
}
.lm-photo {
  width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  background: var(--mat);
  box-shadow: 0 12px 30px rgba(142,20,25,.12);
  position: relative;
}
.lm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.lm-desc { font-size: 15px; line-height: 24px; color: var(--muted); white-space: pre-line; padding: 0 4px; }

/* ============ 灯箱（深红暗底，跟随整合站） ============ */
.lm-lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(43,20,25,.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.lm-lightbox.open { opacity: 1; visibility: visible; }
.lb-img-wrap {
  max-width: 84vw; max-height: 82vh; position: relative;
  background: var(--paper); padding: 18px; border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.lb-img-wrap img { max-width: 78vw; max-height: 74vh; object-fit: contain; display: block; border-radius: 6px; }
.lb-close {
  position: absolute; top: 20px; right: 28px; z-index: 10;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(200,164,92,.5); background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .18s ease;
}
.lb-close:hover { background: #fff; }
.lb-close svg { width: 18px; height: 18px; stroke: var(--red); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(200,164,92,.45); background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s ease;
}
.lb-nav:hover { background: #fff; }
.lb-nav.prev { left: 24px; }
.lb-nav.next { right: 24px; }
.lb-nav svg { width: 22px; height: 22px; stroke: var(--red); }
.lb-caption { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); text-align: center; z-index: 10; max-width: 86vw; }
.lb-caption h3 { font-family: "Songti SC", "SimSun", "Noto Serif SC", serif; font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.lb-caption p { font-size: 14px; color: #EDE3D2; line-height: 22px; }

/* 手机端由原生纵向滚动负责方向识别，照片墙只接管明确的横向手势。 */
@media (max-width: 640px) {
  .lm-stream-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 0 var(--pad,20px);
  }
  .lm-stream-head .s-tag { line-height: 1.35; letter-spacing: 1px; }
  .lm-stream-head .s-tag-main,
  .lm-stream-head .s-tag-sub { display: block; }
  .lm-stream-head .s-tag-sep { display: none; }
  .lm-stream-head .s-name { font-size: 14px; line-height: 1.4; letter-spacing: 0; padding-top: 2px; }

  .lm-arrow { display: none; }

  .lm-lightbox {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    padding: max(64px, calc(env(safe-area-inset-top) + 48px)) 16px calc(24px + env(safe-area-inset-bottom));
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  .lb-close {
    top: max(14px, calc(env(safe-area-inset-top) + 8px));
    right: max(14px, calc(env(safe-area-inset-right) + 8px));
    width: 42px; height: 42px;
  }
  .lb-img-wrap {
    width: 100%;
    max-width: calc(100vw - 152px);
    max-height: 58dvh;
    padding: 10px;
    border-radius: 12px;
    align-self: center;
    flex: 0 0 auto;
    touch-action: pan-y;
  }
  .lb-img-wrap img { width: 100%; max-width: 100%; max-height: 56dvh; border-radius: 5px; }
  .lb-nav {
    position: fixed;
    top: var(--lb-nav-top, 50%);
    width: 44px; height: 44px;
    transform: translateY(-50%);
  }
  .lb-nav.prev { left: max(12px, env(safe-area-inset-left)); }
  .lb-nav.next { right: max(12px, env(safe-area-inset-right)); }
  .lb-nav svg { width: 20px; height: 20px; }
  .lb-caption {
    position: static;
    transform: none;
    max-width: calc(100vw - 42px);
    margin: 16px auto 0;
  }
  .lb-caption p { font-size: 14px; line-height: 1.7; }
}

/* 整合站导航：兼容第三组（光影群像），允许整行换行避免溢出 1080 栏 */
.nav__inner { flex-wrap: wrap; row-gap: 8px; }
