/* ==========================================================================
   1. 变量与基础重置
   ========================================================================== */
:root {
    --bg-dark: #0b0e14;
    --bg-nav: #010409;
    --bg-card: #161b22;
    --accent: #f39c12;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* ==========================================================================
   2. 导航栏 (Navbar)
   ========================================================================== */
.navbar {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    gap: 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
}

.logo span {
    color: #fff;
}

.site-tagline {
    margin-left: 10px;
    font-weight: bold;
    color: #fff;
    font-size: 14px;
}

/* 搜索框增强 */
.nav-middle {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
}

.search-form {
    width: 100%;
}

.search-group {
    display: flex;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 12px;
    transition: border-color 0.3s;
}

.search-group:focus-within {
    border-color: var(--accent);
}

.search-group input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-group button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* 语言切换 */
.nav-right {
    min-width: 150px;
    display: flex;
    justify-content: flex-end;
}

.lang-selector-wrapper {
    position: relative;
/* 【修改点 1】增加一个内边距，确保鼠标在滑向下拉框的瞬间仍处于容器内 */
    padding-bottom: 10px; 
    margin-bottom: -10px;
}

.current-lang {
    cursor: pointer;
    font-size: 13px;
    color: var(--accent);
    padding: 6px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.lang-dropdown {
    display: none;
    position: absolute;
    /* 【修改点 2】top 稍微调小一点，贴近按钮，或者保持现状配合下方的伪元素 */
    top: 100%; 
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 160px;
    box-shadow: var(--shadow);
    z-index: 10;
}

/* 【关键添加：透明桥梁】
   使用伪元素在下拉菜单上方撑起一块“隐形区域”，
   填满当前语言按钮与下拉列表之间的鸿沟。 */
.lang-dropdown::before {
    content: "";
    position: absolute;
    top: -15px;      /* 向上延伸 15px 覆盖间隙 */
    left: 0;
    width: 100%;
    height: 15px;    /* 高度必须能盖住鸿沟 */
    background: transparent;
}


.lang-selector-wrapper:hover .lang-dropdown {
    display: block;
}

.lang-dropdown a {
    color: var(--text-main);
    padding: 12px 15px;
    display: block;
    font-size: 14px;
}

.lang-dropdown a:hover {
    background: #21262d;
    color: var(--accent);
}

/* ==========================================================================
   3. 布局与通用组件
   ========================================================================== */
.layout-main {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .layout-main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* 侧边栏小工具与广告 */
.sidebar-widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 15px;
    margin-bottom: 15px;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    font-weight: 600;
}

.ads-placeholder {
    background: var(--bg-card);
    border: 2px dashed #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.sidebar-ad {
    height: 250px;
}

.sidebar-ad-tall {
    height: 600px;
}

.sticky-ad {
    position: sticky;
    top: 90px;
}

/* ==========================================================================
   4. 页面特定组件 (首页 & 列表)
   ========================================================================== */
/* 游戏卡片网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-thumb {
    position: relative;
    height: 280px;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--accent);
}

.card-info {
    padding: 15px;
}

.card-info h2 {
    margin: 0;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info small {
    color: var(--text-muted);
    font-size: 12px;
}

/* 英雄横幅 (Hero Section) */
.game-hero {
    padding: 60px 0;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.hero-content {
    display: flex;
    gap: 30px;
    align-items: flex-end;
}

.hero-poster {
    width: 180px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.hero-text h1 {
    font-size: 32px;
    margin: 10px 0;
    color: #fff;
}

.hero-text .stats {
    background: var(--accent);
    color: #000;
    display: inline-block;
    padding: 3px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

/* 文章条目列表 */
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list li {
    border-bottom: 1px solid var(--border);
}

.article-list a {
    display: flex;
    align-items: center;
    padding: 18px 15px;
    border-radius: 8px;
    margin: 5px 0;
}

.article-list a:hover {
    background: rgba(243, 156, 18, 0.05);
    color: var(--accent);
}

.art-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.art-title {
    font-size: 16px;
    font-weight: 500;
}

.art-date {
    font-size: 12px;
    color: var(--text-muted);
}

.arrow-icon {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(0);
}

.article-list a:hover .arrow-icon {
    opacity: 1;
    transform: translateX(5px);
}

/* ==========================================================================
   5. 文章详情页内容渲染 (Content Rendering)
   ========================================================================== */
.article-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.article-header {
    margin-bottom: 30px;
}

.article-header h1 {
    font-size: 32px;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.article-meta i {
    color: var(--accent);
    margin-right: 5px;
}

.entry-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-main);
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 25px auto;
    display: block;
    border: 1px solid var(--border);
}

.entry-content h2,
.entry-content h3 {
    color: var(--accent);
    margin: 40px 0 20px;
}

.no-content-alert {
    text-align: center;
    padding: 50px;
    background: rgba(243, 156, 18, 0.05);
    border: 1px dashed var(--accent);
    color: var(--accent);
    border-radius: 8px;
}

/* 面包屑 */
.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--accent);
}

.breadcrumb .separator {
    font-size: 10px;
    margin: 0 10px;
    color: var(--border);
}

/* ==========================================================================
   6. 统一分页器 (Pagination)
   ========================================================================== */
.pagination-wrapper {
    margin-top: 40px;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #1a1d21;
    border: 1px solid var(--border);
    color: #adbac7;
    border-radius: 6px;
    font-size: 14px;
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-link.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #000 !important;
    font-weight: bold;
}

.pager-gap {
    color: var(--text-muted);
    padding: 0 5px;
}

/* ==========================================================================
   7. 页脚 (Footer)
   ========================================================================== */
.footer {
    text-align: center;
    padding: 60px 40px;
    border-top: 1px solid var(--border);
    margin-top: 50px;
    color: var(--text-muted);
    font-size: 14px;
}