/* =========================================================
   婚纱相册 · 样式表
   ========================================================= */

:root {
  --paper: #faf8f4;
  --paper-2: #f2ece2;
  --paper-3: #e9e0d2;
  --ink: #1f1c18;
  --ink-soft: #4b453c;
  --muted: #8c8377;
  --gold: #a98b5d;
  --gold-soft: #c9ab7e;
  --night: #12100e;
  --night-2: #1b1815;
  --line: rgba(31, 28, 24, 0.1);
  --line-light: rgba(255, 255, 255, 0.14);

  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    "Noto Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(18px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.lock,
body.lock {
  overflow: hidden;
  touch-action: none;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--gold-soft); color: #fff; }

/* ---------------- 顶部导航 ---------------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
  padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top);
  background: rgba(250, 248, 244, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-104%);
  transition: transform 0.5s var(--ease);
}

.nav.is-on { transform: translateY(0); }

.nav__brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--ink);
  transition: color 0.4s;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
}

.nav__links a {
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  transition: color 0.3s;
  padding: 4px 0;
}

.nav__links a:hover { color: var(--gold); }

/* 滚到深色区块时自动反色 */
.nav--dark {
  background: rgba(18, 16, 14, 0.74);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.nav--dark .nav__brand { color: rgba(250, 248, 244, 0.9); }
.nav--dark .nav__links a { color: rgba(250, 248, 244, 0.66); }
.nav--dark .nav__links a:hover { color: var(--gold-soft); }

/* ---------------- 首屏 ---------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: var(--night);
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  animation: kenburns 28s var(--ease) forwards;
  will-change: transform;
}

@keyframes kenburns {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* 文字后方的柔和暗部，保证白婚纱上也能看清 */
    radial-gradient(72% 52% at 50% 44%, rgba(10, 8, 6, 0.58) 0%, rgba(10, 8, 6, 0.24) 52%, rgba(10, 8, 6, 0) 78%),
    /* 顶部压暗一点，让标题落到石雕上时不糊 */
    linear-gradient(180deg, rgba(10, 8, 6, 0.56) 0%, rgba(10, 8, 6, 0.3) 20%, rgba(10, 8, 6, 0.04) 40%, rgba(10, 8, 6, 0.1) 62%, rgba(10, 8, 6, 0.62) 100%);
}

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad) 15vh;
  text-align: center;
  color: #fff;
}

/* 宽屏时文字上移，避开下方的人物 —— 更像海报构图 */
@media (min-width: 900px) {
  .hero__content {
    justify-content: flex-start;
    padding-top: clamp(130px, 18vh, 240px);
    padding-bottom: 0;
  }
}

.hero__eyebrow {
  margin: 0 0 clamp(14px, 3vw, 26px);
  font-size: clamp(10px, 2.6vw, 12px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
  opacity: 0;
  animation: rise 1.1s var(--ease) 0.25s forwards;
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 10vw, 5.6rem);
  line-height: 1.22;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.42);
  opacity: 0;
  animation: rise 1.3s var(--ease) 0.4s forwards;
}

.hero__rule {
  width: min(240px, 46vw);
  margin: clamp(20px, 4vw, 34px) auto;
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.62s forwards;
}

.hero__rule span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 171, 126, 0.95), transparent);
}

.hero__sub {
  margin: 0;
  max-width: 26em;
  font-family: var(--serif);
  font-size: clamp(0.92rem, 3.4vw, 1.12rem);
  letter-spacing: 0.14em;
  line-height: 2.1;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.74s forwards;
}

.hero__meta {
  margin: clamp(16px, 3vw, 24px) 0 0;
  font-size: clamp(10px, 2.6vw, 11.5px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.86s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
  opacity: 0;
  animation: rise 1.2s var(--ease) 1.1s forwards;
}

.hero__cue-text {
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.hero__cue-arrow {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  animation: cue 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes cue {
  0%, 100% { transform: scaleY(0.55); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------------- 通用区块 ---------------- */

.sec {
  padding: clamp(52px, 8vw, 110px) 0 clamp(40px, 6vw, 90px);
  scroll-margin-top: 58px;   /* 锚点跳转时避开吸顶导航 */
}

.sec--dark {
  background: var(--night);
  color: var(--paper);
  margin-top: clamp(40px, 6vw, 80px);
}

.sec__head {
  max-width: 1520px;
  margin: 0 auto clamp(26px, 4vw, 46px);
  padding: 0 var(--pad);
  text-align: center;
}

.sec__index {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--gold);
}

.sec__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 5.2vw, 2.3rem);
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  line-height: 1.5;
}

.sec__sub {
  margin: 14px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.sec__sub .dot { margin: 0 0.6em; opacity: 0.6; }

.sec--dark .sec__sub { color: rgba(250, 248, 244, 0.5); }
.sec--dark .sec__index { color: var(--gold-soft); }

/* ---------------- 照片瀑布流 ---------------- */

.grid {
  max-width: 1620px;
  margin: 0 auto;
  padding: 0 clamp(10px, 3.4vw, 34px);
  column-count: 2;
  column-gap: 8px;
}

@media (min-width: 620px) {
  .grid { column-count: 3; column-gap: 12px; }
}

@media (min-width: 1080px) {
  .grid { column-count: 4; column-gap: 16px; }
}

@media (min-width: 1560px) {
  .grid { column-count: 5; }
}

.card {
  position: relative;
  margin: 0 0 8px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  overflow: hidden;
  background: var(--paper-3);
  cursor: zoom-in;
  border-radius: 2px;
}

@media (min-width: 620px) {
  .card { margin-bottom: 12px; }
}

@media (min-width: 1080px) {
  .card { margin-bottom: 16px; border-radius: 3px; }
}

.card__blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(14px) saturate(1.1);
  transform: scale(1.06);
  opacity: 1;
  transition: opacity 0.7s var(--ease);
}

.card.is-loaded .card__blur { opacity: 0; }

.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 1.1s var(--ease);
}

.card.is-loaded .card__img { opacity: 1; }

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.22));
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover .card__img { transform: scale(1.045); }
  .card:hover::after { opacity: 1; }
}

