/**
 * 网站轻应用 · 前端样式
 *
 * 安装按钮 / 提示 toast / iOS 指引弹层。
 * 类名统一带 site-app- 前缀，避免和主题样式打架。
 */

#site-app-btn.site-app-btn {
    position: fixed;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    background: #375ca5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* 入场动画由 JS 加 class 触发 */
#site-app-btn.site-app-btn.site-app-btn-in {
    animation: site-app-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes site-app-pop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

#site-app-btn.site-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

#site-app-btn.site-app-btn:active {
    transform: translateY(0) scale(0.97);
}

/* 图标（用小箭头装饰，CSS 实现） */
#site-app-btn.site-app-btn::before {
    content: '';
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-mask: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMiAzdjEyIi8+PHBhdGggZD0ibTggOSA0IDQgNC00Ii8+PHBhdGggZD0iTTQgMjBoMTYiLz48L3N2Zz4=) center / contain no-repeat;
    mask: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0xMiAzdjEyIi8+PHBhdGggZD0ibTggOSA0IDQgNC00Ii8+PHBhdGggZD0iTTQgMjBoMTYiLz48L3N2Zz4=) center / contain no-repeat;
}

/* toast */
.site-app-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%) translateY(12px);
    z-index: 99999;
    max-width: 86%;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(30, 34, 40, 0.92);
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.site-app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* iOS 指引弹层 */
.site-app-mask {
    position: fixed;
    inset: 0;
    z-index: 99995;
    background: rgba(20, 24, 32, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 18px 28px;
    animation: site-app-fade 0.2s ease;
}

@keyframes site-app-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.site-app-ios-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    animation: site-app-rise 0.26s cubic-bezier(0.34, 1.4, 0.64, 1);
    color: #1f2430;
}

@keyframes site-app-rise {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.site-app-ios-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #8a94a6;
    cursor: pointer;
}

.site-app-ios-tit {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.site-app-ios-step {
    font-size: 14px;
    color: #4a5568;
    margin: 6px 0;
    line-height: 1.6;
}

.site-app-ios-call {
    margin: 10px 0 6px;
    padding: 10px;
    border-radius: 8px;
    background: #f2f6fd;
    text-align: center;
    font-size: 15px;
    color: #375ca5;
}

.site-app-ios-tip {
    font-size: 12px;
    color: #8a94a6;
    margin-top: 10px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    #site-app-btn.site-app-btn { font-size: 13px; padding: 9px 14px; }
}
