/* ============================================
   HollowLight — Album Page
   Aesthetic: 崩坏星穹铁道「智库」/ sr-light-cone
   Deep celestial blues, starfield, luminous gold
   ============================================ */

/* --- CSS Variables (album-scoped, no global pollution) --- */
.album-page {
  --album-bg: #000;
  --album-bg-card: #0a0a0a;
  --album-bg-card-hover: #111;
  --album-surface: #0d0d0d;
  --album-border: #1e2048;
  --album-border-hover: #3a3e8a;
  --album-text: #c8cae0;
  --album-text-dim: #6b6e94;
  --album-text-bright: #e8eaff;
  --album-accent-gold: #c9a64e;
  --album-accent-gold-light: #e8d48b;
  --album-accent-blue: #4a6cf7;
  --album-accent-blue-light: #7b9aff;
  --album-accent-cyan: #5ce1e6;
  --album-glow-gold: rgba(201, 166, 78, 0.3);
  --album-glow-blue: rgba(74, 108, 247, 0.35);
  --album-glow-cyan: rgba(92, 225, 230, 0.2);
  --album-shadow: rgba(0, 0, 0, 0.6);
  --album-radius: 12px;
  --album-transition: 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --album-font-display: 'Cinzel', 'Noto Serif SC', serif;
  --album-font-body: 'Noto Sans SC', 'Segoe UI', sans-serif;
}

/* --- Page container --- */
.album-page {
  position: relative;
  min-height: 100vh;
  background: var(--album-bg);
  color: var(--album-text);
  font-family: var(--album-font-body);
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* --- Starfield background --- */
.album-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.album-starfield__layer {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  will-change: transform;
}

/* Tiny distant stars */
.album-starfield__layer--1 {
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(200, 210, 255, 0.7), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(200, 210, 255, 0.5), transparent),
    radial-gradient(1px 1px at 55% 15%, rgba(200, 210, 255, 0.6), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(200, 210, 255, 0.4), transparent),
    radial-gradient(1px 1px at 85% 40%, rgba(200, 210, 255, 0.55), transparent),
    radial-gradient(1px 1px at 20% 90%, rgba(200, 210, 255, 0.45), transparent),
    radial-gradient(1px 1px at 95% 10%, rgba(200, 210, 255, 0.5), transparent),
    radial-gradient(1px 1px at 40% 50%, rgba(200, 210, 255, 0.3), transparent),
    radial-gradient(1px 1px at 60% 35%, rgba(200, 210, 255, 0.6), transparent),
    radial-gradient(1px 1px at 5% 55%, rgba(200, 210, 255, 0.4), transparent);
  background-size: 400px 400px;
  animation: album-drift 120s linear infinite;
}

/* Medium stars */
.album-starfield__layer--2 {
  background-image:
    radial-gradient(1.5px 1.5px at 15% 45%, rgba(160, 180, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 45% 25%, rgba(201, 166, 78, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 75% 70%, rgba(160, 180, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 90% 30%, rgba(92, 225, 230, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(160, 180, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 60% 55%, rgba(201, 166, 78, 0.4), transparent);
  background-size: 600px 600px;
  animation: album-drift 180s linear infinite reverse;
}

/* Bright accent stars with twinkling */
.album-starfield__layer--3 {
  background-image:
    radial-gradient(2px 2px at 25% 30%, rgba(232, 212, 139, 0.9), transparent),
    radial-gradient(2px 2px at 65% 60%, rgba(123, 154, 255, 0.8), transparent),
    radial-gradient(2.5px 2.5px at 80% 15%, rgba(92, 225, 230, 0.7), transparent),
    radial-gradient(2px 2px at 50% 80%, rgba(232, 212, 139, 0.6), transparent);
  background-size: 800px 800px;
  animation: album-twinkle 6s ease-in-out infinite alternate, album-drift 240s linear infinite;
}

@keyframes album-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-400px); }
}

@keyframes album-twinkle {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Subtle nebula overlay */
.album-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 800px 600px at 20% 30%, rgba(74, 108, 247, 0.06), transparent),
    radial-gradient(ellipse 600px 800px at 80% 70%, rgba(201, 166, 78, 0.04), transparent),
    radial-gradient(ellipse 1000px 400px at 50% 90%, rgba(92, 225, 230, 0.03), transparent);
}

/* Noise texture overlay */
.album-page::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* --- Header --- */
.album-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 24px 32px;
}

