html.embed-image-bank-mode nav.navbar {
  display: none;
}

html.embed-image-bank-mode main.container-fluid {
  padding: 12px;
  max-width: 100%;
}

html.embed-image-bank-mode .group-actions {
  display: none;
}

html.embed-image-bank-mode #groupsList .image-group-tree-item {
  align-items: center;
}

html.embed-image-bank-mode #groupsList .group-name-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.embed-image-bank-mode #groupsList .group-toggle,
html.embed-image-bank-mode #groupsList .group-toggle-placeholder,
html.embed-image-bank-mode #groupsList .image-group-tree-item i {
  flex: 0 0 auto;
}

#embedInlineGroupPicker .embed-inline-group-label {
  font-size: 13px;
  color: #6c757d;
  white-space: nowrap;
  margin-bottom: 0;
}

#embedInlineGroupPicker .custom-select-wrapper {
  min-width: 220px;
}

#embedInlineGroupPicker .custom-select-trigger {
  min-width: 220px;
  height: 36px;
}

#embedGroupDropdown {
  width: 280px;
}

html.embed-image-bank-mode.embed-viewer-mode .image-toolbar {
  min-height: 48px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--separator), white 20%);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

html.embed-image-bank-mode.embed-viewer-mode .image-toolbar-right {
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

html.embed-image-bank-mode.embed-viewer-mode .image-toolbar-search {
  min-width: min(300px, 100%);
  max-width: 360px;
  flex: 1 1 240px;
}

html.embed-image-bank-mode.embed-viewer-mode .image-sort-trigger,
html.embed-image-bank-mode.embed-viewer-mode .custom-select-trigger,
html.embed-image-bank-mode.embed-viewer-mode
  .image-toolbar-search
  .image-library-search__input {
  height: 34px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

@media (max-width: 900px) {
  html.embed-image-bank-mode.embed-viewer-mode .image-toolbar-right {
    justify-content: flex-start;
  }

  html.embed-image-bank-mode.embed-viewer-mode #embedInlineGroupPicker,
  html.embed-image-bank-mode.embed-viewer-mode .image-sort-control,
  html.embed-image-bank-mode.embed-viewer-mode .image-toolbar-search {
    width: 100%;
    max-width: none;
  }

  #embedInlineGroupPicker .custom-select-wrapper,
  #embedInlineGroupPicker .custom-select-trigger {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-transparency: reduce) {
  html.embed-image-bank-mode.embed-viewer-mode .image-toolbar {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

#embedGroupList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

#embedGroupList::-webkit-scrollbar {
  width: 6px;
}

#embedGroupList::-webkit-scrollbar-track {
  background: #f7fafc;
}

#embedGroupList::-webkit-scrollbar-thumb {
  background-color: #cbd5e0;
  border-radius: 3px;
}

#embedGroupList::-webkit-scrollbar-thumb:hover {
  background-color: #a0aec0;
}

#embedGroupList .image-group-tree-item {
  border: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  color: #000000;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

#embedGroupList .image-group-tree-item:hover {
  color: #007bff;
  background-color: transparent;
  border-color: transparent;
}

#embedGroupList .image-group-tree-item.selected {
  color: #007bff;
  background-color: #f0f8ff;
  border-left-color: #007bff;
}

.image-sort-control {
  width: 110px;
}

.image-sort-trigger {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6c757d;
  background: #fff;
  border: 1px solid #d7dce2;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  text-align: left;
}

.image-sort-trigger[aria-expanded="true"] .image-sort-arrow {
  transform: rotate(180deg);
}

.image-sort-arrow {
  color: #8c939d;
  font-size: 14px;
  transition: transform 0.15s ease;
}

.image-sort-menu {
  width: 110px;
  min-width: 110px;
}

.image-sort-menu .image-sort-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  white-space: nowrap;
}

#imageSearchInput:focus {
  border-color: #d7dce2;
  box-shadow: none;
}

#embedGroupList .image-group-tree-item i {
  width: 16px;
  margin-right: 6px;
  font-size: 0.875rem;
}

#embedGroupList .image-group-tree-item .group-name-text {
  margin-right: 8px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#embedImageViewerModal .image-bank-viewer-dialog {
  width: 1200px;
  min-width: 1200px;
  max-width: 1200px;
}

#embedImageViewerModal .image-bank-viewer-dialog {
  background: #111;
  border: none;
}

#embedImageViewerModal .image-bank-viewer-header {
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

#embedImageViewerModal .image-bank-viewer-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.9;
}

#embedImageViewerModal .image-bank-viewer-body {
  padding: 0;
  background: #111;
}

.embed-viewer-stage {
  position: relative;
  width: 100%;
  height: 820px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.embed-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.embed-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.embed-viewer-nav:hover {
  background: rgba(13, 110, 253, 0.65);
  border-color: rgba(13, 110, 253, 0.85);
}

.embed-viewer-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.embed-viewer-nav.prev {
  left: 14px;
}

.embed-viewer-nav.next {
  right: 14px;
}

.embed-viewer-counter {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.embed-viewer-thumbs {
  display: block;
  padding: 10px 12px 12px;
  overflow-x: auto;
  background: #0f0f0f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.embed-viewer-thumbs-track {
  display: flex;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  justify-content: center;
  margin: 0 auto;
}

.embed-viewer-thumbs::-webkit-scrollbar {
  height: 6px;
}

.embed-viewer-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.embed-viewer-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  padding: 0;
}

.embed-viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.embed-viewer-thumb.active {
  border-color: #0d6efd;
  box-shadow: 0 0 0 1px #0d6efd inset;
}

html.image-bank-page-mode .image-card {
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
}

html.image-bank-page-mode .image-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border-color: #999;
}

html.image-bank-page-mode .image-card.selected {
  border-color: #007bff;
  background-color: #f0f8ff;
  box-shadow: 0 0 0 1px #007bff inset;
}

html.image-bank-page-mode .image-checkbox {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  width: 18px;
  height: 18px;
  cursor: pointer;
  border: 1px solid #999;
  border-radius: 2px;
}

html.image-bank-page-mode .image-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  background: #f8f9fa;
}

html.image-bank-page-mode .image-info {
  margin-top: 10px;
  font-size: 13px;
}

html.image-bank-page-mode .image-filename {
  font-weight: 400;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

html.image-bank-page-mode .image-size {
  color: #6c757d;
  font-size: 12px;
}

html.image-bank-page-mode .image-group-tree-item {
  cursor: pointer;
  border: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  color: #000000;
}

html.image-bank-page-mode .image-group-tree-item:hover {
  color: #007bff;
  background-color: transparent;
  border-color: transparent;
}

html.image-bank-page-mode .image-group-tree-item.active {
  color: #007bff;
  background-color: transparent;
  border-color: transparent;
}

html.image-bank-page-mode .image-group-tree-item i {
  width: 20px;
  margin-right: 8px;
}

html.image-bank-page-mode .image-group-tree-item .group-name-text {
  margin-right: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.image-bank-page-mode .image-group-tree-item .badge {
  font-size: 11px;
  padding: 3px 8px;
  font-weight: 500;
}

/* 分组折叠图标 */
html.image-bank-page-mode .group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  cursor: pointer;
  color: inherit;
  transition: color 0.15s ease-in-out;
}

html.image-bank-page-mode .group-toggle:hover {
  color: inherit;
}

html.image-bank-page-mode .image-group-tree-item.active .group-toggle {
  color: #007bff;
}

html.image-bank-page-mode .group-toggle .toggle-icon {
  font-size: 12px;
}

html.image-bank-page-mode .group-toggle-placeholder {
  display: inline-block;
  width: 24px;
  margin-right: 4px;
}

html.image-bank-page-mode .group-indent-guide {
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-block;
  margin-right: 0;
}

html.image-bank-page-mode .group-indent-guide::before {
  display: none;
}

html.image-bank-page-mode .group-indent-guide.is-root::before {
  display: none;
}

html.image-bank-page-mode .group-node-icon {
  color: #1f2937;
  transition: color 0.15s ease-in-out;
}

html.image-bank-page-mode .group-node-icon.is-folder {
  color: #0d6efd;
}

html.image-bank-page-mode .group-node-icon.is-file {
  color: #94a3b8;
}

html.image-bank-page-mode .group-tree-node.is-hidden {
  display: none;
}

html.image-bank-page-mode .group-tree-node.group-level-0,
html.image-bank-page-mode .group-tree-node.group-level-1,
html.image-bank-page-mode .group-tree-node.group-level-2,
html.image-bank-page-mode .group-tree-node.group-level-3,
html.image-bank-page-mode .group-tree-node.group-level-4,
html.image-bank-page-mode .group-tree-node.group-level-5,
html.image-bank-page-mode .group-tree-node.group-level-6,
html.image-bank-page-mode .group-tree-node.group-level-7,
html.image-bank-page-mode .group-tree-node.group-level-8 {
  padding-left: 12px;
}

/* 分组重命名输入框样式 */
html.image-bank-page-mode .group-name-input:focus {
  outline: none;
  box-shadow: none;
}

/* 分组列表跟随左侧容器高度 */
#groupsList {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--separator), transparent 52%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-gutter: stable;
}

/* 主分组列表保留细滚动条，提示还有更多分组可滚动。 */
#groupsList::-webkit-scrollbar {
  width: 6px;
}

#groupsList::-webkit-scrollbar-button {
  -webkit-appearance: none;
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

#groupsList::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}

#groupsList::-webkit-scrollbar-thumb {
  background: rgba(60, 60, 67, 0.24);
  border-radius: 999px;
}

.group-loading-row {
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
}

.group-loading-toggle {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.group-loading-icon {
  width: 18px;
  height: 14px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.group-loading-name {
  width: 54%;
  height: 12px;
  border-radius: 999px;
}

/* 批量移动列表样式 */
#batchMoveGroupList {
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, 0.3) transparent;
}

#batchMoveGroupList::-webkit-scrollbar {
  width: 6px;
}

#batchMoveGroupList::-webkit-scrollbar-track {
  background: transparent;
}

#batchMoveGroupList::-webkit-scrollbar-thumb {
  background-color: rgba(60, 60, 67, 0.3);
  border-radius: 999px;
}

#batchMoveGroupList::-webkit-scrollbar-thumb:hover {
  background-color: rgba(60, 60, 67, 0.42);
}

#batchMoveGroupList .image-group-tree-item {
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

#batchMoveGroupList .image-group-tree-item:hover {
  color: var(--accent-strong);
}

#batchMoveGroupList .image-group-tree-item.selected {
  color: var(--accent-strong);
}

#batchMoveGroupList .image-group-tree-item i {
  width: auto;
  margin-right: 0;
}

#batchMoveGroupList .image-group-tree-item .group-name-text {
  margin-right: 0;
}

#batchMoveGroupList .image-group-tree-item.selected .group-toggle {
  color: var(--accent-strong);
}

/* 自定义下拉框样式 - 模仿select外观 */
html.image-bank-page-mode .custom-select-wrapper {
  position: relative;
  width: auto;
  min-width: 120px;
}

html.image-bank-page-mode .custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  cursor: pointer;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
  min-width: 120px;
}

html.image-bank-page-mode .custom-select-trigger.active {
  border-color: #86b7fe;
}

html.image-bank-page-mode .custom-select-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.image-bank-page-mode .custom-select-arrow {
  position: absolute;
  right: 0.5rem;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

html.image-bank-page-mode .custom-select-trigger.active .custom-select-arrow {
  transform: rotate(180deg);
}

html.image-bank-page-mode .custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  width: 220px;
}

html.image-bank-page-mode .custom-select-dropdown.is-hidden,
html.image-bank-page-mode .group-floating-menu.is-hidden {
  display: none;
}

