/**
 * Pyramiden-Patience Specific Styles
 * © 2025 SolitairePlus
 */

/* ============================================
   PYRAMID GAME BOARD
   ============================================ */

.pyramid-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 10px 5px 10px;
    min-height: calc(100vh - var(--header-height, 60px));
    max-height: calc(100vh - var(--header-height, 60px));
    height: calc(100vh - var(--header-height, 60px));
    overflow: hidden;
    /* 平滑过渡支持 */
    transition: padding 0.3s ease, gap 0.3s ease;
    /* 防止内容溢出 */
    box-sizing: border-box;
}

.pyramid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
    position: relative;
}

.pyramid-row {
    display: flex;
    gap: var(--pyramid-spacing);
    position: relative;
    margin-top: calc(-1 * var(--card-height) * 0.78);
}

.pyramid-row:first-child {
    margin-top: 0;
}

/* ============================================
   PYRAMID CARDS - Dynamic Sizing
   ============================================ */

:root {
    /* Pyramid卡片尺寸系统 - 弹性自适应 */
    --pyramid-spacing: 0.8vw;
    
    /* 基于屏幕宽度和高度的双重计算 */
    --pyramid-card-width-by-width: calc((100vw - 4vw - 6 * var(--pyramid-spacing)) / 7);
    --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 20vh) / 3.8);
    
    /* 选择较小值确保适配 */
    --pyramid-card-width: min(
        var(--pyramid-card-width-by-width),
        var(--pyramid-card-width-by-height)
    );
    --pyramid-card-height: calc(var(--pyramid-card-width) * 1.4);
    --pyramid-card-border-radius: calc(var(--pyramid-card-width) * 0.08);
    
    /* 最小和最大尺寸 - 参考Spider (缩小1%) */
    --pyramid-min-card-width: 76.23px;
    --pyramid-min-card-height: 106.92px;
    --pyramid-max-card-width: 153.45px;
    --pyramid-max-card-height: 214.83px;
    
    /* 使用clamp确保卡片在合理范围内 */
    --card-width: clamp(
        var(--pyramid-min-card-width),
        var(--pyramid-card-width),
        var(--pyramid-max-card-width)
    );
    --card-height: clamp(
        var(--pyramid-min-card-height),
        var(--pyramid-card-height),
        var(--pyramid-max-card-height)
    );
}

.pyramid-card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--pyramid-card-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* GPU加速 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.pyramid-card.selectable {
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15),
        0 0 0 clamp(2px, 0.3vw, 3px) rgba(255, 215, 0, 0.6);
    z-index: 1;
}

.pyramid-card.selectable:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.25),
        0 6px 16px rgba(255, 215, 0, 0.7);
    z-index: 10;
}

.pyramid-card.selected {
    transform: translateY(-8px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(255, 215, 0, 0.9);
    outline: clamp(2px, 0.4vw, 4px) solid #ffd700;
    outline-offset: 2px;
    z-index: 20;
}

.pyramid-card.removed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
    transition: all 0.3s ease;
}

.pyramid-card.covered {
    cursor: not-allowed;
    filter: brightness(0.75) saturate(0.8);
}

/* ============================================
   BOTTOM AREA (Stock, Waste, Info)
   ============================================ */

.bottom-area {
    display: flex;
    gap: clamp(20px, 3vw, 35px);
    align-items: center;
    margin-top: 8px;
    margin-bottom: 5px;
}

.stock-area {
    display: flex;
    gap: clamp(12px, 2vw, 18px);
    align-items: center;
}

/* ============================================
   STOCK PILE
   ============================================ */

.stock-pile,
.waste-pile {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--pyramid-card-border-radius);
    position: relative;
}

