/* eztravel.love 前台移动端与大字体安全适配 */
:root{
    --ez-safe-bottom:env(safe-area-inset-bottom,0px);
    --ez-safe-top:env(safe-area-inset-top,0px);
}

html{
    width:100%;
    min-width:320px;
    overflow-x:hidden;
    font-size:16px !important;
    -webkit-text-size-adjust:none !important;
    text-size-adjust:none !important;
}

body{
    width:100%;
    min-width:320px;
    max-width:100%;
    overflow-x:hidden;
    font-size:14px !important;
}

img,video,canvas,svg{
    max-width:100%;
}

input,select,textarea,button{
    max-width:100%;
    font-family:inherit;
}

/* 固定表单字号：既避免iPhone聚焦放大，也不跟随安卓系统超大字体膨胀 */
input,select,textarea{
    font-size:16px !important;
}

button{
    font-size:14px !important;
}

/* 弹性布局的子项目允许收缩，避免撑破手机宽度 */
header,main,section,article,nav,form,div,a,button,label,span{
    min-width:0;
}

/* 普通界面文字保持单行，空间不足显示省略号 */
h1,h2,h3,h4,h5,h6,
button,
.back,
.top a,
.page-title,
.card-title,
.section-title,
.menu-left,
.menu a,
.nickname,
.status-text,
.setting-title,
.nav-text,
.tag,
.badge{
    white-space:nowrap;
}

.page-title,
.card-title,
.section-title,
.menu-left,
.menu a,
.nickname,
.status-text,
.subtitle,
.desc,
.description,
.setting-description,
.notice-text,
.nav-text,
.tag,
.badge{
    overflow:hidden;
    text-overflow:ellipsis;
}

/* 普通说明和表格保持整齐单行；超出部分用省略号 */
p:not(.chat-text):not(.message-content),
th,
td{
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* 长号码和单号保持一行，由自己的区域左右查看 */
.bank-number,
.card-number,
.order-number,
.account-number{
    white-space:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
}

.bank-number::-webkit-scrollbar,
.card-number::-webkit-scrollbar,
.order-number::-webkit-scrollbar,
.account-number::-webkit-scrollbar{
    display:none;
}

/* 只有聊天和确实属于长正文的输入内容允许换行 */
.bubble,
.message-content,
.chat-message,
.chat-text,
textarea{
    white-space:pre-wrap !important;
    overflow-wrap:anywhere;
    word-break:break-word;
}

/* APP浏览器、安卓Chrome、iOS Safari的可视高度 */
.chat-page,
.full-height-page{
    min-height:100vh;
    min-height:100svh;
    min-height:100dvh;
}

/* 弹窗不能超出APP当前可视区域 */
.modal,
.modal-panel,
.dialog,
.dialog-panel,
.gift-panel{
    max-width:calc(100vw - 20px);
    max-height:calc(100vh - 24px);
    max-height:calc(100dvh - 24px);
}

.modal-panel,
.dialog-panel,
.gift-panel{
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
}

/* 表格只在自身内部滑动，不撑破整个页面 */
.table,
.table-wrap,
.table-responsive{
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

/* 底部导航始终保持五项单行并避开iPhone安全区 */
.bottom-nav{
    padding-bottom:calc(6px + var(--ez-safe-bottom)) !important;
}

.bottom-nav a,
.bottom-nav .nav-text{
    white-space:nowrap !important;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* 会员中心：系统最大字体下仍保持头像、姓名、会员卡的正常横向布局 */
.user-card .user-top{
    display:flex !important;
    align-items:center !important;
    flex-wrap:nowrap !important;
}

.user-card .user-name{
    max-width:130px;
    font-size:20px !important;
    line-height:1.25 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

.user-card .user-id{
    font-size:12px !important;
    line-height:1.4 !important;
    white-space:nowrap !important;
}

.user-card .credit-badge{
    width:max-content !important;
    max-width:130px !important;
    font-size:11px !important;
    line-height:1 !important;
    white-space:nowrap !important;
}

.user-card .vip-tag,
.user-card .normal-tag{
    flex:0 0 auto !important;
    width:96px !important;
    min-width:96px !important;
    height:82px !important;
    padding:10px 7px !important;
    font-size:13px !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
}

.user-card .stats{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
}

.user-card .stat{
    min-height:72px !important;
}

.user-card .stat strong{
    font-size:18px !important;
    white-space:nowrap !important;
}

.user-card .stat span,
.user-card .stat small{
    font-size:11px !important;
    white-space:nowrap !important;
}

/* 打赏页固定为双列礼物，不因系统最大字体退化成单列 */
.reward-card .gift-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

.reward-card .gift-box{
    min-width:0 !important;
}

.reward-card .gift-name{
    font-size:15px !important;
    white-space:nowrap !important;
}

.reward-card .gift-description{
    font-size:11px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

.page-title{
    font-size:27px !important;
    line-height:1.25 !important;
}

.page-subtitle{
    font-size:13px !important;
    line-height:1.5 !important;
}

.balance-label{
    font-size:13px !important;
}

.balance-number{
    font-size:32px !important;
    white-space:nowrap !important;
}

/* 定位弹窗在系统最大字体下保持完整、居中且按钮不互相挤压 */
.location-card{
    width:min(100%,390px) !important;
    padding:25px 22px !important;
}

.location-card h2{
    font-size:22px !important;
    line-height:1.3 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

.location-card p{
    font-size:13px !important;
    line-height:1.7 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

.location-actions{
    grid-template-columns:1fr 1.5fr !important;
}

.location-actions button{
    height:46px !important;
    padding:0 8px !important;
    font-size:14px !important;
    white-space:nowrap !important;
}

/* 系统字体较大或手机较窄时，优先缩小间距而不是换行 */
@media(max-width:430px){
    .page,.wrap,.container{
        max-width:100% !important;
        padding-left:max(10px,env(safe-area-inset-left,0px)) !important;
        padding-right:max(10px,env(safe-area-inset-right,0px)) !important;
    }

    .bottom-nav{
        padding-left:4px !important;
        padding-right:4px !important;
    }

    .bottom-nav a{
        padding-left:1px;
        padding-right:1px;
        font-size:clamp(10px,3vw,12px) !important;
    }

    .bottom-nav .nav-icon{
        font-size:clamp(18px,5.2vw,21px) !important;
    }

    h1,.page-title{
        font-size:clamp(20px,6vw,27px) !important;
    }

    h2,.section-title,.card-title{
        font-size:clamp(17px,5vw,22px) !important;
    }

    button,.button,.btn,.submit{
        padding-left:10px !important;
        padding-right:10px !important;
    }
}

/* 超窄屏只调整资料区；礼物仍保持双列 */
@media(max-width:350px){
    .profile-grid,
    .info-grid,
    .detail-grid,
    .feature-grid{
        grid-template-columns:1fr !important;
    }

    .reward-card .gift-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }
}

@media(prefers-reduced-motion:reduce){
    *,*::before,*::after{
        scroll-behavior:auto !important;
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
    }
}
