* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #26364a;
  background: #e7edf7;
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #e7edf7 url("../assets/bg.webp") center / cover no-repeat;
  filter: blur(5px);
  transform: scale(1.05);
  pointer-events: none;
}

.photos-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(70%, 1100px);
  min-width: 280px;
  gap: 20px;
  margin: 0 auto;
  padding: 100px 0 30px;
}

.glass-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(128%);
  -webkit-backdrop-filter: blur(16px) saturate(128%);
}

.photos-intro {
  min-height: 0;
  margin: 0;
  padding: clamp(32px, 6vw, 64px) 28px 30px;
  text-align: center;
  animation: photo-rise-in 0.65s ease both;
}

.eyebrow {
  margin: 0;
  color: #526f9b;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.photos-intro h1 {
  margin: 12px 0 0;
  color: #1e3049;
  font-size: clamp(2.4rem, 7vw, 4.1rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

.photos-intro h1 span {
  color: #477df4;
}

.intro-copy {
  margin: 16px 0 0;
  color: #526176;
  font-size: 1rem;
  line-height: 1.7;
}

.intro-divider {
  width: min(100%, 520px);
  height: 1px;
  margin: 22px auto 16px;
  background: linear-gradient(90deg, transparent, rgba(71, 125, 244, 0.42), transparent);
}

.intro-note {
  margin: 0;
  color: #526176;
  font-size: 0.82rem;
}

.category-nav,
.gallery,
.usage-note {
  margin: 0;
  padding: 24px;
  animation: photo-rise-in 0.6s ease both;
}

.section-heading,
.category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 7px 0 0;
  color: #26364a;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.collection-count,
.category-kicker {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.category-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.category-link {
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  color: #314760;
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.9rem;
  font-weight: 650;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.category-link:hover {
  transform: translateY(-2px);
  border-color: rgba(71, 125, 244, 0.26);
  background: rgba(255, 255, 255, 0.68);
}

.category-number {
  color: #6684b1;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.link-arrow {
  margin-left: auto;
  color: #477df4;
  font-size: 1.1rem;
}

.gallery-heading {
  margin-bottom: 20px;
}

.gallery-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.74rem;
}

.gallery-load-more {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(71, 125, 244, 0.2);
  border-radius: 11px;
  color: #365f9f;
  background: rgba(255, 255, 255, 0.58);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}

.gallery-load-more:hover {
  background: rgba(255, 255, 255, 0.86);
}

.gallery-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.gallery-empty-state {
  display: grid;
  min-height: 220px;
  place-content: center;
  justify-items: center;
  padding: 28px 16px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
}

.gallery-empty-state[hidden],
.gallery-load-more[hidden] {
  display: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-card {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.photo-card-trigger {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-card-trigger:focus-visible {
  border-radius: 14px;
  outline: 2px solid rgba(71, 125, 244, 0.42);
  outline-offset: -2px;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(100, 116, 139, 0.12);
  transition: transform 0.22s ease;
}

.photo-card-trigger:hover img {
  transform: scale(1.035);
}

.photo-dialog {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: min(90vh, 900px);
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  color: #26364a;
  background: rgba(247, 249, 253, 0.98);
  box-shadow: 0 28px 90px rgba(7, 16, 33, 0.35);
}

.photo-dialog::backdrop {
  background: rgba(13, 22, 38, 0.7);
  backdrop-filter: blur(5px);
}

.photo-dialog-panel {
  position: relative;
  display: grid;
  max-height: min(90vh, 900px);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: inherit;
}

.photo-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #fff;
  background: rgba(18, 27, 43, 0.58);
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.photo-dialog-close:hover {
  background: rgba(18, 27, 43, 0.82);
}

.photo-dialog-image {
  display: block;
  width: 100%;
  min-height: 0;
  max-height: min(72vh, 720px);
  object-fit: contain;
  background: #101725;
}

.photo-dialog-description {
  padding: 18px 22px 20px;
}

.photo-dialog-description h2 {
  margin: 0 0 10px;
  color: #26364a;
  font-size: 1rem;
}

.photo-dialog-description p {
  margin: 5px 0 0;
  color: #526176;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.photo-dialog-description p:only-child {
  margin-top: 0;
}

@media (max-width: 520px) {
  .photo-dialog {
    width: calc(100% - 20px);
    max-height: 92vh;
    border-radius: 16px;
  }

  .photo-dialog-panel {
    max-height: 92vh;
  }

  .photo-dialog-image {
    max-height: 68vh;
  }

  .photo-dialog-description {
    padding: 15px 17px 18px;
  }
}

.gallery-load-more {
  display: flex;
  margin: 18px auto 0;
  padding: 0 18px;
}

.gallery-load-more:disabled {
  cursor: wait;
  opacity: 0.65;
}

.gallery-retry {
  min-height: 34px;
  margin-top: 16px;
  padding: 0 12px;
  border: 1px solid rgba(71, 125, 244, 0.2);
  border-radius: 11px;
  color: #365f9f;
  background: rgba(255, 255, 255, 0.58);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}

.gallery-retry[hidden] {
  display: none;
}

.gallery-empty-icon {
  color: #6b8bb8;
  font-size: 2.4rem;
  line-height: 1;
}

.gallery-empty-state h3 {
  margin: 14px 0 6px;
  color: #31445c;
  font-size: 1rem;
}

.gallery-empty-state p {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.7;
}

.usage-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
}

.note-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(71, 125, 244, 0.18);
  border-radius: 50%;
  color: #3264d3;
  background: rgba(71, 125, 244, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
}

.usage-note h2 {
  margin: 0 0 4px;
  color: #31445c;
  font-size: 0.82rem;
}

.usage-note p {
  margin: 0;
  color: #526176;
  font-size: 0.74rem;
  line-height: 1.6;
}

.usage-note > a {
  flex: 0 0 auto;
  margin-left: auto;
  color: #3264d3;
  font-size: 0.76rem;
  font-weight: 650;
}

.photos-footer {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px 8px;
  color: #526176;
  font-size: 0.73rem;
}

.photos-footer a {
  color: #365f9f;
  font-weight: 650;
}

@keyframes photo-rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .photos-shell {
      width: 92%;
      min-width: 0;
      gap: 14px;
      padding-top: 92px;
  }

  .glass-card {
      border-radius: 20px;
  }

  .category-nav,
  .gallery,
  .usage-note {
      padding: 18px;
  }

}

@media (max-width: 480px) {
  .photos-shell {
      width: 94%;
  }

  .photos-intro {
      padding: 30px 18px 24px;
  }

  .section-heading,
  .category-heading {
      align-items: flex-start;
  }

  .photo-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
  }

  .category-links {
      grid-template-columns: 1fr;
      gap: 8px;
      margin-top: 14px;
  }

  .usage-note {
      align-items: flex-start;
      flex-wrap: wrap;
  }

  .usage-note > div {
      flex: 1 1 calc(100% - 48px);
  }

  .usage-note > a {
      margin-left: 42px;
  }
}

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