/* 上传列表样式 */
#uploadGroupList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

#uploadGroupList::-webkit-scrollbar {
  width: 6px;
}

#uploadGroupList::-webkit-scrollbar-track {
  background: #f7fafc;
}

#uploadGroupList::-webkit-scrollbar-thumb {
  background-color: #cbd5e0;
  border-radius: 3px;
}

#uploadGroupList::-webkit-scrollbar-thumb:hover {
  background-color: #a0aec0;
}

#uploadGroupList .image-group-tree-item {
  border: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  color: #000000;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

#uploadGroupList .image-group-tree-item:hover {
  color: #007bff;
  background-color: transparent;
  border-color: transparent;
}

#uploadGroupList .image-group-tree-item.selected {
  color: #007bff;
  background-color: #f0f8ff;
  border-left-color: #007bff;
}

#uploadGroupList .image-group-tree-item i {
  width: 16px;
  margin-right: 6px;
  font-size: 0.875rem;
}

#uploadGroupList .image-group-tree-item .group-name-text {
  margin-right: 8px;
}

#uploadGroupList .image-group-tree-item.selected .group-toggle {
  color: #007bff;
}

html.image-bank-page-mode .group-actions {
  position: absolute;
  right: 6px;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) scale(0.96);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0.14s ease;
}

html.image-bank-page-mode .image-group-tree-item:hover .group-actions,
html.image-bank-page-mode .image-group-tree-item:focus-within .group-actions,
html.image-bank-page-mode .group-actions.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) scale(1);
}

html.image-bank-page-mode .group-more-button {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--label-secondary);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.image-bank-page-mode .group-more-button:hover,
html.image-bank-page-mode .group-more-button[aria-expanded="true"],
html.image-bank-page-mode .group-actions.is-open .group-more-button {
  background: rgba(120, 120, 128, 0.12);
  color: var(--label-primary);
}

html.image-bank-page-mode .group-more-button:focus {
  box-shadow: none;
}

html.image-bank-page-mode .group-more-button:focus-visible {
  box-shadow: var(--focus-ring);
}

html.image-bank-page-mode .group-more-button i {
  width: auto;
  margin: 0;
  font-size: 14px;
  line-height: 1;
}

html.image-bank-page-mode .group-actions-menu {
  min-width: 144px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

html.image-bank-page-mode .group-floating-menu {
  position: fixed;
  z-index: 3000;
  width: 144px;
}

html.image-bank-page-mode .group-action-item {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--label-primary);
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.image-bank-page-mode .group-action-item i {
  width: 16px;
  margin: 0;
  color: var(--label-secondary);
  font-size: 14px;
}

html.image-bank-page-mode .group-action-item:hover,
html.image-bank-page-mode .group-action-item:focus {
  background: rgba(0, 122, 255, 0.1);
  color: var(--label-primary);
}

html.image-bank-page-mode .group-action-item.is-danger {
  color: var(--danger);
}

html.image-bank-page-mode .group-action-item.is-danger i {
  color: var(--danger);
}

html.image-bank-page-mode .group-action-item.is-danger:hover,
html.image-bank-page-mode .group-action-item.is-danger:focus {
  background: color-mix(in srgb, var(--danger), transparent 90%);
  color: var(--danger);
}

html.image-bank-page-mode .group-actions-menu .dropdown-divider {
  margin: 6px 4px;
  border-top-color: color-mix(in srgb, var(--separator), transparent 24%);
}

.card-header .btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

/* 拖拽上传区域样式 */
html.image-bank-page-mode .drop-zone:hover {
  border-color: #007bff;
  background-color: #e7f3ff;
}

html.image-bank-page-mode .drop-zone.drag-over {
  border-color: #007bff;
  background-color: #e7f3ff;
  transform: scale(1.02);
}

html.image-bank-page-mode .drop-zone-content {
  pointer-events: none;
}

html.image-bank-page-mode .drop-zone-icon {
  font-size: 32px;
  color: #6c757d;
  display: block;
  margin-bottom: 4px;
}

html.image-bank-page-mode .drop-zone:hover .drop-zone-icon,
html.image-bank-page-mode .drop-zone.drag-over .drop-zone-icon {
  color: #007bff;
}

html.image-bank-page-mode .drop-zone-text {
  font-size: 12px;
  margin: 0;
  line-height: 1.4;
}

html.image-bank-page-mode .drop-zone-text-primary {
  color: #000;
}

html.image-bank-page-mode .drop-zone-text-secondary {
  color: #6c757d;
}

/* 拖拽上传区域样式 */
html.image-bank-page-mode .drop-zone {
  width: 100px;
  height: 100px;
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 0;
  text-align: center;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.image-bank-page-mode .drop-zone:hover {
  border-color: #007bff;
  background-color: #e7f3ff;
}

/* 预览容器样式 */
html.image-bank-page-mode .preview-container {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  margin-top: 0;
}

html.image-bank-page-mode #previewGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  padding: 0;
  align-items: flex-start;
}

/* 移除全选框的聚焦光晕 */
#selectAllCheckbox:focus {
  box-shadow: none;
}

html.image-bank-page-mode .preview-img-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

html.image-bank-page-mode .preview-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

html.image-bank-page-mode .preview-img-wrapper:hover .preview-actions {
  display: flex;
}

html.image-bank-page-mode .preview-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: color 0.2s;
}

html.image-bank-page-mode .preview-action-btn:hover {
  color: white;
}

html.image-bank-page-mode .preview-divider {
  width: 1px;
  height: 15px;
  background-color: rgba(255, 255, 255, 0.3);
}

html.image-bank-page-mode .preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
  box-sizing: border-box;
}

/* 上传弹窗预览图：充满预览框，去除内边距 */
html.image-bank-page-mode #previewGrid .preview-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  padding: 0;
}

html.image-bank-page-mode .preview-filename {
  margin-top: 6px;
  font-size: 12px;
  color: #333;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

html.image-bank-page-mode .preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 1px;
}

html.image-bank-page-mode .preview-size {
  font-size: 11px;
  color: #999;
  text-align: left;
  line-height: 1.2;
}

html.image-bank-page-mode .preview-referenced {
  color: #0d6efd;
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  flex-shrink: 0;
}

html.image-bank-page-mode .preview-referenced i {
  font-size: 12px;
  font-weight: bold;
}

html.image-bank-page-mode .preview-img-wrapper .image-checkbox {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
  opacity: 0;
  /* 默认隐藏 */
  transition: opacity 0.2s;
}

html.image-bank-page-mode .preview-img-wrapper .image-checkbox:focus {
  box-shadow: none;
}

#selectAllCheckbox:checked,
#selectAllCheckbox:checked:active,
#selectAllCheckbox:checked:focus,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:checked,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:checked:active,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:checked:focus {
  border-color: color-mix(in srgb, var(--separator), black 8%) !important;
  background-color: #0d6efd !important;
  background-image: var(--bs-form-check-bg-image) !important;
}

#selectAllCheckbox:indeterminate,
#selectAllCheckbox:indeterminate:active,
#selectAllCheckbox:indeterminate:focus,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:indeterminate,
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:indeterminate:active,
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:indeterminate:focus {
  border-color: color-mix(in srgb, var(--separator), black 8%) !important;
  background-color: #0d6efd !important;
  background-image: var(--bs-form-check-bg-image) !important;
}

#selectAllCheckbox:focus,
#selectAllCheckbox:focus-visible,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:focus,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:focus-visible {
  border-color: color-mix(in srgb, var(--separator), black 8%) !important;
  box-shadow: none;
  outline: none;
}

#selectAllCheckbox:not(:checked):not(:indeterminate),
#selectAllCheckbox:not(:checked):not(:indeterminate):focus,
#selectAllCheckbox:not(:checked):not(:indeterminate):focus-visible,
#selectAllCheckbox:not(:checked):not(:indeterminate):active,
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:not(:checked):not(:indeterminate),
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:not(:checked):not(:indeterminate):focus,
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:not(:checked):not(:indeterminate):focus-visible,
html.image-bank-page-mode
  .preview-img-wrapper
  .image-checkbox:not(:checked):not(:indeterminate):active {
  border-color: color-mix(in srgb, var(--separator), black 8%) !important;
  background-color: rgba(255, 255, 255, 0.96) !important;
  background-image: none !important;
}

html.image-bank-page-mode .preview-img-wrapper:hover .image-checkbox,
html.image-bank-page-mode .preview-item.selected .image-checkbox,
html.image-bank-page-mode .preview-img-wrapper .image-checkbox:checked {
  opacity: 1;
  /* 鼠标悬停或选中时显示 */
}

/* ===== 分页组件样式优化 ===== */

/* 分页容器 */
#imagePagination {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-radius: 6px;
  background-color: transparent;
}

/* 统一按钮实例 */
#imagePagination .btn {
  margin: 0;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

/* 页码按钮 */
#imagePagination .page-btn {
  min-width: 36px;
  text-align: center;
}

#imagePagination .page-btn.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: normal;
  box-shadow: 0 1px 3px rgba(13, 110, 253, 0.2);
}

#imagePagination .page-btn.btn-outline-secondary {
  border-color: #495057;
  border-width: 1.5px;
  color: #495057;
  background-color: #fff;
}

#imagePagination .page-btn.btn-outline-secondary:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #212529;
  color: #212529;
}

#imagePagination .page-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 导航按钮（上/下一页） */
#imagePagination .nav-btn {
  font-weight: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background-color: #f8f9fa;
  border-color: #495057;
  border-width: 1.5px;
  color: #212529;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#imagePagination .nav-btn:hover:not(:disabled) {
  background-color: #e2e6eb;
  border-color: #212529;
  color: #000;
}

#imagePagination .nav-btn i {
  font-size: 12px;
}

#imagePagination .nav-btn:disabled {
  opacity: 0.6;
  background-color: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
  cursor: not-allowed;
}

/* 省略号 */
#imagePagination .pagination-ellipsis {
  color: #6c757d;
  font-weight: normal;
  padding: 0 4px;
  user-select: none;
}

/* 页码信息文本 */
#imagePagination .page-info {
  color: #6c757d;
  font-size: 13px;
  white-space: nowrap;
  padding-left: 4px;
  margin-left: 4px;
}

/* 禁用状态 */
#imagePagination .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 焦点状态：仅键盘导航显示，鼠标换页不应出现短暂蓝色外框。 */
#imagePagination .btn:focus-visible:not(:disabled) {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* 图片银行分页不使用外框作为状态反馈，避免换页重渲染时残留蓝色描边。
       不依赖运行时附加的 app-pagination class，首次渲染与换页重绘均生效。 */
#imagePagination .btn:focus,
#imagePagination .btn:focus-visible,
#imagePagination .btn:focus-visible:not(:disabled) {
  outline: none !important;
  outline-width: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

/* ===== 响应式设计 ===== */

/* 平板端 (768px 以下) */
@media (max-width: 768px) {
  #imagePagination {
    gap: 6px;
    padding: 8px;
  }

  #imagePagination .btn {
    padding: 5px 8px;
    font-size: 13px;
  }

  #imagePagination .page-btn {
    min-width: 32px;
  }

  #imagePagination .nav-text {
    display: none;
  }
}

/* 中等手机 (480px - 600px) */
@media (max-width: 600px) {
  #imagePagination .page-info {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }
}

/* 小屏幕手机 (480px 以下) */
@media (max-width: 480px) {
  #imagePagination {
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }

  #imagePagination .btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  #imagePagination .page-btn {
    display: none;
  }

  #imagePagination .nav-btn {
    flex: 1;
    justify-content: center;
    width: 100%;
    display: flex;
    padding: 10px 8px;
  }

  #imagePagination .nav-text {
    display: inline;
  }

  #imagePagination .pagination-ellipsis {
    display: none;
  }

  #imagePagination .page-info {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    border-left: none;
    margin-left: 0;
    font-size: 12px;
  }
}

