/* 年会不能停 - 全局主题 */
:root {
  --primary: #D7263D;
  --primary-dark: #A81E30;
  --gold: #F7C948;
  --gold-soft: #F9D976;
  --bg: #1E1213;
  --bg-card: #2A191B;
  --bg-input: #1A0E0F;
  --text: #FDF6EC;
  --text-dim: #C9B8AE;
  --line: #3E2729;
  --success: #4CAF7D;
  --danger: #E05B5B;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(215,38,61,.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(247,201,72,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* 顶部导航 */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(215,38,61,.20), rgba(30,18,19,0) 90%);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.topbar .logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  white-space: nowrap;
}
.topbar .logo small { font-size: 12px; color: var(--text-dim); letter-spacing: 0; margin-left: 6px; }
.topbar .crumb { color: var(--text-dim); font-size: 13px; }
.topbar .spacer { flex: 1; }

/* 角色切换 tab */
.role-tabs {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.role-tabs a {
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}
.role-tabs a:hover { color: var(--text); }
.role-tabs a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar a.btn-back {
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(247,201,72,.5);
  padding: 6px 14px;
  border-radius: 999px;
}
.topbar a.btn-back:hover { background: rgba(247,201,72,.12); }

/* 页面容器 */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px; }
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 17px;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.ok { background: rgba(76,175,125,.2); color: var(--success); }
.badge.warn { background: rgba(224,91,91,.2); color: var(--danger); }
.badge.info { background: rgba(247,201,72,.15); color: var(--gold); }

/* 表单 */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}
.form-group textarea { min-height: 72px; resize: vertical; }
.form-group input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
.form-group input[type="range"] { padding: 0; }
.form-group .hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--line);
  transition: all .2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: #3A2200; border: none; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { background: rgba(224,91,91,.15); color: var(--danger); border: 1px solid rgba(224,91,91,.4); }
.btn.danger:hover { background: rgba(224,91,91,.28); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left;
  padding: 10px 12px;
  color: var(--gold);
  border-bottom: 2px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(215,38,61,.05); }
.tbl .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.tbl .rank { font-size: 15px; font-weight: 800; color: var(--gold); }
.tbl .empty { text-align: center; color: var(--text-dim); padding: 28px; }

/* 状态点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.red { background: var(--danger); }
.dot.green { background: var(--success); }
.dot.gold { background: var(--gold); }

/* toast */
#toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(30,18,19,.95);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
  max-width: 86vw;
}
.toast.ok { border-color: var(--success); color: var(--success); }
.toast.err { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal h3 { color: var(--gold); margin-bottom: 16px; font-size: 18px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 列表 */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 700; font-size: 14px; }
.list-item .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; word-break: break-all; }
.list-item .right { text-align: right; font-size: 13px; color: var(--text-dim); white-space: nowrap; }

/* 网格（照片墙预览等） */
.grid {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.grid .cell { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; }
.grid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .cell .del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px;
}
.grid .cell .nm { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 6px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; text-align: center; }

/* 响应式 */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .role-tabs { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .role-tabs a { flex: 1; text-align: center; padding: 8px 8px; }
  .page-title { font-size: 21px; }
  .container { padding: 16px 12px; }
}

