<view class="container">
  <view class="hero">
    <view class="hero-title">编辑当前饮食状态</view>
    <view class="hero-sub">用于随机森林推荐与历史回溯</view>
  </view>

  <view class="card">
    <view class="card-title">今日状态</view>
    <input class="input" data-field="weight" type="digit" placeholder="当前体重(kg)" value="{{form.weight}}" bindinput="onInput" />
    <input class="input" data-field="body_fat" type="digit" placeholder="体脂率(%)" value="{{form.body_fat}}" bindinput="onInput" />
    <input class="input" data-field="exercise_kcal" type="digit" placeholder="每天运动消耗(kcal)" value="{{form.exercise_kcal}}" bindinput="onInput" />
    <input class="input" data-field="intake_kcal" type="digit" placeholder="每天饮食摄入(kcal)" value="{{form.intake_kcal}}" bindinput="onInput" />
    <input class="input" data-field="sleep_hours" type="digit" placeholder="睡眠时长(小时)" value="{{form.sleep_hours}}" bindinput="onInput" />
    <textarea class="input textarea" data-field="note" placeholder="备注（可选）" value="{{form.note}}" bindinput="onInput" />

    <button class="btn btn-primary" loading="{{loading}}" bindtap="saveNew">新增今日记录</button>
    <button class="btn btn-ghost" loading="{{loading}}" bindtap="updateLatest">修改最新记录</button>
  </view>
</view>