/* ===== 跳转页面组件样式 ===== */
#imagePagination .page-jump-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 4px;
}

#imagePagination .page-jump-input {
  width: 45px;
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  text-align: center;
  transition: all 0.2s ease;
}

/* 移除 Chrome, Safari, Edge 的上下箭头 */
#imagePagination .page-jump-input::-webkit-outer-spin-button,
#imagePagination .page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
  margin: 0;
}

/* 移除 Firefox 的上下箭头 */
#imagePagination .page-jump-input {
  -moz-appearance: textfield;
}

#imagePagination .page-jump-input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: none;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
}

#imagePagination .page-jump-btn {
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  margin-left: 6px;
}

@media (max-width: 768px) {
  #imagePagination .page-jump-container {
    margin-left: 6px;
    padding-left: 6px;
  }

  #imagePagination .page-jump-input {
    width: 40px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #imagePagination .page-jump-container {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    flex-direction: column;
  }

  #imagePagination .page-jump-input {
    width: 100%;
  }

  #imagePagination .page-jump-btn {
    width: 100%;
  }
}

/* 主图片银行分页区：对齐图片选择弹窗样式 */
html.image-bank-page-mode:not(.embed-image-bank-mode) #imagePagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap !important;
  gap: 10px;
  min-height: 46px;
  padding: 10px 0 0;
  margin-top: auto;
  white-space: normal;
  background: transparent;
  flex: 0 0 auto;
}

html.image-bank-page-mode:not(.embed-image-bank-mode) #imagePagination .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  margin: 0;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-btn {
  min-width: 34px;
  padding: 0 10px;
  border-width: 1px;
  text-align: center;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-btn.btn-primary {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.12);
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-btn.btn-primary:hover:not(:disabled) {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #fff;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-btn.btn-outline-secondary,
html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .nav-btn {
  border-color: color-mix(in srgb, var(--separator), white 18%);
  border-width: 1px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--label-primary);
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-btn.btn-outline-secondary:hover:not(:disabled),
html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .nav-btn:hover:not(:disabled) {
  background: rgba(245, 247, 250, 0.96);
  border-color: color-mix(in srgb, var(--separator), white 2%);
  color: var(--label-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .nav-btn {
  min-width: 40px;
  padding: 0 11px;
  flex-shrink: 0;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .nav-btn
  i {
  font-size: 12px;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .btn:disabled,
html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .nav-btn:disabled {
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.72);
  border-color: color-mix(in srgb, var(--separator), white 24%);
  color: var(--label-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .pagination-ellipsis,
html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-info,
html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-label {
  color: var(--label-secondary);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .pagination-ellipsis {
  padding: 0 2px;
  user-select: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-info {
  margin-left: 4px;
  padding-left: 0;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding-left: 0;
  white-space: nowrap;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-input {
  width: 46px;
  height: 34px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--label-primary);
  text-align: center;
  font-size: 13px;
  box-shadow: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), white 34%);
  box-shadow: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-btn {
  min-width: 58px;
  height: 34px;
  margin-left: 4px;
  padding: 0 14px;
  border-color: #0d6efd;
  background: #0d6efd;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.12);
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination
  .page-jump-btn:hover:not(:disabled) {
  border-color: #0b5ed7;
  background: #0b5ed7;
  color: #fff;
}

/* 重复图片模态框样式 */
#duplicateImagesList .card {
  border: 1px solid #dee2e6;
  transition: all 0.2s;
}

#duplicateImagesList .card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#duplicateImagesList img {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html.image-bank-page-mode .duplicate-image-modal-dialog {
  width: 820px;
  max-width: min(820px, calc(100vw - 48px)) !important;
}

html.image-bank-page-mode .duplicate-image-modal-header {
  min-height: 54px;
  padding: 12px 18px;
  align-items: center;
}

html.image-bank-page-mode .duplicate-image-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.2;
}

html.image-bank-page-mode .duplicate-image-modal-title i {
  color: #ff9500;
  font-size: 15px;
}

html.image-bank-page-mode .duplicate-image-modal-body {
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 24px 10px !important;
}

html.image-bank-page-mode .duplicate-image-modal-description {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--label-secondary);
}

html.image-bank-page-mode .duplicate-image-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

html.image-bank-page-mode .duplicate-image-summary-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

html.image-bank-page-mode .duplicate-image-summary-pill.is-exact {
  background: rgba(255, 59, 48, 0.08);
  color: #ff3b30;
}

html.image-bank-page-mode .duplicate-image-summary-pill.is-similar {
  background: rgba(255, 149, 0, 0.1);
  color: #b86b00;
}

html.image-bank-page-mode .duplicate-image-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 128px;
  align-items: flex-start;
  gap: 18px;
  min-height: 112px;
  padding: 14px 20px 14px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

html.image-bank-page-mode .duplicate-image-card.is-exact {
  border-color: rgba(255, 59, 48, 0.16);
}

html.image-bank-page-mode .duplicate-image-card.is-similar {
  border-color: rgba(255, 149, 0, 0.18);
}

html.image-bank-page-mode .duplicate-image-thumb-wrap {
  width: 80px;
  height: 80px;
  align-self: flex-start;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
}

html.image-bank-page-mode .duplicate-image-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: 5px;
}

html.image-bank-page-mode .duplicate-image-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--label-primary);
}

html.image-bank-page-mode .duplicate-image-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

html.image-bank-page-mode .duplicate-image-status.is-exact {
  background: rgba(255, 59, 48, 0.08);
  color: #ff3b30;
}

html.image-bank-page-mode .duplicate-image-status.is-similar {
  background: rgba(255, 149, 0, 0.1);
  color: #b86b00;
}

html.image-bank-page-mode .duplicate-image-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--label-secondary);
}

html.image-bank-page-mode .duplicate-image-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.image-bank-page-mode .duplicate-image-meta i {
  flex: 0 0 auto;
  font-size: 12px;
}

html.image-bank-page-mode .duplicate-image-card-action {
  display: flex;
  align-items: center;
  align-self: flex-start;
  justify-content: flex-end;
  min-width: 0;
  padding-top: 21px;
}

html.image-bank-page-mode .duplicate-confirm-upload-btn {
  width: 112px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

html.image-bank-page-mode .duplicate-confirm-upload-btn:hover,
html.image-bank-page-mode .duplicate-confirm-upload-btn:focus {
  background: color-mix(in srgb, var(--accent), black 8%);
  color: #fff;
  box-shadow: none;
}

html.image-bank-page-mode .duplicate-confirm-upload-btn:disabled {
  opacity: 0.72;
}

html.image-bank-page-mode .duplicate-confirm-upload-btn.is-uploaded {
  background: #34c759;
}

html.image-bank-page-mode .duplicate-image-skipped-badge {
  width: 112px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(60, 60, 67, 0.08);
  color: var(--label-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

html.image-bank-page-mode .duplicate-image-modal-footer {
  justify-content: flex-end;
  padding: 14px 24px 20px !important;
}

html.image-bank-page-mode .duplicate-image-close-btn {
  min-width: 86px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

html.image-bank-page-mode .duplicate-image-close-btn:hover,
html.image-bank-page-mode .duplicate-image-close-btn:focus {
  background: rgba(28, 28, 30, 1);
  color: #fff;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  html.image-bank-page-mode .duplicate-image-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  html.image-bank-page-mode .duplicate-image-thumb-wrap,
  html.image-bank-page-mode .duplicate-image-thumb {
    width: 64px;
    height: 64px;
  }

  html.image-bank-page-mode .duplicate-image-card-action {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0;
  }
}

/* 浮动提示框样式 */
html.image-bank-page-mode .floating-alert {
  position: fixed;
  top: 72px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  max-width: 500px;
  padding: 12px 50px 12px 16px;
  z-index: 9000;
  border: none;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  animation: slideInRight 0.3s ease-out;
}

html.image-bank-page-mode .floating-alert--success {
  background: #e8f7ee;
  color: #126b35;
}

html.image-bank-page-mode .floating-alert--warning {
  background: #fff7dd;
  color: #7a5200;
}

html.image-bank-page-mode .floating-alert--info {
  background: #eaf3ff;
  color: #0059ba;
}

html.image-bank-page-mode .floating-alert .platform-dialog__close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Apple-style local overrides */
.app-container {
  --image-bank-sidebar-width: 307px;
  --image-bank-main-width: 1564px;
  --image-bank-layout-gap: 8px;
  --image-bank-main-layout-height: 970px;
  --image-bank-grid-min: 180px;
  --image-bank-grid-gap: 16px;
  --image-bank-page-bottom-gap: 24px;
  --image-bank-card-padding: 11px;
  --image-bank-card-radius: 18px;
  --image-bank-thumb-radius: 14px;
  --image-bank-card-bg: rgba(255, 255, 255, 0.72);
  --image-bank-card-bg-hover: rgba(255, 255, 255, 0.82);
  --image-bank-card-border: color-mix(in srgb, var(--separator), white 18%);
  --image-bank-thumb-bg: rgba(245, 247, 250, 0.92);
  --image-bank-thumb-border: color-mix(in srgb, var(--separator), white 16%);
  --image-bank-card-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  --image-bank-card-shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.07);
  width: calc(
    var(--image-bank-sidebar-width) + var(--image-bank-layout-gap) +
      var(--image-bank-main-width) + 24px
  );
  max-width: none;
  min-width: calc(
    var(--image-bank-sidebar-width) + var(--image-bank-layout-gap) +
      var(--image-bank-main-width) + 24px
  );
  padding: 10px 12px var(--image-bank-page-bottom-gap);
}

html.embed-image-bank-mode:not(.embed-viewer-mode),
html.embed-image-bank-mode:not(.embed-viewer-mode) body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: transparent !important;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) main.container-fluid {
  padding: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent !important;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) .app-container {
  --image-bank-sidebar-width: 280px;
  --image-bank-main-width: auto;
  --image-bank-layout-gap: 12px;
  --image-bank-grid-gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent !important;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) .picker-image-group-browser {
  --viewer-card-radius: 18px;
  --viewer-card-padding: 12px;
  --viewer-card-bg: rgba(255, 255, 255, 0.78);
  --viewer-card-bg-hover: rgba(255, 255, 255, 0.88);
  --viewer-card-border: color-mix(in srgb, var(--separator), white 18%);
  --viewer-card-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  --viewer-card-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.08);
  --viewer-thumb-radius: 14px;
  --viewer-thumb-bg: rgba(245, 247, 250, 0.94);
  --viewer-thumb-border: color-mix(in srgb, var(--separator), white 16%);
  --viewer-page-gap: 4px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) .picker-image-group-search {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  width: 100%;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-select-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-select-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--separator), white 12%);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList.picker-image-group-select-options {
  height: 100%;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList.picker-image-group-select-options::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) .picker-image-group-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

html.embed-image-bank-mode:not(.embed-viewer-mode) .picker-image-group-surface {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 12px !important;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-surface::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestions,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--separator), white 14%);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  max-height: 240px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestions.is-visible,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestions.is-visible {
  display: block;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestions::-webkit-scrollbar,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestions::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--label-primary);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion:hover,
