
/**
 * 游戏列表模块 (game-listings.css)
 * 合并了以下文件：
 * - games.css: 游戏卡片和列表样式
 * - category.css: 分类页面样式
 * - tag.css: 标签页面样式
 * - search.css: 搜索页面样式
 * - header-nav.css: 头部导航样式
 */

/* ===== 游戏列表样式 ===== */
.category-filter {
    background-color: transparent;
    padding: 15px 0;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid var(--light-border);
    margin-bottom: 20px;
}

.category-button {
    padding: 8px 15px;
    border-radius: var(--radius-pill);
    background-color: var(--white);
    color: var(--medium-text);
    font-size: 0.95rem;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid var(--light-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    margin-right: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.category-button i {
    color: var(--primary-blue);
    font-size: 1.2rem;
    margin-right: 0;
    transition: all 0.3s ease;
}

.category-button .category-name {
    /* max-width: 0; */
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-left: 0;
}

.category-button:hover .category-name,
.category-button.active .category-name {
    max-width: 150px;
    opacity: 1;
    margin-left: 8px;
}

.category-button:hover {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--yellow-dark-text);
}

.category-button.active {
    background: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
    box-shadow: 0 4px 10px rgba(255, 220, 74, 0.3);
}

.category-button.active i {
    color: var(--yellow-dark-text);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 25px;
}

.game-item {
    display: block;
    background-color: var(--white);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 2px 2px 15px 2px rgb(64 64 64 / 30%);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.game-item:hover {
    transform: rotate(-3deg);
    /* box-shadow: 2px 2px 15px 2px rgb(64 64 64 / 50%); */
    z-index: 5;
    box-shadow: 0 5px 0 var(--deep-yellow);
}

.game-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-item .play-button i {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0;
}

.game-item:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%);
    background-color: var(--primary-yellow);
    box-shadow: 2px 2px 4px 0px var(--yellow-dark-text);
}

.game-item:hover .play-button i {
    color: var(--yellow-dark-text);
}

.game-item-image-wrapper {
    position: relative;
}

.game-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 1px solid var(--light-border);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-item:hover img {
    transform: scale(1.1);
}

/* 游戏标签基础样式 */
.game-badge {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

/* 游戏评分样式 */
.game-rating {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    width: auto;
    height: auto;
    padding: 3px 8px;
    border-radius: var(--radius-badge);
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* 标签容器 */
.game-item-image-wrapper {
    position: relative;
    overflow: hidden;
}

/* 标签堆叠效果 - 修改定位方式 */
.game-badge.new,
.game-badge.recommended,
.game-badge.hot {
    top: 5px;
    transform-origin: left top;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
}

/* 重置所有徽章的默认位置 */
.game-item-image-wrapper .game-badge {
    left: 5px; /* 默认都在最左侧 */
}

/* 设置特定徽章的位置 */
.game-badge.new {
    background-color: #00ff6a;
    font-size: 0.7rem;
    letter-spacing: -0.02em;
    font-weight: 600;
    line-height: 1.5;
    font-family: var(--font-mono);
    z-index: 5;
}

.game-badge.recommended {
    background-color: #0099ff;
    z-index: 4;
}

.game-badge.hot {
    background-color: #ff1900;
    z-index: 3;
}

/* 当存在多个徽章时的位置调整 */
.game-item-image-wrapper .game-badge.new ~ .game-badge.recommended,
.game-item-image-wrapper .game-badge.new ~ .game-badge.hot {
    left: calc(5px + 30px); /* 如果前面有new徽章，则向右移动 */
}

.game-item-image-wrapper .game-badge.recommended ~ .game-badge.hot {
    left: calc(5px + 30px); /* 如果前面有recommended徽章，则向右移动 */
}

/* 当同时存在new和recommended徽章时，hot徽章的位置 */
.game-item-image-wrapper .game-badge.new ~ .game-badge.recommended ~ .game-badge.hot {
    left: calc(5px + 60px); /* 如果前面有两个徽章，则向右移动两次 */
}

/* 鼠标悬浮时的效果 */
.game-item:hover .game-badge.new {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(46, 204, 113, 0.3);
}

.game-item:hover .game-badge.recommended {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.game-item:hover .game-badge.hot {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(231, 76, 60, 0.3);
}

/* 图标内部样式 */
.game-badge i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.game-badge:hover i {
    transform: scale(1.2);
}
.game-item:hover .game-badge.hot, .game-item:hover .game-badge.recommended, .game-item:hover .game-badge.new{
    transform: scale(1.1);
    opacity: 1;
}



/* 添加动画效果 */
@keyframes badgeGlow {
    0% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 10px 3px rgba(255, 255, 255, 0.5); }
    100% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0); }
}

