/**
 * 抽奖系统前端样式
 */

/* 容器样式 */
.b2-lucky-draw-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.b2-lucky-draw-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.b2-lucky-draw-header h2 {
    font-size: 28px;
    margin: 0 0 5px;
    color: #333;
    font-weight: 700;
}

.b2-lucky-draw-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 15px;
}

/* 顶部信息栏 */
.b2-lucky-draw-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px auto;
    padding: 5px 10px;
    font-size: 13px;
}

.b2-lucky-draw-draw-count {
    font-size: 14px;
    color: #555;
    background-color: #f7f7f7;
    padding: 3px 10px;
    border-radius: 15px;
}

.b2-lucky-draw-draw-count span {
    color: #ff5722;
    font-weight: bold;
    margin: 0 2px;
}

.b2-lucky-draw-mode {
    background-color: #ff5722;
    color: #fff;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.b2-lucky-draw-mode.credit-mode {
    background-color: #4CAF50;
}

.b2-lucky-draw-mode.balance-mode {
    background-color: #FF9800;
}

.b2-lucky-draw-mode.disabled-mode {
    background-color: #9e9e9e;
}

.b2-lucky-draw-admin-link a {
    color: #1e88e5;
    text-decoration: none;
    font-size: 14px;
    background-color: #f7f7f7;
    padding: 3px 10px;
    border-radius: 15px;
}

.b2-lucky-draw-admin-link a:hover {
    background-color: #e0e0e0;
}

.b2-lucky-draw-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

/* 九宫格抽奖区域样式 */
.b2-lucky-draw-grid-container {
    width: 395px;
    height: 459px;
    flex: 0 0 438px;
}

.b2-lucky-draw-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-gap: 8px;
    padding: 10px;
    background: #f7f7f7;
    border-radius: 10px;
    border: 4px solid #ffc107;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.b2-lucky-draw-grid-item {
    background-color: #FFFFFF;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.b2-lucky-draw-grid-item.grid-item-prize {
    cursor: default;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

/* 闪光效果 */
@keyframes shine {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.prize-highlight::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.1) 75%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 200%;
    z-index: 10;
    pointer-events: none;
    animation: shine 1.2s linear infinite;
}

/* 更平滑的悬停效果 */
.b2-lucky-draw-grid-item.grid-item-prize:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: #ffc107;
    transition: all 0.3s ease-out;
}

.b2-lucky-draw-grid-item.grid-item-button {
    background: linear-gradient(145deg, #ff5722, #ff7043);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
    transition: all 0.3s ease;
}

.b2-lucky-draw-grid-item.grid-item-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 87, 34, 0.4);
}

.b2-lucky-draw-grid-item.active {
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.7);
    z-index: 5;
    border: 2px solid #ffc107;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.b2-lucky-draw-start-button {
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    color: #fff;
    font-size: clamp(16px, 4vw, 18px); /* 响应式字体大小 */
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    
    /* 移动端优化新增 */
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    touch-action: manipulation; /* 优化触摸响应 */
    padding: 0; /* 确保统一间距 */
    margin: 0; /* 确保统一间距 */
    border-radius: 0; /* 如果需要圆角可调整 */
    user-select: none; /* 防止文字被选中 */
}

.b2-lucky-draw-start-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(145deg, #9e9e9e, #757575);
    color: #fff;
}

