```html
body {
fontfamily: Arial, sansserif;
margin: 20px;
}
h1 {
textalign: center;
}
form {
maxwidth: 400px;
margin: 0 auto;
}
input[type="text"] {
width: 100%;
padding: 10px;
marginbottom: 10px;
boxsizing: borderbox;
}
input[type="submit"] {
width: 100%;
padding: 10px;
backgroundcolor: 007bff;
color: fff;
border: none;
cursor: pointer;
}
input[type="submit"]:hover {
backgroundcolor: 0056b3;
}
result {
margintop: 20px;
}
document.getElementById('calculatorForm').addEventListener('submit', function(event) {
event.preventDefault();
var investmentAmount = parseFloat(document.getElementById('investmentAmount').value);
var investmentDate = new Date(document.getElementById('investmentDate').value);
var redemptionDate = new Date(document.getElementById('redemptionDate').value);
var daysDiff = (redemptionDate investmentDate) / (1000 * 60 * 60 * 24);
var redemptionAmount = investmentAmount * (1 (0.03 * daysDiff / 365)); // 假设年收益率为3%
document.getElementById('result').innerHTML = "
您的赎回金额为:" redemptionAmount.toFixed(2) " 人民币
";});