/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航栏 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
    color: #ff6b35;
}

.logo i {
    font-size: 24px;
}

.header-search {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.header-search form {
    display: flex;
    background-color: #f5f5f5;
    border-radius: 20px;
    overflow: hidden;
    height: 40px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    height: 100%;
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #ff6b35;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background-color: #ff6b35;
    color: #fff;
}

/* 历史记录下拉 */
.history-dropdown {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 320px;
    max-width: 90%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 2001;
    overflow: hidden;
}

.history-dropdown .hd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.history-dropdown .hd-list {
    max-height: 320px;
    overflow-y: auto;
}

.history-dropdown .hd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f9f9f9;
}

.history-dropdown .hd-item:last-child { border-bottom: none; }

.hd-item .title { flex: 1; font-size: 14px; color: #333; }
.hd-item .time { font-size: 12px; color: #999; margin-left: 8px; white-space: nowrap; }
.hd-item .hd-actions { margin-left: 8px; }
.hd-item .hd-actions button { background: transparent; border: none; color: #999; cursor: pointer; }

.hd-empty { padding: 24px; text-align: center; color: #999; }

@media (max-width: 768px) {
    .history-dropdown { right: 10px; top: 56px; width: 280px; }
    
    .site-header {
        padding: 8px 0;
    }
    
    .header-inner {
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    .logo {
        min-width: auto;
    }
    
    .logo a {
        font-size: 16px;
        gap: 6px;
    }
    
    .logo a span {
        display: inline-block;
        white-space: nowrap;
    }
    
    .logo i {
        font-size: 18px;
    }
    
    .header-search {
        flex: 1;
        min-width: 0;
        max-width: none;
        margin: 0 6px;
    }
    
    .header-search form {
        border-radius: 16px;
        height: 32px;
    }
    
    .search-input {
        padding: 0 10px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 0 10px;
        font-size: 14px;
    }
    
    .header-actions {
        gap: 6px;
        min-width: auto;
    }
    
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* 分类侧边栏 */
.category-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    z-index: 2000;
    transition: right 0.3s ease;
}

.category-sidebar.active {
    right: 0;
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-sidebar.active .sidebar-overlay {
    opacity: 1;
}

.sidebar-content {
    position: absolute;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transition: right 0.3s ease;
}

.category-sidebar.active .sidebar-content {
    right: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background-color: #ff6b35;
    color: #fff;
}

.sidebar-body {
    padding: 10px 0;
}

.category-list {
    list-style: none;
}

.category-item {
    border-bottom: 1px solid #f0f0f0;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #333;
    transition: all 0.3s ease;
}

.category-link:hover {
    background-color: #f9f9f9;
    color: #ff6b35;
}

.category-link.active {
    background-color: #fff5f0;
    color: #ff6b35;
    font-weight: 600;
}

.category-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.category-link span {
    flex: 1;
}

/* 主内容区域 */
.main-wrapper {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

.game-section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.hot-icon, .new-icon {
    color: #ff6b35;
    font-size: 24px;
}

/* 游戏网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.game-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.game-card-link {
    display: block;
}

.game-thumb {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background-color: #f0f0f0;
    overflow: hidden;
}

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

.hot-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
}

.hot-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.game-title {
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* 广告区域 */
.ad-section {
    margin: 30px 0;
    text-align: center;
}

.ad-label {
    font-size: 12px;
    color: #999;
    margin: 10px 0;
}

.ad-image {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.ad-code {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.pagination li {
    margin: 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a {
    background-color: #fff;
    color: #333;
    border: 1px solid #e5e5e5;
}

.pagination a:hover {
    background-color: #ff6b35;
    color: #fff;
    border-color: #ff6b35;
}

.pagination .active span {
    background-color: #ff6b35;
    color: #fff;
    border: 1px solid #ff6b35;
}

.pagination .disabled span {
    background-color: #f5f5f5;
    color: #ccc;
    border: 1px solid #e5e5e5;
    cursor: not-allowed;
}

/* 游戏详情页 */
.game-detail {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.game-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.game-detail-thumb {
    flex-shrink: 0;
    width: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.game-detail-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.game-detail-info {
    flex: 1;
}

.game-detail-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.game-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.game-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.game-detail-meta i {
    color: #ff6b35;
    font-size: 16px;
}

.game-detail-description {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 30px;
}

.game-detail-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #ff6b35;
    color: #fff;
}

.btn-primary:hover {
    background-color: #e55a28;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-default {
    background-color: #f5f5f5;
    color: #333;
}

.btn-default:hover {
    background-color: #e5e5e5;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 18px;
}

/* 游戏播放器 */
.game-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-player-wrapper {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
}

#game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000;
}

.game-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background-color: #ff6b35;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 10000;
}

.game-close-btn:hover {
    background-color: #e55a28;
    transform: translateY(-2px);
}

.game-close-btn i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .game-player-wrapper {
        width: 100%;
        height: 100%;
    }
    
    .game-close-btn {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* 评论区 */
.game-comments {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.comment-list {
    margin-bottom: 30px;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #f5f5f5;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.comment-rating i {
    color: #ffd700;
    font-size: 14px;
}

.comment-time {
    font-size: 13px;
    color: #999;
    margin-left: auto;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 相关游戏 */
.related-games {
    background-color: #fff;
    border-radius: 12px;
    /* padding: 30px; */
}

/* 响应式 - 详情页 */
@media (max-width: 768px) {
    .game-detail {
        padding: 20px;
    }
    
    .game-detail-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-detail-thumb {
        width: 100%;
    }
    
    .game-detail-title {
        font-size: 24px;
    }
    
    .game-detail-meta {
        gap: 15px;
    }
    
    .game-detail-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 相关游戏区域手机模式固定2列 */
    .related-games .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* 底部 */
.site-footer {
    background-color: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #666;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b35;
}

.separator {
    margin: 0 10px;
    color: #ccc;
}

.footer-contact {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.footer-copyright {
    font-size: 12px;
    color: #999;
}

/* 响应式 */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

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