/**
 * 钱包页面 - 响应式样式（优化版）
 * 针对手机端进行全面响应式优化
 */

/* 确保页面可以滚动 */
html, body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 页面内容容器 */
.wallet-content {
    position: relative;
    min-height: 100svh;
    z-index: 1;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

/* 确保钱包页面有足够的高度和可滚动性 */
body .page-wrapper,
body .page-no-header {
    min-height: 100svh;
    height: auto !important;
    overflow-y: visible !important;
    position: relative !important;
}

body main {
    min-height: 750px;
    height: auto;
    overflow: visible;
    position: relative;
    padding-bottom: 100px; /* 底部留出空间 */
}

/* ==================== 功能图标区 ==================== */
.wallet-icons {
    position: absolute;
    top: clamp(80px, 24.53vw, 92px);
    left: 0;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: space-around;
    padding: 0 clamp(6%, 9.87vw, 10%);
}

.wallet-icon-item {
    width: clamp(48px, 14.93vw, 56px);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 1.6vw, 6px);
}

.wallet-icon-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.wallet-icon-item p {
    margin: 0;
    font-size: clamp(9px, 3vw, 12px);
    color: #000;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

/* 移除旧的独立文字布局 */
.wallet-icon-labels { display: none; }

/* ==================== 钱包卡片 ==================== */
.wallet-card {
    position: absolute;
    top: clamp(160px, 49.07vw, 184px);
    left: 50%;
    transform: translateX(-50%);
    width: min(91.2%, 342px);
    height: auto;
    aspect-ratio: 342 / 479;
}

.wallet-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== 卡片文字 ==================== */
.wallet-text {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 0;
    width: min(80%, 301px);
    text-align: left;
}

.wallet-text p {
    line-height: 1.4;
    white-space: pre;
    margin: 0;
}

/* 根据卡片位置动态计算文字位置 */
.wallet-balance-label {
    top: clamp(400px, 120.27vw, 451px);
    font-size: clamp(13px, 4vw, 16px);
    color: #000;
}

.wallet-balance-amount {
    top: clamp(425px, 128.27vw, 481px);
    font-size: clamp(18px, 6vw, 24px);
    font-weight: 600;
    color: #000;
}

.wallet-quota-label {
    top: clamp(455px, 136.53vw, 512px);
    font-size: clamp(13px, 4vw, 16px);
    font-weight: 500;
    color: #000;
}

.wallet-quota-amount {
    top: clamp(480px, 144.27vw, 541px);
    font-size: clamp(13px, 4vw, 16px);
    font-weight: 500;
    color: #000;
}

/* ==================== 认证横幅 ==================== */
.wallet-certificate {
    position: absolute;
    top: clamp(510px, 153.6vw, 576px);
    left: 50%;
    transform: translateX(-50%);
    width: min(80.27%, 301px);
    height: auto;
    aspect-ratio: 301 / 66;
    box-shadow: 0px 1px 3px 0px rgba(71,8,8,0.5);
    border-radius: 4px;
}

.wallet-certificate img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* ==================== 操作按钮 ==================== */
.wallet-buttons {
    position: absolute;
    top: clamp(600px, 181.87vw, 682px);
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 360px);
    display: flex;
    justify-content: space-between;
    gap: clamp(3px, 1.2vw, 5px);
}

.wallet-button {
    flex: 1;
    max-width: 85px;
    height: clamp(28px, 8.53vw, 32px);
    position: relative;
    cursor: pointer;
}

.wallet-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* 按钮文字 */
.wallet-button-labels {
    position: absolute;
    top: clamp(616px, 186.13vw, 698px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 360px);
    display: flex;
    justify-content: space-between;
    font-size: clamp(10px, 3.2vw, 13px);
    color: #fff;
    font-weight: 500;
    pointer-events: none;
}

.wallet-button-labels p {
    line-height: 1.4;
    margin: 0;
    text-align: center;
    flex: 1;
}

/* ==================== 媒体查询 ==================== */

/* 超小屏手机 (320px) */
@media (max-width: 320px) {
    /* 确保可以滚动 */
    html, body {
        height: auto !important;
        min-height: 100vh !important;
    }
    
    .container {
        min-height: 800px !important;
        height: auto !important;
    }
    
    .page-wrapper {
        min-height: 800px !important;
        height: auto !important;
    }
    
    main {
        min-height: 800px !important;
        padding-bottom: 120px !important;
    }
    
    .wallet-icons {
        padding: 0 4%;
        gap: 8px;
    }
    
    .wallet-icon-item {
        width: 45px;
    }
    
    .wallet-icon-item p {
        font-size: 9px;
    }
    
    .wallet-card {
        width: 95%;
    }
}

/* 小屏手机 (321px-374px) */
@media (min-width: 321px) and (max-width: 374px) {
    .wallet-icons {
        padding: 0 6%;
    }
    
    .wallet-card {
        width: 92%;
    }
}

/* 标准屏幕 (375px-413px) - iPhone SE, 12/13/14 */
@media (min-width: 375px) and (max-width: 413px) {
    .wallet-icons {
        padding: 0 9.87%;
    }
    
    .wallet-card {
        width: 91.2%;
        max-width: 342px;
    }
}

/* 大屏手机 (414px+) - iPhone Plus, Pro Max */
@media (min-width: 414px) {
    /* 固定布局，居中显示 */
    .wallet-icons {
        padding: 0 calc((100% - 301px) / 2);
    }
    
    .wallet-card {
        width: 342px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .wallet-text {
        width: 301px;
    }
    
    .wallet-certificate {
        width: 301px;
    }
    
    .wallet-buttons {
        width: 321px;
    }
    
    .wallet-button-labels {
        width: 321px;
    }
}

/* 平板竖屏 (768px+) */
@media (min-width: 768px) {
    /* 保持移动端布局，居中显示 */
    .wallet-icons {
        max-width: 375px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .wallet-card,
    .wallet-text,
    .wallet-certificate,
    .wallet-buttons,
    .wallet-button-labels {
        left: 50%;
    }
}

/* 桌面 (1024px+) */
@media (min-width: 1024px) {
    /* 固定为375px移动版布局，完全居中 */
    body .wallet-icons,
    body .wallet-card,
    body .wallet-text,
    body .wallet-certificate,
    body .wallet-buttons,
    body .wallet-button-labels {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .wallet-icons {
        top: 70px;
    }
    
    .wallet-card {
        top: 140px;
        width: min(50%, 342px);
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .wallet-icon-item,
    .wallet-button {
        -webkit-tap-highlight-color: rgba(198, 31, 13, 0.1);
    }
    
    .wallet-icon-item:active {
        opacity: 0.8;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .wallet-card img,
    .wallet-certificate img,
    .wallet-button img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 暗色模式支持（预留） */
@media (prefers-color-scheme: dark) {
    /* 暗色模式样式可以在这里添加 */
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .wallet-icon-item,
    .wallet-button {
        transition: none;
    }
}

/* ==================== 领取政务提现码按钮 ==================== */
.withdrawal-code-button {
    position: absolute;
    top: clamp(655px, 198.4vw, 744px);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(280px, 84.8vw, 318px);
    height: clamp(44px, 13.33vw, 50px);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.withdrawal-code-button img {
    width: 100%;
    height: 100%;
    display: block;
}

.withdrawal-code-button .button-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(13px, 3.73vw, 14px);
    color: #fff;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
}

.withdrawal-code-button:active {
    transform: translateX(-50%) scale(0.98);
    opacity: 0.9;
}

/* 响应式调整 */
@media (min-width: 376px) {
    .withdrawal-code-button {
        width: 318px;
        height: 50px;
    }
}
