/* project1 主题覆盖：对齐 game-template/src/project1 */
:root {
    --blue: #1c7df2;
    --cyan: #16bdd4;
    --green: #22b86b;
    --orange: #ff8a3d;
    --red: #ee4d5a;
    --violet: #7657f4;
    --ink: #172033;
    --text: #344054;
    --muted: #667085;
    --line: rgba(28, 58, 110, .13);
    --panel: rgba(255, 255, 255, .92);
    --soft: #f5f8ff;
    --wrap: 1200px;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #eaf4ff 0, #fff7ec 32%, #f2fff8 68%, #fff 100%);
}

.main-wrapper {
    background: transparent;
}

.wrap {
    width: min(var(--wrap), calc(100% - 24px));
    margin: 0 auto;
}

/* 头部 */
.site-header {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 34px rgba(31, 61, 112, .12);
}

.utility-bar {
    color: #fff;
    background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

.utility-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
}

.utility-inner span,
.utility-inner a {
    min-width: 0;
}

.utility-inner a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.brand-band {
    border-bottom: 1px solid var(--line);
}

.brand-row {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg, var(--blue) 0 45%, var(--green) 45% 74%, var(--orange) 74%);
    font-size: 28px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(28, 125, 242, .24);
}

.brand-text {
    min-width: 0;
}

.brand strong {
    display: block;
    color: var(--ink);
    font-size: 22px;
    line-height: 1.1;
}

