.image-grid {
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: space-between;
  align-items: flex-start;
}

.image-grid::after {
  content: '';
  flex: auto;
}

.custom-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  background: #ffffff;
  transform: translateY(0);
  cursor: pointer;
  height: 250px;
  flex-grow: 1;
  flex-shrink: 0;
  min-width: 180px;
  max-width: 400px;
}

.custom-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.custom-card-cover {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.custom-card-thumbnail {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  display: block;
}

.custom-card:hover .custom-card-thumbnail {
  transform: scale(1.05);
}

.custom-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: white;
}

.custom-card:hover .custom-card-overlay {
  opacity: 1;
}

.custom-card-info {
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0;
}

.custom-card:hover .custom-card-info {
  transform: translateY(0);
  opacity: 1;
}

.custom-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.custom-card-tags-container {
  margin-top: 4px;
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.image-tag {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  color: #ffffff;
  display: inline-block;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.custom-card-indicators {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center; /* 确保垂直对齐 */
  padding: 0 8px;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
}

.custom-card-left-indicators { /* 新增样式 */
  display: flex;
  align-items: center;
  gap: 6px; /* 指示器之间的间距 */
}

.custom-card:hover .custom-card-indicators {
  opacity: 1;
}

.custom-card-permission {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-card-storage-mode { /* 新增样式 */
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-card-metadata {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

.custom-card-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 6px;
}

.custom-card-action-item {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}

.custom-card-action-item:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.context-menu {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 8px 0;
  min-width: 160px;
  z-index: 1000;
}

.context-menu-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.context-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.custom-card-selected {
  box-shadow: 0 0 0 3px #1890ff, 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.custom-card-selected::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #1890ff;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-card-selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  z-index: 6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.image-grid-pagination {
  margin-top: 40px;
  text-align: center;
}

.image-loading-effect {
  position: relative;
  overflow: hidden;
}

.image-loading-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .custom-card {
    height: 150px;
  }

  .custom-card-overlay {
    padding: 12px;
  }

  .custom-card-title {
    font-size: 12px;
  }

  .custom-card-actions {
    gap: 4px;
  }

  .custom-card-action-item {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .custom-card {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .custom-card-overlay {
    padding: 8px;
  }
}