MediaWiki:Common.css:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* ============================================ | /* ==================================================== | ||
MediaWiki 现代美化样式 | |||
============================================ */ | 适用版本:1.35+ / 1.39+ (皮肤:Vector 2022 及旧版兼容) | ||
说明:提升视觉层次、卡片化、柔和阴影、圆角与字体优化 | |||
==================================================== */ | |||
/* 1. | /* ---------- 基础排版优化 ---------- */ | ||
body { | |||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | |||
font-size: 16px; | |||
line-height: 1.65; | |||
color: #1e293b; /* slate-800 */ | |||
background-color: #f8fafc; /* slate-50 */ | |||
} | |||
/* 内容区背景柔和过渡 */ | |||
.mw-body { | |||
background-color: #ffffff; | |||
border-radius: 16px; | |||
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02); | |||
padding: 2rem 2.5rem; | |||
margin-top: 0.5rem; | |||
border: 1px solid rgba(203, 213, 225, 0.3); | |||
} | |||
/* ---------- 标题与标题层级 ---------- */ | |||
h1, h2, h3, h4, h5, h6 { | |||
font-weight: 600; | |||
letter-spacing: -0.02em; | |||
line-height: 1.3; | |||
color: #0f172a; /* slate-900 */ | |||
} | |||
h1 { | |||
font-size: 2.2rem; | |||
border-bottom: 3px solid #e2e8f0; | |||
padding-bottom: 0.4rem; | |||
margin-bottom: 1.2rem; | |||
} | |||
h2 { | |||
font-size: 1.7rem; | |||
border-bottom: 2px solid #e9edf2; | |||
padding-bottom: 0.3rem; | |||
margin-top: 2rem; | |||
} | |||
h3 { | |||
font-size: 1.3rem; | |||
font-weight: 600; | |||
} | |||
/* ---------- 链接美化 ---------- */ | |||
a { | a { | ||
color: #2563eb; /* blue-600 */ | |||
text-decoration: none; | |||
transition: color 0.15s ease, border-bottom 0.15s ease; | |||
border-bottom: 1px solid transparent; | |||
} | } | ||
a:hover { | a:hover { | ||
color: #1d4ed8; /* blue-700 */ | |||
border-bottom-color: #1d4ed8; | |||
} | } | ||
/* | /* 外部链接专属 */ | ||
a.external { | .mw-body a.external { | ||
background: none; | |||
padding-right: 0; | |||
} | |||
.mw-body a.external:after { | |||
content: "↗"; | |||
font-size: 0.75em; | |||
margin-left: 0.2em; | |||
opacity: 0.7; | |||
} | } | ||
/* ---------- 左侧导航 (Vector 2022) ---------- */ | |||
#vector-main-menu .vector-menu-content { | |||
background: transparent; | |||
} | } | ||
.vector-menu-tabs, .vector-menu-dropdown { | |||
background: transparent; | |||
} | } | ||
/* | /* 顶部标签栏 (页签) */ | ||
.vector-page-tabs .mw-list-item a { | |||
border-radius: 8px 8px 0 0; | |||
padding: 0.6rem 1.2rem; | |||
font-weight: 500; | |||
color: #475569; | |||
transition: background 0.15s; | |||
} | } | ||
.vector-page-tabs .mw-list-item a:hover { | |||
background: #f1f5f9; | |||
color: #0f172a; | |||
} | } | ||
.vector-page-tabs .mw-list-item.selected a { | |||
# | background: #ffffff; | ||
color: #2563eb; | |||
border-bottom: 3px solid #2563eb; | |||
font-weight: 600; | |||
} | } | ||
# | /* ---------- 编辑区工具栏 (wiki编辑器) ---------- */ | ||
.wikiEditor-ui { | |||
border-radius: 12px; | |||
border: 1px solid #e2e8f0; | |||
box-shadow: 0 2px 8px rgba(0,0,0,0.02); | |||
} | } | ||
/* | .wikiEditor-ui-toolbar { | ||
background: #f8fafc; | |||
border-radius: 12px 12px 0 0; | |||
} | |||
/* ---------- 信息框/表格美化 ---------- */ | |||
.wikitable { | .wikitable { | ||
border-collapse: separate; | |||
border-spacing: 0; | |||
border-radius: 12px; | |||
overflow: hidden; | |||
box-shadow: 0 2px 8px rgba(0,0,0,0.04); | |||
width: 100%; | |||
background: white; | |||
} | |||
.wikitable th { | |||
background: #f1f5f9; | |||
color: #1e293b; | |||
font-weight: 600; | |||
padding: 0.75rem 1rem; | |||
border-bottom: 2px solid #d1d9e6; | |||
} | |||
.wikitable td { | |||
padding: 0.75rem 1rem; | |||
border-bottom: 1px solid #e9edf2; | |||
} | |||
.wikitable tr:last-child td { | |||
border-bottom: none; | |||
} | |||
/* ---------- 信息框 (infobox) ---------- */ | |||
.infobox { | |||
background: #f8fafc; | |||
border: 1px solid #e2e8f0; | |||
border-radius: 16px; | |||
padding: 1.2rem 1.5rem; | |||
box-shadow: 0 2px 12px rgba(0,0,0,0.03); | |||
float: right; | |||
clear: right; | |||
margin: 0 0 1rem 1.5rem; | |||
max-width: 320px; | |||
width: 100%; | |||
} | |||
.infobox th, .infobox td { | |||
padding: 0.4rem 0.6rem; | |||
border: none; | |||
} | } | ||
.infobox: | .infobox .infobox-header { | ||
. | font-weight: 700; | ||
font-size: 1.2rem; | |||
text-align: center; | |||
background: #e9edf2; | |||
border-radius: 8px; | |||
padding: 0.3rem 0.5rem; | |||
} | } | ||
/* | /* ---------- 引用与参考文献 ---------- */ | ||
. | .mw-cite-backlink, .citation { | ||
. | color: #475569; | ||
} | } | ||
. | ol.references { | ||
font-size: 0.9rem; | |||
background: #f8fafc; | |||
padding: 1rem 1.5rem 1rem 2.5rem; | |||
border-radius: 12px; | |||
border-left: 4px solid #94a3b8; | |||
} | } | ||
/* | /* ---------- 消息框 (模板消息) ---------- */ | ||
. | .msgbox, .messagebox { | ||
border-radius: 12px; | |||
padding: 1rem 1.5rem; | |||
background: #f1f5f9; | |||
border-left: 6px solid #64748b; | |||
box-shadow: 0 2px 6px rgba(0,0,0,0.02); | |||
margin: 1.2rem 0; | |||
} | } | ||
.mw- | .msgbox.warning, .messagebox.warning { | ||
border-left-color: #f59e0b; | |||
background: #fffbeb; | |||
} | |||
.msgbox.error, .messagebox.error { | |||
border-left-color: #ef4444; | |||
background: #fef2f2; | |||
} | |||
.msgbox.success, .messagebox.success { | |||
border-left-color: #22c55e; | |||
background: #f0fdf4; | |||
} | |||
/* ---------- 代码与预格式化 ---------- */ | |||
pre, .mw-code { | |||
background: #f1f5f9; | |||
border: 1px solid #e2e8f0; | |||
border-radius: 12px; | |||
padding: 1rem 1.5rem; | |||
font-family: "JetBrains Mono", "Fira Code", monospace; | |||
font-size: 0.9rem; | |||
overflow-x: auto; | |||
box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); | |||
} | |||
/* ---------- 目录 (TOC) ---------- */ | |||
#toc { | |||
background: #f8fafc; | |||
border: 1px solid #e2e8f0; | |||
border-radius: 16px; | |||
padding: 1rem 1.5rem; | |||
display: inline-block; | |||
box-shadow: 0 2px 8px rgba(0,0,0,0.02); | |||
} | |||
#toc ul { | |||
margin-left: 0.5rem; | |||
} | } | ||
#toc li { | #toc li { | ||
list-style: none; | |||
padding: 0.15rem 0; | |||
} | |||
.toctitle h2 { | |||
font-size: 1.1rem; | |||
border-bottom: none; | |||
margin: 0 0 0.5rem 0; | |||
display: inline-block; | |||
} | |||
/* ---------- 编辑按钮/操作按钮 ---------- */ | |||
.mw-editsection { | |||
font-size: 0.8rem; | |||
} | } | ||
# | .mw-editsection a { | ||
background: #f1f5f9; | |||
padding: 0.2rem 0.7rem; | |||
border-radius: 20px; | |||
color: #475569; | |||
border: 1px solid #e2e8f0; | |||
transition: all 0.15s; | |||
} | } | ||
.mw-editsection a:hover { | |||
background: #2563eb; | |||
color: white; | |||
border-color: #2563eb; | |||
} | } | ||
/* ---------- 响应式微调 ---------- */ | |||
@media (max-width: 768px) { | |||
.mw-body { | |||
padding: 1rem 1.2rem; | |||
border-radius: 12px; | |||
} | |||
h1 { font-size: 1.8rem; } | |||
h2 { font-size: 1.4rem; } | |||
.infobox { | |||
float: none; | |||
margin: 1rem auto; | |||
max-width: 100%; | |||
} | |||
} | } | ||
/* | /* ---------- 滚动条 (可选) ---------- */ | ||
# | ::-webkit-scrollbar { | ||
width: 8px; | |||
height: 8px; | |||
} | |||
::-webkit-scrollbar-track { | |||
background: #f1f5f9; | |||
border-radius: 12px; | |||
} | |||
::-webkit-scrollbar-thumb { | |||
background: #cbd5e1; | |||
border-radius: 12px; | |||
} | |||
::-webkit-scrollbar-thumb:hover { | |||
background: #94a3b8; | |||
} | } | ||
/* ---------- 打印优化 ---------- */ | |||
@media print { | |||
.mw-body { | |||
border- | box-shadow: none; | ||
border: none; | |||
padding: 0; | |||
} | |||
a { | |||
border-bottom: 1px dotted #ccc; | |||
} | |||
.infobox { | |||
border: 1px solid #ccc; | |||
box-shadow: none; | |||
} | |||
} | } | ||
2026年8月19日 (三) 02:50的版本
/* ====================================================
MediaWiki 现代美化样式
适用版本:1.35+ / 1.39+ (皮肤:Vector 2022 及旧版兼容)
说明:提升视觉层次、卡片化、柔和阴影、圆角与字体优化
==================================================== */
/* ---------- 基础排版优化 ---------- */
body {
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.65;
color: #1e293b; /* slate-800 */
background-color: #f8fafc; /* slate-50 */
}
/* 内容区背景柔和过渡 */
.mw-body {
background-color: #ffffff;
border-radius: 16px;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
padding: 2rem 2.5rem;
margin-top: 0.5rem;
border: 1px solid rgba(203, 213, 225, 0.3);
}
/* ---------- 标题与标题层级 ---------- */
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
letter-spacing: -0.02em;
line-height: 1.3;
color: #0f172a; /* slate-900 */
}
h1 {
font-size: 2.2rem;
border-bottom: 3px solid #e2e8f0;
padding-bottom: 0.4rem;
margin-bottom: 1.2rem;
}
h2 {
font-size: 1.7rem;
border-bottom: 2px solid #e9edf2;
padding-bottom: 0.3rem;
margin-top: 2rem;
}
h3 {
font-size: 1.3rem;
font-weight: 600;
}
/* ---------- 链接美化 ---------- */
a {
color: #2563eb; /* blue-600 */
text-decoration: none;
transition: color 0.15s ease, border-bottom 0.15s ease;
border-bottom: 1px solid transparent;
}
a:hover {
color: #1d4ed8; /* blue-700 */
border-bottom-color: #1d4ed8;
}
/* 外部链接专属 */
.mw-body a.external {
background: none;
padding-right: 0;
}
.mw-body a.external:after {
content: "↗";
font-size: 0.75em;
margin-left: 0.2em;
opacity: 0.7;
}
/* ---------- 左侧导航 (Vector 2022) ---------- */
#vector-main-menu .vector-menu-content {
background: transparent;
}
.vector-menu-tabs, .vector-menu-dropdown {
background: transparent;
}
/* 顶部标签栏 (页签) */
.vector-page-tabs .mw-list-item a {
border-radius: 8px 8px 0 0;
padding: 0.6rem 1.2rem;
font-weight: 500;
color: #475569;
transition: background 0.15s;
}
.vector-page-tabs .mw-list-item a:hover {
background: #f1f5f9;
color: #0f172a;
}
.vector-page-tabs .mw-list-item.selected a {
background: #ffffff;
color: #2563eb;
border-bottom: 3px solid #2563eb;
font-weight: 600;
}
/* ---------- 编辑区工具栏 (wiki编辑器) ---------- */
.wikiEditor-ui {
border-radius: 12px;
border: 1px solid #e2e8f0;
box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.wikiEditor-ui-toolbar {
background: #f8fafc;
border-radius: 12px 12px 0 0;
}
/* ---------- 信息框/表格美化 ---------- */
.wikitable {
border-collapse: separate;
border-spacing: 0;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
width: 100%;
background: white;
}
.wikitable th {
background: #f1f5f9;
color: #1e293b;
font-weight: 600;
padding: 0.75rem 1rem;
border-bottom: 2px solid #d1d9e6;
}
.wikitable td {
padding: 0.75rem 1rem;
border-bottom: 1px solid #e9edf2;
}
.wikitable tr:last-child td {
border-bottom: none;
}
/* ---------- 信息框 (infobox) ---------- */
.infobox {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 1.2rem 1.5rem;
box-shadow: 0 2px 12px rgba(0,0,0,0.03);
float: right;
clear: right;
margin: 0 0 1rem 1.5rem;
max-width: 320px;
width: 100%;
}
.infobox th, .infobox td {
padding: 0.4rem 0.6rem;
border: none;
}
.infobox .infobox-header {
font-weight: 700;
font-size: 1.2rem;
text-align: center;
background: #e9edf2;
border-radius: 8px;
padding: 0.3rem 0.5rem;
}
/* ---------- 引用与参考文献 ---------- */
.mw-cite-backlink, .citation {
color: #475569;
}
ol.references {
font-size: 0.9rem;
background: #f8fafc;
padding: 1rem 1.5rem 1rem 2.5rem;
border-radius: 12px;
border-left: 4px solid #94a3b8;
}
/* ---------- 消息框 (模板消息) ---------- */
.msgbox, .messagebox {
border-radius: 12px;
padding: 1rem 1.5rem;
background: #f1f5f9;
border-left: 6px solid #64748b;
box-shadow: 0 2px 6px rgba(0,0,0,0.02);
margin: 1.2rem 0;
}
.msgbox.warning, .messagebox.warning {
border-left-color: #f59e0b;
background: #fffbeb;
}
.msgbox.error, .messagebox.error {
border-left-color: #ef4444;
background: #fef2f2;
}
.msgbox.success, .messagebox.success {
border-left-color: #22c55e;
background: #f0fdf4;
}
/* ---------- 代码与预格式化 ---------- */
pre, .mw-code {
background: #f1f5f9;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 1rem 1.5rem;
font-family: "JetBrains Mono", "Fira Code", monospace;
font-size: 0.9rem;
overflow-x: auto;
box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
/* ---------- 目录 (TOC) ---------- */
#toc {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 1rem 1.5rem;
display: inline-block;
box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
#toc ul {
margin-left: 0.5rem;
}
#toc li {
list-style: none;
padding: 0.15rem 0;
}
.toctitle h2 {
font-size: 1.1rem;
border-bottom: none;
margin: 0 0 0.5rem 0;
display: inline-block;
}
/* ---------- 编辑按钮/操作按钮 ---------- */
.mw-editsection {
font-size: 0.8rem;
}
.mw-editsection a {
background: #f1f5f9;
padding: 0.2rem 0.7rem;
border-radius: 20px;
color: #475569;
border: 1px solid #e2e8f0;
transition: all 0.15s;
}
.mw-editsection a:hover {
background: #2563eb;
color: white;
border-color: #2563eb;
}
/* ---------- 响应式微调 ---------- */
@media (max-width: 768px) {
.mw-body {
padding: 1rem 1.2rem;
border-radius: 12px;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
.infobox {
float: none;
margin: 1rem auto;
max-width: 100%;
}
}
/* ---------- 滚动条 (可选) ---------- */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 12px;
}
::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 12px;
}
::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
/* ---------- 打印优化 ---------- */
@media print {
.mw-body {
box-shadow: none;
border: none;
padding: 0;
}
a {
border-bottom: 1px dotted #ccc;
}
.infobox {
border: 1px solid #ccc;
box-shadow: none;
}
}