/* ============================================================
 * gallery.css · 照片墙样式（模板风 v2）
 * 配色沿用全站契约（design-system.md v1.0）：暗底 #080908 + 酸绿 #c7ff38
 * 直角硬边 · 细线分隔 · 无渐变无辉光 · 皮肤更换，数据流/类名结构不变
 * ============================================================ */

/* ---------- 模板风页头（复用 site.css 的 .hero，追加细线分隔） ---------- */
.gal-head {
  padding-top: 44px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 46px;
}
.gal-crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 30px;
}
.gal-crumb a { color: var(--muted); transition: color .2s; }
.gal-crumb a:hover { color: var(--acid); }
.gal-crumb-sep { color: var(--dim); }
.gal-crumb-cur { color: var(--acid); }

/* ---------- 状态行 ---------- */
.gal-status {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--dim);
  margin: 0 0 20px;
}
.gal-status code {
  color: var(--acid);
  background: rgba(199, 255, 56, .07);
  border: 1px solid rgba(199, 255, 56, .25);
  border-radius: 0;
  padding: 1px 6px;
  font-size: 11px;
}

/* ---------- 网格 ---------- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gal-card {
  margin: 0;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .25s ease;
}
.gal-card:hover {
  border-color: var(--line-strong);
}

.gal-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
  line-height: 0;
}
.gal-btn:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}

/* 统一 3:2 横版，顶部对齐 —— 与全站作品卡一致 */
.gal-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #181b16;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.gal-card:hover .gal-img { transform: scale(1.045); }

/* 悬停角标：酸绿块直角，滑入呈现（模板 .project-art:after 同款机制） */
.gal-zoom {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1;
  color: #080908;
  background: var(--acid);
  border-radius: 0;
  opacity: 0;
  transform: translateY(44px);
  transition: opacity .25s ease, transform .25s ease;
}
.gal-card:hover .gal-zoom {
  opacity: 1;
  transform: translateY(0);
}

.gal-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}
.gal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gal-size {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}

/* ---------- 骨架屏 ---------- */
.gal-skel-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: linear-gradient(100deg, rgba(242,244,238,.03) 30%,
              rgba(199,255,56,.06) 50%, rgba(242,244,238,.03) 70%);
  background-size: 220% 100%;
  animation: galShimmer 1.4s linear infinite;
}
@keyframes galShimmer {
  from { background-position: 140% 0; }
  to   { background-position: -40% 0; }
}

/* ---------- 空状态 ---------- */
.gal-empty {
  grid-column: 1 / -1;
  padding: 46px 26px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 0;
  background: rgba(199, 255, 56, .04);
}
.gal-empty-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.gal-empty-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.gal-empty-sub code {
  color: var(--acid);
  background: rgba(199, 255, 56, .07);
  border: 1px solid rgba(199, 255, 56, .25);
  border-radius: 0;
  padding: 1px 6px;
  font-size: 12px;
}

.gal-note {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--mono);
  letter-spacing: .5px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(8, 9, 8, .95);
  animation: lbIn .22s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

body.lb-open { overflow: hidden; }

.lb-img {
  grid-column: 2;
  grid-row: 1;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 0;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

.lb-cap {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: center;
}

.lb-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease, color .22s ease;
}
.lb-btn:hover {
  color: #080908;
  background: var(--acid);
  border-color: var(--acid);
}
.lb-close { position: absolute; top: 20px; right: 20px; z-index: 2; }
.lb-prev  { grid-column: 1; grid-row: 1; }
.lb-next  { grid-column: 3; grid-row: 1; }

/* ---------- 手机适配 ---------- */
@media (max-width: 760px) {
  .gal-head { padding-top: 30px; padding-bottom: 26px; margin-bottom: 32px; }
  .gal-crumb { margin-bottom: 22px; }

  .gal-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .gal-cap { padding: 8px 10px; }
  .gal-name { font-size: 12px; }
  .gal-size { display: none; }

  /* 移动端无 hover：角标常驻（契约 §4.2） */
  .gal-zoom { opacity: 1; transform: none; }

  .lightbox { padding: 14px; }
  .lb-img { max-height: calc(100vh - 120px); }
  .lb-btn { width: 38px; height: 38px; font-size: 19px; }
  .lb-prev, .lb-next {
    position: absolute;
    bottom: 22px;
    z-index: 2;
  }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-cap  { padding-bottom: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .gal-skel-img { animation: none; }
  .lightbox { animation: none; }
  .gal-img { transition: none; }
}
