<!doctype html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<link rel="canonical" href="{{ .Permalink }}">
<meta name="keywords" content="{{ .Site.Params.keywords }}">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="{{ "rss.xml" | absURL }}">
<link rel="icon" type="image/x-icon" href="{{ "favicon.ico" | absURL }}">
<link rel="preconnect" href="https://cravatar.cn">
<link rel="dns-prefetch" href="https://bsz.dusays.com:9001">
<script>(function(){try{var e=localStorage.getItem("theme");e||(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?e="dark":e="light"),document.documentElement.setAttribute("data-theme",e),window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(e){if(!localStorage.getItem("theme")){var t=e.matches?"dark":"light";document.documentElement.setAttribute("data-theme",t)}})}catch{}})()</script>
<link rel="preload" href="{{ "font/zql-v2-subset.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
<script>
window.optionalAssetUrls={echarts:"{{ "js/libs/echarts.min.js" | absURL }}",artalk:"{{ "js/libs/Artalk.min.js" | absURL }}"};
window.loadScriptOnce=window.loadScriptOnce||function(e,t,n){if(t&&window[t]){n();return}var s,o=document.querySelector('script[data-dynamic-src="'+e+'"]');if(o){o.addEventListener("load",n,{once:!0});return}s=document.createElement("script"),s.src=e,s.defer=!0,s.dataset.dynamicSrc=e,s.onload=n,document.head.appendChild(s)};
window.siteConfig={artalk:{server:"{{ .Site.Params.artalkServer }}",site:"{{ .Site.Title }}",emoticons:"{{ "emotion/OwO.json" | absURL }}",gravatar:"https://cravatar.cn/avatar/"},author:{avatar:"{{ .Site.Params.avatar }}",description:"{{ .Site.Params.bio }}"},barrage:{enableHitokoto:!0,hitokotoUrl:"https://v1.hitokoto.cn?c=a&c=b&c=c&c=d&c=i"}};
</script>
<link rel="stylesheet" href="{{ "css/style.min.css" | absURL }}">
<style>body{background-image:url({{ "image/background/deno.webp" | absURL }})!important;background-size:contain!important;background-repeat:round!important;background-position:50%!important;background-attachment:fixed!important}[data-theme=dark] body{background-image:url({{ "image/background/deno.webp" | absURL }})!important}[data-theme=dark] body::before{content:''!important;position:fixed!important;top:0!important;left:0!important;width:100%!important;height:100%!important;background-color:rgba(0,0,0,.4)!important;pointer-events:none!important;z-index:-1!important}@media(max-width:768px){body{background-attachment:scroll!important}}.code-expand-btn:hover span{color:#24292e!important}[data-theme=dark] .code-expand-btn:hover span{color:#f8f8f2!important}.highlight pre code,.highlight pre{color:#24292e!important}[data-theme=dark] .highlight pre code,[data-theme=dark] .highlight pre{color:#f8f8f2!important}blockquote::before{display:none!important}blockquote{border-left:4px solid rgba(0,0,0,.2)!important;font-style:normal!important}[data-theme=dark] blockquote{border-left-color:rgba(255,255,255,.2)!important}.post-content img{cursor:zoom-in}.post-tags{display:none!important}.post-content{content-visibility:auto;contain-intrinsic-size:auto 800px}.toc-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.28);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s,visibility .3s;display:flex;align-items:center;justify-content:center}.toc-overlay.show{opacity:1;visibility:visible;pointer-events:auto}.toc-overlay-content{background:rgba(255,255,255,.92);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(0,0,0,.06);border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.15);width:86%;max-width:420px;max-height:70vh;display:flex;flex-direction:column;transform:translateY(20px) scale(.96);transition:transform .3s cubic-bezier(.22,.61,.36,1)}.toc-overlay.show .toc-overlay-content{transform:translateY(0) scale(1)}[data-theme=dark] .toc-overlay-content{background:rgba(30,33,40,.94);border-color:rgba(255,255,255,.08);box-shadow:0 20px 60px rgba(0,0,0,.4)}.toc-overlay-header{display:flex;justify-content:space-between;align-items:center;padding:18px 20px 12px;border-bottom:1px solid rgba(0,0,0,.06)}[data-theme=dark] .toc-overlay-header{border-bottom-color:rgba(255,255,255,.06)}.toc-overlay-header h3{margin:0;font-size:1.1rem;color:#333}[data-theme=dark] .toc-overlay-header h3{color:#e5e7eb}.toc-close{font-size:24px;cursor:pointer;color:#999;font-weight:700}.toc-close:hover{color:#333}[data-theme=dark] .toc-close:hover{color:#fff}.toc-overlay-body{padding:12px 8px 18px;overflow-y:auto;max-height:calc(70vh - 60px)}.toc-overlay-body a:hover{background:rgba(0,0,0,.05)!important}[data-theme=dark] .toc-overlay-body a:hover{background:rgba(255,255,255,.08)!important}</style>
<script src="{{ "js/instantpage.min.js" | absURL }}" type="module" defer></script>
<meta name="template" content="Amigo">
{{ block "head" . }}{{ end }}
</head>
<body>
<script>window.barrageConfig={enableHitokoto:!0,hitokotoUrl:"https://v1.hitokoto.cn?c=a&c=b&c=c&c=d&c=i",hitokotoAvatar:"{{ .Site.Params.avatar }}"}</script>
<div class=barrager></div>
<script defer src="{{ "js/modules/barrage.min.js" | absURL }}"></script>
<div class="main"><div class="container">
<div class="header"><div class="header-top"><div class="header-avatar load-memos-editor" id="theme-toggle-avatar"><img src="{{ .Site.Params.avatar }}" class="blog-img" width="80" height="80" alt="{{ .Site.Title }}" decoding="async" fetchpriority="high"><div class="avatar-theme-tip">点击头像切换昼夜</div></div><div class="header-info"><div class="header-social">
{{- range .Site.Menus.social -}}
<a href="{{ .URL }}" title="{{ .Name }}" target="_blank"><i class="{{ .Identifier }}"></i></a>
{{- end -}}
</div><div class="header-bio">{{ .Site.Params.bio }}</div></div></div>
<nav class="header-menu"><ul class="flat">
{{- range .Site.Menus.main -}}
<li class="active"><a href="{{ .URL }}">{{ .Name }}</a></li>
{{- end -}}
</ul></nav></div>
<div id="pjax-wrapper" style="position:relative;min-height:50vh"><div id="pjax-container">
{{ block "main" . }}{{ end }}
</div></div>
<div class="footer"><nav class="nav" style="clear:both">&copy; {{ .Site.Params.startYear }} - 2026<br><a href="https://beian.miit.gov.cn/" target="_blank"><span style="color:#999">{{ .Site.Params.icp }}</span></a><br>{{ .Site.Params.cdn | safeHTML }}</nav></div>
</div></div>
<div class="floating-tools">
<a href="javascript:;" id="search-btn" title="搜索文章"><i class="ri-search-line"></i></a>
<a href="javascript:;" id="theme-toggle" title="切换主题"><i class="ri-sun-line"></i></a>
<a href="javascript:;" id="toc-btn" title="文章目录"><i class="ri-list-check"></i></a>
<a href="#Comments" id="to-comments" title="跳转评论"><i class="ri-chat-2-line"></i></a>
<a href="#" id="back-to-top" title="返回顶部"><i class="ri-arrow-up-line"></i></a>
</div>
<div id="toc-overlay" class="toc-overlay">
<div class="toc-overlay-content">
<div class="toc-overlay-header">
<h3>文章目录</h3>
<span class="toc-close" onclick="document.getElementById('toc-overlay').classList.remove('show')">&times;</span>
</div>
<div class="toc-overlay-body" id="toc-body"></div>
</div>
</div>
<div id="search-modal" class="search-modal"><div class="search-modal-content"><div class="search-header"><h3>搜索文章</h3><span class="close-search">&#215;</span></div><div class="search-body"><div class="search-input-wrapper"><input type="text" id="search-input" placeholder="输入关键词搜索..." autocomplete="off"><button id="search-submit"><i class="ri-search-line"></i></button></div><div id="search-results" class="search-results"><p class="search-tip">输入关键词并回车进行搜索</p></div></div></div></div>
<script defer src="{{ "js/core.min.js" | absURL }}"></script>
<script>
document.addEventListener("click",function(e){var n=e.target.closest(".search-result-item");if(!n)return;var h=n.getAttribute("data-href");if(!h)return;e.preventDefault();e.stopPropagation();try{window.pjax&&window.pjax.abortRequest&&window.pjax.abortRequest()}catch(x){}window.location.href=h},{capture:true});
document.addEventListener("click",function(e){if(!e.target.closest("#toc-btn"))return;var o=document.getElementById("toc-overlay"),b=document.getElementById("toc-body");if(!o||!b)return;var hs=document.querySelectorAll(".post-content h2,.post-content h3,.post-content h4");if(!hs.length){b.innerHTML="<p style='color:#999;text-align:center'>本文没有目录</p>";o.classList.add("show");return}var h="";hs.forEach(function(el){var lv=parseInt(el.tagName.charAt(1)),ind=(lv-2)*20,id=el.id||el.textContent.trim().replace(/\s+/g,"-");if(!el.id)el.id=id;h+='<a href="#'+id+'" style="display:block;padding:8px 14px;margin-left:'+ind+'px;font-size:'+(16-lv)+'px;color:inherit;text-decoration:none;border-radius:6px;line-height:1.6" onclick="document.getElementById(\'toc-overlay\').classList.remove(\'show\')">'+el.textContent+"</a>"});b.innerHTML=h;o.classList.add("show")});
document.addEventListener("click",function(e){if(e.target.id==="toc-overlay")e.target.classList.remove("show")});
document.addEventListener("mouseup",function(e){if(!e.target.closest(".amigo-music-card__seek"))return;var a=AudioManager&&AudioManager._getAudio&&AudioManager._getAudio();if(a&&a.paused&&a.currentTime>0)setTimeout(function(){a.play().catch(function(){})},50)});
document.addEventListener("pjax:complete",function(){if(typeof initVoiceBubbles==="function")initVoiceBubbles();if(typeof initMusicCards==="function")initMusicCards();lazyLoadImages()});
function lazyLoadImages(){document.querySelectorAll(".post-content img:not([loading])").forEach(function(img){img.loading="lazy"})}
if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",lazyLoadImages);else lazyLoadImages();
</script>
<script>window.enableInfiniteScroll=false</script>
<script>window.friendLinks={hosts:[],names:[]}</script>
<script>window.friendFeeds={hosts:[],names:[]}</script>
<script>window._pageOnlyScriptUrl="{{ "js/page-only.min.js" | absURL }}"</script>
<script>"requestIdleCallback"in window?requestIdleCallback(function(){var e=document.createElement("script");e.src="{{ "js/deferred.min.js" | absURL }}",e.defer=!0,document.body.appendChild(e)}):setTimeout(function(){var e=document.createElement("script");e.src="{{ "js/deferred.min.js" | absURL }}",e.defer=!0,document.body.appendChild(e)},1e3)</script>
{{ block "scripts" . }}{{ end }}
</body></html>