.stock-pile {
    cursor: pointer;
    background-image: url('../images/cards/Back.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    position: relative;
}

.stock-pile:hover:not(.empty) {
    border-color: rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.stock-pile.empty {
    cursor: pointer;
    background-image: none;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.stock-pile.empty::before {
    content: "↻";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(48px, 6vw, 72px);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    pointer-events: none;
    z-index: 1;
}

.stock-pile.empty:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

.stock-pile.empty:hover::before {
    color: rgba(255, 215, 0, 0.8);
    animation: rotateIcon 0.8s ease-in-out;
}

/* When completely empty (no waste to recycle) */
.stock-pile.empty[style*="not-allowed"]::before {
    display: none;
}

.stock-pile.empty[style*="not-allowed"] {
    opacity: 0.3;
}

.stock-pile.empty[style*="not-allowed"]:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes rotateIcon {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.stock-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: clamp(24px, 3.5vw, 48px);
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 50%;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 2;
}

/* ============================================
   WASTE PILE (从Stock抽出的牌)
   ============================================ */

.waste-pile,
.discard-pile {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--pyramid-card-border-radius);
    position: relative;
}

.waste-pile {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.waste-pile.has-cards {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   DISCARD PILE (消除后的牌)
   ============================================ */

.discard-pile {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.discard-pile.has-cards {
    border: 2px solid rgba(100, 255, 100, 0.3);
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.25),
        0 0 10px rgba(100, 255, 100, 0.2);
}

.waste-card,
.discard-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--pyramid-card-border-radius);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.waste-card {
    cursor: pointer;
}

.discard-card {
    cursor: default;
    pointer-events: none;
}

/* 堆叠效果 - 显示下面的牌 */
.waste-card:not(:last-child),
.discard-card:not(:last-child) {
    filter: brightness(0.9);
}

.waste-card.selectable:hover {
    transform: translateY(-8px) !important;
    box-shadow: 
        0 6px 16px rgba(255, 215, 0, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 10 !important;
}

.waste-card.selected {
    transform: translateY(-10px) !important;
    box-shadow: 
        0 8px 20px rgba(255, 215, 0, 0.8),
        0 4px 10px rgba(0, 0, 0, 0.4) !important;
    outline: 3px solid #ffd700;
    outline-offset: 2px;
    z-index: 10 !important;
}

/* ============================================
   GAME INFO PANEL
   ============================================ */

.game-info {
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(8px, 1.5vw, 15px) clamp(15px, 2.5vw, 28px);
    border-radius: var(--pyramid-card-border-radius);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-info-label {
    font-size: clamp(11px, 1.2vw, 14px);
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: clamp(4px, 0.8vw, 8px);
}

.game-info-value {
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 700;
    color: #ffd700;
}

/* ============================================
   HINT AND ANIMATIONS
   ============================================ */

.hint-highlight {
    animation: hintPulse 1.5s ease-in-out;
    box-shadow: 0 0 20px 5px #ffd700 !important;
}

.hint-flash {
    animation: hintFlash 1s ease-in-out 2;
}

@keyframes hintPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.8);
    }
}

@keyframes hintFlash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   RESPONSIVE DESIGN - 弹性自适应系统
   ============================================ */

/* 大屏幕横屏 (宽高比 > 16:9) */
@media (min-aspect-ratio: 16/9) and (orientation: landscape) {
    :root {
        --pyramid-spacing: 1vw;
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 15vh) / 3.5);
    }
}

/* 平板横屏 (常见: 4:3, 16:10) */
@media (max-width: 1024px) and (orientation: landscape) {
    :root {
        --pyramid-spacing: 0.7vw;
        --pyramid-card-width-by-width: calc((100vw - 3vw - 6 * var(--pyramid-spacing)) / 7.5);
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 18vh) / 4);
        --pyramid-min-card-width: 64.35px;
        --pyramid-min-card-height: 90.09px;
    }
    
    .pyramid-board {
        gap: 8px;
        padding: 8px 5px 3px 5px;
    }
    
    .pyramid-container {
        margin-top: 3px;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.76);
    }
    
    .bottom-area {
        gap: clamp(12px, 2vw, 20px);
        margin-top: 6px;
        margin-bottom: 3px;
    }
    
    .stock-area {
        gap: clamp(10px, 1.5vw, 15px);
    }
}

/* 手机横屏 (超窄屏幕) */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --pyramid-spacing: 0.6vw;
        --pyramid-card-width-by-width: calc((100vw - 2.5vw - 6 * var(--pyramid-spacing)) / 8);
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 16vh) / 4.2);
        --pyramid-min-card-width: 54.45px;
        --pyramid-min-card-height: 76.23px;
    }
    
    .pyramid-board {
        gap: 6px;
        padding: 5px 5px 2px 5px;
    }
    
    .pyramid-container {
        margin-top: 2px;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.78);
    }
    
    .bottom-area {
        gap: 10px;
        margin-top: 4px;
        margin-bottom: 2px;
    }
    
    .stock-area {
        gap: 8px;
    }
}

/* 平板竖屏 (常见: iPad, 4:3, 3:2) */
@media (max-width: 1024px) and (orientation: portrait) {
    :root {
        --pyramid-spacing: 0.9vw;
        --pyramid-card-width-by-width: calc((100vw - 3vw - 6 * var(--pyramid-spacing)) / 7);
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 25vh) / 3.5);
        --pyramid-min-card-width: 69.3px;
        --pyramid-min-card-height: 97.02px;
    }
    
    .pyramid-board {
        gap: 8px;
        padding: 8px 5px 5px 5px;
    }
    
    .bottom-area {
        flex-direction: column;
        gap: 12px;
        margin-top: 8px;
        margin-bottom: 5px;
    }
    
    .stock-area {
        gap: 15px;
    }
}

