.container {
    max-width: 75%;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    overflow: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* 设置最小高度确保整体布局稳定 */
    min-height: 100vh;
    box-sizing: border-box;
}

header {
    text-align: center;
    padding: 20px;
    font-size: 2em;
    color: #333;
    cursor: default;
    position: relative; /* 为图标定位提供参考 */
}

/* 右上角功能图标 */
.header-icons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
}

.icon {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    /* 完全透明背景 */
    background-color: transparent;
    /* 无边框设计 */
    border: none;
    position: relative;
    overflow: hidden;
    /* 取消所有阴影效果 */
    box-shadow: none;
}

.icon:hover {
    /* 取消所有背景色和阴影，仅保留变换效果 */
    background-color: transparent;
    transform: translateY(-2px) scale(1.18);
    /* 取消所有阴影效果 */
    box-shadow: none;
}

.icon:active {
    transform: translateY(0) scale(1.1);
    /* 取消所有阴影效果 */
    box-shadow: none;
}

.icon svg {
    width: 22px;
    height: 22px;
    /* 加粗线条 */
    stroke: #555;
    stroke-width: 2.3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 取消所有滤镜效果 */
    filter: none;
}

.icon:hover svg {
    stroke: #212121;
    transform: scale(1.25);
    /* 取消所有滤镜效果 */
    filter: none;
}

/* 波纹效果 */
.icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(33, 33, 33, 0.08);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s, opacity 0.4s;
}

.icon:active::before {
    width: 200%;
    height: 200%;
    opacity: 0;
}

/* 红点提示 */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1000;
    display: none; /* 默认隐藏 */
}

.notification-badge.show {
    display: flex;
}

/* 下载提示弹窗 */
.download-popup {
    position: fixed;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    min-width: 300px;
    max-width: 350px;
    padding: 25px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 初始位置设置为隐藏状态 */
    transform: translateY(-20px);
}

.download-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.download-popup-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
}

.download-popup-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 1em;
    line-height: 1.5;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 123, 255, 0.2);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 指向箭头 */
.download-popup::before {
    content: '';
    position: absolute;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
    z-index: 2001;
    /* 支持动态调整箭头位置 */
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
}

/* 指向箭头的阴影 */
.download-popup::after {
    content: '';
    position: absolute;
    top: -11px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 11px solid rgba(0, 0, 0, 0.1);
    z-index: 2000;
    /* 支持动态调整箭头位置 */
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
}

/* 关于信息弹窗 */
.about-popup {
    position: fixed;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 220px;
    max-width: 250px;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.about-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 关于信息弹窗指向箭头 */
.about-popup::before {
    content: '';
    position: absolute;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
    z-index: 1001;
    /* 支持动态调整箭头位置 */
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
}

/* 关于信息弹窗指向箭头的阴影 */
.about-popup::after {
    content: '';
    position: absolute;
    top: -11px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 11px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    /* 支持动态调整箭头位置 */
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
}

.about-popup-content {
    font-size: 0.9em;
}

.about-popup-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
    text-align: center;
    font-weight: 600;
}

.about-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 6px 0;
}

.about-info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #666;
    flex: 1;
}

.info-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.copyright-info {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    color: #888;
    font-size: 0.85em;
}

/* 支付按钮区域 - 缩小与下方内容的间距 */
.payment {
    text-align: center;
    /* 减小与下方内容的间距 */
    margin: 20px 0 15px 0; /* 上边距20px，下边距15px */
    padding: 25px;
    background: transparent;
    border-radius: 15px;
    box-shadow: none;
    position: sticky;
    top: 20px;
    z-index: 100;
    border: none;
    transition: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* 固定高度避免布局跳动 */
    height: 120px;
    box-sizing: border-box;
}

.payment.show {
    visibility: visible;
    opacity: 1;
}

.pay-button {
    padding: 14px 35px;
    margin: 0 15px;
    font-size: 1.15em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pay-button.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.pay-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#wechat-pay-button {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    color: white;
    border-radius: 8px;
}

#wechat-pay-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #219653 0%, #1e8449 100%);
}

#alipay-pay-button {
    background: linear-gradient(135deg, #1A73E8 0%, #0D6EFD 100%);
    color: white;
    border-radius: 8px;
}

#alipay-pay-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #0D6EFD 0%, #0b5ed7 100%);
}

