/* 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;
    }
    /* page-member* 在 body 上（layout.php），不要写成 html.is-wap.page-member* */
    html.is-wap body.page-member-login main {
        align-items: flex-end;
        padding: 0;
        min-height: calc(100dvh - 52px - 100px);
        background: var(--paper);
    }
    html.is-wap body.page-member-login .member-login-scene {
        align-items: flex-end;
        width: 100%;
        padding: 0;
    }
    html.is-wap body.page-member-login .member-login-bg__tile {
        font-size: 0.85rem;
        max-width: 9em;
        color: rgba(55, 70, 95, 0.16);
    }
    html.is-wap body.page-member-login .member-login-bg__tile--4,
    html.is-wap body.page-member-login .member-login-bg__tile--5,
    html.is-wap body.page-member-login .member-login-bg__tile--6,
    html.is-wap body.page-member-login .member-login-bg__tile--8 {
        display: none;
    }
    html.is-wap body.page-member-login .member-login-card {
        max-width: none;
        width: 100%;
        margin: 0;
        border-radius: var(--wap-sheet-radius);
        box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.1);
        padding: 36px 22px calc(28px + var(--wap-safe-bottom));
        min-height: 42vh;
        border: none;
    }
    html.is-wap body.page-member-login .member-login-close {
        display: block;
    }
    html.is-wap body.page-member-login .site-footer {
        display: none;
    }

    /* —— 底部登录 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;
        cursor: pointer;
    }
    .ct-auth-sheet-panel {
        position: relative;
        padding-top: 8px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .ct-auth-sheet-panel .site-dialog-close.wap-sheet-close {
        top: 10px;
        right: 10px;
        background: #f0f0f0;
    }
    .ct-auth-sheet-body .ct-auth-stack {
        width: 100%;
        max-width: min(400px, 100%);
        margin: 0 auto;
        box-sizing: border-box;
    }
    .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,
    html.is-wap .zm-panel.zm-panel--paywall--stripe {
        max-width: none;
        width: 100%;
        max-height: none;
        margin: 0;
        border-radius: var(--wap-sheet-radius);
        padding: 12px 14px calc(12px + var(--wap-safe-bottom));
        overflow: visible;
        animation: wap-sheet-up 0.28s ease-out;
        box-sizing: border-box;
    }
    html.is-wap .zm-panel--paywall .zm-title {
        margin: 0 0 2px;
        font-size: 18px;
        line-height: 1.25;
        text-align: center;
    }
    html.is-wap .zm-panel--paywall .zm-sub,
    html.is-wap .zm-panel--paywall--stripe .zm-sub {
        margin: 0 0 10px;
        font-size: 12px;
        line-height: 1.35;
        color: #888;
        text-align: center;
    }
    html.is-wap .zm-paywall-tabbar {
        margin-bottom: 10px;
    }
    html.is-wap .zm-plan-grid,
    html.is-wap .zm-panel--paywall--stripe .zm-plan-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }
    html.is-wap .zm-plan-card,
    html.is-wap .zm-panel--paywall--stripe .zm-plan-card {
        gap: 2px;
        padding: 14px 6px 10px;
        border-width: 1.5px;
        border-radius: 10px;
        min-width: 0;
    }
    html.is-wap .zm-plan-badge {
        right: 4px;
        padding: 2px 5px;
        font-size: 9px;
        border-radius: 0 0 6px 6px;
        max-width: calc(100% - 8px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    html.is-wap .zm-plan-card-title {
        margin-top: 2px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
    }
    html.is-wap .zm-plan-card-price {
        font-size: 11px;
        line-height: 1.2;
    }
    html.is-wap .zm-plan-card-price strong {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }
    html.is-wap .zm-plan-card-desc,
    html.is-wap .zm-panel--paywall--stripe .zm-plan-card-desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        min-height: 0;
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.3;
        color: #999;
    }
    html.is-wap .zm-pay-cta-hint,
    html.is-wap .zm-panel--paywall--stripe .zm-pay-cta-hint {
        margin: 0 0 8px;
        padding: 0;
        font-size: 11px;
        line-height: 1.35;
        color: #888;
    }
    html.is-wap .zm-pay-actions .zm-pay-btn--stripe {
        padding: 12px 14px;
        border-radius: 10px;
    }
    html.is-wap .zm-pay-actions .zm-pay-btn__label {
        font-size: 15px;
    }
    html.is-wap .zm-pay-btn__sub {
        font-size: 11px;
    }
    html.is-wap .zm-stripe-trust {
        gap: 6px 8px;
        font-size: 11px;
    }
    html.is-wap .zm-stripe-trust .zm-stripe-wordmark {
        height: 14px;
    }
    html.is-wap .zm-panel--paywall--stripe .zm-foot,
    html.is-wap .zm-panel--paywall .zm-foot {
        margin-top: 10px;
        padding-top: 8px;
        font-size: 12px;
    }
    html.is-wap .zm-panel .site-dialog-close.zm-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        z-index: 5;
    }
}

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

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

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

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

html.is-wap body.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 body.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 body.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 body.page-member .member-sidebar-link:last-child {
    border-bottom: 0;
}

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

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

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

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

html.is-wap body.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 首页 / 分类列表底栏下载条（制作页无） ——
 * 默认隐藏见 app.css（勿只写在本文件：本文件受 max-width:980px 限制）
 */
/* 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 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);
}

/* —— 首页 / 分类列表：字帖卡片等高，CTA 底对齐 —— */
html.is-wap .cover-grid {
    align-items: stretch;
}

html.is-wap .cover-grid > li {
    display: flex;
    min-width: 0;
}

html.is-wap .cover-card {
    flex: 1;
    width: 100%;
    min-height: 100%;
    align-items: center;
    box-sizing: border-box;
}

html.is-wap .cover-card .cover-frame {
    flex-shrink: 0;
}

html.is-wap .cover-card strong {
    flex: 1 1 auto;
    width: 100%;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    /* 统一占两行高度，避免 1 行标题把按钮顶得过高 */
    min-height: calc(2 * 1.35em);
}

html.is-wap .cover-card em {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 16px;
    font-size: 15px;
}

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