blob: 394c84b8976b1c247af7c56529db0df291f12ac7 [file] [log] [blame]
TRM-codingd1cbf672025-06-18 15:15:08 +08001/* --------- 容器 & Tabs --------- */
2.home-feed {
3 padding: 20px;
4}
5
6.feed-tabs {
7 display: flex;
8 flex-wrap: wrap;
9 gap: 12px;
10 margin-bottom: 20px;
11}
12
13.feed-tabs .tab {
14 padding: 6px 12px;
15 border: none;
16 background: #f0f0f0;
17 border-radius: 16px;
18 cursor: pointer;
19 transition: background 0.2s;
20}
21
22.feed-tabs .tab.active {
23 background: #ff4757;
24 color: #fff;
25}
26
27/* --------- 瀑布流布局 --------- */
28.feed-grid {
29 display: grid;
30 grid-gap: 16px;
31 grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
32}
33
34/* --------- 卡片样式及最大高度限制 --------- */
35.feed-card {
36 display: flex;
37 flex-direction: column;
38 max-height: 360px; /* 卡片最大高度 */
39 overflow: hidden; /* 超出部分隐藏 */
40 background: #fff;
41 border-radius: 8px;
42 box-shadow: 0 1px 4px rgba(0,0,0,0.1);
43 transition: transform 0.2s;
44}
45
46.feed-card:hover {
47 transform: translateY(-4px);
48}
49
50/* 封面图固定高度 */
51.card-img {
52 width: 100%;
53 height: 180px; /* 固定图片区域高度 */
54 object-fit: cover;
55 flex-shrink: 0; /* 不随容器收缩 */
56}
57
58/* 标题填充剩余空间 */
59.card-title {
60 font-size: 14px;
61 color: #333;
62 margin: 12px;
63 line-height: 1.4;
64 flex: 1; /* 占满中间区域 */
65 overflow: hidden;
66 text-overflow: ellipsis;
67 display: -webkit-box;
68 -webkit-line-clamp: 2; /* 最多两行 */
69 -webkit-box-orient: vertical;
70}
71
72/* --------- 底部:作者 + 点赞 --------- */
73.card-footer {
74 display: flex;
75 justify-content: space-between;
76 align-items: center;
77 padding: 8px 12px;
78 border-top: 1px solid #f0f0f0;
79 background: #fff;
80 flex-shrink: 0; /* 保持在底部 */
81}
82
83/* 作者区域 */
84.card-author {
85 display: flex;
86 align-items: center;
87 gap: 8px;
88}
89
90.card-author .avatar {
91 width: 24px;
92 height: 24px;
93 border-radius: 50%;
94 object-fit: cover;
95}
96
97.card-author .username {
98 font-size: 13px;
99 color: #333;
100}
101
102/* 点赞区域 */
103.card-likes {
104 display: flex;
105 align-items: center;
106 gap: 4px;
107}
108
109.card-likes svg {
110 color: #ff4757;
111}
112
113.card-likes .likes-count {
114 font-size: 13px;
115 color: #666;
22301008b2ef5192025-06-19 22:00:37 +0800116}
117
118/* --------- JWLLL 搜索推荐功能样式 --------- */
119
120/* 搜索框美化 */
121.feed-search {
122 display: flex;
123 gap: 8px;
124 align-items: center;
125}
126
127.search-input {
128 flex: 1;
129 padding: 8px 14px;
130 border: 1.5px solid #e0e0e0;
131 border-radius: 20px;
132 font-size: 15px;
133 outline: none;
134 transition: border 0.2s;
135 background: #fafbfc;
136}
137
138.search-input:focus {
139 border: 1.5px solid #e84c4a;
140 background: #fff;
141}
142
143.search-btn {
144 padding: 8px 22px;
145 border: none;
146 border-radius: 20px;
147 background: linear-gradient(90deg,#ff6a6a,#ff4757);
148 color: #fff;
149 font-weight: 600;
150 font-size: 15px;
151 cursor: pointer;
152 box-shadow: 0 2px 8px rgba(255,71,87,0.08);
153 transition: background 0.2s, box-shadow 0.2s;
154}
155
156.search-btn:hover {
157 background: linear-gradient(90deg,#ff4757,#e84c4a);
158 box-shadow: 0 4px 16px rgba(255,71,87,0.15);
159}
160
161/* 推荐模式切换按钮 */
162.rec-btn {
163 background: #f8f9fa;
164 border: 1px solid #dee2e6;
165 color: #495057;
166 padding: 6px 12px;
167 border-radius: 20px;
168 cursor: pointer;
169 transition: all 0.2s;
170 font-size: 14px;
171 outline: none;
172}
173
174.rec-btn:hover {
175 background: #e9ecef;
176}
177
178.rec-btn.active {
179 background: #fff0f0;
180 border: 2px solid #e84c4a;
181 color: #e84c4a;
182 font-weight: 600;
183}
184
185/* 卡片内容显示区域 */
186.card-content {
187 padding: 0 12px 8px;
188 font-size: 13px;
189 color: #666;
190 line-height: 1.4;
191 overflow: hidden;
192 text-overflow: ellipsis;
193 display: -webkit-box;
194 -webkit-line-clamp: 2;
195 -webkit-box-orient: vertical;
196}
197
198/* 点击效果 */
199.feed-card {
200 cursor: pointer;
201 transition: transform 0.2s, box-shadow 0.2s;
202}
203
204.feed-card:hover {
205 transform: translateY(-2px);
206 box-shadow: 0 4px 12px rgba(0,0,0,0.15);
TRM-codingd1cbf672025-06-18 15:15:08 +0800207}