/* ============================================================
   泽凯集团年会抽奖 · 金羊贺岁
   ============================================================ */
:root{
  --gold: #ffd75e;
  --gold-deep: #e8a020;
  --gold-light: #fff3c4;
  --red: #8f1610;
  --red-deep: #5c0808;
  --text: #ffe9a8;
}
*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; }
body{
  font-family: "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",sans-serif;
  background:
    radial-gradient(ellipse 120% 95% at 50% -12%, #d2452f 0%, #a61f16 36%, #6e0b0b 70%, #470404 100%);
  color: var(--text);
  overflow:hidden;
  user-select:none;
  -webkit-user-select:none;
  cursor: default;
}
[hidden]{ display:none !important; }
#fx{ position:fixed; inset:0; z-index:0; pointer-events:none; }
.view{ position:relative; height:100%; }

/* ---------- 灯笼 ---------- */
.lantern{
  position:fixed; top:12px; z-index:2;
  filter: drop-shadow(0 8px 18px rgba(255,80,50,.55));
  animation: sway 4.2s ease-in-out infinite;
  transform-origin: top center;
  pointer-events:none;
}
.lantern-l{ left:4.5vw; }
.lantern-r{ right:4.5vw; animation-delay:-2.1s; }
@keyframes sway{
  0%,100%{ transform: rotate(-3.5deg); }
  50%{ transform: rotate(3.5deg); }
}

/* ---------- 底部云纹 ---------- */
.cloud-band{
  position:fixed; left:0; right:0; bottom:0; height:64px; z-index:1;
  pointer-events:none;
}
.cloud-band svg{ width:100%; height:100%; display:block; }

/* ---------- 福 / 春 印章 ---------- */
.stamp{
  position:fixed; z-index:2; width:74px; height:74px;
  display:flex; align-items:center; justify-content:center;
  font-size:40px; font-weight:900; color:#fff6d8;
  border-radius:14px;
  background: linear-gradient(145deg, #c83020, #9c0c06);
  border:2px solid rgba(255,215,94,.75);
  box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 0 18px rgba(255,190,90,.35);
  transform: rotate(-8deg);
  pointer-events:none;
  font-family: "STKaiti","KaiTi","STXingkai",serif;
}
.stamp-fu{ left:2.6vw; bottom:90px; }
.stamp-chun{ right:2.6vw; bottom:90px; transform: rotate(8deg); }

/* ---------- 头部 ---------- */
.header{
  position:fixed; top:22px; left:0; right:0; z-index:3;
  text-align:center; pointer-events:none;
}
.header-inner{
  display:flex; align-items:center; justify-content:center; gap:26px;
}
.sheep{
  flex:0 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.sheep-r svg{ transform: scaleX(-1); }
.title-col{ text-align:center; }
.main-title{
  font-size: clamp(36px, 5.6vw, 86px);
  font-weight:900; letter-spacing:.14em; line-height:1.15;
  background: linear-gradient(180deg,#fff8e0 6%,#ffe27a 32%,#f5a623 62%,#fff3c4 96%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter: drop-shadow(0 3px 2px rgba(120,10,0,.6)) drop-shadow(0 0 24px rgba(255,190,60,.45));
}
.subtitle{
  margin-top:8px;
  font-size: clamp(13px,1.5vw,21px);
  letter-spacing:.55em; text-indent:.55em;
  color:var(--gold);
  text-shadow: 0 0 16px rgba(255,190,60,.65);
}

/* ---------- 舞台 ---------- */
.stage{
  position:fixed; inset:0; z-index:1;
  display:flex; align-items:center; justify-content:center;
}

/* ---- 3D 球面 ---- */
.sphere-wrap{
  position:absolute; inset:0; z-index:5;
  display:flex; align-items:center; justify-content:center;
  perspective: 1100px;
  opacity:0; pointer-events:none;
  transition: opacity .35s ease;
}
.sphere-wrap.on{ opacity:1; }
.sphere-glow{
  position:absolute; left:50%; top:50%;
  width:min(72vh,760px); height:min(72vh,760px);
  transform:translate(-50%,-50%);
  border-radius:50%;
  background: radial-gradient(circle, rgba(255,215,94,.18) 0%, rgba(255,215,94,.05) 45%, transparent 70%);
  border:1px dashed rgba(255,215,94,.28);
  box-shadow: inset 0 0 90px rgba(255,170,40,.12);
}
.sphere{ position:relative; width:0; height:0; transform-style:preserve-3d; }
.name-chip{
  position:absolute; left:0; top:0;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(180deg, rgba(255,232,150,.97), rgba(255,178,50,.94));
  color:#7a1a05; font-weight:800;
  border-radius: 22px;
  border:1px solid rgba(255,246,216,.9);
  box-shadow: 0 0 14px rgba(255,200,80,.55), 0 2px 6px rgba(0,0,0,.3);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  padding:0 6px;
  will-change:transform;
}

/* ---- 中奖展示板 ---- */
.board{
  position:relative; z-index:1;
  width:min(1200px,92vw);
  height:min(58vh,540px);
  background: linear-gradient(180deg,#7c0d0d 0%,#5c0808 100%);
  border:2px solid rgba(255,215,94,.55);
  border-radius:20px;
  box-shadow: 0 0 70px rgba(255,170,40,.28), inset 0 0 70px rgba(0,0,0,.4);
  display:flex; flex-direction:column;
  padding:16px 20px 12px;
  overflow:hidden;
  transition: opacity .35s ease;
}
.board-title{
  flex:0 0 auto; text-align:center;
  font-size: clamp(15px,1.7vw,22px); font-weight:800;
  letter-spacing:.6em; text-indent:.6em;
  color:var(--gold);
  text-shadow: 0 0 12px rgba(255,190,60,.7);
  padding-bottom:10px;
}
.board-title span{ color:#ff8f6a; }
.board-empty{
  flex:1; display:flex; align-items:center; justify-content:center;
  font-size: clamp(18px,2.4vw,30px); letter-spacing:.4em; text-indent:.4em;
  color:rgba(255,233,168,.5);
}
.grid{
  flex:1; display:grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: minmax(54px,auto);
  gap:14px;
  align-content:start;
  overflow-y:auto;
  padding:6px 2px 4px;
}
.grid::-webkit-scrollbar{ width:6px; }
.grid::-webkit-scrollbar-track{ background:rgba(0,0,0,.2); border-radius:3px; }
.grid::-webkit-scrollbar-thumb{ background:rgba(255,215,94,.45); border-radius:3px; }
.winner-card{
  position:relative;
  background: linear-gradient(180deg,#fff2c9 0%,#ffd75e 55%,#f0a020 100%);
  color:#7a1a05; font-weight:800;
  border-radius:14px;
  padding:10px 8px 8px;
  text-align:center;
  font-size: clamp(15px,1.7vw,26px);
  letter-spacing:.06em;
  box-shadow: 0 5px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.65);
  overflow:hidden;
}
.winner-card.animate-in{ animation: popIn .6s cubic-bezier(.22,1.6,.4,1) both; }
.winner-card::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.55), transparent 55%);
  pointer-events:none;
}
.w-num{
  position:absolute; top:4px; right:7px;
  font-size:11px; font-weight:700; color:rgba(122,26,5,.55);
}
.w-name{
  position:relative; display:block;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
@keyframes popIn{
  0%{ transform: scale(.3) translateY(-46px); opacity:0; }
  100%{ transform:none; opacity:1; }
}

/* ---- 蹦出层 ---- */
.pop-layer{
  position:absolute; inset:0; z-index:10;
  display:flex; align-items:center; justify-content:center;
  align-content:center; flex-wrap:wrap; gap:22px;
  pointer-events:none;
  padding:8vh 6vw;
}
.pop-card{
  min-width:190px;
  padding:28px 34px 30px;
  text-align:center;
  background: radial-gradient(circle at 50% 28%, #fff8e0 0%, #ffd75e 55%, #e8a020 100%);
  color:#7a1a05;
  border-radius:20px;
  box-shadow: 0 12px 60px rgba(255,200,80,.65), inset 0 2px 0 rgba(255,255,255,.75), 0 0 0 3px rgba(255,246,216,.6);
  opacity:0;
  transform: translateY(85vh) scale(.35);
}
.pop-card.in{ animation: bounceIn .75s cubic-bezier(.22,1.45,.36,1) forwards; }
.pop-tag{
  display:block; font-size:13px; font-weight:700;
  letter-spacing:.3em; color:#b34a12; margin-bottom:8px;
}
.pop-name{
  display:block; font-size: clamp(30px,4.4vw,56px); font-weight:900;
  letter-spacing:.08em; line-height:1.2;
}
@keyframes bounceIn{
  0%{ opacity:0; transform:translateY(85vh) scale(.35); }
  55%{ opacity:1; transform:translateY(-7vh) scale(1.07); }
  80%{ transform:translateY(2vh) scale(.98); }
  100%{ opacity:1; transform:translateY(0) scale(1); }
}

/* ---------- 底部控制栏（前台） ---------- */
.controls{
  position:fixed; left:50%; bottom:16px; transform:translateX(-50%);
  z-index:10;
  display:flex; align-items:center; gap:18px;
  padding:12px 28px;
  border-radius:50px;
  background: linear-gradient(180deg, rgba(96,12,10,.94), rgba(58,4,4,.96));
  border:1px solid rgba(255,215,94,.5);
  box-shadow: 0 10px 34px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
  flex-wrap:wrap; justify-content:center;
  max-width:96vw;
}
.count-box{ display:flex; align-items:center; gap:9px; font-size:15px; color:var(--text); }
.count-label{ letter-spacing:.1em; }
.stepper{
  width:34px; height:34px; border-radius:50%;
  border:1px solid rgba(255,215,94,.65);
  background:transparent; color:var(--gold);
  font-size:20px; line-height:1; cursor:pointer;
  transition: all .15s;
}
.stepper:hover{ background:rgba(255,215,94,.2); }
.stepper:active{ transform:scale(.9); }
.count-val{
  font-size:27px; font-weight:900; color:var(--gold);
  min-width:36px; text-align:center;
  text-shadow: 0 0 12px rgba(255,190,60,.6);
}
.count-unit{ font-size:14px; }
.btn{
  border:none; cursor:pointer; font-family:inherit;
  border-radius:30px;
  padding:11px 24px;
  font-size:17px; font-weight:800; letter-spacing:3px;
  transition: transform .15s, box-shadow .2s, filter .15s;
  white-space:nowrap;
}
.btn:hover{ transform:translateY(-2px) scale(1.03); }
.btn:active{ transform:scale(.95); }
.btn:disabled{ opacity:.4; cursor:not-allowed; transform:none; filter:grayscale(.3); }
.btn-start{
  background: linear-gradient(180deg,#ff6a45 0%,#e02718 100%);
  color:#fff; font-size:20px; padding:13px 38px;
  box-shadow: 0 6px 20px rgba(255,60,30,.55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-stop{
  background: linear-gradient(180deg,#ffd75e,#e8a020);
  color:#7a1a05;
  box-shadow: 0 6px 18px rgba(255,170,40,.5), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-clear{
  background: linear-gradient(180deg,#5fb8e8,#2e7fc8);
  color:#fff; font-size:15px; letter-spacing:2px;
  box-shadow: 0 6px 18px rgba(46,127,200,.45), inset 0 1px 0 rgba(255,255,255,.3);
}
/* ---- 管理页入口齿轮 ---- */
.gear{
  position:fixed; right:18px; bottom:100px; z-index:12;
  width:46px; height:46px; border-radius:50%;
  border:1px solid rgba(255,215,94,.5);
  background: rgba(60,6,6,.72);
  color:var(--gold); font-size:21px; cursor:pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.gear:hover{ transform:rotate(40deg) scale(1.08); background:rgba(255,215,94,.2); }

/* ============================================================
   后台管理页
   ============================================================ */
.admin-page{
  position:fixed; inset:0; z-index:15;
  overflow-y:auto;
  background:
    radial-gradient(ellipse 120% 95% at 50% -12%, #b02a1e 0%, #80130c 38%, #4e0707 78%, #330303 100%);
  padding:20px clamp(14px,3vw,40px) 60px;
}
.admin-head{
  position:sticky; top:0; z-index:5;
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 4px 14px;
  background: linear-gradient(180deg, rgba(78,7,7,.98) 70%, rgba(78,7,7,0));
}
.admin-title{
  font-size: clamp(20px,2.6vw,30px); font-weight:900; letter-spacing:.3em;
  background: linear-gradient(180deg,#fff8e0 10%,#ffe27a 40%,#f5a623 70%,#fff3c4 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter: drop-shadow(0 2px 8px rgba(255,190,60,.4));
}
.btn-back{
  background: linear-gradient(180deg,#ffd75e,#e8a020);
  color:#7a1a05; font-size:15px; letter-spacing:2px;
  box-shadow: 0 4px 14px rgba(255,170,40,.45);
}
.admin-cols{
  display:grid; grid-template-columns: 1.1fr 1fr; gap:16px;
  align-items:start;
}
.admin-col{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.panel{
  background: linear-gradient(180deg, rgba(110,15,10,.85), rgba(60,5,5,.9));
  border:1px solid rgba(255,215,94,.35);
  border-radius:16px;
  padding:16px 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.panel h2{
  font-size:16px; font-weight:800; letter-spacing:.2em;
  color:var(--gold);
  margin-bottom:10px;
  display:flex; align-items:center; gap:8px;
}
.panel h2 .hl{ color:#fff; background:rgba(255,215,94,.2); border-radius:8px; padding:0 8px; font-size:15px; }
.tip-line{ font-size:12.5px; color:rgba(255,233,168,.85); margin-bottom:8px; line-height:1.6; }
textarea{
  width:100%; height:128px; resize:vertical;
  background: rgba(40,3,3,.65);
  border:1px solid rgba(255,215,94,.4);
  border-radius:10px;
  color:#ffe9a8; font-size:15px; line-height:1.7;
  padding:10px 12px; font-family:inherit;
  outline:none;
}
textarea:focus{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(255,215,94,.18); }
.row{ display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; align-items:center; }
.btn-file{
  display:inline-flex; align-items:center;
  background: linear-gradient(180deg,#6aa8f0,#3a6fc8);
  color:#fff; font-size:14px; letter-spacing:1px; cursor:pointer;
  padding:10px 18px;
}
.btn-import{ background: linear-gradient(180deg,#ffd75e,#e8a020); color:#7a1a05; font-size:14px; letter-spacing:2px; }
.btn-add{ background: linear-gradient(180deg,#58c880,#2e9a58); color:#fff; font-size:14px; letter-spacing:2px; }
.btn-del{ background: linear-gradient(180deg,#e05a4a,#a52a1a); color:#fff; font-size:14px; letter-spacing:2px; }
.btn-reset{ background: linear-gradient(180deg,#f0a020,#c87d10); color:#fff; font-size:14px; letter-spacing:1px; }
.btn-clear-log{ background: linear-gradient(180deg,#8f8f9a,#5a5a68); color:#fff; font-size:13px; letter-spacing:1px; }
.btn-danger{ background: linear-gradient(180deg,#e05a4a,#a52a1a); color:#fff; font-size:13px; letter-spacing:1px; }
.warn-text{ font-size:12px; color:#ffb3a0; margin-top:12px; line-height:1.6; }
.modal-tip{ font-size:13px; color:#8fffb8; min-height:20px; margin-top:10px; }

/* 名单统计条（待抽 / 已中奖 / 名单） */
.stats{
  display:flex; gap:10px; flex-wrap:wrap;
  margin:4px 0 10px;
}
.stat{
  flex:1; min-width:110px;
  background: rgba(255,215,94,.1);
  border:1px solid rgba(255,215,94,.3);
  border-radius:10px;
  padding:8px 12px;
  font-size:13px; color:rgba(255,233,168,.9);
  letter-spacing:.05em;
  text-align:center;
}
.stat b{
  display:block; font-size:22px; font-weight:900;
  color:var(--gold);
  text-shadow: 0 0 12px rgba(255,190,60,.5);
  margin-bottom:2px;
}
.stat.stat-win b{ color:#ff9d7a; text-shadow:0 0 12px rgba(255,120,80,.5); }

/* 名单列表（每行可删除） */
.name-list{
  display:flex; flex-direction:column; gap:6px;
  max-height:300px; overflow-y:auto; margin-top:4px;
  padding-right:4px;
}
.name-list::-webkit-scrollbar{ width:6px; }
.name-list::-webkit-scrollbar-thumb{ background:rgba(255,215,94,.4); border-radius:3px; }
.name-row{
  display:flex; align-items:center; gap:10px;
  background: rgba(255,215,94,.08);
  border:1px solid rgba(255,215,94,.25);
  border-radius:10px;
  padding:6px 12px;
  font-size:14px;
  transition: background .15s;
}
.name-row:hover{ background:rgba(255,215,94,.16); }
.name-idx{
  flex:0 0 auto; min-width:24px; text-align:center;
  font-size:12px; color:rgba(255,233,168,.6);
  font-variant-numeric: tabular-nums;
}
.name-text{ flex:1; color:#ffe9a8; letter-spacing:.05em; word-break:break-all; }
.name-del{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%;
  border:none; cursor:pointer;
  background: rgba(224,90,74,.25); color:#ffb3a0;
  font-size:13px; line-height:1;
  transition: all .15s;
}
.name-del:hover{ background:#e05a4a; color:#fff; transform:scale(1.12); }
.name-list .empty{ color:rgba(255,233,168,.5); font-size:13px; padding:10px 2px; }

/* 日志 */
.log-panel{ display:flex; flex-direction:column; }
.log-panel h2{ flex:0 0 auto; }
.log-list{
  flex:1; min-height:420px; max-height:calc(100vh - 210px);
  overflow-y:auto; display:flex; flex-direction:column; gap:6px;
  padding-right:4px;
}
.log-list::-webkit-scrollbar{ width:6px; }
.log-list::-webkit-scrollbar-thumb{ background:rgba(255,215,94,.4); border-radius:3px; }
.log-item{
  display:flex; align-items:baseline; gap:10px;
  background: rgba(0,0,0,.22);
  border-left:3px solid rgba(255,215,94,.55);
  border-radius:8px;
  padding:7px 12px;
  font-size:13px;
  animation: logIn .35s ease both;
}
.log-item[data-type="import"]{ border-left-color:#6aa8f0; }
.log-item[data-type="draw"]{ border-left-color:#ffd75e; }
.log-item[data-type="reset"]{ border-left-color:#f0a020; }
.log-item[data-type="delete"]{ border-left-color:#e05a4a; }
.log-item[data-type="clear"]{ border-left-color:#5fb8e8; }
.log-item[data-type="wipe"]{ border-left-color:#e05a4a; }
@keyframes logIn{
  from{ opacity:0; transform:translateY(-6px); }
  to{ opacity:1; transform:none; }
}
.log-time{
  flex:0 0 auto; font-size:12px; color:rgba(255,233,168,.55);
  font-variant-numeric: tabular-nums;
}
.log-type{ flex:0 0 auto; font-size:14px; }
.log-msg{ flex:1; color:#ffe9a8; line-height:1.5; word-break:break-all; }
.log-empty{ color:rgba(255,233,168,.5); font-size:13px; padding:20px 4px; text-align:center; }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:92px; transform:translateX(-50%) translateY(16px);
  z-index:30; pointer-events:none;
  background: rgba(10,0,0,.82);
  color:var(--gold);
  padding:11px 26px; border-radius:30px;
  font-size:15px; letter-spacing:1px;
  border:1px solid rgba(255,215,94,.4);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  opacity:0; transition: all .3s ease;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px){
  .admin-cols{ grid-template-columns: 1fr; }
  .log-list{ max-height:320px; }
}
@media (max-width: 900px){
  .lantern-l{ left:1vw; } .lantern-r{ right:1vw; }
  .stamp{ display:none; }
  .header-inner{ gap:10px; }
  .sheep svg{ width:54px; height:54px; }
  .grid{ grid-template-columns: repeat(3, 1fr); gap:8px; }
  .controls{ gap:10px; padding:10px 14px; }
  .btn{ padding:9px 16px; font-size:14px; letter-spacing:1px; }
  .btn-start{ font-size:16px; padding:11px 22px; }
}
@media (max-width: 560px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .admin-head{ flex-direction:column; gap:10px; }
}
