/* 博客阅读权限 · 前台样式 */

.bgv-paid-hint {
    margin: 0 0 18px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #9bbffd;
    border-radius: 8px;
    color: #224b92;
    font-size: 13px;
    line-height: 1.6;
}

.bgv-lock {
    margin: 22px 0;
    padding: 36px 24px;
    border: 1px dashed #dbe1f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 70%);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bgv-lock-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #eef1fd;
    color: #5b74f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgv-lock-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.bgv-lock-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 16px;
}

.bgv-lock-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bgv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    border: 1px solid #dfe3ec;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 34px;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.bgv-btn:hover {
    border-color: #4e6ef2;
    color: #4e6ef2;
}

.bgv-btn-primary {
    background: #4e6ef2;
    border-color: #4e6ef2;
    color: #fff;
}

.bgv-btn-primary:hover {
    background: #3f5dde;
    border-color: #3f5dde;
    color: #fff;
}

.bgv-btn[disabled] {
    opacity: .7;
    cursor: default;
}

/* 易支付渠道按钮：白底描边，和站内余额主按钮区分开 */
.bgv-btn-epay {
    border-color: #c9d6f5;
    color: #2456c8;
    background: #f7f9ff;
}

.bgv-btn-epay:hover {
    border-color: #4e6ef2;
    background: #eef3ff;
    color: #2456c8;
}

.bgv-pwd-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.bgv-pwd-input {
    width: 200px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dfe3ec;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.bgv-pwd-input:focus {
    border-color: #4e6ef2;
    box-shadow: 0 0 0 2px rgba(78, 110, 242, .12);
}

.bgv-balance {
    font-size: 12px;
    color: #9aa3b2;
}

.bgv-teaser {
    text-align: left;
    font-size: 14px;
    line-height: 1.9;
    color: #374151;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e6eaf3;
    position: relative;
    max-height: 96px;
    overflow: hidden;
}

.bgv-teaser::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}

.bgv-toast {
    position: fixed;
    left: 50%;
    top: 24px;
    transform: translate(-50%, -12px);
    background: #2f3542;
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    opacity: 0;
    transition: all .25s;
    z-index: 99999;
}

.bgv-toast-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.bgv-toast-ok {
    background: #16a34a;
}

@media (max-width: 640px) {
    .bgv-lock {
        padding: 26px 16px;
    }
    .bgv-lock-actions {
        flex-direction: column;
        gap: 12px;
    }
    .bgv-btn {
        width: 100%;
    }
    .bgv-pwd-row {
        flex-direction: column;
    }
    .bgv-pwd-input {
        width: 100%;
    }
}

/* ---------------- 行内隐藏（隐藏选中的几个字） ---------------- */

.bgv-lock.bgv-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    margin: 0 2px;
    border: 1px dashed #d5dae3;
    border-radius: 4px;
    background: #f6f7fa;
    color: #6b7280;
    font-size: 13px;
    line-height: 22px;
    vertical-align: baseline;
    box-shadow: none;
    max-width: 100%;
}

.bgv-lock.bgv-inline:hover {
    border-color: #4e6ef2;
    background: #f3f6ff;
    color: #3358e0;
}

.bgv-inline-icon {
    font-size: 12px;
    opacity: .85;
}

.bgv-inline-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.bgv-inline-count {
    font-size: 11px;
    color: #9aa3af;
    white-space: nowrap;
}

.bgv-inline-act {
    border: none;
    background: none;
    padding: 0 2px;
    margin: 0;
    color: #3358e0;
    font-size: 13px;
    line-height: 22px;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid rgba(51, 88, 224, .35);
}

.bgv-inline-act:hover {
    color: #1f3fc0;
    border-bottom-color: #1f3fc0;
}

.bgv-inline-note {
    font-size: 12px;
    color: #9aa3af;
}

.bgv-inline-pwd[hidden] {
    display: none !important;
}

.bgv-inline-pwd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bgv-inline-pwd .bgv-pwd-input {
    width: 96px;
    height: 22px;
    line-height: 22px;
    padding: 0 6px;
    font-size: 12px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    background: #fff;
}

@media (max-width: 640px) {
    .bgv-inline-text { max-width: 130px; }
}

/* 评论区解锁提示 */
.bgv-comment-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f5f8ff;
    border: 1px solid #e3ebff;
    color: #3358e0;
    font-size: 13px;
    line-height: 1.6;
}
.bgv-comment-hint b { color: #1f4bd8; }

/* 手机端：行内标记更紧凑，长标签允许换行，不撑破排版 */
@media (max-width: 640px) {
    .bgv-inline {
        padding: 1px 6px;
        font-size: 12px;
        gap: 4px;
        flex-wrap: wrap;
    }
    .bgv-inline-count { font-size: 10px; }
    .bgv-inline-act { font-size: 12px; }
}

/* 免费试读 */
.bgv-trial {
    margin: 12px 0 4px;
    padding: 0 2px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.9;
    position: relative;
}
.bgv-trial::after {
    content: '';
    display: block;
    height: 18px;
    margin-top: -18px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff);
    position: relative;
}

