/* 众享达商家助手 · iOS 安装页（外卖跑腿风格） */

:root {
    --brand: #ff5a1f;
    --brand-2: #ff8a00;
    --brand-deep: #e9440a;
    --brand-soft: #fff2ea;
    --accent: #ffd35c;
    --bg: #fff9f4;
    --card: #ffffff;
    --ink: #221a14;
    --ink-2: #5b5148;
    --muted: #9a8f83;
    --line: #ffe7d8;
    --radius: 20px;
    --shadow: 0 8px 28px rgba(255, 90, 31, 0.09);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #171310;
        --card: #211b17;
        --ink: #f6efe8;
        --ink-2: #d8ccc2;
        --muted: #9c8f84;
        --line: #332821;
        --brand-soft: #2a1d14;
        --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    min-height: 100vh;
}

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 14px calc(24px + env(safe-area-inset-bottom));
}

/* ==================== Hero ==================== */

.hero {
    position: relative;
    margin: 0 -14px;
    padding: calc(16px + env(safe-area-inset-top)) 20px 22px;
    color: #fff;
    background: linear-gradient(155deg, #ffa02e 0%, #ff6a1f 46%, #ef420b 100%);
    border-radius: 0 0 32px 32px;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(140px 140px at 88% 6%, rgba(255, 255, 255, 0.3), transparent 68%),
        repeating-linear-gradient(-38deg, rgba(255, 255, 255, 0.055) 0 9px, transparent 9px 27px);
}

.hero-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b6ff7a;
    box-shadow: 0 0 0 3px rgba(182, 255, 122, 0.22);
}

.hero-ver {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.92;
    font-variant-numeric: tabular-nums;
}

.hero-main {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.app-icon {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(140, 45, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.35);
}

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

.app-icon-fallback {
    font-size: 34px;
    font-weight: 800;
    color: var(--brand-deep);
}

.hero-text {
    min-width: 0;
}

.app-name {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.app-slogan {
    margin: 4px 0 10px;
    font-size: 12.5px;
    opacity: 0.86;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 2px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.hero-cta {
    position: relative;
    text-align: center;
}

.btn-install {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffe27a 0%, #ffc93c 100%);
    color: #4a2c00;
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(110, 38, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.btn-install:active {
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(110, 38, 0, 0.26);
}

.btn-install::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 38%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-18deg);
    animation: shine 3.6s ease-in-out infinite;
}

@keyframes shine {
    0%, 52% { left: -60%; }
    100% { left: 132%; }
}

.btn-install.is-disabled {
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.btn-install.is-disabled::after {
    display: none;
}

.btn-install.is-disabled:active {
    transform: none;
}

.btn-install.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.btn-small {
    height: 44px;
    font-size: 15px;
    border-radius: 22px;
    max-width: 200px;
    margin: 0 auto;
}

.hero-tip {
    margin: 10px 0 0;
    font-size: 11.5px;
    opacity: 0.8;
    letter-spacing: 0.2px;
}

.hero-enroll {
    display: inline-block;
    margin-top: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.5);
    padding-bottom: 1px;
}

.hero-enroll:active {
    opacity: 0.8;
}

.enroll-desc {
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-2);
}

.hero-foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.foot-item {
    flex: 1;
    text-align: center;
    font-size: 10.5px;
    opacity: 0.8;
    line-height: 1.5;
}

.foot-item b {
    display: block;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.98;
    font-variant-numeric: tabular-nums;
}

.foot-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== Cards ==================== */

.content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 17px 17px 18px;
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.card-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.card-head h2::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(180deg, #ff9a2e, #ff4d0d);
}

.card-sub {
    font-size: 11.5px;
    color: var(--muted);
}

.tag-new {
    padding: 2px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff8a00, #ff4d0d);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.notes {
    font-size: 13.5px;
    color: var(--ink-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.force-tip {
    margin: 12px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: #fff0ec;
    color: #d93c1f;
    font-size: 12.5px;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .force-tip {
        background: #3a1c13;
        color: #ff9170;
    }
}

/* ==================== 安装步骤（路线） ==================== */

.route {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
}

.route li {
    position: relative;
    padding-left: 42px;
    padding-bottom: 18px;
}

.route li:last-child {
    padding-bottom: 0;
}

.route li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: 2px;
    border-left: 2px dashed #ffcdb2;
}

@media (prefers-color-scheme: dark) {
    .route li:not(:last-child)::before {
        border-color: #5a3a28;
    }
}

.route-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff8a00, #ff4d0d);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(255, 90, 31, 0.32);
}

.route-body b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.route-body p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.65;
}

/* ==================== 版本列表 ==================== */

.versions {
    margin: 0 -3px;
}

.ver {
    border-top: 1px solid var(--line);
}

.ver:first-child {
    border-top: 0;
}

.ver summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 3px;
    cursor: pointer;
    list-style: none;
    font-size: 13.5px;
}

