<!DOCTYPE html><html lang="zh" data-theme="dark"><head><meta charset="utf-8"><meta name="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><title>奶茶店毕业 · Cytrogen 的个人博客</title><meta name="description" content="早在 第一篇月刊 里,我就说过去年八月份我找了份兼职,主要是得快速还笔钱。这一做就是半年,而在二月份我提了离职、逃跑了。"><link rel="icon" href="../favicon.png"><link rel="canonical" href="https://blog.cytrogen.icu/posts/7ae3.html"><link rel="webmention" href="https://webmention.io/blog.cytrogen.icu/webmention"><link rel="me" href="https://gts.cytrogen.icu/@Cytrogen"><link rel="me" href="mailto:blog@cytrogen.icu"><meta name="fediverse:creator" content="@Cytrogen@gts.cytrogen.icu"><link rel="preload" href="../fonts/opensans-regular-latin.woff2" as="font" type="font/woff2" crossorigin="anonymous"><style>@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans-regular-latin.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
size-adjust: 107%;
ascent-override: 97%;
descent-override: 25%;
line-gap-override: 0%;
}
</style><script>(function() {
try {
// 优先级:用户选择 > 系统偏好 > 默认浅色
const saved = localStorage.getItem('theme');
const theme = saved ||
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
document.documentElement.style.colorScheme = theme;
} catch (error) {
// 失败时使用默认主题,不阻塞渲染
document.documentElement.setAttribute('data-theme', 'light');
}
})();
</script><link rel="stylesheet" href="../css/ares.css"><script data-netlify-skip-bundle="true">(function() {
document.addEventListener('DOMContentLoaded', function() {
const theme = document.documentElement.getAttribute('data-theme');
const pageWrapper = document.getElementById('page-wrapper');
if (pageWrapper && theme) {
pageWrapper.setAttribute('data-theme', theme);
}
});
})();
</script><!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 8.1.1"><link rel="alternate" href="atom.xml" title="Cytrogen 的个人博客" type="application/atom+xml">
</head><body><div id="page-wrapper"><a class="skip-link" href="#main-content">跳到主要内容</a><div class="wrap"><header><a class="logo-link" href="../index.html"><img src="../favicon.png" alt="logo"></a><div class="h-card visually-hidden"><img class="u-photo" src="https://blog.cytrogen.icu/favicon.png" alt="Cytrogen"><a class="p-name u-url u-uid" href="https://blog.cytrogen.icu">Cytrogen</a><p class="p-note">Cytrogen 的个人博客,Cytrogen's Blog</p><a class="u-url" rel="me noopener" target="_blank" href="https://gts.cytrogen.icu/@Cytrogen">Mastodon</a></div><nav class="site-nav"><div class="nav-main"><div class="nav-primary"><ul class="nav-list hidden-mobile"><li class="nav-item"><a class="nav-link" href="../index.html">首页</a></li></ul><div class="nav-tools"><div class="language-menu"><button class="language-toggle" type="button"><svg class="icon icon-globe" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 1.855A7.97 7.97 0 0 0 5.145 4H7.5V1.077zM4.09 4a9.267 9.267 0 0 1 .64-1.539 6.7 6.7 0 0 1 .597-.933A7.025 7.025 0 0 0 2.255 4H4.09zm-.582 3.5c.03-.877.138-1.718.312-2.5H1.674a6.958 6.958 0 0 0-.656 2.5h2.49zM4.847 5a12.5 12.5 0 0 0-.338 2.5H7.5V5H4.847zM8.5 5v2.5h2.99a12.495 12.495 0 0 0-.337-2.5H8.5zM4.51 8.5a12.5 12.5 0 0 0 .337 2.5H7.5V8.5H4.51zm3.99 0V11h2.653c.187-.765.306-1.608.338-2.5H8.5zM5.145 12c.138.386.295.744.468 1.068.552 1.035 1.218 1.65 1.887 1.855V12H5.145zm.182 2.472a6.696 6.696 0 0 1-.597-.933A9.268 9.268 0 0 1 4.09 12H2.255a7.024 7.024 0 0 0 3.072 2.472zM3.82 11a13.652 13.652 0 0 1-.312-2.5h-2.49c.062.89.291 1.733.656 2.5H3.82zm6.853 3.472A7.024 7.024 0 0 0 13.745 12H11.91a9.27 9.27 0 0 1-.64 1.539 6.688 6.688 0 0 1-.597.933zM8.5 12v2.923c.67-.204 1.335-.82 1.887-1.855A7.97 7.97 0 0 0 10.855 12H8.5zm3.68-1h2.146c.365-.767.594-1.61.656-2.5h-2.49a13.65 13.65 0 0 1-.312 2.5zm2.802-3.5a6.959 6.959 0 0 0-.656-2.5H12.18c.174.782.282 1.623.312 2.5h2.49zM11.27 2.461c.247.464.462.98.64 1.539h1.835a7.024 7.024 0 0 0-3.072-2.472c.218.284.418.598.597.933zM10.855 4a7.966 7.966 0 0 0-.468-1.068C9.835 1.897 9.17 1.282 8.5 1.077V4h2.355z"></path></svg><span>中文</span></button><div class="language-dropdown"></div></div></div><div class="nav-controls"><div class="more-menu hidden-mobile"><button class="more-toggle" type="button"><span>更多</span><svg class="icon icon-chevron-down" width="12" height="12" viewBox="0 0 12 12" fill="currentColor" aria-hidden="true" focusable="false"><path d="M6 8.825c-.2 0-.4-.1-.5-.2l-3.3-3.3c-.3-.3-.3-.8 0-1.1s.8-.3 1.1 0l2.7 2.7 2.7-2.7c.3-.3.8-.3 1.1 0s.3.8 0 1.1l-3.3 3.3c-.1.1-.3.2-.5.2z"></path></svg></button><div class="more-dropdown"><ul class="dropdown-list"><li class="dropdown-item"><a class="nav-link" href="../archives/index.html">归档</a></li><li class="dropdown-item"><a class="nav-link" href="../categories/index.html">分类</a></li><li class="dropdown-item"><a class="nav-link" href="../tags/index.html">标签</a></li><li class="dropdown-item"><a class="nav-link" href="../about/index.html">关于</a></li><li class="dropdown-item"><a class="nav-link" href="../sitemap/index.html">领地地图</a></li></ul></div></div><div class="theme-switcher"><button class="theme-toggle" type="button" role="switch" aria-pressed="false" aria-label="切换主题"><div class="theme-icon moon-icon"><svg class="icon icon-moon" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false"><path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"></path></svg></div><div class="theme-icon sun-icon"><svg class="icon icon-sun" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false"><path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"></path></svg></div></button></div><details class="mobile-menu-details hidden-desktop"><summary class="hamburger-menu" aria-label="nav.menu"><svg class="icon icon-bars" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false"><path d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path></svg><span class="menu-text">nav.menu</span></summary><div class="mobile-menu-dropdown"><ul class="mobile-nav-list"><li class="mobile-nav-item"><a class="mobile-nav-link" href="../index.html">首页</a></li><li class="mobile-nav-item"><a class="mobile-nav-link" href="../archives/index.html">归档</a></li><li class="mobile-nav-item"><a class="mobile-nav-link" href="../categories/index.html">分类</a></li><li class="mobile-nav-item"><a class="mobile-nav-link" href="../tags/index.html">标签</a></li><li class="mobile-nav-item"><a class="mobile-nav-link" href="../about/index.html">关于</a></li><li class="mobile-nav-item"><a class="mobile-nav-link" href="../sitemap/index.html">领地地图</a></li></ul></div></details></div></div></div></nav></header><main class="container" id="main-content" tabindex="-1"><div class="post"><article class="post-block h-entry"><div class="post-meta p-author h-card visually-hidden"><img class="author-avatar u-photo" src="../favicon.png" alt="Cytrogen"><span class="p-name">Cytrogen</span><a class="u-url" href="https://blog.cytrogen.icu">https://blog.cytrogen.icu</a></div><a class="post-permalink u-url u-uid visually-hidden" href="https://blog.cytrogen.icu/posts/7ae3.html">永久链接</a><div class="p-summary visually-hidden"><p>早在 <a href="/posts/dc84.html">第一篇月刊</a> 里,我就说过去年八月份我找了份兼职,主要是得快速还笔钱。这一做就是半年,而在二月份我提了离职、逃跑了。</p></div><div class="visually-hidden"><a class="p-category" href="../categories/%E6%97%A5%E5%B8%B8%E7%94%9F%E6%B4%BB/">日常生活</a></div><a class="u-syndication visually-hidden" target="_blank" rel="noopener" href="https://m.otter.homes/@Cytrogen/116229993921254103">https://m.otter.homes/@Cytrogen/116229993921254103</a><h1 class="post-title p-name">奶茶店毕业</h1><div class="post-info"><time class="post-date dt-published" datetime="2026-03-14T04:00:00.000Z">3/14/2026</time><time class="dt-updated visually-hidden" datetime="2026-03-14T22:56:03.574Z"></time></div><div class="post-content e-content"><html><head></head><body><p>早在 <a href="/posts/dc84.html">第一篇月刊</a> 里,我就说过去年八月份我找了份兼职,主要是得快速还笔钱。这一做就是半年,而在二月份我提了离职、逃跑了。</p>
<span id="more"></span>
<p>先从最开始说起吧。当时我的银行账户已经支撑不起我日常的吃喝拉撒了。就算是和室友合租,有父母给的几百块生活费,不欠钱活下去依然很难。不得已,我只能将开发项目的时间分出来,花费在打工上 —— 那会儿连公司都没有被注册,项目跟个人项目没有什么区别,更别说赚钱了。</p>
<p>粉领工作虽然赚得不多,但胜在成本低,不需要培训很久就能上岗工作。尤其是我在大一时就做过奶茶店的兼职,去新的店里工作学习很快。于是我在网上找各个招人的店,一个个联系过去 —— 有些人无视了我,有些人问了我点问题后就不回我了… 最后只有家附近的一家本地知名奶茶品牌的店同意让我来培训。</p>
<p>因为隐私还是得要的,这个奶茶品牌是什么我就不说了。</p>
<p>奶茶店的员工要做的事情并不算多:做前台收银、摇奶茶、补货、开店闭店,如果店里提供小吃的话做小吃 —— 这种小吃多数以甜品或者炸物为多,我去的这家店没有甜品,只有炸物,做起来也方便,丢到油锅里炸即可。</p>
<p>经济情况从某一年开始,从来都没有好转过。Trump 第二次竞选的时候,就有大量认为民主党搞坏了经济的老白人上网支持 Trump,认为他可以让美国的经济再度伟大。实际上,什么也没有变。说到底,一个联邦的总统怎么可能一下子就改善整个经济体系呢?人们是住在地方内的,地方有自己的官,地方外的州也有自己的官。人们总是将希望寄托于一个人,听信政客们的承诺,最后只能活在比过去更痛苦的生活中。但也没有办法,除了相信这些系统的明面指定人,还能去相信谁呢?</p>
<p>在蜜雪冰城来到纽约之前,奶茶大致可以分成两种:没有品牌的,和有品牌的。没有品牌的奶茶,估计只有三四美元吧,通常都是广东饼店用粉冲泡的,成本本来就很低,味道只能说能喝就行。而有品牌的,价格会高一些,目前来看市场价得在六七块钱之间,只说最经典的珍珠奶茶。这里有一些用的依然是粉,只是粉质量更高,虽然我喝的话只能喝出来恶心的粉味儿,和没有品牌的奶茶没什么太大的区别。如果是标榜自己用真奶的品牌,价格还得高一些,我喝了不会觉得肚子痛,但为了钱包和身体健康还是少喝为妙。</p>
<p>奶茶店除了奶茶,卖的东西还有水果茶:多数都是使用果酱或者水果风味的糖浆。能用得起真水果的,很少很少。我大一兼职的那家奶茶店,就有使用真水果,但是其他店员都不会检查它们的质量,导致我每次上班就要清理大量腐烂、长白毛的水果,恶心死了。没多久,这家店便倒闭不做了。</p>
<p>那么蜜雪冰城对本地的奶茶品牌造成的影响有多大呢?大杯的奶茶或者百香果果茶,只需要两三块钱,花没有品牌的奶茶所需的钱,喝到了有品牌的奶茶的质量。可能会有人说蜜雪冰城也没有那么好喝吧,问题是两倍价格的有品牌的奶茶,不见得有好喝多少。我就不一一点名了,纽约客或许会知道我在说哪些品牌。</p>
<p>奶茶店的生意如何,和地段有很大的关系。繁荣的地段,尤其是约会圣地、有着逛街氛围的地方,奶茶店就是很容易满座。学校附近也不错,学生们多数喜欢放学后来喝杯奶茶。如果组团一起来,还会点小吃一起吃、聊聊天再回家。</p>
<p>不过这家店所在的地段有些特殊,它算是一种住宅区,老人偏多,还有许多流浪汉。尽管附近有足足三所学校,但是有实际购买能力的只有大学生。要问我为什么知道,因为另外两所里,一所是小学,另一所是高中 —— 我的高中。这家高中的同学们,都不住在附近,而是住在坐地铁半个小时远的、低购买欲住宅区。有零花钱时不时买奶茶喝的,并没有那么多,这里的另一层原因是「奶茶很贵」。</p>
<p>这家店的老板和经理是对夫妻,对员工的要求很高:穿着好看、外貌漂亮、做事认真、年轻能干、不能属鸡。要求高重点在于「做事认真」和「年轻能干」上,比方说他们会定时看监控,看员工们是否在玩手机。其实这也还好,对比一位朋友兼职的店,那边的经理还会偷听员工们聊天。如果有人抱怨很累的话,就会打电话过去质问。好恐怖喔。</p>
<p>他们最让我讨厌的点是动不动就言语攻击。有些事情明明不是我的问题,有些甚至会是他们的问题,他们却会时常说我这个说我那个,听着很烦。所有的线上交流都是通过电话或者微信 —— 都在海外了也要使用微信吗,腾讯的影响力可想而知 —— 而微信群聊,通常会变成公开的处刑场。他们会公开艾特要挨骂的人的账户,接着一大段文字发过来,有时是很直接地训斥,有时则是阴阳怪气。但是被挨骂的人,也没有真的做错什么,很多时候都只是因为信息不对等的问题,而不知道要做某件事而已。</p>
<p>不过作为严厉的奖励,这家店的卫生条件和责任心不错。</p>
<p>迫使我离职的原因也很简单:在这家店里继续工作下去对我的精神状态不太好。工资不过是最低薪水的标准、小费拿不到、员工餐也没有,还要和这两尊大佛相处。再加上这家店所在的地段,先前说过,是一个特殊的住宅区,因为它也在另一个金融区的角落,周围还有地铁站,所以租金不低,但客人就是没有那么多。为了「降本增效」,这家店缺人,俩大佛也经常迟到,或者干脆不来、让其他员工临时来工作顶上。</p>
<p>要知道,小规模的奶茶店一天只会有两个人在,只有一个人的话,是很难同时顾得上前台收银、摇奶茶和做小吃的。我因为他们的迟到,已经吃过许多亏,那些时候我只能绷紧神经,一个人处理店内所有的事情。这里最麻烦的是接单,因为客人们点单的速度很慢,而根据规矩,有客人进来就必须先接单。有时候柜台上已经积累十几单还没开始处理,前台却还有一些客人慢吞吞地在点单,旁边站着已经点了单的其他客人、盯着我看。我能怎么办呢?要是想退款的话,就退款吧,反正我做多少都不会影响到我的工资,老板少赚也只会是老板活该,可怜的只有赶时间的客人。</p>
<p>有位老员工,便因为这件事受不了、早我一两个月离职了。走之前他说,你的底线在哪里,我的底线在这里。</p>
<p>他走后,压力便到了我身上。其他员工都是学生,还有实习什么的,一周内能来上班的次数很少。我因为一学期里要做的事情不多,反而要上更多的班,一个人扛住压力。这些压力明显不是我能承受得了的,但就算是那个时候,除了被说「菜」外,得到的反馈也只有「我做事不认真」,尽管我根本不知道哪来的「不认真」,我能做的都做了。</p>
<p>提出离职那天,感觉一身轻。这半年来收获许多,其实一个月过去,已经不记得自己当时有多么不舒服,只记得自己很愤怒。这些情绪都被记录在日记和聊天记录内,再来看的时候反而觉得陌生。</p>
</body></html></div></article></div></main><footer><div class="paginator"><a class="prev" href="1572.html">上一篇</a><a class="next" href="a778.html">下一篇</a></div><!-- Webmention 显示区域--><div class="webmention-section" data-page-url="posts/7ae3.html" data-full-url="https://blog.cytrogen.icu/posts/7ae3.html" data-syndication-url="https://m.otter.homes/@Cytrogen/116229993921254103" data-mode="static">
<script type="application/json" class="webmention-overrides-data">{"bySourceDomain":{"v1sta.xyz":{"name":"远景幻想 V1STA","url":"https://v1sta.xyz/","photo":"https://v1sta.xyz/wp-content/uploads/2026/03/V1sta-Orb-Output512-2.png"}}}</script>
<h3 class="webmention-title">Webmentions (<span class="webmention-count">3</span>)</h3><form class="webmention-form" action="https://webmention.io/blog.cytrogen.icu/webmention" method="POST">
<input type="hidden" name="target" value="https://blog.cytrogen.icu/posts/7ae3.html">
<label for="webmention-source">你的文章 URL</label>
<div class="webmention-form-row">
<input id="webmention-source" type="url" name="source" placeholder="https://example.com/your-post" required>
<button type="submit">发送 Webmention</button>
</div>
</form><div class="webmention-respond">
<a class="webmention-respond-btn" href="https://m.otter.homes/@Cytrogen/116229993921254103" target="_blank" rel="noopener syndication">在 Mastodon 上回应本文</a>
</div><div class="webmention-group webmention-group-likes"><div class="webmention-compact-list"><a class="webmention-compact-item" href="https://fedi.lya.moe/users/dohna" target="_blank" rel="noopener ugc" title=":cat_roll:"><img class="webmention-compact-photo" src="https://avatars.webmention.io/media.otter.homes/9f5ac3f9321bdf04b228ef4ffbfa5ddec6acbc0077639408135ceab9cd3cc92c.png" alt=":cat_roll:" title=":cat_roll:" loading="lazy"></a><a class="webmention-compact-item" href="https://akk.glowisle.me/users/verdant" target="_blank" rel="noopener ugc" title="五葉地錦"><img class="webmention-compact-photo" src="https://avatars.webmention.io/media.otter.homes/d91c7b91d6a9e678e2ff40333acf9246017a6a23d2771372315bc70995ab915a.png" alt="五葉地錦" title="五葉地錦" loading="lazy"></a><a class="webmention-compact-item" href="https://mstdn.feddit.social/@admin" target="_blank" rel="noopener ugc" title="KIP/JΛYCHØU ⁂ :neocat_cofe:"><img class="webmention-compact-photo" src="https://avatars.webmention.io/media.otter.homes/b3a5ebdc7764c92d0a28a39ee05451f98685bd5f10185dc981856443952aa13c.png" alt="KIP/JΛYCHØU ⁂ :neocat_cofe:" title="KIP/JΛYCHØU ⁂ :neocat_cofe:" loading="lazy"></a><span class="webmention-compact-label">(3) 喜欢了这篇文章</span></div></div><p class="webmention-hint">本站支持 <a href="https://www.w3.org/TR/webmention/" target="_blank" rel="noopener">Webmention</a>。你可以在 Fediverse(如 Mastodon)上回应本文的联合链接,互动会自动出现在此处。<a href="/colophon/#webmention">详情见营造记</a>。</p></div><!-- 邮件评论--><div class="email-comment-section email-comment-loading" data-post-id="7ae3" data-blog-domain="blog.cytrogen.icu">
<h3 class="email-comment-title">邮件评论 (<span class="email-comment-count">0</span>)</h3>
<p class="email-comment-intro">通过邮件参与讨论:<a href="mailto:post-7ae3@blog.cytrogen.icu" aria-label="通过邮件发送评论">post-7ae3@blog.cytrogen.icu</a></p>
<p class="email-comment-empty">还没有邮件评论。</p>
<p class="email-comment-hint">发送邮件到上方地址即可评论。你的名字会公开显示,但邮箱地址不会。</p>
</div><script src="/js/email-comment.js" defer></script><div class="copyright"><p class="footer-links"><a href="../friends/index.html">友链</a><span class="footer-separator"> ·</span><a href="../links/index.html">邻邦</a><span class="footer-separator"> ·</span><a href="../contact/index.html">联络</a><span class="footer-separator"> ·</span><a href="../colophon/index.html">营造记</a><span class="footer-separator"> ·</span><a href="../atom.xml">RSS订阅</a></p><p>© 2025 - 2026 <a href="https://blog.cytrogen.icu">Cytrogen</a>, powered by <a href="https://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/cytrogen/hexo-theme-ares" target="_blank">hexo-theme-ares</a>.</p><p><a href="https://blogscn.fun" target="_blank" rel="noopener">BLOGS·CN</a></p></div></footer></div></div><a class="back-to-top" href="#top" aria-label="返回顶部"><svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M3.293 9.707a1 1 0 010-1.414L9.586 2a2 2 0 012.828 0l6.293 6.293a1 1 0 01-1.414 1.414L11 3.414V17a1 1 0 11-2 0V3.414L2.707 9.707a1 1 0 01-1.414 0z"></path></svg></a><script>document.addEventListener('DOMContentLoaded', function() {
const codeBlocks = document.querySelectorAll('figure.highlight');
codeBlocks.forEach(block => {
let caption = block.querySelector('figcaption');
if (!caption) {
caption = document.createElement('figcaption');
block.insertBefore(caption, block.firstChild);
}
const info = document.createElement('div');
info.className = 'info';
const filename = caption.querySelector('span');
if (filename) {
filename.className = 'filename';
info.appendChild(filename);
}
const lang = block.className.split(' ')[1];
if (lang) {
const langSpan = document.createElement('span');
langSpan.className = 'lang-name';
langSpan.textContent = lang;
info.appendChild(langSpan);
}
const sourceLink = caption.querySelector('a');
if (sourceLink) {
sourceLink.className = 'source-link';
info.appendChild(sourceLink);
}
const actions = document.createElement('div');
actions.className = 'actions';
const codeHeight = block.scrollHeight;
const threshold = 300;
if (codeHeight > threshold) {
block.classList.add('folded');
const toggleBtn = document.createElement('button');
toggleBtn.textContent = '展开';
toggleBtn.addEventListener('click', () => {
block.classList.toggle('folded');
toggleBtn.textContent = block.classList.contains('folded') ? '展开' : '折叠';
});
actions.appendChild(toggleBtn);
}
const copyBtn = document.createElement('button');
copyBtn.textContent = '复制';
copyBtn.addEventListener('click', async () => {
const codeLines = block.querySelectorAll('.code .line');
const code = Array.from(codeLines)
.map(line => line.textContent)
.join('\n')
.replace(/\n\n/g, '\n');
try {
await navigator.clipboard.writeText(code);
copyBtn.textContent = '已复制';
copyBtn.classList.add('copied');
setTimeout(() => {
copyBtn.textContent = '复制';
copyBtn.classList.remove('copied');
}, 3000);
} catch (err) {
console.error('复制失败:', err);
copyBtn.textContent = '复制失败';
setTimeout(() => {
copyBtn.textContent = '复制';
}, 3000);
}
});
actions.appendChild(copyBtn);
caption.innerHTML = '';
caption.appendChild(info);
caption.appendChild(actions);
const markedLines = block.getAttribute('data-marked-lines');
if (markedLines) {
const lines = markedLines.split(',');
lines.forEach(range => {
if (range.includes('-')) {
const [start, end] = range.split('-').map(Number);
for (let i = start; i <= end; i++) {
const line = block.querySelector(`.line-${i}`);
if (line) line.classList.add('marked');
}
} else {
const line = block.querySelector(`.line-${range}`);
if (line) line.classList.add('marked');
}
});
}
});
});</script><script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" id="MathJax-script"></script><script>(function() {
document.addEventListener('DOMContentLoaded', function() {
const themeToggle = document.querySelector('.theme-toggle');
if (!themeToggle) return;
const getCurrentTheme = () => {
return document.documentElement.getAttribute('data-theme') || 'light';
};
const updateUI = (theme) => {
const isDark = theme === 'dark';
themeToggle.setAttribute('aria-pressed', isDark.toString());
};
const setTheme = (theme) => {
document.documentElement.setAttribute('data-theme', theme);
document.documentElement.style.colorScheme = theme;
const pageWrapper = document.getElementById('page-wrapper');
if (pageWrapper) {
pageWrapper.setAttribute('data-theme', theme);
}
// Find and remove the temporary anti-flicker style tag if it exists.
// This ensures the main stylesheet takes full control after the initial load.
const antiFlickerStyle = document.getElementById('anti-flicker-style');
if (antiFlickerStyle) {
antiFlickerStyle.remove();
}
localStorage.setItem('theme', theme);
updateUI(theme);
};
const toggleTheme = () => {
const current = getCurrentTheme();
const newTheme = current === 'light' ? 'dark' : 'light';
setTheme(newTheme);
};
updateUI(getCurrentTheme());
themeToggle.addEventListener('click', toggleTheme);
if (window.matchMedia) {
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
mediaQuery.addEventListener('change', function(e) {
if (!localStorage.getItem('theme')) {
const theme = e.matches ? 'dark' : 'light';
setTheme(theme);
}
});
}
});
})();
</script><script src="../js/details-toggle.js" defer></script><script>(function() {
document.addEventListener('DOMContentLoaded', function() {
const backToTopBtn = document.querySelector('.back-to-top');
if (!backToTopBtn) return;
const toggleButtonVisibility = () => {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const shouldShow = scrollTop > 200;
if (shouldShow) {
backToTopBtn.classList.add('is-visible');
} else {
backToTopBtn.classList.remove('is-visible');
}
};
let ticking = false;
const handleScroll = () => {
if (!ticking) {
requestAnimationFrame(() => {
toggleButtonVisibility();
ticking = false;
});
ticking = true;
}
};
const scrollToTop = (event) => {
event.preventDefault();
window.scrollTo({
top: 0,
behavior: 'smooth'
});
};
window.addEventListener('scroll', handleScroll);
backToTopBtn.addEventListener('click', scrollToTop);
toggleButtonVisibility();
});
})();</script></body></html>