/* 在线购买系统样式表 */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Microsoft YaHei', sans-serif;
}

.main-container {
    margin-top: 50px;
    margin-bottom: 50px;
}

.purchase-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.site-title {
    color: #333;
    font-weight: bold;
    font-size: 2.5rem;
}

.header-actions {
    flex-shrink: 0;
}

.header-actions .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.product-item {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.product-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

.product-item.selected {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
}

/* 无库存商品样式 */
.product-item.out-of-stock {
    opacity: 0.6;
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
}

.product-item.out-of-stock:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #dee2e6 !important;
}

.product-item.out-of-stock .product-title,
.product-item.out-of-stock .product-prices,
.product-item.out-of-stock .text-muted {
    color: #6c757d !important;
}

.product-item.out-of-stock .current-price {
    color: #adb5bd !important;
}

.product-item.out-of-stock .original-price {
    color: #ced4da !important;
}

.product-item.out-of-stock input[type="radio"] {
    cursor: not-allowed;
}

.stock-status-badge {
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: normal;
}

.stock-info.stock-empty {
    color: #dc3545;
}

.stock-empty-text {
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: bold;
}

.stock-sync-info {
    font-size: 0.75rem;
    color: #fd7e14;
    font-style: italic;
}

.product-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.product-prices {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.stock-info {
    color: #28a745;
    font-size: 0.9rem;
}

.payment-methods {
    margin-top: 30px;
}

.payment-item {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-item:hover {
    border-color: #28a745;
}

.payment-item.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.payment-item.active {
    border-color: #28a745;
    background: #f8fff9;
}

.payment-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.payment-item.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #dee2e6 !important;
}

.payment-icon {
    font-size: 2rem;
}

.payment-text {
    font-size: 1.1rem;
    font-weight: bold;
}

.btn-purchase {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-top: 30px;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-purchase:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.phone-input-section {
    margin: 30px 0;
}

/* 手机号区域禁用状态 */
.phone-input-section.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.phone-input-section.enabled {
    opacity: 1;
    pointer-events: auto;
    transition: all 0.3s ease-in-out;
}

.phone-input-container .input-group {
    margin-bottom: 10px;
}

.phone-input-container .form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

#customerPhone {
   /* border-radius: 0 15px 15px 0; */
}

.col-md-7{
    margin-top:9px;
}

.input-group-text {
    border-radius: 15px 0 0 15px;
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Modal样式 */
.modal-content {
    border-radius: 20px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.qr-code-container {
    text-align: center;
    padding: 30px;
}

.qr-code {
    width: 200px;
    height: 200px;
    border: 5px solid #f8f9fa;
    border-radius: 10px;
    margin: 20px auto;
}

.card-code-container {
    text-align: center;
    padding: 20px;
}

.card-code {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    word-break: break-all;
    color: #495057;
    margin-bottom: 15px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.card-result {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.card-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    border: 2px dashed #007bff;
    word-break: break-all;
}

/* API选择样式 */
.api-selection {
    margin-bottom: 30px;
}

.api-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.api-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.api-item.selected {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.api-icon {
    font-size: 1.5rem;
    margin: 0 15px;
    min-width: 30px;
    text-align: center;
}

.api-text {
    flex-grow: 1;
}

.api-text div {
    font-weight: 500;
    margin-bottom: 2px;
}

/* 卡密显示页面样式 */
.card-result-container {
    background: #fff;
}

.card-codes-display {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    border: 2px dashed #28a745 !important;
}

.card-codes-display pre {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.action-buttons .btn {
    min-width: 120px;
    font-weight: 500;
}

.success-icon {
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.alert-warning ul {
    padding-left: 1rem;
}

.alert-warning li {
    margin-bottom: 0.25rem;
}

/* 验证码相关样式 */
.captcha-verification-section {
    margin: 30px 0;
}

.captcha-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
}

/* 验证成功后的图形验证码样式 */
.captcha-section.verified {
    border-color: #28a745;
    background-color: #d4edda;
}

.captcha-section.verified .captcha-img {
    opacity: 0.6;
}

.captcha-section.verified .btn-outline-secondary {
    opacity: 0.6;
    cursor: not-allowed;
}

.captcha-section.verified .form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

.captcha-img {
    transition: all 0.3s ease;
}

.captcha-img:hover {
    transform: scale(1.05);
    border-color: #007bff !important;
}

#smsCodeGroup {
    animation: slideDown 0.3s ease-in-out;
}

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

.input-group .btn {
    white-space: nowrap;
}

/* 验证状态样式 */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 插件介绍样式 */
.plugin-intro-section {
    margin-top: 20px;
    animation: fadeIn 0.5s ease-in;
}

.plugin-intro {
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.plugin-intro.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #01579b;
}

.plugin-intro.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #1b5e20;
}

.plugin-intro.alert-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffecb3 100%);
    color: #e65100;
}

.plugin-intro.alert-primary {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0d47a1;
}

.plugin-intro .alert-heading {
    font-weight: 600;
    display: flex;
    align-items: center;
}

.plugin-intro .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.plugin-intro-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
}

.plugin-intro-content .plugin-list-item {
    display: block;
    margin-left: 20px;
    margin-bottom: 5px;
}

.plugin-intro-content strong {
    color: #222;
    font-weight: 600;
}

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

/* 版权信息样式 */
.copyright-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 0;
    margin-top: 50px;
}

