body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* 淺灰色背景 */
    color: #333; /* 深灰色文字 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background-color: #040b57; /* 深藍色 */
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container-calc {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    gap: 20px;
}

.card {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.card h2 {
    color: #040b57; /* 深藍色 */
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555; /* 中灰色 */
}

.input-group input[type="number"] {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ddd; /* 淺灰色邊框 */
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

button {
    background-color: #040b57; /* 深藍色 */
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 15px;
}

button:hover {
    background-color: #ffd700; /* 淺一點的藍色 */
    color: black;
}

.result-card {
    background-color: #fff; /* 略淺的灰色 */
    border: 1px solid #eee; /* 更淺的灰色邊框 */
}

.result-card p {
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd; /* 虛線分隔 */
}

.result-card p:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.result-value {
    color: #040b57; /* 深藍色 */
    font-size: 20px;
}

#totalInterest {
    font-weight: bold;
    color: #040b57;
}

.footer {
    background-color: #333; /* 黑色 */
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    margin-top: auto; /* 將 footer 推到底部 */
}

/* RWD 調整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .card {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px;
    }
    .input-group input[type="number"], button {
        font-size: 14px;
    }
    .result-card p {
        font-size: 16px;
    }
    .result-value {
        font-size: 18px;
    }
}