/* ===== 基础复位与防晃动核心 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮阴影 */
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none; /* 阻止 iOS 橡皮筋横向触发 */
    scroll-behavior: smooth; /* 全局平滑滚动 */
    -webkit-text-size-adjust: 100%; /* 阻止横屏时字体自动放大 */
}

#app-wrap, .fixed-footer, .header-container, body > * {
    max-width: 100%;
}

body {
    font-family: PingFang SC, -apple-system, BlinkMacSystemFont, Helvetica Neue, Arial, sans-serif;
    background: #fff;
    color: #333;
}

/* ===== 全局图片优化 ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

/* ===== 头部与悬浮按钮 ===== */
.header-container {
    position: relative;
    width: 100%;
}

.header-container img {
    width: 100%;
}

.floating-buttons {
    position: absolute;
    top: 22%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn {
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation; /* 优化移动端点击延迟 */
    transition: transform 0.1s ease;
}

.floating-btn:active {
    transform: scale(.95);
}

/* ===== 产品区与常规图片区 ===== */
.product-display img, .divider img, .pay-section img {
    width: 100%;
    cursor: pointer;
}

/* ===== 横向商品滚动容器（核心优化） ===== */
.scroll-row {
    display: flex;
    align-items: center;
    max-width: 100%;
}

.scroll-row .yyzz {
    width: 20%;
    flex-shrink: 0; /* 防止被挤压 */
}

.scroll-row .yyzz img {
    width: 100%;
}

.scroll-view, .scroll-view-H {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    max-width: 100%;
    overscroll-behavior-x: contain; /* 局部滚动不影响全局 */
    -webkit-overflow-scrolling: touch; /* 恢复 iOS 丝滑滚动弹性 */
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none; /* IE 隐藏滚动条 */
}

/* Webkit内核（Chrome/Safari/微信）隐藏滚动条 */
.scroll-view::-webkit-scrollbar,
.scroll-view-H::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ===== 商品卡片组件 ===== */
.product-item {
    display: inline-block;
    margin-left: 10px;
    width: 60px;
    text-align: center;
    position: relative;
    vertical-align: top;
}

.product-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.product-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: #dfc449;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 0 4px 0 4px;
    color: #fff;
}

.product-name {
    font-size: 12px;
    margin: 5px 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-weight: bold;
    font-size: 11px;
    color: #ec5d2a;
}

/* ===== 文本与通知 ===== */
.notice {
    color: #999;
    font-size: 13px;
    padding: 12px;
    line-height: 1.6;
}

.notice a {
    color: #FF5252;
    text-decoration: none;
}

.hotline {
    padding: 15px 10px;
}

.hotline p {
    text-align: center;
    color: #999;
    margin: 5px 0;
    font-size: 14px;
}

.notice-popup {
    position: fixed;
    top: 15px;
    left: 15px;
    max-width: 240px;
    background: rgba(0,0,0,.65); /* 稍微加深提升可读性 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* Safari 模糊兼容 */
    border-radius: 8px;
    padding: 12px 14px;
    z-index: 99999;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

/* ===== 表单样式 ===== */
.addr-form {
    padding: 4px 6px;
}

.addr-form .layui-input {
    height: 42px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    transition: border-color 0.2s;
}

.addr-form .layui-textarea {
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    transition: border-color 0.2s;
}

.addr-form .layui-input:focus,
.addr-form .layui-textarea:focus {
    border-color: #FF5252; /* 聚焦高亮 */
    outline: none;
}

.addr-err {
    color: #FF5252;
    font-size: 12px;
    margin: 4px 0 0;
    display: none;
}

.addr-row {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.addr-row .layui-input-inline {
    flex: 1;
}

.addr-row > #area-picker {
    flex: 1 1 auto;
    min-width: 0;
}

/* layarea 省市区三级联动适配 */
#area-picker {
    flex: 1;
    min-width: 0;
    width: 100%;
}

#area-picker .layarea-box {
    display: flex;
    gap: 8px;
    width: 100%;
}

#area-picker .layarea-item {
    flex: 1;
    min-width: 0;
}

#area-picker .layarea-item .layui-form-select {
    width: 100%;
}
.layui-input-block {
    margin-left: 0;
}
/* ===== 底部固定按钮 & 全面屏适配（核心优化） ===== */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    /* 基础内边距 + 自动适配苹果刘海全面屏底部安全区域 */
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 999;
}

.fixed-footer .submit-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(90deg,#FF5252,#ff6b6b);
    color: #fff;
    border: none;
    border-radius: 26px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    touch-action: manipulation;
    /* 强制硬件加速，防止动画抖动、卡顿或文字变模糊 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    animation: btnPulse 1.5s infinite ease-in-out;
}

@keyframes btnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03) translateY(-1px); } /* 减小了位移幅度，防止触底晃动 */
    100% { transform: scale(1); }
}

/* 动态撑开页面底部，防止内容被固定底部遮挡（适配全面屏） */
.page-padding {
    padding-bottom: calc(85px + env(safe-area-inset-bottom));
}
