/**
 * 在线编辑器 — 4399 搜索页同款小图标网格
 */

.editor-tab-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    padding: 0.85rem 1rem 1.25rem !important;
    overflow: visible !important;
}

.editor-tab-section > .section-title {
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* 与 4399 搜索「图片」视图一致：72px 方图 + 小字标题（列宽统一以容纳最长游戏名） */
.editor-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 88px);
    gap: 17px 21px;
    justify-content: start;
    align-content: start;
    width: 100%;
    padding: 4px 2px 8px;
}

.editor-game-card {
    display: flex;
    flex-direction: column;
    width: 88px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    transition:
        opacity 0.28s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.editor-game-card:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: none;
}

.editor-game-card:active {
    opacity: 0.75;
    transform: scale(0.97);
}

.editor-game-card .card-img-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: var(--bg-input, #eef2f7);
    flex-shrink: 0;
}

.editor-game-card .card-img-wrap img,
.editor-game-card__img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
}

.editor-game-card__placeholder {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.editor-game-card .card-title {
    padding: 8px 2px 0;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    color: var(--text, #1e293b);
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(0.68rem * 1.4 * 2);
}

#editor-tab.tab-content.active {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .editor-game-grid {
        grid-template-columns: repeat(auto-fill, 88px);
        gap: 15px 19px;
    }

    .editor-tab-section {
        padding: 0.75rem 0.85rem 1rem !important;
    }
}

[data-theme="dark"] .editor-game-card .card-title {
    color: #e2e8f0;
}

[data-theme="dark"] .editor-game-card .card-img-wrap {
    background: rgba(255, 255, 255, 0.06);
}

/* 西游大战僵尸2 — 标题单行显示（字号与其他游戏一致） */
.editor-game-card[data-game-id="100021366"] .card-title {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    display: block;
    -webkit-line-clamp: unset;
    min-height: calc(0.68rem * 1.4);
    overflow: visible;
    text-overflow: clip;
}
