/* ============================================================
   本周吃什么 · 样式
   极简、克制、移动端优先
   ============================================================ */

:root {
  --green: #07C160;
  --green-dark: #06AD56;
  --green-soft: #EAF9F0;
  --amber: #FF9500;
  --amber-soft: #FFF5E6;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --line: #EDEDF0;
  --line-strong: #E2E2E6;
  --text: #1A1A1C;
  --text-2: #8A8A8E;
  --text-3: #B9B9BE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  --tabbar-h: 62px;
}

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

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

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 布局骨架 ---------- */

.phone {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.topbar .sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.2px;
}

.topbar-actions { display: flex; gap: 8px; padding-bottom: 2px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:active { transform: scale(0.93); }
.icon-btn svg { width: 18px; height: 18px; }

main { padding: 4px 16px 0; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card + .card { margin-top: 12px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 10px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.4px;
}

.card-body { padding: 0 16px 16px; }

.section-label {
  margin: 22px 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- 今日 ---------- */

.today-card {
  background: linear-gradient(160deg, #FFFFFF 0%, #FBFEFC 100%);
  border: 1px solid #E6F4EC;
}

.today-date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 16px 12px;
}

.today-date .d { font-size: 17px; font-weight: 650; }
.today-date .w { font-size: 13px; color: var(--text-2); }
.today-date .hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  padding: 3px 9px;
  border-radius: 100px;
}

.meal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.meal-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #F7F7F9;
  color: #9A9AA0;
}
.meal-ico svg { width: 17px; height: 17px; }
.meal-ico.lunch { color: #F2A03D; background: #FEF6EA; }
.meal-ico.dinner { color: #5C7CFA; background: #EEF1FE; }

/* 餐次块 */
.meal-block { border-top: 1px solid var(--line); }

.meal-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 4px;
}

.mb-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.mb-count {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-3);
}

.meal-dishes { padding: 0 16px 8px; }

.tod-dish {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
}

.td-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  text-align: left;
  border-radius: 8px;
}
.td-main:active { background: #FAFAFB; }

.td-name {
  font-size: 15.5px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-meta {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.td-x {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #C6C6CB;
}
.td-x:active { background: #FDF0EF; color: #FF3B30; }
.td-x svg { width: 12px; height: 12px; }

.em-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 14px;
}
.em-name { font-size: 15.5px; font-weight: 600; color: var(--amber); }
.em-note { margin-left: auto; font-size: 11px; color: var(--text-3); }

.empty-meal {
  margin: 0;
  padding: 4px 0 10px;
  font-size: 13px;
  color: var(--text-3);
}

.mini-btn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #F7F7F9;
  color: var(--text-2);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.mini-btn:active { background: #EFEFF3; }
.mini-btn.warn { color: var(--amber); background: var(--amber-soft); }
.mini-btn.green { color: var(--green-dark); background: var(--green-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 500;
}
.badge.emergency { color: var(--amber); background: var(--amber-soft); }
.badge.done { color: var(--green-dark); background: var(--green-soft); }

/* ---------- 一周列表 ---------- */

.week-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
}
.week-row:first-child { border-top: none; }
.week-row.is-today { background: #FAFEFB; }

.week-day {
  flex: none;
  width: 54px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.week-day b { font-size: 13px; font-weight: 600; }
.week-day span { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.week-row.is-today .week-day b { color: var(--green-dark); }

.week-meals { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.meal-line {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.mlabel {
  flex: none;
  width: 14px;
  line-height: 22px;
  font-size: 11px;
  color: var(--text-3);
}

.pill {
  font-size: 12.5px;
  line-height: 1;
  color: var(--text);
  background: #F6F6F8;
  border-radius: 6px;
  padding: 5px 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill:active { background: #ECECEF; }
.pill.em { color: var(--amber); background: var(--amber-soft); }

.pill-edit {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--line-strong);
}
.pill-edit:active { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.pill-edit svg { width: 12px; height: 12px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 550;
  transition: transform .12s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.985); opacity: .9; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:disabled { background: #D9D9DE; color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line-strong); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn svg { width: 17px; height: 17px; }

/* ---------- 循环菜单 ---------- */

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.pick-chip svg { width: 13px; height: 13px; opacity: .55; }

.counter {
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.counter b { color: var(--green-dark); font-weight: 650; }

/* ---------- 模板库 ---------- */

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--line);
  transition: all .15s ease;
}
.filter-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.dish-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.dish-item:first-child { border-top: none; }
.dish-item:active { background: #FAFAFB; }

.dish-info { flex: 1; min-width: 0; }
.dish-name {
  font-size: 15px;
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dish-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dish-sub i { font-style: normal; }

.tag {
  font-size: 10.5px;
  color: var(--text-2);
  background: #F4F4F6;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 400;
}

.add-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  background: #fff;
  transition: all .15s ease;
}
.add-btn svg { width: 15px; height: 15px; }
.add-btn.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ---------- 购物清单 ---------- */

.progress-card { padding: 16px; }

.progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.progress-num { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-num em { font-size: 14px; font-style: normal; color: var(--text-3); font-weight: 400; }
.progress-label { font-size: 12.5px; color: var(--text-2); }

.bar {
  height: 6px;
  border-radius: 100px;
  background: #F0F0F3;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: var(--green);
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
}

/* 采购范围切换 */
.scope-bar {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.scope-chip {
  flex: 1;
  height: 32px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text-2);
  background: #F6F6F8;
  transition: all .15s ease;
}
.scope-chip:active { background: #ECECEF; }
.scope-chip.active {
  background: var(--green);
  color: #fff;
  font-weight: 550;
}

.scope-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.scope-who {
  flex: none;
  font-size: 11.5px;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 100px;
  padding: 3px 9px;
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px 16px 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.cat-head .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
}
.cat-head .cnt { margin-left: auto; font-weight: 400; color: var(--text-3); font-size: 11.5px; }

.buy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  width: 100%;
  text-align: left;
}

.checkbox {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid #D8D8DD;
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .16s ease;
}
.checkbox svg { width: 12px; height: 12px; }
.buy-row.checked .checkbox {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.buy-name { font-size: 14.5px; flex: 1; min-width: 0; }
.buy-name .who {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 6px;
}
.buy-row.checked .buy-name { color: var(--text-3); text-decoration: line-through; }
.buy-qty {
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.buy-row.checked .buy-qty { color: var(--text-3); }

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.9;
}
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; color: #D8D8DD; }

/* ---------- 家庭 / 设置 ---------- */

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.member-row:first-child { border-top: none; }
.member-row.active { background: #FAFEFB; }

.avatar {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #F4F4F6;
  font-size: 17px;
}
.avatar svg { width: 17px; height: 17px; }
.member-row.active .avatar { background: var(--green-soft); }

.member-name { flex: 1; font-size: 14.5px; }
.member-name small { display: block; color: var(--text-3); font-size: 11.5px; }

.radio {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid #D8D8DD;
  display: grid; place-items: center;
  color: transparent;
}
.member-row.active .radio { border-color: var(--green); background: var(--green); color: #fff; }
.radio svg { width: 11px; height: 11px; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.setting-row:first-child { border-top: none; }
.setting-label { flex: 1; font-size: 14.5px; }
.setting-label small { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 1px; }
.setting-value { font-size: 13.5px; color: var(--text-2); }

.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: #F5F5F7;
  display: grid; place-items: center;
  color: var(--text-2);
}
.stepper button:active { background: #ECECEF; }
.stepper span {
  min-width: 26px;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.switch {
  flex: none;
  width: 44px; height: 26px;
  border-radius: 100px;
  background: #E5E5E9;
  position: relative;
  transition: background .2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }

.danger { color: #FF3B30; }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  transition: color .15s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--green); }

.tab .dot-badge {
  position: absolute;
  top: 9px;
  left: calc(50% + 7px);
  min-width: 16px;
  height: 16px;
  border-radius: 100px;
  background: var(--green);
  color: #fff;
  font-size: 9.5px;
  line-height: 16px;
  padding: 0 4px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 弹层 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  animation: fade .18s ease;
}
.modal[hidden] { display: none; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp .24s cubic-bezier(.32, .72, 0, 1);
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
  flex: none;
}
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 650; flex: 1; }
.sheet-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); font-weight: 400; }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
  flex: 1;
}

.sheet-foot {
  flex: none;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #FAFAFB;
  outline: none;
  font-size: 14px;
}
.search-input:focus { border-color: var(--green); background: #fff; }

.textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #FAFAFB;
  outline: none;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-2);
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  width: 100%;
  text-align: left;
  border-top: 1px solid var(--line);
}
.opt-row:first-child { border-top: none; }
.opt-row:active { background: #FAFAFB; }
.opt-row .txt { flex: 1; }
.opt-row .txt b { display: block; font-size: 14.5px; font-weight: 500; }
.opt-row .txt small { color: var(--text-3); font-size: 11.5px; }

/* 调整某一餐 */
.me-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
}

.me-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  text-align: left;
  border-top: 1px solid var(--line);
}
.me-row:first-of-type .me-main { border-top: none; }
.me-main:active { opacity: .65; }

.me-name { font-size: 15px; font-weight: 550; }
.me-meta {
  margin-left: auto;
  flex: none;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.me-x {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #C6C6CB;
}
.me-x:active { background: #FDF0EF; color: #FF3B30; }
.me-x:disabled { opacity: .25; }
.me-x svg { width: 13px; height: 13px; }

.me-em {
  margin: 0 20px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #8A6A20;
  font-size: 12.5px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 28px);
  transform: translate(-50%, 12px);
  background: rgba(26, 26, 28, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 60;
  max-width: 84vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 辅助文本 ---------- */

.hint-line {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  margin: 12px 0 0;
}

.foot-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.8;
  margin: 14px 0 0;
}

/* 隐私政策 / 用户协议入口：位置固定但很轻，不抢设置项的风头 */
.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
}
.legal-links a {
  color: var(--text-2);
  text-decoration: none;
}
.legal-links a:active { color: var(--green-dark); }

.inline-tip {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #FFFDF7;
  display: flex;
  align-items: center;
  gap: 12px;
}

.inline-tip span {
  flex: 1;
  font-size: 12.5px;
  color: #8A6A20;
}

.inline-tip-card {
  margin-top: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFDF7;
  border-color: #F6ECD8;
}

/* ---------- 账号 / 家庭 ---------- */

.account-card { padding: 16px; }

.acct-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acct-ic {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: #F2F2F5;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.acct-ic svg { width: 19px; height: 19px; }
.acct-ic.on { background: var(--green-soft); color: var(--green-dark); }

.acct-text { flex: 1; min-width: 0; }
.acct-text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-text small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.acct-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.acct-actions .btn { flex: 1; }

.invite-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
  background: #FAFAFB;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.invite-label {
  font-size: 12px;
  color: var(--text-2);
  flex: 0 0 auto;
}

.invite-code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: var(--text);
  user-select: all;
}

/* ---------- 表单 ---------- */

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #F2F2F5;
  border-radius: 11px;
  margin: 0 0 16px;
}
.auth-tabs button {
  flex: 1;
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.auth-tabs button.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form { display: block; }
.form label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 14px;
}
.form label .search-input {
  display: block;
  width: 100%;
  margin-top: 7px;
  font-size: 15px;
}

.invite-input {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px !important;
  text-align: center;
}

.form-err {
  min-height: 18px;
  margin: 0 0 4px;
  font-size: 12.5px;
  color: #E5484D;
  line-height: 1.5;
}
.form-err:empty { min-height: 0; }

/* ---------- 成员管理 ---------- */

.member-row-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
}

.mr-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.member-row-edit .avatar.off {
  background: #F2F2F5;
  color: var(--text-3);
  filter: grayscale(1);
  opacity: .7;
}

.cook-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px 0 6px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-3);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cook-toggle .ct-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
}
.cook-toggle .ct-dot svg { width: 9px; height: 9px; }
.cook-toggle.on {
  background: var(--green-soft);
  border-color: #C9EED8;
  color: var(--green-dark);
}
.cook-toggle.on .ct-dot {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.member-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 44px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.member-add svg { width: 15px; height: 15px; }
.member-add:active { background: #FAFEFB; }

.invite-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: #FAFAFB;
}
.is-label { font-size: 11.5px; color: var(--text-2); flex: none; }
.is-code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  user-select: all;
}

/* ---------- 头像选择 / 通用表单字段 ---------- */

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--text-2);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.emoji-opt {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #FAFAFB;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.emoji-opt.on {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 1px var(--green) inset;
}

.row-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 42px;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid #F6D7D8;
  background: #FFF7F7;
  color: #D93A3F;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
}
.row-danger svg { width: 15px; height: 15px; }
.row-danger:active { background: #FFEFEF; }

.btn-danger { background: #E5484D; color: #fff; }
.btn-danger:active { background: #D93A3F; }

/* 确认弹层：内容少，不让它撑满 */
.confirm-sheet .sheet-head { padding-bottom: 6px; }
.confirm-sheet .sheet-foot { border-top: 0; padding-top: 6px; }

/* ---------- 加入家庭 / 选择身份 ---------- */

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.pick-row:first-child { border-top: 0; }
.pick-row.on { background: #FAFEFB; }
.pick-row .avatar { flex: none; }
.pick-row .avatar svg { width: 17px; height: 17px; }
.pick-row .member-name { flex: 1; min-width: 0; }

/* ---------- 二维码 ---------- */

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 16px 0 10px;
}
.qr-svg {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.qr-fallback {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 30px 0;
}
.qr-name {
  text-align: center;
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 自定义菜谱 ---------- */

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 13px;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
}

/* 注销账号入口：要能找到，但不该显眼到被误点 */
.link-btn.danger {
  color: var(--text-3);
  font-size: 12px;
}
.link-btn.danger:active { color: #E5484D; }

/* 账号卡片底部：左边邮箱，右边注销 */
.acct-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.acct-foot .mono {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 注销确认里那段后果说明 */
.danger-box {
  background: #FFF6F6;
  border: 1px solid #FFE0E1;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 4px 0 16px;
}
.danger-box p {
  margin: 0 0 6px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #8C3A3D;
}
.danger-box p:last-child { margin-bottom: 0; }

.tag-mine {
  color: #B4761F;
  background: #FFF4E0;
}

.dish-item-mine { padding: 0; }
.dish-open {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 13px 4px 13px 16px;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.dish-item-mine .add-btn { margin-right: 14px; }

.tag-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.tag-chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.tag-chip.on {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 500;
}

.ing-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: #FAFAFB;
}
.ing-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ing-name {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.ing-x {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #F2F2F5;
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ing-x svg { width: 12px; height: 12px; }

.ing-line2 {
  display: grid;
  grid-template-columns: 74px 74px 1fr;
  gap: 8px;
  margin-top: 8px;
}
.ing-qty, .ing-unit, .ing-cat {
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
}
.ing-qty { text-align: center; }
.ing-unit { text-align: center; }
.ing-cat { appearance: none; -webkit-appearance: none; }

.ing-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.ing-add svg { width: 14px; height: 14px; }

/* ---------- 桌面端微调 ---------- */

@media (min-width: 600px) {
  body { background: #EFEFF2; }
  .phone {
    box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(0, 0, 0, 0.06);
    min-height: 100vh;
  }
}

/* ---------------- 邮箱验证 ---------------- */

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 验证码一行：输入框 + 发送按钮 */
.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.form .code-row .search-input {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
}
.code-send {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--green-dark);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}
.code-send:disabled {
  color: var(--text-3);
  background: #F5F5F6;
  cursor: default;
}

/* 验证码输入：等宽、大字距，方便一眼核对 */
.code-input {
  letter-spacing: 8px;
  font-size: 20px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-align: center;
}
.form .code-row .code-input {
  letter-spacing: 5px;
  font-size: 17px;
}
.code-input::placeholder {
  letter-spacing: 0;
  font-family: inherit;
  font-size: 14px;
}

/* 验证码下面那行提示：有内容才占位 */
#codeHint { margin: 8px 0 12px; }
#codeHint:empty { display: none; }
#codeHint b { color: var(--green-dark); font-weight: 600; }
