/**
 * File: lottery-orders.css
 * Version: v1.0.25
 * Author: xAI Grok 3
 * Created: 2025-07-18
 * Updated: 2025-07-20 11:30 (HKT)
 * Description: Fixed modal button alignment and number hover effects, synced timestamp
 * 用户体验优化：增强媒体查询，确保小屏下双色球红球/蓝球网格换行自适应，避免溢出；后台无改动
 */

:root {
    --number-size: 24px;
    --success-color: #009944;
    --danger-color: #DC3545;
}

.lottery-orders {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: transparent; /* 透明背景 */
    border: none; /* 移除边框 */
    box-shadow: none; /* 移除阴影 */
    font-family: Roboto, sans-serif !important;
}

.lottery-orders h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 28px;
}

.lottery-orders > p {
    color: #151b26;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: bold;
}

.modules-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.lottery-card {
    flex: 1 1 30%;
    min-width: 280px;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
}

.lottery-card h3 {
    text-align: center;
    color: #3498db;
    margin: 0 0 15px;
    font-size: 20px;
}

.play-type {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    background: transparent; /* 修改4：父容器背景变透明 */
}

.play-type label {
    background: #f0f4f8;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.play-type input[type="radio"] {
    width: 16px;
    height: 16px;
    border: 2px solid #3498db;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
}

.play-type input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.play-type-3d {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    background: transparent; /* 修改4：父容器背景变透明 */
}

.play-type-3d label {
    background: #f0f4f8;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.play-type-3d input[type="radio"] {
    width: 16px;
    height: 16px;
    border: 2px solid #3498db;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
}

.play-type-3d input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.price-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    background: transparent; /* 修改4：父容器背景变透明 */
}

.price-options label {
    background: #f0f4f8;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-options input[type="radio"] {
    width: 16px;
    height: 16px;
    border: 2px solid #3498db;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
}

.price-options input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.buttons-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.status-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 5px;
    padding: 0 15px;
    height: 36px;
    line-height: 36px;
    font-size: 12px;
    color: #2c3e50;
    font-weight: bold;
    border: 1px solid #e0e6ed;
    flex: 1;
}

.lottery-button.clear {
    height: 36px;
    line-height: 36px;
    padding: 0 15px;
    background-color: #F39C12;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    flex: 1;
}

.lottery-button.randomize {
    height: 36px;
    line-height: 36px;
    padding: 0 15px;
    background-color: #009944;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    flex: 1;
}

.number-selection {
    position: relative;
    min-height: 150px;
    text-align: center;
    margin-bottom: 15px;
}

.card-number {
    position: absolute;
    top: 40%;  /* 保持有用：定位到垂直中心 */
    left: 50%; /* 保持有用：定位到水平中心 */
    transform: translate(-50%, -50%);  /* 保持有用：基于自身大小偏移居中 */
    font-size: 100px;
    color: #555555;
    opacity: 0.3;
    z-index: 10;
    pointer-events: none;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    text-align: center;  /* 新增：文本内部居中，不影响定位 */
}

.digit-rows {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
}

.digit-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: 0 10px;
}

.digit-label {
    text-align: center;
    font-size: 10px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.number-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.lottery-orders--keno8 .number-buttons {
    grid-template-columns: repeat(10, 1fr);
}

.number {
    width: var(--number-size);
    height: var(--number-size);
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    line-height: var(--number-size);
    margin: 0 0 2px;
    aspect-ratio: 1 / 1;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.number:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.number:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.lottery-orders--3d .digit-row[data-digit="hundreds"] .number.selected,
.lottery-orders--3d .digit-row[data-digit="tens"] .number.selected,
.lottery-orders--3d .digit-row[data-digit="units"] .number.selected { 
    background: #FFA500 !important; 
    color: #fff !important; 
    border-color: #FFA500 !important; 
}

.lottery-orders--keno8 .digit-row[data-digit="units"] .number.selected { 
    background: #00b08c !important; 
    color: #fff !important; 
    border-color: #00b08c !important; 
}

.lottery-orders--doublecolor .digit-row[data-digit="red"] .number.selected { 
    background: #FF2752 !important; 
    color: #fff !important; 
    border-color: #FF2752 !important; 
}

.lottery-orders--doublecolor .digit-row[data-digit="blue"] .number.selected { 
    background: #267aff !important; 
    color: #fff !important; 
    border-color: #267aff !important; 
}

.lottery-ball {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--number-size) !important;
    height: var(--number-size) !important;
    line-height: var(--number-size) !important;
    border-radius: 50% !important;
    text-align: center !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: bold !important;
    margin: 0 1px !important;
    vertical-align: middle !important;
}

.lottery-ball.orange-ball {
    background-color: #FFA500 !important;
}

.lottery-ball.keno-number {
    background-color: #00b08c !important;
}

.lottery-ball.red-ball {
    background-color: #FF2752 !important;
}

.lottery-ball.blue-ball {
    background-color: #267aff !important;
}

.lottery-orders--cart[data-lottery-type="3D"] .lottery-ball,
.lottery-orders--cart[data-lottery-type="3d"] .lottery-ball { 
    background-color: #FFA500 !important; 
}

.lottery-orders--cart[data-lottery-type="Keno8"] .lottery-ball { 
    background-color: #00b08c !important; 
}

.lottery-orders--cart[data-lottery-type="DoubleColor"] .lottery-ball.red-ball { 
    background-color: #FF2752 !important; 
}

.lottery-orders--cart[data-lottery-type="DoubleColor"] .lottery-ball.blue-ball { 
    background-color: #267aff !important; 
}

.expected-result {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
    text-align: left;
    margin-bottom: 17px;
}

.expected-result p {
    margin: 8px 0;
    font-size: 12px;
    color: #2c3e50;
}

.expected-result span {
    font-weight: bold;
    color: #e74c3c;
}

.lottery-button#buy-button {
    width: 100%;
    padding: 15px;
    background: #DC3545; 
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 25px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.lottery-button#buy-button:hover:not(:disabled) {
    background: #009944; 
    transform: translateY(-2px);
}

