/* ===== 轻盈减脂 · 移动端样式(对标薄荷健康) ===== */
:root {
  --green: #22B583;
  --green-d: #1AA275;
  --green-l: #E8F8F1;
  --grad: linear-gradient(135deg, #3FDD9C 0%, #1FB07E 100%);
  --grad-card: linear-gradient(135deg, #36CF96 0%, #16A877 100%);
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --text: #1F2329;
  --text2: #6B7178;
  --text3: #ADB3BA;
  --line: #EEF0F2;
  --orange: #FF8A4C;
  --red: #FF5A5A;
  --blue: #4C9BFF;
  --purple: #A77BFF;
  --yellow: #FFB23E;
  --shadow: 0 2px 12px rgba(31,35,41,.06);
  --shadow-lg: 0 8px 28px rgba(31,35,41,.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select { font-family: inherit; outline: none; }
.muted { color: var(--text2); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.grow { flex: 1; }

/* ===== 登录/注册 ===== */
.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; padding: 0 32px;
  background: var(--grad); color: #fff;
}
.auth-logo {
  width: 76px; height: 76px; border-radius: 24px; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
  backdrop-filter: blur(8px);
}
.auth-title { font-size: 30px; font-weight: 700; text-align: center; letter-spacing: 2px; }
.auth-sub { text-align: center; opacity: .9; margin: 8px 0 34px; font-size: 14px; }
.auth-card { background: #fff; border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow-lg); }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.seg button {
  flex: 1; padding: 9px 0; border-radius: 9px; background: transparent;
  color: var(--text2); font-size: 15px; font-weight: 600; transition: .2s;
}
.seg button.on { background: #fff; color: var(--green); box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; color: var(--text); background: #fff; transition: .2s;
}
.field input:focus, .field select:focus { border-color: var(--green); }
.btn-main {
  width: 100%; padding: 14px; border-radius: 14px; background: var(--grad);
  color: #fff; font-size: 16px; font-weight: 600; margin-top: 8px;
  box-shadow: 0 6px 16px rgba(34,181,131,.32);
}
.btn-main:active { transform: scale(.98); }
.btn-main:disabled { opacity: .6; }

/* ===== 主框架 ===== */
.page { padding: 0 16px 96px; }
.page-pad-top { padding-top: 14px; }
.appbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  padding: 14px 16px 8px; display: flex; align-items: center; justify-content: space-between;
}
.appbar h1 { font-size: 20px; font-weight: 700; margin: 0; }
.appbar .date { font-size: 13px; color: var(--text2); }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; background: var(--green-l); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* 卡片 */
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title .link { font-size: 13px; color: var(--green); font-weight: 500; }

/* ===== 首页 hero ===== */
.hero { background: var(--grad-card); border-radius: 20px; padding: 22px 18px; color: #fff; margin-bottom: 14px; box-shadow: 0 10px 24px rgba(31,180,131,.28); }
.hero-top { display: flex; align-items: center; justify-content: space-around; }
.hero-side { text-align: center; min-width: 72px; }
.hero-side .n { font-size: 20px; font-weight: 700; }
.hero-side .l { font-size: 12px; opacity: .9; margin-top: 2px; }
.ring-wrap { position: relative; width: 150px; height: 150px; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .big { font-size: 30px; font-weight: 800; line-height: 1.1; }
.ring-center .lbl { font-size: 12px; opacity: .92; margin-top: 2px; }
.hero-foot { text-align: center; margin-top: 14px; font-size: 12.5px; opacity: .92; }
.hero-foot b { font-weight: 700; }

/* 三大营养素 */
.macros { display: flex; gap: 12px; }
.macro { flex: 1; }
.macro .mtop { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.macro .mname { font-size: 13px; color: var(--text2); }
.macro .mval { font-size: 13px; color: var(--text); font-weight: 600; }
.bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; transition: width .4s; }
.bar.carbs > i { background: var(--blue); }
.bar.protein > i { background: var(--purple); }
.bar.fat > i { background: var(--yellow); }

/* 小统计卡 */
.stat-row { display: flex; gap: 12px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.stat .sn { font-size: 19px; font-weight: 700; }
.stat .sl { font-size: 12px; color: var(--text2); margin-top: 2px; }
.stat .su { font-size: 12px; color: var(--text3); font-weight: 400; }

/* 图表容器 */
.chart { width: 100%; height: 180px; }
.chart.sm { height: 140px; }

/* ===== 餐 / 列表 ===== */
.meal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.meal-head .mh-l { display: flex; align-items: center; gap: 8px; }
.meal-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--green-l); color: var(--green); display: flex; align-items: center; justify-content: center; }
.meal-name { font-weight: 700; font-size: 15px; }
.meal-kcal { font-size: 13px; color: var(--text2); }
.add-btn { color: var(--green); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 3px; background: none; }

.list-item { display: flex; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: none; }
.li-main { flex: 1; min-width: 0; }
.li-name { font-size: 14.5px; font-weight: 500; }
.li-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.li-kcal { font-size: 14px; color: var(--text2); font-weight: 600; margin-left: 8px; }
.li-del { width: 28px; height: 28px; border-radius: 8px; background: #FFF0F0; color: var(--red); margin-left: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.empty-line { color: var(--text3); font-size: 13px; padding: 8px 0; }

/* 日期选择 */
.dateline { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 6px 0 14px; }
.dateline button { background: #fff; width: 34px; height: 34px; border-radius: 10px; color: var(--green); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.dateline .d { font-size: 16px; font-weight: 700; min-width: 130px; text-align: center; }

/* 进度(目标) */
.goalbar { position: relative; height: 8px; border-radius: 5px; background: var(--line); margin: 18px 0 8px; }
.goalbar > i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px; background: var(--grad); }
.goalbar .dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--green); transform: translate(-50%,-50%); box-shadow: var(--shadow); }
.goal-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); }

/* 运动类型网格 */
.ex-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.ex-cell { background: var(--bg); border-radius: 14px; padding: 12px 4px; text-align: center; transition: .15s; }
.ex-cell.on { background: var(--green-l); box-shadow: inset 0 0 0 2px var(--green); }
.ex-cell .ec-ic { font-size: 22px; }
.ex-cell .ec-n { font-size: 12px; margin-top: 4px; color: var(--text); }

/* 饮水杯 */
.cups { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cup { width: 42px; height: 52px; border-radius: 0 0 12px 12px; border: 2px solid var(--blue); position: relative; overflow: hidden; background: #fff; }
.cup.full { background: var(--blue); }
.cup::after { content: ''; position: absolute; top: -2px; left: -2px; right: -2px; height: 6px; border: 2px solid var(--blue); border-radius: 4px; }

/* ===== 底部 Tab ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; display: flex; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 30;
}
.tabbar .tab { flex: 1; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; color: var(--text3); }
.tabbar .tab.on { color: var(--green); }
.tabbar .tab .tl { font-size: 11px; margin-top: 2px; }

/* ===== 底部弹层(sheet) / modal ===== */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.mask.center { align-items: center; }
.sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .25s ease; }
.dialog { width: 86%; max-width: 360px; background: #fff; border-radius: 18px; padding: 22px; animation: pop .2s ease; }
@keyframes up { from { transform: translateY(100%);} to { transform: translateY(0);} }
@keyframes pop { from { transform: scale(.9); opacity: 0;} to { transform: scale(1); opacity: 1;} }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.x-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: var(--text2); display: flex; align-items: center; justify-content: center; font-size: 18px; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.search-box input { flex: 1; border: none; background: none; font-size: 15px; }
.food-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.food-item .fi-n { font-weight: 500; }
.food-item .fi-s { font-size: 12px; color: var(--text3); }
.food-item .fi-k { color: var(--orange); font-weight: 600; font-size: 14px; }

.stepper { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 6px 0 16px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; background: var(--green-l); color: var(--green); font-size: 22px; font-weight: 700; }
.stepper .sv { font-size: 26px; font-weight: 800; min-width: 90px; text-align: center; }
.stepper .su { font-size: 14px; color: var(--text2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 20px; background: var(--bg); color: var(--text2); font-size: 14px; }
.chip.on { background: var(--green); color: #fff; }

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .k { color: var(--text2); }
.kv .v { font-weight: 600; }

/* AI 卡片 */
.ai-card { background: linear-gradient(135deg,#7B6CFF,#A77BFF); color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: 0 8px 20px rgba(140,110,255,.3); }
.ai-card .ac-t { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.ai-card .ac-s { font-size: 13px; opacity: .92; margin-top: 4px; }
.ai-out { background: var(--bg); border-radius: 12px; padding: 14px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; color: var(--text); max-height: 50vh; overflow-y: auto; }

/* toast / loading */
.toast { position: fixed; top: 40%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.8); color: #fff; padding: 12px 22px; border-radius: 12px; z-index: 90; font-size: 14px; max-width: 70%; text-align: center; }
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: rot .7s linear infinite; vertical-align: middle; }
.spin.dark { border-color: var(--line); border-top-color: var(--green); }
@keyframes rot { to { transform: rotate(360deg);} }
.loading-full { padding: 40px; text-align: center; color: var(--text2); }

/* ===== BMI 健康评估 ===== */
.warn-banner { border-radius: 14px; padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; box-shadow: var(--shadow); }
.hc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hc-l { display: flex; align-items: baseline; gap: 8px; }
.hc-bmi { font-size: 36px; font-weight: 800; line-height: 1; }
.hc-u { font-size: 13px; color: var(--text2); }
.hc-badge { padding: 6px 16px; border-radius: 20px; font-size: 15px; font-weight: 700; }
.bmi-scale { position: relative; height: 8px; border-radius: 5px; margin: 8px 0 6px;
  background: linear-gradient(90deg, var(--blue) 0 22%, var(--green) 22% 50%, var(--yellow) 50% 70%, var(--red) 70% 100%); }
.bmi-marker { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--green); transform: translate(-50%,-50%); box-shadow: var(--shadow); transition: left .3s; }
.bmi-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.hc-advice { border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }

/* ===== 减重进度 ===== */
.prog-row { display: flex; gap: 10px; margin-top: 16px; }
.pg { flex: 1; background: var(--bg); border-radius: 14px; padding: 12px 4px; text-align: center; }
.pg-n { font-size: 19px; font-weight: 800; }
.pg-l { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* ===== 食物红绿灯 ===== */
.food-dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
