/* ============================================
   幸运抽奖系统 - 样式表
   ============================================ */

/* Inter 字体 — 英文/数字专用，国内 CDN 加速加载 */
@import url('https://fonts.loli.net/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base: #091424;
  --bg-card: #0f1f36;
  --bg-card-hover: #142742;
  --bg-elevated: #182c4a;
  --border: #1e3660;
  --border-light: #2a4572;
  --text-primary: #edf2f9;
  --text-secondary: #a8bedb;
  --text-muted: #6588b0;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-dim: rgba(249, 115, 22, 0.15);
  --success: #10b981;
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --info: #38bdf8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 15% 8%, rgba(249, 115, 22, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 90%, rgba(56, 189, 248, 0.04) 0%, transparent 55%),
    linear-gradient(160deg, #0c1a30 0%, #091424 40%, #0a1628 70%, #0d1e38 100%);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* 字体渲染优化：深色主题下关闭子像素渲染，避免模糊 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============ 动态背景 ============ */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block; /* 消除 inline 行高占位 */
}

/* 渐变光斑 */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  display: block;
}

.bg-glow-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.35), rgba(249, 115, 22, 0.08) 50%, transparent 75%);
  top: -220px;
  right: -150px;
  opacity: 0.5;
  animation: glowDrift1 22s ease-in-out infinite alternate;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), rgba(56, 189, 248, 0.06) 50%, transparent 75%);
  bottom: -220px;
  left: -150px;
  opacity: 0.45;
  animation: glowDrift2 28s ease-in-out infinite alternate;
}

.bg-glow-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.18), rgba(249, 115, 22, 0.03) 50%, transparent 75%);
  top: 45%;
  left: 40%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  animation: glowDrift3 18s ease-in-out infinite alternate;
}

/* 第四个光斑：深蓝平衡 */
.bg-glow-4 {
  position: fixed;
  display: block;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(30, 78, 140, 0.3), transparent 70%);
  top: 55%;
  right: 10%;
  opacity: 0.35;
  animation: glowDrift4 24s ease-in-out infinite alternate;
}

@keyframes glowDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  40%  { transform: translate(-90px, 70px) scale(1.1); }
  100% { transform: translate(50px, -40px) scale(0.95); }
}

@keyframes glowDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  40%  { transform: translate(70px, -90px) scale(1.08); }
  100% { transform: translate(-50px, 50px) scale(0.92); }
}

@keyframes glowDrift3 {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-40%, -60%) scale(1.2); }
  100% { transform: translate(-60%, -40%) scale(0.9); }
}

@keyframes glowDrift4 {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-60px, 40px); }
  100% { transform: translate(30px, -30px); }
}

/* 抽奖时全局脉冲 */
#app.drawing .bg-glow-1 { opacity: 0.7; transition: opacity 0.5s; }
#app.drawing .bg-glow-2 { opacity: 0.65; transition: opacity 0.5s; }
#app.drawing .bg-glow-3 { opacity: 0.4; transition: opacity 0.5s; }
#app.drawing .bg-glow-4 { opacity: 0.55; transition: opacity 0.5s; }

#app.celebrating .bg-glow-1 { opacity: 0.9; transition: opacity 0.3s; animation-duration: 3s; }
#app.celebrating .bg-glow-2 { opacity: 0.85; transition: opacity 0.3s; animation-duration: 3s; }
#app.celebrating .bg-glow-3 { opacity: 0.6; transition: opacity 0.3s; animation-duration: 3s; }
#app.celebrating .bg-glow-4 { opacity: 0.75; transition: opacity 0.3s; animation-duration: 3s; }

#app {
  position: relative;
  z-index: 1;
}

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 20, 36, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30, 54, 96, 0.7);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  user-select: none;
}

.logo svg {
  flex-shrink: 0;
  transition: filter 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.logo:hover svg {
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.4));
  transform: scale(1.08);
}

.logo span {
  text-shadow: 0 0 12px rgba(249,115,22,0.2);
  transition: text-shadow 0.3s ease;
}

.logo:hover span {
  text-shadow: 0 0 16px rgba(249,115,22,0.4);
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-tab.active { color: var(--accent); background: var(--accent-dim); }

/* ============ Main & Tabs ============ */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============ DRAW TAB ============ */
.draw-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 16px;
  min-height: calc(100vh - 108px);
}

