﻿/* shop panel 基础 */
.shop-panel {
    color: #fff;
    font-family: "Helvetica Neue", Arial, sans-serif;
    z-index: 111;
    box-sizing: border-box;
    height: 80%;
    margin-top: 20%;
}

/* 头部 */
.shop-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.25);
}

.shop-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--btn_color_q);
}

.shop-close {
    background: rgba(255,255,255,0);
    color: #fff;
    border: none;
    padding: 0px;
    border-radius: 6px;
    cursor: pointer;
    position: absolute;
    right: 2px;
    bottom: 0px;
}

    .shop-close img {
        width: 36px;
        height: 36px;
    }

.shop-currency {
    position: absolute;
    right: 10px;
}

.shop-cost-icon img {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

.shop-currency-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

.shop-currency-amount {
    font-weight: 600;
    color: #ffd54f;
    font-size: 13px;
}
/* body */
.shop-body {
    display: flex;
    width: 100%;
    height: calc(100% - 56px);
    box-sizing: border-box;
}

.shop-left {
    background: var(--btn_bg_s);
    box-sizing: border-box;
}

.shop-main {
    flex: 1;
    padding: 12px 12px 30px 12px;
    box-sizing: border-box;
    overflow: hidden;
}
/* 菜单 */
.shop-menu-btn {
}
/* 列表容器 */
.shop-list {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
}
/* item 基本样式（由 loop.js 控制列宽） */
.shop-item-wrap {
    background: var(--bg_bg_q);
    border-radius: 8px;
    padding: 8px 20px;
    box-sizing: border-box;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.shop-item-content {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-item-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
    width:60px;
}

.shop-item-remain {
    color: #cfd8dc;
    font-size: 12px;
}
/* 购买按钮 */
.shop-buy-btn {
    background: linear-gradient(90deg, #ff8a65, #ffb74d);
    border: none;
    padding: 0px 10px;
    border-radius: 6px;
    color: #061026;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--btn_color_s);
    font-size: 14px;
}

.shop-buy-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
/* modal */
.shop-modal {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    display: none;
}

.shop-modal-box {
    width: 92%;
    max-width: 720px;
    background: var(--btn_bg_s);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    color: var(--btn_color_q);
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.shop-modal-left {
    width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-modal-title {
    font-size: 18px;
    font-weight: 700;
}

.shop-modal-cost {
    font-size: 14px;
    color: #ffd54f;
}

.shop-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .shop-qty-row input[type="range"] {
        width: 180px;
    }

.shop-modal-actions {
    display: flex;
    justify-content: center;
    gap: 0px;
    padding-top: 0px;
}

.shop-buy-msg {
    margin-top: 8px;
    color: #ffccbc;
}

/* 修复：将滚动限定到列表，阻止顶部/底部随手势一起移动（最小改动，追加于文件末尾） */
.shop-panel {
    /* 保持已有布局（不要将 panel 改为 absolute/flex 列） */
    /* 仅确保不允许外层滚动穿透 */
    overflow: visible; /* 不改变布局，仅避免强制隐藏 */
}

.shop-body {
    /* 防止外层区域滚动，列表内部滚动 */
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: contain;
}

.shop-left {
    /* 侧栏可以内部滚动，但不要影响外层 */
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.shop-main {
    /* 主区本身不滚动，列表承担滚动 */
    overflow: hidden;
}

/* 关键：让列表成为唯一滚动容器 */
.shop-list,
#shop-list {
    height: 100%; /* 占满主区高度 */
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* 阻止弹性滚动穿透到父容器 */
    touch-action: pan-y; /* 仅允许竖向滚动手势 */
    scrollbar-width: none; /* Firefox 隐藏滚动条（可选） */
    -ms-overflow-style: none; /* IE/Edge Legacy */
}

    .shop-list::-webkit-scrollbar,
    #shop-list::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

/* 新增：底部横向菜单（#shop-menu 加上 .shop-bottom-menu 时生效） */
#shop-menu.shop-bottom-menu {
    position: absolute; /* 脱离文档流，悬浮在底部 */
    left: 0px;
    bottom: 0px;
    width: 100%;
    border-radius: 8px;
}

    /* 单个底部菜单按钮样式（水平排列、可滚动） */
    #shop-menu.shop-bottom-menu .shop-menu-bottom-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 70px;
        margin-right: 12px;
        font-size: 14px;
        height: 30px;
        padding: 6px 12px;
        background: var(--btn_bg_s);
        color: var(--btn_color_q);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        white-space: nowrap;
        flex: 0 0 auto;
    }

        /* 激活态 */
        #shop-menu.shop-bottom-menu .shop-menu-bottom-btn.active {
            background: var(--btn_bg_q);
            color: var(--btn_color_s);
        }

    /* 隐藏横向滚动条（WebKit） */
    #shop-menu.shop-bottom-menu::-webkit-scrollbar {
        height: 0;
    }

/* 修复面板切换时出现向左偏移露白边的问题：
   - 保证面板在横向上不产生滚动或宽度抖动（隐藏水平溢出）
   - 为滚动条保留槽位（避免出现/隐藏滚动条导致宽度变化）
   - 阻止滚动链与横向手势穿透到父层或页面
   仅追加，不改变现有布局结构 */
.shop-panel {
    overflow-x: hidden; /* 禁止水平溢出，防止露出右侧白边 */
    overscroll-behavior: contain; /* 阻止滚动链到父页面 */
    touch-action: pan-y; /* 面板内只允许纵向手势，避免横向手势引起位移 */
    scrollbar-gutter: stable; /* 为滚动条保留空间，避免出现/隐藏滚动条时宽度抖动 */
    box-sizing: border-box; /* 与现有样式一致 */
}

/* 列表保留滚动槽，避免垂直滚动条出现时导致整体抖动 */
.shop-list,
#shop-list {
    scrollbar-gutter: stable;
}

/* 底部横向菜单：确保横向滚动仅限菜单自身，阻止向外部传播 */
#shop-menu.shop-bottom-menu,
.shop-bottom-menu,
.shop-menu-bottom {
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}