/* === 全局复位 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    background-color: #f5f7f9;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === 头部导航 === */
header {
    background: #ffffff;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.logo span {
    color: #3498db;
}

.nav-menu ul {
    display: flex;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: #666;
    padding: 10px 20px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #3498db;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: #333;
    transition: 0.3s;
}

/* === 主内容区 === */
main {
    margin-top: 30px;
    padding-bottom: 40px;
}

/* === 游戏网格 === */
.game-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}

.game-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: #3498db;
}

.game-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #e1e4e8;
    overflow: hidden;
}

.game-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-title {
    padding: 15px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === 分类标题 === */
.cat-title {
    margin: 40px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    position: relative;
    padding-left: 15px;
}
.cat-title::before {
    content: "# ";
    position: absolute;
    left: 0;
}
.cat-title .more {
    font-size: 14px;
    font-weight: normal;
    color: #3498db;
    text-decoration: none;
    padding: 5px 15px;
    border: 1px solid #3498db;
    border-radius: 50px;
    transition: all 0.3s;
}

.cat-title .more:hover {
    background: #3498db;
    color: #fff;
}

/* === 返回按钮 === */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 16px;
    border: 1px solid #3498db;
    border-radius: 50px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #3498db;
    color: #fff;
}

/* === 分页 === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #eee;
    transition: all 0.3s;
}

.pagination a:hover {
    border-color: #3498db;
    color: #3498db;
}

.pagination a.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* === 游戏运行容器 === */
.game-run-container {
    background: #000;
    max-width: 800px;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#canvas {
    width: 100%;
    min-height: 400px;
}

/* === 友情链接 === */
.friend-links {
    background: #fff;
    padding: 40px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.links-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
}

.links-title::before {
    content: "";
    width: 4px;
    height: 16px;
    background: #3498db;
    margin-right: 10px;
    border-radius: 2px;
}

.links-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    padding: 6px 14px;
    background: #f8f9fa;
    border-radius: 50px;
    transition: all 0.3s;
}

.link-item:hover {
    background: #3498db;
    color: #fff;
}

.link-item img {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-radius: 2px;
}

/* === 底部版权 === */
footer {
    background: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 40px 0;
	font-size:14px;
}
footer a{color: #bdc3c7;font-size:14px; text-decoration:none}
/* === 响应式布局 === */
@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -250px;
        width: 250px;
        height: 100vh;
        background: #fff;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        padding-top: 80px;
        z-index: 1050;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
    }

    .nav-menu a {
        display: block;
        padding: 15px 30px;
        border-bottom: 1px solid #f9f9f9;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
/* === 面包屑导航 === */
.breadcrumb {
    display: flex;
    align-items: center;
    padding: 10px 0;
	margin-top:10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #1d6fa5;
    text-decoration: underline;
}

.breadcrumb .divider {
    margin: 0 8px;
    color: #666;
}

.breadcrumb .current {
    color: #666;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
/* ===== 菜单按钮 “三” → “X” 动画 ===== */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
.playbtns {
    background: url(../img/start.png) no-repeat;
    background-color: transparent !important;
    text-indent: -31em;
    overflow: hidden;
    height: 80px !important;
    animation: ejs--9bd947b3e6427453595f083d740a7c 1.2s linear infinite alternate;
}

.game-warning {
    background-color: #fff;
    color: #333;
    border: 1px solid #e3e3e3;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.keyboard-guide {
   display:flex;

}
.key-label {
    font-size: 14px;
    font-weight: bold;
    color: #475569;
    white-space: nowrap;
    margin-right: 2px;
}
.key-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #1e293b;
    white-space: nowrap;
}
.key-btn.attack {
    background: #ef4444;
    border-color: #dc2626;
    color: #fff;
}
.key-btn.func {
    width: auto;
    padding: 0 8px;
    font-size: 16px;
    min-width: 56px;
}
.hint-text {
    font-size: 14px;
    color: #94a3b8;
    white-space: nowrap;
    margin-left: 6px;
}
.keyboard-box{margin-right:15px}
@media screen and (max-width:1024px){
 .keyboard-guide{display:block;}
 .keyboard-box{margin:0 0 15px}
 .hint-text{display:block;margin:10px 0 0}
 .game-warning{padding: 10px 10px 0;}
}
.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 2000;
    padding: 15px 0;
    display: none;
    transition: all 0.3s;
}
.search-popup.active {
    display: block;
}
.search-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    padding: 0 20px;
}
.search-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
}
.search-container input:focus {
    border-color: #3498db;
}
.search-container button {
    padding: 10px 25px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}
.search-container button:hover {
    background: #2980b9;
}
.search-toggle a {
    display: block;
    width: 20px;
    height: 20px;
    background: url('../img/search.png') no-repeat center center / contain;
    padding: 0 !important;
    margin: 0 10px;
}
.search-toggle a:hover {
    opacity: 0.8;
}

/* ===== 标签栏 ===== */
.tags-bar {
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.tags-scroll {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-right: 4px;
    white-space: nowrap;
}

.tag-link {
    display: inline-block;
    padding: 4px 14px;
    background: #f0f4ff;
    color: #3498db;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tag-link:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

@media (max-width: 768px) {
    .tags-bar {
        padding: 8px 10px;
    }
   
    .tag-link {
        flex: 0 0 auto;
    }
}
.search-toggle-mobile {
    display: none;
}

.search-toggle-mobile a {
    display: block;
    width: 22px;
    height: 22px;
    background: url('../img/search.png') no-repeat center center / contain;
    margin-right: 15px;
}

@media (max-width: 768px) {
    .search-toggle-mobile {
        display: block;          
        position: absolute;
        right: 60px;              
        top: 50%;
        transform: translateY(-50%);
    }

    .search-toggle {
        display: none;   
    }
}
.related-games {
    margin-top: 40px;
    margin-bottom: 20px;
}

.related-games h2 {
    margin-bottom: 20px;
}