/* 抽奖页面 - 与Zibll主题协调 */
.lottery-page {
  background: var(--body-bg-color);
  min-height: 80vh;
  padding: 20px 15px;
}

.lottery-container {
  max-width: 800px;
  margin: 0 auto;
}

.lottery-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--key-color);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.lottery-subtitle {
  text-align: center;
  color: var(--muted-2-color);
  font-size: 13px;
  margin-bottom: 20px;
}

/* 积分栏 */
.user-points-bar {
  background: var(--main-bg-color);
  border-radius: var(--main-radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 0 10px var(--main-shadow);
}

.points-info {
  font-size: 14px;
  color: var(--main-color);
}

.points-value {
  color: var(--focus-color);
  font-weight: 700;
  font-size: 18px;
}

.cost-info {
  color: var(--muted-2-color);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vip-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.points-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.original-price {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 12px;
}

.discount-price {
  color: var(--focus-color);
  font-weight: 600;
  font-size: 14px;
}

.login-prompt {
  background: var(--main-bg-color);
  border-radius: var(--main-radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 0 10px var(--main-shadow);
}

.login-prompt p {
  color: var(--muted-color);
  margin-bottom: 12px;
}

/* 转盘区域 */
.wheel-section {
  text-align: center;
  margin-bottom: 24px;
}

.wheel-wrapper {
  position: relative;
  display: inline-block;
  padding: 16px;
  background: var(--main-bg-color);
  border-radius: 50%;
  box-shadow: 0 4px 20px var(--main-shadow);
}

.wheel-canvas {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

/* 跑马灯 */
.wheel-lights {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 372px;
  height: 372px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.wheel-light {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--focus-color);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--focus-color);
  opacity: 0.8;
}

.wheel-lights .wheel-light:nth-child(odd) {
  animation: lightPulse 1.2s ease-in-out infinite;
}

.wheel-lights .wheel-light:nth-child(even) {
  animation: lightPulse 1.2s ease-in-out infinite 0.6s;
}

@keyframes lightPulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* 指针 */
.wheel-pointer {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 32px;
  background: linear-gradient(180deg, var(--focus-color) 0%, color-mix(in srgb, var(--focus-color) 70%, #000) 100%);
  border-radius: 4px 4px 0 0;
  z-index: 20;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid color-mix(in srgb, var(--focus-color) 70%, #000);
}

.wheel-pointer.vibrate {
  animation: pointerShake 0.08s ease-in-out 3;
}

@keyframes pointerShake {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(3deg); }
}

/* 中心 */
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--main-bg-color);
  border-radius: 50%;
  border: 3px solid var(--focus-color);
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* 抽奖按钮 */
.spin-btn {
  display: block;
  width: 180px;
  margin: 20px auto;
  padding: 12px 0;
  background: var(--focus-color);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px var(--focus-shadow-color);
}

.spin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--focus-shadow-color);
}

.spin-btn:disabled {
  background: var(--muted-3-color);
  color: var(--muted-2-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 中奖弹窗 */
.prize-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.prize-modal.show {
  display: flex !important;
}

.prize-modal-content {
  position: relative;
  background: var(--main-bg-color);
  border-radius: var(--main-radius);
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  overflow: hidden;
}

.sunburst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, var(--focus-color-opacity1, rgba(240,68,148,0.1)) 10deg, transparent 20deg);
  border-radius: 50%;
  animation: sunRotate 12s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes sunRotate {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.prize-modal-inner {
  position: relative;
  z-index: 1;
}

.prize-modal h2 {
  color: var(--focus-color);
  font-size: 22px;
  margin-bottom: 16px;
}

.prize-card {
  background: var(--muted-border-color);
  border-radius: var(--main-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.prize-card .prize-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.prize-card .prize-title {
  color: var(--focus-color);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.prize-card .prize-cdk {
  display: block;
  background: var(--body-bg-color);
  padding: 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  color: var(--main-color);
  word-break: break-all;
  margin-top: 12px;
}

.prize-modal-close {
  background: var(--focus-color);
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.prize-modal-close:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px var(--focus-shadow-color);
}

/* 信息卡片 */
.info-card {
  background: var(--main-bg-color);
  border-radius: var(--main-radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 0 10px var(--main-shadow);
}

.info-card h3 {
  font-size: 15px;
  color: var(--key-color);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--main-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 记录表格 */
.record-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table th {
  text-align: left;
  color: var(--muted-2-color);
  font-weight: 400;
  padding: 8px 0;
  border-bottom: 1px solid var(--main-border-color);
  font-size: 12px;
}

.record-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--muted-border-color);
  font-size: 13px;
  color: var(--main-color);
}

.record-table .prize-col {
  color: var(--focus-color);
  font-weight: 500;
}

.record-table .code-col {
  color: var(--muted-color);
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  max-width: 160px;
}

.record-table .time-col {
  color: var(--muted-2-color);
  text-align: right;
  font-size: 11px;
}

/* 概率网格 */
.prob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.prob-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--muted-border-color);
  border-radius: 6px;
}

.prob-item .name {
  color: var(--main-color);
  font-size: 13px;
}

.prob-item .rate {
  color: var(--focus-color);
  font-weight: 600;
  font-size: 13px;
}

.prob-item .stock {
  color: var(--muted-2-color);
  font-size: 11px;
  margin-left: 4px;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--muted-2-color);
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.clear-btn:hover {
  opacity: 1;
}

/* 响应式 */
@media (max-width: 520px) {
  .lottery-title {
    font-size: 20px;
  }
  
  .wheel-wrapper {
    padding: 12px;
  }
  
  .wheel-canvas {
    width: 280px;
    height: 280px;
  }
  
  .wheel-lights {
    width: 304px;
    height: 304px;
  }
  
  .prob-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .record-table .code-col {
    max-width: 100px;
  }
  
  .prize-modal-content {
    padding: 24px 16px;
  }
}