/* ═══════════════════════════════════════
   回忆相册展示网站 — 样式 v3
   暖色 · 胶片感 · 拍立得 · 记忆展厅
   ═══════════════════════════════════════ */

:root {
  --accent: #e8b4b8;
  --accent-warm: #d4957a;
  --text: #f0ece6;
  --muted: #b0a8a0;
  --radius-card: 20px;
  --radius-img: 10px;
}

* { box-sizing: border-box; }

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

/* ═══════════════════════════════════════
   BACKGROUND
   移动端：简单暖色渐变（轻量，秒开）
   桌面端：照片模糊背景 + 毛玻璃质感
   ═══════════════════════════════════════ */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;

  /* 移动端默认：温润的暖褐色渐变 */
  background:
    radial-gradient(ellipse 400px 300px at 30% 10%, rgba(180, 120, 90, 0.20), transparent 60%),
    radial-gradient(ellipse 350px 280px at 70% 50%, rgba(200, 150, 130, 0.15), transparent 55%),
    linear-gradient(175deg, #1e1410 0%, #191210 30%, #151010 60%, #1a1312 100%);
}

/* 桌面端才启用照片模糊背景 */
@media (min-width: 769px) {
  body {
    position: relative;
  }
  body::before {
    content: "";
    position: fixed; inset: 0; z-index: -2;
    background-image: url("/assets/photos/hangzhou-2024/medium_cover.jpg");
    background-size: cover;
    background-position: center;
    filter: blur(60px) brightness(0.25);
    transform: scale(1.1);
  }
  body::after {
    content: "";
    position: fixed; inset: 0; z-index: -1;
    background:
      radial-gradient(ellipse 900px 600px at 25% 20%, rgba(180, 120, 90, 0.22), transparent 60%),
      radial-gradient(ellipse 700px 500px at 75% 60%, rgba(200, 150, 130, 0.15), transparent 55%),
      linear-gradient(175deg, rgba(40,25,20,0.90) 0%, rgba(30,20,18,0.85) 50%, rgba(25,18,16,0.88) 100%);
    pointer-events: none;
  }
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* Skip link */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #1a1010;
  padding: 8px 16px; z-index: 100;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Page ── */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 20px 80px;
}
@media (max-width: 640px) {
  .page { padding: 48px 16px 64px; }
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up, .card, .photo-thumb { animation: none !important; opacity: 1 !important; }
}

/* ═══════════════════════════════════════
   HOMEPAGE
   ═══════════════════════════════════════ */

.hero {
  text-align: center;
  margin-bottom: 64px;
  padding: 40px 0 48px;
}

.hero-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin: 0 0 18px;
  opacity: 0.7;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f5efe6 0%, #d4b8a8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin: 16px auto 0;
  max-width: 480px;
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.8;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 0;
  padding: 9px 22px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
}
@supports (backdrop-filter: blur(10px)) {
  .hero-stats {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
  }
}
.hero-stats span { color: var(--accent); }

/* ── Album Grid ── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}
@media (max-width: 700px) {
  .album-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Card (拍立得风格) ── */
.card {
  display: block;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.card:hover {
  transform: translateY(-6px);
}
.card:active { transform: scale(0.985); }

.card-inner {
  background: rgba(35, 25, 22, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
@supports (backdrop-filter: blur(10px)) {
  .card-inner {
    background: rgba(30, 22, 20, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.card:hover .card-inner {
  border-color: rgba(232, 180, 184, 0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(200, 150, 130, 0.06);
}

.card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: rgba(0,0,0,0.3);
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.card:hover .card-img img { transform: scale(1.06); }

.card-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 12, 10, 0.5) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.4s ease;
}
.card:hover .card-img::after { opacity: 1; }

.card-body {
  padding: 20px 22px 22px;
}
.card-body h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.card-desc {
  margin: 8px 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}
.card-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--muted); opacity: 0.6;
}
.dot { color: rgba(255,255,255,0.15); }

/* ═══════════════════════════════════════
   ALBUM PAGE
   ═══════════════════════════════════════ */

.back-nav { margin-bottom: 32px; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.9rem; color: var(--muted);
  padding: 6px 0;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

.album-hero { margin-bottom: 48px; }
.album-hero .hero-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 14px;
  opacity: 0.7;
}

.album-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.03em;
}

.album-desc {
  margin: 14px 0 8px;
  font-size: 1rem; color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
}

.album-count {
  font-size: 0.85rem; color: var(--muted);
  opacity: 0.6;
}

/* ── Photo Grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 768px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

.photo-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-img);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 0;
  cursor: pointer;
  position: relative;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}
.photo-thumb:hover {
  transform: scale(1.03);
  border-color: rgba(232, 180, 184, 0.3);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.photo-thumb:active { transform: scale(0.97); }
.photo-thumb:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.photo-thumb:hover img { transform: scale(1.06); }

/* ═══════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════ */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 6, 5, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  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; }

.lb-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top, 18px));
  right: 18px; z-index: 10;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: #fff; border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  touch-action: manipulation;
}
.lb-close:hover { background: rgba(255,255,255,0.12); }
.lb-close:active { transform: scale(0.9); }

.lb-counter {
  position: fixed;
  top: max(18px, env(safe-area-inset-top, 18px));
  left: 18px; z-index: 10;
  font-size: 0.85rem; color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px; border-radius: 999px;
}

.lb-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: #fff; border: none;
  cursor: pointer;
  transition: background 0.2s;
  touch-action: manipulation;
}
.lb-nav:hover { background: rgba(255,255,255,0.1); }
.lb-nav:active { transform: translateY(-50%) scale(0.92); }
.lb-prev { left: max(10px, env(safe-area-inset-left, 10px)); }
.lb-next { right: max(10px, env(safe-area-inset-right, 10px)); }
@media (max-width: 640px) { .lb-nav { display: none; } }

.lb-stage {
  display: flex; align-items: center; justify-content: center;
  transition: transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
  touch-action: pan-y;
}
.lb-stage img {
  max-width: 90vw; max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 0.3s ease;
  user-select: none; -webkit-user-select: none;
  pointer-events: none;
}

.lb-skeleton {
  position: absolute;
  width: 80vw; height: 60vh;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.015) 25%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.015) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.lb-dots {
  position: fixed;
  bottom: max(36px, env(safe-area-inset-bottom, 36px));
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
  max-width: 85vw; overflow-x: auto;
  padding: 4px 8px;
}
.lb-dot {
  width: 7px; height: 7px; min-width: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none; padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.lb-dot:hover { background: rgba(255,255,255,0.45); }
.lb-dot.active { background: var(--accent); width: 22px; border-radius: 999px; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.35;
}
