/* ============================================
   商品详情页 - 精美 APP 风格（移动端优化）
   ============================================ */

/* ===== 商品详情容器 ===== */
.goods-detail {
    background: #FFFFFF;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    margin-top: 4px;
}

/* ===== 图片轮播 ===== */
.detail-slider {
    position: relative;
    padding-top: 100%;
    background: #E8E8EE;
    overflow: hidden;
}

.slider-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider-item {
    flex: 0 0 100%;
    height: 100%;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-dots .dot.active {
    background: #FFFFFF;
    width: 24px;
    border-radius: 4px;
}

.slider-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #FF4757, #E74C3C);
    color: #FFFFFF;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(255, 71, 87, 0.3);
}

/* ===== 商品信息 ===== */
.detail-info {
    padding: 18px 16px 14px;
}

.detail-title {
    font-size: 19px;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1.4;
    margin-bottom: 6px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.detail-price {
    color: #FF3D00;
    font-size: 22px;
    font-weight: 800;
}

.detail-type {
    font-size: 13px;
    color: #8E8E9A;
    background: #F2F2F7;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.detail-progress {
    background: #F8F8FC;
    border-radius: 14px;
    padding: 14px 16px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #3D3D4E;
    margin-bottom: 6px;
}

.progress-stats strong {
    color: #FF3D00;
    font-weight: 700;
}

.progress-bar {
    height: 6px;
    background: #E8E8EE;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF8A65, #FF3D00);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-percent {
    text-align: right;
    font-size: 13px;
    color: #8E8E9A;
    margin-top: 4px;
    font-weight: 500;
}

/* ===== 购买区域 ===== */
.buy-section {
    padding: 16px;
    border-top: 1px solid #F0F0F5;
    background: #FFFFFF;
}

.buy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.buy-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A2E;
}

.buy-remain {
    font-size: 14px;
    color: #8E8E9A;
    font-weight: 500;
}

/* ===== 购买操作栏 ===== */
.buy-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.buy-actions .btn-decrease,
.buy-actions .btn-increase {
    width: 40px;
    height: 40px;
    border: 1.5px solid #E8E8EE;
    background: #FFFFFF;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #1A1A2E;
    flex-shrink: 0;
}

.buy-actions .btn-decrease:active,
.buy-actions .btn-increase:active {
    background: #F2F2F7;
    transform: scale(0.92);
}

.buy-actions .buy-input {
    width: 64px;
    height: 40px;
    text-align: center;
    border: 1.5px solid #E8E8EE;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    color: #1A1A2E;
    background: #FAFAFE;
    outline: none;
    transition: border-color 0.2s;
}

.buy-actions .buy-input:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.08);
}

/* =============================================
   【重要】购买按钮 - 强制渐变色（移动端修复）
   ============================================= */
#buyBtn,
.buy-actions .btn-buy {
     flex: 1;
    height: 48px;
    /* 蓝色渐变背景 */
    background: linear-gradient(135deg, #358dff, #3366FF) !important;
    background-color: #358dff !important; /* 降级方案 */
    color: #FFFFFF !important;
    font-size: 16px;
    font-weight: 700;
    border: none !important;
    border-radius: 14px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(53, 141, 255, 0.35) !important;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    -webkit-appearance: none; /* 去除移动端默认样式 */
    appearance: none;
    outline: none;
}

/* 激活（按压）状态 */
.buy-actions .btn-buy:active,
#buyBtn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(53, 141, 255, 0.25) !important;
}

/* 禁用状态 */
.buy-actions .btn-buy:disabled,
#buyBtn:disabled {
    background: #B0B0B8 !important;
    background-color: #B0B0B8 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 0.7;
    text-shadow: none;
}

/* ===== 响应式适配 ===== */
@media (max-width: 420px) {
    .buy-actions .btn-buy,
    #buyBtn {
        height: 44px;
        font-size: 15px;
        min-width: 100px;
        border-radius: 12px !important;
    }
}

@media (max-width: 360px) {
    .buy-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .buy-actions .btn-buy,
    #buyBtn {
        width: 100%;
        min-width: unset;
        flex: none;
    }
}

#buyBtn:active,
.buy-actions .btn-buy:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 61, 0, 0.2) !important;
}

#buyBtn:disabled,
.buy-actions .btn-buy:disabled {
    background: #B0B0B8 !important;
    background-color: #B0B0B8 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 0.7;
    text-shadow: none;
}

/* ===== 购买总计 ===== */
.buy-total {
    margin-top: 12px;
    font-size: 15px;
    text-align: right;
    color: #3D3D4E;
}

