* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #f5f5f5;
    cursor: grab;
}

body.dragging {
    cursor: grabbing;
}

.canvas-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.canvas {
    position: relative;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
}

.image-item {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease;
    cursor: pointer;
    background: #fff;
    will-change: transform;
    border-color: white;
    border-width: 3px;
    border-style: solid;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease;
    cursor: pointer;
    background: #fff;
    will-change: transform;
}

.image-item:hover {
    transform: scale(1.15) rotate(0deg) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.image-item img,
.image-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 0;
}

.image-item video {
    background: #000;
}

/* 黑色透明描边层 - 叠加在图片上 */
.image-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 21px;
    pointer-events: none;
    z-index: 1;
    box-sizing: border-box;
}

/* 加载占位符 */
.image-placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #ededed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* 全局 Loading 指示器 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 245, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.global-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-item {
        border-radius: 8px;
    }
    
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .loading-text {
        font-size: 12px;
    }
}
