/* 7B2抽奖插件样式 - 完美适配7B2主题 */
/* 使用高优先级选择器确保样式生效 */

/* 主容器样式 - 增强优先级 */
.b7b2-lottery-container,
body .b7b2-lottery-container,
.entry-content .b7b2-lottery-container {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 7B2主题兼容性修复 */
.entry-content .b7b2-lottery-container * {
    box-sizing: border-box !important;
}

/* 抽奖标题区域 - 增强优先级 */
.lottery-header,
body .lottery-header,
.entry-content .lottery-header {
    text-align: center !important;
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #f0f0f0 !important;
    display: block !important;
}

.lottery-title,
body .lottery-title,
.entry-content .lottery-title {
    font-size: 28px !important;
    font-weight: bold !important;
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: block !important;
    line-height: 1.2 !important;
}

.lottery-description,
body .lottery-description,
.entry-content .lottery-description {
    font-size: 16px !important;
    color: #666 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    display: block !important;
}

/* 信息栏样式 - 增强优先级 */
.lottery-info,
body .lottery-info,
.entry-content .lottery-info {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 15px !important;
    margin-bottom: 30px !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    border-radius: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.info-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.info-item .label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.info-item .value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.user-points {
    color: #ff6b6b !important;
}

.remaining-draws {
    color: #4ecdc4 !important;
}

/* 九宫格容器 - 增强优先级和7B2兼容性 */
.lottery-grid,
body .lottery-grid,
.entry-content .lottery-grid,
.b7b2-lottery-container .lottery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    max-width: 500px !important;
    margin: 0 auto 30px !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 九宫格单元格 - 增强优先级和7B2兼容性 */
.lottery-item,
body .lottery-item,
.entry-content .lottery-item,
.b7b2-lottery-container .lottery-item {
    position: relative !important;
    aspect-ratio: 1 !important;
    background: #fff !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    border: 3px solid transparent !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    min-height: 100px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.lottery-item:hover,
body .lottery-item:hover,
.entry-content .lottery-item:hover,
.b7b2-lottery-container .lottery-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* 7B2主题特殊兼容 */
.entry-content .lottery-grid * {
    margin: 0 !important;
    padding: 0 !important;
}

.entry-content .lottery-item * {
    box-sizing: border-box !important;
}

/* 中心按钮样式 */
.lottery-center {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.lottery-center:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.5);
}

.start-button {
    position: relative;
    text-align: center;
    z-index: 2;
}

.button-text {
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

/* 奖品内容样式 */
.prize-content {
    text-align: center;
    padding: 10px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.prize-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.prize-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.2;
}

.prize-value {
    font-size: 12px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 2px;
}

.prize-probability {
    font-size: 10px;
    color: #999;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 10px;
}

/* 奖品类型样式 */
.prize-item.points .prize-value {
    color: #ff6b6b;
}

.prize-item.membership .prize-value {
    color: #ffa502;
}

.prize-item.physical .prize-value {
    color: #3742fa;
}

.prize-item.virtual .prize-value {
    color: #2ed573;
}

/* 发光效果 */
.item-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    border-radius: 15px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.lottery-item.active .item-glow {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

/* 抽奖动画 */
.lottery-item.spinning {
    animation: spin 0.1s ease-in-out;
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

.lottery-item.winner {
    animation: winner 0.6s ease-in-out;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

/* 统计信息样式 */
.lottery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stats-item {
    text-align: center;
    padding: 10px;
}

.stats-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stats-value {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* 控制按钮样式 */
.lottery-controls {
    text-align: center;
    margin-top: 20px;
}

.lottery-draw-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lottery-draw-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.lottery-draw-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 登录提示样式 */
.lottery-login-prompt {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    margin-top: 20px;
}

.lottery-login-prompt a {
    color: #e17055;
    text-decoration: none;
    font-weight: bold;
}

.lottery-login-prompt a:hover {
    text-decoration: underline;
}

/* 结果弹窗样式 */
.lottery-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.result-header {
    position: relative;
    margin-bottom: 20px;
}

.result-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff6b6b;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.result-prize {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.prize-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.prize-info .prize-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.prize-info .prize-value {
    font-size: 16px;
    color: #ff6b6b;
    font-weight: bold;
}

.result-message {
    font-size: 16px;
    color: #666;
    margin: 15px 0;
}

.result-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.continue-btn, .close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.continue-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.close-btn {
    background: #f1f2f6;
    color: #333;
}

.continue-btn:hover, .close-btn:hover {
    transform: translateY(-1px);
}

/* 抽奖记录样式 */
.b7b2-lottery-records {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.records-header h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.no-records {
    text-align: center;
    padding: 40px;
    color: #666;
}

.records-table {
    overflow-x: auto;
}

.table-header, .table-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px 100px 80px 100px 80px 120px;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.table-header {
    font-weight: bold;
    background: #f8f9fa;
    padding: 15px 0;
    border-radius: 8px 8px 0 0;
}

.table-row.winner {
    background: rgba(76, 175, 80, 0.1);
}

.table-row.loser {
    background: rgba(244, 67, 54, 0.05);
}

.record-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.prize-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prize-icon.win {
    color: #4caf50;
}

.prize-icon.lose {
    color: #f44336;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge.win {
    background: #e8f5e8;
    color: #4caf50;
}

.badge.lose {
    background: #ffebee;
    color: #f44336;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status.completed {
    background: #e8f5e8;
    color: #4caf50;
}

.status.pending {
    background: #fff3e0;
    color: #ff9800;
}

.status.cancelled {
    background: #ffebee;
    color: #f44336;
}

/* 短代码样式 */
.b7b2-lottery-shortcode {
    margin: 20px 0;
}

.shortcode-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* 统计卡片样式 */
.lottery-stats-card .stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 32px;
}

.card-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.card-label {
    font-size: 14px;
    color: #666;
}

/* v1.1.0 增强动画效果 */
.lottery-drawing {
    position: relative;
}

.lottery-drawing::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    border-radius: 25px;
    opacity: 0.3;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

/* 粒子效果容器 */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    border-radius: 15px;
}

.particles-container.active {
    display: block;
}

.particle {
    position: absolute;
    background: #4ecdc4;
    border-radius: 50%;
    animation: particleFloat 3s ease-out forwards;
    opacity: 0.8;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100%) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1);
    }
    100% {
        transform: translateY(-200%) scale(0);
        opacity: 0;
    }
}

/* 庆祝粒子效果 */
.celebration-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
}

/* v1.1.0 新增动画类型 */
.lottery-item.bounce {
    animation: bounce-keyframes 0.6s ease-in-out;
}

.lottery-item.flip {
    animation: flip-keyframes 0.8s ease-in-out;
}

.lottery-item.scale {
    animation: scale-keyframes 0.5s ease-in-out;
}

.lottery-item.slide {
    animation: slide-keyframes 0.7s ease-in-out;
}

.lottery-item.rotate3d {
    animation: rotate3d-keyframes 1s ease-in-out;
}

/* 动画定义 */
@keyframes bounce-keyframes {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) translateY(-10px); }
    50% { transform: scale(1.2) translateY(-20px); }
    75% { transform: scale(1.1) translateY(-10px); }
    100% { transform: scale(1); }
}

@keyframes flip-keyframes {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(360deg); }
}

