Files
NianxxWEB/public/privacy-policy.html
2026-06-26 11:48:35 +08:00

138 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>隐私协议 - AI数字员工</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; color: #1d1d1f; background: #f5f5f7; }
header, footer { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
header { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 600; color: #0070c9; }
nav a { margin-left: 16px; color: #6e6e73; text-decoration: none; }
nav a:hover { color: #0070c9; }
main { max-width: 960px; margin: 32px auto; background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
h1 { font-size: 28px; margin-bottom: 8px; }
.meta { color: #6e6e73; margin-bottom: 24px; }
h2 { font-size: 20px; margin-top: 24px; }
p, li { line-height: 1.7; color: #333; }
ul { padding-left: 18px; }
footer { margin-top: 40px; padding: 16px 24px; text-align: center; }
.links a { color: #0070c9; text-decoration: none; }
.links a:hover { text-decoration: underline; }
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<header>
<div class="brand"><i class="fas fa-robot"></i> AI数字员工</div>
<nav>
<a href="index.html">首页</a>
<a href="service-agreement.html">服务协议</a>
<a href="privacy-policy.html">隐私协议</a>
</nav>
</header>
<main>
<h1>隐私协议</h1>
<div id="policy-content">
正在加载隐私协议内容...
</div>
</main>
<footer>
<div class="links">
<a href="service-agreement.html">服务协议</a> ·
<a href="privacy-policy.html">隐私协议</a> ·
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer">黔ICP备2025054767号</a>
</div>
<div>&copy; 2025 AI数字员工</div>
</footer>
</body>
</html>
<script>
// 轻量级 Markdown 语法移除与HTML渲染不依赖外部CDN
function mdToHtml(md) {
md = md.replace(/\r/g, '');
const lines = md.split('\n');
let html = '';
let inUl = false, inOl = false, inPre = false;
function escapeHtml(str){
return str.replace(/[&<>"']/g, s => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[s]));
}
function inline(text){
let t = text;
// 图片 -> 仅保留替代文本
t = t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '$1');
// 链接 -> 转为 <a>
t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener">$1</a>');
// 粗体/斜体/行内code -> 去除包裹符号
t = t.replace(/\*\*([^*]+)\*\*/g, '$1').replace(/__([^_]+)__/g, '$1');
t = t.replace(/\*([^*]+)\*/g, '$1').replace(/_([^_]+)_/g, '$1');
t = t.replace(/`([^`]+)`/g, '$1');
return t;
}
for (let i = 0; i < lines.length; i++) {
let line = lines[i];
// 代码块
if (line.trim().startsWith('```')) {
if (inPre) { html += '</code></pre>'; inPre = false; }
else { html += '<pre><code>'; inPre = true; }
continue;
}
if (inPre) { html += escapeHtml(line) + '\n'; continue; }
// 标题
if (/^#{1,6}\s+/.test(line)) {
const level = (line.match(/^#{1,6}/)[0]).length;
const content = line.replace(/^#{1,6}\s+/, '');
html += `<h${level}>${inline(content)}</h${level}>`;
continue;
}
// 引用
if (/^\s*>\s*/.test(line)) {
const content = line.replace(/^\s*>\s*/, '');
html += `<blockquote>${inline(content)}</blockquote>`;
continue;
}
// 水平分割线
if (/^\s*---+\s*$/.test(line)) { html += '<hr>'; continue; }
// 无序列表
if (/^\s*[-*+]\s+/.test(line)) {
if (!inUl) { if (inOl) { html += '</ol>'; inOl = false; } html += '<ul>'; inUl = true; }
const content = line.replace(/^\s*[-*+]\s+/, '');
html += `<li>${inline(content)}</li>`;
continue;
}
// 有序列表
if (/^\s*\d+\.\s+/.test(line)) {
if (!inOl) { if (inUl) { html += '</ul>'; inUl = false; } html += '<ol>'; inOl = true; }
const content = line.replace(/^\s*\d+\.\s+/, '');
html += `<li>${inline(content)}</li>`;
continue;
}
if (inUl) { html += '</ul>'; inUl = false; }
if (inOl) { html += '</ol>'; inOl = false; }
// 普通段落
if (line.trim() === '') { html += ''; }
else { html += `<p>${inline(line)}</p>`; }
}
if (inUl) html += '</ul>';
if (inOl) html += '</ol>';
if (inPre) html += '</code></pre>';
return html;
}
// 加载并渲染隐私协议.txt
fetch('隐私协议.txt')
.then(function(res){ if(!res.ok) throw new Error('无法加载隐私协议.txt'); return res.text(); })
.then(function(md){ document.getElementById('policy-content').innerHTML = mdToHtml(md); })
.catch(function(err){ document.getElementById('policy-content').textContent = '加载隐私协议内容失败:' + err.message; });
</script>
</html>