/*!
 * app.css — 宴会扫码查座 · 公共样式（移动端优先，喜庆暖金配色）
 */
:root {
  --red: #b3261e;
  --red-deep: #8c1b16;
  --gold: #c8a45c;
  --gold-light: #e8d5a8;
  --ink: #2b2320;
  --gray: #7a6e68;
  --line: #ecdfd0;
  --bg: #fffaf4;
  --card: #ffffff;
  --ok: #2e7d52;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(140, 90, 40, .12);
}

* { 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", "WenQuanYi Micro Hei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body {
  background-image: radial-gradient(circle at 50% 0%, #fff3e2 0%, var(--bg) 45%);
  min-height: 100vh;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; }
.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff5e8;
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: 1px; font-weight: 700; }
.hero .sub { margin: 0; font-size: 14px; opacity: .92; }
.hero .meta { margin-top: 12px; font-size: 13px; opacity: .85; display: flex; flex-wrap: wrap; gap: 12px; }
.hero .meta span::before { content: "· "; opacity: .6; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 2px 10px rgba(140, 90, 40, .06);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--red-deep);
  display: flex; align-items: center; gap: 8px;
}
.card h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(var(--gold), var(--red));
}

/* ---------- 表单 ---------- */
label { display: block; font-size: 14px; color: var(--gray); margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfa;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 92, .18);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 20px;
  font-size: 16px; font-weight: 600;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, opacity .2s;
  box-shadow: 0 6px 16px rgba(179, 38, 30, .25);
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: #fff; color: var(--red-deep);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.gold { background: linear-gradient(135deg, var(--gold), #a8843c); box-shadow: 0 6px 16px rgba(168, 132, 60, .25); }
.btn.ok { background: linear-gradient(135deg, #38946a, #256d4c); box-shadow: 0 6px 16px rgba(37, 109, 76, .25); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }

/* ---------- 结果 ---------- */
.seat-hero {
  text-align: center;
  padding: 10px 0 4px;
}
.seat-hero .table-name {
  font-size: 40px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--red), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 6px 0;
}
.seat-hero .seat-no { font-size: 18px; color: var(--ink); font-weight: 600; }
.seat-hero .guest-name { font-size: 15px; color: var(--gray); }
.seat-hero .seat-no b { color: var(--red); font-size: 22px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; background: rgba(200, 164, 92, .16); color: #8a6a23;
}
.badge.ok { background: rgba(46, 125, 82, .14); color: var(--ok); }

.mates { display: flex; flex-wrap: wrap; gap: 8px; }
.mate {
  padding: 6px 12px; border-radius: 999px;
  background: #fff8ee; border: 1px solid var(--line);
  font-size: 14px;
}
.mate.self { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; }
.mate small { color: var(--gray); margin-left: 4px; }
.mate.self small { color: rgba(255, 255, 255, .8); }

/* ---------- 平面图 ---------- */
.plan-wrap { background: #fffdf8; border: 1px dashed var(--line); border-radius: 12px; padding: 8px; }
.plan-wrap svg { width: 100%; height: auto; display: block; }
.plan-legend { display: flex; gap: 16px; font-size: 12px; color: var(--gray); margin-top: 8px; justify-content: center; }
.plan-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
@keyframes pulse { 0% { r: 0; opacity: .55; } 100% { r: 30; opacity: 0; } }

/* ---------- 列表 / 表格 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; cursor: pointer; background: #fffdfa;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.list li:hover { border-color: var(--gold); background: #fff8ee; }
.list li b { font-size: 16px; }
.list li span { color: var(--gray); font-size: 13px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left;
}
table.grid th { color: var(--gray); font-weight: 600; background: #fff8ee; position: sticky; top: 0; }
.table-scroll { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.table-scroll table.grid td input {
  padding: 5px 8px; font-size: 14px; border-radius: 8px; border: 1px solid transparent; background: transparent;
}
.table-scroll table.grid td input:hover { border-color: var(--line); background: #fff; }

/* ---------- 提示 ---------- */
.tip { font-size: 13px; color: var(--gray); margin-top: 10px; line-height: 1.7; }
.notice {
  background: #fff6e6; border: 1px solid var(--gold-light); color: #8a6a23;
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px;
}
.empty { text-align: center; color: var(--gray); padding: 26px 10px; font-size: 14px; }

/* ---------- 后台 ---------- */
.tabs { display: flex; gap: 6px; margin: 16px 0 0; background: #fff; padding: 6px; border-radius: 14px; border: 1px solid var(--line); }
.tabs button {
  flex: 1; padding: 10px 6px; font-size: 14px; border: none; background: transparent;
  border-radius: 10px; color: var(--gray); cursor: pointer; font-family: inherit;
}
.tabs button.on { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; font-weight: 600; }
.field { margin-bottom: 12px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 140px; margin-bottom: 12px; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi { flex: 1 1 90px; background: #fff8ee; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 24px; color: var(--red-deep); }
.kpi span { font-size: 12px; color: var(--gray); }
.qr-box { text-align: center; padding: 10px; }
.qr-box canvas, .qr-box img { max-width: 100%; border-radius: 12px; background: #fff; }
.footnote { text-align: center; font-size: 12px; color: var(--gray); margin-top: 24px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(43, 35, 32, .94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; max-width: 88vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 打印（桌牌） ---------- */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-card {
    page-break-inside: avoid;
    border: 1px solid #999; border-radius: 8px;
    padding: 18px; margin: 10px; text-align: center;
  }
  .print-card h3 { margin: 6px 0; font-size: 26px; }
}
