/* ══════════════════════════════════════════════════════════════
   房间：作品 / 图像索引 / Studio 三个整屏页面横向排开
   data-slot 0 在屏幕上，1、2 依次排在右侧；切换时整屏横移
   ══════════════════════════════════════════════════════════════ */
.room {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  transform-origin: center;
  transition: transform var(--dur-room) var(--ease-room);
  will-change: transform;
}
.room[data-slot="0"] { transform: translateX(0); }
.room[data-slot="1"] { transform: translateX(110%); }
.room[data-slot="2"] { transform: translateX(220%); }

/* Menu 总览打开时房间隐藏；关闭时房间从原位滑回各自的 slot */
body.is-overview .room { visibility: hidden; pointer-events: none; transform: none; }
body.is-busy .room { pointer-events: none; }

/* ── 作品：横向画廊 ──────────────────────────────────────────── */
.gallery-tools {
  position: absolute;
  top: 115px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.gallery-tools button { font-size: 19px; }

.gallery {
  position: absolute;
  top: calc(34vh - 24px);
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  gap: 9px;
  padding: 0 16px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  cursor: grab;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-dragging { cursor: grabbing; }

body[data-view="case"] .gallery,
body[data-view="case"] .gallery-tools { display: none; }

.card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc((66dvh - 16px) * var(--ratio));
  user-select: none;
}
.card-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 14px;
}
.card-caption span:last-child { font-size: 10px; color: var(--muted); }

.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--img-empty);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .media { flex: 1; min-height: 0; }
.card .media img { transition: transform .7s; pointer-events: none; }
.card:hover .media img { transform: scale(1.025); }

/* 开场动画期间标题先隐藏，卡片落位后再淡入 */
body.intro-running .card { transform-origin: center; will-change: transform, clip-path; }
body.intro-running .card:not(.caption-ready) .card-caption { opacity: 0; }

/* ── 图像索引 ─────────────────────────────────────────────────── */
.archive-body {
  height: 100%;
  overflow: auto;
  padding: 165px 16px 40px;
}
.section-title {
  margin-bottom: 42px;
  font-size: clamp(54px, 8vw, 130px);
  line-height: 1;
  letter-spacing: -.01em;
}
.subline {
  margin-bottom: 25px;
  font-size: 11px;
  color: #72756a;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 10px;
}
.archive-card .media {
  width: 100%;
  aspect-ratio: var(--ratio);
  margin-bottom: 9px;
}

@media (max-height: 460px) and (min-width: 651px) {
  .gallery-tools { top: 85px; }
  .gallery { top: 125px; }
  .card { width: calc((100dvh - 141px) * var(--ratio)); }
}

@media (max-width: 650px) {
  .gallery-tools { display: none; }
  .gallery {
    top: 170px;
    bottom: 0;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 30px;
  }
  .card { width: 100%; margin-bottom: 30px; }
  .card .media { flex: none; width: 100%; aspect-ratio: var(--ratio); }

  .archive-body { padding-top: 150px; }
  .section-title { letter-spacing: 0; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
}
