This repository has been archived on 2026-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
Files
MetaLab/templates/MetaLab-2026/static/css/studio.css
Victor_Jay 4d212a8f8a feat: 收藏夹系统 + Studio 趋势图 + 通知偏好设置
- 新增收藏夹系统 (Folder/FolderItem 模型、CRUD API、前端管理页)
- 新增文章详情页收藏按钮 (书签图标、ToggleFavorite 一键收藏)
- 新增 Studio 趋势图 (赋能值/评论/点赞/收藏 4 线图, 7d/30d/90d)
- 新增通知偏好设置页 (评论/回复/点赞/关注 4 类开关)
- 后端通知列表支持按偏好过滤 (排除已关闭的通知类型)
- 下载 Chart.js 到本地静态资源 (static/js/chart.umd.min.js)
- 补充收藏夹卡片、开关滑块、趋势图网格等 CSS 样式
2026-06-01 17:33:59 +08:00

762 lines
14 KiB
CSS

/* ============================================================
MetaLab Studio — 创作中心专用样式
============================================================ */
/* ---------- 布局 ---------- */
.studio-wrapper {
display: flex;
min-height: calc(100vh - 120px);
}
/* ---------- 左侧导航 ---------- */
.studio-sidebar {
width: 220px;
min-width: 220px;
background: var(--color-surface);
border-right: 1px solid var(--color-border);
padding: 24px 0;
flex-shrink: 0;
}
.sidebar-brand {
font-size: 18px;
font-weight: 700;
color: var(--color-primary);
padding: 0 24px 20px;
border-bottom: 1px solid var(--color-border);
margin-bottom: 12px;
}
.sidebar-nav {
display: flex;
flex-direction: column;
}
.sidebar-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 24px;
font-size: 15px;
color: var(--color-text-light);
transition: var(--transition);
border-left: 3px solid transparent;
}
.sidebar-item:hover {
background: #f0f4ff;
color: var(--color-accent);
}
.sidebar-item.active {
background: #e8f0fe;
color: var(--color-accent);
border-left-color: var(--color-accent);
font-weight: 600;
}
.sidebar-icon {
font-size: 18px;
width: 24px;
text-align: center;
}
/* ---------- 主内容区 ---------- */
.studio-main {
flex: 1;
padding: 32px 40px;
overflow-y: auto;
}
.studio-header {
margin-bottom: 28px;
}
.studio-header h1 {
font-size: 24px;
font-weight: 700;
color: var(--color-primary);
margin-bottom: 6px;
}
.studio-subtitle {
font-size: 14px;
color: var(--color-secondary);
}
.header-counts {
display: flex;
gap: 16px;
margin-top: 8px;
}
.header-count {
font-size: 13px;
padding: 2px 10px;
border-radius: 12px;
background: #f0f0f0;
color: var(--color-text-light);
}
.header-count.approved { background: #e8f5e9; color: #2e7d32; }
.header-count.pending { background: #fff3e0; color: #e65100; }
.header-count.draft { background: #e3f2fd; color: #1565c0; }
.header-count.rejected { background: #ffebee; color: #c62828; }
/* ---------- 统计卡片 ---------- */
.stat-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 16px;
margin-bottom: 28px;
}
.stat-card {
background: var(--color-surface);
border-radius: var(--radius);
padding: 20px;
box-shadow: var(--shadow);
display: flex;
align-items: center;
gap: 16px;
transition: var(--transition);
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.stat-card-icon {
font-size: 32px;
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
background: #f5f5f5;
border-radius: 12px;
}
.stat-card-body {
display: flex;
flex-direction: column;
}
.stat-card-value {
font-size: 28px;
font-weight: 700;
color: var(--color-primary);
line-height: 1.2;
}
.stat-card-label {
font-size: 13px;
color: var(--color-secondary);
margin-top: 2px;
}
.stat-card-approved .stat-card-icon { background: #e8f5e9; }
.stat-card-approved .stat-card-value { color: #2e7d32; }
.stat-card-pending .stat-card-icon { background: #fff3e0; }
.stat-card-pending .stat-card-value { color: #e65100; }
.stat-card-draft .stat-card-icon { background: #e3f2fd; }
.stat-card-draft .stat-card-value { color: #1565c0; }
.stat-card-rejected .stat-card-icon { background: #ffebee; }
.stat-card-rejected .stat-card-value { color: #c62828; }
/* ---------- 通用区块 ---------- */
.studio-section {
background: var(--color-surface);
border-radius: var(--radius);
padding: 24px;
box-shadow: var(--shadow);
margin-bottom: 20px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: var(--color-primary);
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--color-border);
}
/* ---------- 状态条 ---------- */
.status-bar {
display: flex;
height: 32px;
border-radius: 6px;
overflow: hidden;
gap: 2px;
background: #eee;
}
.status-bar-segment {
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 600;
color: #fff;
min-width: 80px;
}
.status-bar-approved { background: #4caf50; }
.status-bar-draft { background: #42a5f5; }
.status-bar-pending { background: #ff9800; }
.status-bar-rejected { background: #ef5350; }
/* ---------- 快捷操作 ---------- */
.quick-actions {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.quick-action-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 10px 20px;
border-radius: 8px;
background: #f5f5f5;
color: var(--color-text);
font-size: 14px;
transition: var(--transition);
border: 1px solid var(--color-border);
}
.quick-action-btn:hover {
background: #e8f0fe;
border-color: var(--color-accent);
color: var(--color-accent);
}
.quick-action-btn.primary {
background: var(--color-accent);
color: #fff;
border-color: var(--color-accent);
}
.quick-action-btn.primary:hover {
background: #2980b9;
}
/* ---------- 状态筛选 Tabs ---------- */
.status-tabs {
display: flex;
gap: 0;
margin-bottom: 20px;
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
}
.status-tab {
padding: 10px 20px;
font-size: 14px;
color: var(--color-text-light);
transition: var(--transition);
border-bottom: 2px solid transparent;
}
.status-tab:hover {
color: var(--color-accent);
background: #f8f9fa;
}
.status-tab.active {
color: var(--color-accent);
font-weight: 600;
border-bottom-color: var(--color-accent);
background: #e8f0fe;
}
/* ---------- 帖子列表 ---------- */
.post-list {
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
}
.post-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid var(--color-border);
transition: var(--transition);
}
.post-item:last-child {
border-bottom: none;
}
.post-item:hover {
background: #f8f9fa;
}
.post-item-main {
flex: 1;
min-width: 0;
}
.post-item-title {
font-size: 15px;
font-weight: 600;
color: var(--color-primary);
display: block;
margin-bottom: 6px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.post-item-title:hover {
color: var(--color-accent);
}
.draft-title {
color: var(--color-secondary);
}
.post-item-meta {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--color-secondary);
}
.post-status-badge {
display: inline-block;
padding: 1px 8px;
border-radius: 10px;
font-size: 12px;
font-weight: 600;
}
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-draft { background: #e3f2fd; color: #1565c0; }
.status-rejected { background: #ffebee; color: #c62828; }
.status-locked { background: #f3e5f5; color: #6a1b9a; }
.post-reject-hint {
color: #c62828;
font-style: italic;
}
.post-item-actions {
display: flex;
gap: 8px;
flex-shrink: 0;
margin-left: 16px;
}
.action-btn {
padding: 6px 14px;
border-radius: 6px;
font-size: 13px;
border: 1px solid var(--color-border);
background: #f5f5f5;
color: var(--color-text-light);
cursor: pointer;
transition: var(--transition);
white-space: nowrap;
}
.action-btn:hover {
background: #e8f0fe;
border-color: var(--color-accent);
color: var(--color-accent);
}
.action-btn.primary {
background: var(--color-accent);
color: #fff;
border-color: var(--color-accent);
}
.action-btn.primary:hover {
background: #2980b9;
}
.action-btn.danger {
color: var(--color-danger);
border-color: #ffcdd2;
}
.action-btn.danger:hover {
background: #ffebee;
border-color: var(--color-danger);
}
/* ---------- 分页 ---------- */
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
padding: 20px;
}
.page-btn {
padding: 6px 16px;
border-radius: 6px;
border: 1px solid var(--color-border);
background: var(--color-surface);
color: var(--color-text);
font-size: 14px;
transition: var(--transition);
}
.page-btn:hover {
background: #e8f0fe;
border-color: var(--color-accent);
color: var(--color-accent);
}
.page-info {
font-size: 14px;
color: var(--color-secondary);
}
/* ---------- 空状态 ---------- */
.studio-empty {
text-align: center;
padding: 60px 20px;
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.studio-empty p {
font-size: 16px;
color: var(--color-secondary);
margin-bottom: 20px;
}
.btn-primary {
display: inline-block;
padding: 10px 24px;
background: var(--color-accent);
color: #fff;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
transition: var(--transition);
}
.btn-primary:hover {
background: #2980b9;
color: #fff;
}
/* ---------- 锁定提示 ---------- */
.studio-locked-banner {
display: flex;
gap: 14px;
align-items: center;
padding: 16px 20px;
margin-bottom: 20px;
background: #f3e5f5;
border: 1px solid #ce93d8;
border-radius: var(--radius);
color: #6a1b9a;
font-size: 14px;
}
.studio-locked-banner p {
margin: 4px 0 0;
font-size: 13px;
color: #8e24aa;
}
.studio-locked-banner strong {
font-size: 15px;
}
.locked-banner-icon {
font-size: 28px;
flex-shrink: 0;
}
.locked-submit-hint {
font-size: 14px;
color: #6a1b9a;
font-weight: 600;
padding: 8px 16px;
background: #f3e5f5;
border-radius: 8px;
}
/* ---------- 占位提示 ---------- */
.studio-placeholder {
text-align: center;
padding: 40px;
color: var(--color-secondary);
font-size: 15px;
}
/* ---------- 错误提示 ---------- */
.studio-error {
background: #ffebee;
color: #c62828;
padding: 16px 20px;
border-radius: var(--radius);
margin-bottom: 20px;
font-size: 14px;
}
/* ============================================================
编辑器样式(复用自 posts/new.html 的编辑器布局)
============================================================ */
.editor-layout {
width: 100%;
}
.editor-form {
max-width: 100%;
}
.editor-header {
margin-bottom: 16px;
}
.editor-title-input {
width: 100%;
padding: 14px 0;
border: none;
border-bottom: 2px solid var(--color-border);
font-size: 22px;
font-weight: 600;
outline: none;
background: transparent;
color: var(--color-primary);
transition: var(--transition);
}
.editor-title-input:focus {
border-bottom-color: var(--color-accent);
}
.editor-title-input::placeholder {
color: #ccc;
}
.editor-main {
display: flex;
gap: 20px;
margin-bottom: 16px;
}
.editor-pane {
flex: 1;
min-width: 0;
}
.editor-sidebar {
width: 200px;
flex-shrink: 0;
}
.editor-sidebar-section {
background: var(--color-surface);
border-radius: var(--radius);
padding: 16px;
box-shadow: var(--shadow);
margin-bottom: 12px;
}
.editor-sidebar-section h4 {
font-size: 13px;
font-weight: 600;
color: var(--color-primary);
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px solid var(--color-border);
}
.tips-list {
list-style: none;
font-size: 12px;
color: var(--color-secondary);
line-height: 2;
}
.tips-list code {
background: #f0f0f0;
padding: 1px 5px;
border-radius: 3px;
font-size: 11px;
}
.editor-statusbar {
display: flex;
align-items: center;
padding: 12px 0;
border-top: 1px solid var(--color-border);
gap: 16px;
}
.status-item {
font-size: 13px;
color: var(--color-secondary);
}
.status-spacer {
flex: 1;
}
.btn-submit {
padding: 8px 24px;
}
/* ---------- 趋势图 ---------- */
.trends-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.trends-period {
display: flex;
gap: 4px;
background: #f3f4f6;
border-radius: 8px;
padding: 3px;
}
.trends-period-btn {
padding: 6px 14px;
border: none;
background: transparent;
font-size: 13px;
font-weight: 500;
color: #6b7280;
border-radius: 6px;
cursor: pointer;
font-family: inherit;
transition: all .15s ease;
}
.trends-period-btn.active {
background: #fff;
color: #111827;
font-weight: 600;
box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.trends-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.trends-card {
background: var(--color-surface);
border-radius: var(--radius);
box-shadow: var(--shadow);
border: 1px solid var(--color-border);
padding: 20px;
}
.trends-card-title {
font-size: 14px;
font-weight: 600;
color: var(--color-text);
margin: 0 0 12px 0;
}
.trends-chart-wrap {
position: relative;
width: 100%;
height: 220px;
}
.trends-chart-wrap canvas {
display: block;
}
.trends-loading {
display: none;
text-align: center;
padding: 60px 0;
color: #9ca3af;
font-size: 13px;
}
.trends-no-data {
display: flex;
align-items: center;
justify-content: center;
height: 220px;
color: #9ca3af;
font-size: 14px;
}
/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
.studio-wrapper {
flex-direction: column;
}
.studio-sidebar {
width: 100%;
min-width: 100%;
border-right: none;
border-bottom: 1px solid var(--color-border);
padding: 12px 0;
}
.sidebar-nav {
flex-direction: row;
overflow-x: auto;
padding: 0 12px;
}
.sidebar-item {
padding: 8px 16px;
border-left: none;
border-bottom: 2px solid transparent;
white-space: nowrap;
}
.sidebar-item.active {
border-left: none;
border-bottom-color: var(--color-accent);
}
.stat-cards {
grid-template-columns: repeat(2, 1fr);
}
.post-item {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
.post-item-actions {
margin-left: 0;
}
.editor-main {
flex-direction: column;
}
.editor-sidebar {
width: 100%;
}
}