/* =========================================================
   郭濠亮 · 个人主页 · 相册（切换 + 灯箱）
   ========================================================= */

.album {
  --album-gap: clamp(10px, 1.4vw, 18px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--album-gap);
  align-items: stretch;
  min-height: clamp(360px, 42vw, 600px);
}

/* ---------- 左侧主图 ---------- */
.album-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #12100d;
  overflow: hidden;
}

.album-stage-btn {
  position: relative;
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.album-shots {
  position: absolute;
  inset: 0;
  display: block;
}

.album-shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .55s var(--ease), transform .9s var(--ease);
  transform: scale(1.015);
}
.album-shot.is-active {
  opacity: 1;
  transform: scale(1);
}
.album-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #12100d;
}

.album-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(60px, 9vw, 110px) clamp(14px, 2.4vw, 26px) clamp(14px, 2.2vw, 22px);
  color: #f4efe3;
  background: linear-gradient(
    to top,
    rgba(10, 8, 6, .88) 0%,
    rgba(10, 8, 6, .72) 28%,
    rgba(10, 8, 6, .42) 55%,
    rgba(10, 8, 6, 0) 100%
  );
  pointer-events: none;
}
.album-caption p { margin: 0; }
.album-caption strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  font-weight: 600;
  letter-spacing: .02em;
}
.album-caption span {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  line-height: 1.6;
  color: #cfc6b3;
}
.album-count {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .16em;
  white-space: nowrap;
  color: #d9cfba;
}

/* 切换箭头 */
.album-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-top: -21px;
  border: 1px solid rgba(244, 239, 227, .35);
  border-radius: 50%;
  background: rgba(12, 10, 8, .35);
  color: #f4efe3;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color .3s, border-color .3s, transform .3s var(--ease);
}
.album-nav:hover {
  background: rgba(12, 10, 8, .65);
  border-color: rgba(244, 239, 227, .7);
}
.album-nav--prev { left: clamp(10px, 1.6vw, 18px); }
.album-nav--next { right: clamp(10px, 1.6vw, 18px); }
.album-nav:active { transform: scale(.94); }
.album-nav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- 右侧网格 ---------- */
.album-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--album-gap);
  align-content: stretch;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.album-thumb,
.album-slot {
  flex: 1 1 calc(50% - var(--album-gap) / 2);
  max-width: calc(50% - var(--album-gap) / 2);
  min-height: 74px;
  height: auto;
}

.album-grid[data-cols="1"] .album-thumb,
.album-grid[data-cols="1"] .album-slot {
  flex-basis: 100%;
  max-width: 100%;
}

.album-thumb {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
}
.album-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s var(--ease), filter .4s;
  filter: saturate(.94);
}
.album-thumb:hover img { transform: scale(1.05); filter: saturate(1.05); }
.album-thumb:hover { border-color: var(--ink-3); }
.album-thumb.is-active {
  border-color: var(--vermilion);
  box-shadow: 0 0 0 2px var(--vermilion) inset;
}
.album-thumb.is-active::after {
  content: "";
  position: absolute;
  left: 8px; bottom: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(255, 248, 238, .65);
}
.album-thumb span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 10px 8px;
  font-family: var(--mono);
  font-size: .56rem;
  letter-spacing: .06em;
  color: #f4efe3;
  text-align: left;
  background: linear-gradient(to top, rgba(12, 10, 8, .78), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s, transform .35s var(--ease);
}
.album-thumb:hover span, .album-thumb:focus-visible span { opacity: 1; transform: none; }

/* 「我的照片」待补位 */
.album-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, var(--line-soft) 9px 10px),
    var(--paper);
  text-align: center;
  color: var(--ink-3);
}
.album-slot strong {
  font-family: var(--serif);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-2);
}
.album-slot em {
  font-family: var(--mono);
  font-style: normal;
  font-size: .54rem;
  letter-spacing: .06em;
  line-height: 1.8;
}
.album-slot .slot-plus {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 2px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--vermilion);
  transition: transform .4s var(--ease), border-color .3s;
}
.album-slot:hover .slot-plus { transform: rotate(90deg); border-color: var(--vermilion); }

/* ---------- 底部条：分组 + 说明 ---------- */
.album-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: clamp(20px, 3vw, 32px);
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.album-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.album-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: .84rem;
  letter-spacing: .05em;
  cursor: pointer;
  transition: border-color .3s, background-color .3s, color .3s;
}
.album-tab em {
  font-family: var(--mono);
  font-style: normal;
  font-size: .58rem;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.album-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.album-tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.album-tab[aria-selected="true"] em { color: rgba(244, 240, 230, .6); }

.album-hint {
  margin: 0;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .06em;
  color: var(--ink-3);
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  background: rgba(10, 9, 7, .94);
  backdrop-filter: blur(10px);
}
.lightbox.is-open { display: flex; }
.lightbox-figure {
  margin: 0;
  max-width: min(1180px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: min(76vh, 900px);
  width: auto;
  object-fit: contain;
  border: 1px solid rgba(244, 239, 227, .14);
  background: #0a0907;
}
.lightbox-figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .06em;
  color: #b9b0a0;
}
.lightbox-figure figcaption strong {
  font-family: var(--serif);
  font-size: .96rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #f4efe3;
}
.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 9001;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(244, 239, 227, .25);
  border-radius: 50%;
  background: rgba(20, 18, 15, .6);
  color: #f4efe3;
  cursor: pointer;
  transition: background-color .3s, border-color .3s;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(244, 239, 227, .16); border-color: rgba(244, 239, 227, .6); }
.lightbox-close { top: clamp(12px, 2vw, 26px); right: clamp(12px, 2vw, 26px); }
.lightbox-nav { top: 50%; margin-top: -22px; }
.lightbox-nav--prev { left: clamp(10px, 2vw, 26px); }
.lightbox-nav--next { right: clamp(10px, 2vw, 26px); }
.lightbox-close svg, .lightbox-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

body.is-locked { overflow: hidden; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .album {
    grid-template-columns: minmax(0, 1fr);
    aspect-ratio: auto;
  }
  .album-stage { aspect-ratio: 3 / 2; }
  .album-stage-btn { position: relative; aspect-ratio: 3 / 2; }
  .album-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--album-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .album-thumb,
  .album-slot {
    flex: 0 0 128px;
    max-width: none;
    width: 128px;
    height: 92px;
    scroll-snap-align: start;
  }
  .album-slot { flex: 0 0 128px; }
  .album-thumb span { display: none; }
  .album-slot em { display: none; }
  .album-slot strong { font-size: .78rem; }
}

@media (max-width: 520px) {
  .album-caption { flex-direction: column; align-items: flex-start; gap: 6px; }
  .album-nav { width: 36px; height: 36px; margin-top: -18px; }
  .album-tab { padding: 7px 13px; font-size: .8rem; }
  .album-thumb, .album-slot { flex: 0 0 112px; width: 112px; height: 82px; }
  .album-hint { display: none; }
}
