/* ============================================================
   营养膳食食谱 · 视觉系统 v2
   设计语言：自然绿 + 奶油白，轻阴影、细描边、克制的层次
   ============================================================ */
:root {
  /* 品牌绿（由原橄榄绿微调为更深的森林绿，更专业、更有质感） */
  --g900: #16301F;
  --g800: #1E4029;
  --g700: #2B5B3A;
  --g600: #3C7A4E;
  --g500: #5C9A6B;
  --g400: #7FB98A;
  --g300: #A9C9AA;
  --g200: #D6E7D2;
  --g100: #E9F3E5;
  --g50: #F4FAF1;

  /* 中性色 */
  --line: #E2EADE;
  --line-soft: #EEF3EB;
  --ink: #182719;
  --ink-2: #3B4A3F;
  --muted: #7B897F;
  --faint: #A4B0A6;
  --bg: #F2F5F0;
  --card: #ffffff;

  /* 语义色 */
  --red: #B8442F;
  --red-bg: #FBEDE9;
  --amber: #94661A;
  --amber-bg: #FBF2DE;
  --sky: #2F6C80;
  --sky-bg: #E8F1F4;

  --radius: 18px;
  --r-sm: 12px;
  --shadow-s: 0 1px 2px rgba(18, 38, 24, .04), 0 6px 18px -10px rgba(18, 38, 24, .16);
  --shadow-m: 0 1px 2px rgba(18, 38, 24, .05), 0 14px 34px -18px rgba(18, 38, 24, .26);
  --shadow-l: 0 2px 5px rgba(18, 38, 24, .05), 0 24px 56px -26px rgba(18, 38, 24, .3);
  --shadow: var(--shadow-s);

  /* 运动曲线：出场用指数衰减，交互用短促的 ease-out */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(120% 46% at 50% -6%, #E6F0E0 0%, rgba(230, 240, 224, 0) 70%),
    var(--bg);
}

.page { padding: 4px 14px 100px; }

/* ---------- boot / empty ---------- */
.boot {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13.5px; letter-spacing: .02em;
}
.empty {
  text-align: center; padding: 46px 22px; color: var(--muted); font-size: 13.5px; line-height: 1.9;
}
.empty .big {
  width: 62px; height: 62px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; color: var(--g500);
  border-radius: 50%;
  background: radial-gradient(120% 120% at 32% 18%, #F7FBF3, #E7F1E0);
  box-shadow: inset 0 0 0 1px rgba(24, 39, 25, .045), 0 10px 20px -14px rgba(24, 39, 25, .55);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, rgba(242, 245, 240, .96), rgba(242, 245, 240, .82));
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 {
  font-size: 18px; margin: 0; font-weight: 800; flex: 1; min-width: 0;
  letter-spacing: -.01em; line-height: 1.25;
}
.topbar h1 .sub {
  display: block; font-size: 11.5px; color: var(--muted); font-weight: 500;
  margin-top: 3px; letter-spacing: .02em;
}
.icon-btn {
  border: none; background: none; padding: 6px 2px; font-size: 14px; color: var(--ink-2);
  cursor: pointer; display: inline-flex; align-items: center; gap: 3px; font-family: inherit;
}
.icon-btn:active { opacity: .6; }
.icon-btn.link { color: var(--g700); font-weight: 700; font-size: 13.5px; letter-spacing: .01em; }
.icon-btn.back {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px 10px 5px 8px; color: var(--ink-2); box-shadow: var(--shadow-s); font-size: 13px;
}
.icon-btn .ico { width: 15px; height: 15px; display: block; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(24, 39, 25, .055);
  box-shadow: var(--shadow-s);
  padding: 16px;
  margin-bottom: 12px;
}
.card.tight { padding: 13px 14px; }
.card-title {
  font-size: 13px; font-weight: 800; color: var(--g800);
  letter-spacing: .02em; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--g400), var(--g600));
}
.card-title .muted {
  margin-left: auto; font-weight: 500; color: var(--faint); letter-spacing: 0; font-size: 11.5px;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--r-sm); padding: 11px 16px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
  box-shadow: 0 1px 2px rgba(18, 38, 24, .04);
}
.btn svg.ico { width: 15px; height: 15px; flex: none; }
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(180deg, #418052 0%, #2B5B3A 62%, #275236 100%);
  border-color: #27523A; color: #fff;
  box-shadow:
    0 2px 4px rgba(30, 64, 41, .18),
    0 12px 24px -12px rgba(30, 64, 41, .58),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:active:not(:disabled) {
  background: linear-gradient(180deg, #3B7449 0%, #27523A 100%);
  box-shadow: 0 1px 2px rgba(30, 64, 41, .2), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.btn-primary:disabled { opacity: .55; box-shadow: none; }
.btn-ghost { background: #FBFDF9; border-color: #DCE9D5; color: var(--g700); }
.btn-danger { background: #fff; border-color: #F0D6D0; color: var(--red); }
.btn-danger:active { background: #FDF6F4; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 9px; }
.btn-row .btn { flex: 1; }

/* 文本型操作（用于弱化的次要动作） */
.btn-text {
  background: none; border: none; box-shadow: none; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 9px; width: 100%;
}
.btn-text.danger { color: var(--red); }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block; font-size: 12px; color: #62705F; margin-bottom: 6px; font-weight: 700;
  letter-spacing: .03em;
}
input, select, textarea {
  width: 100%; min-width: 0; font-family: inherit; font-size: 16px; color: var(--ink);
  background: #F7FAF3; border: 1px solid #E1EADC; border-radius: 12px;
  padding: 11px 13px; outline: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--g400); background: #fff;
  box-shadow: 0 0 0 3px rgba(92, 154, 107, .14);
}
textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #7E8A80; font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 客户码输入框（大字母 + 字距） */
.code-input {
  text-align: center; letter-spacing: .22em; text-indent: .22em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: 20px; text-transform: uppercase;
  background: #F8FBF5; border-color: #DCE9D5; color: var(--g800);
  padding: 13px 10px; border-radius: 13px;
}
.code-input::placeholder {
  letter-spacing: .05em; text-indent: 0; font-size: 13.5px; font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 登录角色切换（工作人员 / 客户） */
.role-switch {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: #EEF4E7; border: 1px solid #E0EAD7; border-radius: 14px;
}
.role-tab {
  flex: 1; appearance: none; border: none; background: none; cursor: pointer;
  padding: 10px 8px; border-radius: 11px; font-family: inherit;
  font-size: 14px; font-weight: 700; color: #6B7A6F; letter-spacing: .02em;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.role-tab.on {
  background: linear-gradient(180deg, #3B7449, #2B5B3A); color: #fff;
  box-shadow: 0 6px 16px -8px rgba(30, 64, 41, .75);
}
.icon-btn .ico { width: 16px; height: 16px; }

/* 搜索框（带图标） */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap input {
  padding-left: 34px; background: #fff; border-radius: 13px;
  box-shadow: var(--shadow-s); border-color: rgba(24, 39, 25, .05);
  font-size: 15.5px;
}
.search-wrap .s-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--faint); pointer-events: none;
}

/* ---------- login（bold hero 版） ---------- */
.login-wrap {
  position: relative; overflow: hidden; color: #fff;
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 42px 22px 48px;
  background:
    radial-gradient(120% 70% at 82% -12%, rgba(126, 199, 143, .22) 0%, rgba(126, 199, 143, 0) 56%),
    radial-gradient(95% 60% at -10% 112%, rgba(40, 96, 56, .6) 0%, rgba(40, 96, 56, 0) 60%),
    linear-gradient(158deg, #20502F 0%, #163A26 50%, #0E2417 100%);
}
/* 左上/右上极淡的有机光，避免纯色块；矮屏改自上而下排布防裁切 */
.login-wrap::before {
  content: ''; position: absolute; pointer-events: none;
  width: 520px; height: 520px; right: -170px; top: -190px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(150, 210, 162, .28), rgba(150, 210, 162, 0) 66%);
}
.login-wrap > * { position: relative; }
/* 桌面端把登录内容收成居中窄列，避免卡片被撑到上千像素宽 */
.login-wrap > .brand,
.login-wrap > .card,
.login-wrap > .alert,
.login-wrap > .login-links {
  width: 100%; max-width: 400px; margin-left: auto; margin-right: auto;
}
/* 登录/绑定页整屏深色底，避免 overscroll 露白；关掉横向滚动（仅此页，不影响主应用 sticky 顶栏） */
body.is-login { background: #0E2417; overflow-x: hidden; }
@media (min-width: 820px) {
  /* 宽屏下 hero 铺满整屏，登录卡片仍是居中的窄列 */
  body.is-login .login-wrap {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}
@media (max-height: 700px) {
  .login-wrap { justify-content: flex-start; padding-top: 28px; }
}

.brand { text-align: center; margin-bottom: 30px; animation: brandIn .6s var(--ease-out) both; }
.brand .logo {
  width: 76px; height: 76px; border-radius: 26px; margin: 0 auto 16px;
  background: linear-gradient(152deg, #57A06A 0%, #2E6240 54%, #20442E 100%);
  color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 18px 38px -14px rgba(0, 0, 0, .5),
    0 0 0 7px rgba(255, 255, 255, .08),
    inset 0 1px 0 rgba(255, 255, 255, .32);
  position: relative;
}
.brand .logo::after {
  content: ''; position: absolute; inset: 5px; border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 8px 14px -10px rgba(255, 255, 255, .5);
}
/* 默认（浅底，如「还差一步」页）深色字；仅深色登录 hero 内反白 */
.brand h2 { font-size: 27px; margin: 0 0 9px; letter-spacing: -.01em; font-weight: 800; color: var(--ink); }
.brand p { margin: 0; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; font-weight: 500; }
.login-wrap .brand h2 { color: #fff; }
.login-wrap .brand p { color: rgba(255, 255, 255, .66); }

.login-wrap .card {
  border-radius: 24px; padding: 22px 20px;
  border: none;
  box-shadow: 0 26px 64px -24px rgba(0, 0, 0, .62);
  animation: cardIn .62s var(--ease-out) .08s both;
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wechat-btn {
  width: 100%; padding: 14px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #12cf6a, #07b455); color: #fff;
  font-size: 15.5px; font-weight: 700; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 22px -10px rgba(7, 193, 96, .8);
}
.wechat-btn:disabled { opacity: .6; }
.login-tip { text-align: center; font-size: 12px; color: var(--faint); margin-top: 16px; line-height: 1.8; }
.login-links { display: flex; gap: 8px; justify-content: center; margin-top: 22px; animation: fadeIn .5s var(--ease-out) .2s both; }
.login-links .btn {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .26);
  color: rgba(255, 255, 255, .92); font-weight: 600; box-shadow: none;
  padding: 9px 15px; font-size: 12.5px; border-radius: 999px; letter-spacing: .02em;
}
.login-links .btn:active { background: rgba(255, 255, 255, .2); transform: scale(.98); }
.alert {
  background: var(--red-bg); color: #9C3626; border-radius: 12px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px; line-height: 1.6; border: 1px solid #F3DCD5;
}

/* ---------- 我的：身份卡 ---------- */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 18px 16px 14px;
  background: linear-gradient(150deg, #3A7451 0%, #27523A 52%, #1B3927 100%);
  color: #fff; margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(27, 57, 39, .16), 0 20px 40px -22px rgba(27, 57, 39, .7);
}
.hero-card::before {
  content: ''; position: absolute; width: 240px; height: 240px; right: -100px; top: -150px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 68%);
}
.hero-card::after {
  content: ''; position: absolute; width: 162px; height: 162px; right: -92px; bottom: -104px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08);
}
.hc-top { display: flex; align-items: center; gap: 13px; position: relative; }
.hc-avatar {
  width: 50px; height: 50px; border-radius: 16px; flex: none;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .02em;
  backdrop-filter: blur(4px);
}
.hc-info { min-width: 0; flex: 1; }
.hc-name { font-size: 18px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 7px; }
.hc-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .26);
  letter-spacing: .04em; color: #F2F8EE;
}
.hc-sub { font-size: 12px; color: rgba(255, 255, 255, .72); margin-top: 4px; letter-spacing: .02em; }
.hc-stats {
  display: flex; margin-top: 15px; padding-top: 13px; gap: 0;
  border-top: 1px solid rgba(255, 255, 255, .14); position: relative;
}
.hc-stat { flex: 1; text-align: center; }
.hc-stat + .hc-stat { border-left: 1px solid rgba(255, 255, 255, .14); }
.hc-stat b {
  display: block; font-size: 17px; font-weight: 800; letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.hc-stat b.txt { font-size: 14px; letter-spacing: .04em; }
.hc-stat span { font-size: 11px; color: rgba(255, 255, 255, .66); letter-spacing: .04em; }

/* ---------- 设置列表 ---------- */
.rows {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(24, 39, 25, .055); box-shadow: var(--shadow-s); margin-bottom: 12px;
}
.row-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; background: none; border: none; text-align: left;
  font-family: inherit; cursor: pointer; color: var(--ink);
}
.row-item + .row-item::before {
  content: ''; position: absolute; left: 60px; right: 0; top: 0; height: 1px; background: var(--line-soft);
}
.row-item:active { background: #FAFCF8; }
.row-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--g100); color: var(--g700);
}
.row-ico svg { width: 17px; height: 17px; }
.row-main { flex: 1; min-width: 0; }
.row-t { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: .01em; }
.row-d { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; letter-spacing: .01em; }
.row-arrow { color: #C8D2C8; flex: none; display: flex; }
.row-arrow svg { width: 16px; height: 16px; }
.row-item.danger .row-t { color: var(--red); }
.row-item.danger .row-ico { background: var(--red-bg); color: var(--red); }

/* 页脚说明 */
.foot-note {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 11.5px; color: var(--faint); line-height: 1.7; padding: 4px 4px 0;
}
.foot-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }

/* ============================================================
   使用说明 / 指标口径（help.js）
   ============================================================ */
/* 标题旁的小问号 */
.help-q {
  appearance: none; -webkit-appearance: none; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; padding: 0;
  font-size: 11px; font-weight: 800; line-height: 1;
  color: var(--muted); background: var(--g50);
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; vertical-align: 1px;
  transition: color .15s, background .15s, border-color .15s;
}
.help-q:hover { color: var(--g700); background: var(--g100); border-color: var(--g200); }
.sec-hd h2 .help-q { margin-left: 0; }

/* 页面内的一条说明栏 */
.hl-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--g50); border: 1px solid var(--g100);
  border-radius: 13px; padding: 8px 9px 8px 11px; margin: 0 0 11px;
}
.hl-bar > svg { width: 14px; height: 14px; flex: none; color: var(--g500); }
.hl-bar-t { flex: 1; min-width: 0; font-size: 12.3px; color: var(--ink-2); line-height: 1.45; }
.hl-bar .btn { flex: none; padding: 6px 11px; font-size: 12.5px; }

/* 弹层里的滚动容器 */
.hl-sheet-body { max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }

/* 单个词条 */
.hl-e {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 14px; margin-bottom: 8px; overflow: hidden;
}
.hl-e-t {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; cursor: pointer;
  font-size: 13.4px; font-weight: 800; color: var(--g800); letter-spacing: .01em;
}
.hl-e-b { display: none; padding: 0 13px 12px; }
.hl-e.open .hl-e-b { display: block; }
.hl-e-d { font-size: 12.7px; color: var(--ink-2); line-height: 1.85; }
.hl-e-d b { color: var(--g700); font-weight: 700; }
.hl-e-d br + b { color: var(--g700); }
.hl-caret { flex: none; font-size: 16px; color: var(--faint); transition: transform .18s ease; }
.hl-e.open .hl-caret { transform: rotate(90deg); }
.hl-e-tip {
  display: flex; gap: 7px; align-items: flex-start; margin-top: 9px;
  padding: 8px 10px; background: var(--g50); border-radius: 10px;
  font-size: 12.1px; color: var(--ink-2); line-height: 1.7;
}
.hl-e-tip svg { width: 13px; height: 13px; flex: none; margin-top: 3px; color: var(--g500); }
/* sheet 内第一个词条不要上边距，紧跟标题 */
.sheet .hl-e:first-child { margin-top: 4px; }

/* 帮助中心的分组卡片 */
.hl-gs { display: grid; gap: 9px; }
.hl-g {
  display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(18, 38, 24, .03);
}
.hl-g:active { background: var(--g50); }
.hl-g-t { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; color: var(--g800); }
.hl-g-t i {
  font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--g100); border-radius: 20px; padding: 1px 7px;
}
.hl-g-d { font-size: 12.1px; color: var(--muted); line-height: 1.6; }