.copyright-footer p {
    font-size: 14px;
    line-height: 1.5;
}

/* ============== 产品分类布局样式 ============== */
/* 节标题样式 */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 1.3rem;
}

.product-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title.premium {
    color: #f39c12;
}

.premium-badge {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 10px;
}

.magic-required-badge {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 10px;
}

/* 产品网格布局 */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    /* 防止Bootstrap干扰 */
    flex-direction: initial !important;
    flex-wrap: initial !important;
    /* 调试边框，确保容器正确显示 */
    border: 1px solid transparent;
    min-height: 100px;
}

/* 新的紧凑产品卡片 */
.product-card {
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    /* 确保Grid项目正确显示 */
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    /* 防止Bootstrap干扰 */
    flex: none !important;
    margin: 0 !important;
}

.product-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.product-card.premium {
    border-color: #ffa500;
    background: linear-gradient(135deg, #fff9e6 0%, #fff5dc 100%);
}

.product-card.premium:hover {
    border-color: #ff8c00;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.product-card .form-check {
    margin: 0;
}

.product-card .form-check-input {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
}

.product-card .form-check-label {
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.product-card .product-info {
    padding-right: 30px;
}

.product-card .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 4px;
}

.product-card.premium .product-price {
    color: #ff8c00;
}

.product-card .product-type {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 3px;
}

.product-card .stock-count {
    font-size: 0.75rem;
    color: #28a745;
    font-weight: 500;
}

.product-card .premium-feature {
    font-size: 0.7rem;
    color: #ff8c00;
    font-weight: 500;
    margin-top: 5px;
    font-style: italic;
}

.premium-icon {
    font-size: 0.8rem;
}

.stock-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 5px;
}

.stock-badge.sold-out {
    background: #dc3545;
    color: white;
}

/* 热卖角标样式 */
.hot-sale-corner-badge {
    position: absolute;
    top: -15px;
    left: -15px;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: hotSalePulse 2s infinite;
    z-index: 10;
    white-space: nowrap;
}

@keyframes hotSalePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 热卖商品卡片样式 */
.product-card.hot-sale {
    position: relative;
    border-color: #ff4757 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%) !important;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.2) !important;
}

.product-card.hot-sale:hover {
    border-color: #ff3838 !important;
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3) !important;
    transform: translateY(-3px) !important;
}

/* 移除左上角的火焰图标，改用右上角角标 */

@keyframes hotSaleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 高级热卖商品样式 */
.product-card.premium.hot-sale {
    border-color: #ff6b35 !important;
    background: linear-gradient(135deg, #fff9f5 0%, #ffede0 100%) !important;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2) !important;
}

.product-card.premium.hot-sale:hover {
    border-color: #ff5722 !important;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3) !important;
}

/* 高级商品也使用右上角角标，不需要左上角图标 */

/* 热卖商品选中状态 */
.product-card.hot-sale:has(input[type="radio"]:checked),
.product-card.hot-sale.selected {
    border-color: #ff3838 !important;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%) !important;
    transform: scale(1.03) !important;
}

.product-card.premium.hot-sale:has(input[type="radio"]:checked),
.product-card.premium.hot-sale.selected {
    border-color: #ff5722 !important;
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%) !important;
}

/* 选中状态 */
.product-card:has(input[type="radio"]:checked) {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    transform: scale(1.02);
}

.product-card.premium:has(input[type="radio"]:checked) {
    border-color: #ff8c00;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

/* JavaScript添加的类（兼容不支持:has()的浏览器） */
.product-card.selected {
    border-color: #007bff !important;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%) !important;
    transform: scale(1.02) !important;
}

.product-card.premium.selected {
    border-color: #ff8c00 !important;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%) !important;
}

/* 无库存状态 */
.product-card.out-of-stock {
    opacity: 0.6;
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
}

.product-card.out-of-stock:hover {
    transform: none !important;
    box-shadow: none !important;
}

.product-card.out-of-stock .product-name,
.product-card.out-of-stock .product-price,
.product-card.out-of-stock .product-type,
.product-card.out-of-stock .stock-count {
    color: #6c757d !important;
}

.product-card.out-of-stock .premium-feature {
    color: #adb5bd !important;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 768px) {
    .plugin-intro {
        padding: 15px;
    }
    
    .plugin-intro .alert-heading {
        font-size: 1.1rem;
    }
    
    .plugin-intro-content {
        font-size: 0.9rem;
    }
    
    .copyright-footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-card .product-info {
        padding-right: 25px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .product-card .product-name {
        font-size: 0.85rem;
    }
    
    .product-card .product-price {
        font-size: 1rem;
    }
}
