/* ============================================================
   Kaze 主题 · 摄影展 v2（横向沉浸式胶片带）
   设计目标：暗房般的沉浸式观展体验，独立于主站风格。
   ============================================================ */

:root {
  /* 色彩系统 - 暗色为主 */
  --pe-bg: #0f0f0f;
  --pe-surface: #141414;
  --pe-film: #000000;
  --pe-text: #f5f2eb;
  --pe-text-muted: #9a9a9a;
  --pe-text-dim: #5a5a5a;
  --pe-border: rgba(255, 255, 255, 0.08);
  --pe-border-strong: rgba(255, 255, 255, 0.16);
  --pe-accent: #c9a15a;
  --pe-accent-soft: rgba(201, 161, 90, 0.15);

  /* 类型标签色 */
  --pe-type-portrait: #8b6f5c;
  --pe-type-landscape: #5c7a8b;
  --pe-type-humanity: #8b8b7a;
  --pe-type-urban: #6b6b7a;
  --pe-type-other: #7a7a7a;

  /* 字体 */
  --pe-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --pe-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pe-mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;

  /* 尺寸 */
  --pe-header-h: 56px;
  --pe-info-w: 280px;
  --pe-frame-gap: 32px;
  --pe-frame-w: 52vw;
  --pe-frame-h: 68vh;
  --pe-radius: 12px;
  --pe-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 色彩模式（替换原来的 light/dark 切换） ---------- */
.pe-theme-warm {
  --pe-bg: #18120f;
  --pe-surface: #1f1712;
  --pe-film: #0c0907;
  --pe-text: #f0e6db;
  --pe-text-muted: #a89484;
  --pe-text-dim: #6b5d52;
  --pe-border: rgba(255, 220, 180, 0.10);
  --pe-border-strong: rgba(255, 220, 180, 0.20);
  --pe-accent: #d4a574;
}

.pe-theme-cool {
  --pe-bg: #0d1216;
  --pe-surface: #121a20;
  --pe-film: #070a0c;
  --pe-text: #e2eef5;
  --pe-text-muted: #8ba3b0;
  --pe-text-dim: #52646e;
  --pe-border: rgba(160, 200, 220, 0.10);
  --pe-border-strong: rgba(160, 200, 220, 0.20);
  --pe-accent: #7fb3c9;
}

.pe-theme-mono {
  --pe-bg: #111111;
  --pe-surface: #1a1a1a;
  --pe-film: #000000;
  --pe-text: #eeeeee;
  --pe-text-muted: #888888;
  --pe-text-dim: #555555;
  --pe-border: rgba(255, 255, 255, 0.10);
  --pe-border-strong: rgba(255, 255, 255, 0.22);
  --pe-accent: #cccccc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.pe-body {
  background: var(--pe-bg);
  color: var(--pe-text);
  font-family: var(--pe-sans);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--pe-info-w) 1fr;
  grid-template-rows: var(--pe-header-h) 1fr auto;
  grid-template-areas:
    "header header"
    "info stage"
    "footer footer";
}

/* ---------- 顶部导航 ---------- */
.pe-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--pe-border);
  z-index: 100;
  background: var(--pe-bg);
}

.pe-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pe-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.25s var(--pe-ease);
}

.pe-back:hover {
  color: var(--pe-text);
}

.pe-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--pe-border);
  background: transparent;
  color: var(--pe-text-muted);
  cursor: pointer;
  transition: all 0.25s var(--pe-ease);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.pe-theme-toggle:hover {
  border-color: var(--pe-border-strong);
  color: var(--pe-text);
}

.pe-icon-palette {
  display: block;
}

.pe-theme-label {
  display: inline;
}

@media (max-width: 768px) {
  .pe-theme-label {
    display: none;
  }
  .pe-theme-toggle {
    padding: 0;
    width: 36px;
  }
}

