/* ============================================================
   images.css - 图片栏目样式
   加载页面：/index.html（精选图片）、/images/index.html（图片画廊）
   ============================================================ */

.card-grid .image-grid {
  --grid-min: 250px;
}
/* ---------- 图片卡片 ---------- */
.image-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.img-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--code-bg);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  margin-bottom: 12px;
  aspect-ratio: 4 / 3;
}
.img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.img-thumb-btn:hover .img-thumb {
  transform: scale(1.04);
  opacity: 0.92;
}
.image-card .ic-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-card .ic-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- 灯箱 ---------- */
.img-lightbox-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: img-lightbox-fade 0.2s ease;
}
@keyframes img-lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.img-lightbox {
  position: relative;
  max-width: min(1000px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: img-lightbox-pop 0.2s ease;
}
@keyframes img-lightbox-pop {
  from { transform: scale(0.97) translateY(6px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.img-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.img-lightbox-close:hover { background: rgba(0, 0, 0, 0.8); }
.img-lightbox-img {
  max-width: 100%;
  max-height: calc(90vh - 110px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.img-lightbox-info {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.img-lightbox-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.img-lightbox-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
