/* ===== 今天吃什么 · 可爱风样式 ===== */
:root {
  --bg: #fff7f2;
  --ink: #55403c;
  --ink-soft: #9c8a84;
  --pink: #ff8296;
  --pink-deep: #f4637c;
  --pink-soft: #ffe6ec;
  --mint: #7ed0ac;
  --mint-soft: #e6f8f0;
  --yellow: #ffcf6b;
  --yellow-soft: #fff3d9;
  --sky: #8ec8f0;
  --sky-soft: #e6f3fd;
  --paper: #fffdfb;
  --line: #f5e3dc;
  --radius: 22px;
  --shadow: 0 6px 20px rgba(218, 152, 138, 0.13);
  --shadow-lg: 0 12px 34px rgba(214, 141, 128, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, #ffe9ef 0, transparent 42%),
    radial-gradient(circle at 94% 10%, #e8f7f0 0, transparent 38%),
    radial-gradient(circle at 50% 100%, #fff4e0 0, transparent 45%);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.65 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

main { max-width: 720px; margin: auto; padding: 22px 16px 130px; }

/* ---------- 顶部标题 ---------- */
.hero { padding: 10px 6px 24px; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--pink);
  background: var(--pink-soft);
  border-radius: 20px;
  padding: 5px 12px;
  font-weight: 700;
}
.hero h1 {
  font-size: 32px;
  line-height: 1.25;
  margin: 14px 0 6px;
  color: var(--ink);
  letter-spacing: 1px;
}
.hero h1::before { content: "🍚 "; }
.hero p { color: var(--ink-soft); margin: 0; font-size: 13.5px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  color: var(--pink-deep);
  border: 2px solid var(--pink-soft);
  border-radius: 22px;
  padding: 6px 14px 6px 7px;
  font-size: 13px;
  margin-top: 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.pill .pill-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-soft);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.pill .pill-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hidden { display: none !important; }

/* ---------- 卡片 ---------- */
.panel {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

h2, h3, h4 { margin: 0 0 6px; letter-spacing: .5px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
h4 { font-size: 14px; color: var(--pink-deep); margin-top: 16px; }

.muted { color: var(--ink-soft); font-size: 12.5px; margin: 5px 0 16px; }
.muted-inline { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

/* ---------- 提示条 ---------- */
/* 提示条固定在屏幕顶部：出错时不用回头找，也不会被滚动位置藏起来。 */
.notice {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: var(--yellow-soft);
  color: #b5801f;
  padding: calc(13px + env(safe-area-inset-top)) 18px 13px;
  border-radius: 0 0 20px 20px;
  margin: 0;
  font-size: 13px;
  border: 2px dashed #ffe0a3;
  border-top: 0;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 22px rgba(218, 152, 138, .22);
  animation: notice-in .22s ease;
}
.notice.ok { background: var(--mint-soft); color: #3f9270; border-color: #b6e8d2; }
@keyframes notice-in { from { transform: translateY(-100%); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- 表单 ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; margin: 18px 0 7px; color: #6d5651; }
input, textarea, select {
  width: 100%;
  border: 2px solid var(--line);
  background: #fffaf7;
  border-radius: 15px;
  padding: 12px 14px;
  margin-top: 7px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--pink);
  background: white;
  box-shadow: 0 0 0 4px var(--pink-soft);
}
textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #cbbbb5; }

/* ---------- 按钮 ---------- */
.primary, .secondary {
  border-radius: 15px;
  padding: 12px 20px;
  font-weight: 700;
  letter-spacing: .5px;
}
.primary {
  background: linear-gradient(135deg, #ff9aab, var(--pink-deep));
  color: white;
  box-shadow: 0 5px 14px rgba(244, 99, 124, .32);
}
.secondary {
  background: var(--mint-soft);
  color: #4a9a78;
}
.danger {
  background: #fff0f0;
  color: #d9534f;
  border: 2px solid #ffdede;
  border-radius: 15px;
  padding: 11px 18px;
  font-weight: 700;
}
.link {
  display: block;
  background: transparent;
  color: var(--pink);
  margin: 15px auto 0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.full { width: 100%; margin-top: 14px; }

button { -webkit-tap-highlight-color: transparent; transition: transform .13s ease, filter .13s ease; }
button:active { transform: scale(.955); filter: brightness(.97); }
button:disabled { opacity: .55; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex;
  background: white;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 5px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.tabs button {
  flex: 1;
  padding: 11px 6px;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
}
.tabs button.active {
  background: linear-gradient(135deg, #ff9aab, var(--pink-deep));
  color: white;
  box-shadow: 0 4px 12px rgba(244, 99, 124, .28);
}

/* ---------- 区块标题 ---------- */
.heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.heading .secondary, .heading .primary { padding: 9px 15px; font-size: 13px; }
.heading-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 搜索与筛选 ---------- */
.search { background: white; margin: 0 0 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: 0 0 auto;
  background: white;
  color: var(--ink-soft);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}
.chips button.active {
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-color: #ffc7d4;
}

/* ---------- 菜品卡片 ---------- */
.dish-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dish {
  background: white;
  border: 2px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
  box-shadow: var(--shadow);
}
.dish:active { transform: scale(.985); }
.cover {
  height: 122px;
  background: var(--pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c98b9b;
  cursor: pointer;
}
.cover.meat { background: #ffe9e0; color: #d78b6f; }
.cover.soup { background: var(--yellow-soft); color: #c9a04c; }
.cover.main { background: var(--sky-soft); color: #7aa9cd; }
.plate {
  border: 6px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  width: 74px; height: 74px;
  display: grid; place-items: center;
  font-size: 12.5px;
  font-weight: 700;
}
.dish img { width: 100%; height: 100%; object-fit: cover; }
.dish-body { padding: 12px; }
.dish-name {
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.dish-desc {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 3px 0 9px;
}
.dish-foot { display: flex; justify-content: space-between; align-items: center; }
.tag {
  font-size: 10.5px;
  color: var(--pink-deep);
  background: var(--pink-soft);
  padding: 3px 9px;
  border-radius: 8px;
  font-weight: 700;
}
.add {
  background: linear-gradient(135deg, #ff9aab, var(--pink-deep));
  color: white;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(244, 99, 124, .3);
}

/* ---------- 厨房 / 订单 ---------- */
.date { background: white; margin-bottom: 13px; }
.summary { background: linear-gradient(160deg, var(--mint-soft), #f4fdf9); border-color: #cdeee0; }
.summary-row, .order-dish {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #dcf0e6;
  padding: 10px 0;
}
.summary-row:last-child, .order-dish:last-child { border-bottom: 0; }
.quantity { color: #3f9270; font-weight: 800; }
.order-title { margin: 22px 0 11px; }
.order { margin-bottom: 12px; }
.order-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.status {
  color: #b5801f;
  background: var(--yellow-soft);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.status.done { color: #3f9270; background: var(--mint-soft); }
.order-dish { font-size: 14px; }
.note {
  background: var(--yellow-soft);
  padding: 9px 12px;
  border-radius: 12px;
  color: #a8862f;
  font-size: 12.5px;
  margin-top: 9px;
}
.order-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.order-actions button { padding: 8px 13px; font-size: 12px; }

/* ---------- 家庭页 ---------- */
.invite {
  text-align: center;
  font-size: 27px;
  letter-spacing: 3px;
  color: var(--pink-deep);
  font-weight: 800;
  margin: 16px 0;
  background: var(--pink-soft);
  border-radius: 16px;
  padding: 12px;
  font-family: ui-monospace, Menlo, monospace;
}
.invite::before { content: "🎟️"; display: block; font-size: 20px; letter-spacing: 0; margin-bottom: 2px; }
.actions { display: flex; gap: 10px; }
.actions > * { flex: 1; }

/* ---------- 个人资料卡 ---------- */
.profile-head { display: flex; align-items: center; gap: 15px; }
.avatar-lg {
  width: 68px; height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-soft);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
  border: 3px solid white;
  box-shadow: 0 4px 14px rgba(244, 99, 124, .2);
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { min-width: 0; }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-sign { color: var(--ink-soft); font-size: 12.5px; margin-top: 3px; word-break: break-word; }
.avatar-edit { display: flex; gap: 8px; margin-top: 15px; }
.avatar-edit > * { flex: 1; }
.avatar-edit button, .avatar-edit label { margin: 0; }
.avatar-edit label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 15px;
  background: var(--sky-soft);
  color: #4a86b8;
  cursor: pointer;
}
.avatar-edit input[type=file] { display: none; }

/* ---------- 成员列表 ---------- */
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
}
.member:last-child { border-bottom: 0; }
.member .info { min-width: 0; flex: 1; }
.member .name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.member .sign {
  color: var(--ink-soft);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pink-soft);
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: var(--shadow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.crown { font-size: 12px; }
.me-badge {
  font-size: 10px;
  background: var(--mint-soft);
  color: #3f9270;
  padding: 2px 7px;
  border-radius: 7px;
  font-weight: 700;
}
.role { color: var(--ink-soft); font-size: 11.5px; }
.member-remove {
  background: #fff0f0;
  color: #d9534f;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- 点菜篮 ---------- */
.cart-bar {
  position: fixed;
  z-index: 6;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--line);
  padding: 12px max(16px, calc((100vw - 720px) / 2 + 16px)) calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -6px 22px rgba(218, 152, 138, .12);
}
.cart-bar small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.cart-bar b { font-size: 15px; }
.cart-bar > button { padding: 12px 26px; flex-shrink: 0; }

/* ---------- 弹窗 ---------- */
dialog {
  border: 0;
  border-radius: 26px;
  padding: 22px;
  width: min(92vw, 500px);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(85, 64, 60, .35); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dialog-head button {
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-weight: 600;
}
.stepper { display: flex; align-items: center; gap: 11px; }
.stepper button {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 17px;
  font-weight: 700;
}
.stepper b { min-width: 18px; text-align: center; }

/* ---------- 照片 ---------- */
.photo-preview, .detail-photo {
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #f7efe9;
}
.photo-preview img, .detail-photo img { width: 100%; display: block; object-fit: cover; max-height: 250px; }
.detail-photo { margin: 0 0 14px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--ink-soft); padding: 34px 12px; font-size: 13.5px; }
.empty::before { content: "🍽️"; display: block; font-size: 30px; margin-bottom: 8px; }

/* ---------- 桌面添加提示 ---------- */
.install-tip { background: linear-gradient(160deg, var(--sky-soft), #f5fbff); border-color: #cfe7f7; }
.install-tip .muted { margin-bottom: 0; }

/* ---------- 移动端适配 ---------- */
html { -webkit-text-size-adjust: 100%; }
main { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }

/* iOS 在输入框字号小于 16px 时会自动放大整页，这里统一放大到 16px。 */
@media (max-width: 600px) {
  input, textarea, select { font-size: 16px; }
  .hero h1 { font-size: 27px; }
  .avatar-lg { width: 58px; height: 58px; font-size: 22px; }
}

@media (min-width: 620px) {
  main { padding-top: 40px; }
  .dish-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 尊重系统“减少动效”设置 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
