/* ============================================================
   Detail Panel — 从右侧滑入的详情面板 (detail-info frame)
   左边缘停在页面宽度 40% 处，右边缘贴住页面右侧
============================================================ */

/* archive 图片列表退场过渡 — detail 展开/收起时淡出/淡入
   文字条（archiveTextLeft/Right/Center）不受影响，保持可见
   ★ 改 0.5s 调整时长 */
#imageContainer {
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 面板主体 */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 60%;
  height: 100vh;
  background: transparent; /* ★ 1. 无背景色 — 如需填色改这里 */
  z-index: 250;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  /* ★ 滑入动效 — 改这里调整时长和缓动曲线 */
  transform: translateX(100%);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-panel.is-open {
  transform: translateX(0);
}

.detail-panel::-webkit-scrollbar {
  display: none;
}

/* 横向排列的图片容器 */
.detail-images {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;           /* ★ 4. 图片之间的间距 */
  padding: 0 48px 0 0; /* ★ 4. 左侧无 padding，第一张图片与面板左边界对齐；右侧留白 */
  min-width: max-content;
}

/* 单张媒体包裹层 — 固定 16:9 比例 */
.detail-media-wrap {
  flex: none;
  height: 60vh;
  width: auto; /* 宽度由图片原始宽高比自适应 */
  background: #D9D9D9;
  overflow: hidden;
  border-radius: 2px;
}

.detail-media-wrap img,
.detail-media-wrap video {
  width: auto;
  height: 100%;
  display: block;
}

/* ============================================================
   Detail Info Panel (detail-info frame) — archive 区域内原地展开
   left 与 .archive-side-text--center 对齐，top 由 JS 控制
============================================================ */
.detail-info-panel {
  position: absolute;
  left: 300px; /* ★ 与 .archive-side-text--center 对齐 — 改这里调整位置 */
  right: calc(60% + var(--detail-info-panel-gap, 20px));
  max-width: var(--detail-info-max-width, 320px);
  height: 492px;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

/* 顶部区块
   ★ gap 说明（改这里调整间距）：
     .di-top gap:         标题块 ↔ 年份 之间的距离
     .di-title-block gap: TYPE+名称块 ↔ 描述文字 之间的距离
     .di-type-name gap:   TYPE ↔ 项目名称 之间的距离
     .di-bottom gap:      My Role ↔ Other 之间的距离
     .di-section gap:     标签 ↔ 内容文字 之间的距离
*/
.di-top {
  display: flex;
  flex-direction: column;
  gap: 28px; /* ★ 标题块与年份间距 */
  width: 100%;
}

.di-title-block {
  display: flex;
  flex-direction: column;
  gap: 16px; /* ★ TYPE+名称 与 描述文字 间距 */
  width: 100%;
}

/* TYPE + 项目名 */
.di-type-name {
  display: flex;
  flex-direction: column;
  gap: 4px; /* ★ TYPE 与 项目名称 间距 */
  width: 100%;
}

.di-type {
  font-size: 10px;
  font-weight: 500;
  color: #000;
  line-height: normal;
}

.di-name {
  font-size: 20px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.75);
  line-height: normal;
}

.di-desc {
  font-size: 10px;
  font-weight: 400;
  color: #8a8a8b;
  line-height: 1.5;
  width: 100%;
}

.di-year {
  font-size: 11px;
  font-weight: 400;
  color: #000;
  line-height: normal;
}

/* 底部区块 */
.di-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px; /* ★ My Role 与 Other 间距 */
  width: 100%;
}

.di-section {
  display: flex;
  flex-direction: column;
  gap: 4px; /* ★ 标签与内容文字间距 */
  width: 100%;
}

.di-label {
  font-size: 11px;
  font-weight: 400;
  color: #000;
  line-height: normal;
}

.di-value {
  font-size: 10px;
  font-weight: 400;
  color: #8a8a8b;
  line-height: 1.5;
}

.di-value a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ============================================================
   Compact 模式（≤ BREAKPOINTS.detail = 1360px，bp-detail 类）
   上下布局：文字组在上（289px 宽），图片在下（面板全宽，16:9）
   整体在面板内垂直居中
============================================================ */

/* compact 模式下隐藏独立的 #detailInfo 区块（文字改由 detail-inline-info 显示） */
.bp-detail .detail-info-panel {
  display: none;
}

/* compact 面板：从 archiveCenterLeft 到右侧，子元素绝对定位 */
.bp-detail .detail-panel {
  left: var(--archive-center-left, 300px);
  right: 0;
  width: auto;
  overflow: hidden;
}

/* 内联信息区 — 默认隐藏，compact 模式下显示 */
.detail-inline-info {
  display: none;
}

/* ★ 文字组：底边缘对齐 --detail-text-bottom */
.bp-detail .detail-inline-info {
  position: absolute;
  bottom: var(--detail-text-bottom, 82vh);
  left: 0;
  right: 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;                 /* ★ Figma Frame 15 gap：标题块 ↔ 年份 */
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.bp-detail .detail-inline-info.dii-in  { opacity: 1; }
.bp-detail .detail-inline-info.dii-out { opacity: 0; }

/* 文字内部嵌套结构（image 0）— 对应 Figma Frame 11 / Frame 10 */
.dii-title-block {
  display: flex;
  flex-direction: column;
  gap: 11px;                 /* ★ Figma Frame 11 gap：(type+name) ↔ 描述文字 */
}

.dii-type-name {
  display: flex;
  flex-direction: column;
  gap: 3px;                  /* ★ Figma Frame 10 gap：TYPE ↔ 项目名称 */
}

/* image 1/2 时的 label/value 组 */
.bp-detail .detail-inline-info .di-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ★ 图片行：顶边缘对齐 --detail-image-top，高度由 --detail-image-height 决定 */
.bp-detail .detail-images {
  position: absolute;
  top: var(--detail-image-top, 20vh);
  left: 0;
  right: 0;
  height: var(--detail-image-height, 70vh);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.bp-detail .detail-images::-webkit-scrollbar { display: none; }
.bp-detail .detail-images { scrollbar-width: none; }

/* ★ 单张图片：高度填满容器，宽度由图片原始宽高比自适应 */
.bp-detail .detail-media-wrap {
  flex-shrink: 0;
  height: 100%;
  width: auto;
}

/* ── 移动端（≤ BREAKPOINTS.archive = 710px，bp-archive 类）── */
.bp-archive .detail-panel {
  left: 20px;
}

.bp-archive .detail-inline-info {
  right: 20px;
}

/* 动画单元 — 与现有翻页效果一致：14px 位移 + 0.15s ease */
.detail-info-row {
  opacity: 0;
}

@keyframes detailInfoRowIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 退出：反向入场 — 向下淡出，顺序从外侧向中间收拢（由 JS 控制波次） */
@keyframes detailInfoRowOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(14px); }
}

.detail-info-row.row-in  { animation: detailInfoRowIn  0.15s ease forwards; }
.detail-info-row.row-out { animation: detailInfoRowOut 0.15s ease forwards; }
