/* ===== 全屏无边框铺满 ===== */
body {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0d0610;
    overflow: hidden;
}

/* 顶部固定导航 */
.gallery-header {
    padding: 12px 20px;
    background: rgba(13, 6, 16, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.08);
    flex-shrink: 0;
    z-index: 10;
}

.gallery-header h1 {
    color: #ffd700;
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.gallery-header .sub-info {
    color: #b8a0c0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== 网格铺满整个剩余高度 ===== */
.gallery-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    /* 更密，铺得更多 */
    gap: 12px;
    align-content: start;
    width: 100%;
    box-sizing: border-box;
}

/* 优雅的自定义滚动条 */
.gallery-grid::-webkit-scrollbar {
    width: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 10px;
}

/* ----- 卡片外层（撑满整个网格格子） ----- */
.card-slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-slot-wrapper:hover {
    transform: translateY(-4px) scale(1.02);
}

/* 关键修正：取消 max-width 限制，让卡片完全横向铺满格子 */
.card-slot {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 5;
    max-width: none;
    /* 重点：去除限制 */
}

/* 重写标签：从上方移到下方居中 */
.card-label {
    position: static !important;
    transform: none !important;
    /* 🔥 核心修复：抵消原 CSS 中 translateX(-50%) 导致的偏移 */
    margin-top: 8px;
    text-align: center;
    width: 100%;
    /* 使标签占满父容器 */
    box-sizing: border-box;
    /* 防止内边距撑破容器 */
    color: #d8c8e0;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.06);
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 1px;
}

.card-label .en-name {
    color: #6a5a7a;
    font-size: 0.6rem;
    margin-left: 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .gallery-header h1 {
        font-size: 1.2rem;
    }

    .card-label {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 6px;
        padding: 6px;
    }

    .card-label {
        font-size: 0.55rem;
        padding: 2px 6px;
    }

    .card-label .en-name {
        display: none;
    }
}