/* ============================================================
   企优活动中心 · 幸运大转盘 — 商务黑金主题
   ============================================================ */
:root {
  --bg0: #07090e;
  --bg1: #0b0d14;
  --card: rgba(20, 24, 38, .72);
  --card-solid: #131724;
  --text: #eef1f6;
  --text2: #a7b0c3;
  --muted: #6b7488;
  --gold: #c9a35c;
  --gold-bright: #e8c97a;
  --gold-deep: #a8874a;
  --gold-grad: linear-gradient(135deg, #e8c97a 0%, #c9a35c 45%, #a8874a 100%);
  --danger: #e05b5b;
  --green: #3ecf8e;
  --blue: #4f8cff;
  --border: rgba(255, 255, 255, .08);
  --border-gold: rgba(201, 163, 92, .35);
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- 粒子背景 ---------- */
.bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .8; }
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(201,163,92,.14), transparent 60%),
    radial-gradient(800px 600px at 85% 110%, rgba(79,140,255,.08), transparent 60%);
}

/* ---------- 通用 ---------- */
main { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 10px; cursor: pointer; font-size: 14px;
  font-weight: 600; border: 1px solid var(--border); background: rgba(255,255,255,.04);
  color: var(--text); transition: all .2s; user-select: none; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.09); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-gold {
  background: var(--gold-grad); color: #14110a; border: none;
  box-shadow: 0 8px 24px rgba(201,163,92,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-gold:hover { filter: brightness(1.08); background: var(--gold-grad); }
.btn-outline { background: transparent; border-color: var(--border-gold); color: var(--gold-bright); }
.btn-outline:hover { background: rgba(201,163,92,.12); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(224,91,91,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(224,91,91,.12); }
.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,14,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--gold-grad); color: #14110a;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(201,163,92,.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: .5px; }
.brand-text small { color: var(--muted); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  padding: 8px 16px; border-radius: 8px; color: var(--text2);
  font-size: 14px; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-bright); background: rgba(201,163,92,.1); }
.btn-manage { margin-left: 8px; }

/* ---------- Hero 主视觉 ---------- */
.hero {
  max-width: 1240px; margin: 0 auto; padding: 48px 24px 20px;
}
.hero-inner { display: flex; gap: 48px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero-left { flex: 1 1 420px; min-width: 320px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 30px;
  border: 1px solid var(--border-gold);
  background: rgba(201,163,92,.1);
  color: var(--gold-bright); font-size: 13px; font-weight: 600;
  letter-spacing: 1px; animation: fadeUp .8s both;
}
.hero-title {
  font-size: clamp(38px, 5.5vw, 62px);
  font-weight: 800; line-height: 1.15; letter-spacing: 1px;
  margin: 22px 0 18px; animation: fadeUp .8s .1s both;
}
.hero-title span {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc { color: var(--text2); max-width: 480px; font-size: 15px; animation: fadeUp .8s .2s both; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; animation: fadeUp .8s .3s both; }
.hero-stats { display: flex; gap: 40px; margin-top: 36px; animation: fadeUp .8s .4s both; }
.hs-item b { display: block; font-size: 26px; font-weight: 800; color: var(--gold-bright); }
.hs-item span { color: var(--muted); font-size: 13px; }

/* ---------- 转盘舞台 ---------- */
.hero-right { flex: 1 1 540px; min-width: 340px; text-align: center; animation: fadeUp .9s .2s both; }
.wheel-stage { position: relative; width: min(560px, 90vw); margin: 0 auto; }
.wheel-halo {
  position: absolute; inset: -28px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,163,92,.22) 0%, transparent 65%);
  animation: haloPulse 3.5s ease-in-out infinite; pointer-events: none;
}
.wheel-pointer {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 6; color: var(--gold-bright); font-size: 26px; line-height: 1;
  text-shadow: 0 4px 12px rgba(201,163,92,.6); pointer-events: none;
}
.wheel-stage canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); }
.spin-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 128px; height: 128px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gold-grad); z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 10px 30px rgba(201,163,92,.5), inset 0 2px 0 rgba(255,255,255,.4), inset 0 -6px 14px rgba(0,0,0,.2);
  transition: all .15s;
}
.spin-btn::after {
  content: ''; position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid rgba(201,163,92,.35); animation: ringPulse 2s ease-out infinite;
}
.spin-btn:hover { transform: translate(-50%, -50%) scale(1.06); }
.spin-btn:disabled { opacity: .75; cursor: not-allowed; transform: translate(-50%, -50%); }
.spin-main { color: #14110a; font-size: 28px; font-weight: 800; letter-spacing: 6px; }
.spin-sub { color: rgba(20,17,10,.6); font-size: 10px; letter-spacing: 3px; }

/* 自定义金额 */
.draw-controls { margin-top: 26px; text-align: center; }
.limit-label { display: block; color: var(--text2); font-size: 14px; margin-bottom: 10px; letter-spacing: 1px; }
.limit-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.limit-row input {
  width: 220px; padding: 12px 16px; font-size: 16px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); outline: none; transition: all .2s;
}
.limit-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,163,92,.15); }
.limit-unit { color: var(--text2); font-size: 15px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ---------- 结果横幅 ---------- */
.result-strip { max-width: 1240px; margin: 24px auto 0; padding: 0 24px; }
.result-box {
  background: var(--card); border: 1px solid var(--border-gold);
  border-radius: var(--radius); padding: 26px 32px;
  text-align: center; backdrop-filter: blur(12px);
  box-shadow: var(--shadow); animation: popIn .5s both;
  position: relative; overflow: hidden;
}
.result-box::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 50% 0%, rgba(201,163,92,.14), transparent 70%);
}
.result-label { color: var(--gold-bright); font-size: 14px; letter-spacing: 3px; }
.result-main { display: flex; align-items: baseline; justify-content: center; gap: 18px; margin-top: 6px; flex-wrap: wrap; }
.result-name { font-size: 32px; font-weight: 800; }
.result-amount { font-size: 40px; font-weight: 900; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- Section ---------- */
.section { max-width: 1240px; margin: 56px auto 0; padding: 0 24px; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.section-head p { color: var(--muted); font-size: 14px; }
.section-head .btn { margin-left: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; backdrop-filter: blur(10px);
  transition: all .25s; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold-grad); opacity: 0; transition: opacity .25s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-gold); box-shadow: var(--shadow); }