/* -- Control Panel -- */
.draw-control {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prize-selector-card,
.draw-count-card,
.options-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.draw-prob-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  max-height: 240px;
  overflow-y: auto;
}

.draw-prob-panel.hidden { display: none; }

.draw-prob-header {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.draw-prob-list { display: flex; flex-direction: column; gap: 6px; }

.draw-prob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.draw-prob-name {
  width: 56px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.draw-prob-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.draw-prob-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.draw-prob-pct {
  width: 40px;
  text-align: right;
  color: var(--text-muted);
  flex-shrink: 0;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.select-field {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.select-field:focus { border-color: var(--accent); }

.count-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-btn:hover { background: var(--border); }

.count-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

.count-input:focus { border-color: var(--accent); }
.count-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-row:hover { color: var(--text-primary); }

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-draw {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-draw::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fb923c, #f97316);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-draw:hover:not(:disabled)::before { opacity: 1; }
.btn-draw:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(249,115,22,0.4); }
.btn-draw:active:not(:disabled) { transform: scale(0.98); }
.btn-draw:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-draw-text {
  position: relative;
  z-index: 1;
}

/* 动态省略号：绝对定位避免宽度变化导致"抽奖中"文字跳动 */
.btn-draw.spinning .btn-draw-text::after {
  content: '...';
  position: absolute;
  left: 100%;
  top: 0;
  display: inline-block;
  width: 1.5em;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: baseline;
  animation: ellipsis 1s steps(4, end) infinite;
}

@keyframes ellipsis {
  0%  { width: 0; }
  25% { width: 0.5em; }
  50% { width: 1em; }
  75% { width: 1.5em; }
}

.btn-secondary {
  width: 100%;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover { color: var(--text-primary); border-color: var(--border-light); }

.stats-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.stat-item { text-align: center; }

.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* -- 摇奖机 -- */
.draw-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 舞台光晕 */
.stage-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: radial-gradient(ellipse at center, rgba(249,115,22,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s;
}

#app.drawing .stage-glow {
  background: radial-gradient(ellipse at center, rgba(249,115,22,0.18) 0%, transparent 60%);
}

#app.celebrating .stage-glow {
  background: radial-gradient(ellipse at center, rgba(249,115,22,0.3) 0%, rgba(249,115,22,0.1) 40%, transparent 70%);
  animation: stageGlowPulse 0.5s ease-in-out infinite alternate;
}

@keyframes stageGlowPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ============ 转球机 ============ */

.ball-machine {
  width: 100%;
  max-width: 640px;
  height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  overflow: visible;
  z-index: 0;
}

/* 抽奖时外发光 */
#app.drawing .ball-machine #ball-canvas {
  filter: drop-shadow(0 0 20px rgba(249,115,22,0.35));
}
#app.celebrating .ball-machine #ball-canvas {
  filter: drop-shadow(0 0 36px rgba(249,115,22,0.55));
}

#ball-canvas {
  width: 100%;
  height: 100%;
  display: block;
  transition: filter 0.3s;
}

/* 空状态提示 */
.ball-machine-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.ball-machine-label.has-winners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  white-space: normal;
  max-width: 90%;
  max-height: 80px;
  overflow-y: auto;
  bottom: 6px;
}

.multi-winner-tag {
  background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(249,115,22,0.06));
  border: 1px solid rgba(249,115,22,0.4);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(249,115,22,0.3);
  animation: tagIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.5) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 弹出球 - 更大更醒目 */
.ball-out {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
}

.ball-out-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6), 0 0 16px rgba(0,0,0,0.3);
  letter-spacing: 1px;
  text-align: center;
  padding: 8px;
  word-break: break-all;
  line-height: 1.2;
  box-shadow:
    0 10px 40px rgba(0,0,0,0.5),
    0 0 30px rgba(249,115,22,0.5),
    0 0 60px rgba(249,115,22,0.2),
    inset 0 2px 6px rgba(255,255,255,0.25),
    inset 0 -4px 8px rgba(0,0,0,0.2);
  transform: translateY(0) scale(0);
  opacity: 0;
  transition: none;
  position: relative;
}