html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion.is-active,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion:hover,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion.is-active {
  background: color-mix(in srgb, var(--accent), white 90%);
  color: color-mix(in srgb, var(--accent), black 16%);
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion-name,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion-name {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion-meta,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion-meta {
  flex: 0 0 auto;
  color: var(--label-secondary);
  font-size: 11px;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .picker-image-group-search-suggestion-hint,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  .picker-image-group-search-suggestion-hint {
  margin-top: 4px;
  padding: 7px 10px 3px;
  color: var(--label-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.image-bank-toolbar-copy {
  max-width: 42ch;
}

.image-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.image-toolbar-left,
.image-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.image-toolbar-right {
  justify-content: flex-end;
  flex: 1 1 auto;
}

.image-selection-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
}

.image-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-toolbar-search {
  position: relative;
  width: 250px;
  min-width: 220px;
}

.image-library-search__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--label-primary);
  font: inherit;
  line-height: 20px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.42);
}

.image-library-search__input::placeholder {
  color: var(--label-tertiary);
}

.image-library-search__input:focus,
.image-library-search__input:focus-visible {
  border-color: #858b93;
  outline: none;
}

.image-toolbar-search .image-library-search__input {
  padding-right: 72px;
}

html.image-bank-page-mode .image-toolbar-search .image-library-search__input {
  padding-right: 34px;
}

.image-search-actions {
  position: absolute;
  right: 6px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 3px;
  transform: translateY(-50%);
}

.image-search-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-search-button:hover {
  background: rgba(120, 120, 128, 0.1);
  color: var(--label-primary);
}

.image-search-clear {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(120, 120, 128, 0.28);
  color: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-search-clear .bi {
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 10px;
}

.image-search-clear .bi::before {
  line-height: 10px;
}

.image-library-search__clear--hidden {
  display: none;
}

html.image-bank-page-mode:not(.embed-viewer-mode)
  .image-toolbar-search
  .image-search-clear,
#imageBankPickerModal .image-toolbar-search .image-search-clear,
#editImageBankPickerModal .image-toolbar-search .image-search-clear {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-basis: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(120, 120, 128, 0.28);
  color: #fff;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-search-clear:hover {
  background: rgba(120, 120, 128, 0.42);
  color: #fff;
}

html.image-bank-page-mode:not(.embed-viewer-mode)
  .image-toolbar-search
  .image-search-clear:hover,
#imageBankPickerModal .image-toolbar-search .image-search-clear:hover,
#editImageBankPickerModal .image-toolbar-search .image-search-clear:hover {
  background: rgba(120, 120, 128, 0.42);
  color: #fff;
}

.image-bank-picker-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--separator), white 14%);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  max-height: 240px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-bank-picker-search-suggestions.is-visible {
  display: block;
}

.image-bank-picker-search-suggestions::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.image-bank-picker-search-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--label-primary);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

.image-bank-picker-search-suggestion:hover,
.image-bank-picker-search-suggestion.is-active {
  background: color-mix(in srgb, var(--accent), white 90%);
  color: color-mix(in srgb, var(--accent), black 16%);
}

.image-bank-picker-search-suggestion-name {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-bank-picker-search-suggestion-meta {
  flex: 0 0 auto;
  color: var(--label-secondary);
  font-size: 11px;
}

.image-bank-picker-search-suggestion-hint {
  margin-top: 4px;
  padding: 7px 10px 3px;
  color: var(--label-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.image-toolbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
}

.image-toolbar-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.image-sort-trigger {
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.82);
  color: var(--label-primary);
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.app-container > .image-bank-main-layout {
  display: grid;
  grid-template-columns: var(--image-bank-sidebar-width) var(
      --image-bank-main-width
    );
  column-gap: var(--image-bank-layout-gap);
  align-items: stretch;
  margin: 0;
  width: calc(
    var(--image-bank-sidebar-width) + var(--image-bank-layout-gap) +
      var(--image-bank-main-width)
  );
  height: var(--image-bank-main-layout-height, auto);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .app-container
  > .image-bank-main-layout {
  display: flex;
  flex-direction: row;
  grid-template-columns: var(--image-bank-sidebar-width) minmax(0, 1fr);
  column-gap: 0;
  gap: 12px;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  background: transparent !important;
}

.app-container > .image-bank-main-layout > .image-bank-sidebar {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  width: var(--image-bank-sidebar-width);
  min-width: var(--image-bank-sidebar-width);
  max-width: var(--image-bank-sidebar-width);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .app-container
  > .image-bank-main-layout
  > .image-bank-sidebar {
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  height: 100%;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.app-container
  > .image-bank-main-layout:not(.picker-image-group-browser)
  > .image-bank-sidebar {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  height: var(--image-bank-main-layout-height);
}

.app-container
  > .image-bank-main-layout:not(.picker-image-group-browser)
  > .image-bank-sidebar
  #groupsList {
  border: 1px solid color-mix(in srgb, var(--separator), transparent 52%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 5px;
}

.app-container > .image-bank-main-layout > .image-bank-main {
  width: var(--image-bank-main-width);
  min-width: var(--image-bank-main-width);
  max-width: var(--image-bank-main-width);
  min-height: 0;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .app-container
  > .image-bank-main-layout
  > .image-bank-main {
  --image-bank-card-bg: #fcfdfe;
  --image-bank-card-bg-hover: #fcfdfe;
  --image-bank-thumb-bg: #fcfdfe;
  --image-bank-card-shadow: none;
  --image-bank-card-shadow-hover: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .app-container
  > .image-bank-main-layout
  > .image-bank-main
  > .card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #fcfdfe;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  .app-container
  > .image-bank-main-layout
  > .image-bank-main
  > .card
  > .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fcfdfe;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  .app-container
  > .image-bank-main-layout
  > .image-bank-main {
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.app-container .card {
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

#imagesGrid .preview-item {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--image-bank-card-padding);
  border-radius: var(--image-bank-card-radius);
  background: var(--image-bank-card-bg);
  border: 1px solid var(--image-bank-card-border);
  box-shadow: var(--image-bank-card-shadow);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

#imagesGrid .preview-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--image-bank-card-shadow-hover);
  background: var(--image-bank-card-bg-hover);
}

#imagesGrid .preview-item.selected {
  border-color: color-mix(in srgb, var(--accent), white 78%);
  background: color-mix(in srgb, var(--accent), white 95%);
}

#imagesGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  max-width: none;
  gap: var(--image-bank-grid-gap);
  padding: 0;
}

html.image-bank-page-mode:not(.embed-image-bank-mode) #imagesGrid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  /* 第一行卡片悬浮上移时，保留顶部边框与阴影的显示空间。 */
  padding-top: 2px;
  background: #fcfdfe;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagesGrid:has(> .image-bank-empty-state) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#imagesGrid .preview-img-wrapper {
  border-radius: var(--image-bank-thumb-radius);
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--image-bank-thumb-bg);
  border: 1px solid var(--image-bank-thumb-border);
  margin-bottom: 10px;
}

#imagesGrid .preview-item:hover .preview-img-wrapper,
#imagesGrid .preview-item.selected .preview-img-wrapper {
  border-color: var(--image-bank-thumb-border);
}

#imagesGrid .preview-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  padding: 0;
  box-sizing: border-box;
}

html.image-bank-page-mode .preview-filename {
  margin-top: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--label-primary);
  min-width: 0;
  height: calc(13px * 1.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.image-bank-page-mode .preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 5px;
  gap: 6px;
}

html.image-bank-page-mode .preview-size {
  color: var(--label-secondary);
}

.image-bank-empty-state {
  grid-column: 1 / -1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  height: 100%;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.image-bank-empty-state i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  margin-bottom: 12px;
  color: var(--label-tertiary);
  background: color-mix(in srgb, var(--quaternary-fill), white 35%);
  font-size: 22px;
}

.image-bank-empty-state strong {
  display: block;
  color: var(--label-primary);
  font-size: 16px;
  margin-bottom: 6px;
}

.image-bank-loading-state {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--image-bank-grid-gap);
  width: 100%;
}

.image-bank-loading-card {
  min-height: 244px;
  padding: var(--image-bank-card-padding);
  border-radius: var(--image-bank-card-radius);
  background: var(--image-bank-card-bg);
  border: 1px solid var(--image-bank-card-border);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.035);
}

.image-bank-skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(120, 120, 128, 0.12);
}

.image-bank-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.48) 50%,
    transparent 100%
  );
  animation: imageBankLoadingShimmer 1.55s ease-in-out infinite;
}

.image-bank-toolbar-selection-loading,
.image-bank-toolbar-controls-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.image-bank-toolbar-controls-loading {
  margin-left: auto;
}

.image-bank-toolbar-skeleton {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 8px;
}

.image-bank-toolbar-skeleton.is-checkbox {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.image-bank-toolbar-skeleton.is-label {
  width: 34px;
  height: 14px;
  border-radius: 999px;
}

.image-bank-toolbar-skeleton.is-sort {
  width: 110px;
  height: 30px;
  border-radius: 4px;
}

.image-bank-toolbar-skeleton.is-search {
  width: 250px;
  height: 30px;
  border-radius: 4px;
}

.image-bank-toolbar-skeleton.is-count {
  width: 52px;
  height: 14px;
  border-radius: 999px;
}

.image-bank-loading-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--image-bank-thumb-radius);
  margin-bottom: 10px;
}

.image-bank-loading-line {
  height: 12px;
  border-radius: 999px;
}

.image-bank-loading-line + .image-bank-loading-line {
  margin-top: 10px;
}

.image-bank-loading-line.is-short {
  width: 58%;
}

.image-bank-loading-line.is-mid {
  width: 74%;
}

html.image-bank-page-mode:not(.embed-image-bank-mode)
  #imagePagination.image-bank-pagination-loading {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 0 0;
  flex: 0 0 auto;
}

html.embed-image-bank-mode.embed-viewer-mode
  #imagePagination.image-bank-pagination-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  padding: 10px 0 0;
  margin-top: 0;
  flex: 0 0 auto;
}

.image-bank-pagination-skeleton {
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  border-radius: 12px;
  background: rgba(120, 120, 128, 0.1);
}

.image-bank-pagination-skeleton-nav {
  width: 78px;
}

.image-bank-pagination-skeleton-page {
  width: 34px;
}

.image-bank-pagination-skeleton-page.is-active {
  background: color-mix(in srgb, var(--accent), white 84%);
}

.image-bank-pagination-skeleton-info {
  width: 64px;
  height: 14px;
  border-radius: 999px;
}

.image-bank-pagination-skeleton-input {
  width: 48px;
}

.image-bank-pagination-skeleton-confirm {
  width: 58px;
}

@keyframes imageBankLoadingShimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-bank-skeleton::after {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-container .card,
  #imagesGrid .preview-item,
  #imagesGrid .preview-img-wrapper,
  .image-bank-empty-state,
  .image-bank-loading-card {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

#groupsList .image-group-tree-item,
#embedGroupList .image-group-tree-item,
#batchMoveGroupList .image-group-tree-item,
#uploadGroupList .image-group-tree-item {
  min-height: 44px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 14%);
  border-left: 1px solid color-mix(in srgb, var(--separator), white 14%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--label-primary);
}

#groupsList .image-group-tree-item:hover,
#embedGroupList .image-group-tree-item:hover,
#batchMoveGroupList .image-group-tree-item:hover,
#uploadGroupList .image-group-tree-item:hover {
  background: rgba(0, 122, 255, 0.06);
}

#groupsList .image-group-tree-item.active,
#embedGroupList .image-group-tree-item.selected,
#batchMoveGroupList .image-group-tree-item.selected,
#uploadGroupList .image-group-tree-item.selected {
  background: color-mix(in srgb, #0a84ff 12%, white 88%);
  color: var(--accent-strong);
  border-color: rgba(10, 132, 255, 0.24);
  border-left-color: rgba(10, 132, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.08);
}