/* ===== 幸运抽奖 ===== */
/* 等级选择按钮 */
.level-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.level-picker .lv {
  flex: 1; min-width: 150px;
  padding: 16px 14px; border-radius: 12px; cursor: pointer;
  background: var(--bg-input); border: 2px solid var(--line);
  color: var(--text); text-align: center; transition: all .2s;
}
.level-picker .lv b { display: block; font-size: 17px; margin-bottom: 4px; }
.level-picker .lv small { color: var(--text-dim); font-size: 12px; }
.level-picker .lv:hover { border-color: var(--gold); transform: translateY(-2px); }
.level-picker .lv.on {
  border-color: var(--gold); background: linear-gradient(135deg, rgba(247,201,72,.15), rgba(247,201,72,.05));
  box-shadow: 0 4px 18px rgba(247,201,72,.2);
}
.level-picker .lv.on b { color: var(--gold); }
.level-picker .lv.lv1.on { border-color: #F7C948; }
.level-picker .lv.lv2.on { border-color: #C0C8D0; }
.level-picker .lv.lv3.on { border-color: #CD8B5E; }

/* 主显示区大字 */
.lottery-hero {
  text-align: center; padding: 26px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(215,38,61,.15), rgba(30,18,19,0));
  border: 1px dashed var(--line); margin-bottom: 18px;
}
.lottery-hero .h-label { color: var(--text-dim); font-size: 13px; letter-spacing: 2px; }
.lottery-hero .h-level { font-size: 44px; font-weight: 900; color: var(--gold); margin: 6px 0 2px; line-height: 1.15; }
.lottery-hero .h-count { color: var(--text-dim); font-size: 14px; }
.lottery-hero .h-state { margin-top: 10px; font-size: 15px; font-weight: 700; }
.lottery-hero.live .h-level { animation: heroPulse 1s ease-in-out infinite; }
@keyframes heroPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .85; }
}

/* 大屏 */
.screen-mode { padding: 0; max-width: none; }
.screen-stage { position: relative; min-height: calc(100vh - 20px); display: flex; flex-direction: column; }
.screen-stage .stage-head { text-align: center; padding: 14px 20px 6px; }
.screen-stage .stage-title { font-size: 30px; font-weight: 900; color: var(--gold); letter-spacing: 6px; text-shadow: 0 0 30px rgba(247,201,72,.35); }
.screen-stage .stage-sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.screen-stage .stage-body { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 20px 20px; min-height: 0; }

/* 照片墙（静态网格） */
.wall-grid {
  display: grid; gap: 14px; width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(var(--wall-w, 150px), 1fr));
}
.wall-grid .wall-cell { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); aspect-ratio: 1; }
.wall-grid .wall-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall-grid .wall-cell .nm {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff;
  font-size: 15px; font-weight: 700; text-align: center;
}

/* 照片墙（跑马灯滚动，右→左） */
.marquee { overflow: hidden; width: 100%; position: relative; }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marqueeX linear infinite; will-change: transform; }
.marquee.paused .marquee-track { animation-play-state: paused; }
.marquee.slow .marquee-track { animation-duration: 60s; }
@keyframes marqueeX { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track .wall-cell { position: relative; width: var(--wall-w, 150px); flex: 0 0 auto; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); aspect-ratio: 1; }
.marquee-track .wall-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.marquee-track .wall-cell .nm {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff;
  font-size: 15px; font-weight: 700; text-align: center;
}

/* 多行横向跑马灯墙（cols>1：cols 行同向滚动） */
.marquee-wall { display: flex; flex-direction: column; gap: 12px; width: 100%; height: 100%; justify-content: center; }
.marquee-wall .marquee { flex: 1; min-height: 0; display: flex; align-items: center; }
.marquee-wall .marquee-track { gap: 14px; }

/* 抽奖中舞台 */
.roll-stage { text-align: center; }
.roll-stage .roll-big { font-size: 34px; font-weight: 900; color: var(--gold); letter-spacing: 4px; margin-bottom: 26px; animation: heroPulse 1s ease-in-out infinite; }
.roll-stage .roll-note { color: var(--text-dim); font-size: 15px; margin-top: 22px; letter-spacing: 2px; }

