/* ============================================================
   Photo Album — 单列滚动 · 左右交错 · 视口淡入
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  background-color: #fafafa;
  /* 极淡网点纹理 — 远看不察，近看有呼吸感 */
  background-image:
    radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  padding: 80px 40px 60px;
}
.logo {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #111;
}
.subtitle {
  margin-top: 14px;
  font-size: 0.9rem;
  color: #aaa;
  letter-spacing: 0.25em;
}

/* ---------- Feed ---------- */
.feed {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 60px;
}

/* 每张图的外层容器 */
.feed-item {
  margin-bottom: 72px;
  line-height: 0;
}

/* 图片内层：照片裱框效果 */
.feed-item-inner {
  position: relative;
  display: inline-block;   /* shrink-wrap：自适应图片宽度 */
  max-width: 100%;         /* 不超过 feed-item 宽度 */
  cursor: pointer;
  background: #fff;
  border-radius: 2px;
  line-height: 0;
  /* 白边衬框 */
  padding: 10px;
  /* 极淡浮影 */
  box-shadow:
    0 1px 3px rgba(0,0,0,0.04),
    0 6px 24px rgba(0,0,0,0.05);
  transition: box-shadow 0.4s ease;
}

.feed-item-inner:hover {
  box-shadow:
    0 1px 3px rgba(0,0,0,0.06),
    0 10px 36px rgba(0,0,0,0.10);
}

.feed-item img {
  display: block;

  /* 不强制撑满宽度，保持原始比例 */
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;

  /* 默认透明，JS 触发淡入 */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* JS 触发的显示状态 */
.feed-item img.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 左右交错 + 宽度节奏 ---- */

/* 第 1、4、7... 张：靠左，偏宽 */
.feed-item:nth-child(6n+1) {
  margin-right: auto;
  margin-left: 4%;
  max-width: 68%;
}

/* 第 2、5、8... 张：靠右，中等 */
.feed-item:nth-child(6n+2) {
  margin-left: auto;
  margin-right: 5%;
  max-width: 56%;
}

/* 第 3、6、9... 张：靠左，偏窄 */
.feed-item:nth-child(6n+3) {
  margin-right: auto;
  margin-left: 12%;
  max-width: 50%;
}

/* 第 4 张：靠右，偏宽 */
.feed-item:nth-child(6n+4) {
  margin-left: auto;
  margin-right: 3%;
  max-width: 64%;
}

/* 第 5 张：靠左，中等 */
.feed-item:nth-child(6n+5) {
  margin-right: auto;
  margin-left: 8%;
  max-width: 54%;
}

/* 第 6 张：靠右，偏窄 */
.feed-item:nth-child(6n+6) {
  margin-left: auto;
  margin-right: 14%;
  max-width: 46%;
}

/* 悬停微动 */
.feed-item-inner:hover img.reveal {
  transform: scale(1.02);
  transition: transform 0.5s ease;
}

/* ---- 照片编号角标 ---- */
.feed-item-number {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.25);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  transition: color 0.3s;
}

.feed-item-inner:hover .feed-item-number {
  color: rgba(0, 0, 0, 0.45);
}

/* ---- 照片日期标注 ---- */
.feed-item-date {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 300;
  color: #bbb;
  letter-spacing: 0.1em;
  text-align: right;
  line-height: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
}

.feed-item-date.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* 靠右的照片日期改为左对齐 */
.feed-item:nth-child(6n+2) .feed-item-date,
.feed-item:nth-child(6n+4) .feed-item-date,
.feed-item:nth-child(6n+6) .feed-item-date {
  text-align: left;
}

/* ---- 设备信息栏 ---- */
.camera-info {
  max-width: 1100px;
  margin: -20px auto 48px;
  padding: 0 32px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 300;
  color: #c5c5c5;
  letter-spacing: 0.1em;
}
.camera-info-dot {
  margin: 0 8px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 20px 20px 60px;
}
.footer-text {
  font-size: 0.78rem;
  color: #ccc;
  letter-spacing: 0.1em;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  line-height: 44px;
  text-align: center;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-img-wrap {
  position: relative;
  z-index: 5;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox-img.show { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s;
  line-height: 56px;
  text-align: center;
  font-weight: 200;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .feed {
    padding: 0 16px 40px;
  }
  .feed-item {
    margin-bottom: 40px;
    max-width: 80% !important;
  }
  /* 移动端减弱偏移量 */
  .feed-item:nth-child(odd) {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  .feed-item:nth-child(even) {
    margin-left: auto !important;
    margin-right: 0 !important;
  }
  .header { padding: 50px 20px 40px; }
  .logo { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  .feed {
    padding: 0 10px 32px;
  }
  .feed-item {
    margin-bottom: 24px;
    max-width: 88% !important;
  }
  .feed-item:nth-child(odd) {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  .feed-item:nth-child(even) {
    margin-left: auto !important;
    margin-right: 0 !important;
  }
  .header { padding: 40px 16px 32px; }
  .logo { font-size: 1.5rem; }
  .subtitle { font-size: 0.8rem; }
  .lightbox-close { top: 10px; right: 12px; }
  .lightbox-prev { left: 2px; }
  .lightbox-next { right: 2px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 32px; line-height: 40px; }
  .lightbox-counter { bottom: 16px; font-size: 0.72rem; }
}
