/* ============================================
   SEA MIST PHOTOGRAPHY — Pure Portfolio
   ============================================ */

:root {
  --bg: #FAF8F5;
  --text: #5C4F42;
  --text-light: #F2EDE8;
  --text-muted: #8A8279;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-quart: cubic-bezier(0.7, 0, 0.84, 0);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* --- Logo --- */
.logo-wrap {
  display: flex;
  justify-content: center;
  padding: 72px 0 56px;
}

.logo {
  width: auto;
  max-height: 140px;
  height: auto;
  display: block;
}

/* --- Gallery (JS-masonry absolute positioning) --- */
/* max-width 1100：保持 3 列居中，左右留白，照片大小不变 */
.gallery {
  padding: 0 32px 80px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* --- Gallery Item --- */
.gallery__item {
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.gallery__item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery__block {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.4s var(--ease);
  background: var(--text-muted);
}

.gallery__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.gallery__img.loaded {
  opacity: 1;
}

.gallery__item:hover .gallery__block {
  transform: scale(1.015);
}

.gallery__date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #fff;
  opacity: 0.85;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  box-sizing: border-box;
}

/* --- Gallery Likes Overlay --- */
.gallery__likes {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  user-select: none;
  pointer-events: none;
}

.gallery__item:hover .gallery__likes,
.gallery__item.touch-active .gallery__likes {
  opacity: 1;
}

.gallery__likes.liked {
  opacity: 0.85;  /* 点过赞的照片：左下角小爱心常亮 */
}

.gallery__likes-heart {
  color: #e8a0a0;
  font-size: 12px;
  transition: color 0.25s var(--ease);
}

.gallery__likes.liked .gallery__likes-heart {
  color: #ff6b7a;  /* 亮红色 + 心形 */
}

/* --- Lightbox (flex column, FLIP-driven image) --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(42, 40, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
  touch-action: pan-y;
  padding: 24px 16px;
}

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

.lightbox__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.lightbox__img {
  border-radius: 2px;
  max-width: 80vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.4s var(--ease-out-expo);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  will-change: transform, opacity;
}

.lightbox.open .lightbox__img {
  opacity: 1;
}

.lightbox__fallback {
  border-radius: 2px;
  transition: opacity 0.3s var(--ease);
}

.lightbox__date {
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgba(242, 237, 232, 0.6);
  user-select: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease) 0.05s;
}

.lightbox.open .lightbox__date {
  opacity: 1;
}

/* --- Lightbox Actions (like + close, side by side) --- */
.lightbox__actions {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.25s var(--ease) 0.1s;
}

.lightbox.open .lightbox__actions {
  opacity: 1;
}

/* --- Lightbox Like Button --- */
.lightbox__like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  color: rgba(242, 237, 232, 0.7);
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.lightbox__like-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(242, 237, 232, 0.95);
}

.lightbox__like-heart {
  font-size: 16px;
  color: #d4919a;
  transition: transform 0.3s var(--ease);
}

.lightbox__like-btn.liked .lightbox__like-heart {
  animation: like-pulse 0.4s var(--ease);
}

.lightbox__like-btn.liked {
  border-color: rgba(212, 145, 154, 0.4);
  background: rgba(212, 145, 154, 0.1);
}

@keyframes like-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* --- Lightbox Close (now inline next to like-btn) --- */
.lightbox__close {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  padding: 0;
  outline: none;
}

.lightbox__close:hover,
.lightbox__close:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.lightbox__close::before,
.lightbox__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 1.5px;
  background: rgba(242, 237, 232, 0.7);
  transition: background 0.2s var(--ease);
}

.lightbox__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.lightbox__close:hover::before,
.lightbox__close:hover::after {
  background: rgba(242, 237, 232, 0.95);
}

/* --- Slogan --- */
.slogan {
  display: flex;
  justify-content: center;
  padding: 64px 24px;
  margin-top: 40px;
}

.slogan__img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

/* --- Back to top button --- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(60, 50, 40, 0.65);
  color: rgba(242, 237, 232, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 18px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.back-to-top.show {
  display: flex;
  opacity: 1;
}

.back-to-top:hover,
.back-to-top:active {
  background: rgba(60, 50, 40, 0.85);
}

/* --- Responsive --- */
@media (max-width: 1400px) {
  .gallery {
    padding: 0 32px 80px;
  }
}

@media (max-width: 1024px) {
  .gallery {
    padding: 0 24px 60px;
  }
  .logo-wrap {
    padding: 36px 0 32px;
  }
}

@media (max-width: 640px) {
  .gallery {
    padding: 0 16px 60px;  /* 之前 8px 太顶满，留 16px 呼吸 */
  }
  .gallery__item {
    transform: translateY(16px);
  }
  .logo-wrap {
    padding: 32px 0 24px;
  }
  .logo {
    max-height: 90px;
  }
  .lightbox {
    padding: 20px 12px;
  }
  .lightbox__img {
    max-width: 92vw;
    max-height: 68vh;
  }
  .lightbox__close {
    width: 44px;
    height: 44px;
  }
  .lightbox__actions {
    bottom: 28px;
    gap: 10px;
  }
  .slogan {
    padding: 32px 12px;
  }
  .slogan__img {
    max-width: 55vw;
  }
  .back-to-top {
    right: 12px;
    bottom: 24px;
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .fastscroll {
    width: 8px;
  }
  .fastscroll__thumb {
    right: 2px;
    width: 4px;
  }

}

/* === Fast scrollbar (macOS / iOS 风格：按住拖动快速浏览) === */
.fastscroll {
  position: fixed;
  top: 0;
  right: 0;
  width: 14px;
  height: 100vh;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.fastscroll.visible,
.fastscroll.dragging,
.fastscroll:hover {
  opacity: 1;
}
.fastscroll__thumb {
  position: absolute;
  right: 3px;
  width: 5px;
  min-height: 32px;
  border-radius: 3px;
  background: rgba(20, 20, 20, 0.45);
  transition: background 0.15s var(--ease);
  will-change: transform, height;
}
.fastscroll.dragging .fastscroll__thumb,
.fastscroll__thumb:hover {
  background: rgba(20, 20, 20, 0.75);
  width: 6px;
  right: 2px;
}