/* 手机竖屏 (常见: 16:9, 18:9, 19.5:9, 20:9) */
@media (max-width: 768px) and (orientation: portrait) {
    :root {
        --pyramid-spacing: 0.8vw;
        --pyramid-card-width-by-width: calc((100vw - 2.5vw - 6 * var(--pyramid-spacing)) / 7);
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 30vh) / 3.3);
        --pyramid-min-card-width: 61.38px;
        --pyramid-min-card-height: 86.13px;
    }
    
    .pyramid-board {
        gap: 5px;
        padding: 5px 3px 2px 3px;
        max-height: calc(100vh - var(--header-height, 60px));
        justify-content: space-between;
    }
    
    .pyramid-container {
        margin-top: 2px;
        flex-shrink: 1;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.79);
    }
    
    .bottom-area {
        flex-direction: column;
        gap: 8px;
        margin-top: 5px;
        margin-bottom: 2px;
        flex-shrink: 0;
    }
    
    .stock-area {
        gap: 10px;
    }
    
    .game-info {
        padding: clamp(6px, 1.2vw, 12px) clamp(12px, 2vw, 20px);
    }
}

/* 超长屏幕竖屏 (20:9 及以上) */
@media (max-width: 768px) and (orientation: portrait) and (min-aspect-ratio: 9/20) {
    :root {
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 30vh) / 3.2);
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    :root {
        --pyramid-spacing: 0.7vw;
        --pyramid-card-width-by-width: calc((100vw - 2vw - 6 * var(--pyramid-spacing)) / 7);
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 32vh) / 3.2);
        --pyramid-min-card-width: 57.42px;
        --pyramid-min-card-height: 80.19px;
    }
    
    .pyramid-board {
        gap: 4px;
        padding: 4px 2px 2px 2px;
        max-height: calc(100vh - var(--header-height, 60px));
    }
    
    .pyramid-container {
        margin-top: 2px;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.80);
    }
    
    .bottom-area {
        gap: 6px;
        margin-top: 4px;
        margin-bottom: 2px;
    }
    
    .stock-area {
        gap: 8px;
    }
    
    .game-info {
        padding: 5px 12px;
    }
    
    .game-info-label {
        font-size: 10px;
        margin-bottom: 3px;
    }
    
    .game-info-value {
        font-size: clamp(20px, 4vw, 28px);
    }
    
    .stock-count {
        font-size: clamp(18px, 3vw, 32px);
        min-width: 48px;
        min-height: 48px;
        padding: 6px 10px;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    :root {
        --pyramid-spacing: 0.6vw;
        --pyramid-card-width-by-width: calc((100vw - 1.5vw - 6 * var(--pyramid-spacing)) / 7);
        --pyramid-min-card-width: 51.48px;
        --pyramid-min-card-height: 72.27px;
    }
    
    .pyramid-board {
        gap: 4px;
        padding: 4px 2px 2px 2px;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.82);
    }
    
    .bottom-area {
        gap: 6px;
        margin-top: 4px;
    }
    
    .stock-area {
        gap: 8px;
    }
    
    .stock-count {
        font-size: clamp(16px, 2.8vw, 24px);
        min-width: 36px;
        min-height: 36px;
        padding: 5px 8px;
    }
}

/* 超窄屏幕 (折叠屏外屏等) */
@media (max-width: 280px) {
    :root {
        --pyramid-spacing: 0.5vw;
        --pyramid-card-width-by-width: calc((100vw - 1vw - 6 * var(--pyramid-spacing)) / 7);
        --pyramid-min-card-width: 47.52px;
        --pyramid-min-card-height: 66.33px;
    }
    
    .pyramid-board {
        gap: 3px;
        padding: 3px 2px 1px 2px;
    }
    
    .pyramid-row {
        margin-top: calc(-1 * var(--card-height) * 0.83);
    }
    
    .bottom-area {
        gap: 5px;
        margin-top: 3px;
    }
}

/* 高分辨率大屏优化 */
@media (min-width: 1920px) {
    :root {
        --pyramid-spacing: 1.2vw;
        --pyramid-max-card-width: 178.2px;
        --pyramid-max-card-height: 249.48px;
    }
    
    .pyramid-board {
        gap: 15px;
        padding: 15px;
    }
}