@keyframes scale-keyframes {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes slide-keyframes {
    0% { transform: translateX(0); }
    25% { transform: translateX(10px) scale(1.05); }
    50% { transform: translateX(-10px) scale(1.1); }
    75% { transform: translateX(5px) scale(1.05); }
    100% { transform: translateX(0); }
}

@keyframes rotate3d-keyframes {
    0% { transform: perspective(400px) rotateX(0deg) rotateY(0deg); }
    25% { transform: perspective(400px) rotateX(180deg) rotateY(0deg) scale(1.1); }
    50% { transform: perspective(400px) rotateX(180deg) rotateY(180deg) scale(1.2); }
    75% { transform: perspective(400px) rotateX(0deg) rotateY(180deg) scale(1.1); }
    100% { transform: perspective(400px) rotateX(0deg) rotateY(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes winner {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.1); }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .b7b2-lottery-container {
        padding: 15px;
        margin: 10px;
    }
    
    .lottery-grid {
        gap: 6px;
        padding: 15px;
    }
    
    .lottery-item {
        border-radius: 8px;
    }
    
    .prize-name {
        font-size: 12px;
    }
    
    .prize-value {
        font-size: 10px;
    }
    
    .lottery-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .lottery-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-header, .table-row {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: center;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .lottery-title {
        font-size: 22px;
    }
    
    .lottery-grid {
        max-width: 300px;
        gap: 4px;
        padding: 10px;
    }
    
    .prize-image {
        width: 30px;
        height: 30px;
    }
    
    .button-text {
        font-size: 14px;
    }
    
    .lottery-draw-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* 错误提示样式 */
.b7b2-lottery-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ffcdd2;
}

/* 加载状态 */
.lottery-loading {
    pointer-events: none;
    opacity: 0.7;
}

.lottery-loading .lottery-center {
    animation: pulse 1s infinite;
}