/* 球面高光伪元素 */
.ball-out-inner::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 18%;
  width: 35%;
  height: 28%;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  filter: blur(2px);
  pointer-events: none;
}

.ball-out.ejected .ball-out-inner {
  animation: ballEject 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards,
             ballPulse 2s ease-in-out 0.8s infinite alternate;
}

@keyframes ballEject {
  0%   { transform: translateY(30px) scale(0);   opacity: 0; }
  25%  { transform: translateY(-20px) scale(1.2); opacity: 1; }
  50%  { transform: translateY(-80px) scale(1);   opacity: 1; }
  70%  { transform: translateY(-90px) scale(1.05); opacity: 1; }
  85%  { transform: translateY(-85px) scale(0.98); opacity: 1; }
  100% { transform: translateY(-88px) scale(1);   opacity: 1; }
}




@keyframes ballPulse {
  from { box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 30px rgba(249,115,22,0.4), 0 0 60px rgba(249,115,22,0.15), inset 0 2px 6px rgba(255,255,255,0.25); transform: translateY(-88px) scale(1); }
  to   { box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 50px rgba(249,115,22,0.7), 0 0 100px rgba(249,115,22,0.3), inset 0 2px 6px rgba(255,255,255,0.25); transform: translateY(-88px) scale(1.03); }
}




/* ============ Canvas 粒子背景 ============ */
#stage-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============ 震屏效果已移除 ============ */

/* -- Winners Panel -- */
.draw-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.results-header h3 { font-size: 14px; font-weight: 600; }

.winners-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 280px);
}

/* 空状态 */
.winners-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 8px;
  color: var(--text-muted);
}
.winners-empty svg { opacity: 0.4; margin-bottom: 4px; }
.winners-empty p { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin: 0; }
.winners-empty span { font-size: 12px; opacity: 0.7; }

/* 统计摘要 */
.winners-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(249,115,22,0.02));
  border-bottom: 1px solid var(--border);
}
.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.summary-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.summary-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* 按奖项分组 */
.winner-group {
  border-bottom: 1px solid var(--border);
  animation: groupFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.winner-group:last-child { border-bottom: none; }

@keyframes groupFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  position: sticky;
  top: 0;
  z-index: 2;
}
/* P2-2 fix: 支持 color-mix 的浏览器使用奖品色 */
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .group-header {
    background: linear-gradient(90deg, color-mix(in srgb, var(--prize-color, #f97316) 8%, transparent), transparent 70%);
  }
}
.group-emoji { font-size: 16px; }
.group-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--prize-color, var(--accent));
  flex: 1;
}
.group-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* 中奖者卡片 */
.group-members {
  display: flex;
  flex-direction: column;
  padding: 4px 8px 8px;
  gap: 4px;
}

.winner-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  animation: cardSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

.winner-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateX(2px);
}
/* P2-2 fix: 支持 color-mix 的浏览器使用奖品色 */
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .winner-card:hover {
    border-color: color-mix(in srgb, var(--prize-color, var(--accent)) 30%, transparent);
  }
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 头像色块 */
.winner-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.winner-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.winner-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.winner-card-time {
  font-size: 12px;
  color: var(--text-muted);
}

.winner-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.5;
  min-width: 14px;
  text-align: right;
}

/* 保留旧样式兼容（历史弹窗等场景） */
.winner-entry {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.winner-entry .prize-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}
.winner-entry .winner-name { font-weight: 600; flex: 1; }
.winner-entry .winner-time { font-size: 12px; color: var(--text-muted); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

/* 清空按钮 */
.btn-clear-results {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.btn-clear-results:hover {
  color: var(--danger);
  background: var(--danger-dim);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-clear-results svg {
  flex-shrink: 0;
}

/* 底部操作栏 */
.results-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.btn-export-results {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-export-results:hover {
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.3);
  background: var(--accent-dim);
}
.btn-export-results svg {
  flex-shrink: 0;
}

/* ============ MEMBERS TAB ============ */
.members-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: start;
}

.import-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.import-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.import-tab {
  flex: 1;
  padding: 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.import-tab:hover { color: var(--text-primary); }
.import-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.import-panel { display: none; }
.import-panel.active { display: block; animation: fadeIn 0.2s ease; }

.import-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.import-hint code {
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--accent);
}

.textarea-field {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.6;
}

.textarea-field:focus { border-color: var(--accent); }

.import-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }

.btn-danger {
  padding: 8px 16px;
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover { background: var(--danger); color: #fff; }

.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-secondary);
}

.file-drop-zone p { font-size: 14px; font-weight: 500; }
.file-drop-zone span { font-size: 12px; }

.file-label {
  cursor: pointer;
  display: inline-block;
}

.file-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  max-height: 150px;
  overflow-y: auto;
  margin-top: 8px;
}

