/* =======================================================
   精选作品 + 作品详情弹窗 —— 严格对齐参考站排版
   （小标签带点 / 胶囊分类 Tab / 分组标题 / 3 列卡片 / 深色弹窗）
   ======================================================= */

/* ---------------- 作品区 ---------------- */
.gallery-yk {
  padding: 48px 24px 96px;   /* 需求：整体上移，压缩顶部留白 */
  background: #fff;
  scroll-margin-top: 72px;
}
.gallery-yk .section-label {
  display: flex;
  align-items: center;
  justify-content: center;   /* 需求：小标签居中 */
  gap: 10px;
  margin: 0 0 14px;
  color: rgba(0, 0, 0, .62);
  font-size: 17px;           /* 需求：字号放大 */
  font-weight: 500;
  letter-spacing: .01em;
}
.gallery-yk .section-label::before {
  content: "";
  width: 7px; height: 7px;   /* 圆点同步放大 */
  border-radius: 50%;
  background: #111;
}

/* 分类 Tab（胶囊） */
.gallery-yk .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;   /* 需求：分类 Tab 居中 */
  margin-top: 28px;
}
.gallery-yk .tabs button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .12);
  color: rgba(0, 0, 0, .46);
  background: #fff;
  font-size: 11px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.gallery-yk .tabs button:hover { color: rgba(0, 0, 0, .8); }
.gallery-yk .tabs button.active {
  color: #fff;
  background: #111;
  border-color: #111;
}

/* 分组 */
.gallery-sections {
  display: grid;
  gap: 56px;
  max-width: 960px;
  margin: 46px auto 0;
}
.gallery-group.hidden { display: none; }
.gallery-group h3 {
  margin: 0 0 28px;
  font-size: 18px;
  font-weight: 600;
  color: #000;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 30px;
}

/* 卡片 */
.gallery-yk .work-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 0 0 8px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transform-origin: center;
  transition: transform 260ms cubic-bezier(.2, .75, .2, 1);
}
.gallery-yk .work-card:hover { transform: translateY(-6px) scale(1.01); z-index: 2; }

.gallery-yk .work-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #101010;
}
.gallery-yk .work-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;            /* 需求：封面完整显示，不裁切 */
  object-position: center center; /* 需求：居中 */
  background: #f4f4f4;
  display: block;
  transition: transform .4s ease;
}
.gallery-yk .work-card:hover .work-media img { transform: scale(1.03); }

/* View Details 胶囊：照参考站写法（绝对定位 + translate(-50%,-50%)），用 !important 压过模板残留规则 */
.gallery-yk .work-view {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(.96) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.gallery-yk .work-card:hover .work-view,
.gallery-yk .work-card:focus-visible .work-view {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) !important;
}

/* 视频角标 */
.work-media-badge {
  position: absolute;
  right: 10px; top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
}

/* 卡片下方信息 */
.gallery-yk .work-card > p {
  margin: 12px 0 0;
  padding: 0 12px;
  color: rgba(0, 0, 0, .34);
  font-size: 11px;
}
.gallery-yk .work-card > h4 {
  margin: 5px 0 0;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

/* 版本标记（临时，用于确认前端资源版本） */
.build-tag {
  margin-left: 8px;
  color: rgba(0, 0, 0, .28);
  font-size: 11px;
  font-weight: 400;
}

/* ---------------- 作品详情弹窗 ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-overlay .modal-content {
  width: min(900px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  transform: none;
}
.modal-overlay .modal-close {
  position: fixed;
  top: 22px; right: 22px;
  width: 42px; height: 42px;
  z-index: 120;
  border-radius: 50%;
  border: none;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay .modal-close:hover { background: rgba(0, 0, 0, .8); transform: none; }

/* 媒体区 */
.wm-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f2f2f2;
}
.wm-media > img { width: 100%; height: 100%; object-fit: contain; object-position: center center; display: block; background: #f2f2f2; }

/* 详情图片网格（视觉/概念类：直接铺开） */
.visual-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  padding: 24px;
}
.visual-detail-item {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: none;
  padding: 0;
  border-radius: 6px;
  background: #f2f2f2;
  cursor: zoom-in;
}
.visual-detail-item img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; transition: transform .35s ease; }
.visual-detail-item:hover img { transform: scale(1.04); }

/* 视频/漫剧类：主视觉 + 工作留痕 */
.ai-video-detail { display: grid; gap: 22px; padding: 24px; }
.ai-video-stage {
  justify-self: stretch;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #101010;
}
.ai-video-stage img { width: 100%; height: 100%; object-fit: contain; object-position: center center; display: block; background: #f2f2f2; }
.ai-video-stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #101010; }
.wm-media video { width: 100%; height: 100%; object-fit: contain; display: block; background: #101010; }
.trace-title {
  margin: 2px 0 -6px;
  color: rgba(0, 0, 0, .52);
  font-size: 13px;
  font-weight: 600;
}
.ai-video-detail .visual-detail-grid { padding: 0; }

/* 信息区 */
.modal-info { padding: 26px 28px 34px; }
.modal-category {
  margin: 0 0 8px;
  color: rgba(0, 0, 0, .34);
  font-size: 11px;
}
.modal-info h3 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #000;
}
.modal-info p.modal-desc {
  margin: 0;
  color: rgba(0, 0, 0, .62);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* 返回作品集按钮：改为文档流内，位于作品内容上方，不遮挡画面 */
.wm-back {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 18px 24px 0;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.wm-back:hover { background: #f2f2f2; border-color: rgba(0, 0, 0, .25); }


/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .gallery-yk { padding: 72px 20px; }
  .gallery-grid,
  .visual-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .gallery-grid,
  .visual-detail-grid { grid-template-columns: 1fr; }
  .modal-info { padding: 20px 18px 28px; }
}

/* 未设置主视觉时的占位提示 */
.stage-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 240px;
  color: rgba(0, 0, 0, .42);
  font-size: 13px;
  background: #f7f7f7;
}

/* 作品集模块（详情弹窗内的分区） */
.detail-groups { padding: 24px; display: grid; gap: 22px; }
.detail-groups .visual-detail-grid { padding: 0; }
.detail-group { display: grid; gap: 14px; }
.detail-group .trace-title { margin: 0; }
.ai-video-detail .detail-group { gap: 14px; }