#embedGroupList .image-group-tree-item.selected .group-name-text,
#batchMoveGroupList .image-group-tree-item.selected .group-name-text,
#uploadGroupList .image-group-tree-item.selected .group-name-text {
  font-weight: 600;
}

#groupsList .image-group-tree-item.active .group-node-icon,
#groupsList .image-group-tree-item.active .group-toggle,
#embedGroupList .image-group-tree-item.selected .group-node-icon,
#embedGroupList .image-group-tree-item.selected .group-toggle,
#batchMoveGroupList .image-group-tree-item.selected .group-node-icon,
#batchMoveGroupList .image-group-tree-item.selected .group-toggle,
#uploadGroupList .image-group-tree-item.selected .group-node-icon,
#uploadGroupList .image-group-tree-item.selected .group-toggle {
  color: var(--accent-strong);
}

#groupsList .image-group-tree-item {
  position: relative;
  height: auto;
  min-height: 38px;
  margin-bottom: 0;
  padding: 8px 12px;
  border: 0;
  border-left: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--label-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  gap: 8px;
  cursor: default;
  transition:
    background-color 0.14s ease,
    color 0.14s ease;
}

#groupsList .image-group-tree-item:hover {
  background: transparent;
  color: var(--label-primary);
}

#groupsList .image-group-tree-item.active,
#groupsList .image-group-tree-item.is-selected {
  margin-top: 0;
  background: transparent;
  color: var(--label-primary);
  border-color: transparent;
  border-left-color: transparent;
  box-shadow: none;
}

#groupsList .group-main-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#groupsList .group-main-action:hover,
#groupsList .group-main-action:focus,
#groupsList .group-toggle:hover,
#groupsList .group-toggle:focus {
  color: color-mix(in srgb, var(--accent), black 14%);
}

#groupsList .group-main-action:focus,
#groupsList .group-toggle:focus {
  outline: none;
}

#groupsList .image-group-tree-item.active .group-main-action,
#groupsList .image-group-tree-item.is-selected .group-main-action,
#groupsList .image-group-tree-item.active .group-toggle,
#groupsList .image-group-tree-item.is-selected .group-toggle {
  color: color-mix(in srgb, var(--accent), black 14%);
}

#groupsList .group-toggle,
#groupsList .group-toggle-placeholder {
  width: 18px;
  min-width: 18px;
  height: 22px;
  min-height: 22px;
  margin-right: 0;
  color: currentColor;
}

#groupsList .image-group-tree-item i.group-node-icon {
  width: 18px;
  min-width: 18px;
  margin-right: 0;
  text-align: center;
  color: currentColor;
}

#groupsList .image-group-tree-item .group-name-text {
  margin-right: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: currentColor;
  font-weight: 500;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option {
  width: 100%;
  min-height: 38px;
  height: auto;
  padding: 8px 12px 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--label-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  transition:
    background-color 0.14s ease,
    color 0.14s ease;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover {
  background: rgba(0, 122, 255, 0.08);
  color: color-mix(in srgb, var(--accent), black 14%);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover
  .group-toggle,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover
  .group-toggle
  .toggle-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover
  i.group-node-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover
  i.group-node-icon.is-folder,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option:hover
  i.group-node-icon.is-file {
  color: color-mix(in srgb, var(--accent), black 14%) !important;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected {
  background: color-mix(in srgb, var(--accent), white 86%);
  color: color-mix(in srgb, var(--accent), black 14%);
  box-shadow: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-name-text {
  font-weight: inherit;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  .group-name-text,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  .group-name-text {
  font-weight: 600;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-toggle,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-toggle-placeholder {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-right: 0;
  border-radius: 999px;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-toggle
  .toggle-icon {
  font-size: 11px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  .group-toggle,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  .group-toggle,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  .group-toggle
  .toggle-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  .group-toggle
  .toggle-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  i.group-node-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  i.group-node-icon,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  i.group-node-icon.is-folder,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  i.group-node-icon.is-folder,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.active
  i.group-node-icon.is-file,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option.is-selected
  i.group-node-icon.is-file {
  color: color-mix(in srgb, var(--accent), black 14%) !important;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-indent-guide {
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  width: 0;
  min-width: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-indent-guide::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  right: 0;
  width: 1px;
  background: color-mix(in srgb, var(--separator), white 18%);
  border-radius: 999px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #groupsList
  .picker-group-option
  .group-indent-guide.is-root::before {
  display: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card {
  align-self: start;
  padding: var(--viewer-card-padding);
  border-radius: var(--viewer-card-radius);
  background: var(--viewer-card-bg);
  border: 1px solid var(--viewer-card-border);
  box-shadow: var(--viewer-card-shadow);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card:hover {
  box-shadow: var(--viewer-card-shadow-hover);
  background: var(--viewer-card-bg-hover);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-img-wrapper {
  border-radius: var(--viewer-thumb-radius);
  border: 1px solid var(--viewer-thumb-border);
  background: var(--viewer-thumb-bg);
  margin-bottom: 10px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-img {
  border-radius: inherit;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-filename,
html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-meta {
  padding-left: 0;
  padding-right: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-filename {
  min-height: 0;
  height: auto;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-size {
  font-size: 12px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagesGrid
  .picker-image-card
  .preview-referenced {
  transform: scale(0.92);
  transform-origin: center;
  opacity: 0.84;
}

#groupsList .image-group-tree-item .badge,
#embedGroupList .image-group-tree-item .badge,
#batchMoveGroupList .image-group-tree-item .badge,
#uploadGroupList .image-group-tree-item .badge {
  background: rgba(15, 23, 42, 0.06);
  color: var(--label-secondary);
  font-weight: 600;
}

#uploadGroupList {
  padding: 5px;
  background: rgba(255, 255, 255, 0.46);
  scrollbar-color: rgba(60, 60, 67, 0.3) transparent;
}

#uploadGroupList::-webkit-scrollbar-track {
  background: transparent;
}

#uploadGroupList::-webkit-scrollbar-thumb {
  background-color: rgba(60, 60, 67, 0.3);
  border-radius: 999px;
}

#uploadGroupList .image-group-tree-item {
  position: relative;
  height: 40px;
  min-height: 40px;
  margin-bottom: 2px;
  padding: 0 10px;
  border: 0;
  border-left: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--label-primary);
}

#uploadGroupList .image-group-tree-item.is-hidden {
  display: none;
}

#uploadGroupList .image-group-tree-item:hover {
  background: transparent;
  color: var(--label-primary);
}

#uploadGroupList .image-group-tree-item.selected {
  background: transparent;
  color: color-mix(in srgb, var(--accent), black 14%);
  border-color: transparent;
  border-left-color: transparent;
  box-shadow: none;
}

#uploadGroupList .group-toggle,
#uploadGroupList .group-toggle-placeholder {
  width: 18px;
  min-width: 18px;
  margin-right: 0;
}

#uploadGroupList .image-group-tree-item i.group-node-icon {
  width: 18px;
  min-width: 18px;
  margin-right: 0;
  text-align: center;
}

#uploadGroupList .image-group-tree-item .group-name-text {
  margin-right: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#uploadGroupList .image-group-tree-item:not(.selected) .group-toggle,
#uploadGroupList .image-group-tree-item:not(.selected) .group-node-icon {
  color: var(--label-primary);
}

#uploadGroupList .group-main-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#uploadGroupList .group-main-action:hover,
#uploadGroupList .group-main-action:focus,
#uploadGroupList .image-group-tree-item:not(.selected) .group-toggle:hover,
#uploadGroupList .image-group-tree-item:not(.selected) .group-toggle:focus {
  color: color-mix(in srgb, var(--accent), black 14%);
  outline: none;
}

#uploadGroupList .group-main-action:hover .group-node-icon,
#uploadGroupList .group-main-action:hover .group-name-text,
#uploadGroupList .group-main-action:focus .group-node-icon,
#uploadGroupList .group-main-action:focus .group-name-text {
  color: color-mix(in srgb, var(--accent), black 14%);
}

#uploadGroupList .image-group-tree-item.selected .group-name-text {
  font-weight: 500;
}

#uploadGroupList .group-level-0 {
  padding-left: 10px;
}

#uploadGroupList .group-level-1 {
  padding-left: 24px;
}

#uploadGroupList .group-level-2 {
  padding-left: 38px;
}

#uploadGroupList .group-level-3 {
  padding-left: 52px;
}

#uploadGroupList .group-level-4 {
  padding-left: 66px;
}

#uploadGroupList .group-level-5,
#uploadGroupList .group-level-6,
#uploadGroupList .group-level-7,
#uploadGroupList .group-level-8 {
  padding-left: 80px;
}

html.image-bank-page-mode .custom-select-trigger {
  min-height: 36px;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

html.image-bank-page-mode .custom-select-dropdown {
  border-color: color-mix(in srgb, var(--separator), white 16%);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.image-detail-modal-dialog {
  --image-detail-modal-width: 1200px;
  --image-detail-modal-height: 760px;
  --image-detail-panel-width: 403px;
  width: var(--image-detail-modal-width);
  min-width: var(--image-detail-modal-width);
  max-width: var(--image-detail-modal-width);
  margin-left: auto;
  margin-right: auto;
}

.image-detail-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
}

#uploadModal .preview-container {
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  border-radius: 18px;
  background: rgba(245, 247, 250, 0.56);
  padding: 18px;
  min-height: 466px;
  max-height: none;
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

#uploadModal #uploadProgress {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(248, 250, 252, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#uploadModal #uploadProgress[hidden] {
  display: none;
}

#uploadModal .image-bank-upload-progress-dialog {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

#uploadModal .image-bank-upload-progress-dialog__title {
  color: var(--label-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  margin-bottom: 14px;
}

#uploadModal
  .image-bank-upload-progress-dialog
  .image-bank-upload-progress-meta {
  margin-top: 0;
}

#uploadModal .preview-container.has-previews {
  min-height: 0;
  max-height: none;
}

#uploadModal .image-upload-group-block {
  margin-bottom: 18px !important;
}

#uploadModal .image-upload-limit-notice {
  margin-right: auto;
  color: var(--danger, #dc3545);
  font-size: 13px;
  line-height: 20px;
}

#uploadModal .image-bank-upload-footer {
  align-items: center;
}

#uploadModal .upload-preview-block {
  min-height: 0;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
}

#uploadModal .image-upload-group-shell {
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 16px 18px;
}

#uploadModal .image-upload-group-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
}

#uploadGroupSelectorReactRoot {
  display: contents;
}

#uploadModal .image-upload-group-row .custom-select-wrapper {
  width: fit-content;
  min-width: 180px;
  max-width: min(560px, 62%);
  flex: 0 1 auto;
}

#uploadModal #uploadGroupSelectTrigger {
  width: fit-content;
  min-width: 180px;
  max-width: 100%;
  text-align: left;
}

#uploadModal #uploadGroupDropdown {
  width: 100%;
  min-width: 100%;
}

#uploadModal .image-upload-group-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

#uploadModal .image-upload-group-note-title {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--label-primary);
  letter-spacing: 0.01em;
}

#uploadModal .image-upload-group-hint {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--label-secondary) !important;
}

#uploadModal #previewGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 16px;
  width: 100%;
  align-items: start;
  align-content: start;
  min-height: 100%;
  flex: 1 1 auto;
  height: 100%;
  padding-bottom: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

#uploadModal #previewGrid::-webkit-scrollbar {
  display: none;
}

#uploadModal #previewGrid.has-previews {
  min-height: auto;
  max-height: none;
  padding-right: 0;
}

#uploadModal #previewGrid:not(.has-previews) {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(425px, 1fr);
  align-items: stretch;
  align-content: stretch;
}

#uploadModal #previewGrid .preview-item {
  min-width: 0;
}