.stat-card:hover::after { opacity: 1; }
.sc-icon { font-size: 26px; }
.sc-num { font-size: 30px; font-weight: 800; margin: 8px 0 2px; color: var(--gold-bright); }
.sc-label { color: var(--muted); font-size: 13px; }

/* ---------- 记录表 ---------- */
.records-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; backdrop-filter: blur(10px);
}
.records-table { width: 100%; border-collapse: collapse; }
.records-table th {
  text-align: left; padding: 14px 18px; font-size: 13px; color: var(--muted);
  font-weight: 600; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
}
.records-table td { padding: 13px 18px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.04); }
.records-table tbody tr { transition: background .15s; animation: fadeUp .4s both; }
.records-table tbody tr:hover { background: rgba(255,255,255,.03); }
.records-table tbody tr:last-child td { border-bottom: none; }
.h-time { color: var(--muted); font-size: 12.5px; }
.h-name { color: var(--text); font-weight: 600; }
.h-amt { color: var(--gold-bright); font-weight: 700; }
.h-amt.zero { color: var(--muted); }
.h-mode { color: var(--muted); font-size: 12.5px; }
.records-empty td { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- 页脚 ---------- */
.footer { position: relative; z-index: 1; margin-top: 64px; border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 22px 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: var(--muted); font-size: 13px;
}

/* ---------- 彩带 ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 99; }
.confetti-piece { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.92); } 60% { transform: scale(1.02); } 100% { opacity: 1; transform: none; } }
@keyframes haloPulse { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes ringPulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav-inner { flex-wrap: wrap; gap: 14px; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .btn-manage { margin-left: 0; }
  .hero { padding-top: 28px; }
  .hero-inner { justify-content: center; text-align: center; }
  .hero-left { flex-basis: 100%; }
  .hero-desc { margin: 0 auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-stats { gap: 24px; }
  .records-table th:nth-child(4), .records-table td:nth-child(4) { display: none; }
}
