/* ============================================================
   我的女孩 · 相册样式（粉色浪漫风）
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg: #1a0e1f;
  --bg-soft: #241527;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #fff0f6;
  --muted: #c9a8bb;
  --accent-1: #ff5c9d;
  --accent-2: #c86bfa;
  --accent-3: #ffb3c6;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* ---------- 基础 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255, 92, 157, 0.55);
  color: #fff;
}

/* ---------- 背景装饰光斑 ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 20% -5%, rgba(255, 92, 157, 0.2), transparent 70%),
    radial-gradient(ellipse 55% 45% at 85% 15%, rgba(200, 107, 250, 0.16), transparent 70%),
    radial-gradient(ellipse 70% 55% at 50% 110%, rgba(255, 179, 198, 0.14), transparent 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(255, 92, 157, 0.55), transparent 70%);
}

.orb-2 {
  width: 380px;
  height: 380px;
  top: 30%;
  right: -140px;
  background: radial-gradient(circle, rgba(200, 107, 250, 0.5), transparent 70%);
  animation-delay: -5s;
}

.orb-3 {
  width: 460px;
  height: 460px;
  bottom: -180px;
  left: 30%;
  background: radial-gradient(circle, rgba(255, 179, 198, 0.4), transparent 70%);
  animation-delay: -10s;
}

/* ---------- 飘落的花瓣 ---------- */
.petals {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.petals span {
  position: absolute;
  top: -6%;
  display: block;
  width: 14px;
  height: 18px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #ffb3c6, #ff5c9d);
  opacity: 0;
  animation: petalFall linear infinite;
}

.petals span:nth-child(1) { left: 4%;  animation-duration: 11s; animation-delay: 0s;    transform: rotate(24deg); }
.petals span:nth-child(2) { left: 12%; animation-duration: 13s; animation-delay: 2.2s;  transform: rotate(-18deg); }
.petals span:nth-child(3) { left: 22%; animation-duration: 10s; animation-delay: 4.5s;  transform: rotate(40deg); }
.petals span:nth-child(4) { left: 31%; animation-duration: 14s; animation-delay: 1.2s;  transform: rotate(-30deg); }
.petals span:nth-child(5) { left: 41%; animation-duration: 12s; animation-delay: 5.8s;  transform: rotate(15deg); }
.petals span:nth-child(6) { left: 50%; animation-duration: 15s; animation-delay: 3.1s;  transform: rotate(-24deg); }
.petals span:nth-child(7) { left: 59%; animation-duration: 11s; animation-delay: 6.6s;  transform: rotate(35deg); }
.petals span:nth-child(8) { left: 68%; animation-duration: 13s; animation-delay: 0.8s;  transform: rotate(-12deg); }
.petals span:nth-child(9) { left: 77%; animation-duration: 10s; animation-delay: 4.0s;  transform: rotate(28deg); }
.petals span:nth-child(10) { left: 85%; animation-duration: 14s; animation-delay: 2.7s; transform: rotate(-35deg); }
.petals span:nth-child(11) { left: 92%; animation-duration: 12s; animation-delay: 5.1s;  transform: rotate(20deg); }
.petals span:nth-child(12) { left: 96%; animation-duration: 15s; animation-delay: 7.3s;  transform: rotate(-20deg); }
.petals span:nth-child(13) { left: 8%;  animation-duration: 16s; animation-delay: 8.0s;  transform: rotate(45deg); }
.petals span:nth-child(14) { left: 47%; animation-duration: 13s; animation-delay: 9.2s;  transform: rotate(-45deg); }
.petals span:nth-child(15) { left: 74%; animation-duration: 11s; animation-delay: 10.5s; transform: rotate(18deg); }
.petals span:nth-child(16) { left: 16%; animation-duration: 12s; animation-delay: 3.5s;  transform: rotate(-22deg); }
.petals span:nth-child(17) { left: 28%; animation-duration: 14s; animation-delay: 1.8s;  transform: rotate(33deg); }
.petals span:nth-child(18) { left: 36%; animation-duration: 11s; animation-delay: 6.2s;  transform: rotate(-15deg); }
.petals span:nth-child(19) { left: 44%; animation-duration: 13s; animation-delay: 8.7s;  transform: rotate(26deg); }
.petals span:nth-child(20) { left: 55%; animation-duration: 10s; animation-delay: 4.8s;  transform: rotate(-38deg); }
.petals span:nth-child(21) { left: 63%; animation-duration: 15s; animation-delay: 9.6s;  transform: rotate(12deg); }
.petals span:nth-child(22) { left: 72%; animation-duration: 12s; animation-delay: 2.4s;  transform: rotate(-28deg); }
.petals span:nth-child(23) { left: 82%; animation-duration: 14s; animation-delay: 7.1s;  transform: rotate(31deg); }
.petals span:nth-child(24) { left: 90%; animation-duration: 11s; animation-delay: 11.2s; transform: rotate(-33deg); }
.petals span:nth-child(25) { left: 6%;  animation-duration: 15s; animation-delay: 12.5s; transform: rotate(-16deg); }
.petals span:nth-child(26) { left: 19%; animation-duration: 12s; animation-delay: 13.8s; transform: rotate(38deg); }
.petals span:nth-child(27) { left: 33%; animation-duration: 16s; animation-delay: 1.5s;  transform: rotate(-29deg); }
.petals span:nth-child(28) { left: 53%; animation-duration: 13s; animation-delay: 10.8s; transform: rotate(21deg); }
.petals span:nth-child(29) { left: 66%; animation-duration: 15s; animation-delay: 12.1s; transform: rotate(-40deg); }
.petals span:nth-child(30) { left: 79%; animation-duration: 12s; animation-delay: 14.6s; transform: rotate(14deg); }
.petals span:nth-child(31) { left: 87%; animation-duration: 16s; animation-delay: 2.9s;  transform: rotate(-25deg); }
.petals span:nth-child(32) { left: 94%; animation-duration: 14s; animation-delay: 15.4s; transform: rotate(36deg); }

@keyframes petalFall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) translateX(0);
  }
  10% {
    opacity: 0.85;
  }
  50% {
    transform: translateY(55vh) rotate(180deg) translateX(30px);
  }
  90% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(108vh) rotate(360deg) translateX(-40px);
  }
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.15); }
}

