:root {
  --accent: #004D98;
  --accent-dark: #003a73;
  --accent-soft: #e6f0fa;
  --accent-orange: #F36C21;
  --bg: #f6f9fd;
  --card: #ffffff;
  --ink: #2b3440;
  --muted: #7c8798;
  --line: #e5ebf2;
  --green: #3aa76d;
  --green-soft: #e8f6ee;
  --danger: #e05252;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(0, 77, 152, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #e6f0fa 0%, #f6fafe 45%, #fdeee0 100%) fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(72px + env(safe-area-inset-bottom));
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}
input, select, textarea {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

/* ---------- 通用 ---------- */
.hidden { display: none !important; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.muted { color: var(--muted); font-size: 13px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  border: 1.5px solid var(--line);
  transition: transform .06s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #004D98, #F36C21); border-color: transparent; color: #fff; }
.btn.primary:active { background: linear-gradient(135deg, #003a73, #e05e16); }
.btn.block { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { color: var(--danger); border-color: #f3caca; }
.btn.ghost { border-color: transparent; background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  background: var(--bg);
}
.topbar .back {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 18px; margin: 0; flex: 1; }
.topbar .spacer { width: 40px; }

/* ---------- 登录 ---------- */
.login { padding-top: 60px; text-align: center; }
.login-hero { font-size: 52px; }
.login-title { font-size: 26px; font-weight: 800; margin: 12px 0 4px; }
.login-sub { color: var(--muted); margin: 0 0 28px; }
.member-list { display: grid; gap: 12px; text-align: left; }
.member-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 17px;
  font-weight: 600;
}
.member-item:active { transform: scale(.98); }
.member-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.login-add { margin-top: 20px; text-align: left; }
.login-add .row { display: flex; gap: 8px; }
.login-add input {
  flex: 1; padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff;
}

/* ---------- 今日食光卡片 ---------- */
.today-card {
  background: linear-gradient(135deg, #004D98, #F36C21);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 77, 152, .25);
  margin-bottom: 16px;
}
.today-card .date { font-size: 13px; opacity: .92; }
.today-card .quote { font-size: 19px; font-weight: 700; margin: 8px 0 4px; }
.today-card .seasonal { font-size: 13px; opacity: .95; }

/* ---------- 首页一餐卡片 ---------- */
.meal-card { cursor: pointer; }
.meal-card:active { transform: scale(.99); }
.meal-card .top { display: flex; align-items: center; gap: 8px; }
.meal-card .title { font-size: 17px; font-weight: 700; flex: 1; }
.meal-card .meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.status-pill {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.status-pill.decided { background: var(--green-soft); color: var(--green); }
.status-pill.done { background: #eee; color: var(--muted); }

.section-title { font-size: 14px; color: var(--muted); margin: 4px 2px 10px; font-weight: 600; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 14px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 福州时令菜 ---------- */
.seasonal-line { display: flex; align-items: baseline; white-space: nowrap; overflow-x: auto; font-size: 15px; line-height: 1.7; }
.seasonal-line + .seasonal-line { margin-top: 2px; }
.seasonal-label { flex-shrink: 0; font-weight: 600; color: var(--ink); margin-right: 6px; }
.seasonal-items { color: var(--ink); }
.seasonal-line::-webkit-scrollbar { display: none; }

/* ---------- 照片轮播 ---------- */
.photo-card { padding: 8px; }
.photo-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; display: block; }

/* ---------- 照片管理 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-cell { position: relative; }
.photo-cell img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; display: block; }
.photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 菜品列表 ---------- */
.item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: none; }
.item .dish-name { font-weight: 600; }
.item .dish-note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .tags { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.item .del { margin-left: auto; color: var(--danger); font-size: 20px; padding: 0 4px; }

/* ---------- 买菜清单 ---------- */
.shop-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: none; }
.shop-item .check {
  width: 24px; height: 24px; min-width: 24px;
  border-radius: 8px;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: transparent;
}
.shop-item.bought .check { background: var(--green); border-color: var(--green); color: #fff; }
.shop-item.bought .name { text-decoration: line-through; color: var(--muted); }
.shop-item .name { flex: 1; }
.shop-item .qty { color: var(--muted); font-size: 13px; }
.badge-have {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}
.role-badge {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 20px;
  background: #f3ede6;
  color: #8a7d6f;
  margin-left: 6px;
  white-space: nowrap;
}

/* ---------- 底部操作栏 ---------- */
.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(250, 246, 240, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 100px;
  transform: translateX(-50%);
  background: rgba(61,51,43,.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  z-index: 200;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