/* 售后政策与客诉解决 - 缩小与页脚的间距 */
.after-sales-policy {
    margin: 15px auto 10px auto; /* 上边距15px，下边距10px */
    max-width: 800px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid #d0d0d0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-margin-top: 20px;
    /* 固定最小高度避免布局跳动 */
    min-height: 60px;
    box-sizing: border-box;
}

.policy-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #555555 0%, #444444 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.policy-header:hover {
    background: linear-gradient(135deg, #444444 0%, #333333 100%);
    transform: translateY(-1px);
}

.policy-icon {
    font-size: 1.4em;
    margin-right: 12px;
}

.policy-title {
    font-size: 1.1em;
    font-weight: 600;
    flex-grow: 1;
    text-align: center;
}

.policy-toggle {
    font-size: 1.4em;
    transition: transform 0.4s ease;
    margin-left: auto;
}

.after-sales-policy.expanded .policy-toggle {
    transform: rotate(180deg);
}

.policy-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    background-color: #fafafa;
}

.after-sales-policy.expanded .policy-content {
    max-height: 1000px;
    padding: 20px;
}

.policy-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.policy-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.label-icon {
    font-size: 1.2em;
    margin-right: 10px;
}

.policy-desc {
    color: #6c757d;
    line-height: 1.6;
    margin-left: 30px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-left: 30px;
}

.contact-card {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 200px;
}

.contact-icon {
    font-size: 1.5em;
    margin-right: 15px;
    color: #007bff;
}

.contact-details {
    flex: 1;
}

.contact-type {
    font-size: 0.8em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-weight: 600;
    color: #495057;
    word-break: break-all;
}

.policy-note {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    margin-top: 10px;
    background: linear-gradient(to right, #fff, #f8f9fa, #fff);
    font-style: italic;
    border-radius: 0 0 8px 8px;
}

.note-icon {
    margin-right: 5px;
}

.hidden {
    display: none;
}

/* 商品列表容器 - 重新设计布局 */
.product-list {
    display: flex;
    /* 移除justify-content: center，避免影响商品的offsetLeft计算 */
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 30px 0;
    scrollbar-width: none;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: grab;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
    /* 调整高度以适应商品项，避免占据整个页面 */
    height: auto;
    min-height: 300px;
    max-height: 500px;
    box-sizing: border-box;
    /* 调整遮罩效果，进一步减少对商品可见性的影响 */
    mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
    position: relative;
}

.product-list::-webkit-scrollbar {
    display: none;
}

/* 拖拽时的光标样式 */
.product-list.active {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* 商品项容器 - 重新设计尺寸确保合理布局 */
.product {
    flex: 0 0 auto;
    width: 280px;
    /* 调整高度以适应内容，避免过大 */
    height: auto;
    min-height: 350px;
    max-height: 400px;
    margin: 0 15px;
    padding: 20px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* 使用 transform 实现视觉放大效果，而不改变文档流 */
    transform-origin: center center;
    box-sizing: border-box;
}

/* 商品内容容器 - 更好地控制内部布局 */
.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product img {
    /* 调整图片尺寸，确保不占据过多空间 */
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    /* 添加边框以增强视觉效果 */
    border: 1px solid #eee;
}

.product h3 {
    font-size: 1.3em;
    margin: 12px 0;
    color: #2c3e50;
    font-weight: 600;
    height: 2.5em;
    overflow: hidden;
    flex-shrink: 0;
}

.product-description {
    font-size: 0.95em;
    color: #7f8c8d;
    margin: 12px 0;
    min-height: 60px;
    line-height: 1.5;
    flex: 1;
}

.product-price {
    font-size: 1.2em;
    color: #e74c3c;
    margin: 12px 0;
    font-weight: 700;
    height: 1.5em;
    flex-shrink: 0;
}

.product-discount {
    font-size: 0.95em;
    color: #27ae60;
    margin: 6px 0;
    font-weight: 500;
    height: 1.5em;
    flex-shrink: 0;
}

.product-rebate {
    font-size: 0.95em;
    color: #3498db;
    margin: 6px 0;
    font-weight: 500;
    height: 1.5em;
    flex-shrink: 0;
}

/* 商品悬停效果 - 使用 transform 实现视觉效果 */
.product:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product:hover img {
    transform: scale(1.05);
}

/* 选中商品效果 - 使用 transform 实现视觉效果 */
.product.selected {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
    border: 3px solid #007bff;
    background-color: #f8f9fa;
    /* 使用 position: relative 和 z-index 确保选中商品在视觉上突出 */
    z-index: 10;
    position: relative;
}

/* 移动端优化商品列表 */
@media (max-width: 768px) {
    /* 移动端优化商品列表 */
    .product-list {
        padding: 2vw 0;
        margin: -1.5vw 0;
        height: auto;
        min-height: 25vh;
        max-height: 35vh;
        /* 调整遮罩效果，进一步减少对商品可见性的影响 */
        mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
    }
    
    .product {
        width: 25vw;
        min-width: 160px;
        max-width: 260px;
        margin: 0 1vw;
        padding: 1.2vw;
        height: auto;
        min-height: 28vh;
        max-height: 380px;
        border-radius: 1.2vw;
        box-shadow: 0 0.4vw 1.2vw rgba(0, 0, 0, 0.1);
    }
    
    .product img {
        height: 15vh;
        max-height: 130px;
    }
    
    .product h3 {
        font-size: 1.1em;
    }
    
    .product-description {
        font-size: 0.9em;
        min-height: 50px;
    }
    
    .product-price {
        font-size: 1em;
    }
    
    .product-discount,
    .product-rebate {
        font-size: 0.9em;
    }
}

/* 针对更小屏幕的优化 */
@media (max-width: 480px) {
    .product-list {
        height: auto;
        min-height: 22vh;
        max-height: 32vh;
        padding: 1.5vw 0;
        /* 调整遮罩效果，进一步减少对商品可见性的影响 */
        mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 1%, black 99%, transparent 100%);
    }
    
    .product {
        width: 28vw;
        min-width: 140px;
        max-width: 240px;
        margin: 0 0.8vw;
        padding: 1vw;
        height: auto;
        min-height: 26vh;
        max-height: 360px;
        border-radius: 1vw;
        box-shadow: 0 0.3vw 1vw rgba(0, 0, 0, 0.1);
    }
    
    .product img {
        height: 14vh;
        max-height: 120px;
    }
    
    .product h3 {
        font-size: 1em;
    }
    
    .product-description {
        font-size: 0.85em;
        min-height: 45px;
    }
    
    .product-price {
        font-size: 0.95em;
    }
    
    .product-discount,
    .product-rebate {
        font-size: 0.85em;
    }
}

/* 支付弹窗样式 - 现代化设计 */
.payment-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 深色半透明背景 */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* 背景模糊效果 */
}

