:root {
  --brand: #9c2b1f;
  --brand-2: #c0392b;
  --brand-dark: #7a2016;
  --gold: #b8860b;
  --cream: #faf3ec;
  --card: #ffffff;
  --text: #2b2420;
  --muted: #8a7f76;
  --border: #ecdfd4;
  --ok: #1c8a5b;
  --ok-bg: #e7f6ee;
  --warn: #b8720a;
  --warn-bg: #fff2dd;
  --danger: #c23b2f;
  --danger-bg: #fbe9e6;
  --light-fill: #fbf0ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

/* ---------------- 客人端（手机优先，大字体大按钮） ---------------- */

.phone-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  padding-bottom: 40px;
}

.brand-header {
  background: linear-gradient(160deg, var(--brand-dark), var(--brand-2));
  color: #fff;
  text-align: center;
  padding: 30px 20px 26px;
  border-radius: 0 0 28px 28px;
}
.brand-header .shop-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 4px;
}
.brand-header .shop-sub {
  margin-top: 6px;
  font-size: 15px;
  color: #f3d9ce;
  letter-spacing: 2px;
}

.big-card {
  background: var(--card);
  border-radius: 20px;
  padding: 22px 20px;
  margin: -18px 16px 16px;
  box-shadow: 0 6px 20px rgba(120, 40, 20, 0.08);
  position: relative;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.stat-box {
  background: var(--light-fill);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}
.stat-box .num {
  font-size: 34px;
  font-weight: 800;
  color: var(--brand-2);
  line-height: 1.1;
}
.stat-box .lbl {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.now-serving {
  text-align: center;
  margin: 18px 0 6px;
}
.now-serving .lbl { font-size: 15px; color: var(--muted); }
.now-serving .code {
  font-size: 46px;
  font-weight: 900;
  color: var(--brand-dark);
  letter-spacing: 2px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  text-decoration: none;
}
.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-secondary { background: var(--light-fill); color: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand-2); border: 2px solid var(--brand-2); }
.btn-ghost { background: transparent; color: var(--muted); text-decoration: underline; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { padding: 20px; font-size: 22px; border-radius: 16px; }

.section-gap { margin: 18px 16px; }

.pick-list { display: flex; flex-direction: column; gap: 12px; }
.pick-opt {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  background: #fff;
  text-align: left;
  font-size: 17px;
}
.pick-opt.active { border-color: var(--brand-2); background: var(--light-fill); }
.pick-opt .opt-name { font-weight: 800; font-size: 19px; color: var(--brand-dark); }
.pick-opt .opt-meta { font-size: 14px; color: var(--muted); margin-top: 3px; }

.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.number-cell {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px 0;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.number-cell.active { border-color: var(--brand-2); background: var(--brand-2); color: #fff; }

.field-lg label {
  display: block;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-lg input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 18px;
  font-family: inherit;
}

.status-pill-lg {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  margin-top: 14px;
}
.pill-waiting { background: #eef1ff; color: #3546b8; }
.pill-called { background: var(--warn-bg); color: var(--warn); }
.pill-seated { background: var(--ok-bg); color: var(--ok); }
.pill-no_show { background: var(--danger-bg); color: var(--danger); }
.pill-cancelled { background: #eee; color: #888; }

.almost-banner {
  background: var(--warn-bg);
  color: #7a4c00;
  border: 2px solid #f0c273;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin: 12px 16px;
}

.notice-card {
  text-align: center;
  padding: 40px 24px;
}
.notice-card .icon { font-size: 46px; margin-bottom: 12px; }
.notice-card h2 { font-size: 20px; color: var(--brand-dark); margin: 0 0 8px; }
.notice-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }

.hint-text { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }
.error-text { color: var(--danger); font-size: 14px; margin-top: 8px; text-align: center; }

.top-nav {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 0;
}
.top-nav a { color: #fff; text-decoration: none; font-size: 15px; opacity: 0.9; }

/* ---------------- 后台管理端（电脑/iPad） ---------------- */

.admin-topbar {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-2));
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-topbar h1 { font-size: 21px; margin: 0; font-weight: 800; letter-spacing: 1px; }
.admin-topbar .sub { font-size: 12.5px; opacity: 0.9; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6bd68a; margin-right: 6px; }
.status-dot.offline { background: #e0e0e0; }

.admin-container { max-width: 1280px; margin: 0 auto; padding: 18px; }

.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card h2 { font-size: 16px; margin: 0 0 12px; color: var(--brand-dark); display: flex; align-items: center; justify-content: space-between; }

.type-card { border-top: 5px solid var(--brand-2); }
.type-card .t-label { font-size: 15px; font-weight: 800; color: var(--brand-dark); }
.type-card .t-nums { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 4px; }
.type-card .t-nums .free { font-size: 32px; font-weight: 900; color: var(--brand-2); }
.type-card .t-nums .total { font-size: 15px; color: var(--muted); }
.type-card .t-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.table-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.table-chip {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--muted);
}
.table-chip.free { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.table-chip.occupied { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

.big-call-btn {
  width: 100%;
  padding: 18px;
  font-size: 20px;
  font-weight: 900;
  border-radius: 14px;
  border: none;
  background: var(--brand-2);
  color: #fff;
  cursor: pointer;
  margin: 14px 0;
}
.big-call-btn:disabled { background: #ddd; color: #999; cursor: not-allowed; }
.big-call-btn .sub { display: block; font-size: 13px; font-weight: 500; margin-top: 4px; opacity: 0.9; }

.abtn {
  border: none; border-radius: 8px; padding: 7px 11px; font-size: 12.5px; cursor: pointer; font-weight: 700;
}
.abtn-primary { background: var(--brand-2); color: #fff; }
.abtn-ok { background: var(--ok); color: #fff; }
.abtn-warn { background: var(--warn); color: #fff; }
.abtn-danger { background: var(--danger); color: #fff; }
.abtn-ghost { background: #f2ece5; color: var(--brand-dark); }
.abtn:disabled { opacity: 0.4; cursor: not-allowed; }

table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th { background: var(--brand-2); color: #fff; text-align: center; padding: 9px 6px; font-weight: 700; }
table.list td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--border); }
table.list tr:nth-child(even) td { background: var(--light-fill); }
table.list tr.overdue td { background: #fbe4e1; }
table.list tr.recommended td { background: #fff6d8; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-waiting { background: #eef1ff; color: #3546b8; }
.badge-called { background: var(--warn-bg); color: var(--warn); }
.badge-seated { background: var(--ok-bg); color: var(--ok); }
.badge-no_show { background: var(--danger-bg); color: var(--danger); }
.badge-cancelled { background: #eee; color: #888; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 999px; background: #f2ece5; color: var(--brand-dark); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.tab.active { background: var(--brand-2); color: #fff; }

.action-cell { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

.empty-hint { text-align: center; color: var(--muted); padding: 24px; font-size: 13.5px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-name { font-size: 14px; font-weight: 700; color: var(--text); }
.toggle-row .t-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #ddd; border-radius: 999px; cursor: pointer; transition: 0.2s; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::before { transform: translateX(20px); }

.settings-field { margin-bottom: 12px; }
.settings-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.settings-field input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; }

.notif-log { max-height: 220px; overflow-y: auto; font-size: 12.5px; }
.notif-log .row { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.notif-log .row .ch { color: var(--muted); }

.section-title { font-size: 17px; font-weight: 800; color: var(--brand-dark); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .bar { width: 5px; height: 18px; background: var(--brand-2); border-radius: 3px; display: inline-block; }

.hidden { display: none !important; }

/* ============ 语言选择 & 双语切换 ============ */
.lang-gate {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
  display: none; align-items: center; justify-content: center;
}
.lang-gate-inner { width: 86%; max-width: 340px; text-align: center; }
.gate-logo { color: #fff; font-size: 40px; font-weight: 800; letter-spacing: 8px; }
.gate-sub { color: rgba(255,255,255,.75); font-size: 13px; letter-spacing: 3px; margin: 8px 0 40px; }
.gate-btn { margin-bottom: 14px; }
.lang-gate .btn-outline { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.6); }

.lang-switch { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; z-index: 5; }
.lang-switch button {
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12);
  color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 20px; cursor: pointer;
}
.lang-switch button.on { background: #fff; color: var(--brand-dark); font-weight: 700; }

/* ============ 首页 A/B 双号码 ============ */
.now-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.now-three { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.now-three .code { font-size: 30px; }
.ns-col { text-align: center; }
.ns-g { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 2px; }
.now-two .code { font-size: 40px; }

/* ============ 取号页分组提示 ============ */
.group-hint {
  margin-top: 14px; padding: 12px; border-radius: 10px; text-align: center;
  font-size: 16px; font-weight: 700; color: var(--brand-dark);
  background: #fdf2ee; opacity: 0; transition: opacity .2s;
}
.group-hint.show { opacity: 1; }
.field-title { font-size: 16px; font-weight: 800; color: var(--brand-dark); margin-bottom: 12px; }

/* ============ 后台：A/B 双列表 ============ */
.group-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
@media (max-width: 1180px) { .group-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .group-board { grid-template-columns: 1fr; } }

.gcard { background: #fff; border-radius: 14px; padding: 18px; border-top: 5px solid var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.gcard-b { border-top-color: #1f6f5c; }
.gcard-c { border-top-color: #2c5f8a; }
.ghead { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.gname { font-size: 26px; font-weight: 800; color: var(--brand-dark); }
.gcard-b .gname { color: #1f6f5c; }
.gcard-c .gname { color: #2c5f8a; }
.gdesc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.gnow { text-align: right; }
.gnow .lbl { font-size: 12px; color: var(--muted); }
.gnow .val { font-size: 30px; font-weight: 800; color: var(--brand-dark); line-height: 1.1; }
.gcard-b .gnow .val { color: #1f6f5c; }
.gcard-c .gnow .val { color: #2c5f8a; }

.gcall {
  width: 100%; border: none; border-radius: 12px; cursor: pointer;
  background: var(--brand); color: #fff; padding: 16px; font-size: 19px; font-weight: 800;
  display: flex; flex-direction: column; gap: 4px; transition: filter .15s;
}
.gcard-b .gcall { background: #1f6f5c; }
.gcard-c .gcall { background: #2c5f8a; }
.gcall:hover:not(:disabled) { filter: brightness(1.08); }
.gcall:disabled { background: #cfc9c6; cursor: not-allowed; }
.gcall .sub { font-size: 13px; font-weight: 500; opacity: .9; }

.glist { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #faf7f5; border: 1px solid #efe7e3; }
.qrow.called { background: #fff8e6; border-color: #f0dca8; }
.qrow.no_show { background: #f5f5f5; opacity: .8; }
.qnum { font-size: 22px; font-weight: 800; color: var(--brand-dark); min-width: 74px; }
.gcard-b .qnum { color: #1f6f5c; }
.gcard-c .qnum { color: #2c5f8a; }
.qmid { flex: 1; min-width: 0; }
.qsize { font-weight: 700; font-size: 15px; }
.qmeta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qact { display: flex; gap: 6px; flex-shrink: 0; }
.rbtn { border: 1px solid #ddd; background: #fff; border-radius: 7px; padding: 8px 12px; font-size: 14px; cursor: pointer; font-weight: 600; }
.rbtn:hover { background: #f2f2f2; }
.rbtn-call { background: var(--brand); border-color: var(--brand); color: #fff; }
.rbtn-ok { background: #1f6f5c; border-color: #1f6f5c; color: #fff; }
.ops-alert { background: #fff3cd; border: 1px solid #f0dca8; color: #7a5c00; padding: 12px 16px; border-radius: 10px; margin-bottom: 4px; font-weight: 600; }

/* ============ 到号提示音按钮 ============ */
.btn-bell {
  background: #fff; color: var(--brand-dark);
  border: 2px solid var(--brand); font-weight: 800;
}
.btn-bell.on { background: var(--brand); color: #fff; border-color: var(--brand); }
