/**
 * File: lottery-orders.css
 * Version: v1.0.26
 * Author: xAI Grok 3
 * Created: 2025-07-18
 * Updated: 2025-07-20 11:30 (HKT)
 * Description: 
 *   - Fixed gap spacing for Double Color and Keno8 balls
 *   - Added .balls-container styling
 *   - Removed default margins on lottery balls
 */
 
:root {
    --number-size: 24px;
    --success-color: #009944;
    --danger-color: #DC3545;
    --dc-kn-ball-gap: 8px; /* 控制双色球&快乐8 球间距 */
}

.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-orders--cart .pay-now-module {
    display: flex;
    flex-direction: column; /* 关键修改：改变主轴方向 */
    justify-content: space-between; /* 现在作用于垂直方向 */
    align-items: center; /* 现在作用于水平方向 */
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    margin-top: 20px;
}

.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;
}

.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-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 !important; /* 清除所有默认边距 */
    vertical-align: middle !important;
    position: relative; /* 新增：相对定位，便于::before/::after */
}

/* 统一数字球颜色（基于类型） */
.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;
}

/* 购物车/模态中数字球统一应用颜色（基于data-lottery-type） */
.lottery-orders--cart[data-lottery-type="3d"] .lottery-ball,
.lottery-orders--cart[data-lottery-type="3D"] .lottery-ball,
.modal-body[data-lottery-type="3d"] .lottery-ball,
.modal-body[data-lottery-type="3D"] .lottery-ball {
    background-color: #FFA500 !important;
}

.lottery-orders--cart[data-lottery-type="keno8"] .lottery-ball,
.modal-body[data-lottery-type="keno8"] .lottery-ball {
    background-color: #00b08c !important;
}

.lottery-orders--cart[data-lottery-type="doublecolor"] .lottery-ball.red-ball,
.modal-body[data-lottery-type="doublecolor"] .lottery-ball.red-ball {
    background-color: #FF2752 !important;
}

.lottery-orders--cart[data-lottery-type="doublecolor"] .lottery-ball.blue-ball,
.modal-body[data-lottery-type="doublecolor"] .lottery-ball.blue-ball {
    background-color: #267aff !important;
}

/* 新增：3D特定 - 添加hundreds/tens/units标签（使用::before，仅3D类型） */
.lottery-orders--cart[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(1)::before,
.lottery-orders--cart[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(1)::before,
.modal-body[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(1)::before,
.modal-body[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(1)::before {
    content: 'hundreds: '; /* 百位标签 */
    color: #000; /* 标签颜色 */
    font-size: 14px; /* 与球一致 */
    font-weight: normal; /* 非粗体 */
    margin-right: 2px; /* 与球间隙 */
    display: inline-block; /* 确保行内显示 */
    vertical-align: middle; /* 与球对齐 */
}

.lottery-orders--cart[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(2)::before,
.lottery-orders--cart[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(2)::before,
.modal-body[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(2)::before,
.modal-body[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(2)::before {
    content: 'tens: '; /* 十位标签 */
    color: #000;
    font-size: 14px;
    font-weight: normal;
    margin-right: 2px;
    display: inline-block;
    vertical-align: middle;
}

.lottery-orders--cart[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(3)::before,
.lottery-orders--cart[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(3)::before,
.modal-body[data-lottery-type="3d"] .digits-container .lottery-ball:nth-child(3)::before,
.modal-body[data-lottery-type="3D"] .digits-container .lottery-ball:nth-child(3)::before {
    content: 'units: '; /* 个位标签 */
    color: #000;
    font-size: 14px;
    font-weight: normal;
    margin-right: 2px;
    display: inline-block;
    vertical-align: middle;
}

.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); }
}

.modal-close:hover {
    color: #000;
}

/* 弹窗标题字体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;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 15px;
    background: none; /* 移除背景，使为纯绿色文字 */
}

.lottery-orders--cart .header-bottom {
    display: flex;
    gap: 10px;
}

/* 时间戳灰色 */
.lottery-orders--cart .header-bottom span:last-child {
    color: #6b7280; /* 灰色时间戳 */
    font-size: 14px;
}

.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;
}

/* ====== 球容器样式 ====== */
/* 基础球容器样式 */
.balls-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* 双色球和快乐8的间隙控制 */
.lottery-orders--cart .selection-item > .balls-container.doublecolor-balls,
.lottery-orders--cart .selection-item > .balls-container.keno8-balls {
    gap: var(--dc-kn-ball-gap) !important;
}

.lottery-orders--cart .digits-container, 
.lottery-orders--cart .keno-numbers-container, 
.lottery-orders--cart .double-color-balls {
    display: flex;
    flex-wrap: wrap;
}

.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;
}

/* 优惠说明（已是 13px，无需再调） */
.discount-note-container{font-size:13px}

/* ----- 价格选项 ----- */
.price-options{
    display:flex;
    gap:16px;
    font-size:13px;
    flex-wrap:wrap;         /* 防止溢出 */
}
.price-options label{
    display:inline-flex;
    align-items:center;
    gap:4px;
}
@media(max-width:768px){
    .price-options{flex-direction:column;gap:8px}
}

/* 单价数字红色高亮 */
.price-value{color:#d62839;font-weight:600}

/* ----- Pay Now 按钮 ----- */
.pay-now-button{
    display:block;          /* 块级，独占一行 */
    width:100%;
    padding:12px 0;
    font-weight:700;
}


/* ===== 专属间隙：Double Color & Keno8 ===== */
.doublecolor-balls,
.keno8-balls{
    gap: var(--dc-kn-ball-gap) !important;  /* 默认 27px，改这里即可 */
}

/* 新增：修复购物车确认弹窗数字球间隔
   在购物车弹窗内的 lottery-ball 左右各 5px
*/
#cart-modal .lottery-ball {
    margin: 0 1px !important;
}

