/* 调色板：鲜明有趣 */
:root {
    --bg: #060b24;
    --text: #ffffff;
    --muted: #c8d4ff;
    --primary: #27ffb8;
    /* 更亮薄荷绿 */
    --accent: #ff31c2;
    /* 高饱和粉 */
    --warning: #ffb300;
    --card: #18224a;
    --card-hover: #223064;
    --border: rgba(255, 255, 255, 0.14);
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

/* 基础 */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    /* 明亮鲜艳背景 */
    background: linear-gradient(135deg, #ffe27a 0%, #7ae7ff 50%, #ff99e8 100%);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 页面容器 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* 头部 */
.site-header {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0 8px;
}

.nav-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.nav-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    width: 160px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

@media (min-width: 798px) {
    .brand-logo {
        width: 200px;
    }
}

.search-button {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}

.search-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* 侧栏 */
.sidebar-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 78vw;
    max-width: 340px;
    height: 100vh;
    background: linear-gradient(180deg, #111937 0%, #0d142c 100%);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 0 1px var(--border), var(--shadow);
    display: none;
    z-index: 9999;
    padding: 16px 12px;
}

.sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 9998;
}

.sidebar-title {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: .2px;
    margin: 4px 4px 12px;
}

.sidebar-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.sidebar-link {
    text-decoration: none;
}

.sidebar-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: background .2s ease, transform .2s ease;
}

.sidebar-item:hover {
    background: var(--card-hover);
    transform: translateX(2px);
}

.sidebar-text {
    color: var(--text);
    font-weight: 600;
}

.sidebar-icon {
    color: var(--accent);
}

/* 翻译入口位置已内联保持尺寸，额外增强层级 */
.translate-anchor {
    z-index: 9999;
}

/* 广告区 */
.ad {
    margin: 18px 0;
    display: flex;
    justify-content: center;
}

.ad-header {
    padding: 6px 0;
}

.ad-header-wide {
    padding: 6px 0;
}

.ad-article {
    padding: 8px 0;
}

.ad .adsbygoogle,
.ad a img {
    border-radius: 12px;
}

.ad-row {
    display: block;
    width: 100%;
}

/* 主体内容 */
.main-content {
    padding-bottom: 24px;
}

/* 区块标题 */
.section-head {
    margin: 10px 0 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(39, 255, 184, 0.18), rgba(255, 49, 194, 0.18));
    border: 1px solid var(--border);
    border-radius: 12px;
}

.section-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 24px;
    height: 24px;
}

.section-title {
    font-weight: 800;
    color: var(--text);
    letter-spacing: .3px;
}

.section-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--accent);
    transition: background .2s ease, transform .2s ease;
}

.section-more:hover {
    background: rgba(255, 49, 194, 0.15);
    transform: translateY(-2px);
}

/* 游戏网格与卡片 */
.game-grid {
    margin: 8px 0 14px;
}

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

@media (min-width: 720px) {
    .grid-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1100px) {
    .grid-row {
        grid-template-columns: repeat(6, 1fr);
    }
}

.card-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .22s ease, box-shadow .22s ease, background .25s ease;
}

.card-item:hover {
    transform: translateY(-4px);
    background: var(--card-hover);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #101c3f;
    display: grid;
    place-items: center;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

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

.card-title {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 4px 6px 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .65) 85%);
    color: var(--text);
    display: flex;
    align-items: flex-end;
    min-height: 32px;
    box-sizing: border-box;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}

.card-info {
    display: none;
}

/* Footer */
.site-footer {
    margin-top: 24px;
}

.footer-bar {
    border-top: 1px solid var(--border);
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
}

.footer-nav a {
    color: var(--text);
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    padding-right: 16px;
}

.footer-nav a:last-of-type {
    border-right: none;
}

.footer-nav span {
    color: var(--muted);
}

/* 轻量动画 */
@media (prefers-reduced-motion: no-preference) {
    .card-thumb img {
        transition: transform .3s ease;
    }

    .card-item:hover .card-thumb img {
        transform: scale(1.03);
    }
}

/* 无障碍增强 */
.nav-toggle:focus,
.section-more:focus,
.sidebar-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ad-tips-top::after {
    display: inline-block;
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #696969;
    margin-left: 3px;
}

.ad-tips-bottom::after {
    display: inline-block;
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #696969;
    margin-left: 3px;
}

@media (max-width=768px) {

    .ad-tips-top,
    .ad-tips-bottom {
        display: flex;
        justify-content: center;
        align-items: center;
        color: #666;
        font-size: 12px;
        text-align: center;

    }
}

/* 加载更多提示样式 */
.feed-loader {
    margin: 12px 0 20px;
    padding: 10px 12px;
    text-align: center;
    color: var(--accent);
    background: rgba(255,255,255,0.12);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
}