.brand em {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.main-nav {
    background: #fff;
    box-shadow: none;
    padding: 0;
    overflow: visible;
    border-top: 1px solid var(--line);
}

.nav-inner {
    min-height: auto;
}

/* 移动端主题：导航始终横向展示，可左右滑动 */
.site-header .nav-toggle,
.nav-toggle {
    display: none !important;
}

.site-header .nav-links,
.nav-links {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-header .nav-links::-webkit-scrollbar,
.nav-links::-webkit-scrollbar {
    display: none;
}

.site-header .nav-links a,
.nav-links a {
    flex: 0 0 auto;
    min-width: max-content;
    height: 34px;
    padding: 0 14px;
    display: inline-grid;
    place-items: center;
    color: var(--ink) !important;
    font-size: 13px;
    font-weight: 700;
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
    background: transparent;
    border-radius: 0;
    text-decoration: none;
}

.site-header .nav-links a.active,
.site-header .nav-links a:hover,
.nav-links a.active,
.nav-links a:hover {
    color: #fff !important;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-size: 14px;
    overflow: visible;
}

.breadcrumb a {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

.breadcrumb a::after {
    content: "/";
    margin-left: 8px;
    color: #a1adc0;
    font-weight: 400;
}

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

/* 分页：强制单行，超出可横向滑动 */
.pager {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
}

.pager::-webkit-scrollbar {
    display: none;
}

.pager a,
.pager span {
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.pager a.active,
.pager span.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

/* 游戏/应用列表页：修复窄屏下列表项被压成单列的问题 */
.list-page .list-head {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

.list-page .list-head h1 {
    font-size: 24px;
}

.list-page .list-head p {
    font-size: 13px;
    line-height: 1.6;
}

.list-page .resource-panel {
    padding: 14px;
}

.list-page .resource-item {
    grid-template-columns: 72px minmax(0, 1fr) 68px;
    gap: 10px;
    align-items: center;
    padding: 11px;
}

.list-page .resource-icon {
    width: 72px;
    height: 72px;
}

.list-page .resource-main h2 {
    font-size: 16px;
}

.list-page .resource-main p {
    font-size: 13px;
    -webkit-line-clamp: 2;
}

.list-page .resource-meta {
    gap: 5px;
    margin-top: 6px;
}

.list-page .resource-meta span {
    font-size: 12px;
    padding: 2px 6px;
}

.list-page .resource-download {
    width: 68px !important;
    height: 32px !important;
    font-size: 12px !important;
    justify-self: end;
    align-self: center;
    text-decoration: none;
}

/* 排行榜页：修复主榜列表、侧栏与底部模块在移动端的布局 */
.rank-page .rank-page-panel {
    padding: 14px;
}

.rank-page .rank-page-head {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.rank-page .rank-page-head h1 {
    font-size: 24px;
}

.rank-page .rank-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.rank-page .rank-tabs::-webkit-scrollbar {
    display: none;
}

.rank-page .rank-tabs a {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 7px 12px;
    text-decoration: none;
}

.rank-page .rank-page-layout {
    grid-template-columns: 1fr;
    gap: 12px;
}

.rank-page .rank-main-list {
    padding: 12px 12px 8px;
}

.rank-page .rank-main-list li {
    grid-template-columns: 32px 52px minmax(0, 1fr) 68px !important;
    grid-template-rows: auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
}

.rank-page .rank-main-num {
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    height: 32px;
    font-size: 12px;
    align-self: center;
}

.rank-page .rank-main-list img {
    grid-column: 2;
    grid-row: 1;
    width: 52px;
    height: 52px;
    align-self: center;
}

.rank-page .rank-main-info {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    gap: 4px;
    align-self: center;
}

.rank-page .rank-main-info a {
    font-size: 15px;
    line-height: 1.3;
}

.rank-page .rank-main-info p {
    display: none;
}

.rank-page .rank-main-info div {
    gap: 4px;
    margin-top: 2px;
}

.rank-page .rank-main-info span {
    font-size: 11px;
    padding: 2px 6px;
    max-width: none;
}

.rank-page .rank-main-stat {
    display: none !important;
}

.rank-page .rank-main-action {
    grid-column: 4 !important;
    grid-row: 1 !important;
    width: 68px;
    height: 32px;
    font-size: 12px;
    justify-self: end;
    align-self: center;
    text-decoration: none;
}

.rank-page .rank-side {
    grid-template-columns: 1fr;
    gap: 10px;
}

.rank-page .rank-side-card {
    padding: 12px;
}

.rank-page .rank-side-card h2 {
    font-size: 18px;
}

.rank-page .rank-side-list li {
    grid-template-columns: 24px 40px minmax(0, 1fr) auto;
    gap: 8px;
}

.rank-page .rank-side-list img {
    width: 40px;
    height: 40px;
}

.rank-page .rank-side-list a {
    font-size: 13px;
}

.rank-page .rank-side-list span {
    font-size: 11px;
    white-space: nowrap;
}

.rank-page .rank-extra-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

.rank-page .rank-extra-grid .module {
    margin-top: 0;
    padding: 14px;
}

.rank-page .rank-news-list a {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
}

.rank-page .rank-news-list img {
    width: 96px;
    height: 64px;
    grid-row: span 2;
}

.rank-page .rank-news-list span,
.rank-page .rank-news-list strong {
    grid-column: 2;
}

.rank-page .rank-news-list strong {
    font-size: 14px;
}

.rank-page .rank-topic-list a {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
}

.rank-page .rank-topic-list img {
    width: 96px;
    height: 64px;
}

.rank-page .rank-topic-list span {
    font-size: 14px;
}

.rank-page .rank-topic-list em {
    font-size: 12px;
}

/* 按钮配色 */
.resource-download {
    background: linear-gradient(135deg, var(--orange), var(--red)) !important;
    color: #fff !important;
}

.resource-download.app {
    background: linear-gradient(135deg, var(--green), var(--cyan)) !important;
}

.download-btn {
    background: linear-gradient(135deg, var(--orange), var(--red)) !important;
    color: #fff !important;
}

.download-btn.app {
    background: linear-gradient(135deg, var(--green), var(--cyan)) !important;
}

.topic-more,
.topic-download,
.rank-main-action,
.list-action,
.collection-more {
    background: linear-gradient(135deg, var(--blue), var(--cyan)) !important;
    color: #fff !important;
}

/* 页脚 */
.footer.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    margin-top: 24px;
}

.footer-inner {
    padding: 22px 0 28px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 13px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.footer-links a:hover {
    color: var(--blue);
}

.footer-copyright {
    margin-top: 12px;
}

.copyright-text {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

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

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(28, 125, 242, .28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
    z-index: 999;
    cursor: pointer;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-icon {
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

/* 页面主体间距 */
.wrap.page {
    padding-top: 16px;
    padding-bottom: 24px;
}

@media (max-width: 820px) {
    .brand-row {
        min-height: 0;
        padding: 12px 0;
    }

    .brand strong {
        font-size: 20px;
    }

    .site-header .nav-links,
    .nav-links {
        display: flex !important;
        gap: 6px;
        padding: 8px 0 10px;
    }

    .site-header .nav-links a,
    .nav-links a {
        height: 32px;
        padding: 0 12px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .utility-inner {
        font-size: 12px;
    }

    .site-header .nav-links a,
    .nav-links a {
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    .list-page .list-head h1 {
        font-size: 20px;
    }

    .list-page .resource-item {
        grid-template-columns: 64px minmax(0, 1fr) 62px;
        gap: 8px;
        padding: 10px;
    }

    .list-page .resource-icon {
        width: 64px;
        height: 64px;
    }

    .list-page .resource-download {
        width: 62px !important;
        height: 30px !important;
        font-size: 11px !important;
    }

    .pager {
        justify-content: flex-start;
        gap: 5px;
    }

    .pager a,
    .pager span {
        min-width: 28px;
        height: 30px;
        padding: 0 8px;
        font-size: 12px;
    }

    .rank-page .rank-page-head h1 {
        font-size: 20px;
    }

    .rank-page .rank-main-list li {
        grid-template-columns: 28px 48px minmax(0, 1fr) 62px !important;
        gap: 8px;
        padding: 10px 0;
    }

    .rank-page .rank-main-num {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .rank-page .rank-main-list img {
        width: 48px;
        height: 48px;
    }

    .rank-page .rank-main-info a {
        font-size: 14px;
    }

    .rank-page .rank-main-info span {
        font-size: 10px;
        padding: 2px 5px;
    }

    .rank-page .rank-main-action {
        grid-column: 4 !important;
        grid-row: 1 !important;
        width: 62px;
        height: 30px;
        font-size: 11px;
        justify-self: end;
    }

    .rank-page .rank-news-list a,
    .rank-page .rank-topic-list a {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .rank-page .rank-news-list img,
    .rank-page .rank-topic-list img {
        width: 84px;
        height: 56px;
    }
}