.b2-lucky-draw-grid-item.grid-item-button .b2-lucky-draw-start-button.disabled {
    background: linear-gradient(145deg, #9e9e9e, #757575);
    opacity: 0.9;
    cursor: not-allowed;
    border-radius: 5px;
}

/* 次数用完的提示样式 */
.b2-lucky-draw-grid-item.grid-item-button .b2-lucky-draw-start-button.disabled::after {
    content: "今日抽奖次数已用完";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.b2-lucky-draw-grid-item.grid-item-button:hover .b2-lucky-draw-start-button.disabled::after {
    opacity: 1;
    visibility: visible;
}

.prize-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    position: relative;
}

.prize-stock {
    position: absolute;
    top: 3px;
    right: 3px;
    background-color: #FF5722;
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 8px;
    font-weight: bold;
}

.prize-image {
    width: 153px;
    height: 59px;
    margin-bottom: 5px;
}

.prize-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 奖品名称样式 */
.prize-name {
    font-size: 12px;
    color: #333;
    margin-top: 5px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-all;
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 40px;
}

/* 概率显示样式 */
.prize-probability {
    font-size: 11px;
    color: #FF5722;
    background-color: #FFF3E0;
    border-radius: 10px;
    padding: 1px 6px;
    margin-top: 4px;
    font-weight: bold;
    border: 1px dashed #FF9800;
    display: inline-block;
}

/* 中奖动画 */
@keyframes highlight {
    0% { transform: scale(1); border-color: #e0e0e0; box-shadow: 0 0 0 rgba(255, 193, 7, 0); }
    25% { transform: scale(1.05); border-color: #FFC107; box-shadow: 0 0 10px rgba(255, 193, 7, 0.5); }
    50% { transform: scale(1.1); border-color: #FF9800; box-shadow: 0 0 20px rgba(255, 193, 7, 0.8); }
    75% { transform: scale(1.05); border-color: #FFC107; box-shadow: 0 0 10px rgba(255, 193, 7, 0.5); }
    100% { transform: scale(1); border-color: #e0e0e0; box-shadow: 0 0 0 rgba(255, 193, 7, 0); }
}

.prize-highlight {
    animation: highlight 0.8s ease 3;
    border: 2px solid transparent;
    position: relative;
    z-index: 10;
}

/* 信息区域样式 */
.b2-lucky-draw-info {
    width: calc(100% - 380px);
    min-width: 300px;
    flex: 1;
}

/* 用户信息显示 */
.b2-lucky-draw-user-info {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    position: relative;
}

.b2-lucky-draw-user-credit,
.b2-lucky-draw-user-balance,
.b2-lucky-draw-user-draws,
.b2-lucky-draw-reset-time {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.b2-lucky-draw-user-credit span,
.b2-lucky-draw-user-balance span,
.b2-lucky-draw-user-draws span,
.b2-lucky-draw-reset-time span {
    font-weight: bold;
    color: #ff5722;
    margin-left: 116px;
}

.b2-lucky-draw-cost-info {
    margin-bottom: 15px;
}

.b2-lucky-draw-cost-item {
    margin-bottom: 10px;
    background: #f9f9f9;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.b2-lucky-draw-cost-item:hover {
    background: #f0f0f0;
}

.b2-lucky-draw-cost-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.b2-lucky-draw-cost-item input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.cost-value {
    color: #ff5722;
    font-weight: bold;
    margin: 0 3px;
}

/* 中奖提示区域的整体样式 */
.b2-lucky-draw-result {
    background-color: #fff;
    padding: 20px 15px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-in-out;
    display: none;
    border-left: 3px solid #ff5722;
}

/* 淡入动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 标题样式 */
.b2-lucky-draw-result-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

/* 内容区域样式 */
.b2-lucky-draw-result-content {
    font-size: 16px;
    color: #FF5722;
    line-height: 1.5;
    font-weight: 500;
}

/* 会员信息样式 */
.b2-lucky-draw-result-content .winner-vip-info {
    display: inline-block;
    color: #FF9800;
    font-weight: bold;
    background-color: #FFF8E1;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #FFE0B2;
}

/* 中奖名单样式 */
.b2-lucky-draw-winners {
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.winners-title {
    background-color: #f5f5f5;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #eee;
}

.winners-list {
    max-height: 250px;
    overflow-y: auto;
}

.winner-item {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.winner-item:last-child {
    border-bottom: none;
}

.winner-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
}

.winner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-info {
    flex: 1;
}

.winner-name {
    font-size: 13px;
    color: #333;
    font-weight: bold;
}

.winner-prize {
    font-size: 12px;
    color: #ff5722;
}

.winner-time {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

.winner-remaining {
    font-size: 11px;
    color: #666;
    margin-left: 3px;
    display: inline-block;
    background-color: #f5f5f5;
    padding: 0 4px;
    border-radius: 10px;
    line-height: 1.4;
}

/* 抽奖模式标签样式 */
.draw-mode-tag {
    font-size: 11px;
    margin-left: 4px;
    display: inline-block;
    padding: 0 6px;
    border-radius: 10px;
    line-height: 1.5;
    color: #fff;
}

.draw-mode-tag.credit-mode {
    background-color: #4CAF50; /* 积分模式使用绿色 */
}

.draw-mode-tag.balance-mode {
    background-color: #FF9800; /* 余额模式使用橙色 */
}

.no-winners {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* 抽奖规则样式 */
.b2-lucky-draw-rules {
    margin-top: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.rules-title {
    background-color: #f5f5f5;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.rules-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #ff5722;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    font-style: normal;
}

.rules-content {
    padding: 10px 15px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    background: #fff;
}

/* 抽奖记录样式 */
.b2-lucky-draw-records-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.b2-lucky-draw-records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.b2-lucky-draw-records-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.b2-lucky-draw-refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2-lucky-draw-refresh-button:hover {
    background: #e0e0e0;
    color: #333;
}

.b2-lucky-draw-refresh-button svg {
    margin-right: 5px;
}

.b2-lucky-draw-refresh-button.refreshing {
    pointer-events: none;
    opacity: 0.7;
}

.b2-lucky-draw-refresh-button.refreshing svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.b2-lucky-draw-records-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    background: #f9f9f9;
    border-radius: 8px;
}

.b2-lucky-draw-records-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    background-color: #fff;
}

.b2-lucky-draw-records-table th {
    background: linear-gradient(to bottom, #f8f8f8, #f2f2f2);
    font-weight: bold;
    font-size: 13px;
    padding: 12px 5px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.b2-lucky-draw-records-table td {
    padding: 12px 5px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #f5f5f5;
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
    color: #444;
    transition: background-color 0.2s ease;
}

/* 表格行悬停效果 */
.b2-lucky-draw-records-table tbody tr {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.b2-lucky-draw-records-table tbody tr:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
}

/* 奇数行和偶数行颜色区分 */
.b2-lucky-draw-records-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.b2-lucky-draw-records-table tbody tr:nth-child(even):hover {
    background-color: #f5f5f5;
}

/* 移动设备适配优化 */
@media (max-width: 768px) {
    .b2-lucky-draw-records-table {
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .b2-lucky-draw-records-table th {
        font-size: 12px;
        padding: 10px 4px;
    }
    
    .b2-lucky-draw-records-table td {
        padding: 10px 4px;
        font-size: 12px;
    }
    
    .record-number {
        font-size: 12px;
        width: 32px;
    }
    
    .record-number-single {
        width: 28px;
        height: 28px;
        line-height: 28px;
    }
    
    .b2-lucky-draw-records-table .draw-mode-tag {
        font-size: 9px;
        padding: 1px 5px;
    }
}

/* 记录状态样式 */
.record-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.record-status-0 {
    background-color: #FFB300;
    color: #fff;
}

.record-status-1 {
    background-color: #4CAF50;
    color: #fff;
}

.record-status-none {
    background-color: #9E9E9E;
    color: #fff;
}

/* 表格特定列的宽度设置 */
.b2-lucky-draw-records-table th:nth-child(6),
.b2-lucky-draw-records-table td:nth-child(6) {
    width: 90px; /* 为抽奖模式列微调宽度 */
    text-align: center;
}

/* 确保抽奖模式标签在表格中的显示更美观 */
.b2-lucky-draw-records-table .draw-mode-tag {
    font-size: 10px;
    padding: 2px 6px;
    margin: 0;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border-radius: 12px;
}

.b2-lucky-draw-records-table .draw-mode-tag.credit-mode {
    background-color: #4CAF50;
    background-image: linear-gradient(135deg, #4CAF50, #43A047);
}

.b2-lucky-draw-records-table .draw-mode-tag.balance-mode {
    background-color: #FF9800;
    background-image: linear-gradient(135deg, #FF9800, #F57C00);
}

/* 抽奖模式标签悬停效果 */
.b2-lucky-draw-records-table .draw-mode-tag {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.b2-lucky-draw-records-table td:nth-child(6):hover .draw-mode-tag {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* 修改响应式设置，确保在移动设备上正确显示重要列 */
@media (max-width: 768px) {
    .b2-lucky-draw-records-table th:nth-child(3),
    .b2-lucky-draw-records-table th:nth-child(4),
    .b2-lucky-draw-records-table td:nth-child(3),
    .b2-lucky-draw-records-table td:nth-child(4) {
        display: none; /* 在移动设备上隐藏类型和价值列 */
    }
    
    /* 确保抽奖模式列在移动设备上可见 */
    .b2-lucky-draw-records-table th:nth-child(6),
    .b2-lucky-draw-records-table td:nth-child(6) {
        display: table-cell;
        width: 80px;
    }
    
    /* 确保奖品名称列在移动设备上有合适的宽度 */
    .b2-lucky-draw-records-table th:nth-child(2),
    .b2-lucky-draw-records-table td:nth-child(2) {
        width: 30%;
    }
}

.b2-lucky-draw-records-pagination {
    margin-top: 15px;
    text-align: center;
}

.b2-lucky-draw-records-pagination .page-numbers {
    display: inline-block;
    padding: 4px 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.b2-lucky-draw-records-pagination .page-numbers.current {
    background: #ff5722;
    color: #fff;
    border-color: #ff5722;
}

.b2-lucky-draw-login-required {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #ff5722;
    font-weight: bold;
}

/* 数值变化动画 */
.number-change {
    position: absolute;
    font-size: 14px;
    font-weight: bold;
    animation: floatUp 2s ease-out;
    opacity: 0;
    right: -5px;
    top: -5px;
    z-index: 100;
}

.number-change.positive {
    color: #4CAF50;
}

.number-change.negative {
    color: #f44336;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .b2-lucky-draw-content {
        flex-direction: column;
    }
    
    .b2-lucky-draw-grid-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        flex: 0 0 auto;
    }
    
    .b2-lucky-draw-info {
        width: 100%;
    }
    
    .prize-image {
        width: 30px;
        height: 30px;
    }
    
    .prize-name {
        font-size: 10px;
        line-height: 1.1;
        margin-top: 3px;
        margin-bottom: 1px;
    }
    
    .prize-probability {
        font-size: 8px;
        padding: 0 3px;
        margin-bottom: 1px;
    }
    
    .winner-remaining {
        font-size: 9px;
        padding: 0 3px;
        margin-left: 2px;
    }
}

/* 库存为0的奖品样式 */
.b2-lucky-draw-grid-item.out-of-stock {
    opacity: 0.7;
}

.b2-lucky-draw-grid-item.out-of-stock .prize-stock {
    background-color: #9e9e9e;
}

.b2-lucky-draw-grid-item.out-of-stock::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    border-radius: 5px;
    pointer-events: none;
}

/* 奖品库存数量变化动画 */
@keyframes stockChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #ff5722; }
    100% { transform: scale(1); }
}

.stock-changed {
    animation: stockChange 0.5s ease;
}

/* 抽奖记录序号样式 */
.record-number {
    font-weight: bold;
    background-color: #ff5722;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 4px 0;
    width: 42px;
    display: inline-block;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* 序号背景渐变效果 */
.record-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0));
    pointer-events: none;
}

/* 单数序号样式 */
.record-number-single {
   width: 47px;
    height: 34px;
    padding: 0;
    line-height: 34px;
    border-radius: 20%;
    font-size: 16px;
    background-color: #ff7043;
}

/* 更好的行间隔效果 */
.b2-lucky-draw-records-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* 适配移动设备的表格样式 */
@media (max-width: 768px) {
    .b2-lucky-draw-records-table {
        table-layout: auto;
    }
    
    .b2-lucky-draw-records-table th,
    .b2-lucky-draw-records-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* 调整移动端列宽 */
    .b2-lucky-draw-records-table th:first-child,
    .b2-lucky-draw-records-table td:first-child {
        width: 40px;
    }
    
    /* 隐藏类型列，在移动端不是必要信息 */
    .b2-lucky-draw-records-table th:nth-child(3),
    .b2-lucky-draw-records-table td:nth-child(3) {
        display: none;
    }
    
    /* 在移动端确保其他列有合理的宽度 */
    .b2-lucky-draw-records-table td:nth-child(2) {
        width: 25%; /* 奖品名称列 */
    }
    
    .b2-lucky-draw-records-table td:nth-child(4),
    .b2-lucky-draw-records-table td:nth-child(5) {
        width: 15%; /* 价值和消费列 */
    }
    
    .record-number {
        font-size: 12px;
        padding: 4px 0;
        width: 36px;
    }
    
    .record-number-single {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 14px;
    }
}

/* 各列宽度设置 */
.b2-lucky-draw-records-table th:first-child,
.b2-lucky-draw-records-table td:first-child {
   width: 47px;
    text-align: center;
}

.b2-lucky-draw-records-table th:nth-child(2),
.b2-lucky-draw-records-table td:nth-child(2) {
    width: 12%;
    text-align: left;
    padding-left: 10px;
}

.b2-lucky-draw-records-table th:nth-child(3),
.b2-lucky-draw-records-table td:nth-child(3) {
    width: 10%;
    text-align: center;
}

.b2-lucky-draw-records-table th:nth-child(4),
.b2-lucky-draw-records-table td:nth-child(4) {
 width: 10%;
    text-align: right;
    padding-right: 10px;
}

.b2-lucky-draw-records-table th:nth-child(5),
.b2-lucky-draw-records-table td:nth-child(5) {
   width: 13%;
    text-align: right;
    padding-right: 28px;
}

.b2-lucky-draw-records-table th:nth-child(6),
.b2-lucky-draw-records-table td:nth-child(6) {
   width: 38px;
    text-align: center;
}

.b2-lucky-draw-records-table th:nth-child(7),
.b2-lucky-draw-records-table td:nth-child(7) {
    width: 13%;
    text-align: center;
}

.b2-lucky-draw-records-table th:nth-child(8),
.b2-lucky-draw-records-table td:nth-child(8) {
    width: 16%;
    text-align: center;
}

/* 表格行悬停效果 */
.b2-lucky-draw-records-table tbody tr {
    transition: background-color 0.2s ease;
}

.b2-lucky-draw-records-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* 奇数行和偶数行颜色区分 */
.b2-lucky-draw-records-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.b2-lucky-draw-records-table tbody tr:nth-child(even):hover {
    background-color: #f5f5f5;
}

/* 序号的悬停效果 */
.record-number {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

td:hover .record-number {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 各列内容的对齐方式 */
.b2-lucky-draw-records-table th {
    text-align: center; /* 表头居中对齐 */
}

/* 序列列居中对齐 */
.b2-lucky-draw-records-table td:first-child {
    text-align: center;
}

/* 奖品名称左对齐 */
.b2-lucky-draw-records-table td:nth-child(2) {
    text-align: left;
    padding-left: 10px;
}

/* 类型居中对齐 */
.b2-lucky-draw-records-table td:nth-child(3) {
    text-align: center;
}

/* 价值、消费列数字右对齐 */
.b2-lucky-draw-records-table td:nth-child(4),
.b2-lucky-draw-records-table td:nth-child(5) {
    text-align: right;
    padding-right: 10px;
}

/* 状态居中对齐 */
.b2-lucky-draw-records-table td:nth-child(6) {
    text-align: center;
}

/* 时间居中对齐 */
.b2-lucky-draw-records-table td:nth-child(7) {
    text-align: center;
}

/* 会员信息样式 */
.vip-info,
.winner-vip-info {
    display: inline-block;
    font-size: 12px;
    color: #FF9800;
    font-weight: bold;
    margin-left: 3px;
}

/* 九宫格中会员信息样式 */
.prize-name .vip-info {
    font-size: 11px;
    background-color: #FFF3E0;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
}

/* 中奖列表中会员信息样式 */
.winner-vip-info {
    color: #ff9800;
    font-size: 12px;
    background-color: rgba(255, 152, 0, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block !important;
    margin-left: 3px;
    border: 1px solid rgba(255, 152, 0, 0.3);
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
}

.winner-extended {
    color: #2196f3;
    font-size: 12px;
    background-color: rgba(33, 150, 243, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 3px;
    border: 1px solid rgba(33, 150, 243, 0.3);
    font-weight: bold;
}

.winner-permanent {
    color: #9c27b0;
    font-size: 12px;
    background-color: rgba(156, 39, 176, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 3px;
    border: 1px solid rgba(156, 39, 176, 0.3);
    font-weight: bold;
}

.winner-level-up {
    color: #f44336;
    font-size: 12px;
    background-color: rgba(244, 67, 54, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 3px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: bold;
}

/* 转换为余额的样式 */
.winner-converted {
    color: #f44336;
    font-size: 12px;
    background-color: rgba(244, 67, 54, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block !important;
    margin-left: 3px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: bold;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
}

/* 中奖记录表格中的会员转换样式 */
.b2-lucky-draw-records-table .winner-vip-info {
    color: #ff9800;
    font-size: 12px;
    background-color: rgba(255, 152, 0, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block !important;
    margin-left: 3px;
    border: 1px solid rgba(255, 152, 0, 0.3);
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
}

.b2-lucky-draw-records-table .winner-converted {
    color: #f44336;
    font-size: 12px;
    background-color: rgba(244, 67, 54, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 3px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: bold;
}

/* 会员转换类型的特殊标记 */
.prize-type-converted {
    display: inline-block;
    font-size: 12px;
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-weight: bold;
}

/* 修改响应式设置，确保在移动设备上正确显示重要列 */
@media (max-width: 768px) {
    .b2-lucky-draw-records-table th:nth-child(3),
    .b2-lucky-draw-records-table th:nth-child(4),
    .b2-lucky-draw-records-table td:nth-child(3),
    .b2-lucky-draw-records-table td:nth-child(4) {
        display: none; /* 在移动设备上隐藏类型和价值列 */
    }
    
    /* 确保抽奖模式列在移动设备上可见 */
    .b2-lucky-draw-records-table th:nth-child(6),
    .b2-lucky-draw-records-table td:nth-child(6) {
        display: table-cell;
        width: 80px;
    }
    
    /* 确保奖品名称列在移动设备上有合适的宽度 */
    .b2-lucky-draw-records-table th:nth-child(2),
    .b2-lucky-draw-records-table td:nth-child(2) {
        width: 30%;
    }
}

/* 抽奖模式标签特效 */
.b2-lucky-draw-records-table .draw-mode-tag {
    position: relative;
    overflow: hidden;
}

.b2-lucky-draw-records-table .draw-mode-tag::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.b2-lucky-draw-records-table td:nth-child(6):hover .draw-mode-tag::after {
    opacity: 1;
    animation: shine 1.2s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* 抽奖模式按钮点击效果 */
.b2-lucky-draw-records-table .draw-mode-tag:active {
    transform: scale(0.95);
    box-shadow: 0 0px 1px rgba(0,0,0,0.1);
}

/* 表格行进入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.b2-lucky-draw-records-container {
    overflow: hidden; /* 确保动画不超出容器 */
}

/* 刷新后的新记录高亮效果 */
@keyframes highlight-row {
    0% { background-color: rgba(255, 223, 85, 0.3); }
    100% { background-color: transparent; }
}

.highlight-new-row {
    animation: highlight-row 2s ease-out;
}

/* 记录数变化时的提示效果 */
.records-count-changed {
    color: #4CAF50;
    font-weight: bold;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 自定义刷新按钮动画 */
.b2-lucky-draw-refresh-button {
    position: relative;
    overflow: hidden;
}

.b2-lucky-draw-refresh-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    pointer-events: none;
}

.b2-lucky-draw-refresh-button:hover::after {
    animation: button-shine 0.8s forwards;
}

@keyframes button-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 确保会员转换为余额时的显示格式正确 */
.b2-lucky-draw-result-content .winner-vip-info,
.b2-lucky-draw-result-content .winner-converted {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
}

/* 确保星号正确显示 */
.winner-vip-info::after,
.winner-converted::before {
    content: none !important;
}

/* 添加中奖和未中奖的脉冲动画效果 */
@keyframes prizePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

@keyframes noPrizePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

@keyframes centerPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(255, 165, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 165, 0, 0); }
}

/* 中奖脉冲效果 */
.b2-lucky-draw-grid-item.prize-pulse {
    animation: prizePulse 1s infinite;
    z-index: 10;
}

/* 未中奖脉冲效果 */
.b2-lucky-draw-grid-item.no-prize-pulse {
    animation: noPrizePulse 1s infinite;
    z-index: 10;
}

/* 中心位置特殊脉冲效果 */
.b2-lucky-draw-grid-item.center-pulse {
    animation: centerPulse 1.5s infinite;
    z-index: 10;
}

/* 增强高亮效果 */
.b2-lucky-draw-grid-item.prize-highlight {
    border: 3px solid #f60;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    z-index: 5;
}

/* 优化九宫格过渡效果 */
.b2-lucky-draw-grid-item {
    transition: all 0.3s ease-in-out;
}

/* 添加额外的响应式优化 */
@media screen and (max-width: 768px) {
    .b2-lucky-draw-grid-item.prize-pulse,
    .b2-lucky-draw-grid-item.no-prize-pulse,
    .b2-lucky-draw-grid-item.center-pulse {
        animation-duration: 1.2s; /* 移动设备上稍微减慢动画 */
    }
} 