.album-header__title {
  font-family: var(--album-font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--album-accent-gold-light), var(--album-accent-gold), var(--album-accent-blue-light));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: album-shimmer 8s ease-in-out infinite;
  margin: 0;
  line-height: 1.3;
}

@keyframes album-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.album-header__glyph {
  display: inline-block;
  margin: 0 12px;
  font-size: 0.6em;
  opacity: 0.6;
  vertical-align: middle;
}

.album-header__sub {
  font-size: 0.9rem;
  color: var(--album-text-dim);
  letter-spacing: 0.3em;
  margin-top: 12px;
  font-weight: 300;
}

/* Decorative line under header */
.album-header::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  margin: 28px auto 0;
  background: linear-gradient(90deg, transparent, var(--album-accent-gold), transparent);
}

/* --- Album Content Frame (border + radius wrapper) --- */
.album-content {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0 5% 60px;
  padding: 40px 24px 40px;
  border: 1px solid rgba(100, 110, 180, 0.25);
  border-radius: 20px;
  background: #12132a;
}

/* --- Album Tabs --- */
.album-tabs {
  position: relative;
  z-index: 1;
  padding: 0;
  margin-bottom: 40px;
  -webkit-overflow-scrolling: touch;
}

.album-tabs__track {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.album-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--album-border);
  border-radius: 100px;
  background: var(--album-surface);
  color: var(--album-text-dim);
  font-family: var(--album-font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--album-transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.album-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(135deg, var(--album-glow-gold), var(--album-glow-blue));
  transition: opacity var(--album-transition);
}

.album-tab:hover {
  border-color: var(--album-border-hover);
  color: var(--album-text-bright);
}

.album-tab:hover::before {
  opacity: 0.3;
}

.album-tab--active {
  border-color: var(--album-accent-gold);
  color: var(--album-accent-gold-light);
  background: linear-gradient(135deg, rgba(201, 166, 78, 0.12), rgba(74, 108, 247, 0.08));
  box-shadow: 0 0 20px var(--album-glow-gold), inset 0 0 20px rgba(201, 166, 78, 0.05);
}

.album-tab--active::before {
  opacity: 0.15;
}

.album-tab__icon {
  font-size: 0.65em;
  opacity: 0.5;
  transition: opacity var(--album-transition);
}

.album-tab--active .album-tab__icon {
  opacity: 1;
  color: var(--album-accent-gold);
}

.album-tab__count {
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--album-text-dim);
  font-variant-numeric: tabular-nums;
}

.album-tab--active .album-tab__count {
  background: rgba(201, 166, 78, 0.15);
  color: var(--album-accent-gold-light);
}

/* --- Album Panels --- */
.album-panels {
  position: relative;
  z-index: 1;
}

.album-panel {
  display: none;
}

.album-panel--active {
  display: block;
  animation: album-panelIn 350ms var(--album-transition) both;
}

@keyframes album-panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Photo Grid --- */
/* --- Photo Grid (masonry via CSS columns) --- */
  .album-grid {
  columns: 4;
  column-gap: 20px;
}

/* --- Photo Card --- */
.album-card {
  position: relative;
  border-radius: var(--album-radius);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  break-inside: avoid;
  margin-bottom: 20px;
  display: block;
  transition: transform var(--album-transition), box-shadow var(--album-transition);
}

.album-card:hover,
.album-card:focus-visible {
  transform: scale(1.03);
  box-shadow:
    0 0 24px var(--album-glow-blue),
    0 8px 32px var(--album-shadow);
  z-index: 2;
}

.album-card:focus-visible {
  outline: 2px solid var(--album-accent-blue-light);
  outline-offset: 2px;
}

.album-card__frame {
  position: relative;
  background: var(--album-bg-card);
  overflow: hidden;
  min-height: 60px;
}