#uploadModal #previewGrid .preview-img-wrapper {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

#uploadModal #previewGrid .preview-filename {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-primary);
  line-height: 1.35;
}

#uploadModal #previewGrid .preview-meta {
  margin-top: 4px;
}

#uploadModal #previewGrid .preview-size {
  font-size: 11px;
  color: var(--label-secondary);
}

#uploadModal .drop-zone {
  width: 100%;
  height: auto;
  grid-column: 1 / -1;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent), white 35%);
  background: rgba(255, 255, 255, 0.82);
  min-height: 316px;
  padding: 18px 20px;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#uploadModal #previewGrid:not(.has-previews) .drop-zone {
  min-height: 0;
  height: 100%;
}

#uploadModal .drop-zone-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  justify-content: center;
  text-align: center;
}

#uploadModal .drop-zone-icon-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  flex: 0 0 auto;
  background: linear-gradient(
    180deg,
    rgba(0, 122, 255, 0.12),
    rgba(0, 122, 255, 0.08)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

#uploadModal .drop-zone-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-strong);
  font-size: 22px;
}

#uploadModal .drop-zone-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

#uploadModal .drop-zone-text-primary {
  color: var(--label-primary);
  font-weight: 700;
}

#uploadModal .drop-zone-text-secondary {
  color: var(--label-secondary);
}

#uploadModal #previewGrid.has-previews .drop-zone {
  grid-column: auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 12px 8px;
  align-self: start;
  justify-self: start;
  border-radius: 18px;
}

#uploadModal #previewGrid.has-previews .drop-zone-content {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
}

#uploadModal #previewGrid.has-previews .drop-zone-icon-shell {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.12);
  box-shadow: none;
}

#uploadModal #previewGrid.has-previews .drop-zone-icon {
  font-size: 18px;
}

#uploadModal #previewGrid.has-previews .drop-zone-copy {
  gap: 0;
  align-items: center;
}

#uploadModal #previewGrid.has-previews .drop-zone-text {
  font-size: 12px;
  line-height: 1.35;
}

#uploadModal #previewGrid.has-previews .drop-zone-text-primary {
  display: inline-block;
  font-weight: 700;
}

#uploadModal #previewGrid.has-previews .drop-zone-text-secondary {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
}

#uploadModal #uploadBtn,
#batchMoveModal #confirmBatchMoveBtn,
#renameImageModal #confirmRenameImageBtn,
#createGroupModal #confirmCreateGroupBtn,
#deleteGroupModal #confirmDeleteGroupBtn,
#deleteImageModal #confirmDeleteImageBtn {
  min-width: 120px;
}

#batchMoveModal .batch-move-modal-dialog {
  max-width: min(700px, calc(100vw - 48px));
}

#deleteImageModal .delete-image-modal-dialog {
  max-width: min(560px, calc(100vw - 40px));
}

#renameImageModal .rename-image-modal-dialog {
  --rename-image-modal-width: 560px;
  --rename-image-modal-height: 254px;
  width: var(--rename-image-modal-width);
  min-width: var(--rename-image-modal-width);
  max-width: var(--rename-image-modal-width);
  margin-left: auto;
  margin-right: auto;
}

#renameImageModal .rename-image-modal-dialog {
  height: var(--rename-image-modal-height);
  min-height: var(--rename-image-modal-height);
  max-height: var(--rename-image-modal-height);
  border-radius: 18px;
  overflow: hidden;
}

#renameImageModal .rename-image-modal-header {
  flex: 0 0 auto;
  /* Keep the original title inset, while the shared close control keeps
         * its platform-standard 16px distance from the dialog edge. */
  padding: 16px 16px 16px 22px;
}

#renameImageModal .rename-image-modal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

#renameImageModal .rename-image-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 22px 22px;
}

#renameImageModal .rename-image-modal-body .platform-field {
  margin-bottom: 0 !important;
  gap: 10px;
}

#renameImageModal .platform-field__label {
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

#renameImageModal #newImageName {
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--separator), white 10%);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--label-primary);
  font-size: 14px;
  box-shadow: none;
}

#renameImageModal #newImageName:focus {
  border-color: color-mix(in srgb, var(--accent), white 28%);
  box-shadow: var(--focus-ring);
}

#renameImageModal .rename-image-modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 22px;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#renameImageModal .rename-image-modal-footer .platform-button {
  min-width: 92px;
  height: 40px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

#renameImageModal .rename-image-modal-btn-secondary {
  border-color: color-mix(in srgb, var(--separator), white 12%);
  background: rgba(255, 255, 255, 0.72);
  color: var(--label-primary);
}

#renameImageModal .rename-image-modal-btn-secondary:hover,
#renameImageModal .rename-image-modal-btn-secondary:focus {
  border-color: color-mix(in srgb, var(--separator), white 4%);
  background: rgba(255, 255, 255, 0.9);
  color: var(--label-primary);
  box-shadow: none;
}

#renameImageModal #confirmRenameImageBtn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent), transparent 76%);
}

#renameImageModal #confirmRenameImageBtn:hover,
#renameImageModal #confirmRenameImageBtn:focus {
  border-color: color-mix(in srgb, var(--accent), black 8%);
  background: color-mix(in srgb, var(--accent), black 8%);
  color: #fff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent), transparent 72%);
}

html.image-bank-page-mode .delete-image-modal-dialog {
  width: 100%;
  max-width: min(560px, calc(100vw - 40px)) !important;
}

#deleteReferencedModal .delete-referenced-modal-dialog {
  --delete-referenced-modal-width: 760px;
  --delete-referenced-modal-height: 560px;
  width: var(--delete-referenced-modal-width);
  min-width: var(--delete-referenced-modal-width);
  max-width: var(--delete-referenced-modal-width);
  margin-left: auto;
  margin-right: auto;
}

#deleteImageModal .delete-image-modal-header {
  min-height: 54px;
  padding: 12px 18px;
  align-items: center;
}

html.image-bank-page-mode .delete-image-modal-header {
  min-height: 54px;
  padding: 12px 18px;
  align-items: center;
}

html.image-bank-page-mode .delete-image-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.2;
}

html.image-bank-page-mode .delete-image-modal-title i {
  color: var(--label-secondary);
  font-size: 15px;
}

#deleteReferencedModal .delete-referenced-modal-header {
  min-height: 46px;
  padding: 8px 16px;
  align-items: center;
}

.image-bank-dialog-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#deleteImageModal .delete-image-modal-body {
  padding: 24px 24px 16px !important;
}

html.image-bank-page-mode .delete-image-modal-body {
  padding: 24px 24px 16px !important;
}

#deleteReferencedModal .delete-referenced-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 24px 12px !important;
}

#deleteImageModal .delete-image-modal-footer {
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 20px !important;
}

html.image-bank-page-mode .delete-image-modal-footer {
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 20px !important;
}

html.image-bank-page-mode .delete-image-modal-btn {
  min-width: 0;
  width: auto;
  height: 40px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  box-shadow: none;
  vertical-align: middle;
}

html.image-bank-page-mode .delete-image-modal-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0 !important;
  flex: 0 0 auto;
}

html.image-bank-page-mode .delete-image-modal-btn-secondary {
  border-color: color-mix(in srgb, var(--separator), white 14%);
  background: rgba(255, 255, 255, 0.88);
  color: var(--label-primary);
}

html.image-bank-page-mode .delete-image-modal-btn-secondary:hover,
html.image-bank-page-mode .delete-image-modal-btn-secondary:focus {
  border-color: color-mix(in srgb, var(--separator), white 4%);
  background: rgba(255, 255, 255, 0.96);
  color: var(--label-primary);
  box-shadow: none;
}

html.image-bank-page-mode .delete-image-modal-btn-danger {
  border-color: transparent;
  background: #ff5b52;
  color: #fff;
}

html.image-bank-page-mode .delete-image-modal-btn-danger:hover,
html.image-bank-page-mode .delete-image-modal-btn-danger:focus {
  background: #f24a40;
  color: #fff;
  box-shadow: none;
}

#deleteReferencedModal .delete-referenced-modal-dialog {
  height: var(--delete-referenced-modal-height);
  max-height: var(--delete-referenced-modal-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.image-bank-page-mode .batch-move-modal-header {
  min-height: 54px;
  padding: 12px 18px;
  align-items: center;
}

html.image-bank-page-mode .batch-move-modal-body {
  padding: 18px 22px 14px !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

html.image-bank-page-mode .batch-move-modal-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

html.image-bank-page-mode .batch-move-modal-intro-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-primary);
  line-height: 1.4;
}

html.image-bank-page-mode .batch-move-modal-intro-note {
  font-size: 12px;
  color: var(--label-secondary);
  line-height: 1.45;
}

html.image-bank-page-mode .batch-move-tree-shell {
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(248, 250, 252, 0.84)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

html.image-bank-page-mode .batch-move-tree-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--separator), white 14%);
  background: rgba(255, 255, 255, 0.52);
}

html.image-bank-page-mode .batch-move-tree-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.3;
}

html.image-bank-page-mode .batch-move-tree-hint {
  font-size: 12px;
  color: var(--label-secondary);
  line-height: 1.35;
  text-align: right;
}

html.image-bank-page-mode .group-modal-dialog {
  width: 100%;
  max-width: min(680px, calc(100vw - 48px)) !important;
}

#createGroupModal.image-bank-group-dialog-layer {
  z-index: 9100;
}

html.image-bank-page-mode .group-modal-title {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

html.image-bank-page-mode .group-modal-dialog-delete {
  max-width: min(620px, calc(100vw - 48px)) !important;
}

html.image-bank-page-mode .group-modal-header {
  min-height: 52px;
  padding: 10px 18px;
  align-items: center;
}

html.image-bank-page-mode .group-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.2;
}

html.image-bank-page-mode .group-modal-title i {
  color: var(--label-secondary);
  font-size: 15px;
}

html.image-bank-page-mode .group-modal-body {
  padding: 20px 24px 16px !important;
}

html.image-bank-page-mode .group-modal-body-delete {
  padding-top: 24px !important;
}

html.image-bank-page-mode .group-modal-path-wrap {
  margin-bottom: 18px;
}

html.image-bank-page-mode .group-modal-path-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(248, 250, 252, 0.78)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

html.image-bank-page-mode .group-modal-path-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-secondary);
}

html.image-bank-page-mode .group-modal-path-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-primary);
  line-height: 1.45;
  word-break: break-word;
}

html.image-bank-page-mode .group-modal-field {
  margin-bottom: 0;
}

html.image-bank-page-mode .group-modal-label {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--label-primary);
}

html.image-bank-page-mode .group-modal-input {
  height: 44px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--label-primary);
  padding: 0 14px;
}

html.image-bank-page-mode .group-modal-input::placeholder {
  color: rgba(60, 60, 67, 0.42);
}

html.image-bank-page-mode .group-modal-input:focus {
  border-color: color-mix(in srgb, var(--accent), white 28%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 76%);
  background: rgba(255, 255, 255, 0.98);
}

html.image-bank-page-mode .group-modal-footer {
  padding: 14px 24px 20px !important;
  gap: 8px;
}

html.image-bank-page-mode .group-modal-btn {
  min-width: 112px;
  height: 40px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  box-shadow: none;
  vertical-align: middle;
}

html.image-bank-page-mode .group-modal-dialog-delete .group-modal-btn {
  min-width: 0;
  width: auto;
}

html.image-bank-page-mode .group-modal-dialog-create .group-modal-btn {
  min-width: 0;
  width: auto;
}

html.image-bank-page-mode .group-modal-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0 !important;
  flex: 0 0 auto;
}

