/* zitieweb 手机网页（≤980px），不修改 app.css 桌面规则 */

@media (max-width: 980px) {
    :root {
        --wap-preview-h: min(46dvh, 400px);
        --wap-dock-h: 56px;
        --wap-tabbar-h: 48px;
        --wap-sheet-radius: 16px 16px 0 0;
        --wap-safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* —— 登录页：默认手机号，隐藏微信 —— */
    html.is-wap #loginWx,
    html.is-wap #memberLoginModeSwitch {
        display: none !important;
    }
    html.is-wap.page-member-login main {
        align-items: flex-end;
        padding: 0;
        min-height: calc(100dvh - 52px);
    }
    html.is-wap .member-login-card {
        max-width: none;
        width: 100%;
        margin: 0;
        border-radius: var(--wap-sheet-radius);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
        padding: 20px 20px calc(24px + var(--wap-safe-bottom));
        min-height: 38vh;
    }

    /* —— 底部登录 Sheet（制作页等） —— */
    .wap-auth-sheet {
        position: fixed;
        inset: 0;
        z-index: 10100;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
    .wap-auth-sheet[hidden] {
        display: none !important;
    }
    .wap-sheet-mask {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
    }
    .wap-sheet-panel {
        position: relative;
        z-index: 1;
        width: 100%;
        max-height: min(72dvh, 520px);
        background: #fff;
        border-radius: var(--wap-sheet-radius);
        padding: 12px 20px calc(20px + var(--wap-safe-bottom));
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: wap-sheet-up 0.28s ease-out;
    }
    .wap-auth-sheet--tall .wap-sheet-panel {
        max-height: min(85dvh, 640px);
    }
    @keyframes wap-sheet-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .wap-sheet-grab {
        width: 36px;
        height: 4px;
        margin: 4px auto 12px;
        border-radius: 2px;
        background: #ddd;
    }
    .wap-sheet-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 50%;
        background: #f0f0f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M1 1l10 10M11 1L1 11'/%3E%3C/svg%3E") center no-repeat;
        cursor: pointer;
    }
    .wap-sheet-title {
        margin: 0 0 4px;
        font-size: 20px;
        font-weight: 600;
        text-align: center;
        color: #222;
    }
    .wap-sheet-sub {
        margin: 0 0 16px;
        font-size: 13px;
        text-align: center;
        color: #888;
        line-height: 1.4;
    }
    .wap-sheet-body label {
        display: block;
        margin: 12px 0 6px;
        font-size: 14px;
        color: #666;
    }
    .wap-sheet-body input[type="tel"],
    .wap-sheet-body input[type="password"],
    .wap-sheet-body input[type="text"] {
        width: 100%;
        box-sizing: border-box;
        height: 44px;
        padding: 0 12px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        font-size: 16px;
    }
    .wap-btn-primary {
        width: 100%;
        margin-top: 16px;
        height: 48px;
        border: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, #ff8a7a 0%, #ff6b5a 100%);
        color: #fff;
        font-size: 17px;
        font-weight: 600;
    }
    .wap-btn-ghost {
        flex-shrink: 0;
        height: 44px;
        padding: 0 12px;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        background: #fafafa;
        font-size: 13px;
    }
    .wap-sms-row {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    .wap-sms-row input {
        flex: 1;
        min-width: 0;
    }
    .wap-auth-links {
        margin: 14px 0 0;
        text-align: center;
        font-size: 14px;
        color: #888;
    }
    .wap-link {
        border: 0;
        background: none;
        color: #c41e3a;
        font-size: 14px;
        padding: 4px 8px;
        cursor: pointer;
    }
    .wap-auth-msg {
        margin: 10px 0 0;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 13px;
        line-height: 1.4;
    }
    .wap-auth-msg--error {
        background: #fff5f5;
        color: #b91c1c;
    }
    .wap-auth-msg--ok {
        background: #f0fdf4;
        color: #166534;
    }
    body.wap-sheet-open {
        overflow: hidden;
    }

    /* —— 付费墙：底部 Sheet —— */
    html.is-wap .zm-modal {
        align-items: flex-end;
        justify-content: flex-end;
        padding: 0;
    }
    html.is-wap .zm-panel.zm-panel--paywall {
        max-width: none;
        width: 100%;
        max-height: min(78dvh, 720px);
        margin: 0;
        border-radius: var(--wap-sheet-radius);
        padding: 16px 16px calc(16px + var(--wap-safe-bottom));
        animation: wap-sheet-up 0.28s ease-out;
    }
    html.is-wap .zm-plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    html.is-wap .zm-pay-btn__sub {
        font-size: 12px;
    }
}

/* —— 用户中心（html.is-wap + page-member） —— */
html.is-wap.page-member .member-main-shell {
    min-height: calc(100dvh - 52px);
}

html.is-wap.page-member .member-layout {
    flex-direction: column;
    padding: 12px 16px calc(24px + var(--wap-safe-bottom, 0px));
    gap: 12px;
}

html.is-wap.page-member .member-layout.main {
    width: auto;
    max-width: 100%;
}

html.is-wap.page-member .member-sidebar {
    position: static;
    width: 100%;
    flex: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html.is-wap.page-member .member-sidebar-user {
    margin: 0;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.12);
}

html.is-wap.page-member .member-sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.12);
}

