/* ==================== 最先加载：全屏加载层样式 ==================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f7fafc 0%, #e3f2fd 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}
.loader-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 32px rgba(18, 134, 255, 0.2);
    margin-bottom: 2rem;
    animation: loaderPulse 1.5s ease-in-out infinite;
    border: 3px solid rgba(18, 134, 255, 0.1);
}
@keyframes loaderPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(18, 134, 255, 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(18, 134, 255, 0.3); }
}
.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.loader-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}
.loader-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2.5rem;
    font-weight: 500;
}
.loader-progress-container {
    width: 260px;
    height: 10px;
    background: rgba(18, 134, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(18, 134, 255, 0.1);
}
.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #50bdff, #1286ff, #50bdff);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.loader-percent {
    font-size: 1.25rem;
    color: #1286ff;
    font-weight: 700;
    margin-bottom: 1rem;
}
.loader-tips {
    font-size: 0.875rem;
    color: #6b7280;
    animation: fadeTips 1.5s ease-in-out infinite;
    padding: 0.5rem 1rem;
    background: rgba(18, 134, 255, 0.05);
    border-radius: 20px;
}
@keyframes fadeTips {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.loader-error {
    display: none;
    text-align: center;
    padding: 2rem;
}
.loader-error.show {
    display: block;
}
.loader-error-icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1rem;
}
.loader-error-text {
    color: #ef4444;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.loader-retry-btn {
    padding: 0.875rem 2.5rem;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(18, 134, 255, 0.3);
}

/* ==================== 主内容区：默认隐藏 ==================== */
.main-wrapper {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s;
}
.main-wrapper.show {
    opacity: 1;
    visibility: visible;
}

/* ==================== 原页面样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
    touch-callout: none;
    user-select: none;
    outline: none !important;
}
body {
    background: #f7fafc;
    max-width: 420px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: transparent; cursor: pointer; }
img {
    user-drag: none;
    display: block;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* 顶部导航 */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}
.logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f8f8f8;
    flex-shrink: 0;
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.nav-center {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.nav-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1286ff;
    text-align: center;
}
.nav-home-title {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
}
.nav-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}
.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

