/* =========================================================
   青春老友合照集 · 样式表
   配色：米白主调 + 浅暖灰点缀，低饱和青春治愈质感
   ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --bg:         #ffd6ec;   /* 芭比粉主背景 */
  --bg-soft:    #ffc2e2;   /* 深一档粉卡片底 */
  --ink:        #7a2150;   /* 主文字（玫紫墨） */
  --ink-soft:   #c45c93;   /* 次要文字（柔粉） */
  --line:       #ffaad4;   /* 分隔线 */
  --accent:     #ff1493;   /* 芭比亮粉点缀色 */
  --white:      #fffafd;
  --shadow:     0 8px 30px rgba(214, 51, 132, 0.20);
  --radius:     14px;
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: linear-gradient(160deg, #ffe0f1 0%, #ffd6ec 40%, #ffc8e6 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部固定导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 214, 236, 0.80);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 214, 236, 0.94);
}
.nav__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink);
}
.nav__menu {
  display: flex;
  gap: 34px;
}
.nav__link {
  position: relative;
  font-size: 15px;
  color: var(--ink-soft);
  padding: 4px 0;
  transition: color .3s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .3s var(--ease);
}
.nav__link:hover,
.nav__link.is-active { color: var(--ink); }
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }

/* 移动端汉堡按钮 */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首屏主视觉 ---------- */
.hero {
  position: relative;
  height: 78vh;
  min-height: 460px;
  margin-top: 64px;
  overflow: hidden;
}
.carousel { width: 100%; height: 100%; position: relative; }
.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s var(--ease), transform 6s linear;
}
.carousel__slide.is-active {
  opacity: 1;
  transform: scale(1);
}
.carousel__slide img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero::after {   /* 底部柔和压暗，保证文字可读 */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(74,68,61,0) 45%, rgba(74,68,61,0.45) 100%);
  pointer-events: none;
}
.hero__caption {
  position: absolute;
  left: 0; right: 0; bottom: 48px;
  text-align: center;
  color: var(--white);
  z-index: 2;
  padding: 0 24px;
}
.hero__sub {
  font-size: 13px;
  letter-spacing: 6px;
  opacity: .85;
  margin-bottom: 10px;
}
.hero__title {
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 500;
  letter-spacing: 2px;
  text-shadow: 0 2px 18px rgba(0,0,0,.25);
}
.carousel__dots {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 3;
}
.carousel__dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.carousel__dots button.is-active {
  background: var(--white);
  transform: scale(1.25);
}

/* ---------- 图集区块 ---------- */
.gallery { padding: 64px 0 12px; }
.gallery__head { text-align: center; margin-bottom: 36px; }
.gallery__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}
.gallery__title::after {
  content: "";
  display: block;
  width: 38px; height: 3px;
  margin: 12px auto 0;
  background: var(--accent);
  border-radius: 3px;
}
.gallery__desc {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity .7s var(--ease), transform .6s var(--ease);
}
.card img.is-loaded { opacity: 1; }          /* 图片加载淡入 */
.card:hover img { transform: scale(1.07); }  /* hover 轻微放大 */
.card__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 16px 14px;
  color: var(--white);
  font-size: 14px;
  letter-spacing: .5px;
  background: linear-gradient(180deg, rgba(74,68,61,0) 0%, rgba(74,68,61,.55) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.card:hover .card__label { opacity: 1; transform: translateY(0); }

/* ---------- 联系 / 页脚 ---------- */
.contact {
  margin-top: 56px;
  padding: 64px 24px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  text-align: center;
}
.contact__inner { max-width: 680px; margin: 0 auto; }
.contact__title { font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.contact__line { color: var(--ink-soft); font-size: 15px; margin-bottom: 8px; }
.contact code {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--accent);
}
.contact__copy { margin-top: 24px; font-size: 13px; color: var(--ink-soft); }

/* ---------- 全屏预览灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 36, 31, 0.92);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  max-width: 90vw;
  max-height: 86vh;
  text-align: center;
  transform: scale(.96);
  transition: transform .35s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
.lightbox__img {
  max-width: 90vw;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox__cap {
  margin-top: 16px;
  color: #f3ede4;
  font-size: 15px;
  letter-spacing: .5px;
}
.lightbox__close {
  position: absolute;
  top: 22px; right: 28px;
  width: 44px; height: 44px;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background .3s var(--ease);
}
.lightbox__close:hover { background: rgba(255,255,255,.25); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 32px;
  color: #fff;
  background: rgba(255,255,255,.10);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background .3s var(--ease);
}
.lightbox__nav:hover { background: rgba(255,255,255,.25); }
.lightbox__prev { left: 24px; }
.lightbox__next { right: 24px; }

/* ---------- 滚动入场动画 ---------- */
[data-aos] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-aos].is-in { opacity: 1; transform: translateY(0); }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ---------- 响应式：手机端（单列） ---------- */
@media (max-width: 600px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 214, 236, 0.98);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s var(--ease);
  }
  .nav__menu.is-open { max-height: 280px; }
  .nav__link {
    padding: 14px 24px;
    border-top: 1px solid var(--line);
  }
  .nav__link::after { display: none; }

  .hero { height: 62vh; min-height: 360px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }   /* 手机端单列 */
  .card { aspect-ratio: 3 / 2; }
  .lightbox__nav { width: 42px; height: 42px; font-size: 26px; }
  .lightbox__prev { left: 10px; }
  .lightbox__next { right: 10px; }
}