.file-preview.hidden { display: none; }

.col-map {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

.col-map.hidden { display: none; }
.col-map h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text-secondary); }

.col-map-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.col-map-row label { width: 120px; flex-shrink: 0; }

.select-sm { width: 160px; padding: 6px 10px; }

/* -- Members Panel -- */
.members-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.members-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.members-panel-header h3 { font-size: 15px; font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  margin-left: 6px;
}

.members-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 160px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); width: 200px; }

.bulk-weight {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.bulk-weight .count-input {
  width: 70px;
  padding: 4px 8px;
  font-size: 13px;
  height: 30px;
}

.table-wrap {
  flex: 1;
  overflow: auto;
  max-height: calc(100vh - 300px);
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.members-table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.members-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(45,49,72,0.5);
  color: var(--text-primary);
}

.members-table tbody tr:hover td { background: var(--bg-card-hover); }

.members-table .weight-input {
  width: 70px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  outline: none;
}

.members-table .weight-input:focus { border-color: var(--accent); }

.prob-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prob-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
  min-width: 2px;
}

.prob-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.group-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 14px;
}

.btn-icon:hover { color: var(--danger); background: var(--danger-dim); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.members-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* ============ PRIZES TAB ============ */
.prizes-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  align-items: start;
}

.prizes-config {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.prizes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.prizes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prize-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: var(--transition);
}

.prize-card:hover { border-color: var(--border-light); }

.prize-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.prize-emoji-btn {
  width: 40px;
  height: 40px;
  font-size: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.prize-emoji-btn:hover { border-color: var(--accent); }

.prize-name-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
}

.prize-name-input:focus { border-color: var(--accent); }

.prize-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.prize-delete-btn:hover { color: var(--danger); background: var(--danger-dim); }

.prize-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.prize-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prize-field label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prize-field input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.prize-field input:focus { border-color: var(--accent); }

.prize-color-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prize-color-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
}

/* -- Prob Config -- */
.prob-config {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.prob-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.prob-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.prob-mode-card:hover { border-color: var(--border-light); }
.prob-mode-card.active { border-color: var(--accent); background: var(--accent-dim); }

.mode-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }

.mode-info strong { display: block; font-size: 13px; margin-bottom: 4px; }
.mode-info p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.prob-preview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.prob-preview-card h4 {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-weight: 600;
}

.prob-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.prob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.prob-row-name { width: 80px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

.prob-row-bar-wrap { flex: 1; height: 8px; background: var(--bg-card); border-radius: 4px; overflow: hidden; }

.prob-row-bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s ease; }

.prob-row-pct { width: 45px; text-align: right; color: var(--text-muted); flex-shrink: 0; }

/* ============ HISTORY TAB ============ */
.history-layout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-actions { display: flex; gap: 8px; }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-round {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-round-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.history-round-header:hover { background: var(--bg-card-hover); }

.history-time { font-size: 12px; color: var(--text-muted); }
.history-prize { font-weight: 600; font-size: 13px; }
.history-count { font-size: 12px; color: var(--text-secondary); margin-left: auto; }

/* U4: 展开箭头旋转动画 */
.history-arrow {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.history-arrow.expanded {
  transform: rotate(180deg);
}

.history-round-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-top: 0;
  padding-bottom: 0;
}

.history-round-body.expanded {
  max-height: 400px;
  padding: 12px 16px;
}

.history-name-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

/* U5: 用 opacity + pointer-events 替代 display:none，实现关闭动画 */
.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: flex; /* 保留 flex 以维持居中布局，靠 opacity 控制可见性 */
}