/* ---------- 左侧信息区 ---------- */
.pe-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 36px;
  border-right: 1px solid var(--pe-border);
  background: var(--pe-surface);
  z-index: 50;
}

.pe-title {
  font-family: var(--pe-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}

.pe-intro {
  color: var(--pe-text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 32px;
  max-width: 220px;
}

.pe-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.pe-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pe-stat-num {
  font-family: var(--pe-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--pe-text);
  font-variant-numeric: tabular-nums;
}

.pe-stat-label {
  font-size: 12px;
  color: var(--pe-text-dim);
  letter-spacing: 0.05em;
}

.pe-sort {
  margin-bottom: 20px;
}

.pe-sort label {
  display: block;
  font-size: 11px;
  color: var(--pe-text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.pe-sort-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--pe-border);
  background: var(--pe-bg);
  color: var(--pe-text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.pe-sort-select:focus {
  border-color: var(--pe-border-strong);
}

.pe-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.pe-filter-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--pe-border);
  background: transparent;
  color: var(--pe-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--pe-ease);
}

.pe-filter-btn:hover {
  border-color: var(--pe-border-strong);
  color: var(--pe-text);
}

.pe-filter-btn.active {
  background: var(--pe-text);
  color: var(--pe-bg);
  border-color: var(--pe-text);
}

.pe-hint {
  font-size: 12px;
  color: var(--pe-text-dim);
  letter-spacing: 0.1em;
  margin: 0;
  animation: pePulseHint 2.5s ease-in-out infinite;
}

@keyframes pePulseHint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---------- 中央胶片带 ---------- */
.pe-stage {
  grid-area: stage;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--pe-bg);
}

.pe-film-track {
  display: flex;
  align-items: center;
  gap: var(--pe-frame-gap);
  width: 100%;
  height: 100%;
  padding: 0 calc((100% - var(--pe-frame-w)) / 2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.pe-film-track::-webkit-scrollbar {
  display: none;
}

.pe-film-track:focus {
  outline: none;
}

/* ---------- 胶片帧 ---------- */
.pe-frame {
  flex: 0 0 auto;
  width: var(--pe-frame-w);
  height: var(--pe-frame-h);
  scroll-snap-align: center;
  opacity: 0.55;
  transform: scale(0.94);
  contain: layout style paint;
  transition:
    opacity 0.5s var(--pe-ease),
    transform 0.5s var(--pe-ease);
}

.pe-frame.active {
  opacity: 1;
  transform: scale(1);
  will-change: transform;
}

.pe-frame-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.pe-frame-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--pe-film);
  border-radius: var(--pe-radius);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--pe-border);
  transition: border-color 0.3s var(--pe-ease);
}

.pe-frame.active .pe-frame-inner {
  border-color: var(--pe-border-strong);
}

/* 齿孔 */
.pe-frame-sprockets {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.pe-frame-sprockets span {
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: var(--pe-surface);
  border: 1px solid var(--pe-border);
}

.pe-frame-sprockets--bottom {
  margin-top: auto;
}

/* 图片区域 */
.pe-frame-media {
  position: relative;
  flex: 1;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--pe-surface);
}

.pe-frame-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, var(--pe-surface) 8%, rgba(255, 255, 255, 0.04) 18%, var(--pe-surface) 33%);
  background-size: 200% 100%;
  animation: pe-shimmer 1.4s linear infinite;
  z-index: 0;
  pointer-events: none;
}

.pe-frame-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  transition: transform 0.8s var(--pe-ease), opacity 0.4s var(--pe-ease);
  opacity: 0;
}

.pe-frame-img[loaded="true"],
.pe-frame-img[src] {
  opacity: 1;
}

.pe-frame-media:has(.pe-frame-img[src])::before {
  animation: none;
  opacity: 0;
}

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

.pe-frame-link:hover .pe-frame-img {
  transform: scale(1.04);
}

.pe-frame-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pe-text-dim);
}

