* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f7fb;
    padding: 24px 16px;
    color: #1e293b;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
}

.product-gallery {
    flex: 1;
    min-width: 280px;
    background: #fefefe;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eef2f6;
}

.product-info {
    flex: 1.2;
    min-width: 280px;
    padding: 28px 32px;
}

.main-image {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    background: #f8fafc;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.product-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #0f172a;
}

.tag-list {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    background: #eef2ff;
    color: #1e40af;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 40px;
    font-weight: 500;
}

.price-area {
    background: #f8fafc;
    border-radius: 20px;
    padding: 16px 20px;
    margin: 16px 0 24px 0;
}

.sale-price {
    font-size: 2rem;
    font-weight: 700;
    color: #e11d48;
    letter-spacing: -0.02em;
}

.sale-price small {
    font-size: 0.9rem;
    font-weight: 500;
}

.line-price {
    font-size: 1rem;
    color: #64748b;
    text-decoration: line-through;
    margin-left: 12px;
}

.limit-info {
    font-size: 0.8rem;
    color: #f97316;
    background: #fff7ed;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    margin-top: 12px;
}

.spec-section {
    margin: 24px 0;
}

.spec-group {
    margin-bottom: 24px;
}

.spec-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #334155;
}

.spec-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 60px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e293b;
}

.spec-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.spec-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.quantity-section {
    margin: 24px 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1.2rem;
    cursor: pointer;
}

.quantity-number {
    font-size: 1.1rem;
    min-width: 40px;
    text-align: center;
}

.payment-section {
    margin: 24px 0;
}

.payment-options {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.buy-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.buy-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.buy-btn:active {
    transform: translateY(1px);
}

.buy-btn.disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.qr-area {
    margin-top: 24px;
    text-align: center;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
}

.qr-title {
    font-weight: 600;
    margin-bottom: 12px;
}

.qrcode-container {
    display: inline-block;
    margin: 0 auto;
}

.qr-tip {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 12px;
}

.code-area {
    margin-top: 24px;
    background: #e0f2fe;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
}

.code-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.code-value {
    font-family: monospace;
    font-size: 1.1rem;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 10px 0;
    word-break: break-all;
}

.copy-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    margin-top: 12px;
}

.loading, .error {
    text-align: center;
    padding: 80px 20px;
    font-size: 1rem;
    background: white;
    border-radius: 32px;
}

.error {
    color: #dc2626;
}

.sku-image-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .product-grid {
        flex-direction: column;
    }
    .product-gallery {
        border-right: none;
        border-bottom: 1px solid #eef2f6;
        padding: 20px;
    }
    .product-info {
        padding: 24px;
    }
    .product-title {
        font-size: 1.5rem;
    }
    .sale-price {
        font-size: 1.7rem;
    }
}

/* 微信支付选项 — 方形，隐藏原生 radio */
.payment-option.wechat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    padding: 0px 0px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.payment-option.wechat input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.payment-option.wechat .wechat-img {
    width: auto;      /* 根据图片实际尺寸，可设高度或宽度 */
    height: 36px;     /* 示例高度，可按需调整 */
    display: block;
    object-fit: contain;
}

.payment-option.wechat:has(input:checked) {
    background: #e6f9ef;
    border-color: #07c160;
}

/* 模态框遮罩 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-container {
    background: white;
    border-radius: 28px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eef2f6;
}
.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.modal-body {
    padding: 24px;
}
.modal-product-info {
    background: #f8fafc;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 24px;
}
.info-line {
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.total-price {
    color: #e11d48;
    font-weight: 700;
    font-size: 1.2rem;
}
.qr-area-modal {
    text-align: center;
    padding: 16px;
}
.qr-area-modal .qr-title {
    font-weight: 600;
    margin-bottom: 12px;
}
.qrcode-container {
    display: inline-block;
    margin: 0 auto;
}
.code-area-modal {
    background: #e0f2fe;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eef2f6;
    text-align: right;
}
.modal-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
}
.modal-btn:hover {
    background: #2563eb;
}

/* 自定义 Toast */
.custom-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    z-index: 1100;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    pointer-events: none;
    animation: fadeInUp 0.2s ease;
}

/* 自定义确认框 */
.confirm-mask .confirm-container {
    background: white;
    border-radius: 28px;
    width: 280px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}
.confirm-container p {
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.4;
}
.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn {
    padding: 8px 20px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.confirm-ok {
    background: #3b82f6;
    color: white;
}
.confirm-cancel {
    background: #e2e8f0;
    color: #1e293b;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 手机端适配 */
@media (max-width: 640px) {
    .modal-container {
        width: 95%;
        border-radius: 20px;
    }
    .custom-toast {
        white-space: normal;
        max-width: 80%;
        text-align: center;
    }
}

/* 标题上方下载按钮与提示 */
.download-header {
    margin: 12px 0 8px;
}
.download-header-btn {
    display: inline-block;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}
.download-header-btn:hover {
    background: #dcfce7;
    transform: translateY(-1px);
}
.download-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 8px;
    margin-bottom: 0;
}
/* 间隔线 */
.title-divider {
    margin: 16px 0 20px;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}