html.image-bank-page-mode .group-modal-btn-secondary {
  border-color: color-mix(in srgb, var(--separator), white 14%);
  background: rgba(255, 255, 255, 0.88);
  color: var(--label-primary);
}

html.image-bank-page-mode .group-modal-btn-secondary:hover,
html.image-bank-page-mode .group-modal-btn-secondary:focus {
  border-color: color-mix(in srgb, var(--separator), white 4%);
  background: rgba(255, 255, 255, 0.96);
  color: var(--label-primary);
  box-shadow: none;
}

html.image-bank-page-mode .group-modal-btn-create {
  border-color: transparent;
  background: #34c759;
  color: #fff;
}

html.image-bank-page-mode .group-modal-btn-create:hover,
html.image-bank-page-mode .group-modal-btn-create:focus {
  background: #30b955;
  color: #fff;
  box-shadow: none;
}

html.image-bank-page-mode .group-modal-btn-danger {
  border-color: transparent;
  background: #ff5b52;
  color: #fff;
}

html.image-bank-page-mode .group-modal-btn-danger:hover,
html.image-bank-page-mode .group-modal-btn-danger:focus {
  background: #f24a40;
  color: #fff;
  box-shadow: none;
}

html.image-bank-page-mode .batch-move-modal-footer {
  padding-top: 12px !important;
  align-items: center;
  display: flex;
  gap: 12px;
}

/* React 页脚不引入额外布局盒，保持原有目标说明与按钮的同一行排列。 */
#batchMoveModalFooterReactRoot {
  display: contents;
}

html.image-bank-page-mode .batch-move-target-summary {
  margin-right: auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.image-bank-page-mode .batch-move-submit-error {
  display: block;
  margin-top: 4px;
  color: var(--danger, #dc3545);
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
}

html.image-bank-page-mode .batch-move-modal-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

html.image-bank-page-mode .group-delete-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}

html.image-bank-page-mode .group-delete-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 59, 48, 0.08);
  color: #ff3b30;
  font-size: 28px;
}

html.image-bank-page-mode .group-delete-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.4;
}

html.image-bank-page-mode .group-delete-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 149, 0, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 240, 0.94),
    rgba(255, 247, 234, 0.82)
  );
}

html.image-bank-page-mode .group-delete-note-icon {
  flex: 0 0 auto;
  color: #ff9500;
  font-size: 14px;
  line-height: 1.4;
  padding-top: 1px;
}

html.image-bank-page-mode .group-delete-note-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--label-primary);
}

html.image-bank-page-mode .delete-image-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}

html.image-bank-page-mode .delete-image-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 59, 48, 0.08);
  color: #ff3b30;
  font-size: 28px;
}

html.image-bank-page-mode .delete-image-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.4;
}

html.image-bank-page-mode .delete-image-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 149, 0, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 240, 0.94),
    rgba(255, 247, 234, 0.82)
  );
}

html.image-bank-page-mode .delete-image-note-icon {
  flex: 0 0 auto;
  color: #ff9500;
  font-size: 14px;
  line-height: 1.4;
  padding-top: 1px;
}

html.image-bank-page-mode .delete-image-note-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--label-primary);
}

#deleteImageModal #deleteImageMessage strong {
  font-weight: 700;
}

.delete-referenced-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delete-referenced-list-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(248, 250, 252, 0.84)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.delete-referenced-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--separator), white 14%);
  background: rgba(255, 255, 255, 0.52);
}

.delete-referenced-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--label-primary);
  line-height: 1.3;
}

.delete-referenced-list-hint {
  font-size: 12px;
  color: var(--label-secondary);
  line-height: 1.35;
  text-align: right;
}

.delete-referenced-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px;
}

#deleteReferencedList .delete-referenced-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(
      0,
      0.95fr
    );
  grid-template-rows: 20px 24px;
  column-gap: 24px;
  row-gap: 5px;
  align-items: center;
  cursor: default;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--separator), white 14%);
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.78) !important;
}

#deleteReferencedList .delete-referenced-item:last-child {
  margin-bottom: 0;
}

.delete-referenced-thumb-shell {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--separator), white 12%);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.96),
    rgba(242, 245, 248, 0.9)
  );
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-referenced-thumb {
  width: 52px !important;
  height: 52px !important;
  flex: 0 0 auto;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.delete-referenced-thumb-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--label-tertiary);
  font-size: 18px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.92),
    rgba(240, 244, 247, 0.9)
  );
}

.delete-referenced-thumb-shell.is-fallback .delete-referenced-thumb-fallback {
  display: flex;
}

.delete-referenced-detail-label,
.delete-referenced-detail-value {
  min-width: 0;
  display: flex;
}

.delete-referenced-detail-label {
  grid-row: 1;
  align-self: center;
  align-items: center;
}

.delete-referenced-detail-value {
  grid-row: 2;
  align-self: center;
  align-items: center;
}

.delete-referenced-image-name {
  grid-column: 2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--label-primary);
}

.delete-referenced-image-meta {
  grid-column: 2;
  font-size: 12px;
  line-height: 1.4;
  color: var(--label-secondary);
}

.delete-referenced-reference-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--label-secondary);
  white-space: nowrap;
}

.delete-referenced-model-label {
  grid-column: 3;
}

.delete-referenced-location-label {
  grid-column: 4;
}

.delete-referenced-reference-value {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--label-primary);
  word-break: break-word;
}

.delete-referenced-model-value {
  grid-column: 3;
}

.delete-referenced-location-value {
  grid-column: 4;
}

.delete-referenced-model-list,
.delete-referenced-location-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.delete-referenced-model-entry {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--label-primary);
}

.delete-referenced-more-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--label-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.delete-referenced-location-entry,
.delete-referenced-reference-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.delete-referenced-reference-tag,
.delete-referenced-reference-model-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.delete-referenced-reference-tag {
  color: var(--label-secondary);
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.delete-referenced-reference-model-chip {
  color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.14);
}

.delete-referenced-reference-empty {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--label-tertiary);
}

#deleteReferencedList .delete-referenced-item-models-only {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 20px 24px;
}

.delete-referenced-item-models-only .delete-referenced-model-label,
.delete-referenced-item-models-only .delete-referenced-model-value {
  grid-column: 1;
}

.delete-referenced-item-models-only .delete-referenced-location-label,
.delete-referenced-item-models-only .delete-referenced-location-value {
  grid-column: 2;
}

.delete-referenced-empty {
  padding: 28px 12px 30px;
  text-align: center;
  font-size: 13px;
  color: var(--label-secondary);
}

@media (max-width: 767.98px) {
  #deleteReferencedList .delete-referenced-item {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: start;
  }

  .delete-referenced-thumb-shell {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .delete-referenced-detail-label,
  .delete-referenced-detail-value,
  .delete-referenced-image-name,
  .delete-referenced-image-meta,
  .delete-referenced-model-label,
  .delete-referenced-location-label,
  .delete-referenced-model-value,
  .delete-referenced-location-value {
    grid-column: 2;
    grid-row: auto;
  }

  #deleteReferencedList .delete-referenced-item-models-only {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .delete-referenced-item-models-only .delete-referenced-model-label,
  .delete-referenced-item-models-only .delete-referenced-model-value,
  .delete-referenced-item-models-only .delete-referenced-location-label,
  .delete-referenced-item-models-only .delete-referenced-location-value {
    grid-column: 1;
    grid-row: auto;
  }
}

.image-detail-modal-dialog {
  height: var(--image-detail-modal-height);
  max-height: var(--image-detail-modal-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#imageDetailInfo .list-group-item,
#duplicateImagesList .list-group-item,
#deleteReferencedList .image-bank-referenced-item {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 14%);
  background: rgba(255, 255, 255, 0.74);
  margin-bottom: 8px;
}

html.embed-image-bank-mode.embed-viewer-mode,
html.embed-image-bank-mode.embed-viewer-mode body,
html.embed-image-bank-mode.embed-viewer-mode main.container-fluid {
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

html.embed-image-bank-mode.embed-viewer-mode .image-bank-embed-shell {
  --image-bank-grid-gap: 14px;
  --image-bank-card-padding: 11px;
  --image-bank-card-radius: 18px;
  --image-bank-thumb-radius: 14px;
  --image-bank-card-bg: rgba(255, 255, 255, 0.72);
  --image-bank-card-bg-hover: rgba(255, 255, 255, 0.82);
  width: 100%;
  min-width: 0;
}

html.embed-image-bank-mode.embed-viewer-mode .image-bank-embed-surface {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px 28px 12px 12px;
  overflow-x: hidden;
  background: var(--glass-panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: saturate(1.24) blur(28px);
  -webkit-backdrop-filter: saturate(1.24) blur(28px);
}

html.embed-image-bank-mode.embed-viewer-mode .image-bank-embed-grid-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

html.embed-image-bank-mode.embed-viewer-mode #imagesGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--image-bank-grid-gap);
  justify-content: start;
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  padding: 0;
  overflow-x: hidden;
}

html.embed-image-bank-mode.embed-viewer-mode #imagesGrid .preview-item {
  min-width: 0;
}

html.embed-image-bank-mode.embed-viewer-mode #imagesGrid .preview-img-wrapper {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

html.embed-image-bank-mode.embed-viewer-mode
  #imagesGrid
  .preview-item:hover
  .preview-img-wrapper {
  border-color: color-mix(in srgb, var(--separator), white 16%);
}

html.embed-image-bank-mode.embed-viewer-mode #embedInlineGroupPicker {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

html.embed-image-bank-mode.embed-viewer-mode
  #embedInlineGroupPicker
  .embed-inline-group-label {
  display: none;
}

.image-selection-count {
  margin-left: 8px;
  color: var(--label-secondary);
  font-size: 14px;
}

.pill-action-btn {
  border-color: color-mix(in srgb, var(--accent), transparent 52%);
  background: transparent;
  color: var(--accent);
}

.pill-action-btn:hover:not(:disabled),
.pill-action-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent), transparent 34%);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  color: var(--accent);
}

.image-toolbar-count {
  color: var(--label-secondary);
}

html.image-bank-page-mode .group-list-scroll-panel {
  max-height: 400px;
  overflow-y: auto;
}

#batchMoveGroupList.group-list-scroll-panel {
  max-height: 404px;
  padding: 8px 10px 10px;
}

#batchMoveGroupList .image-group-tree-item {
  position: relative;
  min-height: 40px;
  height: 40px;
  margin-bottom: 2px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}

#batchMoveGroupList .image-group-tree-item.is-hidden {
  display: none;
}

#batchMoveGroupList .image-group-tree-item:last-child {
  margin-bottom: 0;
}

#batchMoveGroupList .image-group-tree-item:hover {
  background: rgba(0, 122, 255, 0.08);
}

#batchMoveGroupList .image-group-tree-item.selected {
  background: color-mix(in srgb, var(--accent), white 86%);
  border-color: transparent;
  box-shadow: none;
}

#batchMoveGroupList .image-group-tree-item .group-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#batchMoveGroupList .image-group-tree-item .group-node-icon {
  color: var(--label-primary);
}

