/* ============================================================
   BNT Modal Form + Inline Message + Fallback Toast
   ============================================================ */

body.bnt-modal-lock { overflow: hidden; }

/* ---------- 弹窗外壳 ---------- */
.bnt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bnt-modal.is-open { display: flex; }

.bnt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 31, 68, 0.78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.bnt-modal-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: bntModalIn 0.25s ease-out;
}

@keyframes bntModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.bnt-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    background: #f0f2f6;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #0a1f44;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.bnt-modal-close:hover { background: #e0e4ea; }

.bnt-modal-body { padding: 36px 32px 32px; }

.bnt-modal-body h3 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0a1f44;
    margin: 0 0 8px;
    line-height: 1.25;
}

.bnt-modal-body > p {
    font-size: 0.95rem;
    color: #5a6273;
    line-height: 1.6;
    margin: 0 0 22px;
}

/* ---------- 弹窗表单 ---------- */
.bnt-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.bnt-modal-field { margin-bottom: 14px; }

.bnt-modal-form input,
.bnt-modal-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0a1f44;
    background: #f5f7fa;
    border: 1px solid #dde2ea;
    border-radius: 6px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.bnt-modal-form input:focus,
.bnt-modal-form textarea:focus {
    border-color: #f39c12;
    background: #ffffff;
}
.bnt-modal-form input::placeholder,
.bnt-modal-form textarea::placeholder { color: #9aa3b2; }

.bnt-modal-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.bnt-modal-submit {
    width: 100%;
    margin-top: 4px;
}
.bnt-modal-note {
    font-size: 0.8rem;
    color: #9aa3b2;
    text-align: center;
    margin: 12px 0 0;
}

/* ---------- 内联提示（表单标题下方） ---------- */
.bnt-form-msg {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 18px;
}
.bnt-form-msg-success {
    background: #e8f7ef;
    color: #1f7a4d;
    border: 1px solid #b7e4cd;
}
.bnt-form-msg-error {
    background: #fdecea;
    color: #9c2f24;
    border: 1px solid #f5c1ba;
}

/* 深色背景表单上的提示（专题页 contact 区） */
.bnt-mil-contact .bnt-form-msg-success { background: rgba(31,156,108,0.15); color: #6fdfab; border-color: rgba(31,156,108,0.4); }
.bnt-mil-contact .bnt-form-msg-error   { background: rgba(192,57,43,0.15);  color: #ff9e91; border-color: rgba(192,57,43,0.4); }

/* ---------- 降级 Toast（仅在传统提交后短暂出现） ---------- */
.bnt-form-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    animation: bntToastIn 0.3s ease-out;
}
.bnt-form-toast-success { background: #1f9c6c; }
.bnt-form-toast-error   { background: #c0392b; }

@keyframes bntToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);     }
}

/* ---------- 侧边栏图片可点击 ---------- */
.bnt-details-sidebar img,
.bnt-cat-image img,
.bnt-cat-placeholder-img,
.bnt-placeholder-img {
    cursor: pointer;
    transition: opacity 0.2s;
}
.bnt-details-sidebar img:hover,
.bnt-cat-image img:hover,
.bnt-cat-placeholder-img:hover,
.bnt-placeholder-img:hover { opacity: 0.88; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .bnt-modal-body  { padding: 28px 20px 24px; }
    .bnt-modal-row   { grid-template-columns: 1fr; }
    .bnt-modal-body h3 { font-size: 1.3rem; }
    .bnt-modal-close { top: 8px; right: 8px; }
}

/* ============================================================
   弹窗提交按钮：显式背景色，不依赖页面级 CSS 变量
   解决 About / Contact / 首页 / 文章页等非 solution 页面上
   按钮因 --bnt-sol-accent 未定义而变成白底白字的问题
   ============================================================ */
.bnt-modal-form .bnt-modal-submit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #ffffff;
    border: none;
}
.bnt-modal-form .bnt-modal-submit:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #ffffff;
}
.bnt-modal-form .bnt-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}