/* ==========================================================
   奇异岛游戏盒子 - 公共样式（骨架 / 导航 / 通用卡片 / 列表 / 排行 / 页脚）
   源自首页 index.html，供全部页面公共引用
   ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

/* ---------- 电脑端骨架 (≥992px) ---------- */
.app-container {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 180px;
    background-color: #ffffff;
    border-right: 1px solid #e5e5ea;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 15px;
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-header {
    margin-bottom: 20px;
}
.platform-dropdown {
    color: #1d1d1f;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}
.platform-dropdown:hover {
    color: #1d1d1f;
}
.platform-dropdown .fa-apple {
    font-size: 24px;
}
.search-box {
    margin-bottom: 20px;
}
.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f5f5f7;
}
.search-box input:focus {
    outline: none;
    border-color: #0071e3;
    background-color: #ffffff;
}
.nav-menu {
    margin-bottom: 30px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 15px;
    transition: background-color 0.2s;
}
.nav-item:hover {
    background-color: #f5f5f7;
    color: #1d1d1f;
}
.nav-item.active {
    background-color: #e5e5ea;
    font-weight: 500;
}
.category-title {
    font-size: 12px;
    font-weight: 600;
    color: #86868b;
    margin-bottom: 10px;
    padding-left: 12px;
}

/* 电脑端主内容区 */
.main-content {
    flex: 1;
    padding: 20px 40px;
    min-width: 0;
}
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
}

/* ---------- 手机端导航 (<992px) ---------- */
.mobile-navbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5ea;
    z-index: 1000;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
}
.mobile-navbar .platform-dropdown {
    font-size: 18px;
    font-weight: 600;
}
.mobile-navbar .menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #1d1d1f;
    padding: 0;
}
.mobile-sidebar {
    width: 280px;
}
.mobile-sidebar .offcanvas-body {
    padding: 20px 15px;
}

@media (max-width: 991px) {
    .sidebar {
        display: none;
    }
    .mobile-navbar {
        display: flex;
    }
    .main-content {
        margin-top: 60px;
        padding: 20px !important;
    }
    .page-title.desktop-only {
        display: none;
    }
}
@media (min-width: 992px) {
    .mobile-navbar,
    .mobile-sidebar,
    .offcanvas-backdrop {
        display: none !important;
    }
}

/* ---------- 通用大图卡片 ---------- */
.app-card {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
.app-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 25px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.card-tag {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.9;
}
.card-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}
.card-subtitle {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 20px;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
}
.app-name {
    font-size: 16px;
    font-weight: 600;
}
.app-desc {
    font-size: 13px;
    opacity: 0.8;
}
.view-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    padding: 8px 22px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.view-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
.small-card .card-title {
    font-size: 28px;
}
.small-card .card-overlay {
    padding: 20px;
}

