/* ==========================================================================
   App 安装包下载页 —— 移动端优先，无外部依赖，离线可用
   ========================================================================== */

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1c1e21;
    --text-sub: #6b7280;
    --chip-bg: #f0f1f3;
    --android: #3ddc84;
    --android-deep: #0f9d58;
    --ios: #0a84ff;
    --ios-deep: #0066d6;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --radius-card: 20px;
    --radius-btn: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --card: #1a1d24;
        --text: #f3f4f6;
        --text-sub: #9ca3af;
        --chip-bg: #262a33;
        --shadow-card: none;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
        "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.page {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 16px calc(24px + env(safe-area-inset-bottom));
}

@media (min-width: 481px) {
    .page {
        padding-top: 56px;
    }
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 32px 24px 24px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .card {
        border: 1px solid rgba(255, 255, 255, .08);
    }
}

/* ---------- 信息区 ---------- */
.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    display: block;
    background: var(--chip-bg);
    object-fit: cover;
}

.app-name {
    margin-top: 16px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .01em;
    word-break: break-word;
}

.app-pkg {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-sub);
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 6px;
    word-break: break-all;
    cursor: pointer;
    transition: background-color 150ms ease-out;
}

.app-pkg:hover {
    background: var(--chip-bg);
}

.chips {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.chips-extra {
    margin-top: 8px;
}

.chip {
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--text-sub);
    white-space: nowrap;
}

.chip-platform-android {
    color: #0a7d47;
    background: rgba(61, 220, 132, .16);
}

.chip-platform-ios {
    color: var(--ios);
    background: rgba(10, 132, 255, .14);
}

@media (prefers-color-scheme: dark) {
    .chip-platform-android {
        color: var(--android);
    }
    .chip-platform-ios {
        color: #4da3ff;
    }
}

.sha {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-sub);
    word-break: break-all;
}

.empty {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-sub);
}

/* ---------- 下载区 ---------- */
.downloads {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dl-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 56px;
    padding: 8px 16px;
    border-radius: var(--radius-btn);
    text-decoration: none;
    color: #fff;
    transition: transform 150ms ease-out, box-shadow 150ms ease-out, opacity 150ms ease-out;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(.98);
}

.btn-android {
    background: linear-gradient(135deg, var(--android) 0%, var(--android-deep) 100%);
    color: #053b22;
}

.btn-ios {
    background: linear-gradient(135deg, var(--ios) 0%, var(--ios-deep) 100%);
}

/* 非推荐按钮弱化，推荐按钮为绝对主角 */
.btn:not(.is-recommended) {
    filter: saturate(.55);
    opacity: .88;
}

.btn.is-recommended {
    box-shadow: 0 6px 18px rgba(15, 157, 88, .28);
}

.btn-ios.is-recommended {
    box-shadow: 0 6px 18px rgba(10, 132, 255, .30);
}

.btn-label {
    font-size: 16px;
    font-weight: 600;
}

.btn-sub {
    font-size: 12px;
    opacity: .78;
}

.badge {
    position: absolute;
    top: -8px;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--android-deep);
}

.btn-ios .badge {
    background: var(--ios-deep);
}

.btn.is-disabled {
    background: var(--chip-bg);
    color: var(--text-sub);
    opacity: .45;
    cursor: not-allowed;
    filter: none;
    pointer-events: none;
}

.copy-link {
    display: none; /* 无 JS 时隐藏（渐进增强） */
    align-self: center;
    background: none;
    border: none;
    padding: 4px 10px;
    font-size: 13px;
    color: var(--text-sub);
    border-radius: 6px;
    cursor: pointer;
    transition: color 150ms ease-out, background-color 150ms ease-out;
}

html.js .copy-link {
    display: inline-block;
}

.copy-link:hover {
    color: var(--text);
    background: var(--chip-bg);
}

.copy-link.copied {
    color: #0a7d47;
}

@media (prefers-color-scheme: dark) {
    .copy-link.copied {
        color: var(--android);
    }
}

/* ---------- 底部提示 ---------- */
.tips {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--chip-bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tips p {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
}

.tips strong {
    color: var(--text);
    font-weight: 600;
}
