/* Modal styles adapted from gallery.css */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
  z-index: 1000;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.35s, /* 延迟visibility变化直到淡出完成 */
    background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; /* 背景最后退出 */
  justify-content: center;
  align-items: center;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  will-change: opacity, background-color;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0,0,0,0.9);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: 
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear, /* 立即改变visibility */
    background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  cursor: zoom-out; /* 添加这行 */
}

.modal-content {
  cursor: default; /* 添加这行 */
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  transform: scale(0.95);
  opacity: 0;
  transition: 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, /* 图片稍微延迟退出 */
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
  transform-origin: center;
  -webkit-transform-origin: center;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  -moz-user-drag: none;
  -ms-user-drag: none;
  will-change: transform, opacity;
  pointer-events: none;
  -webkit-touch-callout: none;
}

.modal-content-active {
  transform: scale(1);
  opacity: 1;
}
