* { box-sizing: border-box; }
body {
  margin: 0; 
  font-family: Arial, sans-serif; 
  background: #111;
  color: #fff;
}
h1 {
  text-align: center; 
  margin: 20px 0 40px;
}
.grid {
  max-width: 1550px;
  margin: 0 auto;
}
.grid-sizer,
.grid-item {
  width: 100%;
}
.grid-item {
  float: left;
  overflow: hidden;
  position: relative;
}
.grid-item-inner {
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.grid-item-inner:hover {
  box-shadow: none;
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.3s ease;
  border-radius: 0;
}
.grid-item img.loaded {
  opacity: 1;
}
.grid-item-inner:hover img {
  transform: scale(1.02);
  position: relative;
  z-index: 10;
}

/* 弹出大图样式 */
#lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 20px;
}
#lightbox.show {
  opacity: 1;
  pointer-events: auto;
}
#lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  display: flex;
  align-items: center;
}
.lightbox-img-wrapper {
  display: inline-block;
  background-color: #111;
  border: 8px solid #2f2f2f;
  border-bottom-width: 60px;
  position: relative;
}
#lightbox-img {
  display: block;
  max-width: calc(80vw - 60px);
  max-height: calc(80vh - 90px);
  object-fit: contain;
  margin: 0;
  border: none;
  user-select: none;
}
#lightbox-date {
  position: absolute;
  bottom: 8px;
  left: 5px;
  width: calc(100% - 10px);
  text-align: center;
  color: #eee;
  font-size: 14px;
  font-weight: 500;
  user-select: none;
  pointer-events: none;
}
#lightbox-prev, #lightbox-next {
  background: none;
  border: none;
  color: #eee;
  font-size: 48px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  padding: 0 20px;
  transition: color 0.3s ease, transform 420ms cubic-bezier(0.25,0.1,0.25,1), opacity 300ms;
  will-change: transform, opacity;
}
#lightbox-prev:hover, #lightbox-next:hover {
  color: #f44336;
}
#lightbox-img.vertical {
  max-height: 85vh !important;
  max-width: auto !important;
}
body::after {
  content: "";
  display: block;
  height: 100px;
}

/* 新增：保持按钮占位但降低透明度（避免布局重排，同时表现“消失”） */
#lightbox-prev.hidden,
#lightbox-next.hidden {
  /* 不使用 visibility:hidden，改为透明以便平滑过渡 */
  opacity: 0.1;         /* 降低透明度，表现“消失”的视觉效果（仍保留占位） */
  pointer-events: none;  /* 禁止点击 */
}
