Files
mce/templates/MetaLab-2026/static/css/space.css
Victor_Jay 797e9c15f4 refactor: space页面改为卡片式关注列表布局
- 重写 space/index.html:左右分栏,左侧导航栏 + 右侧卡片网格
- 自己空间:显示全部关注用户卡片(头像/用户名/简介/已关注标签)+ 设置入口
- 他人空间:简化侧栏(Ta的关注/粉丝),隐私关闭时显示空状态插图
- Model UserFollow 新增头像/简介联表字段
- Repository ListFollowing/ListFollowers SELECT 增加 avatar/bio
- Controller ShowSpace 注入 FollowService,获取关注列表数据
- space.css 完全重写为卡片网格布局 + 响应式适配
- follow.css 清理旧 .follow-btn/.follow-links 无用样式
2026-06-01 21:18:04 +08:00

406 lines
8.2 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ============================================================
MetaLab Space Styles — 卡片式关注列表布局
============================================================ */
/* ---------- Error State ---------- */
.space-error {
text-align: center;
padding: 80px 20px;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.space-error h1 {
font-size: 1.5rem;
color: var(--color-secondary);
margin-bottom: 1.5rem;
}
.space-error .btn {
display: inline-block;
padding: .6rem 1.8rem;
background: var(--color-accent);
color: #fff;
border-radius: var(--radius);
font-weight: 600;
transition: var(--transition);
}
.space-error .btn:hover {
background: #2980b9;
transform: translateY(-1px);
}
/* ---------- Page Layout ---------- */
.space-page {
flex: 1;
}
/* ============================================================
Card Layout — 左右分栏参考B站关注页
============================================================ */
.space-card-layout {
display: flex;
max-width: 1200px;
margin: 0 auto;
padding: 1.5rem 1rem;
gap: 1.5rem;
min-height: calc(100vh - 160px);
}
/* ---------- Sidebar (左侧导航) ---------- */
.space-sidebar {
width: 200px;
flex-shrink: 0;
}
.space-sidebar-title {
font-size: .95rem;
font-weight: 600;
color: var(--color-primary);
margin-bottom: .75rem;
padding-left: .25rem;
}
.space-sidebar-nav {
display: flex;
flex-direction: column;
gap: 2px;
}
.space-sidebar-link {
display: flex;
align-items: center;
gap: .5rem;
padding: .65rem .75rem;
border-radius: var(--radius);
text-decoration: none;
color: var(--color-text);
font-size: .9rem;
transition: background-color .15s ease;
}
.space-sidebar-link:hover {
background-color: #f5f5f5;
}
.space-sidebar-link.active {
background-color: var(--color-accent);
color: #fff;
font-weight: 500;
}
.space-sidebar-link.active:hover {
background-color: #2980b9;
}
.space-sidebar-link.disabled {
opacity: .6;
pointer-events: none;
}
.space-sidebar-icon {
flex-shrink: 0;
opacity: .8;
}
.space-sidebar-link.active .space-sidebar-icon {
opacity: 1;
}
.space-sidebar-count {
margin-left: auto;
font-size: .8rem;
opacity: .7;
}
.space-sidebar-hint {
margin-top: 1rem;
padding: 0 .25rem;
font-size: .78rem;
color: var(--color-secondary);
}
/* ---------- Main Content (右侧内容) ---------- */
.space-main {
flex: 1;
min-width: 0;
}
.space-main-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.25rem;
}
.space-main-title {
font-size: 1.35rem;
font-weight: 700;
color: var(--color-primary);
}
.space-settings-link {
font-size: .85rem;
color: var(--color-accent);
text-decoration: none;
padding: .3rem .75rem;
border: 1px solid var(--color-border, #e5e7eb);
border-radius: var(--radius);
transition: all .15s;
}
.space-settings-link:hover {
background-color: rgba(52, 152, 219, .05);
border-color: var(--color-accent);
}
/* ============================================================
User Card Grid — 用户卡片网格
============================================================ */
.space-user-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}
.space-user-card {
display: flex;
align-items: flex-start;
gap: .75rem;
padding: 1rem 1.1rem;
background: var(--color-surface, #fff);
border: 1px solid var(--color-border, #e5e7eb);
border-radius: var(--radius);
transition: box-shadow .2s ease, border-color .2s ease;
}
.space-user-card:hover {
box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
border-color: #ccc;
}
/* Avatar */
.space-user-avatar-wrap {
flex-shrink: 0;
text-decoration: none;
display: block;
}
.space-user-avatar-img {
width: 48px;
height: 48px;
border-radius: 50%;
object-fit: cover;
display: block;
}
.space-user-avatar-placeholder {
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--color-accent);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.15rem;
font-weight: 700;
}
/* User Info */
.space-user-info {
flex: 1;
min-width: 0;
}
.space-user-name {
display: block;
font-size: .92rem;
font-weight: 600;
color: var(--color-primary);
text-decoration: none;
line-height: 1.3;
margin-bottom: .2rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.space-user-name:hover {
color: var(--color-accent);
}
.space-user-bio {
font-size: .8rem;
color: var(--color-text-light);
line-height: 1.4;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
word-break: break-word;
}
/* Follow Button in Card */
.space-follow-btn {
flex-shrink: 0;
padding: .28rem .7rem;
border: 1.5px solid var(--color-accent);
border-radius: 6px;
font-size: .8rem;
font-weight: 500;
cursor: pointer;
transition: all .15s ease;
background: transparent;
color: var(--color-accent);
line-height: 1.4;
}
.space-follow-btn:hover {
background: var(--color-accent);
color: #fff;
}
.space-follow-btn.followed {
background: transparent;
border-color: var(--color-border, #e5e7eb);
color: var(--color-secondary);
cursor: default;
}
.space-follow-btn.followed:hover {
background: transparent;
color: var(--color-secondary);
}
.space-follow-btn.waiting {
opacity: .6;
pointer-events: none;
}
/* ============================================================
Empty / Private States
============================================================ */
.space-empty-state {
text-align: center;
padding: 4rem 1rem;
color: var(--color-secondary);
font-size: .95rem;
}
.space-private-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 5rem 1rem;
text-align: center;
}
.space-private-illustration {
margin-bottom: 1.25rem;
opacity: .6;
}
.space-private-text {
color: var(--color-secondary);
font-size: .95rem;
margin-bottom: 1rem;
}
.space-private-setting-btn {
display: inline-block;
padding: .5rem 1.25rem;
background: var(--color-accent);
color: #fff;
border-radius: var(--radius);
font-size: .88rem;
text-decoration: none;
transition: background .15s;
}
.space-private-setting-btn:hover {
background: #2980b9;
}
/* ============================================================
Pagination
============================================================ */
.pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
margin-top: 2rem;
font-size: .9rem;
}
.page-link {
padding: .4rem 1rem;
border: 1px solid var(--color-border);
border-radius: var(--radius);
color: var(--color-accent);
transition: var(--transition);
}
.page-link:hover {
border-color: var(--color-accent);
background: rgba(52, 152, 219, .05);
}
.page-info {
color: var(--color-secondary);
}
/* ============================================================
Responsive
============================================================ */
@media (max-width: 768px) {
.space-card-layout {
flex-direction: column;
padding: 1rem .75rem;
}
.space-sidebar {
width: 100%;
}
.space-sidebar-nav {
flex-direction: row;
overflow-x: auto;
gap: .5rem;
-webkit-overflow-scrolling: touch;
}
.space-sidebar-link {
white-space: nowrap;
flex-shrink: 0;
}
.space-sidebar-title {
margin-bottom: .5rem;
}
.space-sidebar-hint {
display: none;
}
.space-user-grid {
grid-template-columns: 1fr;
}
.space-user-card {
padding: .85rem 1rem;
}
.space-main-header {
flex-direction: column;
align-items: flex-start;
gap: .5rem;
}
}