/* 超宽屏优化 (21:9, 32:9) */
@media (min-aspect-ratio: 21/9) and (orientation: landscape) {
    :root {
        --pyramid-spacing: 1.5vw;
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 12vh) / 3.2);
    }
    
    .pyramid-board {
        justify-content: center;
    }
}

/* 触摸优化 - 增加点击区域 */
@media (hover: none) and (pointer: coarse) {
    .pyramid-card,
    .waste-card,
    .stock-pile {
        /* 增加最小触摸目标 */
        min-width: 44px;
        min-height: 44px;
    }
    
    .pyramid-card.selectable,
    .waste-card.selectable {
        /* 更明显的触摸反馈 */
        box-shadow: 
            0 1px 3px rgba(0, 0, 0, 0.2),
            0 2px 6px rgba(0, 0, 0, 0.15),
            0 0 0 clamp(3px, 0.5vw, 5px) rgba(255, 215, 0, 0.7);
    }
}

/* iOS Safari 底部安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pyramid-board {
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
    
    .bottom-area {
        margin-bottom: max(3px, env(safe-area-inset-bottom));
    }
}

/* 动态视口单位支持 (现代浏览器) */
@supports (height: 100dvh) {
    .pyramid-board {
        min-height: calc(100dvh - var(--header-height, 60px));
        max-height: calc(100dvh - var(--header-height, 60px));
        height: calc(100dvh - var(--header-height, 60px));
    }
    
    @media (max-width: 768px) and (orientation: portrait) {
        :root {
            --pyramid-card-width-by-height: calc((100dvh - var(--header-height, 60px) - 30vh) / 3.3);
        }
        
        .pyramid-board {
            max-height: calc(100dvh - var(--header-height, 60px));
        }
    }
    
    @media (max-width: 480px) and (orientation: portrait) {
        :root {
            --pyramid-card-width-by-height: calc((100dvh - var(--header-height, 60px) - 32vh) / 3.2);
        }
    }
}

/* 横竖屏切换优化 */
@media (orientation: portrait) {
    .pyramid-container {
        width: 100%;
        max-width: 100vw;
        overflow: visible;
    }
    
    .pyramid-board {
        /* 确保竖屏时不溢出 */
        max-height: calc(100vh - var(--header-height, 60px));
        justify-content: space-between;
    }
    
    /* 确保所有子元素适配 */
    .pyramid-row {
        max-width: 100vw;
    }
    
    .bottom-area {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
}

@media (orientation: landscape) {
    .pyramid-container {
        width: auto;
        max-width: 90vw;
    }
}

/* 常见移动设备宽高比优化 */

/* iPhone 标准屏幕 (9:16) */
@media (aspect-ratio: 9/16) {
    :root {
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 26vh) / 3.4);
    }
}

/* iPhone Plus/Max (9:19.5) */
@media (min-aspect-ratio: 9/19) and (max-aspect-ratio: 9/20) {
    :root {
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 29vh) / 3.3);
    }
}

/* Android 标准 (9:18) */
@media (aspect-ratio: 9/18) {
    :root {
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 27vh) / 3.35);
    }
}

/* iPad 竖屏 (3:4) */
@media (aspect-ratio: 3/4) and (orientation: portrait) {
    :root {
        --pyramid-spacing: 1vw;
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 24vh) / 3.6);
    }
}

/* iPad 横屏 (4:3) */
@media (aspect-ratio: 4/3) and (orientation: landscape) {
    :root {
        --pyramid-spacing: 0.8vw;
        --pyramid-card-width-by-height: calc((100vh - var(--header-height, 60px) - 17vh) / 4.1);
    }
}

/* 小屏设备性能优化 */
@media (max-width: 480px) and (max-height: 800px) {
    .pyramid-card,
    .waste-card {
        /* 减少动画复杂度 */
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    
    .pyramid-row {
        /* 更紧凑的重叠 */
        margin-top: calc(-1 * var(--card-height) * 0.81);
    }
}

/* 手机竖屏溢出防护 */
@media (max-width: 768px) and (orientation: portrait) {
    html, body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }
    
    .pyramid-board {
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        /* 确保内容不超出视口 */
        contain: layout size style;
    }
    
    .pyramid-container {
        max-width: calc(100vw - 6px);
        box-sizing: border-box;
    }
    
    /* 防止卡片溢出 */
    .pyramid-row {
        max-width: calc(100vw - 10px);
        justify-content: center;
        box-sizing: border-box;
    }
    
    .stock-area,
    .bottom-area {
        max-width: calc(100vw - 10px);
        box-sizing: border-box;
    }
}

