/* ==========================================================
   Global Styles
   ========================================================== */
:root {
    --c-bg: #f5f5f7;
    --c-card: #ffffff;
    --c-text: #1d1d1f;
    --c-sub: #6e6e73;
    --c-link: #0071e3;
    --c-link-dark: #0058b0;
    --c-line: rgba(0,0,0,0.06);
    --sh-sm: 0 2px 14px rgba(0,0,0,0.05);
    --sh-md: 0 10px 28px rgba(0,0,0,0.09);
    --rd-lg: 24px;
    --rd-md: 18px;
    --rd-sm: 12px;
    --gr-accent: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    --w-max: 100%;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'SF',  -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "微软雅黑", sans-serif;
    background: #ececf1;
    color: var(--c-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

.wrapper {
    width: 100%;
    max-width: var(--w-max);
    margin: 0 auto;
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }

/* Header */
.header {
    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(--c-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;
}
.header.center { justify-content: center; }
.btn-back { color: var(--c-text); font-size: 1.25rem; text-decoration: none; width: 24px; line-height: 1; flex-shrink: 0; }
.header-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

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

/* Banner */
.banner-wrap { margin: 14px 15px 0; }
.banner-box { position: relative; border-radius: var(--rd-md); overflow: hidden; box-shadow: var(--sh-sm); background: #eee; }
.banner-track { display: block; white-space: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; font-size: 0; }
.banner-track::-webkit-scrollbar { display: none; }
.banner-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; }
.banner-slide a, .banner-slide .banner-img { position: absolute; inset: 0; display: block; }
.banner-slide img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.banner-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.55); transition: all 0.25s; }
.banner-dots span.active { background: #fff; width: 16px; border-radius: 3px; }

/* Main content */
.main { padding: 0 15px; flex: 1; }
.group { margin-top: 26px; }
.group-head { text-align: center; margin-bottom: 4px; }
.group-title { font-size: 1.32rem; font-weight: 700; letter-spacing: -0.01em; }
.group-sub { font-size: 0.85rem; color: var(--c-sub); margin-bottom: 14px; text-align: center; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card {
    background: var(--c-card); border-radius: var(--rd-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(--sh-sm);
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}
.card:active { transform: scale(0.97); }
@media (hover: hover) { .card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); } }
.card-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;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-name { font-size: 0.95rem; font-weight: 600; }
.card-desc {
    font-size: 0.78rem; color: var(--c-sub);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.2em;
}
.card-btn { background: var(--c-link); color: #fff; padding: 7px 26px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; margin-top: 2px; }

/* Footer */
.footer {
    text-align: center;
    padding: 22px 18px 26px;
    color: #9b9ba1;
    border-top: 1px solid var(--c-line);
    margin-top: 10px;
}
.footer-main {
    color: #8f8f96;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}
.footer-copy {
    margin-top: 8px;
    color: #b7b7bd;
    font-size: 0.78rem;
    line-height: 1.6;
}
.footer a { color: #9b9ba1; text-decoration: underline; }

/* Tab bar */
.tab-bar {
    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(--c-line);
    display: flex; justify-content: space-around;
    padding: 9px 0 max(9px, env(safe-area-inset-bottom));
}
.tab-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--c-sub); text-decoration: none; font-size: 0.68rem; padding: 4px 16px; }
.tab-item .ico { font-size: 1.32rem; }
.tab-item.active { color: var(--c-link); }

/* Detail hero */
.hero { background: var(--c-card); margin: 16px 15px 0; border-radius: var(--rd-lg); padding: 26px 20px; text-align: center; box-shadow: var(--sh-sm); }
.hero-icon {
    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(--gr-accent); color: #fff; font-size: 2.2rem; font-weight: 700;
}
.hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.code-badge { display: inline-block; background: rgba(10,132,255,0.1); color: var(--c-link); padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; margin-bottom: 18px; }
.btn-group { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-dl {
    flex: 1; min-width: 130px; background: var(--c-link); 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;
}
.btn-dl:active { transform: scale(0.97); }
.btn-dl.sub { background: #1d1d1f; }
.btn-dl.buy { background: linear-gradient(135deg, #ff375f 0%, #ff9f0a 100%); }

/* Content blocks */
.block { background: var(--c-card); margin: 14px 15px; padding: 20px; border-radius: var(--rd-md); box-shadow: var(--sh-sm); }
.block-title { display: flex; align-items: center; gap: 9px; font-size: 1.04rem; font-weight: 700; margin-bottom: 12px; }
.block-title .ico { color: var(--c-link); font-size: 1.05rem; }
.block-text { color: var(--c-sub); line-height: 1.85; font-size: 0.93rem; }
.block-text ul { list-style: none; padding: 0; }
.block-text li { padding: 7px 0 7px 20px; position: relative; color: var(--c-text); }
.block-text li::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background: var(--gr-accent); border-radius: 50%; }

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

/* FAQ page */
.headline { text-align: center; padding: 26px 20px 4px; }
.headline h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.headline p { color: var(--c-sub); font-size: 0.88rem; margin-top: 6px; }
.help-body { padding: 18px 15px 0; flex: 1; }
.help-list { background: var(--c-card); border-radius: var(--rd-md); box-shadow: var(--sh-sm); overflow: hidden; }
.help-item { border-bottom: 1px solid var(--c-line); }
.help-item:last-child { border-bottom: none; }
.help-q { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.help-q-icon {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
    background: var(--gr-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.78rem;
}
.help-q-text { flex: 1; font-size: 0.96rem; font-weight: 600; }
.help-arrow { color: #c7c7cc; transition: transform 0.25s; font-size: 0.9rem; }
.help-item.open .help-arrow { transform: rotate(90deg); color: var(--c-link); }
.help-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 18px 0 56px; }
.help-item.open .help-a { padding-bottom: 16px; }
.help-a-text { color: var(--c-sub); font-size: 0.88rem; line-height: 1.85; }
.help-a-text a { color: var(--c-link); text-decoration: none; }
.help-empty { text-align: center; padding: 40px 20px; color: var(--c-sub); }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 599px) {
    .btn-group { flex-direction: column; }
    .btn-dl { min-width: 100%; }
    .gallery-item img { height: 260px; }
}

@media (min-width: 600px) {
    .wrapper { max-width: 720px; }
    .card-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}

@media (min-width: 900px) {
    .wrapper { max-width: 920px; }
    .card-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .block, .hero, .help-body { max-width: 760px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 1280px) {
    body { padding: 32px; }
    .wrapper {
        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);
    }
    .header { border-radius: 22px 22px 0 0; }
}
