diff --git a/nutrition-calculator.html b/nutrition-calculator.html
index ba971ea..ca850a8 100644
--- a/nutrition-calculator.html
+++ b/nutrition-calculator.html
@@ -11,7 +11,7 @@
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
background: #f4f6f8; color: #1f2933; line-height: 1.6;
}
- .wrap { max-width: 860px; margin: 0 auto; }
+ .wrap { max-width: 880px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: #6b7280; font-size: 13px; margin-bottom: 20px; }
.card {
@@ -21,9 +21,9 @@
.card h2 { font-size: 15px; margin: 0 0 14px; color: #0f766e; letter-spacing: .5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
- input[type=number], select {
+ input[type=number], input[type=text], select {
width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
- font-size: 14px; background: #fff; color: #1f2933;
+ font-size: 14px; background: #fff; color: #1f2933; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid #0d9488; outline-offset: -1px; border-color: #0d9488; }
.radios { display: flex; gap: 16px; padding-top: 4px; }
@@ -36,9 +36,7 @@
.hero .unit { font-size: 16px; font-weight: 400; opacity: .9; }
.hero .desc { font-size: 13px; opacity: .9; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
- .chip {
- background: rgba(255,255,255,.16); border-radius: 8px; padding: 8px 12px; font-size: 13px;
- }
+ .chip { background: rgba(255,255,255,.16); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.chip b { font-size: 16px; display: block; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid #eef1f4; }
@@ -54,15 +52,52 @@
.note { font-size: 12.5px; color: #6b7280; margin-top: 14px; line-height: 1.7; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } }
+
+ /* 饮食记录模块 */
+ .food-input { display: grid; grid-template-columns: 1fr 110px 96px; gap: 10px; align-items: end; }
+ @media (max-width: 560px) { .food-input { grid-template-columns: 1fr; } }
+ .btn {
+ padding: 9px 16px; border: none; border-radius: 8px; font-size: 14px;
+ background: #0d9488; color: #fff; cursor: pointer; font-family: inherit; font-weight: 500;
+ }
+ .btn:hover { background: #0f766e; }
+ .btn-ghost { background: #eef2f3; color: #475b63; }
+ .btn-ghost:hover { background: #e2e8ea; }
+ .btn-line { background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 13px; padding: 4px 6px; font-family: inherit; }
+ .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
+ .msg { font-size: 12.5px; margin-top: 8px; min-height: 18px; }
+ .msg-err { color: #b91c1c; }
+ .msg-ok { color: #0f766e; }
+ .progress { height: 12px; background: #e8edf0; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
+ .progress i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #0d9488); transition: width .25s; }
+ .progress i.over { background: linear-gradient(90deg, #f59e0b, #dc2626); }
+ .prog-label { display: flex; justify-content: space-between; font-size: 12.5px; color: #4b5563; font-variant-numeric: tabular-nums; }
+ .empty { color: #9aa5ad; font-size: 13px; text-align: center; padding: 18px 0; }
+ tfoot td { font-weight: 600; background: #fafbfc; border-bottom: none; }
+ .hint { font-size: 12px; color: #9aa5ad; margin-top: 6px; }
+ .add-intake { color: #0f766e; }
+ .over-text { color: #b91c1c; }
每日热量与七大营养素计算器
-
算法:Mifflin-St Jeor 基础代谢 + MET 法步行能耗 + DRIs 2023 供能比
+
算法:Mifflin-St Jeor 基础代谢 + MET 法步行能耗 + DRIs 2023 供能比 + 食物成分表折算
+
+
+
每日建议摄入热量
+
1800 kcal / 天
+
+
BMI18.7
+
基础代谢 BMR1230
+
步行能耗300
+
总消耗 TDEE1776
+
今日已摄入0
+
+
-
① 输入参数
+
① 身体参数与每日目标
@@ -79,7 +114,7 @@
@@ -87,19 +122,63 @@
-
-
每日建议摄入热量
-
1800 kcal / 天
-
-
BMI18.7
-
基础代谢 BMR1230
-
步行能耗300
-
总消耗 TDEE1776
+
+
② 今日饮食记录 —— 输入你吃了什么,输出热量
+
+
+
参考分量:一碗米饭约 150 g,一个鸡蛋约 50 g,一个苹果约 200 g,一杯牛奶约 250 g,一勺植物油约 10 g。
+
+
+
+
+
+ | 食物 | 分量(g) | 热量 |
+ 蛋白 | 脂肪 | 碳水 | 纤维 | |
+
+
+
+
+
+
+
+
+ 已摄入 0 kcal / 目标 1800 kcal
+ 剩余 1800 kcal
+
+
+
+ 记录自动保存在本机浏览器中,刷新不丢失。
+
+
+
+
+ 食物库没有我要的?点这里自定义添加
+
+
-
② 三大产能营养素分配
+
③ 三大产能营养素:目标 / 已摄入 / 剩余
@@ -112,14 +191,14 @@
- | 营养素 | 每日推荐 | 能量系数 | 提供能量 | 供能比 |
+ | 营养素 | 目标 | 能量系数 | 目标能量 | 已摄入 | 剩余 |
-
③ 七大营养素全景
+
④ 七大营养素全景
| # | 营养素 | 是否产能 | 每日推荐量 | 能量 |
@@ -128,12 +207,12 @@
蛋白质/脂肪/碳水为产能营养素;膳食纤维 25–30 g 建议量,能量按 2 kcal/g 计(通常并入碳水账目);
- 维生素、矿物质、水不产能,其参考摄入量见下表。
+ 维生素、矿物质、水不产能,其参考摄入量见下。
-
④ 微量营养素参考摄入量
+
⑤ 微量营养素参考摄入量
| 维生素 | 每日量 |
@@ -168,12 +247,82 @@
-
以上为成年女性 18–49 岁、轻身体活动水平参考值;男性或孕期/哺乳期需上调。公式仅算存在 ±10%~15% 个体差异,建议以 2–4 周体重变化实测校准。
+
以上为成年女性 18–49 岁、轻身体活动水平参考值;男性或孕期/哺乳期需上调。公式估算存在 ±10%~15% 个体差异,建议以 2–4 周体重变化实测校准。