/* 坊市：与 #mobile-wrapper 同宽；头栏复用灵兽园 beast-scene-header；商品卡 + 全局 .item-slot + 购买按钮 */

.shop-fullscreen {
    position: absolute;
    inset: 0;
    z-index: var(--z-fullscreen-top, 9940);
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
    touch-action: manipulation;
    font-family: 'STKaiti', 'KaiTi', '华文楷体', serif;
    color: var(--text-main);
    background: linear-gradient(180deg, #0a0c12 0%, #050608 45%, #0d0818 100%);
}

.shop-scene-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 120% 55% at 50% -8%, rgba(156, 39, 176, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 40% at 80% 70%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 10% 40%, rgba(0, 230, 118, 0.04) 0%, transparent 45%);
}

.shop-fullscreen > .beast-scene-header,
.shop-fullscreen > .shop-fs-scroll,
.shop-fullscreen > .shop-fs-foot {
    position: relative;
    z-index: 1;
}

/* 标题两字略收字距（灵兽园四字用 6px） */
.shop-fullscreen .beast-scene-title {
    letter-spacing: 0.35em;
}

.relic-fullscreen .beast-scene-title {
    letter-spacing: 0.12em;
}

.relic-fs-scroll {
    padding: 6px 8px 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

/* 河图洛书：单屏内排布，禁止整块区域上下滚动（须盖过后面的 .shop-fs-scroll overflow-y:auto） */
.relic-fullscreen > .shop-fs-scroll.relic-fs-scroll {
    overflow: hidden;
    overflow-y: hidden;
    -webkit-overflow-scrolling: auto;
}

.relic-fullscreen .relic-fs-scroll #relic-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶栏货币条：沿用 style-app.css 中 .tb-pill-prop-icon；旧类名兼容 */
.shop-fullscreen .beast-scene-res .shop-res-ico {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
}

.shop-fullscreen .shop-soon-hint {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.shop-fs-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px 10px;
    box-sizing: border-box;
}

.shop-npc-line {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(224, 224, 224, 0.78);
    text-align: center;
}

.shop-refresh-line {
    font-size: 11px;
    color: var(--jade-green);
    font-family: ui-monospace, 'Consolas', monospace;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.25);
}

/* 商品：通用 item-slot + 下方购买按钮 */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    padding: 4px 0 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    align-items: start;
}

.shop-offer-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

/* 坊市激励商品：与相邻「价格」按钮同高同宽一行排布；格内极窄时勿用奇遇右侧占位，否则文案区过窄会竖排换行 */
.shop-buy-btn.shop-buy-btn--watch-ad.rewarded-ad-btn {
    padding: 9px 10px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.02em;
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    min-height: 0;
}
.shop-buy-btn.shop-buy-btn--watch-ad.rewarded-ad-btn .rewarded-ad-btn__balance {
    display: none;
}
.shop-buy-btn.shop-buy-btn--watch-ad.rewarded-ad-btn .rewarded-ad-btn__label {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    line-height: 1.1;
    text-align: center;
}
.shop-buy-btn.shop-buy-btn--watch-ad.rewarded-ad-btn .rewarded-ad-btn__play {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    font-size: 7px;
    padding-left: 2px;
    line-height: 1;
}

/* 商品外框：固定最小高度，格内布局统一 */
.shop-product-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 6px 10px;
    min-height: 168px;
    border-radius: 8px;
    border: 1px solid var(--bronze-border);
    background: linear-gradient(135deg, rgba(17, 20, 24, 0.88) 0%, rgba(6, 7, 10, 0.92) 100%);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

/* 名称 + 限购：置于卡片的上方，不叠在道具格上 */
.shop-product-card__title {
    flex-shrink: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1.25;
    font-family: 'STKaiti', 'KaiTi', '华文楷体', serif;
    padding: 0 2px 2px;
    min-height: 2.5em;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.65);
}

/* 坊市内道具格宽度一半，仅图标+数量 */
.shop-product-card .item-slot {
    width: 50%;
    align-self: center;
    box-sizing: border-box;
    flex-shrink: 0;
    min-height: 0;
}

.shop-product-grid--relic {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 430px;
}

.shop-product-card--relic {
    min-height: 212px;
}

.shop-product-card--relic .item-slot {
    width: 56%;
}

.shop-relic-hint {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.35;
    min-height: 2.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-relic-buy-stack {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.btn.shop-buy-btn--relic {
    width: 84%;
    margin-top: 0;
    padding: 8px 8px;
    font-size: 13px;
}

/* 与全局 .btn 一致；宽度约卡片的 2/3，置底。双类名保证覆盖 .btn 的 display:inline-block，内容真正 flex 居中 */
.btn.shop-buy-btn {
    position: relative;
    width: 72%;
    max-width: 100%;
    align-self: center;
    margin-top: auto;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
    border-radius: 4px;
    text-align: center;
}

.shop-buy-btn--free .shop-buy-free-label {
    font-size: 15px;
    letter-spacing: 0.35em;
    font-weight: bold;
}

/* 免费可领：商品按钮 → 页签 → 主界面坊市入口 穿透红点 */
.shop-claim-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--alert-red);
    box-shadow: 0 0 6px var(--alert-red);
    pointer-events: none;
    z-index: 3;
}

.shop-claim-dot--btn {
    top: -2px;
    right: -2px;
}

.shop-claim-dot--tab {
    top: 6px;
    right: 10px;
}

.shop-buy-btn.disabled {
    font-size: 12px;
    font-weight: bold;
}

/* 占满按钮内容区，图标+价格在行内整体水平居中 */
.shop-buy-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.shop-buy-cur {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.shop-buy-price {
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.shop-buy-price--short {
    color: var(--alert-red) !important;
    text-shadow: 0 0 6px rgba(255, 59, 48, 0.35);
}

.shop-empty-hint {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 28px 14px;
    line-height: 1.7;
    letter-spacing: 0.5px;
}

/* 底栏页签：对齐 #bottomNav */
.shop-fs-foot {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    min-height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #06080a;
    border-top: 1px solid var(--bronze-border);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.8);
}

.shop-tabs-bar {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    min-height: 52px;
    width: 100%;
}

.shop-tab-pill {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 200px;
    margin: 0;
    padding: 8px 6px;
    border: none;
    border-radius: 0;
    border-top: 3px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: bold;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    line-height: 1.25;
    -webkit-tap-highlight-color: transparent;
}

.shop-tab-pill--soon {
    opacity: 0.65;
}

.shop-tab-pill--active {
    color: var(--antique-gold);
    border-top-color: var(--antique-gold);
    background: linear-gradient(0deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    font-size: 12px;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

@media (max-width: 340px) {
    .shop-product-grid {
        gap: 8px 6px;
    }
    .shop-tab-pill {
        font-size: 10px;
        padding: 6px 4px;
    }
}