.payment-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 20px; /* 更大的圆角 */
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); /* 更深的阴影 */
    animation: modalFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* 确保弹窗在小屏幕上也能正常显示 */
    max-height: 85vh;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.payment-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); /* 渐变背景 */
    border-bottom: 1px solid #dee2e6;
    position: relative;
}

.pay-option {
    padding: 10px 25px;
    margin: 0 15px;
    cursor: pointer;
    border-radius: 30px; /* 圆形标签 */
    transition: all 0.3s ease;
    font-weight: 600;
    color: #6c757d;
    background-color: transparent;
    border: 2px solid transparent;
    /* 确保按钮在小屏幕上不会换行 */
    white-space: nowrap;
}

.pay-option:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

/* 微信支付激活时的样式 */
.pay-option.wechat-active {
    cursor: default;
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.15);
    border-color: #27ae60;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

/* 支付宝支付激活时的样式 */
.pay-option.alipay-active {
    cursor: default;
    color: #1A73E8;
    background-color: rgba(26, 115, 232, 0.15);
    border-color: #1A73E8;
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #e53e3e;

    transform: rotate(90deg);
}

/* 二维码容器样式 */
#qr-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-grow: 1;
    max-height: 100%;
    text-align: center;
    padding: 25px;
    /* 确保内容在小屏幕上也能正常显示 */
    box-sizing: border-box;
    /* 设置固定高度避免内容切换时跳动 */
    min-height: 300px;
    /* 添加过渡动画减少跳动 */
    transition: all 0.3s ease;
    /* 添加淡入淡出效果 */
    opacity: 1;
    /* 使用transform替代opacity获得更流畅的动画 */
    transform: translateZ(0);
    will-change: opacity, transform;
}