/* 颜色图例的小方块 */
.hl-sw {
  display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  margin-right: 5px; vertical-align: 0;
}
.hl-sw.good { background: var(--g500); }
.hl-sw.warn { background: #C98A2E; }
.hl-sw.bad { background: var(--red); }

/* 服务协议确认：勾选行 + 跳转看隐私政策的文字按钮 */
.ag-link {
  background: none; border: 0; padding: 0; margin: 2px 0 0;
  font-size: 13px; color: var(--g600); cursor: pointer; text-decoration: underline;
}
.ag-link:active { opacity: .6; }
.consent-ck {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 12px;
  padding: 11px 12px; border: 1px solid var(--g200); border-radius: 12px;
  background: #F6FAF3; font-size: 14px; line-height: 1.5; cursor: pointer;
}
.consent-ck input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--g500); }
.consent-ck span { flex: 1; }

/* ---------- 隐私政策正文（privacy.js） ---------- */
.hl-lead {
  font-size: 12.8px; line-height: 1.8; color: var(--ink-2);
  margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line, rgba(24,39,25,.08));
}
.hl-lead b { color: var(--g700); font-weight: 700; }
.hl-sheet-body h4 {
  margin: 18px 0 7px; font-size: 13.6px; font-weight: 800; color: var(--g800);
}
.hl-sheet-body p { margin: 0 0 9px; font-size: 12.7px; line-height: 1.85; color: var(--ink-2); }
.hl-sheet-body p b { color: var(--g700); font-weight: 700; }
.hl-note {
  margin: 12px 0 16px; padding: 11px 13px; border-radius: 13px;
  background: #FFF6E5; border: 1px solid #F0DDB8;
  font-size: 12.5px; line-height: 1.8; color: #6B5220;
}
.hl-note b { color: #8A5B12; font-weight: 700; }

/* ---------- 食谱卡片 ---------- */
.recipe {
  background: #fff; border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(24, 39, 25, .06);
  box-shadow: 0 2px 4px rgba(18, 38, 24, .04), 0 26px 50px -26px rgba(18, 38, 24, .34);
}
.recipe-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, #37704E 0%, #24503A 56%, #1A3726 100%);
  color: #fff; padding: 20px 18px 17px;
}
.recipe-banner::before {
  content: ''; position: absolute; width: 250px; height: 250px; right: -95px; top: -130px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 66%);
}
.recipe-banner::after {
  content: ''; position: absolute; width: 150px; height: 150px; left: -55px; bottom: -95px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .13);
}
.recipe-kicker {
  text-align: center; font-size: 9px; letter-spacing: .38em; text-indent: .38em;
  color: rgba(255, 255, 255, .55); text-transform: uppercase; margin-bottom: 7px;
  position: relative; font-weight: 600;
}
.recipe-title {
  position: relative; text-align: center; font-size: 20.5px; font-weight: 800;
  letter-spacing: .17em; text-indent: .17em; margin: 0; line-height: 1.35;
}
.recipe-rule {
  position: relative; margin: 10px auto 0; width: 96px; height: 5px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.recipe-rule::before, .recipe-rule::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .30));
}
.recipe-rule::after { background: linear-gradient(90deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, 0)); }
.recipe-rule i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.recipe-meta {
  position: relative; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 13px;
}
.meta-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.meta-chip.wide { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .26); }
.meta-k { color: rgba(255, 255, 255, .68); letter-spacing: .02em; }
.meta-v { font-weight: 800; font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; }
.meta-v i { font-style: normal; font-weight: 500; opacity: .7; margin-left: 1px; font-size: 10.5px; }
.meta-chip.wide .meta-v { font-size: 15px; color: #F4E7BE; }

.recipe-body { padding: 4px 16px 6px; background: #fff; }
.meal-card {
  position: relative; padding: 14px 0 14px 42px;
  border-top: 1px solid var(--line-soft);
}
.meal-card:first-child { border-top: none; }
.meal-card::before {
  content: ''; position: absolute; left: 15.5px; top: 46px; bottom: -3px;
  border-left: 1px dashed #DAE6D4;
}
.meal-card:last-child::before { display: none; }
.meal-ico {
  position: absolute; left: 0; top: 13px;
  width: 32px; height: 32px; border-radius: 11px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #F6FAF2, #EAF3E3);
  box-shadow: inset 0 0 0 1px rgba(60, 122, 78, .10);
}
.meal-card-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meal-card-t { min-width: 0; }
.meal-name { font-weight: 800; font-size: 14.5px; color: var(--ink); letter-spacing: .03em; }
.meal-time {
  font-size: 11.5px; color: var(--muted); margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 4px;
}
.meal-time .mi { width: 11px; height: 11px; flex: none; opacity: .6; }
.meal-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.meal-row { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.62; align-items: flex-start; }
.meal-row .k {
  flex: none; font-weight: 700; color: var(--g700); background: var(--g100);
  border-radius: 7px; padding: 2px 8px; font-size: 11.5px; white-space: nowrap;
  margin-top: 1px; letter-spacing: .03em;
}
.meal-row .k.k-staple { background: var(--amber-bg); color: var(--amber); }
.meal-row .k.k-protein { background: var(--sky-bg); color: var(--sky); }
.meal-row .k.k-veg { background: #EAF3E2; color: #4A7B36; }
.meal-row .k.k-other { background: #F1F2EF; color: #6D7A70; }
.meal-row .k.k-recommend { background: #F4EEF7; color: #7A5C96; }
.meal-row .v { color: #253227; flex: 1; word-break: break-word; }

.recipe-note {
  background: #FCF8EC; color: #7A6326; font-size: 12.5px; padding: 11px 16px; line-height: 1.7;
  display: flex; gap: 8px; align-items: flex-start;
  border-top: 1px solid #F4EBd4;
}
.recipe-note .nt {
  font-weight: 800; flex: none; font-size: 11px; letter-spacing: .06em;
  background: #F3E6C4; color: #7A5C17; border-radius: 6px; padding: 2px 6px; margin-top: 1px;
}
.reminder {
  background: linear-gradient(100deg, #FBEBE7, #F8E2DD);
  color: #AE3B2C; font-weight: 700;
  font-size: 12.5px; padding: 12px 16px; letter-spacing: .01em;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.6;
}
.reminder + .reminder { border-top: 1px solid rgba(174, 59, 44, .10); }
.reminder .ri { flex: none; display: flex; margin-top: 1px; }
.reminder .ri svg { width: 14px; height: 14px; }
.recipe-ft {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 13px 16px 14px; font-size: 11.5px; color: var(--muted);
  background: #FAFCF7; flex-wrap: wrap; border-top: 1px solid var(--line-soft);
}
.sig { display: flex; align-items: center; gap: 6px; }
.sig > span { letter-spacing: .04em; }
.sig b { color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.sig .sign-box {
  border: 1px solid #CBDFC6; border-radius: 8px; padding: 2px 10px; font-weight: 800;
  color: var(--g800); background: #fff; letter-spacing: .06em;
  box-shadow: 0 1px 2px rgba(30, 64, 41, .06);
}

/* ---------- 执行状态卡 ---------- */
.plan-bar {
  position: relative; display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 18px; padding: 14px 16px 14px 17px;
  margin-bottom: 12px; border: 1px solid rgba(24, 39, 25, .055);
  box-shadow: var(--shadow-s); overflow: hidden;
}
.plan-bar::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--g400), var(--g700));
}
.pb-main { flex: 1; min-width: 0; }
.pb-top { display: flex; align-items: center; gap: 8px; }
.pb-since {
  font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.pb-sub {
  margin-top: 7px; font-size: 12px; color: var(--ink-2); font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.pb-sub .dot { color: var(--faint); font-weight: 400; }
.pb-sub .weak { color: var(--muted); font-weight: 500; }
.progress { margin-top: 9px; height: 5px; background: #EDF2E9; border-radius: 99px; overflow: hidden; }
.progress i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--g400), var(--g600));
  box-shadow: 0 0 8px rgba(92, 154, 107, .4);
}
.pb-ring {
  --p: 50%; flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--g500) var(--p), #EDF2E9 0);
}
.pb-ring .pr-in {
  width: 44px; height: 44px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.pb-ring b {
  font-size: 15px; font-weight: 800; color: var(--g800); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.pb-ring span { font-size: 9px; color: var(--muted); margin-top: 2px; letter-spacing: .04em; }
.pb-ring.gray { background: conic-gradient(#CBD5C8 100%, #EDF2E9 0); }
.pb-ring.gray b { color: #7C8A80; }

/* ---------- 状态胶囊 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--g100); color: var(--g700); border: 1px solid #D9E9D3;
  white-space: nowrap; letter-spacing: .03em;
}
.pill.gray { background: #F1F3EF; color: #7A857C; border-color: #E5E9E2; }
.pill.blue { background: #EAF2F7; color: #31688C; border-color: #D9E8F1; }
.pill.amber { background: var(--amber-bg); color: var(--amber); border-color: #F2E4C5; }
.pill.green { background: var(--g100); color: var(--g700); border-color: var(--g200); }
.pill svg { width: 11px; height: 11px; flex: none; }

/* ---------- list items ---------- */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: #fff;
  border-radius: 16px; margin-bottom: 10px; box-shadow: var(--shadow-s); cursor: pointer;
  border: 1px solid rgba(24, 39, 25, .05);
  transition: transform .1s ease, box-shadow .16s ease;
}
.list-item:active { transform: scale(.992); box-shadow: 0 1px 2px rgba(18, 38, 24, .05); }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(150deg, #5C9A6B, #2B5B3A);
  box-shadow: 0 6px 14px -8px rgba(43, 91, 58, .8);
  letter-spacing: .02em;
}
.avatar.gray {
  background: linear-gradient(150deg, #C0CBBE, #94A390); box-shadow: none;
}
.li-main { flex: 1; min-width: 0; }
.li-title {
  font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 7px;
  letter-spacing: .01em; min-width: 0; flex-wrap: wrap;
}
.li-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.li-arrow { color: #C8D2C8; font-size: 17px; flex: none; }
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700;
  letter-spacing: .1em; background: #F7FAF4; border: 1px dashed #D3E2CC;
  color: var(--g700); padding: 2px 7px; border-radius: 6px; font-size: 11.5px;
}

/* 列表行里的「近 7 天执行率」小标：颜色沿用执行率三档（≥85 绿 / 70–84 橙 / <70 红） */
.adh-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #F1F3EF; color: #7A857C; border: 1px solid #E5E9E2; white-space: nowrap;
}
.adh-chip.ok { background: #EAF6EF; color: #2F7A4F; border-color: #CFE8DA; }
.adh-chip.warn { background: var(--amber-bg); color: var(--amber); border-color: #F2E4C5; }
.adh-chip.bad { background: #FBEEEB; color: #B0503C; border-color: #F2D8D1; }

/* ---------- 客户码卡片 ---------- */
.code-panel { margin-bottom: 12px; }
.cp-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cp-label {
  font-size: 11.5px; font-weight: 700; color: var(--g700); letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 5px;
}
.cp-label svg { width: 13px; height: 13px; }
.cp-code {
  text-align: center; padding: 14px 10px; border-radius: 14px;
  background: linear-gradient(180deg, #F8FBF5, #EDF5E7);
  border: 1px dashed #CCDFC4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 25px; font-weight: 800; letter-spacing: .13em; text-indent: .13em;
  color: var(--g800); line-height: 1.1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.cp-hint { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.6; }
.cp-acts { display: flex; gap: 8px; margin-top: 12px; }
.cp-acts .btn { flex: 1; }

/* ---------- 档案卡 ---------- */
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chipstat {
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: #F5F7F3; border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 3px 9px; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.weight-goal {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(100deg, #F7FAF3, #EFF6EA);
  border: 1px solid #E4EEDD; border-radius: 13px; padding: 11px 13px;
}
.wg-item { display: flex; align-items: baseline; gap: 3px; }
.wg-item b {
  font-size: 19px; font-weight: 800; color: var(--g800); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.wg-item span { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.wg-item .wg-k {
  display: block; font-size: 10.5px; color: var(--muted); font-weight: 600;
  margin-bottom: 3px; letter-spacing: .04em;
}
.wg-col { display: flex; flex-direction: column; }
.wg-arrow { color: var(--g400); font-size: 15px; flex: none; padding: 0 1px; }
.wg-tag {
  margin-left: auto; font-size: 11px; font-weight: 800; color: #94661A;
  background: var(--amber-bg); border: 1px solid #F0E1C1; border-radius: 999px;
  padding: 4px 9px; white-space: nowrap; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.note-line {
  margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.65;
  display: flex; gap: 6px; align-items: flex-start;
}
.note-line b { color: var(--ink-2); font-weight: 700; flex: none; }

/* ---------- hero greeting（客户首页） ---------- */
.hero { padding: 12px 4px 14px; }
.hero-date {
  font-size: 11.5px; color: var(--g600); font-weight: 700; letter-spacing: .1em;
  margin-bottom: 7px; display: flex; align-items: center; gap: 6px;
}
.hero-date::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--g400);
}
.hero-hello { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; }
.hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; letter-spacing: .01em; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 17px; }
.timeline::before {
  content: ''; position: absolute; left: 3.5px; top: 6px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, var(--g200), var(--line-soft));
}
.tl-item { position: relative; padding: 0 0 13px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -17px; top: 4.5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--g500); box-shadow: 0 0 0 3px #F0F7EC;
}
.tl-item .tl-time {
  font-size: 11px; color: var(--faint); letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.tl-item .tl-text { font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.6; }

/* ---------- section header ---------- */
.sec-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 18px 3px 10px;
}
.sec-hd h2 {
  font-size: 13px; margin: 0; font-weight: 800; color: var(--ink-2); letter-spacing: .06em;
  display: flex; align-items: center; gap: 7px;
}
.sec-hd h2::before {
  content: ''; width: 3px; height: 11px; border-radius: 2px;
  background: linear-gradient(180deg, var(--g400), var(--g700));
}
.sec-hd .icon-btn.link { font-size: 12.5px; }

/* ---------- tabbar（浮动药丸版） ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px;
  width: calc(100% - 28px); max-width: 532px;
  display: flex; z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(24, 39, 25, .08);
  border-radius: 20px;
  box-shadow: 0 16px 40px -18px rgba(18, 38, 24, .5);
}
.tabbar a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 7px 0 6px; font-size: 10.5px; color: #8C988E;
  text-decoration: none; font-weight: 600; letter-spacing: .04em;
}
.tabbar a .t-ico { width: 22px; height: 22px; display: block; transition: transform .18s var(--ease); }
.tabbar a .t-label { line-height: 1; }
.tabbar a.on { position: relative; z-index: 1; color: #fff; font-weight: 800; }
.tabbar a.on .t-ico { transform: translateY(-1px); }
.tabbar a.on::before {
  content: ''; position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  width: 66px; height: calc(100% - 4px); border-radius: 14px; z-index: -1;
  background: linear-gradient(180deg, #3B7449, #2B5B3A);
  box-shadow: 0 8px 18px -10px rgba(30, 64, 41, .75);
}

/* ---------- editor ---------- */
.ed-hd { display: flex; gap: 8px; align-items: center; }
.ed-meal {
  background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
  border: 1px solid rgba(24, 39, 25, .055); box-shadow: var(--shadow-s);
}
.ed-meal-hd {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(180deg, #F7FBF3, #EFF6E9); border-bottom: 1px solid var(--line-soft);
}
.ed-meal-hd .n {
  width: 22px; height: 22px; border-radius: 7px; background: var(--g700); color: #fff;
  font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 2px 6px -2px rgba(43, 91, 58, .7);
}
.ed-meal-hd input {
  border: none; background: transparent; font-weight: 800; padding: 2px 0; font-size: 14px;
  width: auto; flex: 1; min-width: 0; box-shadow: none;
}
.ed-meal-hd input:focus { box-shadow: none; background: transparent; }
.ed-meal-hd input.time {
  flex: none; width: 96px; color: var(--muted); font-weight: 500; text-align: right; font-size: 12px;
}
.ed-rows { padding: 9px 12px 10px; }
.ed-row { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 7px; }
.ed-row input.k {
  width: 74px; flex: none; font-weight: 700; padding: 8px; font-size: 13px;
  background: var(--g50); border-color: #E2EDDB; color: var(--g700);
}
.ed-row textarea.v {
  flex: 1; width: auto; min-width: 0; padding: 8px; font-size: 13.5px; min-height: 38px; resize: none;
}
.ed-row .del, .ed-meal-hd .del {
  border: none; background: none; color: #C2CCC1; font-size: 16px; cursor: pointer;
  padding: 8px 4px; flex: none; line-height: 1;
}
.ed-row .del:active, .ed-meal-hd .del:active { color: var(--red); }
.ed-add {
  border: 1px dashed #D5E5CD; background: #FBFDF9; color: var(--g700);
  width: 100%; padding: 9px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; letter-spacing: .02em;
}
.ed-add:active { background: var(--g50); }
.ed-foot { display: flex; gap: 8px; padding: 0 12px 12px; }

.time-box { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; align-items: center; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.chip {
  border: 1px solid #DBE9D4; background: #FBFDF9; color: var(--g700);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: .02em;
}
.chip:active { background: var(--g100); }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 30, 20, .46); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  overflow-y: auto; backdrop-filter: blur(2px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  background: #fff; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.22, .9, .3, 1);
  box-shadow: 0 -20px 50px -20px rgba(16, 30, 20, .4);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@keyframes up { from { transform: translateY(28px); opacity: .5 } to { transform: none; opacity: 1 } }
.sheet::before {
  content: ''; display: block; width: 36px; height: 4px; border-radius: 99px;
  background: #E4E9E1; margin: -6px auto 14px;
}
.sheet h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: rgba(22, 38, 28, .94); color: #fff; font-size: 13px; padding: 10px 16px;
  border-radius: 11px; z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s, bottom .2s; max-width: 78%; text-align: center; line-height: 1.5;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); backdrop-filter: blur(6px);
}
#toast.show { opacity: 1; bottom: 102px; }

/* ============================================================
   报表（工作人员）
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.kpi {
  background: #fff; border: 1px solid rgba(24, 39, 25, .055); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow-s);
}
.kpi-v {
  font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--g800);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.kpi-v i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-k { font-size: 11.5px; color: var(--muted); margin-top: 4px; letter-spacing: .03em; }
.kpi-note { font-size: 12px; color: var(--muted); line-height: 1.75; margin: 0 2px 18px; }
.kpi-note b { color: var(--g800); font-weight: 800; }

.rp-good { color: var(--g700) !important; }
.rp-warn { color: var(--amber) !important; }
.rp-bad { color: var(--red) !important; }

.rp-issues { padding: 2px 14px; }
.rp-issue { display: flex; align-items: center; gap: 9px; padding: 10px 0; cursor: pointer; }
.rp-issue + .rp-issue { border-top: 1px solid var(--line-soft); }
.rp-issue:active { opacity: .7; }
.rp-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #CBD5C8; }
.rp-dot.warn { background: #E0A93B; }
.rp-dot.bad { background: var(--red); }
.rp-issue-main { flex: 1; min-width: 0; }
.rp-issue-main b { display: block; font-size: 13.5px; font-weight: 700; }
.rp-issue-main span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; line-height: 1.5; }

.rp-sort { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.rp-sort .chip.on { background: var(--g700); border-color: var(--g700); color: #fff; }

.rp-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border: 1px solid rgba(24, 39, 25, .055);
  border-radius: var(--radius); box-shadow: var(--shadow-s);
}
.rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-table th {
  text-align: left; font-weight: 700; color: var(--muted); font-size: 11px; letter-spacing: .04em;
  padding: 10px 9px; background: #F7FAF4; border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.rp-table td {
  padding: 9px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rp-table tbody tr:last-child td { border-bottom: none; }
.rp-table tbody tr { cursor: pointer; }
.rp-table tbody tr:active { background: #FAFCF8; }
.rp-name { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 5px; }
.rp-num { color: var(--ink-2); }
.rp-prog { display: flex; align-items: center; gap: 6px; }
.rp-bar { width: 46px; height: 5px; border-radius: 99px; background: #EDF2E9; overflow: hidden; flex: none; }
.rp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--g500), var(--g700)); }
.rp-prog span { font-size: 11px; color: var(--muted); }
.csv-out {
  width: 100%; height: 240px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.5; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; background: #FBFDF9;
}

/* 窄屏：优先保留「客户 / 起始→当前 / 减重 / 合规 / 最近」，其余可横向滚动查看 */
@media (max-width: 519px) {
  .rp-col-g, .rp-col-d, .rp-col-p { display: none; }
  .rp-table th, .rp-table td { padding: 9px 7px; }
}

/* 可点击的「已使用 · 解锁」状态标签（超级管理员解锁客户） */
.pill.unlock {
  cursor: pointer; font-family: inherit; border: 1px solid #DCE9D5; background: #F3FAEE;
  color: var(--g700); font-weight: 700;
}
.pill.unlock:active { background: var(--g100); transform: scale(.97); }

/* 客户归属行（详情页）/ 列表内的操作按钮 */
.owner-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.owner-main { flex: 1; min-width: 0; }
.owner-k { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.owner-v { display: block; font-size: 13.5px; font-weight: 700; margin-top: 1px; }
.owner-row .btn { flex: none; }
.list-item > .btn { flex: none; }

/* ============================================================
   打卡明细表（营养师 / 客户共用）
   ============================================================ */
.ck-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ck-table th {
  text-align: left; font-weight: 700; color: var(--muted); font-size: 11px;
  letter-spacing: .04em; padding: 4px 6px 9px; white-space: nowrap;
}
.ck-table td {
  padding: 9px 6px; border-top: 1px solid var(--line-soft);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ck-table th:first-child, .ck-table td:first-child { padding-left: 2px; }
.ck-table th:last-child, .ck-table td:last-child { text-align: right; padding-right: 2px; }
.ck-table tbody tr { cursor: pointer; }
.ck-table tbody tr:active { background: #FAFCF8; }
.ck-act { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.ck-act .btn { white-space: nowrap; flex: none; }
.ck-flag { color: var(--g600); letter-spacing: 1px; font-size: 12px; }
.ck-flag .off { color: #D3DAD0; }

/* ============================================================
   食谱模板（分类 / 团队共享）
   ============================================================ */
.chip.on { background: var(--g700); border-color: var(--g700); color: #fff; }

.tpl-new {
  background: #FBFDF9; border: 1px solid #E4EEDD; border-radius: 16px;
  padding: 12px; margin-bottom: 4px;
}
.tpl-new-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.tpl-new-row .btn { white-space: nowrap; }
.tpl-share {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.tpl-share input { width: 16px; height: 16px; accent-color: var(--g700); flex: none; }

.tpl-grp {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--g700); letter-spacing: .08em;
  margin: 14px 0 8px; padding-left: 2px;
}
.tpl-grp::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, var(--g500), var(--g700)); flex: none;
}
.tpl-grp span { color: var(--muted); font-weight: 600; letter-spacing: 0; }

.tpl-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: #fff; border: 1px solid rgba(24, 39, 25, .055);
  border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow-s);
}
.tpl-main { flex: 1; min-width: 0; }
.tpl-nm {
  font-size: 13.5px; font-weight: 700; letter-spacing: .01em;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tpl-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.tpl-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 1.5px 7px;
  border-radius: 999px; background: var(--g100); color: var(--g700);
  border: 1px solid #DDEBD5; flex: none;
}
.tpl-tag.share { background: #EAF2F7; color: #31688C; border-color: #D9E8F1; }
.tpl-tag.other { background: #F4F2EC; color: #8A7B4F; border-color: #EAE4D2; }
.tpl-act { display: flex; gap: 6px; flex: none; }
.tpl-act .btn { white-space: nowrap; flex: none; }

.tpl-edit {
  background: #FBFDF9; border: 1px solid #D9E8D2; border-radius: 14px;
  padding: 12px; margin-bottom: 8px;
}
/* ================= 报表（汇报模式） ================= */
.rp-tabs {
  display: flex; gap: 6px; margin: 0 0 12px; padding: 4px; border-radius: 14px;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tab {
  flex: 1 0 auto; min-width: 54px; padding: 7px 12px; border: none; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.rp-tab.on { background: var(--g700); color: #fff; box-shadow: var(--shadow-s); }

/* 自动汇报结论 */
.rp-sum { padding: 12px 14px 10px; margin-bottom: 12px; background: linear-gradient(180deg, #F7FCF4 0%, #FFFFFF 100%); }
.rp-sum-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13.5px; font-weight: 800; color: var(--g800); margin-bottom: 8px;
}
.rp-sum-list { margin: 0; padding-left: 18px; }
.rp-sum-list li { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.rp-sum-list li + li { margin-top: 6px; }
.rp-sum-foot { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--faint); line-height: 1.6; }

/* 导出选项 */
.exp-list { display: flex; flex-direction: column; gap: 8px; }
.exp-item {
  display: block; width: 100%; text-align: left; padding: 11px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-family: inherit;
}
.exp-item:active { background: var(--g50); }
.exp-item b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 700; }
.exp-item span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }

/* ================= 服务营期（购课 / 续营缴费） ================= */
.cyc-card { padding: 12px 14px 10px; }
.cyc-card .hint { padding: 2px 2px 10px; }
.cyc-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.cyc-top.near { padding-bottom: 8px; }
.cyc-cur { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cyc-cur > b { font-size: 16px; color: var(--ink); }
.cyc-top.near .cyc-cur > b { color: var(--amber); }
.cyc-top .cyc-dt { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cyc-top.ended { border-bottom: none; }
.cyc-warn {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--amber-bg); color: var(--amber); font-size: 12.5px; line-height: 1.45;
}
.cyc-warn svg { width: 15px; height: 15px; flex: none; }
.cyc-warn span { flex: 1; min-width: 0; }
.cyc-warn .btn { flex: none; }
.cyc-sum {
  padding: 9px 0 2px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.cyc-sum b { color: var(--ink); font-weight: 700; }
.cyc-list { margin-top: 4px; }
.cyc-list .cyc-row { padding: 9px 0 8px; border-top: 1px solid var(--line-soft); }
.cyc-nm { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink); flex-wrap: wrap; }
.cyc-nm .pill { font-size: 11px; padding: 2px 7px; }
.cyc-row .cyc-dt { margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.cyc-row .cyc-dt b { color: var(--g700); font-weight: 700; }
.cyc-act { display: flex; gap: 6px; margin-top: 7px; }
.cyc-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.cyc-note b { color: var(--g700); }

.tpl-edit .field { margin-bottom: 10px; }

/* ============================================================
   待办中心（独立页） + 客户归档
   ============================================================ */
.chip i { font-style: normal; opacity: .6; margin-left: 4px; font-weight: 700; }
.chip.on i { opacity: .85; }

.rm-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 7px; margin-bottom: 4px;
}
.rm-kpi {
  background: #fff; border: 1px solid rgba(24, 39, 25, .07); border-radius: 14px;
  padding: 10px 6px 9px; text-align: center; cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-s); transition: border-color .15s ease, background .15s ease;
}
.rm-kpi b { display: block; font-size: 19px; line-height: 1.1; color: var(--g800); letter-spacing: -.01em; }
.rm-kpi b.bad, .rm-kpi b.amber { color: #C1683F; }
.rm-kpi b.blue { color: #31688C; }
.rm-kpi b.gray { color: var(--g600); }
.rm-kpi span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; letter-spacing: .01em; }
.rm-kpi.on { border-color: var(--g700); background: #F2F8EE; }
.rm-kpi.on span { color: var(--g700); }

.rm-row-g { font-size: 11px; font-weight: 600; color: var(--muted); }
.rm-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.rm-tags .tpl-tag { font-size: 10.5px; padding: 1px 7px; }

.arch-bar {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; margin-bottom: 12px;
  background: #F6F5EF; border: 1px solid #E7E2D2; border-radius: 14px;
}
.arch-bar svg { width: 17px; height: 17px; color: #8A7B4F; flex: none; }
.arch-bar span { flex: 1; min-width: 0; font-size: 12px; color: #7A6E48; }
.arch-bar .btn { flex: none; }

.arch-foot { margin: 16px 0 4px; }
.arch-foot .btn { color: var(--muted); }

@media (max-width: 519px) {
  .rm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rm-row-t { font-size: 13px; }
  .rm-row-act .btn { padding: 6px 9px; font-size: 12px; }
}

@media (max-width: 519px) {
  .tpl-row { gap: 8px; padding: 10px 11px; }
  .tpl-nm { font-size: 13px; }
  .tpl-act { gap: 5px; }
  .tpl-act .btn-sm { padding: 7px 9px; font-size: 12.5px; }
  .tpl-new-row .btn { padding: 8px 12px; font-size: 13px; }
}

/* ---------- 模板批量操作 ---------- */
.sec-hd-right { display: flex; align-items: center; gap: 8px; flex: none; }
.tpl-row.pick { cursor: pointer; }
.tpl-row.pick.sel { border-color: #9AC9A0; background: #F7FBF3; box-shadow: 0 0 0 1px #CBE3C4 inset; }
.tpl-ck {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1.5px solid #D3DED0; background: #fff; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.tpl-ck.on { background: var(--g700); border-color: var(--g700); }
.tpl-batch {
  background: #FBFDF9; border: 1px dashed #CFE3C7; border-radius: 16px;
  padding: 11px 12px; margin-top: 12px;
}
.tpl-batch-hd {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.tpl-batch-hd b { color: var(--g700); font-size: 13.5px; }
.tpl-batch-hd .btn { margin-left: auto; }
.tpl-batch-row { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 9px; }
.tpl-batch-row input { flex: 1; min-width: 120px; }
.tpl-batch-row .btn { flex: none; }

/* ---------- 打卡提醒 ---------- */
.rm-card {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; margin-bottom: 12px;
  background: linear-gradient(140deg, #F4FAEF, #EAF4E4);
  border: 1px solid #DCEBD3; border-radius: 18px;
}
.rm-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: #fff; color: var(--g700); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px -6px rgba(43, 91, 58, .5);
}
.rm-ico svg { width: 18px; height: 18px; }
.rm-main { flex: 1; min-width: 0; }
.rm-t { font-size: 14px; font-weight: 800; color: var(--g800); letter-spacing: .01em; }
.rm-d { font-size: 11.5px; color: var(--g600); margin-top: 3px; }
.rm-card .btn { flex: none; }

.rm-row {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px;
  background: #fff; border: 1px solid rgba(24, 39, 25, .055);
  border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow-s);
}
.rm-row-main { flex: 1; min-width: 0; }
.rm-row-t {
  font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rm-row-d { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rm-row-act { display: flex; gap: 6px; flex: none; }
.rm-row-act .btn { padding: 7px 10px; font-size: 12.5px; }

/* 客户首页的轻提示条 */
.rm-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px; margin-bottom: 12px;
  background: #FDF9EF; border: 1px solid #F0E4C8; border-radius: 16px;
}
.rm-bar-ico {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: #fff; color: var(--amber); display: flex; align-items: center; justify-content: center;
}
.rm-bar-ico svg { width: 17px; height: 17px; }
.rm-bar-main { flex: 1; min-width: 0; }
.rm-bar-main b { display: block; font-size: 13.5px; color: #7A5C22; letter-spacing: .01em; }
.rm-bar-main span { display: block; font-size: 11.5px; color: #9B8452; margin-top: 3px; }

/* 开关 */
.sw {
  width: 44px; height: 26px; border-radius: 99px; flex: none; border: none;
  background: #DDE4DA; position: relative; padding: 0; cursor: pointer;
  transition: background .16s ease; font-family: inherit;
}
.sw i {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 30, 20, .25);
  transition: transform .16s cubic-bezier(.3, .8, .4, 1);
}
.sw.on { background: var(--g600); }
.sw.on i { transform: translateX(18px); }
.sw[disabled] { opacity: .6; }

/* ============================================================
   结营报告：报告正文（客户 / 营养师预览共用）、编辑页、选期弹层
   ============================================================ */
.cr-bar {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--g50); border: 1px solid var(--g200);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px;
}
.cr-bar svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--g600); }
.cr-bar div { display: flex; flex-direction: column; gap: 2px; }
.cr-bar b { font-size: 13px; }
.cr-bar span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.cr-bar.blue { background: var(--sky-bg); border-color: #CFE3E9; }
.cr-bar.blue svg { color: var(--sky); }
.cr-bar.green { background: var(--g100); border-color: var(--g300); }
.cr-bar.gray { background: #F4F6F3; border-color: var(--line); }
.cr-bar.gray svg { color: var(--muted); }

.cr-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); margin-bottom: 12px;
}
.cr-meta .pill { margin-left: 2px; }

/* 客户端首页 / 我的里的入口 */
.cr-entry { background: var(--card); }

/* 客户详情页的报告列表 */
.cr-card .hint { font-size: 12.5px; }
.cr-row {
  padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line-soft); margin-bottom: 8px; background: #FBFDFA;
}
.cr-row:last-child { margin-bottom: 0; }
.cr-row-t { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.cr-row-d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cr-row-sub { font-size: 12px; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 编辑页：数据快照 */
.cr-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cr-f { display: flex; flex-direction: column; gap: 3px; }
.cr-f label { font-size: 11px; color: var(--muted); }
.cr-num {
  width: 100%; font-size: 14px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}
.cr-calc { margin-top: 10px; font-size: 13px; color: var(--muted); }
.cr-calc b { color: var(--ink); font-size: 15px; }

/* 编辑页：多条文案（亮点 / 建议） */
.cr-li { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.cr-li-n {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: var(--g100); color: var(--g700);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.cr-txt {
  flex: 1; font-size: 13.5px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}
.cr-txt::placeholder { color: var(--faint); }
.rows.tight .row-item { padding: 9px 12px; }

/* 报告正文 */
.cr-doc {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-s); padding: 18px 16px 16px;
  border: 1px solid var(--line-soft);
}
.cr-doc-hd { text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.cr-kicker {
  font-size: 11px; letter-spacing: .12em; color: var(--g600);
  text-transform: uppercase; margin-bottom: 4px;
}
.cr-doc-hd h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.cr-period { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cr-greet { font-size: 14px; color: var(--ink-2); margin: 14px 0 0; }

.cr-stats { display: flex; gap: 8px; margin-top: 14px; }
.cr-stat {
  flex: 1; background: var(--g50); border-radius: var(--r-sm);
  padding: 10px 8px; text-align: center;
}
.cr-stat .cs-k { display: block; font-size: 11px; color: var(--muted); }
.cr-stat .cs-v { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin-top: 2px; }
.cr-stat .cs-v b { font-size: 19px; font-weight: 700; }
.cr-stat .cs-v i { font-style: normal; font-size: 11px; color: var(--muted); }
.cr-stat .cs-v b.down { color: var(--g600); }
.cr-stat .cs-v b.up { color: var(--red); }

.cr-goal { margin-top: 12px; }
.cr-goal .cg-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.cr-pct { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.cr-pct b { color: var(--ink); }
.cr-pct .dot { margin: 0 4px; color: var(--faint); }

.cr-chart { margin-top: 12px; padding: 12px 10px 6px; }
.cr-chart .card-title { margin-bottom: 4px; }

.cr-weeks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cw {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: #F6F8F4; border-radius: 8px; padding: 4px 8px;
}
.cw i { font-style: normal; font-size: 11px; color: var(--muted); }
.cw b { font-size: 13px; }
.cw b.down { color: var(--g600); }
.cw b.up { color: var(--red); }

.cr-facts { margin-top: 12px; padding: 4px 12px 8px; }
.cf-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.cf-row:last-child { border-bottom: none; }
.cf-row .cf-k { color: var(--muted); font-size: 13px; }

.cr-sec { margin-top: 16px; }
.cr-sec h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.cr-sec p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.cr-sec ol { margin: 0; padding-left: 18px; }
.cr-sec li { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; margin-bottom: 3px; }

.cr-next {
  margin-top: 12px; background: var(--g50); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 13.5px; color: var(--g800);
}
.cr-sign {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}
.cr-sign span { font-size: 12px; color: var(--muted); }
.cr-sign b { font-size: 14px; }

/* 选期弹层 */
.cr-pick { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.cr-pick-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; cursor: pointer; text-align: left;
}
.cr-pick-item b { font-size: 14px; }
.cr-pick-item span { font-size: 12px; color: var(--muted); }
.cr-pick-item:active { background: var(--g50); }

/* ---------- 待办中心：批量选择 ---------- */
.rm-ck { flex: 0 0 auto; width: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rm-ck input { position: absolute; opacity: 0; width: 0; height: 0; }
.rm-ck i {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line);
  background: #fff; display: block; position: relative; transition: .16s;
}
.rm-ck input:checked + i { background: var(--g600); border-color: var(--g600); }
.rm-ck input:checked + i::after {
  content: ''; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg);
}
.rm-ck input:indeterminate + i { background: var(--g300); border-color: var(--g300); }
.rm-ck-off { width: 20px; }

.rm-batch {
  position: sticky; bottom: 62px; z-index: 20; margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line);
  box-shadow: var(--shadow-m); backdrop-filter: blur(12px);
}
.rm-batch > span { flex: 1; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.rm-batch .btn { flex: 0 0 auto; }

/* ---------- 报表快照 ---------- */
.sn-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.sn-row {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
}
.sn-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sn-main b { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sn-main span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sn-act { display: flex; gap: 6px; justify-content: flex-end; }
.sn-act .btn { padding: 5px 10px; font-size: 12.5px; }
.sn-act .btn.danger { color: var(--red); }

/* ---------- 操作记录筛选 ---------- */
.au-filter { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.au-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.au-filter .field { margin: 0; }

/* ---------- 报告长图 ---------- */
.poster-box {
  max-height: 60vh; overflow-y: auto; background: var(--bg);
  border-radius: var(--r-sm); padding: 8px; text-align: center;
}
.poster-box img { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 8px; }
.poster-box .empty { padding: 26px 10px; }

/* ---------- 打印 / 存为 PDF：只留报告正文 ---------- */
#print-area { display: none; }
@media print {
  body { background: #fff; }
  body > * { display: none !important; }
  #print-area { display: block !important; }
  @page { margin: 12mm; }
}
#print-area .cr-doc { box-shadow: none; border: 0; margin: 0; padding: 0; }
#print-area .cr-doc-hd { color: #16301F; }
#print-area .card { break-inside: avoid; page-break-inside: avoid; }
#print-area .cr-sec, #print-area .cr-next, #print-area .cr-sign { break-inside: avoid; page-break-inside: avoid; }

/* ---------- 客户体重页：概览数字
   注意：这组 class 原先只在 client.js 里被使用、CSS 里压根没定义，
   所以「最新体重 / 累计变化 / 目标体重」曾经是无排版地挤成一行的。补上。 ---------- */
.weight-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 2px; text-align: center;
}
.weight-summary .ws-col { padding: 2px 0; }
.weight-summary .ws-k {
  display: block; font-size: 11.5px; color: var(--muted); font-weight: 600;
  letter-spacing: .02em; margin-bottom: 3px;
}
.weight-summary .ws-item {
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
}
.weight-summary .ws-item b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.weight-summary .ws-item span { font-size: 11px; color: var(--faint); font-weight: 600; }
/* 减重场景：往下走是好事用绿，往上走用红（与行情「红涨绿跌」无关，别套用） */
.weight-summary .ws-item b.down { color: #2F7A4F; }
.weight-summary .ws-item b.up { color: #B0503C; }

/* ---------- 图表图例 ---------- */
.ch-legend {
  display: flex; flex-wrap: wrap; gap: 5px 12px; justify-content: center;
  margin-top: 9px; font-size: 11.5px; color: var(--muted);
}
.ch-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.ch-legend .sw {
  width: 13px; height: 3px; border-radius: 2px; flex: none; display: inline-block;
}
.ch-legend .sw.band { width: 13px; height: 11px; border-radius: 3px; }

/* ---------- 「执行率 vs 体重」结论条 ---------- */
.adh-insight { padding: 14px 16px 12px; }
.adh-insight .card-title { margin-bottom: 6px; }
.ai-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.ai-row + .ai-concl { margin-top: 10px; }
.ai-row:last-of-type { border-bottom: 0; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ai-k { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ai-v { font-size: 13px; font-weight: 800; white-space: nowrap; }
.ai-concl {
  margin-top: 10px; padding: 9px 11px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.7; font-weight: 600;
}
.ai-concl.good { background: #EDF7F0; color: #2F7A4F; }
.ai-concl.warn { background: #FDF4E5; color: #98631A; }
.ai-concl.flat { background: #F4F6F2; color: var(--muted); }
.ai-note { margin-top: 9px; font-size: 11px; line-height: 1.7; color: var(--faint); }

/* ============================================================
   桌面 / 大屏适配：手机上仍是窄屏单列；电脑上撑开为宽屏并居中弹层
   ============================================================ */
@media (min-width: 820px) {
  #app { max-width: 1080px; }
  .topbar { padding: 14px 32px 12px; }
  /* 桌面端内容底部留白要给悬浮药丸 tabbar 让位 */
  .page { padding: 8px 32px 100px; }
  /* 悬浮药丸在宽屏仍保持紧凑居中，不撑满整行 */
  .tabbar { max-width: 532px; }

  /* 客户列表在大屏铺成多列，避免一行一个、大片留白 */
  #client-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
  }
  #client-list > .list-item { margin: 0; }

  /* 弹层改为居中对话框，而不是贴着屏幕底边的一条 */
  .overlay { align-items: center; padding: 28px 20px; }
  .sheet {
    max-width: 680px;
    border-radius: 22px;
    max-height: calc(100vh - 56px);
    padding: 22px 26px 20px;
    box-shadow: 0 30px 80px -30px rgba(16, 30, 20, .55);
  }
  .sheet::before { display: none; }   /* 去掉手机端下拉手势条 */

  #toast { max-width: 460px; }
}

/* ============================================================
   v3 精修层（2026-10-25）
   只补「浏览器自带、不属于任何设计系统」的细节 + 键盘可达性；
   不改布局、不动既有组件结构，可整段删除回退。
   ============================================================ */

/* 选中文字：用品牌绿的低饱和，替掉系统默认蓝 */
::selection { background: rgba(92, 154, 107, .24); color: var(--g900); }
::-moz-selection { background: rgba(92, 154, 107, .24); color: var(--g900); }

/* 输入光标 */
input, textarea, [contenteditable] { caret-color: var(--g600); }

/* 键盘焦点：只对键盘可见，鼠标点击不出现描边。
   注意：不要在这里设 border-radius，否则会把按钮/胶囊自己的圆角改掉 */
:focus-visible {
  outline: 2px solid var(--g500);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* 滚动条（桌面端 / 安卓 WebView） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #CFE0C8; border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #BBD3B2; background-clip: content-box; }

/* 加载态：让「加载中…」不只是一行灰字 */
.boot { gap: 10px; }
.boot::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--g200); border-top-color: var(--g600);
  animation: bootSpin .8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }

/* 尊重系统的「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 空状态图标：emoji 自带紫/彩色，与绿调冲突，降饱和后统一进品牌色域 */
.empty .big { filter: grayscale(1) opacity(.62); }
