/* ===== 图片预览弹窗增强样式 ===== */

/* 图片预览弹窗标题栏 */
 .image-preview-header {
     background: rgba(255,255,255,0.95);
     border-bottom: 1px solid #eee;
     padding: 3px 8px;
     cursor: grab;
     display: flex;
     align-items: center;
     justify-content: space-between;
     border-radius: 8px 8px 0 0;
 }

.image-preview-header:active {
    cursor: grabbing;
}

.image-preview-header .modal-title {
     font-size: 0.7rem;
    font-weight: 600;
    color: #333;
 }

  .image-preview-header .modal-controls {
    display: flex;
    align-items: center;
    gap: 2px;
 }

  .image-preview-header .modal-controls .btn {
     width: 20px;
     height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #666;
    background: transparent;
    border: none;
    transition: all 0.2s;
 }

  .image-preview-header .modal-controls .btn:hover {
    background: rgba(0,0,0,0.08);
    color: #333;
 }

  .image-preview-header .modal-controls .btn i {
     font-size: 0.6rem;
 }

/* 置顶按钮激活状态 */
.modal-btn-pin.active {
    background: #007bff !important;
    color: white !important;
    transform: rotate(-45deg);
}

.modal-btn-pin.active:hover {
    background: #0056b3 !important;
}

/* ==================== 预览窗「移动到项目」 ==================== */

.preview-move-dropdown {
    position: fixed;
    z-index: 100000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    padding: 6px;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
}
.preview-move-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: #495057;
    padding: 6px 10px 4px;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 4px;
}
.preview-move-item {
    font-size: 0.78rem;
    color: #333;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-move-item:hover { background: #f1f3f5; }
.preview-move-item.muted { color: #adb5bd; cursor: default; }

.preview-move-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -12px);
    background: rgba(25, 135, 84, 0.95);
    color: #fff;
    font-size: 0.8rem;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.3s;
    z-index: 100001;
    pointer-events: none;
}
.preview-move-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 置顶弹窗样式 */
.preview-pinned {
    z-index: 9999 !important;
    box-shadow: 0 0 20px rgba(0,123,255,0.3);
}

/* 图片预览主体 */
 .image-preview-body {
     padding: 8px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: #f8f9fa;
     min-height: 160px;
 }

.image-preview-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

/* ==================== 窗口缩放手柄 ================= */

.resize-handle {
    position: absolute;
    z-index: 10;
}

.resize-n {
    top: 0;
    left: 8px;
    right: 8px;
    height: 6px;
    cursor: n-resize;
}

.resize-s {
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 6px;
    cursor: s-resize;
}

.resize-e {
    top: 8px;
    right: 0;
    bottom: 8px;
    width: 6px;
    cursor: e-resize;
}

.resize-w {
    top: 8px;
    left: 0;
    bottom: 8px;
    width: 6px;
    cursor: w-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: ne-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: nw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    cursor: se-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 12px;
    height: 12px;
    cursor: sw-resize;
}

/* ==================== 项目详情弹窗缩放手柄 ==================== */

#projectDetailModal .resize-handle {
    position: absolute;
    z-index: 1060;
    background: transparent;
    transition: opacity 0.2s;
}

/* 角点手柄始终可见（有颜色） */
#projectDetailModal .resize-ne,
#projectDetailModal .resize-nw,
#projectDetailModal .resize-se,
#projectDetailModal .resize-sw {
    opacity: 0.6;
    transition: all 0.2s;
}

#projectDetailModal .resize-ne:hover,
#projectDetailModal .resize-nw:hover,
#projectDetailModal .resize-se:hover,
#projectDetailModal .resize-sw:hover {
    opacity: 1;
    transform: scale(1.3);
}

/* 边缘手柄hover时可见 */
#projectDetailModal .resize-n,
#projectDetailModal .resize-s,
#projectDetailModal .resize-e,
#projectDetailModal .resize-w {
    opacity: 0;
}

#projectDetailModal:hover .resize-n,
#projectDetailModal:hover .resize-s,
#projectDetailModal:hover .resize-e,
#projectDetailModal:hover .resize-w {
    opacity: 1;
}

#projectDetailModal .resize-n { top: -3px; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
#projectDetailModal .resize-s { bottom: -3px; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
#projectDetailModal .resize-e { right: -3px; top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
#projectDetailModal .resize-w { left: -3px; top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
#projectDetailModal .resize-ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: nesw-resize; background: rgba(0,123,255,0.3); border-radius: 50%; }
#projectDetailModal .resize-nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nwse-resize; background: rgba(0,123,255,0.3); border-radius: 50%; }
#projectDetailModal .resize-se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: nwse-resize; background: rgba(0,123,255,0.3); border-radius: 50%; }
#projectDetailModal .resize-sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: nesw-resize; background: rgba(0,123,255,0.3); border-radius: 50%; }

/* ==================== 图片预览浮动窗口样式（覆盖） ==================== */

/* 浮动窗口容器 */
.image-preview-float {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 11000 !important;
    pointer-events: none !important;
    background: transparent !important;
}

/* 浮动窗口对话框 */
 .image-preview-dialog {
      position: fixed !important;
      background: white !important;
      border-radius: 8px !important;
      box-shadow: 0 4px 24px rgba(0,0,0,0.15) !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
      pointer-events: auto !important;
      min-width: 320px !important;
      min-height: 240px !important;
      z-index: 11001 !important;
      transform: none !important;
      margin: 0 !important;
  }

/* 图片预览弹窗标题栏 */
.image-preview-header {
     background: rgba(255,255,255,0.95) !important;
     border-bottom: 1px solid #eee !important;
     padding: 3px 8px !important;
     cursor: grab !important;
     display: flex !important;
     align-items: center !important;
     justify-content: space-between !important;
     border-radius: 8px 8px 0 0 !important;
     flex-shrink: 0 !important;
 }

.image-preview-header:active {
    cursor: grabbing !important;
}

/* 图片预览主体 */
.image-preview-body {
     padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8f9fa !important;
    flex: 1 !important;
    overflow: auto !important;
    min-height: 0 !important;
}

.image-preview-main {
     max-width: 100% !important;
     max-height: 100% !important;
     width: auto !important;
     height: auto !important;
    border-radius: 4px !important;
    display: block !important;
    object-fit: contain !important;
}

/* 图片导航按钮 */
.image-preview-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-wrapper:hover .nav-btn {
    opacity: 1;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0 !important;
    cursor: default;
}

/* 置顶锁定状态 */
.preview-pinned .image-preview-header {
    background: #4a6cf7 !important;
}

.modal-btn-pin.active {
    background: rgba(255,255,255,0.3) !important;
    color: #fff000 !important;
}

/* 缩略图列表 */
.image-preview-thumbnails {
     background: rgba(255,255,255,0.95) !important;
     padding: 6px 8px !important;
    display: flex !important;
    gap: 4px !important;
     overflow-x: auto !important;
     scrollbar-width: none !important;
     border-top: 1px solid #eee !important;
     flex-shrink: 0 !important;
 }