/* 预渲染的不同状态内容 */
.qr-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.qr-content.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 骨架屏样式 */
.skeleton-loader {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skeleton-title {
    width: 80%;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 20px;
}

.skeleton-image {
    width: 120px;
    height: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
    margin: 15px 0;
}

.skeleton-qr {
    width: 200px;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
    margin: 20px 0;
}

.skeleton-tip {
    width: 70%;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-top: 15px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

#qr-container h3,
#qr-container h4 {
    word-wrap: break-word;
    min-width: 0;
    max-width: 100%;
    cursor: default;
    /* 限制标题的最大宽度 */
    max-width: 90%;
}

/* 商品图像样式 */
.qr-product-img {
    max-width: 120px;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    /* 确保图片在小屏幕上不会过大 */
    max-width: 100px;
}

.qr-product-img:hover {
    transform: scale(1.05);
}

/* 二维码样式 */
.qr-code {
    max-width: 220px;
    height: auto;
    margin: 20px 0;
    border: 10px solid white;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    /* 确保二维码在小屏幕上能正常显示 */
    max-width: 180px;
}

.qr-code:hover {
    transform: scale(1.03);
}

.payment-tip {
    font-size: 1em;
    color: #6c757d;
    margin: 15px 0;
    padding: 12px 18px;
    background: linear-gradient(to right, #e9ecef, #f8f9fa, #e9ecef);
    border-radius: 30px;
    font-weight: 500;
    /* 确保提示信息在小屏幕上不会换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    /* 确保加载动画在小屏幕上也能正常显示 */
    padding: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    /* 确保加载动画在小屏幕上不会过大 */
    width: 40px;
    height: 40px;
}

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

.error-message {
    text-align: center;
    padding: 25px;
    /* 确保错误信息在小屏幕上也能正常显示 */
    padding: 15px;
}

.error-message p {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.1em;
    /* 确保错误信息在小屏幕上不会过大 */
    font-size: 1em;
}

.retry-button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* 确保按钮在小屏幕上不会过大 */
    padding: 10px 20px;
    font-size: 0.9em;
}

.retry-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.retry-button:active {
    transform: translateY(0);
}

.success-icon {
    font-size: 5em;
    color: #4CAF50;
    margin-bottom: 25px;
    text-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    /* 确保图标在小屏幕上不会过大 */
    font-size: 3em;
}

.failure-icon {
    font-size: 5em;
    color: #f44336;
    margin-bottom: 25px;
    text-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
    /* 确保图标在小屏幕上不会过大 */
    font-size: 3em;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* 确保按钮在小屏幕上不会过大 */
    padding: 12px 24px;
    font-size: 0.95em;
}

.btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.btn.secondary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

/* 支付宝网页支付样式 */
.alipay-web-pay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 300px;
}

.alipay-web-pay p {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.pay-now-button {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    width: 100%;
    max-width: 200px;
    margin-bottom: 15px;
}

.pay-now-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.pay-now-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

/* 倒计时容器 */
.countdown-container {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(26, 115, 232, 0.1);
    border-radius: 10px;
    width: 100%;
    text-align: center;
}

.countdown-text {
    font-size: 0.9em;
    color: #1A73E8;
    margin: 0;
    font-weight: 500;
}

.countdown-text span {
    font-weight: 700;
    font-size: 1.1em;
}

/* 支付结果页面样式 */
.payment-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 300px;
}

.success-icon, .failure-icon {
    font-size: 4em;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 20px;
    font-weight: bold;
}

.success-icon {
    background-color: #d4edda;
    color: #28a745;
    border: 3px solid #28a745;
}

.failure-icon {
    background-color: #f8d7da;
    color: #dc3545;
    border: 3px solid #dc3545;
}

.payment-result h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #333;
}

.payment-result p {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #666;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 15px 10px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

/* 支付结果模态框样式 */
.payment-result-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    width: 100%;
}

.payment-result-modal .success-icon, 
.payment-result-modal .failure-icon {
    font-size: 3em;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 20px;
    font-weight: bold;
}

.payment-result-modal .success-icon {
    background-color: #d4edda;
    color: #28a745;
    border: 3px solid #28a745;
}

.payment-result-modal .failure-icon {
    background-color: #f8d7da;
    color: #dc3545;
    border: 3px solid #dc3545;
}

