/* ============ 食堂报餐 · 员工端样式 ============ */
:root {
  --brand: #2f6f4e;
  --brand-weak: #e8f3ec;
  --ink: #1f2328;
  --ink-2: #5b6167;
  --ink-3: #9aa0a6;
  --line: #e3e6e9;
  --bg: #f4f5f6;
  --card: #fff;
  --warn: #b06a00;
  --danger: #c0392b;
  --radius: 14px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px 40px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 6px;
}
.topbar .title { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.topbar a, .topbar .link {
  font-size: 15px;
  color: var(--brand);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.topbar a:active { background: var(--brand-weak); }

/* ---------- 日期导航 ---------- */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 10px 0 18px;
  user-select: none;
}
.date-nav button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.date-nav button:disabled { opacity: .3; cursor: default; }
.date-nav button:active:not(:disabled) { background: var(--brand-weak); }
#dateLabel { font-size: 17px; font-weight: 600; min-width: 158px; text-align: center; }
#dateLabel small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }

/* ---------- 餐次卡片 ---------- */
.meal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  border: 1.5px solid transparent;
  transition: border-color .15s;
}
.meal-card.hl { border-color: var(--brand); }
.meal-card.closed,
.meal-card.paused { background: #eff0f1; box-shadow: none; }
.meal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.meal-name { font-size: 18px; font-weight: 600; }
.meal-card.closed .meal-name,
.meal-card.paused .meal-name { color: var(--ink-3); }
.meal-meta { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.meal-meta.warn { color: var(--warn); }
.meal-mode { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* 报名按钮：手机上一按到底，高度给足 */
.btn-eat {
  width: 100%;
  height: 58px;
  margin-top: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-size: 20px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, transform .06s;
}
.btn-eat:active:not(:disabled) { transform: scale(.985); }
.btn-eat.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-eat.off {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-3);
}
.btn-eat:disabled {
  background: #e6e8ea;
  border-color: #e6e8ea;
  color: #a8aeb3;
  cursor: default;
}
.meal-hint {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 8px;
  min-height: 18px;
}

/* ---------- 底部操作 ---------- */
.bottom-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn-ghost {
  flex: 1;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
.btn-ghost:active { background: #f0f1f2; }
.btn-primary {
  width: 100%;
  height: 56px;
  border-radius: 12px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary:active { background: #275e42; }
.btn-primary:disabled { background: #b9c6bf; }

/* ---------- 绑定页 ---------- */
.bind-hero { text-align: center; padding: 34px 0 16px; }
.bind-hero h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: 1px; }
.bind-hero p { margin: 0; color: var(--ink-2); font-size: 15px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--brand); }
.field .err { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 18px; }
.foot-note {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  margin-top: 22px;
  line-height: 1.7;
}

/* ---------- 日期头 ---------- */
.date-head { text-align: center; margin: 12px 0 16px; }
.date-head #dateLabel { font-size: 20px; font-weight: 600; }
.date-head #dateLabel small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 2px;
}
.rollover { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 停餐横幅 ---------- */
.pause-banner {
  background: #fdf3e2;
  color: var(--warn);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
}

/* ---------- 菜谱 ---------- */
.meal-menu {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.meal-card.closed .meal-menu,
.meal-card.paused .meal-menu { color: var(--ink-3); }
.meal-menu.empty { color: var(--ink-3); font-style: normal; }

/* ---------- 报名 / 撤单 两个小按钮 ---------- */
.meal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-mini {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.btn-mini:active:not(:disabled) { transform: scale(.985); }
.btn-mini.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn-mini.selected-cancel {
  background: #fff;
  border-color: var(--ink-3);
  color: var(--ink-2);
  font-weight: 600;
}
.btn-mini:disabled {
  background: #f2f3f4;
  border-color: #eceef0;
  color: #b9bfc4;
  cursor: default;
}

/* ---------- 提交栏 ---------- */
.submit-bar { margin-top: 20px; }
.unsaved {
  text-align: center;
  font-size: 13px;
  color: var(--warn);
  min-height: 20px;
  margin-top: 8px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translate(-50%, 10px);
  background: rgba(24, 28, 31, .88);
  color: #fff;
  padding: 11px 20px;
  border-radius: 22px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 999;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 骨架 / 空状态 ---------- */
.skeleton {
  background: linear-gradient(90deg, #eceeef 25%, #f5f6f7 37%, #eceeef 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius);
  height: 116px;
  margin-bottom: 12px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 15px; }
.loading { text-align: center; color: var(--ink-3); padding: 30px 0; font-size: 15px; }
