/* ================= 碰碰互动 · 全站样式 ================= */
:root {
  --red: #e8321e;
  --red-deep: #b8230f;
  --orange: #ff6b35;
  --gold: #ffd54a;
  --gold-deep: #f0a500;
  --ink: #1a0708;
  --ink-2: #2a1214;
  --paper: #fffaf2;
  --txt: #2b1a12;
  --txt-2: #7a6255;
  --line: rgba(232, 50, 30, .12);
  --radius: 22px;
  --shadow: 0 10px 30px rgba(120, 20, 5, .16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--txt);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 480px; margin: 0 auto; padding: 0 18px 40px; }
.wrap-wide { max-width: 980px; margin: 0 auto; padding: 0 18px 60px; }

/* ---------- 顶部视觉区 ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% -20%, #ff8a4c 0%, #e8321e 45%, #a81c09 100%);
  padding: 34px 18px 62px;
  overflow: hidden;
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.22) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 12%, rgba(255,213,74,.35) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 68%, rgba(255,255,255,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 30% 80%, rgba(255,213,74,.28) 0 2px, transparent 3px);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 480px; margin: 0 auto; text-align: center; }

.brand-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.28);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; letter-spacing: .06em;
}
.brand-name {
  font-size: 25px; font-weight: 800; margin: 16px 0 6px;
  letter-spacing: .02em; text-shadow: 0 3px 12px rgba(0,0,0,.25);
}
.brand-slogan { font-size: 15px; opacity: .9; letter-spacing: .08em; }

.big-title {
  margin: 26px 0 4px;
  font-size: 46px; font-weight: 900; line-height: 1.06;
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff 10%, var(--gold) 55%, #ffb027 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.28));
}
.sub-title { font-size: 15px; opacity: .92; letter-spacing: .14em; margin-top: 6px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
  border: 1px solid var(--line);
}

.overlap { margin-top: -44px; position: relative; z-index: 2; }

/* ---------- 主按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; cursor: pointer;
  padding: 17px 20px; border-radius: 16px;
  font-size: 18px; font-weight: 800; letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, #ff7a3d, #e8321e 60%, #c01f0c);
  box-shadow: 0 10px 22px rgba(232,50,30,.34), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .12s ease, box-shadow .12s ease;
  font-family: inherit;
}
.btn:active { transform: scale(.975); box-shadow: 0 4px 12px rgba(232,50,30,.3); }
.btn:disabled { opacity: .55; }

.btn-ghost {
  background: #fff; color: var(--red);
  border: 1.5px solid rgba(232,50,30,.3);
  box-shadow: none;
}
.btn-gold {
  background: linear-gradient(135deg, #ffe37a, var(--gold) 40%, var(--gold-deep));
  color: #5b3200;
  box-shadow: 0 10px 22px rgba(240,165,0,.35), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-sm { padding: 11px 16px; font-size: 15px; border-radius: 12px; width: auto; }

/* ---------- 奖品横滑 ---------- */
.prize-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.prize-strip::-webkit-scrollbar { display: none; }
.prize-chip {
  flex: 0 0 auto; min-width: 108px;
  background: linear-gradient(180deg, #fff8e6, #ffeec4);
  border: 1px solid rgba(240,165,0,.32);
  border-radius: 16px; padding: 14px 12px; text-align: center;
}
.prize-chip .lv { font-size: 11px; color: #a06f00; font-weight: 700; letter-spacing: .1em; }
.prize-chip .nm { font-size: 14px; font-weight: 800; margin-top: 5px; line-height: 1.25; }

/* ---------- 进度 / 机会数 ---------- */
.chance-box {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #fff6df, #ffe6b8);
  border: 1px solid rgba(240,165,0,.35);
  border-radius: 18px; padding: 16px 18px;
}
.chance-num { font-size: 34px; font-weight: 900; color: var(--red); line-height: 1; }
.chance-lbl { font-size: 13px; color: #8a5a00; letter-spacing: .06em; }

/* ---------- 任务卡 ---------- */
.task {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border-radius: 18px; padding: 16px;
  box-shadow: 0 6px 18px rgba(120,20,5,.08);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.task-ico {
  flex: 0 0 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, #ffe0d0, #ffc4a8);
}
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 16.5px; font-weight: 800; }
.task-sub { font-size: 13px; color: var(--txt-2); margin-top: 4px; line-height: 1.5; }
.task-done {
  flex: 0 0 auto; font-size: 13px; font-weight: 800; color: #12a05a;
  background: #e8f8ef; border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}

/* ---------- 转盘 ---------- */
.wheel-stage {
  position: relative; width: 100%; aspect-ratio: 1;
  max-width: 340px; margin: 8px auto 0;
  display: grid; place-items: center;
}
.wheel-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 0deg, #ffd54a, #ff8a4c, #e8321e, #ff8a4c, #ffd54a, #ff8a4c, #e8321e, #ff8a4c, #ffd54a);
  box-shadow: 0 16px 40px rgba(232,50,30,.35), inset 0 0 0 4px rgba(255,255,255,.35);
}
canvas#wheel { position: relative; width: 100%; height: 100%; border-radius: 50%; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5;
  box-sizing: content-box;   /* border 画三角形时必须，否则 border-box 会把边框压成 0 */
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 34px solid #b8230f;
  filter: drop-shadow(0 2px 4px rgba(60,10,0,.45));
}
.pointer::after {
  content: ""; position: absolute; top: -34px; left: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e8321e 70%);
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.wheel-center {
  position: absolute; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff6d8, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 6px 16px rgba(0,0,0,.25), inset 0 0 0 4px #fff;
  display: grid; place-items: center; z-index: 4;
  font-weight: 900; color: #7a4a00; font-size: 15px; letter-spacing: .06em;
  cursor: pointer; user-select: none;
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,6,4,.62);
  backdrop-filter: blur(3px); z-index: 90;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 330px; background: #fff; border-radius: 24px;
  padding: 28px 22px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: pop .28s cubic-bezier(.2,1.4,.5,1);
}
@keyframes pop { from { transform: scale(.82); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.modal-emoji { font-size: 52px; line-height: 1; }
.modal-title {
  font-size: 25px; font-weight: 900; margin: 12px 0 6px; color: var(--red);
}
.modal-desc { font-size: 14.5px; color: var(--txt-2); line-height: 1.6; }
.code-box {
  margin: 16px 0 4px; padding: 14px; border-radius: 14px;
  background: #fff8e6; border: 1.5px dashed var(--gold-deep);
  font-size: 22px; font-weight: 900; letter-spacing: .16em; color: #8a5a00;
}

/* ---------- 券码行 ---------- */
.ticket {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 16px; padding: 15px 16px;
  border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(120,20,5,.07);
  margin-bottom: 11px;
}
.ticket-main { flex: 1; min-width: 0 }
.ticket-nm { font-size: 16px; font-weight: 800; }
.ticket-meta { font-size: 12.5px; color: var(--txt-2); margin-top: 4px }
.ticket-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px; font-weight: 800; color: var(--red);
  background: #fff2ee; padding: 8px 11px; border-radius: 10px; letter-spacing: .06em;
}
.badge-used { color: #999; background: #f0f0f0; }

/* ---------- 表单（后台） ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: #5a4238 }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1.5px solid #e6dcd4; font-size: 15px; font-family: inherit;
  background: #fff; color: var(--txt); outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--orange) }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6 }
.hint { font-size: 12px; color: #9b8677; margin-top: 5px; line-height: 1.5 }

/* ---------- 表 ---------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px }
table.tb th {
  text-align: left; padding: 10px 8px; font-size: 12px; color: #8a7566;
  border-bottom: 1.5px solid #eee2d8; white-space: nowrap; font-weight: 700;
}
table.tb td { padding: 11px 8px; border-bottom: 1px solid #f4ece4; vertical-align: middle }
table.tb tr:last-child td { border-bottom: 0 }

/* ---------- 通用小件 ---------- */
.sec-title {
  font-size: 17px; font-weight: 900; margin: 26px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.sec-title::before {
  content: ""; width: 4px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, var(--orange), var(--red));
}
.rules { font-size: 13.5px; line-height: 2; color: #6b5446 }
.muted { color: var(--txt-2); font-size: 13px }
.center { text-align: center }
.mt8 { margin-top: 8px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px }
.row { display: flex; gap: 10px } .row > * { flex: 1 }
.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: #fff0e8; color: var(--red);
}
.warn-wechat {
  background: #fff4e0; border: 1px solid #ffd79a; color: #8a5a00;
  font-size: 12.5px; padding: 10px 13px; border-radius: 12px;
  line-height: 1.6; margin-top: 14px;
}
.sticky-cta {
  position: sticky; bottom: 0; padding: 14px 0 18px;
  background: linear-gradient(180deg, rgba(255,250,242,0), var(--paper) 36%);
}

/* ---------- 桌面端后台 ---------- */
.admin-nav {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px;
}
.admin-nav a {
  padding: 9px 15px; border-radius: 11px; font-size: 14px; font-weight: 700;
  background: #fff; border: 1px solid var(--line); color: #6b5446;
}
.admin-nav a.on { background: var(--red); color: #fff; border-color: var(--red) }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px }
.kpi-item {
  background: #fff; border-radius: 16px; padding: 16px; border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(120,20,5,.06);
}
.kpi-num { font-size: 28px; font-weight: 900; color: var(--red); line-height: 1 }
.kpi-lbl { font-size: 12.5px; color: var(--txt-2); margin-top: 6px }

/* 平台选择 */
.plat-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px }
.plat {
  padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: #f7f1ea; border: 1.5px solid transparent; color: #6b5446; cursor: pointer;
}
.plat.on { background: #fff0e8; border-color: var(--orange); color: var(--red) }
