/* ============================================================
   婚礼幸运抽奖 · 暖金主题
   ============================================================ */

:root {
  --ivory:   #fbf7ef;
  --cream:   #f4ecdd;
  --cream-2: #efe3cc;
  --gold:    #c9a227;
  --gold-lt: #e8cf8c;
  --gold-dp: #a8852a;
  --ink:     #2b2318;
  --muted:   #8a7a5c;
  --dark:    #14100a;
  --dark-2:  #241a0d;
  --line:    rgba(201, 162, 39, 0.35);

  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  color: var(--ink);
}

/* ---------------- 宾客取号页 ---------------- */

.guest-body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 0%, #fffdf8 0%, var(--cream) 55%, var(--cream-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.guest-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #fffdf9 0%, var(--ivory) 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(120, 90, 20, 0.14), inset 0 0 0 6px rgba(201, 162, 39, 0.06);
  padding: 34px 26px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.guest-card::before {
  content: "囍";
  position: absolute;
  top: -26px;
  right: -8px;
  font-family: var(--serif);
  font-size: 120px;
  color: rgba(201, 162, 39, 0.07);
  pointer-events: none;
}

.guest-eyebrow {
  font-family: var(--serif);
  letter-spacing: 0.4em;
  font-size: 13px;
  color: var(--gold-dp);
  margin-bottom: 6px;
}

.guest-title {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.12em;
  margin: 0 0 22px;
  color: var(--ink);
}

.num-wrap {
  margin: 6px 0 4px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.num-label {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 10px;
}

.num-big {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(72px, 26vw, 118px);
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--gold-lt) 0%, var(--gold) 45%, var(--gold-dp) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.4);
}

.guest-hint {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.guest-hint b { color: var(--gold-dp); font-weight: 600; }

.guest-tip-line {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(201, 162, 39, 0.1);
  border: 1px dashed var(--line);
  font-size: 14px;
  color: var(--gold-dp);
}

.spin {
  width: 46px; height: 46px;
  margin: 30px auto;
  border: 3px solid rgba(201, 162, 39, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.guest-foot {
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(138, 122, 92, 0.7);
}

.wx-icon {
  font-size: 58px;
  line-height: 1;
  margin: 14px 0 6px;
}

/* ---------------- 大屏抽奖页 ---------------- */

.screen-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, #2e2210 0%, var(--dark) 60%);
  color: var(--gold-lt);
  overflow: hidden;
}

.screen-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 40px 8px;
}

.screen-title {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 34px);
  letter-spacing: 0.22em;
  margin: 0;
  color: var(--gold-lt);
}

.screen-count { font-size: clamp(14px, 1.2vw, 19px); color: rgba(232, 207, 140, 0.75); }
.screen-count b { color: #fff0c9; font-size: 1.35em; font-family: var(--serif); }

.screen-main {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 26vw);
  gap: 26px;
  padding: 8px 40px 34px;
  height: calc(100vh - 78px);
}

.stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(201, 162, 39, 0.14) 0%, rgba(20, 16, 10, 0) 62%),
    linear-gradient(180deg, rgba(255, 245, 220, 0.04), rgba(0, 0, 0, 0.12));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 30px 26px;
  overflow: hidden;
}

.stage-caption {
  font-family: var(--serif);
  letter-spacing: 0.4em;
  font-size: clamp(13px, 1vw, 17px);
  color: rgba(232, 207, 140, 0.7);
  margin-bottom: 6px;
}

.stage-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(120px, 21vw, 330px);
  line-height: 1;
  color: #ffe9ad;
  text-shadow: 0 0 34px rgba(232, 190, 90, 0.55), 0 0 90px rgba(201, 162, 39, 0.32);
  transition: transform 0.12s ease-out;
}