.ver summary::-webkit-details-marker {
    display: none;
}

.ver-no {
    font-weight: 800;
    font-size: 14.5px;
    font-variant-numeric: tabular-nums;
}

.tag {
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
}

.tag-force {
    background: #ffe9e5;
    color: #d93c1f;
}

@media (prefers-color-scheme: dark) {
    .tag-force {
        background: #3a1c13;
        color: #ff9170;
    }
}

.ver-grow {
    flex: 1;
}

.ver-meta {
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.chev {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #ff9d73;
    border-bottom: 1.5px solid #ff9d73;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
    margin-left: 3px;
}

.ver[open] .chev {
    transform: rotate(-135deg) translateY(-2px);
}

.ver-body {
    padding: 0 3px 14px;
}

.ver-notes {
    font-size: 12.5px;
    color: var(--ink-2);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

.ver-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 通用按钮 ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.2s ease;
}

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

.btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

.btn-ghost {
    background: var(--brand-soft);
    color: var(--brand-deep);
    box-shadow: inset 0 0 0 1px #ffcdb2;
}

.btn-ghost:active {
    background: #ffe6d8;
}

@media (prefers-color-scheme: dark) {
    .btn-ghost {
        color: #ffa17c;
        box-shadow: inset 0 0 0 1px #5a3a28;
    }
    .btn-ghost:active {
        background: #33231a;
    }
}

.btn-text {
    background: transparent;
    color: var(--muted);
    padding: 0 6px;
}

.is-disabled {
    background: rgba(154, 143, 131, 0.14);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}

.is-disabled:active {
    transform: none;
}

/* ==================== 帮助 ==================== */

.facts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.facts li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    font-size: 12.5px;
    border-bottom: 1px dashed var(--line);
}

.facts li:last-child {
    border-bottom: 0;
}

.facts span {
    color: var(--muted);
    flex: 0 0 auto;
}

.facts code,
.facts a {
    color: var(--ink-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    word-break: break-all;
    text-align: right;
    text-decoration: none;
}

/* ==================== 页脚 ==================== */

.footer {
    margin-top: 22px;
    text-align: center;
    font-size: 11.5px;
    color: var(--muted);
}

.footer p {
    margin: 0;
}

/* ==================== Toast ==================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(30px + env(safe-area-inset-bottom));
    transform: translate(-50%, 14px);
    max-width: 80vw;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(34, 26, 20, 0.92);
    color: #fff;
    font-size: 13px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 90;
    backdrop-filter: blur(6px);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ==================== 微信遮罩 ==================== */

.wx-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 6, 0.78);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(3px);
}

.wx-mask[hidden] {
    display: none;
}

.wx-box {
    position: relative;
    width: 100%;
    max-width: 300px;
    background: #fff;
    color: #221a14;
    border-radius: 18px;
    padding: 22px 20px 20px;
    text-align: center;
}

.wx-arrow {
    position: absolute;
    top: -48px;
    right: 10px;
    font-size: 38px;
    color: #ffd35c;
    transform: rotate(-8deg);
}

.wx-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
}

.wx-desc {
    margin: 0 0 18px;
    font-size: 13px;
    color: #6b5f54;
    line-height: 1.7;
}

/* ==================== 动效 ==================== */