html.is-wap.page-member .member-sidebar-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    font-size: 17px;
    border-radius: 0;
    box-sizing: border-box;
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
}

html.is-wap.page-member .member-sidebar-link:last-child {
    border-bottom: 0;
}

html.is-wap.page-member .member-sidebar-link.is-active {
    font-weight: 600;
}

html.is-wap.page-member .member-sidebar-link--muted {
    justify-content: center;
    color: #ff3b30;
    font-weight: 600;
}

html.is-wap.page-member .member-content {
    min-width: 0;
    padding: 0;
}

html.is-wap.page-member .member-page-head h1 {
    font-size: 22px;
}

html.is-wap.page-member .member-card {
    border-radius: 12px;
}

/* —— WAP 顶栏「下载应用」：跳转落地页，不用二维码浮层 —— */
html.is-wap .header-download-mobile--qr {
    display: none !important;
}

html.is-wap .header-download-mobile--link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
}

html.is-wap .site-header-download-panel {
    display: none !important;
}

/* —— WAP 首页 / 分类列表底栏下载条（制作页无） —— */
.wap-app-promo-bar {
    display: none;
}

/* body { overflow-x:hidden } 会让 iOS 上 fixed 底栏内容与页面错层，横滑裁剪放到 .site-root */
html.is-wap body.has-wap-app-promo {
    overflow-x: visible;
}

html.is-wap body.has-wap-app-promo > .site-root {
    overflow-x: hidden;
    max-width: 100%;
}

html.is-wap body.has-wap-app-promo .wap-app-promo-bar {
    display: block;
}

html.is-wap body.has-wap-app-promo main {
    padding-bottom: calc(72px + var(--wap-safe-bottom, 0px));
}

html.is-wap body.has-wap-app-promo .site-footer {
    margin-bottom: 0;
    padding-bottom: 40px;
}

.wap-app-promo-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    box-sizing: border-box;
    padding: 8px 12px calc(8px + var(--wap-safe-bottom, 0px));
    background: #fff;
    border-top: 0.5px solid rgba(60, 60, 67, 0.18);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.1);
}

.wap-app-promo-bar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    min-height: 56px;
    text-decoration: none;
    color: #111827;
    -webkit-tap-highlight-color: transparent;
}

.wap-app-promo-bar__icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.wap-app-promo-bar__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wap-app-promo-bar__title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.wap-app-promo-bar__sub {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wap-app-promo-bar__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, #ff4242, #ff7142);
    box-shadow: 0 4px 12px rgba(255, 66, 66, 0.28);
}

/* 制作页手机版样式见 wap-make-page.css（仅 /m/details* 使用） */
