/* ============================================================
   style.css  v3.1  — 前台完整样式
   ============================================================ */

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

:root {
  --theme:     #6366f1;
  --theme-rgb: 99,102,241;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: #08080e;
  color: #e2e8f0;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a    { color: inherit; text-decoration: none; }
img  { max-width: 100%; display: block; }

/* ============================================================
   动画
   ============================================================ */
@keyframes fadeUp   { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes scaleIn  { from{opacity:0;transform:scale(.9)} to{opacity:1;transform:scale(1)} }
@keyframes popIn    { 0%{transform:scale(0)} 60%{transform:scale(1.12)} 100%{transform:scale(1)} }
@keyframes shimmer  { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
@keyframes slideInR { from{opacity:0;transform:translateX(40px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideInL { from{opacity:0;transform:translateX(-40px)} to{opacity:1;transform:translateX(0)} }
@keyframes float    { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes particle { 0%{transform:translateY(0) scale(1);opacity:.5} 100%{transform:translateY(-100vh) scale(0);opacity:0} }

/* ============================================================
   404
   ============================================================ */
.page-404 {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a1a, #1a1032);
}
.err-box { text-align: center; animation: fadeUp .5s; }
.err-num {
  font-size: clamp(80px, 18vw, 140px);
  font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.err-msg  { font-size: 18px; color: #94a3b8; margin: 16px 0 32px; }
.err-back {
  display: inline-block;
  padding: 13px 32px;
  background: rgba(255,255,255,.07);
  color: #fff;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.1);
  font-weight: 600;
  transition: .3s;
}
.err-back:hover { background: rgba(255,255,255,.13); transform: translateY(-2px); }

/* ============================================================
   首页
   ============================================================ */
.page-home { min-height: 100vh; }

/* Hero */
.home-hero {
  position: relative;
  padding: 96px 20px 72px;
  text-align: center;
  overflow: hidden;
}
.home-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #121230 30%, #1e1060 60%, #3730a3 100%);
}
.home-hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(99,102,241,.25), transparent 60%);
}
.home-hero-content {
  position: relative;
  z-index: 1;
}
.home-hero-icon  { font-size: 56px; display: block; margin-bottom: 16px; animation: float 3s infinite; }
.home-hero-title {
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -.02em;
  animation: fadeUp .6s;
}
.home-hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,.4);
  animation: fadeUp .6s .12s both;
}

/* 相册列表 */
.home-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  max-width: 1280px;
  margin: -36px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.home-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s, border-color .4s;
  animation: fadeUp .6s var(--delay,0s) both;
  display: block;
  text-decoration: none;
}
.home-item:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 50px rgba(0,0,0,.4);
  border-color: rgba(var(--theme-rgb),.3);
}

.home-item-cover {
  height: 210px;
  overflow: hidden;
  position: relative;
}
.home-item-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s;
  display: block;
}
.home-item:hover .home-item-cover img { transform: scale(1.08); }
.home-item-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px;
  animation: float 3s infinite;
}
.home-item-shine {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .6s;
}
.home-item:hover .home-item-shine { transform: translateX(100%); }

.home-item-info { padding: 18px 20px; }
.home-item-name {
  font-size: 17px; font-weight: 700; color: #fff;
  margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-item-meta { font-size: 13px; color: rgba(255,255,255,.3); }

.home-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px;
  color: #475569;
  font-size: 16px;
}

.site-footer {
  text-align: center;
  padding: 32px;
  color: rgba(255,255,255,.12);
  font-size: 13px;
}

/* ============================================================
   相册页 — 头部
   ============================================================ */
.page-album { min-height: 100vh; }

.album-head {
  position: relative;
  min-height: 260px;
  display: flex; align-items: flex-end;
  padding: 28px 24px 40px;
  overflow: hidden;
}
.album-head-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.3);
  transform: scale(1.12);
}
.album-head-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.65) 100%);
}
.album-back {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .3s;
}
.album-back-logo img {
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
  transition: transform .3s, filter .3s;
}
.album-back-logo:hover img {
  transform: scale(1.06);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.6));
}
.album-head-info {
  position: relative;
  z-index: 5;
  max-width: 100%;
  animation: fadeUp .6s;
  margin-top:50px;
}
.album-head-title {
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -.02em;
}
.album-head-desc {
  font-size: 15px;
  color: rgba(255,255,255,.55);
  line-height: 1.75;
}
.album-photo-count {
  font-size: 14px;
  color: rgba(255,255,255,.45);
  margin-top: 8px;
}