.album-card__frame--error {
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-card__img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.4s ease;
}

.album-card:hover .album-card__img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* Index badge */
.album-card__index {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 210, 255, 0.1);
  color: var(--album-text-dim);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* Hover glow effect */
.album-card__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(123, 154, 255, 0.15),
    transparent 70%
  );
  transition: opacity var(--album-transition);
  z-index: 1;
}

.album-card:hover .album-card__glow {
  opacity: 1;
}

/* Bottom overlay */
.album-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 16px 14px;
  background: linear-gradient(to top, rgba(10, 10, 20, 0.92) 0%, rgba(10, 10, 20, 0.4) 60%, transparent 100%);
  transform: translateY(100%);
  transition: transform var(--album-transition);
  z-index: 3;
}

.album-card:hover .album-card__overlay {
  transform: translateY(0);
}

.album-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--album-text-bright);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.album-card__desc {
  font-size: 0.75rem;
  color: var(--album-text-dim);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Card entry stagger --- */
.album-card {
  opacity: 0;
  animation: album-cardIn 400ms ease both;
}

.album-card:nth-child(1) { animation-delay: 40ms; }
.album-card:nth-child(2) { animation-delay: 80ms; }
.album-card:nth-child(3) { animation-delay: 120ms; }
.album-card:nth-child(4) { animation-delay: 160ms; }
.album-card:nth-child(5) { animation-delay: 200ms; }
.album-card:nth-child(6) { animation-delay: 240ms; }
.album-card:nth-child(7) { animation-delay: 280ms; }
.album-card:nth-child(8) { animation-delay: 320ms; }
.album-card:nth-child(9) { animation-delay: 360ms; }
.album-card:nth-child(10) { animation-delay: 400ms; }
.album-card:nth-child(11) { animation-delay: 440ms; }
.album-card:nth-child(12) { animation-delay: 480ms; }
.album-card:nth-child(n+13) { animation-delay: 500ms; }

@keyframes album-cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Lightbox --- */
.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-lightbox[hidden] {
  display: none;
}

.album-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: album-lbFadeIn 250ms ease both;
}

@keyframes album-lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.album-lightbox__container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px;
}

.album-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 210, 255, 0.15);
  border-radius: 50%;
  background: rgba(10, 10, 20, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--album-text);
  cursor: pointer;
  transition: all var(--album-transition);
}

.album-lightbox__close:hover {
  background: rgba(201, 166, 78, 0.15);
  border-color: var(--album-accent-gold);
  color: var(--album-accent-gold-light);
  transform: rotate(90deg);
}

/* Navigation arrows */
.album-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 210, 255, 0.1);
  border-radius: 50%;
  background: rgba(10, 10, 20, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--album-text-dim);
  cursor: pointer;
  transition: all var(--album-transition);
}

.album-lightbox__nav:hover {
  background: rgba(74, 108, 247, 0.15);
  border-color: var(--album-accent-blue);
  color: var(--album-accent-blue-light);
  transform: translateY(-50%) scale(1.1);
}

.album-lightbox__nav--prev { left: 20px; }
.album-lightbox__nav--next { right: 20px; }

/* Main image stage — 提供 3D 透视空间 */
.album-lightbox__stage {
  perspective: 1000px;
  perspective-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  animation: album-lbStageIn 500ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes album-lbStageIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- 3D card container --- */
.album-lightbox__card {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
  /* default: tilted down, large rotateX */
  transform: rotateX(4deg) rotateY(10deg);
  /* hover: stand up via transition only, no looping animation */
  transition: transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.album-lightbox__card:hover {
  transform: rotateX(0deg) rotateY(0deg);
}

/* front glass: toward viewer, real glass highlight */
.album-lightbox__card::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.02) 35%,
    rgba(255, 255, 255, 0.00) 60%,
    rgba(255, 255, 255, 0.09) 100%
  );
  box-shadow:
    inset 0  2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    inset  1px 0 0 rgba(255, 255, 255, 0.35),
    inset -1px 0 0 rgba(255, 255, 255, 0.12),
    0 0 0 0.5px rgba(255, 255, 255, 0.25),
    0 24px 60px rgba(0, 0, 0, 0.45);
  transform: translateZ(26px);
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  outline: 2.5px solid rgba(201, 166, 78, 0.6);
  outline-offset: -8px;
}