/* 中奖展示 */
.win-stage { text-align: center; width: 100%; }
.win-stage .win-title { font-size: 40px; font-weight: 900; color: var(--gold); letter-spacing: 6px; margin-bottom: 30px; text-shadow: 0 0 40px rgba(247,201,72,.45); }
.win-list { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.win-card {
  width: 190px; background: var(--bg-card); border: 2px solid var(--gold);
  border-radius: 16px; overflow: hidden; box-shadow: 0 0 30px rgba(247,201,72,.18);
  animation: winIn .5s ease both;
}
.win-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.win-card .wn { padding: 10px; font-size: 17px; font-weight: 800; background: linear-gradient(135deg, rgba(247,201,72,.2), rgba(247,201,72,.05)); }
@keyframes winIn { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }

/* 中奖清单表格 */
.winner-tbl { margin-top: 8px; }
.winner-tbl .rank { width: 46px; }
.winner-tbl .medal { font-size: 20px; }
.winner-tbl tr.lv1 td .medal { color: #F7C948; }
.winner-tbl tr.lv2 td .medal { color: #C0C8D0; }
.winner-tbl tr.lv3 td .medal { color: #CD8B5E; }

/* 大屏中奖清单 */
.win-screen-tbl { width: 100%; max-width: 1080px; margin: 30px auto 0; border-radius: 14px; overflow: hidden; background: rgba(30,18,19,.6); }
.win-screen-tbl th, .win-screen-tbl td { padding: 12px 10px; font-size: 17px; text-align: center; }
.win-screen-tbl th { background: rgba(247,201,72,.14); color: var(--gold); }
.win-screen-tbl td { border-top: 1px solid var(--line); }
.win-screen-tbl .t-rank { font-size: 20px; font-weight: 800; }
.win-screen-tbl .t-img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

/* 停止按钮脉冲 */
.btn-danger-live { animation: btnPulse 1.2s ease-out infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215,38,61,.55); }
  50% { box-shadow: 0 0 0 10px rgba(215,38,61,0); }
}

/* ---- 多活动管理界面 ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-input); color: var(--text); font-size: 13px;
  cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #3A2200; border-color: transparent; font-weight: 700;
}

.seg3 { display: flex; gap: 12px; }
.seg-btn {
  flex: 1; padding: 18px 10px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--bg-input); color: var(--text); font-size: 17px; cursor: pointer;
  transition: all .2s;
}
.seg-btn:hover { border-color: var(--gold); color: var(--gold); }
.seg-btn.active {
  border-color: transparent; background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #3A2200; font-weight: 800; box-shadow: 0 6px 24px rgba(247,201,72,.25);
}

.btn.big { padding: 20px 24px; font-size: 19px; font-weight: 800; border-radius: 16px; letter-spacing: 2px; }
.mode-area { text-align: center; }

/* 纵向上升滚动（多列网格） */
.marquee-vert { overflow: hidden; width: 100%; position: relative; height: 100%; }
.marquee-vert .marquee-track.mv {
  display: grid; width: 100%; height: max-content; gap: 16px;
  animation-name: marqueeY; will-change: transform;
}
@keyframes marqueeY { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.marquee-vert .wall-cell { width: 100%; aspect-ratio: 1; }

/* 随机转换 */
.wall-grid.random .wall-cell { animation: popIn .8s ease-out both; }
@keyframes popIn {
  from { opacity: 0; transform: scale(.6) rotate(6deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* 抽奖结束 3-2-1 倒计时（叠加在照片滚动墙上，照片继续轮换） */
.countdown {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(25,12,12,.30) 0%, rgba(15,8,8,.80) 100%);
}
.countdown-num {
  font-size: 28vh; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 80px rgba(247,201,72,.55), 0 0 160px rgba(247,201,72,.35);
  animation: countPop .9s ease;
}
@keyframes countPop {
  0% { transform: scale(1.8); opacity: .1; }
  60% { transform: scale(.94); opacity: 1; }
  100% { transform: scale(1); }
}

/* admin 各奖项中奖清单（批次） */
.batch { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; background: rgba(255,255,255,.02); }
.batch-head { display: flex; align-items: center; gap: 8px; color: var(--gold); margin-bottom: 10px; }
.batch-list { display: flex; flex-wrap: wrap; gap: 10px; }
.batch-item { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.batch-avatar { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.batch-name { font-size: 14px; }