/* ============================================================
   目录墙
   ============================================================ */
.dir-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.dir-tile {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  animation: fadeUp .55s var(--delay,0s) both;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s;
}
.dir-tile:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: 0 26px 54px rgba(0,0,0,.5);
}
.dir-tile-cover { position: absolute; inset: 0; }
.dir-tile-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s; display: block;
}
.dir-tile:hover .dir-tile-cover img { transform: scale(1.09); }
.dir-tile-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

.dir-tile-info {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.01) 50%, rgba(0,0,0,.1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
}
.dir-tile-name {
  font-size: 20px; font-weight: 700;
  color: #fff; margin-bottom: 4px;
}
.dir-tile-cnt  { font-size: 13px; color: rgba(255,255,255,.45); }
.dir-tile-arrow{
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.65);
  margin-top: 10px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .3s;
}
.dir-tile:hover .dir-tile-arrow { opacity: 1; transform: translateY(0); }

/* ============================================================
   目录内照片头部
   ============================================================ */
.dir-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1440px;
  margin: 0 auto;
}
.back-to-dirs {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: .25s;
}
.back-to-dirs:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}
.dir-photos-count {
  color: rgba(255,255,255,.6);
  font-size: 15px;
}

/* ============================================================
   瀑布流
   ============================================================ */
.masonry {
  column-count: 4;
  column-gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  cursor: pointer;
  transition: transform .38s cubic-bezier(.4,0,.2,1), box-shadow .38s, border-color .38s;
}
.masonry-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(0,0,0,.35);
  border-color: rgba(var(--theme-rgb), .3);
}
.masonry-item img {
  display: block; width: 100%; height: auto;
  transition: transform .45s;
}
.masonry-item:hover img { transform: scale(1.04); }

.masonry-item img.lazy {
  opacity: 0;
  min-height: 110px;
  background: linear-gradient(90deg, #141420 25%, #1c1c32 50%, #141420 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.masonry-item img.loaded {
  opacity: 1;
  background: none;
  animation: none;
  transition: opacity .4s, transform .45s;
}

.masonry-caption {
  padding: 10px 14px;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.05);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 1100px) { .masonry { column-count: 3; } }
@media (max-width: 720px)  {
  .masonry { column-count: 2; padding: 18px 12px; column-gap: 9px; }
  .masonry-item { margin-bottom: 9px; border-radius: 10px; }
  .dir-wall { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 20px 12px; }
}
@media (max-width: 460px)  {
  .masonry { column-gap: 7px; padding: 12px 8px; }
  .masonry-item { margin-bottom: 7px; border-radius: 8px; }
}

/* ============================================================
   全屏画廊
   ============================================================ */
.gal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
}
.gal.open { display: block; animation: fadeIn .3s; }

.gal-bg {
  position: absolute; inset: 0;
  background: #000;
}

/* 关闭 */
.gal-close {
  position: absolute;
  top: 10px; right: 20px;
  z-index: 30;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
  font-family: var(--font);
  line-height: 1;
}
.gal-close:hover { color: #fff; background: rgba(255,255,255,.14); transform: rotate(90deg); }

/* 下载 */
.gal-download {
  position: absolute;
  top: 10px; right: 74px;
  z-index: 30;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
}
.gal-download:hover { color: #fff; background: rgba(255,255,255,.14); }
.gal-download:active { transform: scale(.95); }

/* 箭头 */
.gal-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 30;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
}
.gal-arrow:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}
.gal-prev { left: 16px; }
.gal-next { right: 16px; }

/* 图片舞台 */
.gal-stage {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 90px;
  display: flex; align-items: center; justify-content: center;
  padding: 70px 88px 0;
}
.gal-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  display: block;
}
.gal-img.anim-right { animation: slideInR .35s cubic-bezier(.4,0,.2,1); }
.gal-img.anim-left  { animation: slideInL .35s cubic-bezier(.4,0,.2,1); }
.gal-img.switching  { opacity: 0; transform: scale(.93); transition: opacity .18s, transform .18s; }

