summaryrefslogtreecommitdiff
path: root/assets/css/feed.css
blob: 32643120f81c1e48868f6cef40ab8ae7e1200e12 (plain)
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
@namespace atom "http://www.w3.org/2005/Atom";
@namespace content "http://purl.org/rss/1.0/modules/content/";
@namespace dc "http://purl.org/dc/elements/1.1/";

:root {
    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #222;
    --text-muted: #555;
    --text-light: #888;
    --max-width: 780px;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1c;
        --card-bg: #2c2c2e;
        --text-main: #e5e5e7;
        --text-muted: #a1a1a6;
        --text-light: #707074;
    }
}

body,
rss,
atom|feed {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0 auto; /* 合并 margin */
    padding: 2rem 1rem;
    font-size: 16px; /* 稍微调大基础字号提升阅读感 */
    line-height: 1.6;
    max-width: var(--max-width);
}

/* 标题样式优化 */
channel > title,
atom|feed > atom|title {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

/* 列表卡片 */
item,
atom|entry {
    display: block;
    background: var(--card-bg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

item:hover,
atom|entry:hover {
    transform: translateY(-2px); /* 轻微悬停效果 */
}

item > title,
atom|entry > atom|title {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* 多行省略号优化 */
item > description,
atom|entry > atom|summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4; /* 最多显示4行,自动加省略号 */
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 元数据(日期) */
item > pubDate,
atom|entry > atom|updated {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* 隐藏不需要的元素 */
link, guid, author, category, comments, source, enclosure, 
content|encoded, dc|creator, lastBuildDate, 
atom|id, atom|link, atom|updated, atom|published, atom|author, 
atom|category, atom|rights, atom|content, 
language, generator {
    display: none;
}

/* 副标题与说明文字 */
channel > description,
atom|feed > atom|subtitle {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

channel > description::after,
atom|feed > atom|subtitle::after {
    content: "这是一个订阅源(Feed)。复制当前URL到任何支持 Atom/RSS 的阅读器,即可订阅本博客的最新文章。\A以下展示了此订阅源包含的最新文章:";
    display: block;
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 1rem;
    padding: 1rem;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}