.pe-frame-placeholder svg {
  width: 48px;
  height: 48px;
}

.pe-frame-type {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5;
}

.pe-frame-type--portrait { background: var(--pe-type-portrait); }
.pe-frame-type--landscape { background: var(--pe-type-landscape); }
.pe-frame-type--humanity { background: var(--pe-type-humanity); }
.pe-frame-type--urban { background: var(--pe-type-urban); }
.pe-frame-type--other { background: var(--pe-type-other); }

/* 信息浮层：确保位于图片之上，不被照片遮挡 */
.pe-frame-info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.5));
  color: #fff;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.35s var(--pe-ease), background 0.35s var(--pe-ease);
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.25);
}

.pe-frame.active .pe-frame-info,
.pe-frame-link:hover .pe-frame-info {
  transform: translateY(-4px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.55));
}

.pe-frame-title {
  font-family: var(--pe-serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px;
}

.pe-frame-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 10px;
}

.pe-frame-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.pe-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

/* ---------- 箭头 ---------- */
.pe-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--pe-border);
  background: rgba(15, 15, 15, 0.6);
  color: var(--pe-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.25s var(--pe-ease);
  backdrop-filter: blur(4px);
}

.pe-arrow:hover {
  background: rgba(15, 15, 15, 0.85);
  border-color: var(--pe-border-strong);
}

.pe-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.pe-arrow-prev { left: 24px; }
.pe-arrow-next { right: 24px; }

/* ---------- 进度 ---------- */
.pe-progress {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pe-surface);
  border: 1px solid var(--pe-border);
  font-family: var(--pe-mono);
  font-size: 12px;
  color: var(--pe-text-muted);
  z-index: 20;
}

.pe-progress-current {
  color: var(--pe-text);
}

/* ---------- 空状态 ---------- */
.pe-empty {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--pe-text-muted);
  text-align: center;
  padding: 40px;
}

.pe-empty-link {
  color: var(--pe-text);
  text-decoration: none;
  border-bottom: 1px solid var(--pe-border);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.pe-empty-link:hover {
  border-color: var(--pe-border-strong);
}

/* ---------- 页脚 ---------- */
.pe-footer {
  grid-area: footer;
  padding: 12px 32px;
  border-top: 1px solid var(--pe-border);
  background: var(--pe-bg);
  text-align: center;
  font-size: 11px;
  color: var(--pe-text-dim);
}

.pe-footer p {
  margin: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .pe-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header"
      "info"
      "stage"
      "footer";
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
  }

  .pe-info {
    border-right: none;
    border-bottom: 1px solid var(--pe-border);
    padding: 24px 28px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 24px;
  }

  .pe-title {
    font-size: 22px;
    margin-bottom: 0;
  }

  .pe-intro {
    max-width: none;
    margin-bottom: 0;
  }

  .pe-stats {
    flex-direction: row;
    margin-bottom: 0;
  }

  .pe-sort,
  .pe-filter,
  .pe-hint {
    display: none;
  }

  .pe-stage {
    min-height: 0;
    padding: 10px 0;
  }

  .pe-frame {
    --pe-frame-w: 68vw;
    --pe-frame-h: min(58vh, 100%);
  }

  .pe-arrow-prev { left: 12px; }
  .pe-arrow-next { right: 12px; }
}

@media (max-width: 768px) {
  .pe-header {
    padding: 0 20px;
  }

  .pe-info {
    padding: 20px;
    gap: 16px;
  }

  .pe-title {
    font-size: 20px;
    width: 100%;
  }

  .pe-intro {
    font-size: 13px;
  }

  .pe-stat-num {
    font-size: 20px;
  }

  .pe-stage {
    min-height: 0;
  }

  .pe-frame {
    --pe-frame-w: 86vw;
    --pe-frame-h: min(62vh, 100%);
    transition-duration: 0.25s;
  }

  .pe-arrow {
    display: none;
  }

  .pe-frame-info {
    opacity: 1;
    transform: translateY(0);
    padding: 12px 14px;
    backdrop-filter: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.5));
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  }

  .pe-frame-title {
    font-size: 16px;
  }

  .pe-frame-img {
    transition: none;
    will-change: auto;
  }

  .pe-frame-link:hover .pe-frame-img {
    transform: none;
  }
}