.stage-num.rolling { color: rgba(255, 233, 173, 0.55); text-shadow: none; }
.stage-num.pop { animation: pop 0.7s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes pop {
  0%   { transform: scale(0.55); filter: brightness(2.4); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.stage-sub { margin-top: 10px; font-size: clamp(13px, 1vw, 17px); color: rgba(232, 207, 140, 0.6); letter-spacing: 0.2em; }

.stage-actions {
  margin-top: 26px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.btn-draw {
  font-family: var(--serif);
  font-size: clamp(20px, 1.7vw, 30px);
  letter-spacing: 0.3em;
  padding: 16px 54px 16px 60px;
  color: #2a1f08;
  background: linear-gradient(180deg, #f4dd9a 0%, var(--gold) 60%, var(--gold-dp) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(201, 162, 39, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn-draw:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(201, 162, 39, 0.45); }
.btn-draw:active { transform: translateY(1px) scale(0.99); }
.btn-draw:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.qr-box {
  position: absolute;
  left: 26px;
  bottom: 22px;
  text-align: center;
}
.qr-box img, .qr-box canvas, .qr-box svg { width: 118px; height: 118px; display: block; background: #fff; padding: 7px; border-radius: 10px; }
.qr-cap { margin-top: 7px; font-size: 12px; letter-spacing: 0.16em; color: rgba(232, 207, 140, 0.72); }

/* 中奖榜 */
.history {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 245, 220, 0.05), rgba(0, 0, 0, 0.14));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-head {
  font-family: var(--serif);
  letter-spacing: 0.3em;
  font-size: clamp(15px, 1.2vw, 20px);
  color: var(--gold-lt);
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.history-head small { font-family: var(--sans); letter-spacing: 0; font-size: 12px; color: rgba(232, 207, 140, 0.5); }

.history-list {
  list-style: none;
  margin: 0;
  padding: 12px 18px 22px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}
.history-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 14px;
  margin-bottom: 9px;
  border-radius: 12px;
  background: rgba(201, 162, 39, 0.07);
  border-left: 3px solid rgba(201, 162, 39, 0.5);
}
.history-list li .h-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 2.4vw, 40px);
  color: #ffe9ad;
  line-height: 1;
  letter-spacing: 0.04em;
}
.history-list li .h-seq { font-size: 13px; color: rgba(232, 207, 140, 0.55); }
.history-list li.is-new { animation: slideIn 0.5s ease-out; border-left-color: var(--gold); background: rgba(201, 162, 39, 0.18); }
@keyframes slideIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.history-list li.history-empty {
  background: none;
  border-left: none;
  justify-content: center;
}

.history-empty { color: rgba(232, 207, 140, 0.4); text-align: center; padding: 40px 10px; font-size: 14px; letter-spacing: 0.2em; background: none; border: none; }

/* 撒金 */
.spark {
  position: fixed;
  width: 9px; height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  animation: sparkFall 1.5s ease-out forwards;
}
@keyframes sparkFall {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), 62vh) scale(0.3); }
}

/* ---------------- 后台页 ---------------- */

.admin-body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #fffdf8, var(--cream) 70%);
  padding: 32px 20px 60px;
}
.admin-wrap { max-width: 860px; margin: 0 auto; }
.admin-h1 { font-family: var(--serif); letter-spacing: 0.2em; font-size: 24px; margin: 0 0 4px; }
.admin-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.admin-panel {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(120, 90, 20, 0.08);
}
.admin-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.admin-input {
  flex: 1; min-width: 220px; padding: 11px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.btn {
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #f4dd9a, var(--gold)); color: #2a1f08;
  font-size: 15px; cursor: pointer; font-weight: 600;
}
.btn.ghost { background: #fff; color: var(--gold-dp); }
.btn.danger { background: #fff; color: #a83232; border-color: rgba(168, 50, 50, 0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.stat .v { font-family: var(--serif); font-size: 34px; color: var(--gold-dp); }
.stat .k { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }
.win-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--serif); font-size: 22px; padding: 6px 16px; border-radius: 999px;
  background: rgba(201, 162, 39, 0.12); border: 1px solid var(--line); color: var(--gold-dp);
}
.note { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 10px; }
.warn-banner {
  background: #fff7e6;
  border: 1px solid #e0b34a;
  color: #8a6a12;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.7;
}
.warn-banner code { background: rgba(201, 162, 39, 0.18); padding: 1px 6px; border-radius: 5px; }
.err { color: #a83232; font-size: 14px; margin-top: 10px; }
.hidden { display: none !important; }
