/* Healthy Living — 设计规范
   结构与质量标准参照 SomaLoop shop：白底、灰色分组、1px 分隔线、无阴影堆叠/渐变/玻璃，
   层级靠留白、字号字重和大图。视觉元素取自 4seas.xyz：墨黑文字、柠檬黄主按钮、深绿品牌色、
   薄荷绿点缀、冷灰底，Outfit 标题 + Open Sans 正文，四叶草标志。 */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/outfit.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/open-sans.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --ink: #0F1213; --ink-2: #1D1F1E; --secondary: #3E4545; --muted: #687170; --absent: #A7AEAD;
  --paper: #fff; --surface: #ECF0EF; --hover: #F5F7F6; --divider: #DFE5E3; --line: #CDD3D2;
  --brand: #006954; --brand-2: #005040; --lime: #DDFF00; --lime-press: #CFEF00;
  --mint: #8AF8CA; --hero: #E4FBF1; --sky: #CFEFF3; --blush: #FDDDEE; --butter: #F4FFB8;
  --danger: #B42318;
  --r: 16px; --r-img: 20px; --r-btn: 10px; --r-in: 10px;
  --tabbar: 64px; --hdr: 64px;
  --display: "Outfit", "Open Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Open Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--body); font-feature-settings: "tnum"; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clover { color: var(--brand); flex: none; }

/* ---------- 文字 ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin: 0 0 6px; }
h1, .h1 { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; margin: 0; }
h2, .h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 36px 0 12px; }
.lead { color: var(--muted); margin: 6px 0 0; }
.mut { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); letter-spacing: .04em; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: var(--r-btn); border: 0; background: var(--lime); color: var(--ink);
  font-weight: 600; font-size: 16px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: opacity .14s, transform .14s, background-color .2s;
}
.btn:hover { background: var(--lime-press); }
.btn:active { opacity: .72; transform: scale(.985); }
.btn:disabled { background: var(--surface); color: var(--absent); cursor: default; }
.btn.sec { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(15, 18, 19, .22); }
.btn.sec:hover { background: var(--hover); }
.btn.dark { background: var(--ink-2); color: var(--lime); }
.btn.dark:hover { background: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(180, 35, 24, .35); }
.btn.danger:hover { background: #FDF3F2; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; color: var(--ink); transition: background .2s;
}
.icon-btn:hover { background: rgba(15, 18, 19, .06); }

/* ---------- 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 13px;
  font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface); white-space: nowrap; vertical-align: middle;
}
.pill.lime { background: var(--lime); } .pill.mint { background: var(--mint); } .pill.hero { background: var(--hero); }
.pill.sky { background: var(--sky); } .pill.butter { background: var(--butter); } .pill.blush { background: var(--blush); }
.pill.gray { color: var(--muted); }
.pill.brand { background: var(--brand); color: #fff; }

/* ---------- 表单 ---------- */
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--secondary); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--divider); border-radius: var(--r-in);
  background: var(--paper); color: var(--ink); font: 16px var(--body); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .2s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
/* 勾选框和单选框保留系统样式（上面的输入框规则会把它们抹平） */
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; appearance: auto; -webkit-appearance: auto; accent-color: var(--brand); vertical-align: middle; flex: none; }
textarea { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.5; }
.search { position: relative; }
.search input { background: var(--surface); border-color: transparent; padding-left: 42px; border-radius: 24px; }
.search input:focus { background: var(--paper); border-color: var(--ink); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: none; font-weight: 600; font-size: 14px; color: var(--secondary); white-space: nowrap; cursor: pointer; }
.seg .on { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--divider); }

/* ---------- 分组列表 ---------- */
.group { background: var(--surface); border-radius: var(--r); padding: 4px 20px; }
.group.pad { padding: 20px; }
.rows > .row { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--divider); min-width: 0; text-decoration: none; color: inherit; }
.rows > .row:first-child { border-top: 0; }
.rows > button.row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; font: inherit; }
.rows > button.row:first-child { border-top: 0; }
.rows > .row.tap::before { content: ""; position: absolute; inset: 1px -12px 0; border-radius: 12px; background: transparent; transition: background .12s; z-index: 0; }
.rows > .row.tap:hover::before { background: var(--hover); }
.rows > .row > * { position: relative; z-index: 1; }
.row .mid { flex: 1; min-width: 0; }
.row .tt { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .tt .x { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row .end { text-align: right; flex: none; }
.row .end b { font-size: 16px; font-weight: 700; white-space: nowrap; }
.row .chev { color: var(--absent); flex: none; }
.ico { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--mint); }
.thumb { width: 48px; height: 60px; border-radius: 8px; flex: none; background: var(--hero); overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.wide { width: 72px; height: 54px; }
.empty { padding: 36px 16px; color: var(--muted); text-align: center; display: grid; gap: 14px; justify-items: center; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 18px 20px; }
.stat .num { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.stat .lbl { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 4px; }
.stat.hero { background: var(--hero); }
.hero-card { background: var(--hero); border-radius: 24px; padding: 28px; }

/* ---------- 对话框 / 底部抽屉 ---------- */
.dlg-bg { position: fixed; inset: 0; background: rgba(15, 18, 19, .32); z-index: 40; animation: fade .14s ease-out; }
.dlg {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); overflow-y: auto; background: var(--paper); border-radius: 24px; padding: 24px; z-index: 41;
  border: 1px solid var(--divider); animation: pop .14s ease-out; overscroll-behavior: contain;
}
.dlg .grab { display: none; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dlg-head h3 { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.dlg form, .stack { display: grid; gap: 14px; }
.dlg .actions { display: grid; gap: 10px; margin-top: 6px; }
.dlg .actions.split { grid-template-columns: 1fr 1fr; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }

.photo-drop {
  position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--hero); overflow: hidden; cursor: pointer;
  color: var(--brand); text-align: center;
}
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop .ph { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; justify-items: center; font-weight: 600; font-size: 14px; }
.photo-drop .chg { position: absolute; right: 12px; bottom: 12px; background: var(--paper); color: var(--ink); border-radius: 18px; height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--ink-2); color: var(--lime); padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 60;
  animation: rise .2s var(--ease); max-width: calc(100vw - 32px);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- 顶栏 ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand b { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