.game-item:hover .game-badge {
    animation: badgeGlow 1.5s infinite;
    animation-delay: calc(var(--badge-index) * 0.2s);
}

.game-badge.new { --badge-index: 0; }
.game-badge.recommended { --badge-index: 1; }
.game-badge.hot { --badge-index: 2; }

/* 使用位置类来定位徽章 */
.game-badge.badge-position-0 {
    left: calc(5px + 0 * 30px);
}

.game-badge.badge-position-1 {
    left: calc(5px + 1 * 30px);
}

.game-badge.badge-position-2 {
    left: calc(5px + 2 * 30px);
}


.game-rating {
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    width: auto;
    height: auto;
    padding: 3px 8px;
    border-radius: var(--radius-badge);
    display: flex;
    align-items: center;
}

.game-rating i {
    color: var(--star-yellow);
    margin-right: 3px;
    font-size: 0.7rem;
}

/* 游戏标题包装器 */
.game-title-wrapper {
    position: relative;
}

/* 游戏标题基本样式 */
.game-title {
    display: block;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 游戏标题悬停层 */
.game-title-overlay {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: auto;
    background-color: var(--text-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    box-sizing: border-box;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* 完整游戏标题 */
.game-title-full {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white);
    text-align: left;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    padding: 2px 8px;
    max-width: 100%;
    word-break: break-word;
    line-height: 1rem;
}

/* 悬停效果 */
.game-item:hover .game-title-overlay {
    opacity: 1;
    transform: translateY(0);
    bottom: 100%;
}

.game-item:hover .game-title {
    color: var(--primary-blue);
}

.loading-placeholder {
    background-color: var(--light-border);
    border-radius: var(--radius-card);
    aspect-ratio: 1 / 1.2;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ===== 分类页面样式 ===== */
/* 分类英雄区域 */
.category-hero {
    background: linear-gradient(135deg, #6c5ce7 0%, #a166ff 100%);
    padding: 10px 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.1;
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    from { transform: translateX(0) translateY(0); }
    to { transform: translateX(-20px) translateY(-20px); }
}

.category-hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
}

.category-info {
    padding: 1rem 2rem;
    color: #fff;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(0);
    transition:transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 400px;
    overflow: scroll;
}

.category-info:hover {
    transform: translateY(-5px);
}

.category-title {
    font-size: 2.5rem;
    font-weight: 800;
    /* margin-bottom: 1.5rem; */
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

.category-description {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.category-stats {
    display: flex;
    gap: 2rem;
    color: #fff;
}

.category-stat {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-stat:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.category-stat i {
    color: #ffd700;
    font-size: 1.4rem;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.category-featured {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.featured-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.featured-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: flex-end;
}

.featured-slide.active {
    opacity: 1;
}

.featured-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-info {
    position: relative;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    z-index: 1;
}

.featured-info h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.featured-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.featured-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.featured-meta i {
    color: var(--accent-color);
}

.featured-play {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.featured-play:hover {
    background: var(--secondary-color);
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slider-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.slider-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2;
}

.slider-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slider-arrow:hover {
    background: var(--primary-color);
}

/* 分类筛选器 */
.category-filter {
    background: rgba(255, 255, 255, 0.8);
    padding: 25px 0;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.category-container {
    display: flex;
    justify-content: start;
    gap: 5px;
    flex-wrap: wrap;
}

.filter-button {
    background: none;
    border: 2px solid transparent;
    padding: 12px 25px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 15px;
    font-weight: 600;
}

.filter-button:hover {
    color: var(--primary-color);
    background: rgba(108, 92, 231, 0.1);
    transform: translateY(-2px);
}

.filter-button.active {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

/* 特色功能区 */
.category-features {
    padding: 60px 0;
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition:transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card .card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-card .card-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .category-hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .category-info {
        padding-right: 0;
        text-align: center;
    }

    .category-stats {
        justify-content: center;
    }

    .category-featured {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 10px 0;
    }

    .category-title {
        font-size: 2.5rem;
    }

    .category-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .category-container {
        flex-wrap: wrap;
        gap: 5px;
    }

    .filter-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .category-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .category-button i {
        font-size: 1rem;
    }

    .category-button:hover .category-name,
    .category-button.active .category-name {
        max-width: 100px;
        margin-left: 5px;
    }
}

    .features-grid {
        grid-template-columns: 1fr;
    }

    .category-featured {
        height: 400px;
    }

    .featured-info h3 {
        font-size: 1.4rem;
    }

    .featured-meta {
        font-size: 0.9rem;
    }

    .featured-play {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .category-hero {
        padding: 10px 0;
    }

    .category-title {
        font-size: 2rem;
    }

    .category-stats span {
        font-size: 1rem;
    }

    .category-description {
        font-size: 1rem;
    }

    .category-featured {
        height: 250px;
    }

    .featured-info {
        padding: 20px;
    }

    .featured-info h3 {
        font-size: 1.2rem;
    }

    .slider-arrows {
        display: none;
    }
}

/* 暗色模式 */
body.lights-off .category-hero {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
}

body.lights-off .featured-game {
    background: #2a2a2a;
}

body.lights-off .featured-game-info h3 {
    color: #fff;
}

body.lights-off .feature-card {
    background: #2a2a2a;
}

body.lights-off .feature-card h3 {
    color: #fff;
}

body.lights-off .feature-card p {
    color: #ccc;
}

body.lights-off .category-filter {
    background: rgba(42, 42, 42, 0.8);
}

body.lights-off .filter-button {
    color: #ccc;
}

body.lights-off .filter-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.lights-off .filter-button.active {
    background: var(--primary-color);
    color: #fff;
}

body.lights-off .category-info {
    background: rgba(0, 0, 0, 0.3);
}

body.lights-off .category-stat {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
} /* ===== 头部导航样式 ===== */
/* 头部布局样式 */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    flex-wrap: nowrap; /* 确保不换行 */
}

.top-bar-logo {
    flex: 0 0 auto;
    margin-right: 20px;
    white-space: nowrap; /* 防止文本换行 */
    min-width: 150px; /* 设置最小宽度保证logo显示 */
    align-items: center;
}

.main-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible; /* 确保下拉菜单可见 */
    position: relative; /* 为绝对定位的子元素提供参考 */
    min-width: 0; /* 允许元素缩小到比其内容更小 */
}

/* 头部分类导航样式 */
.head-category-filter {
    flex: 1;
    margin-right: 15px;
    min-width: 0; /* 允许元素缩小到比其内容更小 */
    overflow: visible;
}

.nav-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-scroll-container {
    display: flex;
    overflow: visible; /* 修改为 visible，不再滚动 */
    white-space: nowrap;
    width: 100%;
    padding: 5px 0;
}

/* 导航按钮样式 */
/* 导航按钮样式 */
.nav-scroll-button, .nav-more-button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--white);
    border: 1px solid var(--light-border);
    color: var(--medium-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

/* 滚动按钮样式 */
.nav-scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.nav-scroll-button:hover, .nav-more-button:hover {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
}

.nav-scroll-button.prev {
    left: 0;
}

.nav-scroll-button.next {
    right: 30px; /* 留出空间给更多按钮 */
}

/* 更多按钮样式 */
.nav-more-button {
    position: relative;
    margin-left: 5px;
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-more-button:hover {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-more-button.active {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 下拉菜单样式 */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: var(--white);
    border-radius: var(--radius-card);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 180px;
    z-index: 100;
    display: none;
    border: 1px solid var(--light-border);
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-dropdown-menu::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 10px;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--medium-text);
    border-radius: 10px;
}

.nav-more-button.active .nav-dropdown-menu {
    display: block;
    animation: dropdown-fade 0.2s ease-in-out;
}

@keyframes dropdown-fade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 头部菜单项样式 */
.head-category-filter .category-button {
    padding: 5px;
    border-radius: var(--radius-lg);
    background-color: var(--primary-color);
    color: var(--medium-text);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-right: 5px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    box-shadow: none;
    position: relative; /* 为子菜单定位提供参考 */
}

.head-category-filter .category-button i {
    color: var(--primary-blue);
    font-size: 1rem;
    margin-right: 0;
    transition: all 0.2s ease;
}

.head-category-filter .category-button .category-name {
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.2s ease;
    margin-left: 0;
}

.head-category-filter .category-button:hover .category-name,
.head-category-filter .category-button.active .category-name {
    max-width: 120px;
    opacity: 1;
    margin-left: 5px;
}

.head-category-filter .category-button:hover {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--yellow-dark-text);
}

.head-category-filter .category-button.active {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
    box-shadow: none;
}

.head-category-filter .category-button.active i {
    color: var(--yellow-dark-text);
}

/* 下拉菜单中的菜单项 */
.nav-dropdown-menu .category-button {
    margin: 5px 0;
    padding: 8px 10px;
    width: 100%;
}

.nav-dropdown-menu .category-button .category-name {
    max-width: 120px;
    opacity: 1;
    margin-left: 5px;
}

/* 子菜单指示器 */
.submenu-indicator {
    font-size: 0.7rem;
    margin-left: 3px;
    transition: transform 0.3s ease;
}

.category-button.has-submenu:hover .submenu-indicator {
    transform: rotate(180deg);
}

/* 子菜单容器 */
.submenu-container {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--primary-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 100;
    padding: 5px;
    margin-top: 5px;
    border: 1px solid var(--light-yellow);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: none;
}

/* 当子菜单显示时，允许鼠标事件 */
.submenu-container.active {
    opacity: 1 !important;
    transform: translateY(0);
    pointer-events: auto;
    display: block !important;
    visibility: visible !important;
}

/* 修改定位方式，确保子菜单相对于父菜单项定位 */
.category-button.has-submenu {
    position: relative;
}

/* 移除之前的悬停显示逻辑，改为通过JS控制 */
.category-button.has-submenu:hover + .submenu-container {
    display: none; /* 覆盖之前的样式 */
}

/* 子菜单样式 */
.submenu {
    list-style: none;
    padding: 10px;
    margin: 0;
}

.submenu .category-button {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin: 2px 0;
    width: 100%;
    justify-content: flex-start;
    display: flex;
    align-items: center;
}

.submenu .category-button .category-name {
    max-width: 150px;
    opacity: 1;
    margin-left: 5px;
}

.submenu .category-button:hover {
    background-color: var(--light-bg);
}

.submenu .category-button.active {
    background-color: var(--primary-yellow);
    color: var(--yellow-dark-text);
}

/* 用户菜单样式 */
.user-menu {
    /* display: inline-block; */
    margin-left: 15px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.user-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-menu-item i {
    margin-right: 5px;
}

/* 头部导航响应式样式 */
@media (max-width: 768px) {
    .header-container {
        /* 保持在同一行 */
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .top-bar-logo {
        /* 缩小 logo 区域 */
        margin-right: 10px;
        min-width: 120px;
        font-size: 0.9rem;
    }


    .main-nav {
        flex: 1;
        min-width: 0;
    }

    .head-category-filter {
        margin-right: 5px;
    }

    .search-area {
        display: none; /* 在小屏幕上隐藏搜索区域以节省空间 */
    }

    .nav-scroll-button, .nav-more-button {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .user-menu {
        margin-left: 5px;
    }

    /* 调整导航菜单项的大小 */
    .head-category-filter .category-button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .head-category-filter .category-button i {
        font-size: 0.9rem;
    }
}

/* 标签页面特定样式 */
.tag-hero {
    background: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%); /* 不同于分类页面的渐变色 */
}

.tag-hero .category-title {
    display: inline-flex;
    align-items: center;
}

.tag-hero .category-title::before {
    content: '#';
    margin-right: 5px;
    font-weight: 300;
    opacity: 0.8;
}

/* 标签页面的特色滑块样式调整 */
.tag-hero .featured-slider {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tag-hero .category-hero-content {
        grid-template-columns: 1fr;
    }

    .tag-hero .category-featured {
        margin-top: 30px;
    }
}
/**
 * 搜索结果页样式
 */

/* 搜索结果页头部 */
.search-results-page .page-header {
    margin-bottom: 2rem;
    padding: 2rem;
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results-page .page-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.search-results-page .page-title span {
    color: var(--color-primary);
    font-weight: 700;
}

/* 搜索元数据 */
.search-meta {
    /* display: flex; */
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.search-scope, .search-count {
    padding: 0.5rem 1rem 0.5rem 0;
    background-color: var(--color-bg-light);
    border-radius: var(--radius-pill);
    display: block;
    align-items: center;
}
.search-field-main{
    padding: 0.5rem 1rem;
    border-radius: var(--radius-input);
    margin: 0 0.5rem;
}

.search-count {
    font-weight: 600;
}

/* 搜索表单容器 */
.search-form-container {
    margin-top: 1.5rem;
}

.search-form-container .search-form {
    width: 100%;
    max-width: 600px;
}

/* 搜索结果网格 */
#search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    #search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    #search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    .search-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 分页导航 */
.search-results-page .pagination {
    margin: 2rem 0;
    text-align: center;
}

.search-results-page .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: var(--radius-input);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.search-results-page .page-numbers.current {
    background-color: var(--color-primary);
    color: white;
}

.search-results-page .page-numbers:hover:not(.current) {
    background-color: var(--color-bg-hover);
}

/* 无结果页面 */
.no-results {
    text-align: center;
    padding: 2rem;
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.no-results .page-content {
    max-width: 800px;
    margin: 0 auto;
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-secondary);
}

.search-suggestions {
    margin: 2rem 0;
    text-align: left;
}

.search-suggestions h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.search-suggestions ul {
    list-style-type: disc;
    padding-left: 2rem;
}

.search-suggestions li {
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.popular-games {
    margin: 2rem 0;
}

.popular-games h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: left;
    color: var(--color-text-primary);
}

.popular-games .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .popular-games .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .popular-games .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
