/* ==========================================================================
   在线留言（全站浮窗 + 弹层）  zhongyancaizheng.com
   风格：白底浅灰 / 无框大气 / 移动端优先   主色沿用站点 #005ab7
   ========================================================================== */

/* ---------- 桌面端浮动入口 ---------- */
.ly-float {
    position: fixed;
    left: 20px;
    bottom: 26px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    background: #005ab7;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 90, 183, .32);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ly-float:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 90, 183, .42); }
.ly-float:active { transform: scale(.97); }

/* ---------- 遮罩 ---------- */
.ly-mask {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(17, 24, 39, .45);
}
.ly-mask.ly-open { display: flex; }
/* 无 JS 兜底：页面内 href="#lyModal" 的链接命中 :target 时同样弹出 */
.ly-mask:target { display: flex; }

/* ---------- 弹层卡片 ---------- */
.ly-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 26px 24px 22px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
    animation: lyIn .22s ease;
}
@keyframes lyIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.ly-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.ly-close:hover { background: #e5e7eb; color: #374151; }

.ly-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: .3px;
}
.ly-sub {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: #9ca3af;
}

/* ---------- 表单 ---------- */
.ly-field { margin-bottom: 12px; }

.ly-field input,
.ly-field select {
    display: block;
    width: 100%;
    height: 46px;
    box-sizing: border-box;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: #111827;
    background: #f7f8fa;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: background .18s ease, border-color .18s ease;
}
.ly-field input::placeholder { color: #b6bcc6; }
.ly-field input:focus,
.ly-field select:focus { background: #fff; border-color: #005ab7; }

.ly-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.ly-submit {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #005ab7;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    transition: opacity .18s ease;
}
.ly-submit:hover { opacity: .92; }
.ly-submit:disabled { opacity: .6; cursor: not-allowed; }

.ly-msg {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.6;
}
.ly-msg.ly-err { display: block; background: #fef2f2; color: #b91c1c; }

/* ---------- 成功态 ---------- */
.ly-ok { padding: 16px 0 8px; text-align: center; }
.ly-ok-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e9f5ee;
    color: #12a150;
    font-size: 28px;
    font-weight: 700;
}
.ly-ok h4 { margin: 0 0 6px; font-size: 18px; color: #111827; }
.ly-ok p { margin: 0; font-size: 13.5px; color: #9ca3af; }

/* ---------- 移动端 ---------- */
@media only screen and (max-width: 768px) {
    .ly-float { display: none; }          /* 移动端改用底部按钮条里的入口 */

    .ly-mask { align-items: flex-end; padding: 0; }
    .ly-card {
        max-width: none;
        border-radius: 18px 18px 0 0;
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
        animation: lyUp .24s ease;
    }
    @keyframes lyUp {
        from { transform: translateY(100%); }
        to   { transform: none; }
    }
    .ly-title { font-size: 18px; }

    /* 底部按钮条容纳第三个按钮，略微收紧间距与字号 */
    .mobile-fixed-buttons {
        gap: 8px;
        padding: 12px 14px;
    }
    .mobile-fixed-buttons .btn {
        font-size: 14px;
        gap: 4px;
        padding: 10px 0;
    }
}