@media (pointer: coarse) {
  .pe-frame,
  .pe-filmstrip-frame {
    transition-duration: 0.25s;
  }

  .pe-frame-img {
    transition: none;
    will-change: auto;
  }

  .pe-arrow {
    display: none;
  }
}

/* ---------- 胶卷展开 Lightbox ---------- */
.pe-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.5s var(--pe-ease);
  pointer-events: none;
}

.pe-lightbox.open {
  background: rgba(0, 0, 0, 0.92);
  pointer-events: auto;
}

.pe-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--pe-ease) 0.25s, transform 0.4s var(--pe-ease) 0.25s;
  z-index: 10;
}

.pe-lightbox.open .pe-lightbox-close {
  opacity: 1;
  transform: translateY(0);
}

.pe-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pe-lightbox-fullscreen,
.pe-lightbox-autoplay {
  position: absolute;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--pe-ease) 0.25s, transform 0.4s var(--pe-ease) 0.25s, background 0.25s var(--pe-ease);
  z-index: 10;
}

.pe-lightbox-fullscreen { right: 78px; }
.pe-lightbox-autoplay { right: 132px; }

.pe-lightbox.open .pe-lightbox-fullscreen,
.pe-lightbox.open .pe-lightbox-autoplay {
  opacity: 1;
  transform: translateY(0);
}

.pe-lightbox-fullscreen:hover,
.pe-lightbox-autoplay:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pe-lightbox-fullscreen.active,
.pe-lightbox-autoplay.active {
  background: rgba(201, 161, 90, 0.25);
  border-color: rgba(201, 161, 90, 0.5);
  color: var(--pe-accent);
}

/* 从封面飞入的幽灵图片 */
.pe-lightbox-ghost {
  position: fixed;
  z-index: 1001;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  will-change: transform, opacity;
  pointer-events: none;
}

/* 胶卷容器 */
.pe-filmstrip {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  opacity: 0;
  transition: opacity 0.45s var(--pe-ease) 0.15s;
  padding: 0 10vw;
}

.pe-filmstrip::-webkit-scrollbar {
  display: none;
}

.pe-lightbox.open .pe-filmstrip {
  opacity: 1;
}

.pe-filmstrip-track {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: auto;
}

.pe-filmstrip-frame {
  flex: 0 0 auto;
  width: 70vw;
  max-width: 900px;
  height: 70vh;
  max-height: 700px;
  scroll-snap-align: center;
  position: relative;
  background: var(--pe-film);
  border-radius: var(--pe-radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.96);
  opacity: 0.7;
  /* 注意：不能用 contain: paint，否则双击放大(scale 2.5)会被帧边界裁切，无法平移看边缘 */
  contain: layout style;
  transition: transform 0.5s var(--pe-ease), opacity 0.5s var(--pe-ease);
}

.pe-filmstrip-frame.active {
  transform: scale(1);
  opacity: 1;
  will-change: transform;
}

.pe-filmstrip-img {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
  opacity: 0;
  backface-visibility: hidden;
  transition: opacity 0.45s var(--pe-ease), transform 0.3s var(--pe-ease);
  position: relative;
  z-index: 2;
  cursor: zoom-in;
}

.pe-filmstrip-img.loaded {
  opacity: 1;
}

.pe-filmstrip-img.zoomed {
  cursor: grab;
}

.pe-filmstrip-img.zoomed:active {
  cursor: grabbing;
}