.payment-result-modal h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.payment-result-modal p {
    font-size: 1em;
    margin-bottom: 10px;
    color: #666;
}

.payment-result-modal .btn {
    display: inline-block;
    padding: 10px 25px;
    margin: 10px 5px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    border: none;
    cursor: pointer;
    font-size: 0.9em;
}

.payment-result-modal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.payment-result-modal .btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.payment-result-modal .btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .alipay-web-pay {
        padding: 15px;
        margin: 15px 0;
    }
    
    .alipay-web-pay p {
        font-size: 1em;
        margin: 0 0 12px 0;
    }
    
    .pay-now-button {
        padding: 10px 25px;
        font-size: 1em;
        max-width: 180px;
        margin-bottom: 12px;
    }
    
    .countdown-container {
        padding: 8px;
        margin-top: 12px;
    }
    
    .countdown-text {
        font-size: 0.85em;
    }
    
    .countdown-text span {
        font-size: 1em;
    }
    
    .error-message {
        padding: 20px;
    }
    
    .error-message p {
        font-size: 1em;
        margin: 0 0 15px 0;
    }
    
    .retry-button {
        padding: 8px 20px;
        font-size: 0.9em;
    }
    
    .payment-result-modal {
        padding: 25px 15px;
    }
    
    .payment-result-modal .success-icon, 
    .payment-result-modal .failure-icon {
        font-size: 2.5em;
        width: 70px;
        height: 70px;
    }
    
    .payment-result-modal h2 {
        font-size: 1.3em;
    }
    
    .payment-result-modal p {
        font-size: 0.9em;
    }
    
    .payment-result-modal .btn {
        padding: 8px 20px;
        margin: 8px 3px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .alipay-web-pay {
        padding: 12px;
        margin: 12px 0;
    }
    
    .alipay-web-pay p {
        font-size: 0.95em;
        margin: 0 0 10px 0;
    }
    
    .pay-now-button {
        padding: 8px 20px;
        font-size: 0.95em;
        max-width: 160px;
        margin-bottom: 10px;
    }
    
    .countdown-container {
        padding: 6px;
        margin-top: 10px;
    }
    
    .countdown-text {
        font-size: 0.8em;
    }
    
    .countdown-text span {
        font-size: 0.95em;
    }
    
    .error-message {
        padding: 15px;
    }
    
    .error-message p {
        font-size: 0.95em;
        margin: 0 0 12px 0;
    }
    
    .retry-button {
        padding: 6px 16px;
        font-size: 0.9em;
    }
    
    .payment-result-modal {
        padding: 20px 10px;
    }
    
    .payment-result-modal .success-icon, 
    .payment-result-modal .failure-icon {
        font-size: 2em;
        width: 60px;
        height: 60px;
    }
    
    .payment-result-modal h2 {
        font-size: 1.1em;
    }
    
    .payment-result-modal p {
        font-size: 0.85em;
    }
    
    .payment-result-modal .btn {
        padding: 6px 16px;
        margin: 6px 2px;
        font-size: 0.8em;
    }
}

/* 页脚 - 调整与上方内容的间距 */
footer {
    text-align: center;
    /* 减小与上方内容的间距 */
    margin-top: 15px;
    font-size: 0.95em;
    color: #333;
    padding: 15px;
    background: transparent;
    border-radius: 10px;
    /* 居中显示并优化字体样式 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 进度指示器 */
.progress-indicator {
    margin: 20px 0;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.progress-indicator p {
    margin: 0;
    font-size: 1em;
    color: #495057;
}

.progress-indicator span {
    font-weight: 700;
    color: #007bff;
}

/* 支付等待指示器 */
.payment-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    width: 100%;
}

.payment-waiting p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #6c757d;
}

/* 错误详情 */
.error-details {
    color: #dc3545;
    font-weight: 500;
    margin: 10px 0;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 5px;
}


/* 在商品列表的开始位置添加更多空间，确保第一个商品完全可见 */
/* .product-list::before {
    content: '';
    flex: 0 0 300px; /* 增加第一个商品前面的空间到 300px */
/* }

/* 在商品列表的结束位置添加标准空间 */
/* .product-list::after {
    content: '';
    flex: 0 0 40px; /* 保持最后一个商品后面的空间为40px */
/* } */