/* 底栏 */
.gal-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.0) 100%);
  padding: 28px 20px 16px;
}
.gal-progress-wrap { margin-bottom: 10px; }
.gal-progress-track {
  height: 3px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  overflow: hidden;
}
.gal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--theme), #a855f7);
  border-radius: 3px;
  width: 0;
  transition: width .3s ease;
}
.gal-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.gal-caption {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  max-width: 75%;
  white-space: normal;
  word-break: break-all;
  line-height: 1.5;
}
.gal-counter {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  font-weight: 500;
  flex-shrink: 0;
  background: rgba(0,0,0,.35);
  padding: 3px 10px;
  border-radius: 20px;
}

/* 结束画面 */
.gal-end {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.gal-end.show { display: flex; }

.gal-end-box {
  text-align: center;
  color: #fff;
  max-width: 460px;
  padding: 40px 24px;
  animation: scaleIn .38s cubic-bezier(.4,0,.2,1);
}
.gal-end-check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 20px;
  animation: popIn .45s .1s both;
  box-shadow: 0 10px 30px rgba(16,185,129,.3);
}
.gal-end-title { font-size: 22px; font-weight: 800; margin-bottom: 7px; }
.gal-end-sub   { color: rgba(255,255,255,.38); font-size: 15px; margin-bottom: 28px; }

.gal-end-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gal-end-btn {
  padding: 13px 28px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: .3s;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.gal-end-replay {
  background: rgba(255,255,255,.07);
  color: #fff;
  border: 1px solid rgba(255,255,255,.1);
}
.gal-end-replay:hover { background: rgba(255,255,255,.13); transform: translateY(-2px); }
.gal-end-next {
  background: linear-gradient(135deg, var(--theme), #a855f7);
  color: #fff;
  box-shadow: 0 8px 24px rgba(var(--theme-rgb),.35);
}
.gal-end-next:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(var(--theme-rgb),.45); }
.gal-end-next small  { font-size: 11px; opacity: .65; }
.gal-end-next strong { font-size: 16px; }

.gal-end-preview {
  margin-top: 22px;
  border-radius: 14px;
  overflow: hidden;
  max-width: 280px;
  margin-left: auto; margin-right: auto;
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
}
.gal-end-preview img {
  width: 100%; height: 150px; object-fit: cover; display: block;
}

@media (max-width: 720px) {
  .gal-stage  { padding: 58px 10px 0; bottom: 100px; }
  .gal-arrow  { width: 40px; height: 40px; }
  .gal-prev   { left: 6px; }
  .gal-next   { right: 6px; }
  .gal-close  { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 18px; }
  .gal-bar    { padding: 24px 14px 14px; }
  .gal-caption{ font-size: 14px; }
}


/* ============================================================
   画廊切换特效
   ============================================================ */

/* slide（已有 slideInR / slideInL，复用即可） */

/* fade */
@keyframes galFadeIn { from{opacity:0} to{opacity:1} }
.gal-img.anim-fade { animation: galFadeIn .4s ease; }

/* zoom */
@keyframes galZoomIn  { from{opacity:0;transform:scale(.75)} to{opacity:1;transform:scale(1)} }
@keyframes galZoomOut { from{opacity:0;transform:scale(1.25)} to{opacity:1;transform:scale(1)} }
.gal-img.anim-zoom-in  { animation: galZoomIn  .38s cubic-bezier(.4,0,.2,1); }
.gal-img.anim-zoom-out { animation: galZoomOut .38s cubic-bezier(.4,0,.2,1); }

/* flip */
@keyframes galFlipIn  { from{opacity:0;transform:perspective(600px) rotateY(90deg)}  to{opacity:1;transform:perspective(600px) rotateY(0)} }
@keyframes galFlipOut { from{opacity:0;transform:perspective(600px) rotateY(-90deg)} to{opacity:1;transform:perspective(600px) rotateY(0)} }
.gal-img.anim-flip-in  { animation: galFlipIn  .4s cubic-bezier(.4,0,.2,1); }
.gal-img.anim-flip-out { animation: galFlipOut .4s cubic-bezier(.4,0,.2,1); }

/* bounce */
@keyframes galBounce { 0%{opacity:0;transform:scale(.6)} 60%{transform:scale(1.06)} 80%{transform:scale(.97)} 100%{opacity:1;transform:scale(1)} }
.gal-img.anim-bounce { animation: galBounce .5s cubic-bezier(.4,0,.2,1); }
