/* 内容保护样式 */

/* 禁用文本选择 */
.protected-content {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 允许输入框选择 */
.protected-content input,
.protected-content textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* 水印样式 - 温和的视觉保护 */
#content-watermark {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    background-repeat: repeat !important;
    opacity: 0.03 !important; /* 降低透明度，更温和 */
    font-size: 14px !important;
    color: #6b7280 !important;
    line-height: 120px !important;
    background-size: 300px 120px !important;
    user-select: none !important;
}

/* 打印保护 */
@media print {
    body * {
        visibility: hidden !important;
    }
    
    body::before {
        content: "此内容受版权保护，禁止打印" !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 24px !important;
        font-weight: bold !important;
        color: #000 !important;
        visibility: visible !important;
        z-index: 10000 !important;
    }
}

/* 防止通过CSS显示隐藏内容 */
.course-content {
    position: relative;
}

.course-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

/* 温和的防拷贝警告弹窗 */
.copy-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f59e0b; /* 改为橙色，更温和 */
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10001;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); /* 减少阴影强度 */
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 温和的模糊效果（当检测到录屏时） */
.blur-content {
    filter: blur(3px) !important; /* 降低模糊强度 */
    transition: filter 0.3s ease !important;
}

/* 隐藏滚动条（防止截图时看到完整内容） */
.course-viewer::-webkit-scrollbar {
    width: 6px;
}

.course-viewer::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.course-viewer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.course-viewer::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 防止图片另存为 */
.course-content img {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none !important;
}

/* 代码块保护 */
.course-content pre,
.course-content code {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    position: relative;
}

.course-content pre::before,
.course-content code::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

/* 开发者工具检测提示 */
.devtools-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    font-size: 18px;
    font-weight: 500;
}

.devtools-warning-content {
    text-align: center;
    padding: 2rem;
}

.devtools-warning h2 {
    font-size: 24px;
    margin-bottom: 1rem;
    color: #ef4444;
}

.devtools-warning p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

/* 防止F12快捷键提示 */
.shortcut-blocked {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10001;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}