:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #172033;
  --muted: #6b7686;
  --line: #e5e9f0;
  --brand: #ff6a00;
  --brand-ink: #ffffff;
  --ok: #0f9d58;
  --warn: #e8a13a;
  --danger: #d93025;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(23, 32, 51, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.hidden { display: none !important; }

#demo-bar {
  background: #172033;
  color: #ffd9b0;
  text-align: center;
  font-size: 12px;
  padding: 5px 10px;
  letter-spacing: 0.3px;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 16px; }
.spacer { flex: 1; }
.who { font-size: 13px; color: var(--muted); }
.icon-btn {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 5px 9px;
  font-size: 15px;
  cursor: pointer;
}
.dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.link-btn {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
}

.nav-slot { display: flex; gap: 6px; overflow-x: auto; }
.nav-slot .nav-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
  white-space: nowrap;
  font-size: 14px;
}
.nav-slot .nav-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
  padding-bottom: 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.card h2 { margin: 0 0 10px; font-size: 16px; }
.card h3 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); }

.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .grid-3 { grid-template-columns: 1fr; } }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
}
.btn {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  width: 100%;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-mini { padding: 5px 10px; font-size: 13px; width: auto; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.field { margin-bottom: 10px; }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef1f6;
  color: var(--muted);
}
.chip.ok { background: #e6f4ea; color: var(--ok); }
.chip.warn { background: #fdf3e3; color: var(--warn); }
.chip.danger { background: #fdecea; color: var(--danger); }
.chip.brand { background: #fff1e6; color: var(--brand); }

.dish {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.dish:last-child { border-bottom: none; }
.dish .name { font-weight: 600; }
.price { color: var(--brand); font-weight: 700; }

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.qty button { border: none; background: #fff; padding: 6px 10px; font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.tabs button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 12px;
  white-space: nowrap;
  font-size: 14px;
}
.tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }

.stat { text-align: center; padding: 8px 4px; }
.stat .num { font-size: 20px; font-weight: 700; }
.stat .lbl { font-size: 12px; color: var(--muted); }
.stat.danger .num { color: var(--danger); }
.stat.ok .num { color: var(--ok); }

.code-box {
  text-align: center;
  background: #172033;
  color: #fff;
  border-radius: var(--radius);
  padding: 12px;
}
.code-box .code { font-size: 28px; letter-spacing: 4px; font-weight: 700; }
.code-box .q { color: #ffd9b0; font-size: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #172033;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 90vw;
}
.toast.err { background: var(--danger); }

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

.login-wrap { max-width: 420px; margin: 24px auto; }