html.image-bank-page-mode
  .batch-move-tree-shell
  .image-group-tree-item.selected
  .group-node-icon {
  color: var(--accent-strong);
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-0 {
  padding-left: 12px;
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-1 {
  padding-left: 28px;
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-2 {
  padding-left: 44px;
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-3 {
  padding-left: 60px;
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-4 {
  padding-left: 76px;
}

html.image-bank-page-mode .batch-move-tree-shell .group-level-5,
html.image-bank-page-mode .batch-move-tree-shell .group-level-6,
html.image-bank-page-mode .batch-move-tree-shell .group-level-7,
html.image-bank-page-mode .batch-move-tree-shell .group-level-8 {
  padding-left: 92px;
}

/* 图片下载进度：桌面工具风格的轻量材质面板。 */
#batchDownloadProgressReactRoot,
#batchDownloadProgressReactRoot > .image-bank-download-progress-dialog {
  width: 100%;
}

.image-bank-download-progress-dialog {
  overflow: hidden;
  border: 1px solid var(--separator, rgba(60, 60, 67, 0.18));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 60px rgba(28, 28, 30, 0.22);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Arial, sans-serif;
}

.image-bank-download-progress-header,
.image-bank-download-progress-footer {
  padding: 16px 16px 16px 20px;
  border-color: var(--separator, rgba(60, 60, 67, 0.18));
}

.image-bank-download-progress-kicker {
  margin: 0 0 2px;
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.image-bank-download-progress-header .platform-dialog__title {
  color: var(--label-primary, #111);
  font-size: 18px;
  font-weight: 700;
}

.image-bank-download-progress-body {
  padding: 8px 20px 20px;
}

.image-bank-download-progress-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent, #007aff), white 86%);
  color: var(--accent, #007aff);
  font-size: 26px;
}

.image-bank-download-progress-icon.is-complete {
  background: color-mix(in srgb, var(--success, #34c759), white 84%);
  color: var(--success, #34c759);
}
.image-bank-download-progress-icon.is-error {
  background: color-mix(in srgb, var(--danger, #ff3b30), white 86%);
  color: var(--danger, #ff3b30);
}

.image-bank-download-progress-copy {
  display: grid;
  gap: 5px;
  text-align: center;
}
.image-bank-download-progress-copy strong {
  color: var(--label-primary, #111);
  font-size: 15px;
}
.image-bank-download-progress-copy span {
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  font-size: 13px;
  line-height: 1.5;
}

.image-bank-download-progress-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 14px;
  padding: 0;
  list-style: none;
}

.image-bank-download-progress-steps li {
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  font-size: 12px;
  text-align: center;
}

.image-bank-download-progress-steps li::before {
  content: "";
  display: block;
  height: 4px;
  margin-bottom: 7px;
  border-radius: 999px;
  background: var(--fill-secondary, rgba(120, 120, 128, 0.16));
}

.image-bank-download-progress-steps li.is-current,
.image-bank-download-progress-steps li.is-done {
  color: var(--accent, #007aff);
  font-weight: 600;
}
.image-bank-download-progress-steps li.is-current::before,
.image-bank-download-progress-steps li.is-done::before {
  background: var(--accent, #007aff);
}
.image-bank-download-progress-wait {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  font-size: 13px;
}
.image-bank-download-progress-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.image-bank-download-progress-bar .image-bank-download-progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--fill-secondary, rgba(120, 120, 128, 0.16));
  overflow: hidden;
}
.image-bank-download-progress-bar .image-bank-download-progress-fill {
  background: var(--accent, #007aff);
  display: block;
  height: 100%;
  transition: width 0.2s ease;
}
.image-bank-download-progress-footer {
  justify-content: flex-end;
}
.image-bank-download-progress-footer .platform-button {
  min-height: 36px;
  padding-inline: 16px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .image-bank-download-progress-dialog *,
  .image-bank-download-progress-dialog *::before {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .image-bank-download-progress-dialog {
    background: var(--bg-primary, #fff);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-color-scheme: dark) {
  .image-bank-download-progress-dialog {
    background: rgba(28, 28, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.14);
  }
}

@media (max-width: 767.98px) {
  html.image-bank-page-mode .batch-move-modal-footer {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  html.image-bank-page-mode .batch-move-target-summary {
    flex: 1 1 100%;
    white-space: normal;
  }
}

.image-grid-loading-state {
  grid-column: 1 / -1;
  height: 100%;
}

#uploadModal .image-upload-dialog {
  width: 1100px;
  min-width: 1100px;
  max-width: 1100px;
  height: 880px;
  min-height: 880px;
  max-height: 880px;
  margin-left: auto;
  margin-right: auto;
}

/* 与迁移前 Bootstrap .modal 的 9100 层级一致，必须覆盖固定导航栏（8000）。 */
#uploadModal.image-bank-upload-layer {
  z-index: 9100;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 上传弹窗固定为 880px 高：当可视高度不足时，由遮罩层承接纵向滚动，
 * 避免被 platform-dialog-open 锁定的页面吞掉超出部分。 */
@media (max-height: 911px) {
  #uploadModal.image-bank-upload-layer {
    align-items: flex-start;
  }
}

#uploadModal .image-bank-upload-title,
#uploadModal .image-upload-group-block > .platform-field__label,
#uploadModal .upload-preview-block > .platform-field__label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

#uploadModal .image-upload-dialog {
  height: 880px;
  min-height: 880px;
  max-height: 880px;
  display: flex;
  flex-direction: column;
  /* 仅预览列表滚动，避免共享弹窗容器再出现第二条滚动条。 */
  overflow: hidden;
}

#uploadModal .image-bank-upload-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#uploadModal #uploadForm {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.image-upload-group-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-preview-block {
  min-height: 350px;
  display: flex;
  flex-direction: column;
}

.image-bank-upload-progress-meta {
  align-items: center;
  color: var(--label-secondary, rgba(60, 60, 67, 0.68));
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 14px;
}
.upload-progress-shell {
  background: var(--fill-secondary, rgba(120, 120, 128, 0.16));
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.upload-progress-bar {
  background: var(--accent, #007aff);
  display: block;
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

.modal-scroll-panel {
  max-height: 500px;
  overflow-y: auto;
}

.modal-scroll-panel-sm {
  max-height: 320px;
}

.image-detail-preview {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1) !important;
}

.image-upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.image-detail-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-secondary);
  margin-bottom: 16px;
}

.modal-hero-icon {
  font-size: 3rem;
}

.page-jump-label {
  font-size: 13px;
  color: #6c757d;
}

.referenced-image-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

html.image-bank-page-mode .duplicate-image-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

html.image-bank-page-mode .preview-img-placeholder {
  background: #eee;
}

.min-w-0 {
  min-width: 0;
}

.image-detail-modal-header {
  min-height: 40px;
  padding: 6px 12px 6px 16px;
  align-items: center;
}

.image-detail-modal-title {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--label-primary);
  flex: 1 1 auto;
  line-height: 1.2;
}

.image-detail-modal-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--image-detail-panel-width);
  height: 100%;
  min-height: 0;
}

.image-detail-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  min-height: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.9),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      rgba(248, 250, 252, 0.94),
      rgba(241, 245, 249, 0.86)
    );
  border-right: 1px solid color-mix(in srgb, var(--separator), white 24%);
}

.image-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  color: var(--label-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 24px rgba(15, 23, 42, 0.08);
  z-index: 2;
  opacity: 0.68;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.image-detail-nav.prev {
  left: 14px;
}

.image-detail-nav.next {
  right: 14px;
}

.image-detail-nav:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.78);
  opacity: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 12px 28px rgba(15, 23, 42, 0.12);
}

.image-detail-nav:disabled {
  opacity: 0.22;
  cursor: default;
  box-shadow: none;
}

.image-detail-nav i {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

.image-detail-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78),
    rgba(250, 250, 252, 0.72)
  );
}

.image-detail-panel-inner,
.image-detail-modal-body {
  min-height: 0;
}

.image-detail-panel-inner {
  width: 100%;
  height: 100%;
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
}

.image-detail-info-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.image-detail-info-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 2px 6px;
}

.image-detail-info-row.is-emphasis {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 20%);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.image-detail-info-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--label-secondary);
  line-height: 1.2;
}

.image-detail-info-label i {
  font-size: 13px;
  color: rgba(60, 60, 67, 0.62);
}

.image-detail-info-value {
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--label-primary);
  word-break: break-word;
}

.image-detail-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.delete-referenced-image-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-detail-path {
  color: rgba(17, 17, 17, 0.88);
}

.image-detail-thumb-section {
  margin-top: auto;
  padding-top: 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.image-detail-thumb-scroll {
  flex: 1 1 auto;
  min-height: 214px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.image-detail-thumb-scroll::-webkit-scrollbar {
  width: 6px;
}

.image-detail-thumb-scroll::-webkit-scrollbar-thumb {
  background: rgba(60, 60, 67, 0.22);
  border-radius: 999px;
}

.image-detail-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.image-detail-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--separator), white 18%);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  opacity: 0.5;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.image-detail-thumb:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.92);
  opacity: 0.9;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.88),
    0 8px 20px rgba(15, 23, 42, 0.08);
}

.image-detail-thumb.active {
  border-color: rgba(255, 255, 255, 0.96);
  opacity: 1;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.96),
    0 10px 24px rgba(15, 23, 42, 0.1);
}

.image-detail-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-detail-thumb-empty {
  grid-column: 1 / -1;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--separator), white 16%);
  color: var(--label-secondary);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
  padding: 12px;
}

.group-name-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.group-name-inline-input {
  width: fit-content;
  max-width: 100px;
  display: inline-block;
}

.group-name-confirm-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition:
    background-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
}

.group-name-confirm-btn:hover {
  background: transparent;
  color: var(--accent-strong);
}

.group-name-confirm-btn:focus {
  box-shadow: none;
  outline: none;
}

.group-name-confirm-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.group-name-confirm-btn:active {
  transform: scale(0.97);
}

.group-name-confirm-btn i {
  width: auto;
  margin: 0;
  font-size: 14px;
  line-height: 1;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 0;
  min-height: 52px;
  margin-top: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .btn {
  margin: 0;
  line-height: 1.2;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 13px;
  border-width: 1px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-btn.btn-primary {
  background: color-mix(in srgb, var(--accent), white 88%);
  border-color: color-mix(in srgb, var(--accent), white 66%);
  color: color-mix(in srgb, var(--accent), black 10%);
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.12);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-btn.btn-outline-secondary {
  border-color: color-mix(in srgb, var(--separator), white 12%);
  color: var(--label-primary);
  background: rgba(255, 255, 255, 0.9);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-btn.btn-outline-secondary:hover:not(:disabled) {
  background: rgba(245, 247, 250, 0.96);
  border-color: color-mix(in srgb, var(--separator), white 2%);
  color: var(--label-primary);
  transform: translateY(-1px);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .nav-btn {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  height: 36px;
  padding: 0 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-color: color-mix(in srgb, var(--separator), white 12%);
  border-width: 1px;
  color: var(--label-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .nav-btn:hover:not(:disabled) {
  background: rgba(245, 247, 250, 0.96);
  border-color: color-mix(in srgb, var(--separator), white 2%);
  color: var(--label-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .nav-btn:disabled {
  opacity: 0.46;
  background: rgba(255, 255, 255, 0.72);
  border-color: color-mix(in srgb, var(--separator), white 24%);
  color: var(--label-tertiary);
  box-shadow: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .nav-btn
  i {
  font-size: 12px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-info {
  color: var(--label-secondary);
  font-size: 13px;
  white-space: nowrap;
  margin-left: 4px;
  padding-left: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .pagination-ellipsis {
  color: var(--label-secondary);
  padding: 0 2px;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-jump-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding-left: 0;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-jump-input {
  width: 46px;
  height: 36px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--separator), white 16%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--label-primary);
  text-align: center;
  font-size: 13px;
  box-shadow: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-jump-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), white 34%);
  box-shadow: none;
}

html.embed-image-bank-mode:not(.embed-viewer-mode)
  #imagePagination.picker-image-pagination
  .page-jump-btn {
  min-width: 52px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent), white 88%);
  border-color: color-mix(in srgb, var(--accent), white 66%);
  color: color-mix(in srgb, var(--accent), black 10%);
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.12);
  margin-left: 0;
}