/* 分享按钮 - 气泡包裹 */
.share-btn-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(115deg, rgba(80, 189, 255, 0.1), rgba(18, 134, 255, 0.1));
    padding: 0.5rem 1rem;
    border-radius: 25px;
    border: 1px solid rgba(18, 134, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-btn-wrapper:active {
    transform: scale(0.95);
    background: linear-gradient(115deg, rgba(80, 189, 255, 0.2), rgba(18, 134, 255, 0.2));
}
.share-btn-wrapper i {
    font-size: 1.1rem;
    color: #1286ff;
    flex-shrink: 0;
}
.share-text {
    font-size: 0.875rem;
    color: #1286ff;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 欢迎横幅 - 固定1500:750比例 */
.banner {
    margin: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f8f8;
    position: relative;
    aspect-ratio: 1500/750;
}
.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 滚动公告 */
.notice-bar {
    margin: 0 0.75rem;
    border-radius: 20px;
    height: 2.5rem;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}
.notice-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.notice-text {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 1.5rem;
}
.notice-scroll {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    animation: scroll 15s linear infinite;
    font-size: 0.75rem;
    line-height: 1.5rem;
}
@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 标签切换 */
.tab-container {
    margin: 1rem 0.75rem;
    display: flex;
    background: rgba(18, 134, 255, 0.1);
    border-radius: 25px;
    padding: 4px;
}
.tab-btn {
    flex: 1;
    padding: 0.75rem 0;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    color: #1286ff;
    text-align: center;
    transition: all 0.3s;
}
.tab-btn.active {
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
}

/* ========== 修改1：整个首页可滚动，不是局部滚动 ========== */
#homePage {
    min-height: 100vh;
    padding-bottom: 140px; /* 底部留白，防止被导航挡住 */
}

/* ========== 修改2：移除原来的局部滚动容器 ========== */
.scroll-container {
    /* 删除原来的 max-height 和 overflow-y */
    padding-bottom: 20px;
}

/* ========== 修改3：游戏卡片变大 ========== */
.tab-content-wrapper {
    margin: 0 0.75rem;
}
.tab-content {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}
.tab-content.active {
    display: grid;
}

/* 游戏卡片 - 变大版本 */
.card {
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0.875rem 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    min-height: 72px; /* 原来56px，变大 */
}
.card:active {
    transform: scale(0.98);
}
.card-img {
    width: 2.8rem; /* 原来2.2rem，变大 */
    height: 2.8rem;
    border-radius: 0.6rem;
    overflow: hidden;
    margin-right: 0.625rem;
    flex-shrink: 0;
    background: #f8f8f8;
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}
.card-title {
    font-size: 0.9rem; /* 原来0.8rem，变大 */
    font-weight: 600;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-subtitle {
    font-size: 0.7rem; /* 原来0.65rem，稍微变大 */
    color: #6b7280;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* 页面内容 */
.page {
    display: none;
}
.page.active {
    display: block;
}

/* 客服页面 */
.contact-page {
    padding: 1rem;
    padding-bottom: 140px; /* 底部留白 */
}
.contact-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.contact-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.contact-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    border: 1.5px solid #1286ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    background: #f8f8f8;
}
.contact-icon img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}
.contact-name {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.contact-desc {
    font-size: 0.875rem;
    color: #6b7280;
}
.contact-copy {
    display: flex;
    align-items: center;
    background: rgba(18, 134, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}
.contact-account {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    word-break: break-all;
}
.copy-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.contact-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.contact-btn {
    padding: 0.75rem 0;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary {
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
}
.btn-outline {
    border: 1.5px solid #1286ff;
    color: #1286ff;
    background: transparent;
}

/* 发现/工具页面 */
.discover-page, .tool-page {
    padding: 1rem;
    padding-bottom: 140px; /* 底部留白 */
}
.discover-item, .tool-item {
    background: #fff;
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}
.discover-item:active, .tool-item:active {
    transform: scale(0.98);
}
.discover-icon, .tool-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 1rem;
    background: #f8f8f8;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.discover-icon img, .tool-icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}
.discover-title, .tool-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.discover-arrow, .tool-arrow {
    font-size: 1.25rem;
    color: #1286ff;
}

/* ========== 修改4：底部导航改小，往下移 ========== */
.bottom-nav {
    position: fixed;
    bottom: 8px; /* 原来20px，往下移 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 40px; /* 原来50px，改小 */
    padding: 6px 10px; /* 原来8px 12px，改小 */
    width: 75%; /* 原来80%，稍微小点 */
    max-width: 320px; /* 原来350px，改小 */
    z-index: 100;
    display: flex;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 50px; /* 原来60px，改小 */
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 70px; /* 原来85px，改小 */
    color: #1286ff;
    font-weight: 500;
    cursor: pointer;
    padding: 0 2px;
    transition: all 0.3s;
}
.nav-item.active {
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    border-radius: 20px; /* 原来25px，改小 */
}
.nav-icon {
    font-size: 1.2rem; /* 原来1.4rem，改小 */
    margin-bottom: 2px; /* 原来4px，改小 */
}
.nav-text {
    font-size: 0.7rem; /* 原来0.75rem，改小 */
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    white-space: nowrap;
}
.notification.show {
    opacity: 1;
}

/* 加载弹窗（卡片打开用） */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}
.loading-content {
    width: 90%;
    max-width: 300px;
    text-align: center;
}
.loading-title {
    font-size: 1.25rem;
    color: #1286ff;
    margin-bottom: 1rem;
}
.loading-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    animation: breathePulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(18, 134, 255, 0.3);
}
@keyframes breathePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 20px rgba(18, 134, 255, 0.3);
    }
    50% { 
        transform: scale(1.08); 
        box-shadow: 0 8px 30px rgba(18, 134, 255, 0.5);
    }
}
.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.loading-text {
    font-size: 0.9rem;
    color: #2d3748;
    margin-bottom: 0.75rem;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    transition: width 0.1s linear;
}
.progress-percent {
    font-size: 0.9rem;
    color: #1286ff;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.cancel-btn {
    padding: 0.75rem 2rem;
    background: #fff;
    border: 1px solid #f56565;
    color: #f56565;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}
.cancel-btn:active {
    background: #f56565;
    color: #fff;
}

/* 提示弹窗 */
.prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}
.prompt-content {
    width: 90%;
    max-width: 300px;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
}
.prompt-title {
    font-size: 1.25rem;
    color: #1286ff;
    margin-bottom: 1.5rem;
}
.prompt-text {
    font-size: 0.9rem;
    color: #2d3748;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.prompt-text p span {
    color: #1286ff;
    font-weight: 600;
}
.prompt-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s;
}
.download-btn {
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    border: none;
}
.prompt-btn-group {
    display: flex;
    gap: 0.75rem;
}
.continue-btn {
    flex: 1;
    background: linear-gradient(115deg, #50bdff, #1286ff);
    color: #fff;
    border: none;
    margin-bottom: 0;
}
.close-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #6b7280;
    color: #6b7280;
    margin-bottom: 0;
}

/* 内嵌页面 */
.embed-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 200;
    display: none;
    overflow: hidden;
}
.embed-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 60px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}
.embed-back-btn {
    position: absolute;
    left: 1rem;
    color: #1286ff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}
.embed-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1286ff;
    text-align: center;
}
.embed-content {
    width: 100%;
    height: calc(100vh - 60px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.embed-content iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}
