:root {
  --bg: #eff5f2;
  --card: #ffffff;
  --text: #1c2a24;
  --muted: #7c8b84;
  --line: #e8efeb;
  --primary: #10b981;
  --primary-dark: #059669;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --shadow: 0 6px 24px rgba(23, 63, 47, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #dff3ea 0%, var(--bg) 55%, #eaf1ee 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(84px + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3 { margin: 0; font-weight: 700; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------------- 登录 ---------------- */
.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 24px; padding: 30px 26px 26px; box-shadow: var(--shadow); }
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo { font-size: 42px; }
.brand h1 { font-size: 24px; margin: 6px 0 4px; letter-spacing: 1px; }
.brand-sub { margin: 0; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; background: #f1f6f3; padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 9px; font-size: 14px; color: var(--muted); font-weight: 600; transition: .2s; }
.tab.active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 8px rgba(16,185,129,.15); }
#authForm label { display: block; margin-bottom: 14px; }
#authForm label span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
#authForm input, .field input, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; background: #fbfdfc; outline: none; transition: .2s; color: var(--text);
}
#authForm input:focus, .field input:focus, .field select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(16,185,129,.1); }
.auth-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* ---------------- 按钮 ---------------- */
.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 600; transition: .18s; }
.btn.primary { background: linear-gradient(135deg, #17c08a, #0aa371); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.28); }
.btn.primary:active { transform: scale(.97); }
.btn.ghost { background: #f2f7f4; color: #41544b; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; margin-top: 4px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.ghost-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 11px; font-size: 12.5px; color: #41544b; font-weight: 600; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; font-size: 19px; color: #56685f; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #eff5f1; }
.link-btn { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; text-decoration: underline; }

/* ---------------- 布局 ---------------- */
.app-wrap { max-width: 520px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.datebar { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.off-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: #eef7f2; color: #0b8f66; border: 1px solid #cfeadd;
}
.off-badge.warn { background: #fff4e6; color: #b45309; border-color: #f6d5a8; }
.user-chip { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 2px 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #d5f5e8, #a7e8cd); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(16,185,129,.18); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar span { font-size: 19px; font-weight: 800; color: #0b8f66; letter-spacing: 0; }
.user-name { font-size: 17px; font-weight: 700; color: var(--text); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.user-name:active { opacity: .7; }
.user-chip:active .avatar { transform: scale(.94); }
.date-nav { display: flex; align-items: center; gap: 2px; }
.date-label { border: 0; background: transparent; font-size: 15px; font-weight: 700; color: var(--text); padding: 6px 4px; }
/* 日期文字上盖一层透明 date 输入框：点一下直接开系统日历 */
.date-wrap { position: relative; display: inline-flex; align-items: center; }
.date-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0;
  font-size: 16px; color: transparent; background: transparent; cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator { width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 4px; }

/* ---------------- 总览 ---------------- */
.hero { display: flex; gap: 16px; padding: 18px; align-items: center; margin-bottom: 12px; }
.hero-ring { flex: 0 0 auto; }
.ring {
  width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(var(--primary) 0deg, var(--primary) var(--p, 0deg), #edf3f0 var(--p, 0deg));
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ring::after { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring-inner { position: relative; z-index: 1; text-align: center; }
.ring-inner strong { display: block; font-size: 25px; line-height: 1.1; letter-spacing: -.5px; }
.ring-inner small { color: var(--muted); font-size: 11px; }
.hero-info { flex: 1; min-width: 0; }
.hero-row { display: flex; align-items: center; font-size: 12.5px; color: #56685f; margin-bottom: 6px; }
.hero-row strong { margin-left: auto; font-size: 14.5px; color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; display: inline-block; }
.dot.green { background: var(--primary); }
.dot.orange { background: var(--orange); }
.dot.blue { background: var(--blue); }
.dot.teal { background: #0ea5e9; }
.dot.purple { background: #8b5cf6; }
.hero-tip { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------------- 上班情况 ---------------- */
.shift-block { padding-bottom: 14px; }
.shift-main { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shift-tag { display: inline-flex; align-items: center; justify-content: center; padding: 7px 16px; border-radius: 11px; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.shift-tag.day { background: #e7f8f0; color: #0b8f66; }
.shift-tag.night { background: #ecebfd; color: #5a4bd4; }
.shift-tag.rest { background: #eef2f5; color: #6b7c88; }
.shift-hint { font-size: 12px; color: var(--muted); }
.shift-plan { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shift-cell { border: 0; font-family: inherit; border-radius: 12px; padding: 9px 6px; text-align: center; background: #f7faf9; }
.shift-cell.on { background: #f0fbf6; box-shadow: inset 0 0 0 1.5px #b8ecda; }
.shift-cell:active { transform: scale(.97); }
.shift-cell .d { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.shift-cell .s { display: block; font-size: 13px; font-weight: 700; }
.shift-cell .s.day { color: #0b8f66; }
.shift-cell .s.night { color: #5a4bd4; }
.shift-cell .s.rest { color: #7b8b96; }
.shift-cell .s.none { color: #a7b6ae; font-weight: 600; }
.shift-opt { display: flex; gap: 8px; margin-bottom: 10px; }
.shift-opt button { flex: 1; border: 0; border-radius: 12px; padding: 14px 0; font-size: 15px; font-weight: 700; font-family: inherit; background: #f2f7f4; color: var(--text); }
.shift-opt button.day { background: #e7f8f0; color: #0b8f66; }
.shift-opt button.night { background: #ecebfd; color: #5a4bd4; }
.shift-opt button.rest { background: #eef2f5; color: #6b7c88; }
.shift-clear { width: 100%; border: 1px dashed #d8e5de; background: #fff; border-radius: 12px; padding: 10px 0; font-size: 13px; color: var(--muted); font-family: inherit; }
.shift-work { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.sw-info { flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px; font-size: 12px; color: var(--muted); }
.sw-info b { font-size: 18px; color: var(--orange); letter-spacing: -.4px; }
.sw-info small { font-size: 10.5px; color: var(--muted); margin-left: 3px; }
.sw-info em { font-style: normal; font-size: 11px; color: #9fb0a9; margin-left: 6px; }

/* ---------------- 三卡片 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { padding: 13px 12px 11px; }
.stat-icon { font-size: 16px; }
.stat-main { display: flex; align-items: baseline; gap: 2px; margin: 5px 0 8px; flex-wrap: wrap; }
.stat-main b { font-size: 19px; letter-spacing: -.4px; }
.stat-main small { font-size: 10.5px; color: var(--muted); }
.stat-main i { font-style: normal; }
.bar { height: 6px; background: #edf3f0; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 6px; transition: width .35s ease; }
.bar.blue i { background: var(--blue); }
.bar.orange i { background: var(--orange); }
.stat-cap { display: block; margin-top: 7px; font-size: 11px; color: var(--muted); }

/* ---------------- 区块 ---------------- */
.block { padding: 16px 16px 14px; margin-bottom: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.block-head h2 { font-size: 15.5px; }
.legend { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--primary); display: inline-block; }
.legend i.o { background: var(--orange); margin-left: 4px; }
.legend i.b { background: var(--blue); margin-left: 4px; }

.meal-list { display: flex; flex-direction: column; gap: 12px; }
.meal-group .meal-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.meal-title b { color: var(--text); font-size: 13px; }
.meal-title span { margin-left: auto; font-weight: 600; color: #56685f; }
.meal-items { display: flex; flex-direction: column; gap: 6px; }
.row-item { display: flex; align-items: center; gap: 8px; background: #f8fbf9; border-radius: 11px; padding: 9px 11px; font-size: 13px; }
.row-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .ms { color: var(--muted); font-size: 11.5px; }
.row-item .kc { font-weight: 700; font-size: 13px; min-width: 52px; text-align: right; }
.row-item .kc small { font-weight: 500; color: var(--muted); font-size: 10px; margin-left: 2px; }
.del { border: 0; background: transparent; color: #c0cbc6; font-size: 15px; width: 22px; line-height: 1; }
.del:hover { color: #ef4444; }
.empty { text-align: center; color: #a6b3ad; font-size: 12.5px; padding: 12px 0 6px; margin: 0; }

.water-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.water-quick button { border: 1.5px dashed #cfe6dc; background: #f7fcfa; color: #0f9a70; border-radius: 11px; padding: 10px 0; font-size: 13px; font-weight: 700; }
.water-quick button:active { background: #e6f7f0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef7fd; color: #2668a3; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.chip button { border: 0; background: transparent; color: #9db6c8; font-size: 13px; padding: 0 1px; }

.ex-list { display: flex; flex-direction: column; gap: 7px; }

/* ---------------- 图表 ---------------- */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; }
.chart-bars i { flex: 1; border-radius: 5px 5px 3px 3px; transition: height .4s; }
.chart-bars i.in { background: linear-gradient(180deg, #34d399, #10b981); }
.chart-bars i.out { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.chart-bars i.work { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.chart-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-label.today { color: var(--primary-dark); font-weight: 700; }
.chart-sub { font-size: 9.5px; color: var(--muted); white-space: nowrap; transform: scale(.94); }

/* ---------------- 月度统计 ---------------- */
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav .icon-btn { width: 26px; height: 26px; line-height: 1; font-size: 15px; border-radius: 8px; }
.month-nav span { font-size: 11.5px; color: var(--muted); min-width: 70px; text-align: center; font-weight: 600; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.m-cell { background: #f6faf8; border: 1px solid #e8f2ed; border-radius: 14px; padding: 10px 12px; }
.m-cell small { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.m-cell b { font-size: 20px; letter-spacing: -.6px; color: var(--text); }
.m-cell em { font-size: 10.5px; color: var(--muted); font-style: normal; margin-left: 3px; }
.m-chart-wrap { margin: 4px 0 10px; }
.m-bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; padding-top: 4px; }
.m-bars i { flex: 1; border-radius: 3px 3px 2px 2px; background: var(--primary); min-height: 0; transition: height .4s; }
.m-bars i.over { background: var(--orange); }
.m-bars i.empty { background: #e6efea; height: 3px !important; }
.m-bars i.today { box-shadow: 0 0 0 1.5px rgba(16,185,129,.45); }
.m-axis { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-top: 4px; padding: 0 1px; }
.m-foot { font-size: 11px; color: var(--muted); line-height: 1.75; border-top: 1px dashed #e8f2ed; padding-top: 9px; }
.m-foot b { color: var(--primary-dark); }

/* ---------------- 装到手机桌面 ---------------- */
.install-block { margin-bottom: 14px; }
.install-hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.install-steps { font-size: 12.5px; line-height: 1.9; color: #47564f; }
.install-steps h4 { font-size: 13px; margin: 10px 0 4px; color: var(--text); }
.install-steps ol { padding-left: 18px; }
.install-steps img { width: 100%; max-width: 220px; display: block; margin: 10px auto 4px; border-radius: 12px; border: 1px solid #e8f2ed; }
.install-steps .note { font-size: 11px; color: var(--muted); margin-top: 6px; }
.apk-box { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e8f2ed; }
.apk-text { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.apk-text b { font-size: 13px; color: var(--text); }
.apk-text span { font-size: 11px; color: var(--muted); }
.apk-box img { width: 96px; height: 96px; border-radius: 10px; border: 1px solid #e8f2ed; background: #fff; }
.apk-text .btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------------- 目标设置卡片 ---------------- */
.goal-block { margin-bottom: 14px; }
.goal-row { display: flex; gap: 10px; }
.goal-row > * { flex: 1 1 0; min-width: 0; }
.auto-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e8f8f1; color: #0b8f66; font-size: 10.5px; font-weight: 600; vertical-align: 1px; }
.goal-field { margin-bottom: 10px; }
.goal-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.goal-field input { width: 100%; border: 1px solid #e2ece7; background: #f7faf9; border-radius: 12px; padding: 11px 12px; font-size: 15px; color: var(--text); }
.goal-field input:focus { outline: none; border-color: #b8ecda; background: #fff; }
.goal-block .hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 4px 0 0; }
.goal-block #goalSave { margin-top: 10px; }

/* ---------------- 首次进入的引导弹窗 ---------------- */
.onboard-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.onboard-field { margin-bottom: 12px; }
.onboard-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.onboard-field input { width: 100%; border: 1px solid #e2ece7; background: #f7faf9; border-radius: 12px; padding: 12px 13px; font-size: 16px; color: var(--text); }
.onboard-field input:focus { outline: none; border-color: #b8ecda; background: #fff; }
.set-account { margin-top: 4px; padding-top: 12px; border-top: 1px dashed #e8f2ed; display: flex; flex-direction: column; gap: 8px; }.set-cur { font-size: 12px; color: var(--muted); }
.set-cur b { color: var(--primary-dark); font-size: 13px; }
.set-btn { border: 1px solid #e2ece7; background: #fff; border-radius: 12px; padding: 12px 0; font-size: 13.5px; font-family: inherit; color: var(--text); font-weight: 600; }
.set-btn.warn { color: #0b8f66; border-color: #cdeee0; background: #f6fdfa; }
.set-btn.danger { color: #e11d48; border-color: #fbd5de; background: #fff7f9; }

/* ---------------- 弹窗 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 40, 32, .38); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 18px 18px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 88vh; display: flex; flex-direction: column; animation: up .24s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-body { overflow-y: auto; flex: 1; padding-bottom: 4px; }
.modal-foot { display: flex; gap: 10px; padding-top: 12px; }
.modal-foot .btn { flex: 1; }
.seg { display: flex; gap: 6px; background: #f2f7f4; padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 8px rgba(16,185,129,.14); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.food-search { margin-bottom: 10px; }
.food-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.food-opt { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fbfdfc; border-radius: 11px; padding: 9px 12px; font-size: 13px; text-align: left; }
.food-opt.sel { border-color: var(--primary); background: #effaf5; }
.food-opt .g { font-size: 10px; color: #9fb0a9; background: #f0f5f2; padding: 2px 6px; border-radius: 5px; }
.food-opt .k { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chips button { border: 1.5px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 11px; font-size: 12px; color: #56685f; }
.chips button:active { border-color: var(--primary); }
.calc-line { display: flex; justify-content: space-between; align-items: center; background: #f4faf7; border-radius: 11px; padding: 11px 13px; margin-bottom: 10px; font-size: 12.5px; color: #56685f; }
.calc-line b { font-size: 18px; color: var(--primary-dark); }
.hint { font-size: 11px; color: #a2b0aa; line-height: 1.5; margin: 2px 0 10px; }

/* ---------------- 其他 ---------------- */
.toast { position: fixed; left: 50%; top: 26px; transform: translate(-50%, -16px); background: rgba(27, 47, 39, .92); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; max-width: 88vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 12px; color: var(--muted); }

@media (min-width: 560px) {
  body { padding: 26px 16px 90px; }
  .modal-mask { align-items: center; }
  .modal { border-radius: 20px; max-width: 460px; }
}

/* ---------- 头像菜单 & 头像大图 ---------- */
.avatar-menu { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.avatar-view-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8, 20, 16, .86);
  backdrop-filter: blur(2px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  padding: 24px;
}
.avatar-view-box {
  width: min(72vw, 300px); height: min(72vw, 300px);
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, #d5f5e8, #a7e8cd);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 255, 255, .18);
}
.avatar-view-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-view-box span { font-size: min(30vw, 120px); font-weight: 800; color: #0b8f66; }
.avatar-view-tip { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .72); letter-spacing: .3px; }


/* ---------- 上班 / 上学 模式切换 ---------- */
.mode-seg { margin-bottom: 14px; }
.mode-seg button { flex: 1; }
.study-cfg { margin: 4px 0 12px; padding: 12px 12px 4px; border-radius: 14px; background: #f2fbf7; border: 1px solid #d7efe4; }
.week-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-pick button {
  padding: 8px 0; border-radius: 10px; border: 1px solid #d9e6e0; background: #fff;
  font-size: 12px; font-weight: 700; color: #55706a; cursor: pointer;
}
.week-pick button.active { background: #10b981; border-color: #10b981; color: #fff; box-shadow: 0 4px 10px rgba(16,185,129,.25); }

/* 上班模式的「接下来 7 天班次」 */
.work-cfg { margin: 4px 0 12px; padding: 12px 12px 4px; border-radius: 14px; background: #f4f8ff; border: 1px solid #dbe6f7; }
.shift-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; line-height: 1.2;
}
.shift-pick button span { font-size: 11px; color: #6b7f8c; font-weight: 600; }
.shift-pick button i { font-style: normal; font-size: 12px; font-weight: 800; color: #4a5f6d; }
.shift-pick button.day { background: #eafaf1; border-color: #88d8b4; }
.shift-pick button.day i { color: #0b8f66; }
.shift-pick button.night { background: #f0f0fb; border-color: #a9a9e6; }
.shift-pick button.night i { color: #4a4aa8; }
.shift-pick button.rest { background: #f5f5f5; border-color: #d6d6d6; }
.shift-pick button.rest i { color: #7a7a7a; }
.shift-pick button.none i { color: #9aa8a3; }
.shift-cell.static { cursor: default; }
.shift-cell.static:active { transform: none; }

/* ---------- 双页面 + 底部切换栏 ---------- */
.page { animation: pageIn .18s ease; }
@keyframes pageIn { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 6px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(23, 63, 47, .06);
}
.tabbar-btn {
  flex: 1 1 0; max-width: 186px;
  border: 0; background: #f2f7f4; color: #64776e;
  border-radius: 12px; padding: 5px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 12px; font-weight: 700; transition: .18s; line-height: 1.3;
}
.tabbar-btn .ti { font-size: 15px; line-height: 1.2; }
.tabbar-btn.active {
  background: linear-gradient(135deg, #17c08a, #0aa371);
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, .3);
}
.tabbar-btn.active .ti { transform: scale(1.06); }

/* ---------- 顶栏天气 ---------- */
.weather-chip {
  display: flex; align-items: center; gap: 5px;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 5px 10px;
  font-size: 12.5px; font-weight: 600; color: #41544b;
  max-width: 148px; overflow: hidden;
}
.weather-chip:active { background: #f6faf8; }
.weather-chip .wx-icon { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.weather-chip .wx-temp { font-size: 14px; font-weight: 800; color: var(--primary-dark); flex: 0 0 auto; }
.weather-chip .wx-text { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-chip.stale { opacity: .65; }
@media (max-width: 380px) {
  .weather-chip .wx-text { display: none; }
}

/* ---------- 今日体重变化 ---------- */
.weight-main { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 2px; }
.weight-main b { font-size: 30px; font-weight: 800; color: var(--primary-dark); letter-spacing: -.5px; }
.weight-main em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 700; }
.w-delta {
  margin-left: 6px; font-size: 13px; font-weight: 800;
  padding: 2px 8px; border-radius: 9px; background: #f2f7f4; color: #64776e;
}
.w-delta.down { background: #e8f8f0; color: #0b8f66; }
.w-delta.up { background: #fdeee4; color: #c2691a; }
.weight-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 月度体重变化 ---------- */
.m-weight {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 2px 0 12px; padding: 9px 12px;
  background: #f7fbf9; border: 1px solid #e4f0ea; border-radius: 12px;
  font-size: 12.5px; color: #5c6f66;
}
.m-weight b { font-size: 14px; color: var(--text); font-weight: 800; }
.m-weight .down { color: #0b8f66; }
.m-weight .up { color: #c2691a; }
.m-weight .flat { color: #64776e; }
