/* 重置样式 */
* {
    font-size: 14px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    /* max-width: 414px; */
    margin: 0 auto;
    background-color: #fff;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* 页面切换 */
.page {
    display: none;
    height: 100vh;
}

.page.active {
    display: block;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    /* padding: 20px 16px; */
    height: 40px;
    line-height: 40px;
    position: relative;
    text-align: center;
}

.profile-content {
    /* padding: 8px; */
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* 个人信息区域 */
.profile-section {
    background: white;
    margin: 16px;
    /* border-radius: 12px; */
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; */
  
 
}
   .user-container{
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.user-info {
    display: flex;
    align-items: center;
    flex: 1 1 auto;   /* 允许拉伸 */
    min-width: 0;     /* 防止内容撑破 */
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    border: 2px solid #f0f0f0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details h4 {
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

/* 跑马灯样式 */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    margin-top: 5px; /* 与上方"微信用户"保持一点距离 */
}

.marquee-text {
    color: red; /* 红色字体 */
    display: inline-block;
    animation: marquee 15s linear infinite; /* 15秒滚动一轮 */
    font-size: 14px; /* 可以根据需要调整字体大小 */
    margin: 0;
}

/* 跑马灯动画 */
@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 鼠标悬停暂停（可选） */
.marquee-container:hover .marquee-text {
    animation-play-state: paused;
}

.scan-section {
    flex-shrink: 0;   /* 不收缩 */
    margin-left: 12px;
}

.scan-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* min-width: 60px; */
}

.scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.scan-btn i {
    font-size: 20px;
}

/* 卡券列表区域 */
.coupons-section {
    margin: 16px;
    background: white;
    /* border-radius: 12px; */
    overflow: hidden;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
}

.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab:hover {
    background-color: #f8f9fa;
}

/* 电子券列表 */
.coupons-container {
    padding: 16px;
    /* min-height: 300px; */
    height: calc(100vh - 100px);
    overflow-y: auto;
}

.coupon-list {
    display: none;
}

.coupon-list.active {
    display: block;
}

.coupon-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
}

.coupon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.coupon-item.used {
    opacity: 0.6;
}

.coupon-item.expired {
    opacity: 0.4;
}

.coupon-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    /* padding: 16px; */
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.coupon-amount {
    font-size: 24px;
    font-weight: bold;
}

.coupon-type {
    font-size: 12px;
    opacity: 0.9;
}

.coupon-body {
    padding: 0.8rem;
    width: calc(100% - 100px);
}

.coupon-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.coupon-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.4;
}

.coupon-validity {
    font-size: 0.8rem;
    color: #999;
}

/* .coupon-status {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
} */

/* 核销状态页面 */
.verification-content {
    padding: 40px 20px;
    text-align: center;
}

.verification-icon {
    margin-top: 40px;
}

.verification-icon i {
    font-size: 40px;
    color: #28a745;
}

.verification-icon i.error {
    color: #dc3545;
}

.verification-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    margin-top: 20px;
}

.verification-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* .verification-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.verification-details h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.verification-details p {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
} */

.verification-actions {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    /* left: 0;
    right: 0; */
    /* margin-top: 32px; */
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 14px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 375px) {
    .container {
        max-width: 100%;
    }
    
    /* .header {
        padding: 6px 12px;
    }
     */
    .profile-section {
        margin: 12px;
        padding: 12px;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
    }
    
    .user-details h2 {
        font-size: 16px;
    }
    
    .scan-btn {
        padding: 10px;
        /* min-width: 50px; */
    }
    
  
    
    .coupons-section {
        margin: 12px;
    }
    
    .coupons-container {
        padding: 12px;
    }
}

/* 微信内置浏览器优化 */
.wechat-optimized {
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

/* 触摸反馈 */
.coupon-item:active {
    transform: scale(0.98);
}

.tab:active {
    background-color: #e9ecef;
}

.scan-btn:active {
    transform: scale(0.95);
}

.merchant-stats {
    margin-top: 12px;
    background: #f8f8ff;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(102,126,234,0.08);
    font-size: 12px!important;
}
.merchant-stats h4 {
    font-size: 12px;
    color: #4b3fa7;
    margin-bottom: 8px;
}
.stats-row {
    display: flex;
    /* flex-wrap: wrap; */
    justify-content: space-between;
    align-items: center;
    color: #333;

}
.stats-row div{
    font-size: 12px; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.stats-row div span{
    font-size: 14px;
    color: #4b3fa7;
}
.voucher-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(102,126,234,0.08);
    margin: 12px 16px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
#load-more-btn {
    display: block;
    margin: 16px auto 0;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}
#load-more-btn:active {
    opacity: 0.8;
}

.voucher-list-title{
    text-align: center;
    margin-top: 12px;
}
.voucher-list-content{
    height: calc(100vh - 200px);
    overflow-y: auto;
}

.qrcode-modal {
    position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.qrcode-modal-mask {
    position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5);
}
.qrcode-modal-content {
    position: relative; background: #fff; border-radius: 12px; padding: 24px 20px 16px 20px; z-index: 1; min-width: 260px; text-align: center;
}
.qrcode-modal-title {
    font-size: 16px; font-weight: bold; margin-bottom: 16px;
}
.qrcode-modal-close {
    margin-top: 18px; padding: 6px 24px; border: none; border-radius: 16px; background: #667eea; color: #fff; font-size: 15px; cursor: pointer;
}