-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
1894 lines (1633 loc) · 54.3 KB
/
archive.php
File metadata and controls
1894 lines (1633 loc) · 54.3 KB
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div class="main-layout">
<main class="main-content" id="main" role="main">
<!-- 归档页面头部 -->
<header class="archive-header">
<div class="archive-hero">
<?php if (!$this->is('category')): ?>
<div class="hero-background">
<div class="hero-pattern"></div>
</div>
<?php endif; ?>
<div class="hero-content">
<div class="archive-icon">
<?php if ($this->is('category')): ?>
<i class="fas fa-folder-open"></i>
<?php elseif ($this->is('tag')): ?>
<i class="fas fa-tags"></i>
<?php elseif ($this->is('search')): ?>
<i class="fas fa-search"></i>
<?php elseif ($this->is('author')): ?>
<i class="fas fa-user-circle"></i>
<?php else: ?>
<i class="fas fa-archive"></i>
<?php endif; ?>
</div>
<h1 class="archive-title">
<?php $this->archiveTitle([
'category' => _t('分类:%s'),
'search' => _t('搜索:%s'),
'tag' => _t('标签:%s'),
'author' => _t('作者:%s'),
'date' => _t('归档:%s')
], '', ''); ?>
</h1>
<!-- 归档描述 -->
<?php if ($this->is('category') && $this->getArchiveSlug()): ?>
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
<?php while ($category->next()): ?>
<?php if ($category->slug == $this->getArchiveSlug() && $category->description): ?>
<div class="archive-description">
<?php echo $category->description; ?>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<!-- 归档统计 -->
<div class="archive-stats">
<div class="stat-item">
<span class="stat-number" id="postCount">-</span>
<span class="stat-label">篇文章</span>
</div>
<div class="stat-item">
<span class="stat-number" id="commentCount">-</span>
<span class="stat-label">条评论</span>
</div>
<div class="stat-item">
<?php
$viewCount = 0;
if ($this->is('category')) {
$categoryId = $this->getArchiveSlug();
$category = null;
Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories);
while ($categories->next()) {
if ($categories->slug == $categoryId) {
$viewCount = getCategoryViews($categories->mid);
break;
}
}
} else {
// 对于非分类页面,可以计算所有文章的浏览量
$db = Typecho_Db::get();
$result = $db->fetchRow($db->select(array('SUM(views)' => 'sumviews'))
->from('table.contents')
->where('table.contents.status = ?', 'publish'));
$viewCount = intval($result['sumviews']);
}
?>
<span class="stat-number" id="viewCount" data-views="<?php echo $viewCount; ?>">-</span>
<span class="stat-label">次浏览</span>
</div>
</div>
</div>
</div>
</header>
<!-- 过滤器和排序 -->
<div class="archive-filters">
<div class="filter-group">
<label class="filter-label">
<i class="fas fa-sort"></i>
排序方式:
</label>
<select id="sortSelect" class="filter-select">
<option value="created_desc">发布时间(新到旧)</option>
<option value="created_asc">发布时间(旧到新)</option>
<option value="modified_desc">更新时间</option>
<option value="views_desc">浏览量</option>
<option value="comments_desc">评论数</option>
<option value="title_asc">标题</option>
</select>
</div>
<div class="filter-group">
<label class="filter-label">
<i class="fas fa-eye"></i>
显示方式:
</label>
<div class="view-toggle">
<button class="view-btn active" data-view="list" title="列表视图">
<i class="fas fa-list"></i>
</button>
<button class="view-btn" data-view="timeline" title="时间线视图">
<i class="fas fa-stream"></i>
</button>
</div>
</div>
<div class="filter-group">
<div class="search-box">
<input type="text" id="filterSearch" placeholder="在当前结果中搜索..." class="filter-input">
<button class="search-btn" id="filterBtn">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
<!-- 文章列表 -->
<div class="archive-content">
<?php if ($this->have()): ?>
<div class="posts-container view-list" id="postsContainer">
<?php $postCount = 0; ?>
<?php $commentTotal = 0; ?>
<?php while ($this->next()): ?>
<?php $postCount++; ?>
<?php $commentTotal += $this->commentsNum; ?>
<article class="archive-post-item"
data-date="<?php $this->date('Y-m-d'); ?>"
data-year="<?php $this->date('Y'); ?>"
data-month="<?php $this->date('m'); ?>"
itemscope itemtype="http://schema.org/BlogPosting">
<!-- 网格视图内容 -->
<div class="post-grid-content" style="display: none;">
<!-- 文章缩略图 -->
<div class="post-thumbnail">
<?php $thumbnail = getPostThumbnail($this); ?>
<?php if ($thumbnail): ?>
<img src="<?php echo $thumbnail; ?>"
alt="<?php $this->title(); ?>"
loading="lazy"
itemprop="image">
<?php else: ?>
<div class="thumbnail-placeholder">
<i class="fas fa-image"></i>
</div>
<?php endif; ?>
<!-- 文章标识 -->
<div class="post-badges">
<?php if ($this->isSticky): ?>
<span class="badge sticky">
<i class="fas fa-thumbtack"></i>
置顶
</span>
<?php endif; ?>
<?php if ($this->password): ?>
<span class="badge protected">
<i class="fas fa-lock"></i>
加密
</span>
<?php endif; ?>
</div>
<!-- 快速操作 -->
<div class="post-quick-actions">
<a href="<?php $this->permalink(); ?>" class="quick-action" title="阅读">
<i class="fas fa-book-open"></i>
</a>
<button class="quick-action like-btn" title="点赞">
<i class="fas fa-heart"></i>
</button>
<button class="quick-action share-btn" title="分享">
<i class="fas fa-share-alt"></i>
</button>
</div>
</div>
<!-- 文章信息 -->
<div class="post-info">
<!-- 分类标签 -->
<div class="post-category">
<?php $this->category(','); ?>
</div>
<!-- 文章标题 -->
<h2 class="post-title" itemprop="name headline">
<a href="<?php $this->permalink(); ?>" itemprop="url">
<?php $this->title(); ?>
</a>
</h2>
<!-- 文章摘要 -->
<div class="post-excerpt">
<?php echo getExcerpt($this->content, 120); ?>
</div>
<!-- 文章元数据 -->
<div class="post-meta">
<div class="meta-left">
<span class="meta-item meta-author">
<img src="<?php echo Typecho_Common::gravatarUrl($this->author->mail, 24, 'X', 'mm', $this->request->isSecure()); ?>"
alt="<?php $this->author(); ?>" class="author-avatar">
<a href="<?php $this->author->permalink(); ?>">
<?php $this->author(); ?>
</a>
</span>
<span class="meta-item meta-date">
<i class="fas fa-calendar-alt"></i>
<time datetime="<?php $this->date('c'); ?>" itemprop="datePublished">
<?php echo formatTime($this->created); ?>
</time>
</span>
</div>
<div class="meta-right">
<span class="meta-item meta-reading-time">
<i class="fas fa-clock"></i>
<?php echo getReadingTime($this->content); ?> 分钟
</span>
<span class="meta-item meta-comments">
<i class="fas fa-comments"></i>
<a href="<?php $this->permalink(); ?>#comments">
<?php $this->commentsNum('0', '1', '%d'); ?>
</a>
</span>
</div>
</div>
<!-- 文章标签 -->
<?php if ($this->tags): ?>
<div class="post-tags">
<?php $this->tags(' ', true, ''); ?>
</div>
<?php endif; ?>
</div>
</div>
<!-- 列表视图内容 -->
<div class="post-list-content" style="display: none;">
<div class="list-thumbnail">
<?php if ($thumbnail): ?>
<img src="<?php echo $thumbnail; ?>" alt="<?php $this->title(); ?>" loading="lazy">
<?php else: ?>
<div class="thumbnail-placeholder">
<i class="fas fa-file-alt"></i>
</div>
<?php endif; ?>
</div>
<div class="list-content">
<div class="list-header">
<h3 class="list-title">
<a href="<?php $this->permalink(); ?>"><?php $this->title(); ?></a>
</h3>
<div class="list-meta">
<span><?php $this->category(','); ?></span>
</div>
</div>
<div class="list-excerpt">
<?php echo getExcerpt($this->content, 200); ?>
</div>
<div class="list-footer">
<div class="list-tags">
<?php $this->tags(' ', true, ''); ?>
</div>
<a href="<?php $this->permalink(); ?>" class="read-more">
阅读全文 <i class="fas fa-arrow-right"></i>
</a>
</div>
</div>
</div>
<!-- 时间线视图内容 -->
<div class="post-timeline-content" style="display: none;">
<div class="timeline-date">
<span class="timeline-month"><?php $this->date('m'); ?></span>
<span class="timeline-day"><?php $this->date('d'); ?></span>
</div>
<div class="timeline-content">
<div class="timeline-header">
<h4 class="timeline-title">
<a href="<?php $this->permalink(); ?>"><?php $this->title(); ?></a>
</h4>
<div class="timeline-meta">
<?php $this->category(','); ?>
<span class="separator">•</span>
<?php $this->commentsNum('0', '1', '%d'); ?> 条评论
</div>
</div>
<div class="timeline-excerpt">
<?php echo getExcerpt($this->content, 100); ?>
</div>
</div>
</div>
</article>
<?php endwhile; ?>
</div>
<!-- 分页导航 -->
<div class="pagination-wrapper">
<?php $this->pageNav('← 上一页', '下一页 →', 3, '...', [
'wrapTag' => 'nav',
'wrapClass' => 'pagination-nav',
'itemTag' => '',
'textTag' => 'a',
'currentClass' => 'current',
'prevClass' => 'prev',
'nextClass' => 'next'
]); ?>
</div>
<?php else: ?>
<!-- 空状态 -->
<div class="empty-state">
<div class="empty-content">
<div class="empty-icon">
<i class="fas fa-search"></i>
</div>
<h3 class="empty-title">没有找到相关内容</h3>
<p class="empty-description">
<?php if ($this->is('search')): ?>
抱歉,没有找到包含 "<span class="search-keyword"><?php $this->archiveTitle('', '', ''); ?></span>" 的文章
<?php else: ?>
该分类下暂时没有文章
<?php endif; ?>
</p>
<div class="empty-actions">
<a href="<?php $this->options->siteUrl(); ?>" class="btn-primary">
<i class="fas fa-home"></i>
返回首页
</a>
<?php if ($this->is('search')): ?>
<button class="btn-secondary" onclick="document.getElementById('s').focus()">
<i class="fas fa-search"></i>
重新搜索
</button>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<!-- 相关分类/标签推荐 -->
<?php if ($this->is('category') || $this->is('tag')): ?>
<aside class="related-section">
<h3 class="section-title">
<i class="fas fa-lightbulb"></i>
<span><?php echo $this->is('category') ? '相关分类' : '相关标签'; ?></span>
</h3>
<div class="related-items">
<?php if ($this->is('category')): ?>
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories); ?>
<?php while ($categories->next()): ?>
<?php if ($categories->slug != $this->getArchiveSlug()): ?>
<a href="<?php $categories->permalink(); ?>" class="related-item category-item">
<div class="item-icon">
<i class="fas fa-folder"></i>
</div>
<div class="item-info">
<span class="item-name"><?php $categories->name(); ?></span>
<span class="item-count"><?php $categories->count(); ?> 篇</span>
</div>
</a>
<?php endif; ?>
<?php endwhile; ?>
<?php else: ?>
<?php Typecho_Widget::widget('Widget_Metas_Tag_Cloud', 'limit=10')->to($tags); ?>
<?php while ($tags->next()): ?>
<a href="<?php $tags->permalink(); ?>" class="related-item tag-item">
<div class="item-icon">
<i class="fas fa-tag"></i>
</div>
<div class="item-info">
<span class="item-name"><?php $tags->name(); ?></span>
<span class="item-count"><?php $tags->count(); ?> 篇</span>
</div>
</a>
<?php endwhile; ?>
<?php endif; ?>
</div>
</aside>
<?php endif; ?>
</main>
<?php $this->need('sidebar.php'); ?>
</div>
<?php $this->need('footer.php'); ?>
<style>
/* 归档页面样式 */
.main-content {
padding: 2rem 0;
}
/* 归档头部 */
.archive-header {
margin-bottom: 2rem;
}
.archive-hero {
position: relative;
background: var(--gradient-primary);
border-radius: var(--radius-xl);
overflow: hidden;
color: white;
}
.hero-background {
position: absolute;
inset: 0;
opacity: 0.1;
}
.hero-pattern {
width: 100%;
height: 100%;
background-image:
radial-gradient(circle at 20% 80%, rgba(255,255,255,0.3) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(255,255,255,0.3) 0%, transparent 50%);
}
.hero-content {
position: relative;
padding: 3rem 2rem;
text-align: center;
}
.archive-icon {
margin-bottom: 1rem;
}
.archive-icon i {
font-size: 3.5rem;
opacity: 0.9;
animation: pulse 2s ease-in-out infinite;
}
.archive-title {
font-size: 2.5rem;
font-weight: 700;
margin: 0 0 1rem;
text-shadow: 0 2px 10px rgba(0,0,0,0.2);
/* 覆盖style.css中的透明文字效果 */
background: none;
-webkit-background-clip: initial;
-webkit-text-fill-color: white;
background-clip: initial;
color: white;
}
.archive-description {
font-size: 1.1rem;
margin: 1rem 0 2rem;
opacity: 0.9;
max-width: 600px;
margin-left: auto;
margin-right: auto;
line-height: 1.6;
}
/* 归档统计 */
.archive-stats {
display: flex;
justify-content: center;
gap: 2rem;
margin-top: 2rem;
}
.stat-item {
text-align: center;
}
.stat-number {
display: block;
font-size: 1.8rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.8;
}
/* 过滤器 */
.archive-filters {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--bg-primary);
border-radius: var(--radius-lg);
border: 1px solid var(--border-color);
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 4px 15px var(--shadow-light);
flex-wrap: wrap;
gap: 1rem;
}
.filter-group {
display: flex;
align-items: center;
gap: 0.75rem;
}
.filter-label {
color: var(--text-secondary);
font-size: 0.9rem;
font-weight: 500;
display: flex;
align-items: center;
gap: 0.5rem;
}
.filter-label i {
color: var(--accent-primary);
font-size: 0.8rem;
}
.filter-select {
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
background: var(--bg-secondary);
color: var(--text-primary);
font-size: 0.9rem;
cursor: pointer;
transition: all var(--transition-fast) ease;
}
.filter-select:focus {
outline: none;
border-color: var(--accent-primary);
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}
/* 视图切换 */
.view-toggle {
display: flex;
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
overflow: hidden;
background: var(--bg-secondary);
}
.view-btn {
padding: 0.5rem 0.75rem;
border: none;
background: transparent;
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-fast) ease;
font-size: 0.9rem;
}
.view-btn:hover,
.view-btn.active {
background: var(--accent-primary);
color: white;
}
/* 搜索框 */
.search-box {
display: flex;
position: relative;
}
.filter-input {
padding: 0.5rem 1rem;
padding-right: 2.5rem;
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
background: var(--bg-secondary);
color: var(--text-primary);
font-size: 0.9rem;
width: 200px;
transition: all var(--transition-fast) ease;
}
.filter-input:focus {
outline: none;
border-color: var(--accent-primary);
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
width: 250px;
}
.search-btn {
position: absolute;
right: 0.25rem;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 0.25rem;
transition: color var(--transition-fast) ease;
}
.search-btn:hover {
color: var(--accent-primary);
}
/* 文章容器 */
.posts-container {
margin-bottom: 2rem;
}
/* 网格视图 */
.view-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 2rem;
}
/* 列表视图 */
.view-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.view-list .post-grid-content {
display: none;
}
.view-list .post-list-content {
display: flex !important;
}
/* 时间线视图 */
.view-timeline {
position: relative;
padding-left: 2rem;
}
.view-timeline::before {
content: '';
position: absolute;
left: 1rem;
top: 0;
bottom: 0;
width: 2px;
background: var(--gradient-primary);
border-radius: 1px;
}
.view-timeline .post-grid-content,
.view-timeline .post-list-content {
display: none;
}
.view-timeline .post-timeline-content {
display: flex !important;
}
.view-timeline .archive-post-item {
position: relative;
margin-bottom: 1.5rem;
}
.view-timeline .archive-post-item::before {
content: '';
position: absolute;
left: -1.75rem;
top: 1rem;
width: 12px;
height: 12px;
background: var(--accent-primary);
border: 3px solid var(--bg-primary);
border-radius: 50%;
z-index: 1;
}
/* 文章项样式 */
.archive-post-item {
background: var(--bg-primary);
border-radius: var(--radius-lg);
border: 1px solid var(--border-color);
overflow: hidden;
transition: all var(--transition-medium) ease;
box-shadow: 0 4px 15px var(--shadow-light);
}
.archive-post-item:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px var(--shadow-medium);
}
/* 网格内容 */
.post-thumbnail {
position: relative;
height: 200px;
background: var(--bg-secondary);
overflow: hidden;
}
.post-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform var(--transition-slow) ease;
}
.archive-post-item:hover .post-thumbnail img {
transform: scale(1.05);
}
.thumbnail-placeholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--gradient-primary);
color: white;
font-size: 2rem;
opacity: 0.8;
}
/* 文章标识 */
.post-badges {
position: absolute;
top: 1rem;
left: 1rem;
display: flex;
gap: 0.5rem;
}
.badge {
display: flex;
align-items: center;
gap: 0.25rem;
padding: 0.3rem 0.6rem;
border-radius: var(--radius-sm);
font-size: 0.75rem;
font-weight: 600;
color: white;
}
.badge.sticky {
background: #e74c3c;
}
.badge.protected {
background: #f39c12;
}
/* 快速操作 */
.post-quick-actions {
position: absolute;
top: 1rem;
right: 1rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
opacity: 0;
transition: opacity var(--transition-fast) ease;
}
.archive-post-item:hover .post-quick-actions {
opacity: 1;
}
.quick-action {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 50%;
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-fast) ease;
text-decoration: none;
backdrop-filter: blur(10px);
}
.quick-action:hover {
background: var(--accent-primary);
color: white;
transform: scale(1.1);
}
.quick-action::after {
display: none;
}
/* 文章信息 */
.post-info {
padding: 1.5rem;
}
.post-category a {
display: inline-block;
padding: 0.3rem 0.6rem;
background: var(--accent-primary);
color: white;
border-radius: var(--radius-sm);
font-size: 0.75rem;
font-weight: 500;
text-decoration: none;
margin-right: 0.5rem;
transition: all var(--transition-fast) ease;
/* 确保不使用透明文字效果 */
-webkit-background-clip: initial;
-webkit-text-fill-color: white;
background-clip: initial;
}
.post-category a::after {
display: none;
}
.post-category a:hover {
background: var(--accent-secondary);
transform: translateY(-1px);
}
.post-title {
margin: 1rem 0;
font-size: 1.3rem;
line-height: 1.3;
font-weight: 600;
}
.post-title a {
color: var(--text-primary);
text-decoration: none;
transition: color var(--transition-fast) ease;
/* 覆盖style.css中的透明文字效果 */
background: none;
-webkit-background-clip: initial;
-webkit-text-fill-color: initial;
background-clip: initial;
}
.post-title a::after {
display: none;
}
.post-title a:hover {
color: var(--accent-primary);
}
.post-excerpt {
color: var(--text-secondary);
line-height: 1.6;
margin-bottom: 1rem;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* 文章元数据 */
.post-meta {
display: flex;
justify-content: space-between;
align-items: center;
margin: 1rem 0;
font-size: 0.85rem;
color: var(--text-muted);
}
.meta-left,
.meta-right {
display: flex;
align-items: center;
gap: 1rem;
}
.meta-item {
display: flex;
align-items: center;
gap: 0.4rem;
}
.meta-item i {
color: var(--accent-primary);
font-size: 0.8rem;
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
border: 2px solid var(--accent-primary);
}
.meta-item a {
color: inherit;
text-decoration: none;
transition: color var(--transition-fast) ease;
}
.meta-item a::after {
display: none;
}
.meta-item a:hover {
color: var(--accent-primary);
}
/* 文章标签 */
.post-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 1rem;
}
.post-tags a {
padding: 0.25rem 0.5rem;
background: var(--bg-secondary);
color: var(--text-muted);
border-radius: var(--radius-sm);
font-size: 0.75rem;
text-decoration: none;
transition: all var(--transition-fast) ease;
border: 1px solid var(--border-color);
}
.post-tags a::after {
display: none;
}
.post-tags a:hover {
background: var(--accent-primary);
color: white;
border-color: var(--accent-primary);
transform: translateY(-1px);
}
/* 列表视图样式 */
.post-list-content {
display: flex;
gap: 1rem;
padding: 1.5rem;
background: var(--bg-primary);
border-radius: var(--radius-lg);
border: 1px solid var(--border-color);
}
.list-thumbnail {
flex-shrink: 0;
width: 120px;
height: 120px;
border-radius: var(--radius-md);
overflow: hidden;
background: var(--bg-secondary);
}
.list-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}
.list-content {
flex: 1;
min-width: 0;
}
.list-header {
margin-bottom: 1rem;
}
.list-title {
margin: 0 0 0.5rem;
font-size: 1.2rem;