.card:active { transform: scale(0.985); transition: transform 0.2s; }

/* ---------------- 影片 ---------------- */

.films {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4.4vw, 44px);
  display: grid;
  gap: clamp(14px, 2.4vw, 26px);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .films { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1120px) {
  .films { grid-template-columns: repeat(3, 1fr); }
}

.film {
  cursor: pointer;
  outline: none;
}

.film__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--night-2);
  border-radius: 2px;
  isolation: isolate;
}

.film__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.94) brightness(0.92);
}

.film__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.42));
  transition: opacity 0.5s;
}

.film__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(52px, 12vw, 64px);
  height: clamp(52px, 12vw, 64px);
  margin: calc(clamp(52px, 12vw, 64px) / -2) 0 0 calc(clamp(52px, 12vw, 64px) / -2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding-left: 3px;
  transition: transform 0.45s var(--ease), background 0.45s;
}

@media (hover: hover) {
  .film:hover .film__cover img { transform: scale(1.05); filter: saturate(1) brightness(1); }
  .film:hover .film__play { transform: scale(1.08); background: rgba(255, 255, 255, 0.24); }
}

.film__meta {
  padding: 16px 2px 0;
}

.film__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.02rem, 3.6vw, 1.2rem);
  letter-spacing: 0.16em;
  color: var(--paper);
}

.film__desc {
  margin: 7px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: rgba(250, 248, 244, 0.56);
}

/* ---------------- 页脚 ---------------- */

.foot {
  padding: clamp(46px, 7vw, 88px) var(--pad) calc(clamp(46px, 7vw, 88px) + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--night);
  color: rgba(250, 248, 244, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.foot__mark {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.8;
}

.foot__text {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(250, 248, 244, 0.62);
}

.foot__year {
  margin: 10px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.3em;
  opacity: 0.55;
}

/* ---------------- 滚动出现 ---------------- */
/* 只在 JS 可用时才隐藏，避免脚本出问题时整页空白 */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------------- 大图查看 ---------------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(8, 7, 6, 0.975);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadein 0.28s ease;
}

.lb[hidden] { display: none; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.lb__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(58px + env(safe-area-inset-top)) 8px 8px;
  min-height: 0;
  overflow: hidden;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.lb__img.is-on { opacity: 1; }

.lb__btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s, transform 0.3s, opacity 0.3s;
}

.lb__btn:hover { background: rgba(255, 255, 255, 0.16); }

.lb__close {
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  width: 38px;
  height: 38px;
}

.lb__nav {
  top: 50%;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  opacity: 0.55;
}

.lb__nav:hover { opacity: 1; }
.lb__prev { left: 10px; }
.lb__next { right: 10px; }

@media (max-width: 700px) {
  .lb__nav { width: 36px; height: 36px; margin-top: -18px; opacity: 0.4; }
  .lb__prev { left: 4px; }
  .lb__next { right: 4px; }
}

.lb__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 5vw, 34px);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.66);
}

.lb__count { font-variant-numeric: tabular-nums; }

.lb__auto,
.lb__save {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.lb__auto:hover,
.lb__save:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lb__auto.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ---------------- 视频播放 ---------------- */

.vm {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  background: #060505;
  animation: fadein 0.25s ease;
}

.vm[hidden] { display: none; }

.vm__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px 18px;
}

.vm__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.86);
}

.vm__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
}

.vm__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 0 calc(14px + env(safe-area-inset-bottom));
}

.vm__video {
  width: 100%;
  height: 100%;
  max-width: min(1280px, 100%);
  object-fit: contain;
  background: #000;
  outline: none;
}

/* ---------------- 空状态 ---------------- */

.empty {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 24px;
  text-align: center;
}

.empty__mark { margin: 0 0 6px; color: var(--gold); font-size: 20px; }
.empty__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: 0.2em; }
.empty__text { margin: 8px 0; color: var(--muted); font-size: 14px; }
.empty__code {
  margin: 6px 0 12px;
  padding: 12px 18px;
  background: var(--paper-2);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
}

/* ---------------- 无障碍 / 减弱动效 ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
