/* 抽奖组件样式 */
.lottery-widget {
    margin: 20px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-in;
    box-sizing: border-box;
    max-width: 800px;
    overflow: hidden;
}

/* 移动端适配 - 抵消父容器的 padding */
@media (max-width: 768px) {
    .lottery-widget {
        margin-left: -25px !important;
        margin-right: -25px !important;
        border-radius: 0 !important;
        width: calc(100% + 50px) !important;
        max-width: none !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lottery-widget-inner {
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 20px;
}

.lottery-title {
    text-align: center;
    margin-bottom: 20px;
}

.lottery-title h3 {
    margin: 0;
    color: #667eea;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lottery-prizes {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.lottery-prize-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    transition: transform 0.2s;
}

.lottery-prize-item:hover {
    transform: translateX(5px);
}

.lottery-status {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.lottery-status.pending {
    background: #fff3cd;
}

.lottery-status.drawn {
    background: #d4edda;
}

.lottery-winners {
    margin-bottom: 15px;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
}

.lottery-winner-item {
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: all 0.3s;
}

.lottery-winner-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lottery-winner-item.is-me {
    border: 2px solid #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

.lottery-participate {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #667eea;
}

.lottery-btn {
    padding: 10px 30px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.lottery-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.lottery-warning {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.lottery-warning.password {
    background: #fff3cd;
    color: #856404;
}

.lottery-warning.limit {
    background: #f8d7da;
    color: #721c24;
}

/* 响应式 */
@media (max-width: 768px) {
    .lottery-widget {
        padding: 12px !important;
        margin: 15px 0 !important;
        border-radius: 12px !important;
        max-width: 100% !important;
    }
    
    .lottery-widget-inner {
        padding: 10px;
    }
    
    .lottery-title h3 {
        font-size: 18px;
    }
    
    /* 移动端统计卡片减少间距和内边距 */
    .lottery-stats-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 20px !important;
    }
    
    .lottery-stat-card {
        padding: 16px 10px !important;
        min-height: 110px !important;
        min-width: auto !important;
    }
    
    .lottery-stat-card > div:first-child {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    
    .lottery-stat-card > div:nth-child(2) {
        font-size: 24px !important;
    }
    
    /* 移动端标题区域优化 */
    .lottery-widget h3 {
        font-size: 18px !important;
    }
    
    /* 移动端奖品展示区域 */
    .lottery-widget > div > div[style*="奖品内容"] {
        padding: 15px !important;
    }
    
    /* 移动端参与成功消息 */
    .lottery-widget div[style*="参与成功"] {
        padding: 16px 20px !important;
    }
    
    .lottery-widget div[style*="参与成功"] > div:first-child {
        width: 40px !important;
        height: 40px !important;
    }
    
    .lottery-widget div[style*="参与成功"] svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* 移动端中奖者卡片布局 */
    .lottery-winner-item {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    
    /* 移动端头像缩小 */
    .lottery-winner-item .winner-avatar {
        width: 48px !important;
        height: 48px !important;
    }
    
    /* 移动端中奖者信息区域 - 占满第一行 */
    .lottery-winner-item .winner-info {
        flex: 0 0 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* 移动端隐藏桌面端的标签和奖品信息 */
    .lottery-winner-item .desktop-badge,
    .lottery-winner-item .desktop-prize,
    .lottery-winner-item .desktop-btn {
        display: none !important;
    }
    
    /* 移动端显示移动端专用元素 */
    .lottery-winner-item .mobile-actions {
        display: flex !important;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }
    
    .lottery-winner-item .mobile-actions .mobile-btn {
        flex: 1;
        min-width: 0;
    }
    
    .lottery-winner-item .mobile-prize {
        display: block !important;
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
}

/* 卡密弹窗 */
.lottery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.lottery-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lottery-card-code {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    word-break: break-all;
    user-select: all;
}