/* back glass: symmetric behind image, same inset -> edge visible = thickness */
.album-lightbox__card::after {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 16px;
  border: 1.5px solid rgba(200, 210, 255, 0.3);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(15, 15, 28, 0.75)   50%,
    rgba(8,  8,  18, 0.88)  100%
  );
  box-shadow:
    inset 0 -2px 0 rgba(255, 255, 255, 0.28),
    inset 0  1px 0 rgba(0, 0, 0, 0.5),
    inset 0  0 40px rgba(0, 0, 0, 0.55),
    0 3px 0 1px rgba(30, 35, 80, 0.65),
    0 7px 8px rgba(0, 0, 0, 0.4);
  transform: translateZ(-26px);
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.album-lightbox__img {
  display: block;
  max-width: 58vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  /* img 在 Z=0，夹在前后玻璃之间 */
  box-shadow: 0 0 0 3px rgba(160, 165, 190, 0.55), 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: opacity 200ms ease;
}

.album-lightbox__img.album-lightbox__img--loading {
  opacity: 0.3;
}

/* Info bar */
.album-lightbox__info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 12px 28px;
  border-radius: 100px;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 210, 255, 0.08);
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: album-lbInfoIn 400ms ease 150ms both;
}

@keyframes album-lbInfoIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.album-lightbox__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--album-text-bright);
  margin: 0;
  display: inline;
}

.album-lightbox__desc {
  font-size: 0.78rem;
  color: var(--album-text-dim);
  margin: 0;
  display: inline;
}

.album-lightbox__desc:not(:empty)::before {
  content: ' · ';
  color: var(--album-border-hover);
}

.album-lightbox__counter {
  font-size: 0.72rem;
  color: var(--album-accent-gold);
  margin-left: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* --- Empty State --- */
.album-empty {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px;
}

.album-empty__icon {
  font-size: 3rem;
  color: var(--album-accent-gold);
  opacity: 0.3;
  margin-bottom: 16px;
}

.album-empty__text {
  font-size: 1.1rem;
  color: var(--album-text-dim);
  margin: 0 0 8px;
}

.album-empty__hint {
  font-size: 0.82rem;
  color: rgba(107, 110, 148, 0.6);
  margin: 0;
  font-family: 'Courier New', monospace;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
  .album-content {
    max-width: 100%;
    margin: 0 16px 40px;
    padding: 32px 16px;
  }
  .album-grid {
    columns: 3;
    column-gap: 16px;
  }
}

@media (max-width: 768px) {
  .album-content {
    margin: 0 12px 32px;
    padding: 28px 12px;
    border-radius: 14px;
  }
  .album-grid {
    columns: 2;
    column-gap: 12px;
  }

  .album-header {
    padding: 40px 16px 24px;
  }

  .album-header__title {
    letter-spacing: 0.08em;
  }

  .album-header__sub {
    letter-spacing: 0.15em;
    font-size: 0.8rem;
  }

  .album-tabs__track {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .album-tabs__track::-webkit-scrollbar {
    display: none;
  }

  .album-tab {
    padding: 8px 18px;
    font-size: 0.82rem;
  }

  .album-lightbox__container {
    padding: 16px;
  }

  .album-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .album-lightbox__nav--prev { left: 8px; }
  .album-lightbox__nav--next { right: 8px; }

  .album-lightbox__info {
    bottom: 16px;
    padding: 10px 20px;
    border-radius: 12px;
    max-width: 90vw;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .album-grid {
    columns: 2;
    column-gap: 10px;
  }

  .album-card__overlay {
    transform: translateY(0);
    padding: 20px 10px 10px;
  }

  .album-card__title {
    font-size: 0.78rem;
  }

  .album-card__desc {
    display: none;
  }

  .album-card__index {
    font-size: 0.6rem;
    padding: 2px 7px;
    top: 6px;
    right: 6px;
  }
}
