The rule that is declared last wins, if they have equal weight.
In your last example the style from the link element is
declared later than the style in the style-element so it wins.
Code:
<html>
<head>
<style type="text/css">
@import url(import.css);
p {
color: blue;
}
</style>
<link href="link.css" rel="stylesheet" type="text/css" />
</head>
...



