/**
 * 九宫格图片/视频上传预览
 * 支持拖拽排序
 */

.moments-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
    max-width: 450px;
}

.moments-upload-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.moments-upload-item:hover {
    border-color: #576b95;
    box-shadow: 0 2px 8px rgba(87, 107, 149, 0.3);
}

.moments-upload-item.dragging {
    opacity: 0.5;
    border-color: #576b95;
}

.moments-upload-item.drag-over {
    border-color: #52c41a;
    background: #f0f9ff;
}

.moments-upload-item-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moments-upload-item img,
.moments-upload-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moments-upload-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 10;
    transition: background 0.3s;
}

.moments-upload-item-delete:hover {
    background: rgba(245, 108, 108, 0.9);
}

.moments-upload-item-type {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    border-radius: 3px;
    z-index: 10;
}

.moments-upload-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    pointer-events: none;
}

.moments-upload-add {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #fafafa;
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.moments-upload-add:hover {
    border-color: #576b95;
    background: #f0f0f0;
}

.moments-upload-add-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.moments-upload-add-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.moments-upload-add-text {
    font-size: 12px;
}

.moments-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(87, 107, 149, 0.2);
}

.moments-upload-progress-bar {
    height: 100%;
    background: #576b95;
    transition: width 0.3s;
}

/* 上传按钮组 */
.moments-upload-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.moments-upload-button {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.moments-upload-button:hover {
    background: #e8f4ff;
    border-color: #576b95;
    color: #576b95;
}

.moments-upload-button input[type="file"] {
    display: none;
}

.moments-upload-button i {
    margin-right: 5px;
    font-size: 16px;
}

/* 拖拽提示 */
.moments-upload-tip {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 10px;
}

/* 限制提示 */
.moments-upload-limit {
    font-size: 12px;
    color: #f5222d;
    margin-top: 5px;
}

/* 响应式 */
@media (max-width: 768px) {
    .moments-upload-grid {
        max-width: 100%;
    }
    
    .moments-upload-item-delete {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

