/* 全局样式 */
:root {
    --primary-color: #7b68ee;
    --secondary-color: #6a5acd;
    --background-color: #1a1a2e;
    --sidebar-bg: #16213e;
    --card-bg: #222831;
    --text-color: #ffffff;
    --text-secondary: #a9a9a9;
    --hot-badge: #ff4757;
    --new-badge: #4caf50;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #7b68ee;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a57dd;
}

/* 暗色模式下的滚动条 */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #2a2a2a;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

a {
    text-decoration: none;
    color: var(--text-color);
}

ul {
    list-style: none;
}

.container {
    display: flex;
    flex: 1;
}

/* 汉堡菜单按钮 - 移动端使用 */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out, width 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    white-space: nowrap;
}

.logo img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    flex-shrink: 0; /* 防止图标缩小 */
}

.logo span {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    white-space: normal; /* 允许文字换行 */
}

.main-nav ul li, .categories ul li {
    margin-bottom: 15px;
}

.main-nav ul li a, .categories ul li a {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover, .categories ul li a:hover {
    background-color: rgba(123, 104, 238, 0.2);
}

.main-nav ul li.active a {
    background-color: var(--primary-color);
}

.main-nav ul li i, .categories ul li i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.categories h3 {
    margin: 20px 0 15px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 15px;
    transition: margin-left 0.3s ease;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 25px;
    padding: 5px 15px;
    width: 300px;
    max-width: 100%; /* 确保在小屏幕上不会溢出 */
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px;
    width: 100%;
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px; /* 增加点击区域大小 */
}

.language-selector select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    font-size: 1rem; /* 增大字体提高可读性 */
}

.user-actions .login-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.user-actions .login-btn:hover {
    background-color: var(--secondary-color);
}

/* 中间区域样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* 在小屏幕上允许换行 */
    gap: 10px; /* 添加间隙 */
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.section-header h2 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.view-more {
    color: var(--primary-color);
    font-size: 0.9rem;
    padding: 5px 10px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    display: inline-flex;
    align-items: center;
}

.view-more:hover {
    background-color: var(--primary-color);
    color: white;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.game-grid.small {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.game-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
    height: 100%;
}

.game-card a {
    display: block;
    height: 100%;
    width: 100%;
    color: inherit;
}

.game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-info {
    padding: 12px;
}

.game-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 限制标题为两行 */
}

.hot-badge, .new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--hot-badge);
    color: white;
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 10px;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.new-badge {
    background-color: var(--new-badge);
}

/* 游戏详情模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 900px;
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 10px; /* 增加点击区域 */
}

.game-frame-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    margin-bottom: 20px;
}

#game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 移动端优化 - 媒体查询 */
@media (max-width: 1600px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: var(--sidebar-collapsed-width);
    }
    
    .sidebar {
        width: var(--sidebar-collapsed-width);
        padding: 20px 10px;
    }
    
    .sidebar .logo span, 
    .sidebar .main-nav span, 
    .sidebar .categories h3, 
    .sidebar .categories ul li a span {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .logo {
        justify-content: center;
    }
    
    .logo img {
        margin-right: 0;
    }
    
    .main-nav ul li a, .categories ul li a {
        justify-content: center;
        padding: 8px;
    }
    
    .main-nav ul li i, .categories ul li i {
        margin-right: 0;
    }
    
    .game-content-layout {
        grid-template-columns: 1fr;
    }
    
    .site-footer {
        margin-left: var(--sidebar-collapsed-width);
    }
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    
    .game-card img {
        height: 120px;
    }
    
    .search-bar {
        width: 100%;
        max-width: 300px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .game-frame-container {
        padding-bottom: 75%;
    }
    
    /* 调整页脚布局 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    /* 启用汉堡菜单 */
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* 调整侧边栏内容在移动端显示 */
    .sidebar .logo span, 
    .sidebar .main-nav span, 
    .sidebar .categories h3, 
    .sidebar .categories ul li a span {
        display: inline-block;
    }
    
    .main-nav ul li a, 
    .categories ul li a {
        justify-content: flex-start;
    }
    
    .main-nav ul li i, 
    .categories ul li i {
        margin-right: 10px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px 10px;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
        max-width: 100%;
    }
    
    .language-selector {
        width: 100%;
    }
    
    .language-selector select {
        width: 100%;
    }
    
    .section-header {
        margin-bottom: 15px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .game-card img {
        height: 110px;
    }
    
    .game-info h3 {
        font-size: 0.9rem;
    }
    
    .site-footer {
        margin-left: 0;
        padding: 20px 15px;
    }
}

/* 增加触摸反馈效果 */
@media (hover: none) {
    .main-nav ul li a:active, 
    .categories ul li a:active, 
    .game-card:active,
    .btn-primary:active,
    .view-more:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    .game-card:active {
        transform: translateY(0);
    }
}

/* 覆盖现有样式的其余部分保持不变 */
.game-content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 30px;
}

.game-info-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.game-details {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.game-details h1 {
    margin-bottom: 20px;
}

.game-details p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.game-tag {
    background-color: rgba(123, 104, 238, 0.2);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.game-tag-count {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-left: 5px;
}

.game-main-title {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-section {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px 15px 15px 10px;
    margin-bottom: 20px;
}

.sidebar-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.features-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.features-list li:before {
    content: "•";
    color: var(--primary-color);
    font-size: 1.5rem;
    position: absolute;
    left: 5px;
}

.new-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 5px;
}

.game-main-area {
    display: flex;
    flex-direction: column;
}

.game-sidebar {
    height: 100%;
    max-width: 300px;
    padding-left: 0;
}

.game-sidebar .game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 300px;
}

.game-sidebar .game-card {
    margin-bottom: 0;
    height: 200px;
    overflow: hidden;
}

.game-sidebar .game-card img {
    height: 140px;
    width: 100%;
    object-fit: cover;
}

/* 调试信息样式 */
#debug-tag-stats {
    position: fixed;
    top: 50px;
    right: 50px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    z-index: 9999;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    font-family: monospace;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#debug-tag-stats pre {
    white-space: pre-wrap;
    font-size: 12px;
}

#debug-tag-stats h4 {
    margin-top: 0;
    color: #7b68ee;
}

/* 页脚样式 */
.site-footer {
    background-color: var(--card-bg);
    padding: 40px 20px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 无游戏提示信息样式 */
.no-games-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 10px;
    margin: 10px auto;
    max-width: 300px;
    min-height: 160px;
}

.no-games-message i {
    color: var(--primary-color);
    margin-bottom: 10px;
    opacity: 0.8;
    font-size: 2.5rem;
}

.no-games-message p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 250px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary i {
    margin-right: 8px;
    color: white;
    opacity: 1;
    margin-bottom: 0;
    font-size: 1rem;
}

@media (max-width: 992px) {
    .site-footer {
        margin-left: var(--sidebar-collapsed-width);
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 30px 15px 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .footer-section ul {
        columns: 2;
        column-gap: 20px;
    }
}

@media (max-width: 576px) {
    .site-footer {
        margin-left: 0;
        padding: 25px 15px 15px;
    }
    
    .footer-section ul {
        columns: 1;
    }
    
    .footer-bottom {
        margin-top: 20px;
        padding-top: 15px;
    }
} 