body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    padding: 20px 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.welcome {
    font-size: 1.2em;
    font-weight: bold;
}

.logout a {
    color: #dc3545;
    text-decoration: none;
    font-weight: bold;
}

h2 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

.nav-links {
    text-align: center;
    margin-bottom: 20px;
}

.nav-links a {
    text-decoration: none;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #0056b3;
}

.form-section, .records-section, .stats-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: bold;
}

input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect total width */
}

button[type="submit"] {
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #218838;
}

hr {
    border: 0;
    height: 1px;
    background: #ccc;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 訊息樣式 */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: bold;
}

.success-message {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* BMI 範圍的顏色 */
.bmi-underweight {
    color: #007bff; /* 藍色 */
    font-weight: bold;
}

.bmi-normal {
    color: #28a745; /* 綠色 */
    font-weight: bold;
}

.bmi-overweight {
    color: #ffc107; /* 黃色 */
    font-weight: bold;
}

.bmi-obesity {
    color: #dc3545; /* 紅色 */
    font-weight: bold;
}

/* 平均 BMI 建議的樣式 */
.bmi-advice-avg {
    font-weight: bold;
    color: #495057; /* 深灰色 */
    font-size: 1.1em; /* 字體稍微大一點 */
}

/* 表格中 BMI 範圍的文字加粗 */
table strong {
    font-weight: bold;
}