.pe-filmstrip-placeholder {
  position: absolute;
  inset: 16px 12px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.6);
  transform: scale(1.05);
  opacity: 1;
  transition: opacity 0.4s var(--pe-ease);
  z-index: 1;
  pointer-events: none;
}

.pe-filmstrip-placeholder.hidden {
  opacity: 0;
}

.pe-filmstrip-sprockets {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.pe-filmstrip-sprockets span {
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.pe-filmstrip-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--pe-mono);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.4s var(--pe-ease) 0.3s;
  z-index: 10;
}

.pe-lightbox.open .pe-filmstrip-counter {
  opacity: 1;
}

/* 查看原图按钮 */
.pe-view-original {
  position: absolute;
  bottom: 28px;
  right: 24px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--pe-sans);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s var(--pe-ease) 0.35s, background 0.25s var(--pe-ease), border-color 0.25s var(--pe-ease);
  z-index: 10;
}

.pe-lightbox.open .pe-view-original {
  opacity: 1;
}

.pe-view-original:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.pe-view-original.loading {
  cursor: wait;
  opacity: 0.7;
}

.pe-view-original.done {
  cursor: default;
  opacity: 0.55;
}

/* 照片信息浮层 */
.pe-lightbox-info {
  position: absolute;
  bottom: 28px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.4s var(--pe-ease) 0.35s;
  z-index: 10;
  max-width: calc(100% - 180px);
}

.pe-lightbox.open .pe-lightbox-info {
  opacity: 1;
}

.pe-lightbox-info-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
  font-family: var(--pe-mono);
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .pe-lightbox-info {
    left: 16px;
    bottom: 22px;
    padding: 6px 12px;
    font-size: 11px;
    max-width: calc(100% - 120px);
  }
  .pe-lightbox-info-name {
    max-width: 140px;
  }
  .pe-lightbox-fullscreen,
  .pe-lightbox-autoplay {
    display: none;
  }
  .pe-view-original {
    bottom: 22px;
    right: 16px;
    padding: 5px 11px;
    font-size: 11px;
  }
}

.pe-filmstrip-prev,
.pe-filmstrip-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.4s var(--pe-ease) 0.25s;
}

.pe-lightbox.open .pe-filmstrip-prev,
.pe-lightbox.open .pe-filmstrip-next {
  opacity: 1;
}

.pe-filmstrip-prev { left: 20px; }
.pe-filmstrip-next { right: 20px; }

.pe-filmstrip-prev:hover,
.pe-filmstrip-next:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* 防止底层滚动 */
body.pe-lightbox-open {
  overflow: hidden;
}

/* Lightbox 错误提示 */
.pe-lightbox-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  z-index: 20;
  max-width: 420px;
  padding: 0 24px;
}

.pe-lightbox-error-title {
  font-size: 18px;
  margin: 0 0 10px;
  letter-spacing: 0.05em;
}

.pe-lightbox-error-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px;
  line-height: 1.6;
}

.pe-lightbox-error-link {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.25s var(--pe-ease);
}

.pe-lightbox-error-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 加载动画 */
.pe-filmstrip-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s var(--pe-ease);
  z-index: 5;
  pointer-events: none;
}

.pe-lightbox.open .pe-filmstrip-loading {
  opacity: 1;
}

.pe-filmstrip-loading[hidden] {
  opacity: 0;
  visibility: hidden;
}

.pe-filmstrip-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: pe-loading-bounce 1.4s infinite ease-in-out both;
}

.pe-filmstrip-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.pe-filmstrip-loading-dot:nth-child(2) { animation-delay: -0.16s; }
.pe-filmstrip-loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes pe-loading-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 768px) {
  .pe-filmstrip {
    padding: 0 5vw;
  }
  .pe-filmstrip-frame {
    width: 90vw;
    height: 60vh;
    transition-duration: 0.25s;
  }
  .pe-filmstrip-prev,
  .pe-filmstrip-next {
    display: none;
  }
}

/* ---------- 减少动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
