1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
| /* 文章目录自动编号(从二级标题开始) */
body {
counter-reset: h2;
}
h2 {
counter-reset: h3;
}
h3 {
counter-reset: h4;
}
h4 {
counter-reset: h5;
}
article[autonumbering] h2:before {
counter-increment: h2;
content: counter(h2) ". ";
}
article[autonumbering] h3:before {
counter-increment: h3;
content: counter(h2) "." counter(h3) " ";
}
article[autonumbering] h4:before {
counter-increment: h4;
content: counter(h2) "." counter(h3) "." counter(h4) " ";
}
article[autonumbering] .toc ul {
counter-reset: item
}
article[autonumbering] .toc li a:before {
content: counters(item, ".") " ";
counter-increment: item
}
:root {
--nav-width: 1380px;
--article-width: 650px;
--toc-width: 300px;
}
/* 调整目录样式 */
.toc {
margin: 0 2px 40px 2px;
border: 1px solid var(--border);
background: var(--entry);
border-radius: var(--radius);
padding: 0.4em;
}
/* 调整目录标题样式 */
.toc summary {
cursor: pointer;
margin-bottom: 10px;
font-size: 1.1em;
font-weight: 600;
display: flex;
align-items: center;
}
.toc-container.wide {
position: absolute;
height: 100%;
left: calc((var(--toc-width) + var(--gap)) * -0.92);
top: calc(var(--gap) * 1);
width: var(--toc-width);
}
.wide .toc {
position: sticky;
top: var(--gap);
border: unset;
background: unset;
border-radius: unset;
width: 100%;
margin: 0 2px 40px 2px;
}
.toc .details {
display: inline;
font-weight: 600;
}
.toc details summary {
cursor: pointer;
margin-bottom: 10px;
font-size: 1.1em;
font-weight: 600;
display: flex;
align-items: center;
list-style: none;
/* 移除原有Gecko箭头 */
}
/* 目录图标 */
.toc details summary::before {
content: "🪧";
margin-right: 8px;
font-size: 1.3em;
vertical-align: middle;
}
/* 移除原有webkit箭头 */
.toc details summary::-webkit-details-marker {
display: none;
}
.toc details[open] summary {
font-weight: 500;
}
.toc-container.wide .toc .inner {
margin: 0;
}
.toc ul {
list-style-type: circle;
}
.toc .inner {
margin: 0 0 0 20px;
padding: 0px 15px 15px 20px;
font-size: 16px;
}
.toc li ul {
margin-inline-start: calc(var(--gap) * 0.5);
list-style-type: none;
}
.toc li {
color: var(--secondary);
list-style: none;
font-size: 16px;
padding-bottom: 5px;
}
.toc li .active {
margin-inline-start: 5px;
color: rgb(49, 184, 204, 0.8);
border-bottom-color: rgb(49, 184, 204);
}
.toc li a:hover {
color: rgb(49, 184, 204, 0.8);
border-bottom-color: rgb(49, 184, 204);
}
/* 进度条样式 */
.progress-bar {
background: linear-gradient(to right, rgba(226, 107, 86, 0.87) 0%, rgba(226, 107, 86, 0.86) 100%);
height: 2px;
position: fixed;
top: 0;
left: 0;
width: 0;
z-index: 9999;
transition: width 0.2s ease-out;
}
/* 最新文章模块样式 */
.recent-container {
margin: 10px 0 0 0;
}
.recent-container.wide {
position: absolute;
height: 100%;
right: calc((var(--toc-width) + var(--gap)) * -0.92);
top: calc(var(--gap) * 1);
width: var(--toc-width);
}
.wide .recent {
position: sticky;
top: var(--gap);
border: unset;
background: unset;
border-radius: unset;
width: 100%;
margin: 0 2px 40px 2px;
}
.recent details summary {
cursor: pointer;
margin-bottom: 10px;
font-size: 1.1em;
font-weight: 600;
display: flex;
align-items: center;
}
.recent details summary::before {
content: "🪄";
margin-right: 8px;
font-size: 1.2em;
vertical-align: middle;
}
.recent-post-item a {
color: var(--secondary);
text-decoration: none;
transition: color 0.3s ease;
margin-left: 15px;
font-size: 16px;
border-bottom: 1px solid transparent;
}
.recent-post-item a:hover {
color: rgb(49, 184, 204, 0.8);
border-bottom-color: rgb(49, 184, 204);
}
/* 适配移动设备 */
@media screen and (max-width: 1400px) {
.recent-container.wide {
display: none;
}
}
|