MediaWiki:Common.css:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* --- | /* --- 通用信息卡片样式 (基于 CSS 变量) --- */ | ||
. | |||
/* 1. 卡片外层容器 */ | |||
.mw-card-box { | |||
width: 100%; | width: 100%; | ||
background-color: #f8f9fa; | background-color: #f8f9fa; | ||
| 第8行: | 第10行: | ||
} | } | ||
/* 标题区 */ | /* 2. 标题区 (颜色跟随变量) */ | ||
. | .mw-card-header { | ||
background-color: #f4f8fc; | background-color: #f4f8fc; | ||
color: #000; | color: #000; | ||
font-weight: bold; | font-weight: bold; | ||
padding: 12px 18px; | padding: 12px 18px; | ||
text-align: left; | text-align: left; | ||
border-bottom: 3px solid #0077FF; /* | border-bottom: 3px solid var(--theme-color, #0077FF); /* 默认蓝色 */ | ||
font-size: 1.2em; | font-size: 1.2em; | ||
} | } | ||
/* | /* 3. 基础数据区 */ | ||
. | .mw-card-body { | ||
padding: 15px 18px; | padding: 15px 18px; | ||
background-color: #ffffff; | background-color: #ffffff; | ||
} | } | ||
/* 数据区内部弹性布局 */ | /* 4. 数据区内部弹性布局 */ | ||
. | .mw-card-flex { | ||
display: flex; | display: flex; | ||
justify-content: space-between; | justify-content: space-between; | ||
| 第34行: | 第36行: | ||
} | } | ||
. | .mw-card-col { | ||
flex: 1; | flex: 1; | ||
line-height: 1.7; | line-height: 1.7; | ||
min-width: 120px; | |||
} | } | ||
/* | /* 5. 右上角图标区 (颜色跟随变量) */ | ||
. | .mw-card-icon-box { | ||
flex: 0 0 auto; | flex: 0 0 auto; | ||
background-color: #0077FF; /* | background-color: var(--theme-color, #0077FF); /* 默认蓝色 */ | ||
padding: 4px 8px; | padding: 4px 8px; | ||
border-radius: 3px; | border-radius: 3px; | ||
| 第49行: | 第52行: | ||
} | } | ||
/* | /* 6. 分割线 */ | ||
. | .mw-card-divider { | ||
padding: 0; | |||
border-bottom: 1px solid #eaecf0; | |||
} | |||
/* 7. 图片/截图展示区 (颜色跟随变量) */ | |||
.mw-card-image-frame { | |||
text-align: center; | text-align: center; | ||
padding: 15px; | padding: 15px; | ||
background-color: #f2f7fb; | background-color: var(--theme-bg, #f2f7fb); | ||
border: 1px solid #0077FF; | border: 1px solid var(--theme-color, #0077FF); | ||
margin: 0; | margin: 0; | ||
} | } | ||
. | .mw-card-image-frame img { | ||
max-width: 100%; | max-width: 100%; | ||
height: auto; | height: auto; | ||
} | } | ||
. | .mw-card-caption { | ||
color: #666; | color: #666; | ||
margin-top: 6px; | margin-top: 6px; | ||
display: block; | display: block; | ||
} | |||
/* 8. 底部信息区 */ | |||
.mw-card-footer { | |||
padding: 15px 18px; | |||
background-color: #ffffff; | |||
line-height: 1.8; | |||
} | } | ||
2026年8月19日 (三) 21:03的版本
/* --- 通用信息卡片样式 (基于 CSS 变量) --- */
/* 1. 卡片外层容器 */
.mw-card-box {
width: 100%;
background-color: #f8f9fa;
border: 1px solid #a2a9b1;
padding: 0;
border-spacing: 0;
}
/* 2. 标题区 (颜色跟随变量) */
.mw-card-header {
background-color: #f4f8fc;
color: #000;
font-weight: bold;
padding: 12px 18px;
text-align: left;
border-bottom: 3px solid var(--theme-color, #0077FF); /* 默认蓝色 */
font-size: 1.2em;
}
/* 3. 基础数据区 */
.mw-card-body {
padding: 15px 18px;
background-color: #ffffff;
}
/* 4. 数据区内部弹性布局 */
.mw-card-flex {
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-wrap: wrap;
gap: 15px 30px;
}
.mw-card-col {
flex: 1;
line-height: 1.7;
min-width: 120px;
}
/* 5. 右上角图标区 (颜色跟随变量) */
.mw-card-icon-box {
flex: 0 0 auto;
background-color: var(--theme-color, #0077FF); /* 默认蓝色 */
padding: 4px 8px;
border-radius: 3px;
display: flex;
align-items: center;
}
/* 6. 分割线 */
.mw-card-divider {
padding: 0;
border-bottom: 1px solid #eaecf0;
}
/* 7. 图片/截图展示区 (颜色跟随变量) */
.mw-card-image-frame {
text-align: center;
padding: 15px;
background-color: var(--theme-bg, #f2f7fb);
border: 1px solid var(--theme-color, #0077FF);
margin: 0;
}
.mw-card-image-frame img {
max-width: 100%;
height: auto;
}
.mw-card-caption {
color: #666;
margin-top: 6px;
display: block;
}
/* 8. 底部信息区 */
.mw-card-footer {
padding: 15px 18px;
background-color: #ffffff;
line-height: 1.8;
}
/* ====================================================
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;
background-color: #f1f5f9;
}
/* ---------- 内容主容器 ---------- */
.mw-body {
background-color: #ffffff;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
padding: 2rem 2.5rem;
margin-top: 0.5rem;
border: 1px solid #d1d9e6;
}
/* ---------- 标题与层级 ---------- */
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
letter-spacing: -0.01em;
line-height: 1.3;
color: #0f172a;
}
h1 {
font-size: 2.2rem;
border-bottom: 3px solid #cbd5e1;
padding-bottom: 0.4rem;
margin-bottom: 1.2rem;
}
h2 {
font-size: 1.7rem;
border-bottom: 2px solid #d1d9e6;
padding-bottom: 0.3rem;
margin-top: 2rem;
}
h3 {
font-size: 1.3rem;
font-weight: 600;
}
/* ====================================================
链接样式 — 修复双下划线问题
==================================================== */
/* 基础链接:默认无下划线,仅保留细底边作为预备 */
a {
color: #1e4f8a;
text-decoration: none; /* 去掉所有文字装饰下划线 */
border-bottom: 1px solid transparent;
transition: border-color 0.15s ease, color 0.15s ease;
}
/* 悬浮时:仅显示一条清晰的底边,无文字下划线 */
a:hover {
color: #0b2b4a;
border-bottom-color: #1e4f8a; /* 仅底边变色,无 text-decoration */
text-decoration: none; /* 强制确保无文字下划线 */
}
/* 已访问链接保持同样风格 */
a:visited {
color: #1e4f8a;
}
/* ---------- 外部链接 (去掉MediaWiki默认背景图标,保留自定义上标) ---------- */
.mw-body a.external {
background: none;
padding-right: 0;
}
.mw-body a.external:after {
content: "↗";
font-size: 0.7em;
margin-left: 0.2em;
opacity: 0.6;
border-bottom: none; /* 避免图标带下划线 */
}
/* 外部链接悬浮时,图标不带下划线 */
.mw-body a.external:hover:after {
border-bottom: none;
}
/* ---------- 编辑区内的链接 (如编辑段落的[编辑]按钮) ---------- */
.mw-editsection a {
background: #e9edf2;
padding: 0.15rem 0.7rem;
border-radius: 2px;
color: #1e293b;
border: 1px solid #cbd5e1;
transition: all 0.1s;
text-decoration: none; /* 确保无下划线 */
}
.mw-editsection a:hover {
background: #1e4f8a;
color: white;
border-color: #1e4f8a;
border-bottom-color: #1e4f8a; /* 保持与边框一致 */
text-decoration: none;
}
/* ---------- 导航与页签 ---------- */
.vector-page-tabs .mw-list-item a {
border-radius: 2px 2px 0 0;
padding: 0.6rem 1.2rem;
font-weight: 500;
color: #475569;
transition: background 0.15s;
text-decoration: none; /* 导航链接无下划线 */
border-bottom: none; /* 导航链接不用底边,用背景区分 */
}
.vector-page-tabs .mw-list-item a:hover {
background: #e9edf2;
color: #0f172a;
border-bottom: none;
text-decoration: none;
}
.vector-page-tabs .mw-list-item.selected a {
background: #ffffff;
color: #1e4f8a;
border-bottom: 3px solid #1e4f8a;
font-weight: 600;
text-decoration: none;
}
/* ---------- 表格美化 ---------- */
.wikitable {
border-collapse: collapse;
border-radius: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
width: 100%;
background: white;
border: 1px solid #d1d9e6;
font-size: 0.95rem;
}
.wikitable th {
background: #e9edf2;
color: #0f172a;
font-weight: 600;
padding: 0.75rem 1rem;
border: 1px solid #cbd5e1;
text-align: left;
letter-spacing: 0.02em;
}
.wikitable td {
padding: 0.65rem 1rem;
border: 1px solid #d1d9e6;
background-color: #ffffff;
}
.wikitable tr:nth-child(even) td {
background-color: #f8fafc;
}
.wikitable tr:hover td {
background-color: #eef2f7;
}
.wikitable thead th {
border-bottom-width: 2px;
border-bottom-color: #94a3b8;
}
.wikitable .sortheader {
cursor: pointer;
}
.wikitable .sortheader:hover {
background: #d1d9e6;
}
/* ---------- 表格内链接 (保持风格统一) ---------- */
.wikitable a {
border-bottom: 1px solid transparent;
}
.wikitable a:hover {
border-bottom-color: #1e4f8a;
}
/* ---------- 信息框 ---------- */
.infobox {
background: #f8fafc;
border: 1px solid #cbd5e1;
border-radius: 2px;
padding: 1rem 1.2rem;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
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;
border-bottom: 1px solid #e2e8f0;
}
.infobox tr:last-child th,
.infobox tr:last-child td {
border-bottom: none;
}
.infobox .infobox-header {
font-weight: 700;
font-size: 1.2rem;
text-align: center;
background: #e2e8f0;
border-radius: 2px;
padding: 0.3rem 0.5rem;
}
/* ---------- 引用 ---------- */
ol.references {
font-size: 0.9rem;
background: #f8fafc;
padding: 0.8rem 1.5rem 0.8rem 2.5rem;
border-left: 4px solid #94a3b8;
border-radius: 0;
}
/* ---------- 消息框 ---------- */
.msgbox, .messagebox {
border-radius: 0;
padding: 1rem 1.5rem;
background: #f1f5f9;
border-left: 6px solid #64748b;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
margin: 1.2rem 0;
border-top: 1px solid #d1d9e6;
border-right: 1px solid #d1d9e6;
border-bottom: 1px solid #d1d9e6;
}
.msgbox.warning, .messagebox.warning {
border-left-color: #b45309;
background: #fffbeb;
}
.msgbox.error, .messagebox.error {
border-left-color: #b91c1c;
background: #fef2f2;
}
.msgbox.success, .messagebox.success {
border-left-color: #15803d;
background: #f0fdf4;
}
/* ---------- 代码块 ---------- */
pre, .mw-code {
background: #f1f5f9;
border: 1px solid #cbd5e1;
border-radius: 2px;
padding: 1rem 1.5rem;
font-family: "JetBrains Mono", "Fira Code", monospace;
font-size: 0.9rem;
overflow-x: auto;
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.02);
}
/* ---------- 目录 ---------- */
#toc {
background: #f8fafc;
border: 1px solid #cbd5e1;
border-radius: 2px;
padding: 0.8rem 1.5rem;
display: inline-block;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
#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;
}
/* ---------- 目录内链接 ---------- */
#toc a {
border-bottom: 1px solid transparent;
}
#toc a:hover {
border-bottom-color: #1e4f8a;
}
/* ---------- 编辑按钮 ---------- */
.mw-editsection {
font-size: 0.8rem;
}
.mw-editsection a {
background: #e9edf2;
padding: 0.15rem 0.7rem;
border-radius: 2px;
color: #1e293b;
border: 1px solid #cbd5e1;
transition: all 0.1s;
text-decoration: none;
}
.mw-editsection a:hover {
background: #1e4f8a;
color: white;
border-color: #1e4f8a;
text-decoration: none;
}
/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
.mw-body {
padding: 1rem 1.2rem;
border-radius: 2px;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
.infobox {
float: none;
margin: 1rem auto;
max-width: 100%;
}
}
/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: #e2e8f0;
border-radius: 0;
}
::-webkit-scrollbar-thumb {
background: #94a3b8;
border-radius: 0;
border: 1px solid #64748b;
}
::-webkit-scrollbar-thumb:hover {
background: #64748b;
}
/* ---------- 打印 ---------- */
@media print {
.mw-body {
box-shadow: none;
border: 1px solid #ccc;
padding: 0.5rem;
}
.wikitable {
box-shadow: none;
border: 1px solid #999;
}
.wikitable th {
background: #eee !important;
}
a {
border-bottom: 1px dotted #999 !important;
}
a:hover {
border-bottom-color: #999 !important;
}
}