<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据采集 - 个性化饮食推荐助手</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/data_collection.css') }}">
</head>
<body>
    <div class="container">
        <header class="header">
            <h1>📝 数据采集</h1>
            <p class="subtitle">建立你的个人饮食档案</p>
        </header>
        <nav class="nav">
            <a href="/" class="nav-item">首页</a>
            <a href="/data-collection" class="nav-item active">数据采集</a>
            <a href="/recommendation" class="nav-item">智能推荐</a>
            <a href="/analysis" class="nav-item">营养分析</a>
            <a href="/recitation" class="nav-item">背诵排序</a>
        </nav>
        <main class="main">
            <div class="data-collection-container">
                <div id="loginSection" class="section">
                    <h2>用户登录</h2>
                    <div class="form-group">
                        <label for="userId">用户ID：</label>
                        <input type="text" id="userId" class="form-input" placeholder="请输入用户ID">
                    </div>
                    <div class="form-group">
                        <label for="userName">姓名：</label>
                        <input type="text" id="userName" class="form-input" placeholder="请输入姓名">
                    </div>
                    <button id="loginBtn" class="btn btn-primary">登录/注册</button>
                </div>
                <div id="basicQuestionnaire" class="section" style="display: none;">
                    <h2>基础信息问卷</h2>
                    <div class="form-group">
                        <label>年龄：</label>
                        <input type="number" id="age" class="form-input" placeholder="请输入年龄">
                    </div>
                    <div class="form-group">
                        <label>性别：</label>
                        <select id="gender" class="form-input">
                            <option value="">请选择</option>
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label>身高（cm）：</label>
                        <input type="number" id="height" class="form-input" placeholder="请输入身高">
                    </div>
                    <div class="form-group">
                        <label>体重（kg）：</label>
                        <input type="number" id="weight" class="form-input" placeholder="请输入体重">
                    </div>
                    <div class="form-group">
                        <label>活动水平：</label>
                        <select id="activityLevel" class="form-input">
                            <option value="">请选择</option>
                            <option value="久坐">久坐</option>
                            <option value="轻度活动">轻度活动</option>
                            <option value="中度活动">中度活动</option>
                            <option value="高度活动">高度活动</option>
                        </select>
                    </div>
                    <button id="submitBasicBtn" class="btn btn-primary">提交基础信息</button>
                </div>
                <div id="mealRecord" class="section" style="display: none;">
                    <h2>记录餐食</h2>
                    <div class="form-group">
                        <label>日期：</label>
                        <input type="date" id="mealDate" class="form-input">
                    </div>
                    <div class="form-group">
                        <label>餐次：</label>
                        <select id="mealType" class="form-input">
                            <option value="breakfast">早餐</option>
                            <option value="lunch">午餐</option>
                            <option value="dinner">晚餐</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label>食物列表（每行一个）：</label>
                        <textarea id="foods" class="form-textarea" rows="5" placeholder="例如：&#10;燕麦粥 1碗&#10;香蕉 1根&#10;牛奶 200ml"></textarea>
                    </div>
                    <div class="form-group">
                        <label>热量（大卡）：</label>
                        <input type="number" id="calories" class="form-input" placeholder="请输入热量">
                    </div>
                    <div class="form-group">
                        <label>满意度（1-5分）：</label>
                        <input type="number" id="satisfaction" class="form-input" min="1" max="5" value="3">
                    </div>
                    <button id="submitMealBtn" class="btn btn-primary">记录餐食</button>
                </div>
                <div id="messageArea" class="message-area"></div>
            </div>
        </main>
        <footer class="footer">
            <p>&copy; 2024 个性化饮食推荐助手</p>
        </footer>
    </div>
    <script src="{{ url_for('static', filename='js/data_collection.js') }}"></script>
</body>
</html>