/* ---------- 加载动画 ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.done {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-1);
  border-right-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preloader-text {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.3em;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
  position: relative;
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
  animation: fadeUp 1s 0.15s both;
}

.hero-title {
  font-size: clamp(3rem, 9vw, 6.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.04em;
  animation: fadeUp 1s 0.3s both;
}

.hero-title .grad {
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}

.hero-subtitle {
  margin-top: 26px;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.9;
  color: var(--muted);
  animation: fadeUp 1s 0.45s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 44px;
  padding: 18px 36px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  animation: fadeUp 1s 0.6s both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* 滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  animation: fadeUp 1s 0.8s both;
}

.mouse {
  display: block;
  width: 26px;
  height: 42px;
  border: 2px solid var(--muted);
  border-radius: 14px;
  position: relative;
}

.wheel {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--accent-2);
  animation: wheelDown 1.6s ease-in-out infinite;
}

@keyframes wheelDown {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ---------- 相册主体 ---------- */
.gallery-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 90px;
}

.gallery-head {
  text-align: center;
  margin-bottom: 34px;
}

.section-title {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
}

.section-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.05em;
}

/* ---------- 筛选栏 ---------- */
.gallery-toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.chip {
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.chip.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 24px rgba(255, 92, 157, 0.45);
}

/* ---------- 照片网格 ---------- */
.masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* 横版照片占两列 */
.card--wide {
  grid-column: span 2;
}

.card--wide img {
  height: 100%;
  object-fit: cover;
}

/* 压轴大图：占满整行（4列）并横跨2行 */
.card--feature {
  grid-column: 1 / -1;
  grid-row: span 2;
}

.card--feature img {
  height: 100%;
  object-fit: cover;
}