.modal-overlay.hiding .modal {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 380px;
  box-shadow: var(--shadow);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* 确认弹窗 */
.modal-confirm {
  width: 400px;
}
.modal-confirm h3 {
  color: var(--danger);
}
.confirm-message {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-field .hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

.input-field {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.input-field:focus { border-color: var(--accent); }

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* Winner Modal */
.winner-modal {
  width: 560px;
  max-width: 92vw;
  padding: 48px;
  text-align: center;
  background: linear-gradient(145deg, #0f1f36, #091424, #0d1e38);
  border-color: var(--accent);
  border-width: 2px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 80px rgba(249,115,22,0.12),
    0 0 160px rgba(109,80,245,0.08),
    inset 0 0 60px rgba(0,0,0,0.4);
}

/* 弹窗内光效 */
.winner-modal::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(249,115,22,0.05), transparent, rgba(249,115,22,0.03), transparent);
  animation: winnerRotate 8s linear infinite;
  pointer-events: none;
}

@keyframes winnerRotate {
  to { transform: rotate(360deg); }
}

.winner-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.winner-content { position: relative; z-index: 1; }

.winner-trophy {
  font-size: 72px;
  animation: trophyBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(249,115,22,0.5));
}

@keyframes trophyBounce {
  0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
  50%  { transform: scale(1.2) rotate(5deg); }
  70%  { transform: scale(0.95) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.winner-modal h2 {
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 28px;
  text-shadow: 0 0 30px rgba(249,115,22,0.4);
  letter-spacing: 2px;
}

.winner-names {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 36px;
}

.winner-name-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(249,115,22,0.05));
  border: 1px solid rgba(249,115,22,0.4);
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  animation: nameIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  text-shadow: 0 0 15px rgba(249,115,22,0.3);
  position: relative;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.winner-name-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(249,115,22,0.1), transparent);
  animation: nameCardShimmer 2s ease-in-out infinite;
}

@keyframes nameCardShimmer {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

@keyframes nameIn {
  0%   { opacity: 0; transform: translateY(30px) scale(0.8); }
  60%  { transform: translateY(-5px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Confetti */
.confetti-piece {
  position: absolute;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  30%  { opacity: 1; }
  60%  { transform: translateY(300px) rotate(360deg) scale(0.8); opacity: 0.7; }
  100% { transform: translateY(600px) rotate(720deg) scale(0.3); opacity: 0; }
}

/* 星星爆炸效果 */
.star-burst {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: starBurst 1s ease-out forwards;
}

@keyframes starBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  50%  { opacity: 0.8; }
  100% { opacity: 0; }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 31, 54, 0.6); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(42, 69, 114, 0.8); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(79, 106, 148, 0.9); }

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 280px;
}

.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ Drawn Member ============ */
.members-table tbody tr.drawn td {
  opacity: 0.6;
}

.members-table tbody tr.drawn:hover td {
  background: var(--bg-card);
}

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .draw-layout { grid-template-columns: 220px 1fr 220px; }
}

@media (max-width: 960px) {
  .draw-layout { grid-template-columns: 1fr; }
  /* N12: 手机端调整顺序——转球机最突出，中奖名单紧跟其后，控制区放底部 */
  .draw-stage { order: 1; }
  .draw-results { order: 2; }
  .draw-control { order: 3; }
  .members-layout { grid-template-columns: 1fr; }
  .prizes-layout { grid-template-columns: 1fr; }
  .ball-machine { height: 420px; }
}

@media (max-width: 640px) {
  .main { padding: 12px; }
  .header-inner { padding: 0 12px; gap: 12px; }
  .nav-tab { padding: 6px 10px; font-size: 12px; }
  .ball-machine { height: 360px; }
  .ball-out-inner { width: 76px; height: 76px; font-size: 13px; }
  .ball-out-inner::before { top: 8%; left: 15%; width: 30%; height: 24%; }
  /* U6: winner-modal 小屏适配 */
  .winner-modal { padding: 28px 20px; }
  .winner-modal h2 { font-size: 24px; }
  .winner-trophy { font-size: 54px; }
  .winner-name-card { font-size: 18px; padding: 10px 20px; }
}
