Files
mce/templates/admin/static/css/site-settings.css
Victor_Jay ecbae7c4fa
Some checks failed
CI / Lint + Build (push) Has been cancelled
fix(admin): 修复设置页面 CSP style-src 违规导致加载失败
- 移除 site-settings 模板中的内联 style 属性(display:none, width:100px)
- 将内联样式迁移至 site-settings.css 的 CSS 类中
- site-settings-theme.js 用 className 替代 style.display 操作
2026-06-30 18:19:50 +08:00

160 lines
4.5 KiB
CSS

/* =====================================================
MetaLab 管理面板 - 站点设置
单一职责:设置页面布局、表单分组、开关组件
===================================================== */
/* --- 设置区块 --- */
.settings-section {
background: var(--bg-card);
border-radius: var(--radius);
box-shadow: var(--shadow);
margin-bottom: 20px;
overflow: hidden;
}
.section-title {
font-size: 15px; font-weight: 600;
color: var(--text);
padding: 16px 20px;
border-bottom: 1px solid var(--border);
background: #fafafa;
}
.section-body { padding: 4px 0; }
/* --- 设置条目 --- */
.setting-item {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 20px;
border-bottom: 1px solid #f5f5f5;
gap: 20px;
}
.setting-item:last-child { border-bottom: none; }
.setting-info { flex: 1; min-width: 0; }
.setting-label {
font-size: 13px; font-weight: 500;
color: var(--text); display: block;
}
.setting-desc {
font-size: 12px; color: var(--text-muted);
margin-top: 2px;
}
.setting-value {
font-size: 12px; color: var(--text-muted);
margin-top: 2px; font-family: monospace;
background: #f5f6fa; padding: 2px 6px; border-radius: 3px;
display: inline-block;
word-break: break-all;
}
/* --- 文本输入框 + 保存按钮 --- */
.setting-input-wrap {
display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.setting-input {
padding: 6px 10px; border: 1px solid var(--border);
border-radius: 4px; font-size: 13px; width: 200px;
outline: none; transition: border-color 0.2s;
}
.setting-input:focus { border-color: var(--primary); }
.btn-save { width: 56px; text-align: center; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
/* --- 垂直布局设置项(用于准则等大文本) --- */
.setting-item-vertical {
flex-direction: column; align-items: stretch;
}
.setting-item-vertical .setting-info {
margin-bottom: 10px;
}
.setting-input-block {
display: flex; flex-direction: column; gap: 10px;
}
.setting-textarea {
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 4px;
font-size: 13px; line-height: 1.6;
font-family: 'Courier New', Consolas, monospace;
resize: vertical;
width: 100%;
box-sizing: border-box;
outline: none;
transition: border-color 0.2s;
}
.setting-textarea:focus { border-color: var(--primary); }
.btn-save-block {
align-self: flex-end;
min-width: 80px;
}
.btn-save-block:disabled { opacity: 0.5; cursor: not-allowed; }
/* --- 空状态 --- */
.settings-empty {
text-align: center; padding: 28px 20px;
color: var(--text-muted); font-size: 13px;
}
/* --- Toggle 开关 --- */
.toggle-switch {
position: relative; display: inline-block;
width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
position: absolute; cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background: #ccc;
border-radius: 24px;
transition: background 0.2s;
}
.toggle-slider::before {
position: absolute; content: "";
height: 18px; width: 18px;
left: 3px; bottom: 3px;
background: #fff;
border-radius: 50%;
transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
opacity: 0.4; cursor: not-allowed;
}
/* --- 下拉选择器 + 保存按钮 --- */
.setting-select {
padding: 6px 10px; border: 1px solid var(--border);
border-radius: 4px; font-size: 13px; min-width: 220px;
outline: none; background: #fff; cursor: pointer;
transition: border-color 0.2s;
}
.setting-select:focus { border-color: var(--primary); }
.btn-save-select { min-width: 56px; text-align: center; }
.btn-save-select:disabled { opacity: 0.5; cursor: not-allowed; }
/* --- 主题信息详情 --- */
.setting-info-detail {
flex: 1; min-width: 0;
font-size: 13px; color: var(--text-muted);
}
/* --- 隐藏工具类 --- */
#theme-status { display: none; }
#theme-status.visible { display: block; }
/* --- 窄输入框 --- */
.setting-input-narrow { width: 100px; }
/* --- 主题状态提示 --- */
.status-success .section-body {
background: #e8f5e9; border-left: 3px solid #4caf50;
padding: 12px 20px;
}
.status-error .section-body {
background: #fce4ec; border-left: 3px solid #f44336;
padding: 12px 20px;
}