* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

/* 小票整体容器 */
.main-container {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 8px 8px 20px 20px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding-bottom: 20px;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
        background-color: #f0f0f0 !important;
    }
    
    .main-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        flex: 1 !important;
        overflow: visible !important;
        padding-top: 0 !important;
        position: relative !important;
    }
    
    .ticket-border {
        top: 20px !important; /* 调整虚线位置到波浪下方 */
        z-index: 100 !important; /* 确保在波浪下方 */
    }
    
    /* 显示PC端的波浪撕票效果 */
    .ticket-tear {
        background-color: #f0f0f0 !important;
        display: block !important;
        top: 0 !important;
        height: 20px !important;
    }
    
    /* 调整波浪样式适应移动端 */
    .ticket-tear:before {
        height: 20px !important;
        background-size: 80px 20px !important;
    }
    
    .header {
        margin-top: 20px !important; /* 适应PC端波浪效果高度 */
        border-top: none !important; /* 移除头部上边框 */
        padding-top: 10px !important; /* 减少顶部内边距 */
    }
    
    .footer {
        margin-top: 0 !important;
        padding: 15px !important;
        background-color: #fff !important;
    }
    
    .qr-code {
        width: 200px !important; /* 稍微缩小二维码尺寸 */
        height: 200px !important;
    }
}

/* 顶部撕票效果 */
.ticket-tear {
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 101;
    overflow: hidden;
}

/* 波浪形撕票效果 */
.ticket-tear:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,20 L0,0 C5,3.5 10,7 15,3.5 C20,0 25,3.5 30,7 C35,10.5 40,7 45,3.5 C50,0 55,3.5 60,7 C65,10.5 70,7 75,3.5 C80,0 85,3.5 90,7 C95,10.5 100,7 100,0 L100,20 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 100px 30px;
    background-repeat: repeat-x;
}

/* 小票边缘虚线 */
.ticket-border {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 1px;
    border-top: 2px dashed #e0e0e0;
    z-index: 100;
}

/* 小票头部 */
.header {
    padding: 15px 15px 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    position: relative;
    z-index: 102;
    margin-top: 25px;
    border-bottom: 1px dashed #e0e0e0;
}

.pay-icon {
    /* background-color: #1677ff; */
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
}

.header-title {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

/* 金额区域 */
.amount-section {
    padding: 25px 0 20px;
    text-align: center;
    /* border-bottom: 1px dashed #e0e0e0; */
    margin: 0 15px;
}

.amount-display {
    font-size: 32px;
    font-weight: 500;
    color: #000;
}

.expire-time {
    margin-top: 10px;
    font-size: 13px;
    color: #999;
}

/* 二维码容器 */
.qr-container {
    padding: 15px;
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.qr-code {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 1px solid #eee;
}

/* 小票分隔虚线 */
.ticket-divider {
    border-top: 1px dashed #e0e0e0;
    margin: 10px 15px;
}

.qr-code img {
    max-width: 100%;
    max-height: 100%;
}

.payment-instructions {
    text-align: center;
    padding: 10px 15px;
    border-top: 1px dashed #e0e0e0;
    margin-top: 10px;
}

.instruction-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 6px 0;
}

/* 小票底部 */
.ticket-bottom {
    margin-top: 10px;
    border-top: 1px dashed #e0e0e0;
    padding: 15px 15px 5px;
    text-align: center;
}

/* 小票序列号 */
.ticket-serial {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* 条形码效果 */
.barcode {
    height: 40px;
    margin: 10px auto;
    background-image: linear-gradient(90deg, #333 2px, transparent 2px), 
                     linear-gradient(90deg, #333 1px, transparent 1px);
    background-size: 8px 100%, 4px 100%;
    background-repeat: repeat-x;
    width: 80%;
}

.footer {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 13px;
}

/* 错误状态 */
.error-state {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    z-index: 10;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #1677ff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* 跳转倒计时 */
.redirect-countdown {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    z-index: 10;
}

body.loading .loading-overlay {
    display: flex;
}

body:not(.loading) .loading-overlay {
    display: none;
}

/* 新增样式 - 订单摘要 */
.order-summary {
    margin: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.summary-header {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 5px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 13px;
}

.summary-label {
    color: #666;
}

.summary-value {
    color: #333;
    font-weight: 500;
}

.check-status {
    cursor: pointer;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border-radius: 15px;
    display: inline-block;
    margin-top: 10px;
    color: #1677ff;
    font-size: 14px;
}

/* 错误状态显示 */
.error-state.show {
    display: flex;
}

/* 跳转倒计时显示 */
.redirect-countdown.show {
    display: flex;
}

.error-icon, .redirect-icon {
    font-size: 28px;
    margin-bottom: 15px;
}

.error-title, .redirect-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.error-message, .redirect-message {
    font-size: 14px;
    color: #666;
    max-width: 80%;
    line-height: 1.5;
}

.redirect-cancel {
    margin-top: 15px;
    font-size: 14px;
    color: #1677ff;
    cursor: pointer;
    text-decoration: underline;
}

/* 状态类样式 */
.error-icon.expired {
    color: #ff9800;
}

.error-icon.cancelled {
    color: #f44336;
}

.error-icon.success {
    color: #4caf50;
}

.error-icon.timeout {
    color: #ff5722;
}

/* 将二维码部分隐藏 */
.qr-container.hide {
    visibility: hidden;
}