/* ---------- 活动板块 ---------- */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 30px 0 10px;
}
.section-subtitle {
    font-size: 15px;
    color: #86868b;
    margin-bottom: 20px;
}
.activity-card {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}
.activity-card:hover {
    transform: translateY(-3px);
}
.activity-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.activity-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #9c27b0;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- 下拉菜单 ---------- */
.dropdown-menu {
    border-radius: 12px;
    border: 1px solid #e5e5ea;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0;
    min-width: 160px;
}
.dropdown-item {
    padding: 12px 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dropdown-item i.fa,
.dropdown-item .fa-icon-svg {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.dropdown-item .fa-icon-svg {
    height: 16px;
}
.dropdown-item.active {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

/* ---------- 列表式 App 推荐 ---------- */
.list-section {
    margin-top: 50px;
}
.list-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #1d1d1f;
    text-decoration: none;
}
.list-title:hover {
    color: #0071e3;
}

/* ---------- 付费 App 排行 ---------- */
.ranking-section {
    margin-top: 50px;
}
.ranking-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #1d1d1f;
    text-decoration: none;
}
.ranking-title:hover {
    color: #0071e3;
}
.ranking-card {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 25px 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    transition: transform 0.2s;
    height: 100%;
}
.ranking-card:hover {
    transform: translateY(-3px);
}
/* 名次角标：贴左上角，右侧斜切，名次不同颜色不同 */
.ranking-number {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    min-width: 46px;
    padding: 7px 16px 7px 13px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    background: #86868b;
    border-radius: 24px 0 0 0;
    clip-path: polygon(0 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
}
.ranking-number.rank-1 { background: linear-gradient(135deg, #ff6a5c 0%, #e8281f 100%); }
.ranking-number.rank-2 { background: linear-gradient(135deg, #ffb347 0%, #f5820b 100%); }
.ranking-number.rank-3 { background: linear-gradient(135deg, #ffd54a 0%, #f2a900 100%); }
.ranking-number.rank-4 { background: linear-gradient(135deg, #4aa3ff 0%, #0071e3 100%); }
.ranking-number.rank-5 { background: linear-gradient(135deg, #35c4d6 0%, #0090a8 100%); }
.ranking-number.rank-6 { background: linear-gradient(135deg, #5ad46f 0%, #22a83c 100%); }
.ranking-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin: 0 auto 15px;
    overflow: hidden;
}
.ranking-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ranking-app-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-app-desc {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 20px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-view-btn {
    background-color: #e8f0fe;
    color: #0071e3;
    border: none;
    border-radius: 20px;
    padding: 6px 22px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.ranking-view-btn:hover {
    background-color: #d4e3fc;
}

/* ---------- 快速链接与页脚 ---------- */
.quick-links-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e5ea;
}
.quick-links-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
}
.quick-link {
    display: block;
    color: #0071e3;
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e5ea;
}
.quick-link:hover {
    text-decoration: underline;
    color: #0071e3;
}
.quick-link:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e5e5ea;
    color: #86868b;
    font-size: 12px;
}
.footer-links {
    margin-top: 10px;
}
.footer-links a {
    color: #86868b;
    text-decoration: none;
    margin-right: 15px;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* ---------- 全断点响应式 ---------- */
@media (min-width: 1400px) {
    .list-col { flex: 0 0 auto; width: 25%; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    .list-col { flex: 0 0 auto; width: 25%; }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .list-col { flex: 0 0 auto; width: 33.33333333%; }
    .main-content { padding: 20px 25px; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .list-col { flex: 0 0 auto; width: 50%; }
}
@media (max-width: 767px) {
    .list-col { flex: 0 0 auto; width: 50%; }
    .card-title { font-size: 24px; }
    .small-card .card-title { font-size: 22px; }
    .card-subtitle { font-size: 13px; }
    .app-icon { width: 40px; height: 40px; }
    .ranking-number { font-size: 15px; }
    .ranking-app-icon { width: 70px; height: 70px; }
}
@media (max-width: 575px) {
    .list-col { flex: 0 0 auto; width: 100%; }
    .card-title { font-size: 20px; }
    .card-subtitle { font-size: 12px; margin-bottom: 15px; }
    .card-overlay { padding: 20px; }
    .view-btn { padding: 6px 18px; font-size: 13px; }
    .ranking-number { font-size: 14px; min-width: 38px; padding: 5px 13px 5px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
    .ranking-app-icon { width: 60px; height: 60px; }
    .ranking-app-name { font-size: 15px; }
    .ranking-app-desc { font-size: 12px; }
}

/* ---------- 筛选条（列表 / 搜索结果页共用） ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e5ea;
    margin-bottom: 24px;
}
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
}
.chips::-webkit-scrollbar {
    display: none;
}
.chip {
    flex-shrink: 0;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    color: #1d1d1f;
    white-space: nowrap;
    transition: all 0.2s;
}
.chip:hover { border-color: #c8c8cf; }
.chip.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #ffffff;
}
.sort-btn {
    flex-shrink: 0;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    color: #1d1d1f;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.sort-btn:hover { border-color: #c8c8cf; }
.sort-btn::after { margin-left: 2px; }

/* ---------- 横向游戏卡片（列表 / 搜索结果 / 专题页共用） ---------- */
.game-card {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 18px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    border-color: #d8d8de;
    color: inherit;
}
.game-icon {
    width: 86px;
    height: 86px;
    border-radius: 19px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.game-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-desc {
    font-size: 13px;
    color: #86868b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.plat-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c0c0c8;
    font-size: 15px;
}
.plat-icons i { transition: color 0.2s; }
.game-card:hover .plat-icons i { color: #86868b; }
.dl-btn {
    background: #e8f0fe;
    color: #0071e3;
    border-radius: 999px;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.game-card:hover .dl-btn { background: #0071e3; color: #ffffff; }

/* ---------- 分页（列表 / 搜索结果页共用） ---------- */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 40px 0 10px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}
.page-btn:hover { border-color: #1d1d1f; color: #1d1d1f; }
.page-btn.active { background: #1d1d1f; border-color: #1d1d1f; color: #ffffff; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }
.page-dots {
    color: #86868b;
    padding: 0 4px;
    font-size: 14px;
}

/* ---------- 共用组件响应式 ---------- */
@media (max-width: 767px) {
    .game-card { padding: 14px 16px; gap: 14px; border-radius: 16px; }
    .game-icon { width: 72px; height: 72px; border-radius: 16px; }
    .game-name { font-size: 15px; }
    .game-desc { font-size: 12px; }
    .game-info { gap: 10px; }
    .plat-icons { font-size: 13px; gap: 10px; }
    .dl-btn { padding: 5px 16px; font-size: 12px; }
    .page-btn { min-width: 34px; height: 34px; font-size: 13px; }
    .chip { padding: 6px 14px; font-size: 13px; }
    .sort-btn { padding: 6px 12px; font-size: 13px; }
    .filter-bar { padding-bottom: 14px; margin-bottom: 18px; }
}
@media (max-width: 575px) {
    .game-card { padding: 12px; gap: 12px; }
    .game-icon { width: 64px; height: 64px; border-radius: 14px; }
}
