@mintfolio/theme-verdant 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +66 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/assets/favicon.ico +0 -0
- package/assets/favicon.svg +9 -0
- package/assets/fonts/Inter-300.woff2 +0 -0
- package/assets/fonts/Inter-400.woff2 +0 -0
- package/assets/fonts/Inter-500.woff2 +0 -0
- package/assets/fonts/Inter-600.woff2 +0 -0
- package/assets/fonts/Inter-700.woff2 +0 -0
- package/assets/fonts/JetBrainsMono-400.woff2 +0 -0
- package/assets/fonts/JetBrainsMono-500.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-400.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-500.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-600.woff2 +0 -0
- package/assets/fonts/PlayfairDisplay-700.woff2 +0 -0
- package/components/base/Contact.astro +173 -0
- package/components/base/Hero.astro +228 -0
- package/components/base/Navigation.astro +288 -0
- package/components/base/Projects.astro +207 -0
- package/components/base/Skills.astro +158 -0
- package/components/blog/ArticleProse.astro +217 -0
- package/components/blog/CodeBlockEnhancer.astro +310 -0
- package/components/blog/PostCard.astro +98 -0
- package/components/blog/ProtectedArticle.astro +89 -0
- package/config/theme-verdant.config.mjs +74 -0
- package/layouts/Base.astro +460 -0
- package/lib/palettes.ts +10 -0
- package/licenses/Inter-OFL.txt +92 -0
- package/licenses/JetBrainsMono-OFL.txt +93 -0
- package/licenses/PlayfairDisplay-OFL.txt +191 -0
- package/package.json +68 -0
- package/pages/archive.astro +384 -0
- package/pages/home.astro +2049 -0
- package/pages/page.astro +434 -0
- package/pages/post.astro +1029 -0
- package/scripts/article.ts +42 -0
- package/scripts/articleOrigin.ts +31 -0
- package/scripts/articleTables.ts +15 -0
- package/scripts/blog.ts +26 -0
- package/scripts/codeBlocks.ts +172 -0
- package/scripts/hero.ts +173 -0
- package/scripts/home.ts +12 -0
- package/scripts/homePanels.ts +100 -0
- package/scripts/hotContent.ts +16 -0
- package/scripts/lifecycle.ts +3 -0
- package/scripts/lightbox.ts +14 -0
- package/scripts/postFilters.ts +101 -0
- package/scripts/postList.ts +132 -0
- package/scripts/progress.ts +29 -0
- package/scripts/protectedArticle.ts +49 -0
- package/scripts/protectedToc.ts +29 -0
- package/scripts/site.ts +145 -0
- package/scripts/tagFold.ts +61 -0
- package/scripts/theme.ts +102 -0
- package/scripts/toc.ts +149 -0
- package/settings.ts +21 -0
- package/styles/fonts.css +120 -0
- package/styles/global.css +146 -0
- package/styles/themes/happyhues/effects.css +62 -0
- package/styles/themes/happyhues/index.css +2 -0
- package/styles/themes/happyhues/theme.css +225 -0
- package/theme.mjs +60 -0
- package/utils/blogNavigation.ts +3 -0
- package/utils/homeReturnHint.ts +34 -0
- package/utils/storage.ts +16 -0
- package/utils/types.ts +8 -0
package/pages/post.astro
ADDED
|
@@ -0,0 +1,1029 @@
|
|
|
1
|
+
---
|
|
2
|
+
/** Verdant article layout receives rendered body or an opaque encrypted payload. */
|
|
3
|
+
import Base from '../layouts/Base.astro';
|
|
4
|
+
import ArticleProse from '../components/blog/ArticleProse.astro';
|
|
5
|
+
import CodeBlockEnhancer from '../components/blog/CodeBlockEnhancer.astro';
|
|
6
|
+
import ProtectedArticle from '../components/blog/ProtectedArticle.astro';
|
|
7
|
+
import Image from '@mintfolio/core/components/Image.astro';
|
|
8
|
+
import type { PageProps, PostPageData } from '@mintfolio/theme-api/astro';
|
|
9
|
+
import type { VerdantSettings } from '../settings';
|
|
10
|
+
|
|
11
|
+
interface Props extends PageProps<VerdantSettings, PostPageData> {}
|
|
12
|
+
const { theme, page } = Astro.props;
|
|
13
|
+
const { post, body } = page;
|
|
14
|
+
const tocHeadings = body.kind === 'public' ? body.headings.filter((heading) => heading.depth === 2 || heading.depth === 3) : [];
|
|
15
|
+
const profileAvatar = theme.site.profile.avatar;
|
|
16
|
+
const footerImage = theme.settings.article.footerImage.src || theme.site.profile.avatar;
|
|
17
|
+
|
|
18
|
+
/** Format the Core-provided ISO publication date without changing its timezone. */
|
|
19
|
+
function formatDate(date: Date): string {
|
|
20
|
+
return date.toISOString().split('T')[0];
|
|
21
|
+
}
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<Base theme={theme} page={page}>
|
|
25
|
+
<article class="blog-post" id="content">
|
|
26
|
+
<div class="container">
|
|
27
|
+
<nav class="breadcrumb" aria-label="文章导航">
|
|
28
|
+
<button type="button" class="back-btn" id="back-btn" aria-label="返回上一页" title="返回上一页">
|
|
29
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="22" height="22" aria-hidden="true">
|
|
30
|
+
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
|
31
|
+
</svg>
|
|
32
|
+
</button>
|
|
33
|
+
</nav>
|
|
34
|
+
|
|
35
|
+
<header class:list={['post-header', { 'no-cover': !post.cover }]}>
|
|
36
|
+
{post.cover && (
|
|
37
|
+
<div class="post-hero-cover glass-card">
|
|
38
|
+
<Image src={post.cover} alt={post.title} loading="lazy" width={800} height={450} />
|
|
39
|
+
<div class="post-hero-cover-mask" aria-hidden="true"></div>
|
|
40
|
+
</div>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
<h1 class="gradient-text post-title" transition:name={`post-title-${post.id}`}>{post.title}</h1>
|
|
44
|
+
<div class="post-meta">
|
|
45
|
+
<time class="post-date" datetime={new Date(post.publishedAt).toISOString()}>
|
|
46
|
+
{formatDate(new Date(post.publishedAt))}
|
|
47
|
+
</time>
|
|
48
|
+
{post.tags && post.tags.length > 0 && (
|
|
49
|
+
<div class="post-tags">
|
|
50
|
+
{post.tags.map(tag => (
|
|
51
|
+
<a href={tag.url} class="tag">{tag.label}</a>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="post-author post-author-shell post-shell-card">
|
|
58
|
+
<Image class="author-avatar" src={profileAvatar} alt={theme.site.profile.name} loading="lazy" width={48} height={48} />
|
|
59
|
+
<div class="author-text">
|
|
60
|
+
<p class="author-name">{theme.site.profile.name}</p>
|
|
61
|
+
<p class="author-signature">{theme.site.profile.signature}</p>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
|
|
66
|
+
{body.kind === 'protected' ? (
|
|
67
|
+
<ProtectedArticle body={body}>
|
|
68
|
+
{/* Empty theme markup only: neither headings nor article text are emitted while locked. */}
|
|
69
|
+
<template slot="toc-template" data-toc-template>
|
|
70
|
+
<!-- TOC 按钮(会被 JS 移动到 ui-float-right 容器中) -->
|
|
71
|
+
<button class="toc-toggle" id="toc-toggle" aria-label="目录" aria-expanded="false" aria-controls="toc-card" title="目录" style="display: none;">
|
|
72
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20" aria-hidden="true">
|
|
73
|
+
<path d="M4 6h16M4 12h12M4 18h8"/>
|
|
74
|
+
</svg>
|
|
75
|
+
</button>
|
|
76
|
+
|
|
77
|
+
<!-- 遮罩层(仅平板/移动端) -->
|
|
78
|
+
<div class="toc-overlay" id="toc-overlay" aria-hidden="true"></div>
|
|
79
|
+
|
|
80
|
+
<!-- TOC 面板 -->
|
|
81
|
+
<aside class="toc-card glass-card" id="toc-card">
|
|
82
|
+
<div class="toc-header">
|
|
83
|
+
<div class="toc-progress" role="progressbar" aria-label="文章阅读进度" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
|
|
84
|
+
<h2 class="toc-title">目录</h2>
|
|
85
|
+
</div>
|
|
86
|
+
<nav class="toc-nav" aria-label="文章目录">
|
|
87
|
+
{[{ depth: 2, slug: '', text: '' }].map((heading) => (
|
|
88
|
+
<a
|
|
89
|
+
href={`#${heading.slug}`}
|
|
90
|
+
class={`toc-link depth-${heading.depth}`}
|
|
91
|
+
>
|
|
92
|
+
{heading.text}
|
|
93
|
+
</a>
|
|
94
|
+
))}
|
|
95
|
+
</nav>
|
|
96
|
+
</aside>
|
|
97
|
+
</template>
|
|
98
|
+
</ProtectedArticle>
|
|
99
|
+
) : (
|
|
100
|
+
<>
|
|
101
|
+
{tocHeadings.length > 0 && (
|
|
102
|
+
<>
|
|
103
|
+
<!-- TOC 按钮(会被 JS 移动到 ui-float-right 容器中) -->
|
|
104
|
+
<button class="toc-toggle" id="toc-toggle" aria-label="目录" aria-expanded="false" aria-controls="toc-card" title="目录" style="display: none;">
|
|
105
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20" aria-hidden="true">
|
|
106
|
+
<path d="M4 6h16M4 12h12M4 18h8"/>
|
|
107
|
+
</svg>
|
|
108
|
+
</button>
|
|
109
|
+
|
|
110
|
+
<!-- 遮罩层(仅平板/移动端) -->
|
|
111
|
+
<div class="toc-overlay" id="toc-overlay" aria-hidden="true"></div>
|
|
112
|
+
|
|
113
|
+
<!-- TOC 面板 -->
|
|
114
|
+
<aside class="toc-card glass-card" id="toc-card">
|
|
115
|
+
<div class="toc-header">
|
|
116
|
+
<div class="toc-progress" role="progressbar" aria-label="文章阅读进度" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div>
|
|
117
|
+
<h2 class="toc-title">目录</h2>
|
|
118
|
+
</div>
|
|
119
|
+
<nav class="toc-nav" aria-label="文章目录">
|
|
120
|
+
{tocHeadings.map((heading) => (
|
|
121
|
+
<a
|
|
122
|
+
href={`#${heading.slug}`}
|
|
123
|
+
class={`toc-link depth-${heading.depth}`}
|
|
124
|
+
>
|
|
125
|
+
{heading.text}
|
|
126
|
+
</a>
|
|
127
|
+
))}
|
|
128
|
+
</nav>
|
|
129
|
+
</aside>
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
<ArticleProse><Fragment set:html={body.html} /></ArticleProse>
|
|
133
|
+
</>
|
|
134
|
+
)}
|
|
135
|
+
|
|
136
|
+
<CodeBlockEnhancer />
|
|
137
|
+
|
|
138
|
+
{theme.settings.article.footerImage.enabled && (
|
|
139
|
+
<div class="post-footer-image glass-card">
|
|
140
|
+
<Image src={footerImage} alt="文章结尾插图" loading="lazy" width={800} height={300} />
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
<!-- Image Lightbox Modal -->
|
|
145
|
+
<dialog class="image-lightbox" id="image-lightbox" aria-label="图片预览">
|
|
146
|
+
<button class="lightbox-close" id="lightbox-close" type="button" aria-label="关闭图片预览">×</button>
|
|
147
|
+
<div class="lightbox-viewport" id="lightbox-viewport">
|
|
148
|
+
<img class="lightbox-image" id="lightbox-image" alt="图片预览" draggable="false" />
|
|
149
|
+
</div>
|
|
150
|
+
<div class="lightbox-controls" role="group" aria-label="图片缩放">
|
|
151
|
+
<button id="lightbox-zoom-out" type="button" aria-label="缩小图片" title="缩小图片">
|
|
152
|
+
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="M5 12h14" /></svg>
|
|
153
|
+
</button>
|
|
154
|
+
<output id="lightbox-zoom-level" aria-live="polite" aria-label="缩放比例">100%</output>
|
|
155
|
+
<button id="lightbox-zoom-in" type="button" aria-label="放大图片" title="放大图片">
|
|
156
|
+
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="M5 12h14M12 5v14" /></svg>
|
|
157
|
+
</button>
|
|
158
|
+
<button class="lightbox-reset" id="lightbox-reset" type="button" title="重置缩放">重置</button>
|
|
159
|
+
</div>
|
|
160
|
+
</dialog>
|
|
161
|
+
</div>
|
|
162
|
+
</article>
|
|
163
|
+
</Base>
|
|
164
|
+
|
|
165
|
+
<style>
|
|
166
|
+
/* Article Page Custom Scrollbar - Override global hide */
|
|
167
|
+
html.blog-article-page,
|
|
168
|
+
html.blog-article-page body {
|
|
169
|
+
scrollbar-width: thin !important;
|
|
170
|
+
scrollbar-color: var(--color-primary) var(--color-bg) !important;
|
|
171
|
+
-ms-overflow-style: auto !important;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
html.blog-article-page::-webkit-scrollbar,
|
|
175
|
+
html.blog-article-page body::-webkit-scrollbar {
|
|
176
|
+
width: 10px !important;
|
|
177
|
+
height: 10px !important;
|
|
178
|
+
display: block !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
html.blog-article-page::-webkit-scrollbar-track,
|
|
182
|
+
html.blog-article-page body::-webkit-scrollbar-track {
|
|
183
|
+
background: var(--color-bg);
|
|
184
|
+
border-radius: 5px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
html.blog-article-page::-webkit-scrollbar-thumb,
|
|
188
|
+
html.blog-article-page body::-webkit-scrollbar-thumb {
|
|
189
|
+
background: linear-gradient(
|
|
190
|
+
180deg,
|
|
191
|
+
var(--color-primary) 0%,
|
|
192
|
+
color-mix(in srgb, var(--color-primary) 70%, var(--color-secondary)) 50%,
|
|
193
|
+
var(--color-primary) 100%
|
|
194
|
+
);
|
|
195
|
+
border-radius: 5px;
|
|
196
|
+
border: 2px solid var(--color-bg);
|
|
197
|
+
background-clip: padding-box;
|
|
198
|
+
transition: background 0.2s ease;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
html.blog-article-page::-webkit-scrollbar-thumb:hover,
|
|
202
|
+
html.blog-article-page body::-webkit-scrollbar-thumb:hover {
|
|
203
|
+
background: linear-gradient(
|
|
204
|
+
180deg,
|
|
205
|
+
var(--color-secondary) 0%,
|
|
206
|
+
var(--color-primary) 50%,
|
|
207
|
+
var(--color-secondary) 100%
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
html.blog-article-page::-webkit-scrollbar-corner,
|
|
212
|
+
html.blog-article-page body::-webkit-scrollbar-corner {
|
|
213
|
+
background: var(--color-bg);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.blog-post {
|
|
217
|
+
min-height: 100vh;
|
|
218
|
+
padding: var(--section-padding);
|
|
219
|
+
padding-top: clamp(1rem, 2.4vw, 1.75rem);
|
|
220
|
+
background: var(--color-bg);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.container {
|
|
224
|
+
max-width: 800px;
|
|
225
|
+
margin: 0 auto;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.breadcrumb {
|
|
229
|
+
position: fixed;
|
|
230
|
+
left: max(1.5rem, calc((100vw - 800px) / 2 - 5.5rem));
|
|
231
|
+
top: clamp(1.75rem, 4vh, 2.5rem);
|
|
232
|
+
z-index: 200;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.back-btn {
|
|
236
|
+
width: 50px;
|
|
237
|
+
height: 50px;
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
justify-content: center;
|
|
241
|
+
border-radius: 50%;
|
|
242
|
+
background: var(--color-surface);
|
|
243
|
+
color: var(--color-text);
|
|
244
|
+
border: 1px solid var(--color-border);
|
|
245
|
+
box-shadow: var(--shadow-md);
|
|
246
|
+
transition: transform var(--transition-base), box-shadow var(--transition-base);
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.back-btn:hover {
|
|
251
|
+
transform: scale(1.05);
|
|
252
|
+
box-shadow: var(--shadow-lg);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.post-header {
|
|
256
|
+
margin-bottom: 1.6rem;
|
|
257
|
+
text-align: center;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.post-header.no-cover {
|
|
261
|
+
padding-top: 1.5rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.post-hero-cover {
|
|
265
|
+
position: relative;
|
|
266
|
+
width: 100%;
|
|
267
|
+
margin: 0 auto 1.1rem;
|
|
268
|
+
border-radius: calc(var(--radius-lg) + 2px);
|
|
269
|
+
overflow: hidden;
|
|
270
|
+
aspect-ratio: 16 / 7;
|
|
271
|
+
border: 1px solid color-mix(in srgb, var(--color-border) 68%, transparent);
|
|
272
|
+
box-shadow: var(--shadow-md);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.post-hero-cover img {
|
|
276
|
+
width: 100%;
|
|
277
|
+
height: 100%;
|
|
278
|
+
object-fit: cover;
|
|
279
|
+
display: block;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.post-hero-cover-mask {
|
|
283
|
+
position: absolute;
|
|
284
|
+
inset: 0;
|
|
285
|
+
background:
|
|
286
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 35%),
|
|
287
|
+
linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 42%);
|
|
288
|
+
pointer-events: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.post-title {
|
|
292
|
+
font-size: 2.5rem;
|
|
293
|
+
font-weight: 700;
|
|
294
|
+
margin-bottom: 1rem;
|
|
295
|
+
line-height: 1.2;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.post-meta {
|
|
299
|
+
display: flex;
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
align-items: center;
|
|
302
|
+
gap: 1rem;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.post-shell-card {
|
|
306
|
+
border-radius: var(--radius-lg);
|
|
307
|
+
border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
|
|
308
|
+
background: var(--color-surface);
|
|
309
|
+
box-shadow: var(--shadow-sm);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.post-author {
|
|
313
|
+
margin-top: 1.5rem;
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 1rem;
|
|
317
|
+
padding: 1rem 1.5rem;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.post-author-shell {
|
|
321
|
+
width: 100%;
|
|
322
|
+
max-width: 100%;
|
|
323
|
+
margin-left: auto;
|
|
324
|
+
margin-right: auto;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.author-avatar {
|
|
328
|
+
width: 56px;
|
|
329
|
+
height: 56px;
|
|
330
|
+
border-radius: 50%;
|
|
331
|
+
object-fit: cover;
|
|
332
|
+
border: 2px solid var(--color-primary);
|
|
333
|
+
flex-shrink: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.author-text {
|
|
337
|
+
text-align: left;
|
|
338
|
+
line-height: 1.3;
|
|
339
|
+
flex: 1;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.author-name {
|
|
343
|
+
font-size: 1rem;
|
|
344
|
+
color: var(--color-text);
|
|
345
|
+
font-weight: 600;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.author-signature {
|
|
349
|
+
font-size: 0.85rem;
|
|
350
|
+
color: var(--color-text-muted);
|
|
351
|
+
margin-top: 0.15rem;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.post-date {
|
|
355
|
+
color: var(--color-text-muted);
|
|
356
|
+
font-size: 0.875rem;
|
|
357
|
+
font-family: monospace;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.post-tags {
|
|
361
|
+
display: flex;
|
|
362
|
+
flex-wrap: wrap;
|
|
363
|
+
justify-content: center;
|
|
364
|
+
gap: 0.5rem;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.tag {
|
|
368
|
+
background: var(--color-tag-bg);
|
|
369
|
+
color: var(--color-tag-text);
|
|
370
|
+
padding: 0.25rem 0.75rem;
|
|
371
|
+
border-radius: 9999px;
|
|
372
|
+
font-size: 0.75rem;
|
|
373
|
+
font-weight: 500;
|
|
374
|
+
text-decoration: none;
|
|
375
|
+
transition: all var(--transition-fast);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.tag:hover {
|
|
379
|
+
background: var(--color-secondary);
|
|
380
|
+
color: var(--color-bg);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.post-footer-image {
|
|
384
|
+
margin-top: 1rem;
|
|
385
|
+
overflow: hidden;
|
|
386
|
+
border-radius: var(--radius-md);
|
|
387
|
+
max-width: 520px;
|
|
388
|
+
margin-left: auto;
|
|
389
|
+
margin-right: auto;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.post-footer-image img {
|
|
393
|
+
display: block;
|
|
394
|
+
width: 100%;
|
|
395
|
+
max-height: 260px;
|
|
396
|
+
object-fit: cover;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* Image Lightbox */
|
|
400
|
+
.image-lightbox {
|
|
401
|
+
display: none;
|
|
402
|
+
margin: 0;
|
|
403
|
+
border: 0;
|
|
404
|
+
width: 100%;
|
|
405
|
+
height: 100%;
|
|
406
|
+
max-width: none;
|
|
407
|
+
max-height: none;
|
|
408
|
+
position: fixed;
|
|
409
|
+
inset: 0;
|
|
410
|
+
background: rgba(0, 0, 0, 0.9);
|
|
411
|
+
|
|
412
|
+
padding: 0;
|
|
413
|
+
overflow: hidden;
|
|
414
|
+
overscroll-behavior: contain;
|
|
415
|
+
z-index: 1000;
|
|
416
|
+
opacity: 0;
|
|
417
|
+
visibility: hidden;
|
|
418
|
+
pointer-events: none;
|
|
419
|
+
transition: opacity var(--transition-fast), visibility var(--transition-fast);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.image-lightbox[open] {
|
|
423
|
+
display: block;
|
|
424
|
+
opacity: 1;
|
|
425
|
+
visibility: visible;
|
|
426
|
+
pointer-events: auto;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
@starting-style {
|
|
430
|
+
.image-lightbox[open] {
|
|
431
|
+
opacity: 0;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.lightbox-close {
|
|
436
|
+
position: absolute;
|
|
437
|
+
top: 1rem;
|
|
438
|
+
right: 1rem;
|
|
439
|
+
width: 44px;
|
|
440
|
+
height: 44px;
|
|
441
|
+
border-radius: var(--radius-full);
|
|
442
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
443
|
+
background: rgba(0, 0, 0, 0.5);
|
|
444
|
+
color: #fff;
|
|
445
|
+
font-size: 1.5rem;
|
|
446
|
+
line-height: 1;
|
|
447
|
+
cursor: pointer;
|
|
448
|
+
display: flex;
|
|
449
|
+
align-items: center;
|
|
450
|
+
justify-content: center;
|
|
451
|
+
transition: all var(--transition-fast);
|
|
452
|
+
z-index: 1001;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.lightbox-close:hover {
|
|
456
|
+
background: rgba(255, 255, 255, 0.2);
|
|
457
|
+
transform: scale(1.1);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.lightbox-viewport {
|
|
461
|
+
position: absolute;
|
|
462
|
+
inset: 4.5rem 1rem calc(5rem + env(safe-area-inset-bottom, 0px));
|
|
463
|
+
display: flex;
|
|
464
|
+
align-items: center;
|
|
465
|
+
justify-content: center;
|
|
466
|
+
overflow: hidden;
|
|
467
|
+
touch-action: none;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.lightbox-image {
|
|
471
|
+
max-width: 100%;
|
|
472
|
+
max-height: 100%;
|
|
473
|
+
flex: none;
|
|
474
|
+
object-fit: contain;
|
|
475
|
+
border-radius: var(--radius-sm);
|
|
476
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
|
477
|
+
user-select: none;
|
|
478
|
+
-webkit-user-drag: none;
|
|
479
|
+
transform-origin: center;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.lightbox-controls {
|
|
483
|
+
position: absolute;
|
|
484
|
+
bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
|
|
485
|
+
left: 50%;
|
|
486
|
+
transform: translateX(-50%);
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
gap: 0.25rem;
|
|
490
|
+
padding: 0.35rem;
|
|
491
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
492
|
+
border-radius: var(--radius-full);
|
|
493
|
+
background: rgba(0, 0, 0, 0.65);
|
|
494
|
+
color: #fff;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.lightbox-controls,
|
|
498
|
+
.lightbox-close {
|
|
499
|
+
-webkit-user-select: none;
|
|
500
|
+
user-select: none;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.lightbox-controls button {
|
|
504
|
+
display: grid;
|
|
505
|
+
place-items: center;
|
|
506
|
+
width: 44px;
|
|
507
|
+
height: 44px;
|
|
508
|
+
border: 0;
|
|
509
|
+
border-radius: var(--radius-full);
|
|
510
|
+
background: transparent;
|
|
511
|
+
color: inherit;
|
|
512
|
+
font-size: 1.5rem;
|
|
513
|
+
cursor: pointer;
|
|
514
|
+
transition: background-color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
|
|
515
|
+
touch-action: manipulation;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
519
|
+
.lightbox-controls button:active:not(:disabled) {
|
|
520
|
+
transform: scale(0.96);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.lightbox-controls svg {
|
|
525
|
+
pointer-events: none;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.lightbox-controls .lightbox-reset {
|
|
529
|
+
width: auto;
|
|
530
|
+
padding: 0 0.85rem;
|
|
531
|
+
font-size: 0.85rem;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.lightbox-controls button:hover:not(:disabled) {
|
|
535
|
+
background: rgba(255, 255, 255, 0.15);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.lightbox-controls button:disabled {
|
|
539
|
+
opacity: 0.35;
|
|
540
|
+
cursor: default;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.lightbox-controls button:focus-visible,
|
|
544
|
+
.lightbox-close:focus-visible {
|
|
545
|
+
outline: 2px solid #fff;
|
|
546
|
+
outline-offset: 2px;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
#lightbox-zoom-level {
|
|
550
|
+
min-width: 4rem;
|
|
551
|
+
text-align: center;
|
|
552
|
+
font-size: 0.85rem;
|
|
553
|
+
font-variant-numeric: tabular-nums;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
@media (max-width: 768px) {
|
|
557
|
+
.blog-post {
|
|
558
|
+
padding-top: 0.6rem;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.breadcrumb {
|
|
562
|
+
left: 1rem;
|
|
563
|
+
top: 1rem;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.post-title {
|
|
567
|
+
font-size: 2rem;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.post-hero-cover {
|
|
571
|
+
margin-bottom: 1rem;
|
|
572
|
+
aspect-ratio: 16 / 9;
|
|
573
|
+
border-radius: var(--radius-md);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.post-author {
|
|
577
|
+
width: 100%;
|
|
578
|
+
max-width: 100%;
|
|
579
|
+
padding: 0.85rem 1rem;
|
|
580
|
+
gap: 0.85rem;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.author-avatar {
|
|
584
|
+
width: 48px;
|
|
585
|
+
height: 48px;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.author-name {
|
|
589
|
+
font-size: 0.92rem;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.author-signature {
|
|
593
|
+
font-size: 0.8rem;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.post-footer-image {
|
|
597
|
+
max-width: 100%;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.post-footer-image img {
|
|
601
|
+
max-height: 220px;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/* TOC Toggle Button - 样式与 Base.astro 按钮一致 */
|
|
606
|
+
.toc-toggle {
|
|
607
|
+
width: 44px;
|
|
608
|
+
height: 44px;
|
|
609
|
+
border-radius: 50%;
|
|
610
|
+
background: var(--color-surface);
|
|
611
|
+
border: 1px solid var(--color-border);
|
|
612
|
+
color: var(--color-text);
|
|
613
|
+
cursor: pointer;
|
|
614
|
+
display: flex;
|
|
615
|
+
align-items: center;
|
|
616
|
+
justify-content: center;
|
|
617
|
+
box-shadow: var(--shadow-md);
|
|
618
|
+
transition: all var(--transition-base);
|
|
619
|
+
order: -1; /* 放在主题按钮上面 */
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.toc-toggle:hover {
|
|
623
|
+
transform: scale(1.05);
|
|
624
|
+
box-shadow: var(--shadow-lg);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.toc-toggle.active {
|
|
628
|
+
background: var(--color-secondary);
|
|
629
|
+
color: var(--color-bg);
|
|
630
|
+
border-color: var(--color-secondary);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.toc-toggle:active {
|
|
634
|
+
transform: scale(0.95);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.toc-toggle:focus-visible {
|
|
638
|
+
outline: 2px solid var(--color-primary);
|
|
639
|
+
outline-offset: 2px;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/* ============================================
|
|
643
|
+
TABLE OF CONTENTS - Modern Glass Design
|
|
644
|
+
============================================ */
|
|
645
|
+
|
|
646
|
+
.toc-card {
|
|
647
|
+
position: relative;
|
|
648
|
+
padding: 0;
|
|
649
|
+
margin-bottom: 1rem;
|
|
650
|
+
border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
|
|
651
|
+
border-radius: var(--radius-lg);
|
|
652
|
+
background: linear-gradient(
|
|
653
|
+
145deg,
|
|
654
|
+
color-mix(in srgb, var(--color-surface) 95%, var(--color-primary) 2%) 0%,
|
|
655
|
+
color-mix(in srgb, var(--color-surface) 90%, transparent) 50%,
|
|
656
|
+
color-mix(in srgb, var(--color-surface) 88%, var(--color-secondary) 3%) 100%
|
|
657
|
+
);
|
|
658
|
+
backdrop-filter: blur(20px) saturate(140%);
|
|
659
|
+
-webkit-backdrop-filter: blur(20px) saturate(140%);
|
|
660
|
+
box-shadow:
|
|
661
|
+
0 4px 24px color-mix(in srgb, var(--color-text) 6%, transparent),
|
|
662
|
+
0 1px 2px color-mix(in srgb, var(--color-text) 4%, transparent),
|
|
663
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-surface) 80%, transparent);
|
|
664
|
+
overflow: hidden;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.toc-header {
|
|
668
|
+
position: sticky;
|
|
669
|
+
top: 0;
|
|
670
|
+
z-index: 4;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* Keep the progress bar inside the sticky header while the card scrolls. */
|
|
674
|
+
.toc-progress {
|
|
675
|
+
position: absolute;
|
|
676
|
+
inset: 0 0 auto 0;
|
|
677
|
+
height: 2px;
|
|
678
|
+
background: color-mix(in srgb, var(--color-border) 50%, transparent);
|
|
679
|
+
z-index: 2;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.toc-progress span {
|
|
683
|
+
position: absolute;
|
|
684
|
+
top: 0;
|
|
685
|
+
left: 0;
|
|
686
|
+
height: 2px;
|
|
687
|
+
width: var(--reading-progress, 0%);
|
|
688
|
+
background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
|
|
689
|
+
z-index: 3;
|
|
690
|
+
transition: width 0.15s ease-out;
|
|
691
|
+
box-shadow: 0 0 12px color-mix(in srgb, var(--color-primary) 50%, transparent);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.toc-title {
|
|
695
|
+
display: flex;
|
|
696
|
+
align-items: center;
|
|
697
|
+
gap: 0.6rem;
|
|
698
|
+
font-size: 0.7rem;
|
|
699
|
+
font-weight: 600;
|
|
700
|
+
letter-spacing: 0.12em;
|
|
701
|
+
text-transform: uppercase;
|
|
702
|
+
color: var(--color-text);
|
|
703
|
+
margin: 0;
|
|
704
|
+
padding: 1rem 1.1rem 0.85rem;
|
|
705
|
+
background: linear-gradient(
|
|
706
|
+
180deg,
|
|
707
|
+
color-mix(in srgb, var(--color-surface) 98%, transparent) 0%,
|
|
708
|
+
color-mix(in srgb, var(--color-surface) 85%, transparent) 100%
|
|
709
|
+
);
|
|
710
|
+
border-bottom: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.toc-title::before {
|
|
714
|
+
content: '◆';
|
|
715
|
+
font-size: 0.5rem;
|
|
716
|
+
color: var(--color-primary);
|
|
717
|
+
background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
|
|
718
|
+
-webkit-background-clip: text;
|
|
719
|
+
background-clip: text;
|
|
720
|
+
-webkit-text-fill-color: transparent;
|
|
721
|
+
filter: drop-shadow(0 0 4px color-mix(in srgb, var(--color-primary) 40%, transparent));
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.toc-title::after {
|
|
725
|
+
content: '';
|
|
726
|
+
flex: 1;
|
|
727
|
+
height: 1px;
|
|
728
|
+
margin-left: 0.5rem;
|
|
729
|
+
background: linear-gradient(90deg, color-mix(in srgb, var(--color-border) 60%, transparent), transparent);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.toc-nav {
|
|
733
|
+
display: flex;
|
|
734
|
+
flex-direction: column;
|
|
735
|
+
gap: 0.15rem;
|
|
736
|
+
padding: 0.75rem 0.85rem 0.85rem;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.toc-link {
|
|
740
|
+
position: relative;
|
|
741
|
+
color: var(--color-text-muted);
|
|
742
|
+
text-decoration: none;
|
|
743
|
+
font-size: 0.8rem;
|
|
744
|
+
line-height: 1.55;
|
|
745
|
+
border-radius: var(--radius-sm);
|
|
746
|
+
padding: 0.55rem 0.7rem;
|
|
747
|
+
border: 1px solid transparent;
|
|
748
|
+
transition:
|
|
749
|
+
color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
750
|
+
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
751
|
+
border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
752
|
+
transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
753
|
+
box-shadow 0.2s ease;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/* Bullet for H3 */
|
|
757
|
+
.toc-link.depth-3 {
|
|
758
|
+
margin-left: 1rem;
|
|
759
|
+
padding-left: 1.5rem;
|
|
760
|
+
font-size: 0.75rem;
|
|
761
|
+
opacity: 0.85;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.toc-link.depth-3::before {
|
|
765
|
+
content: '';
|
|
766
|
+
position: absolute;
|
|
767
|
+
left: 0.7rem;
|
|
768
|
+
top: 50%;
|
|
769
|
+
transform: translateY(-50%);
|
|
770
|
+
width: 5px;
|
|
771
|
+
height: 5px;
|
|
772
|
+
border-radius: 50%;
|
|
773
|
+
background: color-mix(in srgb, var(--color-text-muted) 40%, transparent);
|
|
774
|
+
transition:
|
|
775
|
+
background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
|
|
776
|
+
box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/* Vertical Progress Line */
|
|
780
|
+
.toc-link::after {
|
|
781
|
+
content: '';
|
|
782
|
+
position: absolute;
|
|
783
|
+
left: 0;
|
|
784
|
+
top: 0;
|
|
785
|
+
bottom: 0;
|
|
786
|
+
width: 2px;
|
|
787
|
+
background: transparent;
|
|
788
|
+
border-radius: 1px;
|
|
789
|
+
transition: background 0.2s ease;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.toc-link:hover {
|
|
793
|
+
color: var(--color-text);
|
|
794
|
+
background: color-mix(in srgb, var(--color-primary) 6%, transparent);
|
|
795
|
+
border-color: color-mix(in srgb, var(--color-primary) 15%, transparent);
|
|
796
|
+
transform: translateX(3px);
|
|
797
|
+
box-shadow:
|
|
798
|
+
0 2px 8px color-mix(in srgb, var(--color-primary) 8%, transparent),
|
|
799
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-surface) 50%, transparent);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.toc-link.depth-3:hover {
|
|
803
|
+
opacity: 1;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.toc-link.depth-3:hover::before {
|
|
807
|
+
background: var(--color-primary);
|
|
808
|
+
box-shadow: 0 0 6px color-mix(in srgb, var(--color-primary) 50%, transparent);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.toc-link.active {
|
|
812
|
+
color: var(--color-primary);
|
|
813
|
+
background: linear-gradient(
|
|
814
|
+
135deg,
|
|
815
|
+
color-mix(in srgb, var(--color-primary) 10%, transparent) 0%,
|
|
816
|
+
color-mix(in srgb, var(--color-secondary) 6%, transparent) 100%
|
|
817
|
+
);
|
|
818
|
+
border-color: color-mix(in srgb, var(--color-primary) 25%, transparent);
|
|
819
|
+
box-shadow:
|
|
820
|
+
0 4px 16px color-mix(in srgb, var(--color-primary) 10%, transparent),
|
|
821
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-surface) 60%, transparent);
|
|
822
|
+
transform: translateX(4px);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.toc-link.active::after {
|
|
826
|
+
background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.toc-link.depth-3.active::before {
|
|
830
|
+
background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
|
|
831
|
+
box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary) 60%, transparent);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/* Focus States for Accessibility */
|
|
835
|
+
.toc-link:focus-visible {
|
|
836
|
+
outline: 2px solid var(--color-primary);
|
|
837
|
+
outline-offset: 2px;
|
|
838
|
+
background: color-mix(in srgb, var(--color-primary) 8%, transparent);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.toc-overlay {
|
|
842
|
+
display: none;
|
|
843
|
+
}
|
|
844
|
+
/* Tablet & Mobile TOC Drawer (max-width: 1319px) */
|
|
845
|
+
@media (max-width: 1319px) {
|
|
846
|
+
/* TOC Overlay */
|
|
847
|
+
.toc-overlay {
|
|
848
|
+
display: block;
|
|
849
|
+
position: fixed;
|
|
850
|
+
inset: 0;
|
|
851
|
+
background: linear-gradient(
|
|
852
|
+
135deg,
|
|
853
|
+
color-mix(in srgb, var(--color-bg) 90%, transparent) 0%,
|
|
854
|
+
color-mix(in srgb, var(--color-text) 15%, transparent) 100%
|
|
855
|
+
);
|
|
856
|
+
opacity: 0;
|
|
857
|
+
pointer-events: none;
|
|
858
|
+
transition: opacity 0.3s ease;
|
|
859
|
+
z-index: 235;
|
|
860
|
+
backdrop-filter: blur(2px);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.toc-overlay.open {
|
|
864
|
+
opacity: 1;
|
|
865
|
+
pointer-events: auto;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/* Mobile TOC Drawer Panel */
|
|
869
|
+
.toc-card {
|
|
870
|
+
position: fixed;
|
|
871
|
+
right: 0;
|
|
872
|
+
top: 0;
|
|
873
|
+
bottom: 0;
|
|
874
|
+
width: min(85vw, 340px);
|
|
875
|
+
margin-bottom: 0;
|
|
876
|
+
border-radius: var(--radius-lg) 0 0 var(--radius-lg);
|
|
877
|
+
border: none;
|
|
878
|
+
border-left: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
|
|
879
|
+
transform: translateX(100%);
|
|
880
|
+
opacity: 0;
|
|
881
|
+
visibility: hidden;
|
|
882
|
+
transition:
|
|
883
|
+
transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
|
|
884
|
+
opacity 0.3s ease,
|
|
885
|
+
visibility 0.3s ease;
|
|
886
|
+
z-index: 240;
|
|
887
|
+
overflow: auto;
|
|
888
|
+
overscroll-behavior: contain;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.toc-card.open {
|
|
892
|
+
transform: translateX(0);
|
|
893
|
+
opacity: 1;
|
|
894
|
+
visibility: visible;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/* Enhanced mobile TOC content */
|
|
898
|
+
.toc-card .toc-title {
|
|
899
|
+
padding-top: 1.25rem;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.toc-card .toc-nav {
|
|
903
|
+
padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.toc-card .toc-link {
|
|
907
|
+
padding: 0.65rem 0.75rem;
|
|
908
|
+
font-size: 0.85rem;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.toc-card .toc-link.depth-3 {
|
|
912
|
+
padding-left: 1.6rem;
|
|
913
|
+
font-size: 0.8rem;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/* Desktop Sidebar TOC (min-width 1320px) */
|
|
918
|
+
@media (min-width: 1320px) {
|
|
919
|
+
.toc-card {
|
|
920
|
+
position: fixed;
|
|
921
|
+
top: 8rem;
|
|
922
|
+
right: max(1.25rem, calc((100vw - 800px) / 2 - 250px - 1rem));
|
|
923
|
+
width: 240px;
|
|
924
|
+
max-height: calc(100vh - 10rem);
|
|
925
|
+
margin-bottom: 0;
|
|
926
|
+
z-index: 5;
|
|
927
|
+
overflow: auto;
|
|
928
|
+
overscroll-behavior: contain;
|
|
929
|
+
scrollbar-width: thin;
|
|
930
|
+
scrollbar-color: color-mix(in srgb, var(--color-border) 50%, transparent) transparent;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/* Custom scrollbar for desktop */
|
|
934
|
+
.toc-card::-webkit-scrollbar {
|
|
935
|
+
width: 4px;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.toc-card::-webkit-scrollbar-track {
|
|
939
|
+
background: transparent;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.toc-card::-webkit-scrollbar-thumb {
|
|
943
|
+
background: color-mix(in srgb, var(--color-border) 50%, transparent);
|
|
944
|
+
border-radius: 2px;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.toc-card::-webkit-scrollbar-thumb:hover {
|
|
948
|
+
background: color-mix(in srgb, var(--color-primary) 60%, transparent);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/* Subtle entrance animation */
|
|
952
|
+
.toc-card {
|
|
953
|
+
animation: tocSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
@keyframes tocSlideIn {
|
|
957
|
+
from {
|
|
958
|
+
opacity: 0;
|
|
959
|
+
transform: translateX(20px);
|
|
960
|
+
}
|
|
961
|
+
to {
|
|
962
|
+
opacity: 1;
|
|
963
|
+
transform: translateX(0);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/* Enhanced hover glow effect for desktop */
|
|
968
|
+
.toc-link:hover {
|
|
969
|
+
box-shadow:
|
|
970
|
+
0 4px 12px color-mix(in srgb, var(--color-primary) 12%, transparent),
|
|
971
|
+
0 0 20px color-mix(in srgb, var(--color-primary) 5%, transparent),
|
|
972
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-surface) 60%, transparent);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.toc-link.active {
|
|
976
|
+
box-shadow:
|
|
977
|
+
0 6px 20px color-mix(in srgb, var(--color-primary) 15%, transparent),
|
|
978
|
+
0 0 30px color-mix(in srgb, var(--color-primary) 8%, transparent),
|
|
979
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-surface) 60%, transparent);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/* Desktop TOC hidden state */
|
|
983
|
+
.toc-card.hidden {
|
|
984
|
+
display: none;
|
|
985
|
+
opacity: 0;
|
|
986
|
+
transform: translateX(20px);
|
|
987
|
+
pointer-events: none;
|
|
988
|
+
visibility: hidden;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/* Desktop TOC transition */
|
|
992
|
+
.toc-card {
|
|
993
|
+
transition:
|
|
994
|
+
transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
|
|
995
|
+
opacity 0.3s ease,
|
|
996
|
+
visibility 0.3s ease;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/* Reduced motion support */
|
|
1001
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1002
|
+
.toc-card,
|
|
1003
|
+
.toc-link,
|
|
1004
|
+
.toc-toggle,
|
|
1005
|
+
.toc-overlay,
|
|
1006
|
+
.toc-float-btn {
|
|
1007
|
+
transition: opacity 0.15s ease, visibility 0.15s ease;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.toc-link:hover,
|
|
1011
|
+
.toc-link.active {
|
|
1012
|
+
transform: none;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.toc-toggle:hover,
|
|
1016
|
+
.toc-toggle:active {
|
|
1017
|
+
transform: none;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
@keyframes tocSlideIn {
|
|
1021
|
+
from { opacity: 0; }
|
|
1022
|
+
to { opacity: 1; }
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
</style>
|
|
1026
|
+
|
|
1027
|
+
<script>
|
|
1028
|
+
import '../scripts/article';
|
|
1029
|
+
</script>
|