/**
 * 幸运数字彩票前端样式
 */

.xingyun-lottery-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* 用户信息 */
.xingyun-user-info {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.xingyun-user-points {
    font-size: 16px;
}

.xingyun-user-points strong {
    color: #ff6b35;
    font-size: 24px;
}

.xingyun-bet-limits {
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* 倒计时 */
.xingyun-countdown {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 20px;
}

.countdown-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.countdown-time {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 4px;
    font-family: monospace;
}

.countdown-info {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

/* 投注区域 */
.xingyun-bet-area {
    margin-bottom: 20px;
}

.bet-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.number-item {
    text-align: center;
    padding: 12px 0;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.number-item:hover {
    background: #e0e0e0;
    transform: scale(1.02);
}

.number-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102,126,234,0.4);
}

.selected-numbers {
    text-align: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.selected-list {
    font-weight: bold;
    color: #667eea;
}

.bet-cost {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #666;
}

.bet-cost strong {
    color: #ff6b35;
    font-size: 18px;
}

.xingyun-bet-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.xingyun-bet-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.xingyun-bet-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bet-message {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    display: none;
}

.bet-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.bet-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

/* 按钮区域 */
.xingyun-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.xingyun-rule-btn, .xingyun-history-btn {
    padding: 8px 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.xingyun-rule-btn:hover, .xingyun-history-btn:hover {
    background: #e0e0e0;
}

/* 弹窗 */
.xingyun-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    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.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    z-index: 10;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    line-height: 1.8;
}

/* ==================== 移动端投注记录优化 ==================== */

/* 移动端历史记录卡片式布局 */
@media (max-width: 768px) {
    
    /* 隐藏表格默认样式，使用卡片式布局 */
    .history-table,
    .history-table thead,
    .history-table tbody,
    .history-table tr,
    .history-table th,
    .history-table td {
        display: block;
    }
    
    /* 隐藏表头 */
    .history-table thead {
        display: none;
    }
    
    /* 每条记录作为独立卡片 */
    .history-table tbody tr {
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid #eee;
    }
    
    /* 每个单元格作为卡片内的一行 */
    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: left !important;
    }
    
    /* 最后一个单元格去掉边框 */
    .history-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    /* 添加标签文字 */
    .history-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #666;
        font-size: 13px;
        min-width: 80px;
    }
    
    /* 期号样式 */
    .history-table td:first-child {
        font-weight: bold;
        color: #333;
        background: #f8f9fa;
        margin: -12px -12px 0 -12px;
        padding: 10px 12px;
        border-radius: 12px 12px 0 0;
        border-bottom: 1px solid #eee;
    }
    
    .history-table td:first-child:before {
        content: '📅 期号';
        font-weight: normal;
    }
    
    /* 投注号码样式 */
    .history-table td:nth-child(2):before {
        content: '🎲 投注号码';
    }
    
    .history-table td:nth-child(2) {
        font-weight: bold;
        color: #667eea;
        font-size: 16px;
    }
    
    /* 开奖号码样式 */
    .history-table td:nth-child(3):before {
        content: '🏆 开奖号码';
    }
    
    .history-table td:nth-child(3) {
        font-weight: bold;
    }
    
    /* 中奖数样式 */
    .history-table td:nth-child(4):before {
        content: '⭐ 中奖数';
    }
    
    /* 获得积分样式 */
    .history-table td:nth-child(5):before {
        content: '💰 获得积分';
    }
    
    .history-table td:nth-child(5) {
        font-weight: bold;
        color: #ff6b35;
    }
    
    /* 状态样式 */
    .history-table td:nth-child(6):before {
        content: '📋 状态';
    }
}

/* 小屏手机优化 (宽度小于480px) */
@media (max-width: 480px) {
    .history-table td:before {
        min-width: 70px;
        font-size: 12px;
    }
    
    .history-table td {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .history-table td:nth-child(2) {
        font-size: 14px;
    }
}

/* 历史记录弹窗整体优化 */
.xingyun-history-modal .modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.xingyun-history-modal .history-list {
    padding: 12px;
}

/* 加载状态样式 */
.history-list .loading,
.history-list .no-data,
.history-list .error {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 中奖高亮显示 */
.history-table .win-count {
    background: #ff6b35;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

/* 状态标签 */
.history-table .status-wait {
    color: #ff9800;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

.history-table .status-done {
    color: #4caf50;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

/* 开奖号码显示 */
.xingyun-last-draw {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 10px;
    text-align: center;
    animation: slideDown 0.5s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.last-draw-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.last-draw-numbers .win-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #fff;
    border-radius: 50%;
    margin: 0 5px;
    font-weight: bold;
    font-size: 18px;
    color: #ff6b35;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 未登录状态 */
.xingyun-login-required {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    color: #666;
}

.xingyun-login-required a {
    color: #667eea;
}

/* 响应式 */
@media (max-width: 480px) {
    .xingyun-lottery-container {
        padding: 15px;
    }
    
    .number-grid {
        gap: 8px;
    }
    
    .number-item {
        padding: 8px 0;
        font-size: 16px;
    }
    
    .countdown-time {
        font-size: 28px;
    }
}
/* 弹窗标题居中 */
.xingyun-history-modal .modal-header {
    justify-content: center;
    position: relative;
}

.xingyun-history-modal .modal-header h3 {
    margin: 0;
}

.xingyun-history-modal .modal-close {
    position: absolute;
    right: 15px;
    top: 12px;
}

/* 规则弹窗标题也居中 */
.xingyun-rule-modal .modal-header {
    justify-content: center;
    position: relative;
}

.xingyun-rule-modal .modal-header h3 {
    margin: 0;
}

.xingyun-rule-modal .modal-close {
    position: absolute;
    right: 15px;
    top: 12px;
}