MediaWiki:Common.css:修订间差异

来自心灵终结资料站
跳转到导航 跳转到搜索
无编辑摘要
Lyx讨论 | 贡献
无编辑摘要
第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 {
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
  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: #d4532a; /* 醒目橙红色 */
  color: #1d4ed8; /* blue-700 */
    text-decoration-color: #d4532a;
  border-bottom-color: #1d4ed8;
}
}


/* 2. 外部链接 - 添加右箭头动画 */
/* 外部链接专属 */
a.external {
.mw-body a.external {
    transition: all 0.3s ease;
  background: none;
  padding-right: 0;
}
.mw-body a.external:after {
  content: "↗";
  font-size: 0.75em;
  margin-left: 0.2em;
  opacity: 0.7;
}
}


a.external:hover {
/* ---------- 左侧导航 (Vector 2022) ---------- */
    padding-right: 4px;
#vector-main-menu .vector-menu-content {
    color: #2a6b9e;
  background: transparent;
}
}


a.external:hover::after {
.vector-menu-tabs, .vector-menu-dropdown {
    content: " →";
  background: transparent;
    transition: all 0.3s ease;
}
}


/* 3. 导航栏链接 - 背景高亮 */
/* 顶部标签栏 (页签) */
#mw-panel a,
.vector-page-tabs .mw-list-item a {
#p-navigation a {
  border-radius: 8px 8px 0 0;
    display: block;
  padding: 0.6rem 1.2rem;
    padding: 4px 8px;
  font-weight: 500;
    border-radius: 4px;
  color: #475569;
    transition: background-color 0.25s ease, padding-left 0.25s ease;
  transition: background 0.15s;
}
}


#mw-panel a:hover,
.vector-page-tabs .mw-list-item a:hover {
#p-navigation a:hover {
  background: #f1f5f9;
    background-color: #eaf3ff;
  color: #0f172a;
    padding-left: 12px;
}
}


/* 4. 页面标题 - 微缩放 */
.vector-page-tabs .mw-list-item.selected a {
#firstHeading {
  background: #ffffff;
    transition: transform 0.3s ease;
  color: #2563eb;
  border-bottom: 3px solid #2563eb;
  font-weight: 600;
}
}


#firstHeading:hover {
/* ---------- 编辑区工具栏 (wiki编辑器) ---------- */
    transform: scale(1.02);
.wikiEditor-ui {
    color: #2a4b7a;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
}


/* 5. 信息框或卡片样式悬停 */
.wikiEditor-ui-toolbar {
.infobox,
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}
 
/* ---------- 信息框/表格美化 ---------- */
.wikitable {
.wikitable {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  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:hover,
.infobox .infobox-header {
.wikitable:hover {
  font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
    transform: translateY(-2px);
  text-align: center;
  background: #e9edf2;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}
}


/* 6. 图片悬停 - 轻微放大和阴影 */
/* ---------- 引用与参考文献 ---------- */
.thumb img,
.mw-cite-backlink, .citation {
.image img {
  color: #475569;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border-radius: 4px;
}
}


.thumb img:hover,
ol.references {
.image img:hover {
  font-size: 0.9rem;
    transform: scale(1.02);
  background: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 1rem 1.5rem 1rem 2.5rem;
  border-radius: 12px;
  border-left: 4px solid #94a3b8;
}
}


/* 7. 按钮悬停效果(如有自定义按钮类) */
/* ---------- 消息框 (模板消息) ---------- */
.mw-ui-button {
.msgbox, .messagebox {
    transition: all 0.3s ease;
  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-ui-button:hover {
.msgbox.warning, .messagebox.warning {
    transform: translateY(-2px);
  border-left-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  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;
}
}


/* 8. 目录列表悬停 - 左移效果 */
#toc li {
#toc li {
    transition: padding-left 0.2s ease;
  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;
}
}


#toc li:hover {
.mw-editsection a {
    padding-left: 8px;
  background: #f1f5f9;
    color: #2a6b9e;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.15s;
}
}


/* 9. 分类链接悬停 - 背景色块 */
.mw-editsection a:hover {
#catlinks a {
  background: #2563eb;
    padding: 2px 6px;
  color: white;
    border-radius: 3px;
  border-color: #2563eb;
    transition: background-color 0.3s ease;
}
}


#catlinks a:hover {
/* ---------- 响应式微调 ---------- */
     background-color: #d9e8ff;
@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%;
  }
}
}


/* 10. 编辑区链接工具条(如编辑、查看历史等) */
/* ---------- 滚动条 (可选) ---------- */
#p-views a,
::-webkit-scrollbar {
#p-cactions a {
  width: 8px;
    transition: background-color 0.3s ease, border-radius 0.3s ease;
  height: 8px;
    padding: 2px 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 12px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 12px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
}


#p-views a:hover,
/* ---------- 打印优化 ---------- */
#p-cactions a:hover {
@media print {
     background-color: #f0f8ff;
  .mw-body {
     border-radius: 4px;
    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;
  }
}