:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #7a8291;
  --accent: #2f9e44;
  --danger: #e03131;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 16px; }
.wrap.wide .card { max-width: 720px; }

.topbar {
  width: 100%; max-width: 720px; display: flex; align-items: center; gap: 10px;
  padding: 6px 4px 14px; color: var(--muted); font-size: 13px;
}
.brand { cursor: pointer; font-weight: 700; color: var(--text); font-size: 15px; }
.spacer { flex: 1; }
.who em, .bal { font-style: normal; }

.card {
  width: 100%; max-width: 420px; background: var(--card); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(31, 36, 48, 0.08); padding: 24px;
}
.card.center { text-align: center; color: var(--muted); }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 4px 0 8px; }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--muted); font-weight: 600; }
h3.toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
h3.toggle:hover { color: var(--text); }
h3.toggle .caret { color: var(--accent); font-size: 12px; width: 12px; display: inline-block; }
.hello { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 14px; margin: 8px 0; width: 100%; max-width: 720px; }
.notice { color: var(--accent); font-size: 14px; margin: 8px 0; width: 100%; max-width: 720px; }
.back { margin: 0 0 6px; }
.back a { color: var(--muted); cursor: pointer; font-size: 13px; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #eef0f3;
}
.row:last-child { border-bottom: none; }
.row.link { cursor: pointer; }
.row.link:hover { color: var(--accent); }
.tag { background: #e6f4ea; color: var(--accent); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.code { letter-spacing: 2px; color: var(--text); }

.inline { display: flex; gap: 8px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form.inset { margin: 8px 0 4px; padding: 12px; background: #f8f9fb; border-radius: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

input, select {
  padding: 10px 12px; border: 1px solid #dfe3e8; border-radius: 9px;
  font-size: 14px; background: #fff; color: var(--text); width: 100%;
}
input[type="number"] { width: 72px; }

.btn {
  appearance: none; border: none; padding: 10px 16px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn.ghost { background: #eef0f3; color: var(--text); }
.btn.tiny { padding: 6px 12px; font-size: 13px; }
.inline .btn { width: auto; white-space: nowrap; }

.actions { display: flex; gap: 8px; margin: 12px 0; }
.menu .row { align-items: center; }
.dish { flex: 1; }
.dish em { color: var(--muted); font-style: normal; font-size: 13px; margin-left: 6px; }
.qtybox { display: flex; align-items: center; gap: 6px; }

/* 通知 */
.dim { opacity: 0.55; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }

/* 钱包 */
.neg { color: var(--danger); font-weight: 600; }
.neg em { font-style: normal; font-size: 12px; }
.accounts { display: flex; flex-direction: column; gap: 10px; background: #f8f9fb; border-radius: 10px; padding: 12px; }
.acct { font-size: 13px; line-height: 1.6; }
.qr { max-width: 180px; border-radius: 8px; display: block; margin-top: 6px; }
input[type="file"] { padding: 8px; }

.widget { display: flex; justify-content: center; margin: 8px 0 4px; }
.devbox { margin: 12px 0 0; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 18px; }

/* 提前点餐 */
.adv-matrix-wrap { overflow-x: auto; margin: 10px 0; }
.adv-matrix { border-collapse: collapse; min-width: 560px; width: 100%; }
.adv-matrix th, .adv-matrix td { padding: 7px 6px; border-bottom: 1px solid #eef0f3; text-align: center; font-size: 13px; }
.adv-matrix th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.adv-matrix th small { font-weight: 400; }
.adv-matrix .adv-dish { text-align: left; min-width: 160px; }
.adv-matrix .adv-dish em { color: var(--muted); font-style: normal; font-size: 12px; margin-left: 4px; }
.adv-matrix input[type="number"] { width: 54px; padding: 7px 6px; text-align: center; }
.adv-matrix input:disabled { background: #f2f3f5; color: #b8bdc6; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }
.check input[type="checkbox"] { width: auto; }
.adv-plan { padding: 6px 0 10px; border-bottom: 1px solid #eef0f3; }
.adv-plan:last-child { border-bottom: none; }
.adv-plan .list { margin-top: 2px; }
.adv-day-row { padding: 6px 0 6px 10px; font-size: 13px; }
.adv-day-row em { display: block; font-style: normal; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 点餐等操作的即时提示：固定在底部，无论页面滚到哪里都看得到 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(31, 36, 48, 0.25); font-size: 14px; font-weight: 600;
  z-index: 9999; max-width: 90vw; text-align: center;
}
.toast.err { background: var(--danger); }
