fix: 修复管理后台样式丢失 + CSP inline style 违规

- 评论管理页:创建 comments.css,controller 传递 ExtraCSS/ExtraJS,模板移除所有 inline style,JS 改用 CSS 类
- 修复 comments.js 加载顺序:通过 ExtraJS 在 common.js 之后加载,解决 api is not defined
- base.html:SVG inline style 移至 common.css
- dashboard/index.html:3 处 inline style 替换为 CSS 类
- audit/index.html:modal 移除冗余 style="display:none"
- fund_logs/logs:label inline style 移至 energy.css
- common.css 新增多个 CSS 规则
- energy.css 新增 .filter-bar label 规则
This commit is contained in:
2026-06-02 21:37:52 +08:00
parent 983f539268
commit 543325105c
11 changed files with 174 additions and 20 deletions

View File

@ -0,0 +1,144 @@
/* ========== 管理后台评论管理 ========== */
/* --- 页面标题 --- */
.admin-page-header {
margin-bottom: 24px;
}
.admin-page-header h2 {
font-size: 22px;
font-weight: 600;
color: var(--text);
}
/* --- 工具栏/搜索 --- */
.admin-toolbar {
display: flex;
gap: 10px;
margin-bottom: 16px;
flex-wrap: wrap;
}
.admin-search-input {
flex: 1;
min-width: 200px;
max-width: 400px;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
font-size: 13px;
outline: none;
transition: border-color 0.2s;
}
.admin-search-input:focus {
border-color: var(--primary);
}
/* --- 表格 --- */
.admin-table-wrap {
background: var(--bg-card);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow-x: auto;
}
.admin-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.admin-table th {
text-align: left;
padding: 12px 16px;
background: #f9fafb;
color: var(--text-muted);
font-weight: 600;
font-size: 12px;
border-bottom: 2px solid var(--border);
white-space: nowrap;
}
.admin-table td {
padding: 12px 16px;
border-bottom: 1px solid #f0f0f0;
font-size: 13px;
color: #374151;
vertical-align: middle;
}
.admin-table tbody tr:hover {
background: #f8f9ff;
}
/* 列宽 */
.th-id { width: 60px; }
.th-author { width: 100px; }
.th-post { width: 160px; }
.th-time { width: 140px; }
.th-actions { width: 100px; }
/* 表格空状态 / 加载失败 */
.admin-table-empty {
text-align: center;
padding: 40px;
color: #9ca3af;
}
.admin-table-error {
text-align: center;
padding: 40px;
color: #dc2626;
}
/* 评论内容列 */
.comment-body-cell {
max-width: 320px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* --- 分页 --- */
.admin-pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: 20px;
}
.admin-page-link {
padding: 6px 14px;
border: 1px solid var(--border);
background: #fff;
border-radius: 4px;
font-size: 13px;
cursor: pointer;
color: var(--text);
text-decoration: none;
transition: all 0.15s;
}
.admin-page-link:hover {
border-color: var(--primary);
color: var(--primary);
}
.admin-page-info {
padding: 6px 14px;
font-size: 13px;
color: var(--text-muted);
}
/* --- 加载状态 --- */
.admin-loading {
text-align: center;
padding: 20px;
color: var(--text-muted);
font-size: 13px;
}
/* --- 按钮适配 --- */
.btn-secondary {
background: #e5e7eb;
color: #374151;
}
.btn-secondary:hover {
background: #d1d5db;
}
/* --- 工具类 --- */
.admin-hidden {
display: none;
}