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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

/* 顶部导航栏：随页面滚动，不固定 */
.container > .header {
    position: relative;
    top: auto;
}

.header {
    position: relative;
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 0;
    overflow-x: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 10px;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 20px;
    margin-right: 4px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    height: 36px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 15px;
    font-size: 14px;
}

.search-btn {
    background: transparent;
    padding: 0 15px;
    height: 100%;
    color: #999;
    display: flex;
    align-items: center;
}

.menu-btn {
    background: transparent;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 5px;
    position: relative;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-btn.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.menu-btn.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 10px;
    min-width: 0;
    overflow: hidden;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex: 1;
    min-width: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding: 6px 4px;
    border-radius: 12px;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-tab:active {
    opacity: 0.9;
}

.nav-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.28);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 菜单分类覆盖层 */
.menu-overlay {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.menu-overlay.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.menu-overlay-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-height: calc(100vh - 52px);
    background: white;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    transition: transform 0.3s;
    z-index: 10000;
}

.menu-overlay.show .menu-overlay-panel {
    transform: translateY(0);
}

.menu-overlay-tabs {
    display: flex;
    background: #f5f5f5;
    padding: 0;
}

.menu-overlay-tab {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    color: #666;
    background: white;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.menu-overlay-tab.active {
    color: white;
    background: #1890ff;
    font-weight: 500;
    border-bottom-color: #1890ff;
}

.menu-overlay-tab:first-child.active {
    border-radius: 0;
}

.menu-overlay-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 15px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.menu-overlay-grid::-webkit-scrollbar {
    display: none;
}

.menu-overlay-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.menu-overlay-item:active {
    background: #f5f5f5;
    border-color: #1890ff;
}

.menu-overlay-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.menu-overlay-count {
    font-size: 12px;
    color: #999;
}

/* 专题页面 */
.zt-page {
    background: #f5f5f5;
    min-height: 100vh;
}

/* 专题Tab导航 */
.zt-tabs {
    top: 105px;
    background: white;
    display: flex;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zt-tab {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    font-size: 15px;
    color: #666;
    background: white;
    position: relative;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.zt-tab.active {
    color: #1890ff;
    font-weight: 500;
    border-bottom-color: #1890ff;
}

.zt-tab:active {
    background: #f9f9f9;
}

/* 专题容器 */
.zt-container {
    padding: 15px;
}

/* 专题网格 */
.zt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

/* 专题卡片项 */
.zt-item {
    width: 100%;
}

.zt-card {
    position: relative;
    width: 100%;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.zt-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zt-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.zt-card:active .zt-image {
    transform: scale(1.05);
}

/* 渐变遮罩 */
.zt-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

/* 专题标题 */
.zt-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 加载更多 */
.zt-load-more {
    margin-top: 20px;
    text-align: center;
    padding-bottom: 30px;
}

.zt-load-btn {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #666;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.zt-load-btn:active {
    background: #f5f5f5;
    transform: scale(0.98);
}

/* 响应式调整 */
@media screen and (min-width: 375px) {
    .zt-card {
        height: 120px;
    }

    .zt-title {
        font-size: 14px;
        padding: 10px 12px;
    }
}

@media screen and (min-width: 414px) {
    .zt-card {
        height: 130px;
    }
}

/* ==================== 资讯页 - 仅移动端 ==================== */

.news-page {
    padding-bottom: 56px;
}

/* 资讯页顶部导航（浅色背景） */
.news-page .news-header {
    background: linear-gradient(180deg, #f8f8f8 0%, #eee 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.news-page .news-header .logo {
    color: #333;
}

.news-page .news-header .menu-btn span {
    background: #333;
}

.news-nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 10px;
    background: transparent;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.news-nav-tabs::-webkit-scrollbar {
    display: none;
}

.news-page .news-nav-tabs .nav-tab {
    color: #666;
    font-size: 14px;
    padding: 6px 12px;
    flex-shrink: 0;
    border-radius: 16px;
    white-space: nowrap;
}

.news-page .news-nav-tabs .nav-tab.active {
    color: #fff;
    background: #1890ff;
}

/* 资讯列表容器 */
.news-container {
    padding: 12px 15px 20px;
    background: #f5f5f5;
}

.news-list {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.news-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

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

.news-item:active {
    background: #fafafa;
}

.news-thumb {
    width: 110px;
    height: 82px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    font-size: 13px;
    color: #999;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 分页 */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.news-page-btn {
    padding: 10px 16px;
    min-width: 80px;
    background: #fff;
    color: #666;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.news-page-btn:not(:disabled):active {
    background: #f0f0f0;
    transform: scale(0.98);
}

.news-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.news-page-nums {
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.news-page-num.active {
    background: #1890ff;
    color: #fff;
    font-weight: 500;
}

.news-page-num:not(.active):active {
    background: #f0f0f0;
}

/* 资讯页底部固定导航 */
.news-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 12px 15px;
    background: #6b6b6b;
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.news-footer a {
    color: #fff;
    text-decoration: none;
}

.news-footer a:active {
    opacity: 0.8;
}

/* ==================== 排行榜页面 ==================== */
.rank-page {
    padding-bottom: 20px;
    min-height: 100vh;
    background: #f5f5f5;
}

/* 与顶部导航栏左右对齐（导航 .header-content 为 15px） */
.rank-page .container {
    padding: 0 15px;
}

.rank-tabs {
    display: flex;
    align-items: stretch;
    padding: 10px 15px 12px;
    gap: 10px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.rank-tabs a {
    flex-shrink: 0;
    text-decoration: none;
}

.rank-tab-btn {
    display: block;
    min-width: 72px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
}

/* 未选中：灰框白底，和选中明显区分 */
.rank-tabs a:not(.active) .rank-tab-btn {
    color: #666;
    background: #fff;
    border-color: #e0e0e0;
}

/* 选中：蓝底白字，一眼能看出是当前项 */
.rank-tabs a.active .rank-tab-btn,
.rank-tab-btn.active {
    color: #fff !important;
    background: #1890ff !important;
    border-color: #1890ff !important;
}

.rank-tabs a:not(.active) .rank-tab-btn:active {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.rank-list-wrap {
    padding: 15px;
    min-width: 0;
    overflow-x: hidden;
}

.rank-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.rank-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    min-width: 0;
    overflow: hidden;
}

.rank-list-item:active .rank-list-link {
    opacity: 0.9;
}

.rank-list-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.rank-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    border-radius: 8px;
}

.rank-num.rank-top,
.rank-number.rank-top {
    color: #fff;
    font-weight: 700;
}

.rank-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    border-radius: 8px;
}

.rank-list-item:nth-child(1) .rank-num.rank-top,
.rank-list-item:nth-child(1) .rank-number.rank-top {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
}

.rank-list-item:nth-child(2) .rank-num.rank-top,
.rank-list-item:nth-child(2) .rank-number.rank-top {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
}

.rank-list-item:nth-child(3) .rank-num.rank-top,
.rank-list-item:nth-child(3) .rank-number.rank-top {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
}

.rank-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.rank-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-content {
    flex: 1;
    min-width: 0;
}

.rank-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin: 0;
    min-width: 0;
    overflow: hidden;
}

.rank-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-category {
    color: #1890ff;
}

.rank-download-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(74, 200, 165, 0.3);
    transition: all 0.2s;
}

.rank-download-btn:active {
    transform: scale(0.96);
}

/* 应用/游戏合集详情页复用排行榜样式时的扩展 */
.rank-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 16px 0 10px;
    margin: 0;
}

.rank-hero {
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}

.rank-hero-bg {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.rank-hero-mask {
    position: absolute;
    inset: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.rank-hero-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 0 15px;
    z-index: 1;
}

.rank-hero-intro {
    padding: 15px;
}

.rank-hero-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-hero-meta {
    font-size: 12px;
    color: #999;
    margin: 0;
}

.rank-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 0 20px;
    min-width: 0;
}

.rank-related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
}

.rank-related-icon {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.rank-related-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-related-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}