.card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.card.visible {
  opacity: 1;
  transform: none;
}

.card img {
  display: block;
  width: 100%;
  transform: scale(1.001);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover img {
  transform: scale(1.07);
}

/* 悬浮遮罩 */
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(4, 7, 18, 0.88) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-cat {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  margin-bottom: 10px;
  transform: translateY(10px);
  transition: transform 0.35s ease;
}

.card:hover .card-cat {
  transform: none;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  transform: translateY(10px);
  transition: transform 0.35s ease 0.05s;
}

.card:hover .card-title {
  transform: none;
}

/* 空状态 */
.empty-tip {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 15px;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 40px 20px 50px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.footer-sub {
  margin-top: 8px;
  color: rgba(255, 179, 198, 0.65);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.heart {
  color: var(--accent-2);
  animation: beat 1.2s ease-in-out infinite;
  display: inline-block;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.3); }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 16, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 1080px);
  max-height: 92vh;
  padding: 0 64px;
  transform: scale(0.96);
  transition: transform 0.35s ease;
}

.lightbox.open .lb-figure {
  transform: scale(1);
}

#lb-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  object-fit: contain;
  animation: lbFade 0.35s ease;
}

@keyframes lbFade {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

.lb-caption {
  margin-top: 18px;
  text-align: center;
  max-width: 640px;
}

.lb-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.lb-cat {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.lb-counter {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.lb-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
}

.lb-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* 灯箱按钮 */
.lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.lb-close {
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.lb-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.lb-prev { left: 24px; }
.lb-next { right: 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .masonry { grid-template-columns: repeat(2, 1fr); gap: 12px; grid-auto-flow: dense; }
  .petals span { width: 10px; height: 13px; }
  .card { border-radius: 12px; }
  .lb-figure { padding: 0 12px; }
  .lb-nav { width: 42px; height: 42px; font-size: 28px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .hero-stats { gap: 20px; padding: 14px 24px; }
  .gallery-section { padding: 16px 16px 70px; }
}

/* ---------- 触屏设备适配 ---------- */
@media (hover: none) {
  body { -webkit-tap-highlight-color: transparent; }
  /* 触屏没有 hover，照片信息遮罩常显 */
  .card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(4, 7, 18, 0.78) 0%, transparent 55%);
  }
  .card-overlay .card-cat,
  .card-overlay .card-title { transform: none; }
  .card:hover img { transform: scale(1.001); }
}

@media (max-width: 480px) {
  .masonry { grid-template-columns: repeat(2, 1fr); gap: 8px; grid-auto-flow: dense; }
  .card--wide { grid-column: span 2; }
  .card--feature { grid-column: 1 / -1; grid-row: auto; }
  .card { border-radius: 10px; }
  .card-overlay { padding: 10px; }
  .card-title { font-size: 0.92rem; }
  .card-cat { font-size: 10px; padding: 3px 8px; margin-bottom: 6px; }
  /* 小屏减少花瓣密度，保证动画流畅 */
  .petals span:nth-child(3n) { display: none; }

  .hero { padding: 32px 16px calc(70px + env(safe-area-inset-bottom)); }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.28em; margin-bottom: 18px; }
  .hero-title { font-size: clamp(2.1rem, 10.5vw, 3rem); letter-spacing: 0.02em; }
  .hero-subtitle { margin-top: 18px; font-size: 0.95rem; line-height: 1.8; }
  .hero-stats { margin-top: 30px; padding: 12px 24px; gap: 16px; }
  .stat-num { font-size: 1.4rem; }
  .scroll-hint { display: none; }

  .section-title { font-size: 1.55rem; }
  .section-sub { font-size: 13px; }
  .gallery-head { margin-bottom: 22px; }

  .lb-caption { margin-top: 12px; }
  .lb-title { font-size: 1.15rem; }
  .lb-desc { font-size: 13px; line-height: 1.6; }
  #lb-img { max-height: 60vh; }

  .footer { padding: 30px 16px calc(42px + env(safe-area-inset-bottom)); font-size: 12px; }
}