.lottery-button#buy-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.instructions, .lottery-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.placeholder {
    flex: 1 1 30%;
    min-width: 280px;
    height: 20px;
    background: transparent;
}

/* ========== 统一弹窗样式 ========== */
.lottery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

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

/* 弹窗标题字体18px */
.modal-title {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* 弹窗副标题 */
.modal-subtitle {
    text-align: center;
    font-size: 16px;
    margin: 15px 0 10px;
}

/* 弹窗内容字体15px */
.modal-body {
    text-align: left;
    margin: 15px 0;
    padding: 0 10px;
    line-height: 1.6;
    color: #555;
    font-size: 15px;
}

/* 弹窗按钮字体18px */
.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
}

/* 居中内容 */
.centered-content {
    text-align: center;
    text-indent: 0;
}

.modal-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.single-button {
    background-color: var(--success-color);
}

.modal-button.cancel-button {
    background-color: var(--danger-color);
}

.modal-button.confirm-button {
    background-color: var(--success-color);
}

.modal-button.cancel-button:hover {
    background-color: #bd2130;
}

.modal-button.confirm-button:hover {
    background-color: #00802b;
}

.modal-button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 单按钮居中 */
.modal-buttons.single-button-container {
    display: flex;
    justify-content: center;
}

/* 购物车页面特定样式 */
.lottery-orders--cart {
    background: #f7f9fc;
}

.lottery-orders--cart .pending-payment-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #2c3e50;
    font-size: 28px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lottery-orders--cart .cart-icon {
    width: 28px;
    height: 28px;
    stroke: #3498db;
    stroke-width: 2;
}

.lottery-orders--cart .orders-table {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lottery-orders--cart .order-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
    font-size: 16px;
}

.lottery-orders--cart .header-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lottery-orders--cart .order-sequence {
    font-weight: bold;
}

.lottery-orders--cart .order-amount {
    font-weight: bold;
    color: #27ae60;
    background: #eafaf1;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 15px;
}

.lottery-orders--cart .header-bottom {
    display: flex;
    gap: 10px;
}

.lottery-orders--cart .lottery-card {
    border: 0px solid #e0e6ed;
    padding: 15px;
}

.lottery-orders--cart .order-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: center;
}

.lottery-orders--cart .delete-order {
    background: #f1f1f1;
    color: #e74c3c;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 16px;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.lottery-orders--cart .delete-order i {
    margin-right: 5px;
}

.lottery-orders--cart .delete-order:hover {
    background: #e0e0e0;
}

.lottery-orders--cart .selections-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lottery-orders--cart .selection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex-wrap: wrap;
}

.lottery-orders--cart .line-label {
    font-weight: bold;
    color: #34495e;
    min-width: 70px;
}

.lottery-orders--cart .play-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    color: #333;
    font-weight: bold;
    min-width: 75px;
    text-align: center;
}

.lottery-orders--cart .digits-container, 
.lottery-orders--cart .keno-numbers-container, 
.lottery-orders--cart .double-color-balls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lottery-orders--cart .pay-now-module {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin-top: 20px;
}

.lottery-orders--cart .total-section {
    font-size: 18px;
    color: #2c3e50;
}

.lottery-orders--cart .total-section .total-price {
    font-weight: bold;
    color: #27ae60;
    margin-left: 10px;
}

.lottery-orders--cart .pay-now-button {
    padding: 10px 20px;
    background: #DC3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.lottery-orders--cart .pay-now-button:hover {
    background: #009944;
}

/* 修改4：手机状态下单选项上下堆叠 */
@media (max-width: 768px) {
    .play-type {
        flex-direction: column;
        gap: 15px;
    }

    /* 用户体验优化：小屏下双色球红球/蓝球网格自适应换行 */
    .lottery-orders--doublecolor .red-balls {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)) !important; /* 自适应列数 */
    }

    .lottery-orders--doublecolor .blue-balls {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)) !important; /* 自适应列数 */
    }

    /* 3D玩法选项手机模式一行显示 */
    .play-type-3d {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 5px; /* 缩小间距适应一行 */
    }
    .play-type-3d label {
        flex: 1;
        text-align: center;
        font-size: 10px; /* 缩小字体防溢出 */
        padding: 6px;
    }

    /* 购物车价格选项手机堆叠，恢复样式 */
    .price-options {
        flex-direction: column !important;
        gap: 15px;
    }
}