/* 手机端排盘结果 · 截图此案例（八字 / 紫微 / 奇门 / 六壬 / 七政） */
@media screen and (min-width: 1025px) {
    .paipan-long-screenshot-bar {
        display: none !important;
    }
}

@media screen and (max-width: 1024px) {
    .paipan-long-screenshot-bar,
    #caseDetailArea .paipan-long-screenshot-bar:not([hidden]),
    #caseDetailArea.result-mode--ziwei .paipan-long-screenshot-bar:not([hidden]),
    #qimenResultShell .paipan-long-screenshot-bar:not([hidden]),
    #liurenResultShell .paipan-long-screenshot-bar:not([hidden]),
    #qizhengResultShell .paipan-long-screenshot-bar:not([hidden]) {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        flex: 0 0 auto;
        gap: 0.35rem;
        margin: 0.85rem 0.55rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
        padding: 0.55rem 0.15rem 0.25rem;
        border-top: 1px dashed rgba(180, 152, 118, 0.35);
        box-sizing: border-box;
        width: auto;
        max-width: none;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 2;
    }

    .paipan-long-screenshot-bar[hidden] {
        display: none !important;
    }

    /* 覆盖全局 .secondary-btn 的 max-width / 过大字号 */
    .paipan-long-screenshot-btn,
    .paipan-long-screenshot-btn.secondary-btn {
        width: 100% !important;
        max-width: none !important;
        min-height: 2.35rem !important;
        height: auto !important;
        padding: 0.45rem 0.85rem !important;
        border-radius: 12px !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.01em;
        line-height: 1.25 !important;
        white-space: normal !important;
    }

    .paipan-long-screenshot-btn:disabled {
        opacity: 0.72;
    }

    .paipan-long-screenshot-hint {
        margin: 0;
        font-size: 0.68rem;
        line-height: 1.45;
        color: #7a7064;
        text-align: center;
    }
}

.paipan-long-screenshot-preview {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: flex;
    flex-direction: column;
    background: rgba(18, 14, 10, 0.92);
    padding: calc(0.65rem + env(safe-area-inset-top)) 0.55rem calc(0.75rem + env(safe-area-inset-bottom));
}

.paipan-long-screenshot-preview[hidden] {
    display: none !important;
}

.paipan-long-screenshot-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    color: #f5efe4;
    flex-shrink: 0;
}

.paipan-long-screenshot-preview__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.paipan-long-screenshot-preview__close {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.paipan-long-screenshot-preview__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    background: #f7f0e4;
}

.paipan-long-screenshot-preview__img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-touch-callout: default;
    user-select: auto;
    -webkit-user-select: auto;
    touch-action: manipulation;
}

.paipan-long-screenshot-preview__img.is-save-hint {
    outline: 3px solid #e8b86a;
    outline-offset: 2px;
}

.paipan-long-screenshot-preview__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.55rem;
    margin-top: 0.55rem;
    flex-shrink: 0;
}

.paipan-long-screenshot-preview__save,
.paipan-long-screenshot-preview__copy {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.55rem;
    border-radius: 12px;
    font-size: 0.88rem !important;
    font-weight: 600;
    line-height: 1.25 !important;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

.paipan-long-screenshot-preview__toast {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 3;
    max-width: min(86vw, 18rem);
    padding: 0.7rem 1.15rem;
    border-radius: 12px;
    background: rgba(32, 24, 16, 0.92);
    color: #fff8ee;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.paipan-long-screenshot-preview__toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}