.buy-total span {
    color: #FF3D00;
    font-weight: 800;
    font-size: 20px;
}

.buy-tip {
    margin-top: 8px;
    font-size: 14px;
    color: #8E8E9A;
    text-align: center;
    background: #FFF8F5;
    padding: 8px 12px;
    border-radius: 10px;
}

.buy-tip a {
    color: #FF6B35;
    font-weight: 600;
    text-decoration: none;
}

.buy-tip a:active {
    color: #E55A2B;
}

/* ===== 中奖展示 ===== */
.winner-section {
    padding: 16px;
    border-top: 1px solid #F0F0F5;
}

.winner-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #FFF5E6, #FFE8D0);
    border-radius: 16px;
    padding: 14px 18px;
    position: relative;
    overflow: hidden;
}

.winner-card::before {
    content: '🎉';
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 48px;
    opacity: 0.15;
}

.winner-icon {
    font-size: 34px;
    flex-shrink: 0;
}

.winner-info {
    flex: 1;
}

.winner-label {
    font-size: 12px;
    color: #8E8E9A;
    font-weight: 500;
}

.winner-name {
    font-size: 17px;
    font-weight: 700;
    color: #E55A2B;
}

.winner-number {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A2E;
}

.winner-time {
    font-size: 12px;
    color: #8E8E9A;
}

.winner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #FF6B35;
    object-fit: cover;
    flex-shrink: 0;
}

/* ===== 号码区域 ===== */
.numbers-section,
.my-numbers-section {
    padding: 16px;
    border-top: 1px solid #F0F0F5;
}

.numbers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.numbers-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A2E;
}

.numbers-count {
    font-size: 13px;
    color: #8E8E9A;
    font-weight: 500;
}

.numbers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.number-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 34px;
    padding: 0 8px;
    background: #F2F2F7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3D3D4E;
    position: relative;
}

.number-item.mine {
    background: linear-gradient(135deg, #FF6B35, #FF3D00);
    color: #FFFFFF;
}

.number-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 9px;
    padding: 0 6px;
    border-radius: 10px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 16px;
}

.number-badge.winner {
    background: #FFD700;
    color: #1A1A2E;
}

.number-badge.lost {
    background: #8E8E9A;
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    max-width: 340px;
    width: 90%;
    padding: 24px 20px 20px;
    z-index: 1;
    animation: modalIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalIn {
    from {
        transform: scale(0.9) translateY(24px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A2E;
}

.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #8E8E9A;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:active {
    background: #F2F2F7;
}

.modal-body {
    font-size: 15px;
    line-height: 1.8;
    color: #3D3D4E;
}

.modal-body strong {
    color: #FF3D00;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-footer button {
    flex: 1;
    height: 44px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-footer button:active {
    transform: scale(0.96);
}

.btn-cancel {
    background: #F2F2F7;
    color: #3D3D4E;
    border: 1px solid #E8E8EE;
}

.btn-confirm {
    background: linear-gradient(135deg, #FF6B35, #FF3D00);
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(255, 61, 0, 0.25);
}

/* ===== 结果弹窗 ===== */
.result-content {
    text-align: center;
    padding: 32px 20px 28px;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 10px;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 6px;
}

.result-msg {
    font-size: 15px;
    color: #8E8E9A;
    margin-bottom: 18px;
    line-height: 1.5;
}

.btn-result {
    padding: 10px 40px;
    background: linear-gradient(135deg, #FF6B35, #FF3D00);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(255, 61, 0, 0.25);
}

.btn-result:active {
    transform: scale(0.95);
}

/* ===== 响应式 ===== */
@media (max-width: 420px) {
    .detail-title {
        font-size: 17px;
    }
    .detail-price {
        font-size: 19px;
    }
    .buy-actions .btn-decrease,
    .buy-actions .btn-increase {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
    .buy-actions .buy-input {
        width: 56px;
        height: 36px;
        font-size: 15px;
    }
    #buyBtn,
    .buy-actions .btn-buy {
        height: 44px;
        font-size: 15px;
        min-width: 100px;
    }
    .winner-card {
        padding: 12px 14px;
    }
    .winner-name {
        font-size: 15px;
    }
    .number-item {
        min-width: 32px;
        height: 30px;
        font-size: 12px;
    }
    .modal-content {
        padding: 20px 16px 18px;
        max-width: 320px;
    }
    .result-icon {
        font-size: 44px;
    }
}

@media (max-width: 360px) {
    .buy-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    #buyBtn,
    .buy-actions .btn-buy {
        width: 100%;
        min-width: unset;
    }
}