@media (prefers-reduced-motion: no-preference) {
    .hero-main,
    .hero-cta,
    .hero-foot {
        animation: rise 0.45s ease both;
    }
    .hero-cta {
        animation-delay: 0.05s;
    }
    .hero-foot {
        animation-delay: 0.1s;
    }
    .content > .card {
        animation: rise 0.5s ease both;
    }
    .content > .card:nth-child(2) {
        animation-delay: 0.04s;
    }
    .content > .card:nth-child(3) {
        animation-delay: 0.08s;
    }
    .content > .card:nth-child(4) {
        animation-delay: 0.12s;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-install::after {
        animation: none;
    }
}

/* ==================== 设备登记 ==================== */

.hero-back {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.hero-back:active {
    background: rgba(255, 255, 255, 0.26);
}

.enroll-hero {
    padding-bottom: 24px;
}

.enroll-intro h1 {
    position: relative;
    margin: 6px 0 8px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.enroll-intro p {
    position: relative;
    margin: 0;
    max-width: 320px;
    font-size: 12.5px;
    line-height: 1.7;
    opacity: 0.86;
}

.enroll-status-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.18);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.status-pill.tone-ok {
    background: #1fa855;
    border-color: #1fa855;
    box-shadow: 0 4px 12px rgba(31, 168, 85, 0.35);
}

.status-pill.tone-err {
    background: #e23c22;
    border-color: #e23c22;
    box-shadow: 0 4px 12px rgba(226, 60, 34, 0.3);
}

.status-pill.tone-busy {
    background: rgba(255, 255, 255, 0.26);
}

.enroll-queue {
    font-size: 11px;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

.enroll-alert {
    padding: 10px 13px;
    border-radius: 12px;
    background: #fff0ec;
    border: 1px solid #ffd3c8;
    color: #d93c1f;
    font-size: 12.5px;
    line-height: 1.65;
}

@media (prefers-color-scheme: dark) {
    .enroll-alert {
        background: #3a1c13;
        border-color: #5a2a1c;
        color: #ff9170;
    }
}

.enroll-steps {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
}

.enroll-step {
    position: relative;
    padding-left: 42px;
    padding-bottom: 20px;
}

.enroll-step:last-child {
    padding-bottom: 0;
}

.enroll-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: 2px;
    border-left: 2px dashed var(--line);
}

.enroll-step .route-dot {
    background: #efe8e2;
    color: #9a8f83;
    box-shadow: none;
}

@media (prefers-color-scheme: dark) {
    .enroll-step .route-dot {
        background: #332821;
        color: #9c8f84;
    }
}

.enroll-step.is-active .route-dot {
    background: linear-gradient(180deg, #ff8a00, #ff4d0d);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.14);
}

.enroll-step.is-done .route-dot {
    background: linear-gradient(180deg, #3ecb74, #1fa855);
    color: #fff;
    box-shadow: 0 4px 10px rgba(31, 168, 85, 0.26);
}

.enroll-step.is-error .route-dot {
    background: linear-gradient(180deg, #ff6b5a, #e23c22);
    color: #fff;
    box-shadow: 0 4px 10px rgba(226, 60, 34, 0.24);
}

.enroll-step .route-body b {
    font-size: 14px;
}

.enroll-step .route-body p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.65;
}

.enroll-step .btn {
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(180deg, #ff8a00, #ff4d0d);
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 90, 31, 0.28);
}

.btn-primary:active {
    box-shadow: 0 3px 10px rgba(255, 90, 31, 0.24);
}

.install-slot {
    max-width: 230px;
    margin-top: 12px;
}

.install-slot .btn-install {
    height: 44px;
    font-size: 14px;
    letter-spacing: 0.6px;
    border-radius: 22px;
}

.enroll-help {
    white-space: normal;
}

.enroll-help p {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.7;
    white-space: normal;
}

.enroll-help p:last-child {
    margin-bottom: 0;
}

.enroll-step .btn-text {
    height: auto;
    margin-top: 8px;
    padding: 0;
    font-size: 12px;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.enroll-help b {
    color: var(--ink);
    font-weight: 700;
}


/* ==================== 证书安装（Ad Hoc） ==================== */

.adhoc-note {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.65;
    color: var(--muted);
}

#adhoc .ver-actions {
    flex-wrap: wrap;
    margin-top: 14px;
}
