MediaWiki:Common.css
MediaWiki界面页面
更多操作
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* ===== 江中缘 Wiki 全局样式 ===== */
/* --- 基础样式 --- */
body {
font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
background: #f0f2f5;
color: #333;
line-height: 1.6;
}
/* --- 链接样式 --- */
a {
color: #1976d2;
text-decoration: none;
transition: color 0.2s;
}
a:hover {
color: #0d47a1;
text-decoration: underline;
}
/* --- 标题样式 --- */
#mw-content-wrapper h1,
#mw-content-wrapper h2,
#mw-content-wrapper h3,
#mw-content-wrapper h4 {
color: #1a237e;
border-bottom: 2px solid #1976d2;
padding-bottom: 8px;
margin-top: 24px;
}
#mw-content-wrapper h1 {
font-size: 2em;
}
#mw-content-wrapper h2 {
font-size: 1.5em;
}
#mw-content-wrapper h3 {
font-size: 1.2em;
border-bottom: none;
}
/* --- 内容区域 --- */
#mw-content {
background: white;
border-radius: 12px;
padding: 30px;
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
margin: 20px 0;
}
/* --- 表格样式 --- */
.wikitable {
border-collapse: collapse;
width: 100%;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wikitable th {
background: linear-gradient(135deg, #1565c0, #1976d2);
color: white;
padding: 14px 18px;
text-align: left;
font-weight: 600;
}
.wikitable td {
padding: 12px 18px;
border-bottom: 1px solid #eee;
}
.wikitable tr:hover td {
background: #f5f7fa;
}
.wikitable tr:nth-child(even) td {
background: #fafafa;
}
/* --- 信息框样式 --- */
.infobox {
background: white;
border: 1px solid #e0e4e8;
border-radius: 12px;
padding: 20px;
box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.infobox-title {
background: linear-gradient(135deg, #1565c0, #1976d2);
color: white;
padding: 14px 18px;
margin: -20px -20px 16px -20px;
border-radius: 12px 12px 0 0;
font-size: 1.2em;
font-weight: 600;
text-align: center;
}
/* --- 导航框样式 --- */
.navbox {
background: white;
border: 1px solid #e0e4e8;
border-radius: 12px;
padding: 16px;
margin: 24px 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.navbox-title {
background: linear-gradient(135deg, #1a237e, #283593);
color: white;
padding: 12px 16px;
margin: -16px -16px 12px -16px;
border-radius: 12px 12px 0 0;
font-weight: 600;
text-align: center;
}
/* --- 提示框样式 --- */
.ambox {
background: #e3f2fd;
border-left: 4px solid #1976d2;
border-radius: 0 8px 8px 0;
padding: 14px 18px;
margin: 16px 0;
}
.ambox-warning {
background: #fff3e0;
border-left-color: #ff9800;
}
.ambox-error {
background: #ffebee;
border-left-color: #f44336;
}
.ambox-success {
background: #e8f5e9;
border-left-color: #4caf50;
}
/* --- 引用框样式 --- */
blockquote {
background: #f5f7fa;
border-left: 4px solid #1976d2;
border-radius: 0 8px 8px 0;
padding: 16px 20px;
margin: 16px 0;
font-style: italic;
color: #555;
}
/* --- 代码框样式 --- */
code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 4px;
font-family: Consolas, monospace;
font-size: 0.9em;
color: #c62828;
}
pre {
background: #263238;
color: #aed581;
padding: 16px 20px;
border-radius: 8px;
overflow-x: auto;
font-family: Consolas, monospace;
}
/* --- 按钮样式 --- */
.wiki-button {
background: linear-gradient(135deg, #1565c0, #1976d2);
color: white;
padding: 10px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
transition: all 0.2s;
box-shadow: 0 4px 12px rgba(21,101,192,0.3);
}
.wiki-button:hover {
background: linear-gradient(135deg, #0d47a1, #1565c0);
box-shadow: 0 6px 16px rgba(13,71,161,0.4);
transform: translateY(-2px);
}
/* --- 卡片样式 --- */
.wiki-card {
background: white;
border: 1px solid #e0e4e8;
border-radius: 12px;
padding: 24px;
margin: 16px 0;
box-shadow: 0 2px 12px rgba(0,0,0,0.06);
transition: transform 0.2s, box-shadow 0.2s;
}
.wiki-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
/* --- 标签样式 --- */
.wiki-tag {
display: inline-block;
background: #e3f2fd;
color: #1565c0;
padding: 4px 12px;
border-radius: 16px;
font-size: 0.85em;
font-weight: 500;
margin: 2px 4px;
}
.wiki-tag-rare {
background: #f3e5f5;
color: #9c27b0;
}
.wiki-tag-epic {
background: #fff3e0;
color: #ff9800;
}
.wiki-tag-legendary {
background: #ffebee;
color: #f44336;
}
/* --- 进度条样式 --- */
.wiki-progress {
background: #e0e0e0;
border-radius: 10px;
height: 12px;
overflow: hidden;
margin: 8px 0;
}
.wiki-progress-bar {
background: linear-gradient(90deg, #4caf50, #8bc34a);
height: 100%;
border-radius: 10px;
transition: width 0.3s;
}
/* --- 隐藏默认元素 --- */
/* 隐藏页眉 */
#mw-head {
display: none;
}
/* 隐藏页脚 */
#footer {
display: none;
}
/* 隐藏侧边栏(如需要) */
/* #mw-panel { display: none; } */
/* --- 响应式调整 --- */
@media screen and (max-width: 768px) {
#mw-content {
padding: 16px;
margin: 10px;
border-radius: 8px;
}
.wikitable {
font-size: 0.9em;
}
.wikitable th,
.wikitable td {
padding: 10px 12px;
}
}
/* --- 动画效果 --- */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.wiki-animate {
animation: fadeIn 0.3s ease-out;
}
/* --- 滚动条美化 --- */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: #bdbdbd;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #9e9e9e;
}
/* ===== 深色模式适配 ===== */
@media (prefers-color-scheme: dark) {
body {
background: #1a1a2e;
color: #e0e0e0;
}
#mw-content {
background: #16213e;
box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
a {
color: #64b5f6;
}
a:hover {
color: #90caf9;
}
#mw-content-wrapper h1,
#mw-content-wrapper h2,
#mw-content-wrapper h3 {
color: #90caf9;
border-bottom-color: #1976d2;
}
.wikitable th {
background: linear-gradient(135deg, #0d47a1, #1565c0);
}
.wikitable td {
border-bottom-color: #2a2a4a;
}
.wikitable tr:hover td {
background: #1e2a4a;
}
.wikitable tr:nth-child(even) td {
background: #1a1a2e;
}
/* 卡片背景 */
[style*="background:white"],
[style*="background: white"] {
background: #16213e !important;
color: #e0e0e0;
}
[style*="background:#f5f5f5"],
[style*="background: #f5f5f5"] {
background: #1a1a2e !important;
}
/* 代码块 */
code {
background: #2a2a4a;
color: #ef9a9a;
}
pre {
background: #0d1117;
}
/* 滚动条 */
::-webkit-scrollbar-track {
background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
background: #4a4a6a;
}
}