/* 已有 N 人解锁（社交证明） */
.bgv-lock-proof {
    margin-top: 8px;
    font-size: 12px;
    color: #9aa3af;
}

/* ===== 支付选择悬浮窗（付费解锁） ===== */
body.bgv-paymodal-lock { overflow: hidden; }

.bgv-paymodal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.bgv-paymodal[hidden] { display: none !important; }

.bgv-paymodal-mask {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.bgv-paymodal-dialog {
    position: relative;
    width: min(420px, 100%);
    max-height: min(88vh, 640px);
    overflow-y: auto;
    box-sizing: border-box;
    border-radius: 20px;
    background: #fff;
    color: #111827;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
    animation: bgvPayIn .22s cubic-bezier(.22, 1, .36, 1);
    -webkit-overflow-scrolling: touch;
}
@keyframes bgvPayIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bgv-paymodal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 14px;
    background: linear-gradient(180deg, #f1f5ff, rgba(255, 255, 255, 0));
    border-radius: 20px 20px 0 0;
}
.bgv-paymodal-heading { flex: 1; min-width: 0; }
.bgv-paymodal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}
.bgv-paymodal-sub {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
}
.bgv-paymodal-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin: -2px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
}
.bgv-paymodal-close:hover { background: #f3f4f6; color: #374151; }

.bgv-paymodal-amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 2px 20px 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7f9ff;
    border: 1px solid #e3ebff;
    color: #6b7280;
    font-size: 13px;
}
.bgv-paymodal-amount b {
    font-size: 24px;
    font-weight: 700;
    color: #1f4bd8;
    line-height: 1;
}

.bgv-paymodal-opts {
    display: grid;
    gap: 10px;
    padding: 0 20px 4px;
}
.bgv-paymodal .bgv-payopt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 3px 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 13px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.bgv-paymodal .bgv-payopt:hover {
    border-color: #4e6ef2;
    background: #f7f9ff;
}
.bgv-paymodal .bgv-payopt-primary {
    border-color: #c9d6f5;
    background: #f7f9ff;
}
.bgv-paymodal .bgv-payopt-primary:hover {
    border-color: #4e6ef2;
    background: #eef3ff;
}
.bgv-payopt-name {
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    color: #111827;
}
.bgv-payopt-price {
    grid-column: 2;
    grid-row: 1;
    font-weight: 700;
    color: #1f4bd8;
    white-space: nowrap;
}
.bgv-payopt-note {
    grid-column: 1 / 3;
    grid-row: 2;
    font-size: 12px;
    color: #6b7280;
}
.bgv-paymodal .bgv-payopt-primary .bgv-payopt-note { color: #4e6ef2; }

.bgv-paymodal-foot {
    padding: 14px 20px 18px;
    font-size: 11px;
    line-height: 1.6;
    color: #9ca3af;
    text-align: center;
}

@media (max-width: 560px) {
    .bgv-paymodal {
        align-items: flex-end;
        padding: 0;
    }
    .bgv-paymodal-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        animation: bgvPayUp .26s cubic-bezier(.22, 1, .36, 1);
    }
    .bgv-paymodal-opts { padding: 0 16px 4px; }
    .bgv-paymodal-head { padding: 18px 16px 14px; }
    .bgv-paymodal-amount { margin: 2px 16px 14px; }
    .bgv-paymodal-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
}
@keyframes bgvPayUp {
    from { opacity: .6; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 部分隐藏：保留前 N 段正文，其余进锁定卡片 */
.bgv-partial {
    text-align: left;
    margin: 0 0 6px;
    padding: 0 2px;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
}
.bgv-partial p { margin: 0 0 12px; }
.bgv-partial h2, .bgv-partial h3 { margin: 14px 0 8px; color: #111827; }
.bgv-partial img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 10px auto; }
.bgv-partial blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
}
.bgv-partial ul, .bgv-partial ol { padding-left: 22px; margin: 0 0 12px; }
.bgv-partial-fade {
    height: 56px;
    margin: -56px 0 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 78%);
    pointer-events: none;
}
@media (max-width: 640px) {
    .bgv-partial { font-size: 15px; line-height: 1.85; }
    .bgv-partial-fade { height: 44px; margin-top: -44px; }
}

/* 部分隐藏：锁卡顶部试读说明 */
.bgv-trial-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
}
