/**
 * 章节阅读页反扒样式（小说 + 漫画通用）。
 *
 * 配套脚本：assets/js/anti-piracy.js（由 inc/assets.php 在章节单页入队）。
 *
 * 作用域严格限定在 `body.nf-protected` 下的章节正文 / 漫画图区域，
 * 避免对页面其他区域（标题 / 评论 / 导航）的合法选中、拖拽、长按造成误伤。
 */

/* ========== 1. 受保护区域禁止文本选中 ========== */
body.nf-protected .novel-frame-chapter-content,
body.nf-protected .novel-frame-comic-images,
body.nf-protected .novel-frame-comic-page {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 移动端 Safari / Chrome：长按弹出系统菜单（复制 / 保存图片） */
    -webkit-touch-callout: none;
}

/* ========== 2. 漫画图片禁止拖拽 / 长按保存 ========== */
body.nf-protected .novel-frame-comic-images img,
body.nf-protected .novel-frame-comic-page img {
    -webkit-user-drag: none;
    /* pointer-events 关闭后，浏览器右键 / 长按菜单都不会出现；
       漫画阅读不依赖图片点击交互（翻页通过滚动），关闭无副作用 */
    pointer-events: none;
}

/* ========== 3. DevTools 检测命中：模糊正文 + 浮层警告 ========== */
body.nf-devtools-open .novel-frame-chapter-content,
body.nf-devtools-open .novel-frame-comic-images,
body.nf-devtools-open .novel-frame-comic-page {
    /* 不用 display:none，避免触发布局抖动；模糊保留 DOM 结构便于关闭后恢复 */
    filter: blur(20px);
    pointer-events: none;
    transition: filter .3s ease;
}

body.nf-devtools-open::after {
    content: '检测到调试工具，请关闭后刷新页面继续阅读。';
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    color: #fff;
    background: rgba(0, 0, 0, .85);
    /* 浮层本身允许点击（关闭 DevTools 后用户需要点击空白处或刷新） */
    pointer-events: auto;
}

/* 暗色模式下浮层背景再加深一点 */
body.dark-theme.nf-devtools-open::after {
    background: rgba(0, 0, 0, .92);
}
