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

html,
body {
  height: 100%;
}

body {
  font-family: "Diatype", "ABCDiatype", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  min-height: calc(100vh - 120px);
  width: 100%;
  background-color: #ffffff;
  padding: 40px 20px;
}

.page-layout,
.page-content,
main {
  min-height: inherit;
  width: 100%;
}

.page-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

h1 {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 40px;
  color: #1a1a1a;
  font-weight: 300;
  letter-spacing: 1px;
}

.gallery {
  column-count: 3;
  column-gap: 20px;
  perspective: 1000px;
  width: 100%;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f5f5f5;
  position: relative;
  view-transition-name: var(--transition-name);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 85vw;
  max-height: 85vh;
  z-index: 1000;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  view-transition-name: lightbox-image;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  padding: 0;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* Ultra-wide screen: 4 columns */
@media (min-width: 1601px) {
  .gallery {
    column-count: 4;
    column-gap: 20px;
  }
}

/* Large screen: 3 columns (default) */
@media (max-width: 1600px) {
  main {
    padding: 0 20px;
  }

  .gallery {
    column-count: 3;
    column-gap: 15px;
  }
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  main {
    padding: 0 20px;
  }

  .gallery {
    column-count: 2;
    column-gap: 15px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 30px 15px;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .gallery {
    column-count: 1;
    column-gap: 12px;
  }

  .gallery-item {
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 20px 10px;
    min-height: calc(100vh - 100px);
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .gallery {
    column-count: 1;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    color: #1a1a1a;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 2rem;
  }
}
