/* ==========================================================
   直播盒子 - 前台公共样式（单文件，所有页面共用并可被浏览器缓存）
   ========================================================== */
:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --blue: #0071e3;
    --blue-dark: #0058b0;
    --line: rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 14px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 28px rgba(0,0,0,0.09);
    --r-lg: 24px;
    --r-md: 18px;
    --r-sm: 12px;
    --accent-gradient: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    --shell-max: 100%; /* 手机默认铺满，平板/电脑端在下方媒体查询里逐级放宽 */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "微软雅黑", sans-serif;
    background: #ececf1;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

/* ---------- 居中的内容外壳：根据屏幕宽度分级放宽，
   手机=铺满屏幕；平板=合理利用更多空间；大屏电脑=居中卡片+留白，不拉满铺满 ---------- */
.page-shell {
    width: 100%;
    max-width: var(--shell-max);
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ---------- 图标（内联 SVG，零额外请求） ---------- */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }

/* ---------- 顶部导航（毛玻璃，固定高度，字号可单独调） ---------- */
.topbar {
    position: sticky; top: 0; z-index: 200;
    background: rgba(255,255,255,0.78);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    height: 52px;
    padding: 0 16px;
    display: flex; align-items: center; gap: 14px;
    border-radius: inherit;
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.topbar.center { justify-content: center; }
.back-btn { color: var(--text); font-size: 1.25rem; text-decoration: none; width: 24px; line-height: 1; flex-shrink: 0; }
.topbar-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- 公告：单行滚动 ---------- */
.marquee-wrap { margin: 12px 15px 0; }
.marquee-bar {
    background: var(--card);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px 10px 14px;
    overflow: hidden;
}
.marquee-icon {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent-gradient); color: #fff; font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
}
.marquee-track { flex: 1; overflow: hidden; white-space: nowrap; position: relative; mask-image: linear-gradient(90deg, transparent, #000 12px, #000 90%, transparent); }
.marquee-content { display: inline-flex; will-change: transform; animation: marquee-scroll 18s linear infinite; }
.marquee-content span { padding-right: 60px; font-size: 0.86rem; color: var(--text); white-space: nowrap; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-bar:hover .marquee-content { animation-play-state: paused; }

/* ---------- 推荐展示位（原 class 名带 "ad-"，被部分浏览器内置广告拦截器的
   通用规则误判为广告而隐藏，已统一改名为 "promo-"） ---------- */
.promo-wrap { margin: 14px 15px 0; }
.promo-carousel { position: relative; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); background: #eee; }
/* 用 inline-block + white-space:nowrap 做横向滚动轮播，而不是 flex：
   部分浏览器内核（UC、个别国产浏览器的"省流/优化"模式等）对 flex 横向布局支持不稳定，
   会退化成纵向堆叠。inline-block 方案兼容性最好，几乎所有内核都认。 */
.promo-track { display: block; white-space: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; font-size: 0; }
.promo-track::-webkit-scrollbar { display: none; }
/* 用 padding-top 百分比占位（2.2:1 比例 = 100/2.2），兼容所有浏览器内核，
   图片还没下载完之前这块区域也不会塌陷，避免页面"跳一下" */
.promo-slide { display: inline-block; vertical-align: top; width: 100%; white-space: normal; scroll-snap-align: start; position: relative; padding-top: 45.45%; background: #eee; overflow: hidden; }
.promo-slide a, .promo-slide div.promo-noclick { position: absolute; inset: 0; display: block; }
.promo-slide img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.promo-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.promo-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.55); transition: all 0.25s; }
.promo-dots span.active { background: #fff; width: 16px; border-radius: 3px; }

/* ---------- 首页内容区 ---------- */
.content { padding: 0 15px; flex: 1; }
.category-section { margin-top: 26px; }
.category-head { text-align: center; margin-bottom: 4px; }
.category-title { font-size: 1.32rem; font-weight: 700; letter-spacing: -0.01em; }
.category-subtitle { font-size: 0.85rem; color: var(--text-2); margin-bottom: 14px; text-align: center; }

/* 固定每行 3 个应用：缩小卡片内边距与元素间距来腾出空间，
   图标 / 文字字号 / 下载按钮本身大小保持不变 */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-card {
    background: var(--card); border-radius: var(--r-md);
    padding: 14px 8px 12px;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    text-decoration: none; color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}
.app-card:active { transform: scale(0.97); }
@media (hover: hover) { .app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); } }
.app-icon {
    width: 68px; height: 68px; border-radius: 18px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; font-weight: 700;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 注意：卡片里的应用名用 .app-card-name，跟详情页大标题的 .app-name 是两个不同的类，
   之前曾经共用过同一个类名，导致首页卡片名称被详情页标题样式覆盖，这里已经拆开 */
.app-card-name { font-size: 0.95rem; font-weight: 600; }
.app-desc {
    font-size: 0.78rem; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.2em;
}
.app-btn { background: var(--blue); color: #fff; padding: 7px 26px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; margin-top: 2px; }

/* ---------- 版权声明 ---------- */
.site-footer { text-align: center; padding: 22px 24px 26px; color: var(--text-2); font-size: 0.76rem; line-height: 1.7; border-top: 1px solid var(--line); margin-top: 10px; }
.site-footer a { color: var(--text-2); text-decoration: underline; }

/* ---------- 底部导航（iOS Tab Bar，sticky 而非 fixed，始终保持在内容外壳宽度内） ---------- */
.bottom-nav {
    position: sticky; bottom: 0; margin-top: auto; z-index: 200;
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-around;
    padding: 9px 0 max(9px, env(safe-area-inset-bottom));
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-2); text-decoration: none; font-size: 0.68rem; padding: 4px 16px; }
.nav-item .icon { font-size: 1.32rem; }
.nav-item.active { color: var(--blue); }

/* ---------- 应用详情页 ---------- */
.app-header { background: var(--card); margin: 16px 15px 0; border-radius: var(--r-lg); padding: 26px 20px; text-align: center; box-shadow: var(--shadow-sm); }
.app-icon-large {
    width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 22px; overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient); color: #fff; font-size: 2.2rem; font-weight: 700;
}
.app-icon-large img { width: 100%; height: 100%; object-fit: cover; }
.app-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.invite-code { display: inline-block; background: rgba(10,132,255,0.1); color: var(--blue); padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin-bottom: 18px; }
.download-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.download-btn {
    flex: 1; min-width: 130px; background: var(--blue); color: #fff;
    padding: 13px 20px; border-radius: 999px; text-decoration: none; font-weight: 600;
    text-align: center; font-size: 0.95rem; transition: transform 0.2s;
}
.download-btn:active { transform: scale(0.97); }
.download-btn.secondary { background: #1d1d1f; }
.download-btn.buy { background: linear-gradient(135deg, #ff375f 0%, #ff9f0a 100%); }

.section { background: var(--card); margin: 14px 15px; padding: 20px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 1.04rem; font-weight: 700; margin-bottom: 12px; }
.section-title .icon { color: var(--blue); font-size: 1.05rem; }
.section-content { color: var(--text-2); line-height: 1.85; font-size: 0.93rem; }
.section-content ul { list-style: none; padding: 0; }
.section-content li { padding: 7px 0 7px 20px; position: relative; color: var(--text); }
.section-content li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background: var(--accent-gradient); border-radius: 50%; }

.screenshots-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.screenshots-scroll::-webkit-scrollbar { display: none; }
.screenshot-item { flex: 0 0 auto; scroll-snap-align: start; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; }
.screenshot-item img { height: 320px; width: auto; display: block; }

/* ---------- 常见问题页 ---------- */
.page-head { text-align: center; padding: 26px 20px 4px; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { color: var(--text-2); font-size: 0.88rem; margin-top: 6px; }
.faq-content { padding: 18px 15px 0; flex: 1; }
.faq-group { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-q { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.faq-q-icon {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
    background: var(--accent-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.78rem;
}
.faq-q-text { flex: 1; font-size: 0.96rem; font-weight: 600; }
.faq-chevron { color: #c7c7cc; transition: transform 0.25s; font-size: 0.9rem; }
.faq-item.open .faq-chevron { transform: rotate(90deg); color: var(--blue); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 18px 0 56px; }
.faq-item.open .faq-a { padding-bottom: 16px; }
.faq-a-inner { color: var(--text-2); font-size: 0.88rem; line-height: 1.85; }
.faq-a-inner a { color: var(--blue); text-decoration: none; }
.faq-empty { text-align: center; padding: 40px 20px; color: var(--text-2); }

/* ==========================================================
   响应式布局
   手机 ≤599px      ：3列，铺满屏幕
   大屏手机 ≥600px  ：4列，外壳放宽到720px
   平板 ≥900px      ：5列，外壳放宽到920px，正文区限宽760px居中（保证长文字段落不会太宽难读）
   电脑 ≥1280px     ：920px居中卡片 + 阴影留白，不再随屏幕变宽无限拉伸
   ========================================================== */

/* 小屏手机：仅覆盖跟桌面默认值不同的部分（按钮堆叠、截图变矮） */
@media (max-width: 599px) {
    .download-btns { flex-direction: column; }
    .download-btn { min-width: 100%; }
    .screenshot-item img { height: 260px; }
}

/* 大屏手机 / 小平板 */
@media (min-width: 600px) {
    .page-shell { max-width: 720px; }
    .app-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}

/* 平板竖屏到横屏（iPad / iPad Pro 等） */
@media (min-width: 900px) {
    .page-shell { max-width: 920px; }
    .app-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .section, .app-header, .faq-content { max-width: 760px; margin-left: auto; margin-right: auto; }
}

/* 真正的电脑大屏：居中卡片 + 留白阴影 */
@media (min-width: 1280px) {
    body { padding: 32px; }
    .page-shell {
        width: 920px;
        max-width: 920px;
        min-height: calc(100vh - 64px);
        border-radius: 22px;
        overflow: hidden;
        box-shadow: 0 24px 70px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
    }
    .topbar { border-radius: 22px 22px 0 0; }
}