/* 游戏分类容器样式 - 紧凑折叠设计 */
.game-categories-container {
    margin: 20px 0;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* 折叠容器 */
.game-categories-collapse {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 折叠头部 */
.game-categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.game-categories-header:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.game-categories-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* 折叠图标 */
.game-categories-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-icon {
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.game-categories-collapse.active .toggle-icon {
    transform: rotate(45deg);
}

/* 折叠内容 */
.game-categories-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.game-categories-collapse.active .game-categories-content {
    max-height: 500px;
}

/* 紧凑网格布局 */
.game-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
}

/* 紧凑按钮样式 */
.game-category-button .game-category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 激活状态的按钮样式 */
.game-category-button.active .game-category-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.game-category-button .game-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.game-category-button .game-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.game-category-button.active .game-category-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.game-category-button .game-category-btn:hover::before {
    left: 100%;
}

/* 紧凑图片样式 */
.game-category-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: #fff;
    max-height: 70px;
}

/* 激活状态的图片样式 */
.game-category-image.active {
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.5);
    border: 2px solid #4CAF50;
}

.game-category-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-category-image.active:hover {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.6);
}

.game-category-image .game-category-link {
    display: block;
    text-decoration: none;
    position: relative;
    height: 100%;
    max-height: 70px;
}

.game-category-image .game-category-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.game-category-image:hover .game-category-img {
    transform: scale(1.05);
}

.game-category-image .game-category-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 15px 10px 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 分类页面头部 - 紧凑 */
.game-category-page-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 20px;
    border-radius: 8px;
}

.game-category-page-description {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
    .game-categories-container {
        margin: 15px 0;
        padding: 0 10px;
    }
    
    .game-categories-header {
        padding: 12px 15px;
    }
    
    .game-categories-title {
        font-size: 16px;
    }
    
    .game-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px;
    }
    
    .game-category-button .game-category-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 45px;
    }
    
    .game-category-image .game-category-img {
        height: 100px;
    }
    
    .game-category-image {
        min-height: 100px;
    }
    
    .game-category-image .game-category-name {
        font-size: 13px;
        padding: 12px 8px 6px;
    }
    
    .game-category-page-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .game-category-page-description {
        font-size: 15px;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 768px) {
    .game-categories-container {
        margin: 10px 0;
        padding: 0 8px;
    }
    
    .game-categories-header {
        padding: 10px 12px;
    }
    
    .game-categories-title {
        font-size: 15px;
    }
    
    .game-categories-toggle {
        width: 20px;
        height: 20px;
    }
    
    .toggle-icon {
        font-size: 14px;
    }
    
    .game-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .game-category-button .game-category-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
        border-radius: 6px;
    }
    
    .game-category-image .game-category-img {
        height: 80px;
    }
    
    .game-category-image {
        min-height: 80px;
        border-radius: 6px;
    }
    
    .game-category-image .game-category-name {
        font-size: 12px;
        padding: 10px 6px 4px;
    }
    
    .game-category-page-header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .game-category-page-description {
        font-size: 14px;
    }
}

/* 小屏手机优化 */
@media (max-width: 480px) {
    .game-categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 6px;
    }
    
    .game-category-button .game-category-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 35px;
    }
    
    .game-category-image .game-category-img {
        height: 70px;
    }
    
    .game-category-image {
        min-height: 70px;
    }
    
    .game-category-image .game-category-name {
        font-size: 11px;
        padding: 8px 4px 3px;
    }
    
    .game-categories-header {
        padding: 8px 10px;
    }
    
    .game-categories-title {
        font-size: 14px;
    }
}

/* 折叠动画优化 */
.game-categories-content {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 加载状态优化 */
.game-categories-collapse {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 错误状态和空状态样式 */
.game-category-page-header .no-posts {
    color: #ff6b6b;
    font-style: italic;
}

/* 点击反馈 */
.game-category-item.clicked {
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

/* 加载状态 */
.game-categories-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 调试边框 */
.debug-border {
    border: 1px solid red !important;
}

/* 确保折叠动画流畅 */
.game-categories-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
/* 位置调整辅助样式 */
.game-categories-container.position-adjusted {
    animation: fadeInUp 0.5s ease;
}

/* 确保分类标题正确显示 */
.game-category-page-header {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.game-category-page-description {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .game-category-page-header {
        margin: 15px 0;
        padding: 15px;
    }
    
    .game-category-page-description {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .game-category-page-header {
        margin: 10px 0;
        padding: 12px;
    }
    
    .game-category-page-description {
        font-size: 14px;
    }
}

/* 确保分类栏在正确位置 */
body.home .game-categories-container,
body.blog .game-categories-container,
body.page .game-categories-container {
    margin-bottom: 30px;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}