/* 重置样式 */
* {
    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;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

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);
}

/* 菜单分类覆盖层：固定视口最上层，悬浮在 .header-content 正下方 */
.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-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.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;
}

/* 轮播图 */
.banner-container {
    position: relative;
    margin: 0 0 10px 0;
    overflow: hidden;
    background: #e8e8e8;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    text-decoration: none;
    color: inherit;
}

.banner-item.active {
    opacity: 1;
    z-index: 1;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: top;
}

.banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    z-index: 2;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    cursor: pointer;
}

.dot.active {
    width: 24px;
    border-radius: 4px;
    background: white;
}

@media screen and (min-width: 375px) {
    .banner-slider {
        height: 200px;
    }
}

@media screen and (min-width: 414px) {
    .banner-slider {
        height: 220px;
    }
}

/* 区块样式 */
.section {
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    min-width: 0;
    overflow-x: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    min-width: 0;
    overflow: hidden;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.more-link {
    font-size: 13px;
    color: #999;
    flex-shrink: 0;
}

/* 应用网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    min-width: 0;
    overflow: hidden;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.app-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

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

.app-name {
    font-size: 12px;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 50px;
    /*min-width: 0;*/
}

/* 专题合辑滑动 */
.topic-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 0 10px 0;
    min-width: 0;
}

.topic-slider::-webkit-scrollbar {
    display: none;
}

.topic-item {
    flex: 0 0 auto;
    width: 220px;
    scroll-snap-align: start;
    cursor: pointer;
}

.topic-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
}

.topic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.topic-item:active .topic-image img {
    transform: scale(0.95);
}

.topic-title {
    font-size: 13px;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

/* 对于小屏幕调整专题卡片宽度 */
@media screen and (max-width: 375px) {
    .topic-item {
        width: 200px;
    }

    .topic-image {
        height: 110px;
    }
}

/* 标签列表 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    transition: all 0.3s;
}

.tag-item:active {
    background: #e0e0e0;
}

/* 资讯区块竖线列表（与图片一致：左侧竖线、虚线分隔、右侧日期） */
.news-line-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.news-line-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px dashed #e8e8e8;
    transition: background 0.2s;
}

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

.news-line-item:active {
    background: #f8f8f8;
}

.news-line-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-line-date {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
}

/* 下载列表 */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.download-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.download-info {
    flex: 1;
    min-width: 0;
}

.download-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-desc {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-btn {
    padding: 6px 18px;
    background: #1890ff;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    flex-shrink: 0;
}

/* 加载更多 */
.load-more {
    margin-top: 15px;
    text-align: center;
}

.load-more-btn {
    padding: 10px 30px;
    background: #f0f0f0;
    color: #666;
    border-radius: 20px;
    font-size: 14px;
}

/* 排行榜 */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    transition: background 0.3s;
    min-width: 0;
    overflow: hidden;
}

.rank-item:active {
    background: #f0f0f0;
}

.rank-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #999;
    background: #e0e0e0;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-number.top {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

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

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

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

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

.rank-desc {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-btn {
    padding: 6px 20px;
    background: #1890ff;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.rank-btn:active {
    background: #3db592;
    transform: scale(0.95);
}

/* 友情链接 */
.friend-links {
    display: flex;
    gap: 15px;
}

.friend-link {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
}

/* 底部 */
.footer {
    background: white;
    padding: 20px 15px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: #999;
    overflow: hidden;
    min-width: 0;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

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

.back-to-top:active {
    background: rgba(0, 0, 0, 0.7);
}

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

/* ==================== App 页面样式 ==================== */

/* App 页面整体布局 */
.app-page {
    background: #f5f5f5;
}

/* App 二级导航 */
.app-secondary-nav {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    min-width: 0;
    overflow-x: hidden;
}

.app-secondary-nav .app-nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
}

.app-secondary-nav .app-nav-menu::-webkit-scrollbar {
    display: none;
}

.app-nav-item {
    font-size: 15px;
    color: #666;
    white-space: nowrap;
    padding: 6px 0;
    position: relative;
    transition: color 0.25s, background 0.25s;
    text-decoration: none;
    flex-shrink: 0;
}

.app-nav-item:active {
    color: #1890ff;
}

.app-nav-item.active {
    color: #1890ff;
    font-weight: 600;
}

.app-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1890ff, #40a9ff);
    border-radius: 1px;
}

/* 应用列表容器 */
.app-list-container {
    background: white;
    min-height: calc(100vh - 200px);
}

.app-list {
    padding: 15px;
}

/* 应用列表项 */
.app-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.app-list-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.app-list-info {
    flex: 1;
    min-width: 0;
}

.app-list-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-list-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.star {
    font-size: 14px;
    color: #e0e0e0;
}

.star.filled {
    color: #ffc107;
}

.app-list-date {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.app-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.app-list-tag {
    color: #1890ff;
}

.app-list-size,
.app-list-version {
    position: relative;
}

.app-list-size::before,
.app-list-version::before {
    content: '|';
    position: absolute;
    left: -6px;
    color: #ddd;
}

.app-list-btn {
    padding: 8px 20px;
    background: white;
    color: #1890ff;
    border: 1px solid #1890ff;
    border-radius: 20px;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.app-list-btn:active {
    background: #1890ff;
    color: white;
}

/* 分页（游戏页/软件页） */
.app-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 20px 15px 30px;
    background: white;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.app-pagination .page-prev,
.app-pagination .page-next {
    flex-shrink: 0;
}

.app-pagination .page-prev,
.app-pagination .page-next {
    padding: 8px 14px;
    font-size: 14px;
    color: #1890ff;
    text-decoration: none;
    border: 1px solid #1890ff;
    border-radius: 6px;
    transition: all 0.2s;
}

.app-pagination .page-prev:active,
.app-pagination .page-next:active {
    background: #1890ff;
    color: white;
}

.app-pagination .page-prev.disabled,
.app-pagination .page-next.disabled {
    color: #bbb;
    border-color: #e0e0e0;
    pointer-events: none;
    cursor: not-allowed;
}

.app-pagination .page-nums {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.app-pagination .page-num {
    min-width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s;
}

.app-pagination .page-num:hover,
.app-pagination .page-num:active {
    border-color: #1890ff;
    color: #1890ff;
}

.app-pagination .page-num.active {
    background: #1890ff;
    border-color: #1890ff;
    color: white;
}

.app-pagination .page-ellipsis {
    font-size: 14px;
    color: #999;
    padding: 0 4px;
    flex-shrink: 0;
}

/* 分页（paginator.blade.php：.pagination + .page-btn） */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 15px;
    min-width: 0;
    overflow: hidden;
}

.pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.pagination a.page-btn:active {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination .page-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
    cursor: default;
}

.pagination .page-btn.first-btn,
.pagination .page-btn.last-btn {
    background: #f8f9fa;
    color: #495057;
}
