MediaWiki:Common.css:修订间差异

来自心灵终结资料站
跳转到导航 跳转到搜索
无编辑摘要
Lyx讨论 | 贡献
无编辑摘要
第1行: 第1行:
/* 为特定区域的链接添加特效,这里以 "a" 标签为例,你可以根据需要限制范围 */
/* ========================================
  MediaWiki 通用样式表 (Common.css)
  版本: 2.0
  设计风格: 现代、清晰、响应式
  兼容性: MediaWiki 1.35+
  ======================================== */
 
/* ---------- 全局设置 ---------- */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}
 
/* 主容器增加最大宽度,提升大屏阅读体验 */
#mw-content-container {
    max-width: 1440px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
 
/* ---------- 页面标题 ---------- */
#firstHeading {
    font-weight: 600;
    font-size: 2rem;
    border-bottom: 3px solid #2a4b7c;
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
    color: #1a365d;
}
 
/* ---------- 内容区排版 ---------- */
.mw-body {
    padding: 1.5rem 2rem;
    background: #ffffff;
}
 
/* 内容中的标题 */
.mw-body h1,
.mw-body h2,
.mw-body h3,
.mw-body h4,
.mw-body h5,
.mw-body h6 {
    color: #1a365d;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}
 
.mw-body h2 {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.3rem;
}
 
/* ---------- 链接样式 ---------- */
a {
    color: #0645ad;
    transition: color 0.15s ease;
}
a:hover {
a:hover {
text-decoration: none;
    color: #0b3d91;
     font-weight: bold;
    text-decoration: underline;
     background-color: #e6f2ff; /* 浅蓝色背景 */
}
     padding: 2px 4px;         /* 内边距让背景不贴字 */
 
     border-radius: 3px;       /* 圆角 */
/* 外部链接 - 加个小图标 */
     transition: all 0.2s ease;
.mw-body a.external {
    background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM2NDVhZGQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTggMTN2NmEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY4YTIgMiAwIDAgMSAyLTJoNiIgLz48cG9seWxpbmUgcG9pbnRzPSIxNSAzIDIxIDMgMjEgOSIgLz48bGluZSB4MT0iMTAiIHkxPSIxNCIgeDI9IjIxIiB5Mj0iMyIgLz48L3N2Zz4=) right center no-repeat;
    background-size: 0.85em;
    padding-right: 1.2em;
}
 
/* ---------- 导航栏 (左侧边栏) ---------- */
#mw-panel {
    font-size: 0.9rem;
}
 
#mw-panel .portal {
    background: transparent;
    border: none;
    margin-bottom: 0.8rem;
}
 
#mw-panel .portal h5 {
     font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    background: #e9ecef;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}
 
#mw-panel .portal .body ul {
    list-style: none;
    padding-left: 0.5rem;
}
 
#mw-panel .portal .body li a {
    color: #1a202c;
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background 0.15s;
}
#mw-panel .portal .body li a:hover {
     background: #e2e8f0;
    text-decoration: none;
}
 
/* ---------- 搜索框 ---------- */
#p-search #searchInput {
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    width: 100%;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#p-search #searchInput:focus {
    border-color: #2a4b7c;
    box-shadow: 0 0 0 3px rgba(42, 75, 124, 0.2);
    outline: none;
}
 
#p-search #searchButton {
    background: #2a4b7c;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    margin-left: 0.3rem;
    font-weight: 500;
    transition: background 0.2s;
}
#p-search #searchButton:hover {
    background: #1a365d;
    cursor: pointer;
}
 
/* ---------- 内容表格 (wikitable) ---------- */
.wikitable {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-collapse: collapse;
    font-size: 0.95rem;
    width: 100%;
    margin: 1.2rem 0;
}
.wikitable th {
    background: #f1f3f5;
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.8rem;
    border: 1px solid #dee2e6;
}
.wikitable td {
     padding: 0.5rem 0.8rem;
    border: 1px solid #dee2e6;
}
.wikitable tr:nth-child(even) {
    background: #f8f9fa;
}
 
/* ---------- 信息框 (infobox) ---------- */
.infobox {
    float: right;
    clear: right;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.8rem 1rem;
    margin: 0 0 1rem 1.5rem;
    width: 280px;
    font-size: 0.9rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.infobox caption {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.infobox th,
.infobox td {
    vertical-align: top;
    padding: 0.2rem 0.4rem;
}
.infobox th {
    font-weight: 600;
    white-space: nowrap;
}
 
/* 小屏幕时信息框不浮动 */
@media (max-width: 768px) {
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }
}
 
/* ---------- 引用/脚注 ---------- */
.mw-cite-backlink {
    font-size: 0.85rem;
}
ol.references {
    font-size: 0.9rem;
}
ol.references li {
    margin-bottom: 0.3rem;
}
 
/* ---------- 分类链接 ---------- */
#mw-normal-catlinks {
    background: #f1f3f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
}
#mw-normal-catlinks a {
    color: #0645ad;
}
 
/* ---------- 用户工具栏 (右上角) ---------- */
#p-personal {
    font-size: 0.9rem;
}
#p-personal li a {
    color: #1a202c;
    padding: 0.2rem 0.6rem;
     border-radius: 3px;
}
#p-personal li a:hover {
    background: #e2e8f0;
    text-decoration: none;
}
#p-personal #pt-userpage a {
    font-weight: 600;
}
 
/* ---------- 编辑区 (可视化/源代码) ---------- */
.mw-editform textarea {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
     font-size: 0.9rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.6rem;
}
.mw-editform textarea:focus {
    border-color: #2a4b7c;
    box-shadow: 0 0 0 3px rgba(42, 75, 124, 0.15);
}
 
/* ---------- 消息框 (模板消息) ---------- */
.messagebox,
.ambox {
    border-left: 5px solid #2a4b7c;
    background: #f8f9fa;
    padding: 0.6rem 1rem;
    margin: 0.8rem 0;
    border-radius: 3px;
}
.ambox-warning {
    border-left-color: #dc3545;
    background: #fef2f2;
}
.ambox-notice {
    border-left-color: #0d6efd;
    background: #f0f7ff;
}
.ambox-move {
    border-left-color: #6c757d;
}
}


/* ---------- 特殊页面表格 ---------- */
.mw-specialpage-table {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-collapse: collapse;
}
.mw-specialpage-table th {
    background: #e9ecef;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}
.mw-specialpage-table td {
    padding: 0.4rem 0.8rem;
    border-top: 1px solid #dee2e6;
}
/* ---------- 移动端自适应 ---------- */
@media (max-width: 768px) {
    .mw-body {
        padding: 1rem;
    }
    #firstHeading {
        font-size: 1.5rem;
    }
    #mw-panel {
        display: none; /* 在小屏幕隐藏侧边栏,使用汉堡菜单或顶部导航 (取决于皮肤) */
    }
    .wikitable {
        font-size: 0.85rem;
    }
    .wikitable th,
    .wikitable td {
        padding: 0.3rem 0.5rem;
    }
}
@media (max-width: 480px) {
    .mw-body {
        padding: 0.8rem;
    }
    #firstHeading {
        font-size: 1.25rem;
    }
    #p-search #searchInput {
        width: 70%;
    }
}


/* blockquote - 字体偏大,上下间距适中,内部宽松 */
/* ---------- 打印样式 ---------- */
blockquote {
@media print {
     margin: 0.8em 0;                 /* 上下间距收窄,和普通段落差不多 */
     body {
    padding: 20px 30px;             /* 左右内边距保持宽松 */
        background: #ffffff;
     background-color: #f8fafc;
        color: #000000;
     border-left: 4px solid #cbd5e1;
     }
     border-radius: 0 6px 6px 0;
    #mw-panel,
     color: #1e293b;
    #p-personal,
   
     #mw-navigation,
    font-style: normal;
    .infobox {
     font-size: 1.05em;              /* 比正文大一点点(可根据喜好调 1.05~1.1) */
        display: none;
     line-height: 1.8;                /* 内部行距依然宽松 */
     }
    letter-spacing: 0.03em;
    .mw-body {
      
        padding: 0.5in;
     word-wrap: break-word;
     }
     overflow-wrap: break-word;
    a {
        color: #000000;
        text-decoration: underline;
     }
     .wikitable {
        border: 1px solid #aaa;
     }
     .wikitable th {
        background: #eee;
     }
}
}

2026年8月19日 (三) 02:31的版本

/* ========================================
   MediaWiki 通用样式表 (Common.css)
   版本: 2.0
   设计风格: 现代、清晰、响应式
   兼容性: MediaWiki 1.35+
   ======================================== */

/* ---------- 全局设置 ---------- */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

/* 主容器增加最大宽度,提升大屏阅读体验 */
#mw-content-container {
    max-width: 1440px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---------- 页面标题 ---------- */
#firstHeading {
    font-weight: 600;
    font-size: 2rem;
    border-bottom: 3px solid #2a4b7c;
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
    color: #1a365d;
}

/* ---------- 内容区排版 ---------- */
.mw-body {
    padding: 1.5rem 2rem;
    background: #ffffff;
}

/* 内容中的标题 */
.mw-body h1, 
.mw-body h2, 
.mw-body h3, 
.mw-body h4, 
.mw-body h5, 
.mw-body h6 {
    color: #1a365d;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.mw-body h2 {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.3rem;
}

/* ---------- 链接样式 ---------- */
a {
    color: #0645ad;
    transition: color 0.15s ease;
}
a:hover {
    color: #0b3d91;
    text-decoration: underline;
}

/* 外部链接 - 加个小图标 */
.mw-body a.external {
    background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM2NDVhZGQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTggMTN2NmEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY4YTIgMiAwIDAgMSAyLTJoNiIgLz48cG9seWxpbmUgcG9pbnRzPSIxNSAzIDIxIDMgMjEgOSIgLz48bGluZSB4MT0iMTAiIHkxPSIxNCIgeDI9IjIxIiB5Mj0iMyIgLz48L3N2Zz4=) right center no-repeat;
    background-size: 0.85em;
    padding-right: 1.2em;
}

/* ---------- 导航栏 (左侧边栏) ---------- */
#mw-panel {
    font-size: 0.9rem;
}

#mw-panel .portal {
    background: transparent;
    border: none;
    margin-bottom: 0.8rem;
}

#mw-panel .portal h5 {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    background: #e9ecef;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

#mw-panel .portal .body ul {
    list-style: none;
    padding-left: 0.5rem;
}

#mw-panel .portal .body li a {
    color: #1a202c;
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background 0.15s;
}
#mw-panel .portal .body li a:hover {
    background: #e2e8f0;
    text-decoration: none;
}

/* ---------- 搜索框 ---------- */
#p-search #searchInput {
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    width: 100%;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#p-search #searchInput:focus {
    border-color: #2a4b7c;
    box-shadow: 0 0 0 3px rgba(42, 75, 124, 0.2);
    outline: none;
}

#p-search #searchButton {
    background: #2a4b7c;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    margin-left: 0.3rem;
    font-weight: 500;
    transition: background 0.2s;
}
#p-search #searchButton:hover {
    background: #1a365d;
    cursor: pointer;
}

/* ---------- 内容表格 (wikitable) ---------- */
.wikitable {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-collapse: collapse;
    font-size: 0.95rem;
    width: 100%;
    margin: 1.2rem 0;
}
.wikitable th {
    background: #f1f3f5;
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.8rem;
    border: 1px solid #dee2e6;
}
.wikitable td {
    padding: 0.5rem 0.8rem;
    border: 1px solid #dee2e6;
}
.wikitable tr:nth-child(even) {
    background: #f8f9fa;
}

/* ---------- 信息框 (infobox) ---------- */
.infobox {
    float: right;
    clear: right;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.8rem 1rem;
    margin: 0 0 1rem 1.5rem;
    width: 280px;
    font-size: 0.9rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.infobox caption {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.infobox th,
.infobox td {
    vertical-align: top;
    padding: 0.2rem 0.4rem;
}
.infobox th {
    font-weight: 600;
    white-space: nowrap;
}

/* 小屏幕时信息框不浮动 */
@media (max-width: 768px) {
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }
}

/* ---------- 引用/脚注 ---------- */
.mw-cite-backlink {
    font-size: 0.85rem;
}
ol.references {
    font-size: 0.9rem;
}
ol.references li {
    margin-bottom: 0.3rem;
}

/* ---------- 分类链接 ---------- */
#mw-normal-catlinks {
    background: #f1f3f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
}
#mw-normal-catlinks a {
    color: #0645ad;
}

/* ---------- 用户工具栏 (右上角) ---------- */
#p-personal {
    font-size: 0.9rem;
}
#p-personal li a {
    color: #1a202c;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}
#p-personal li a:hover {
    background: #e2e8f0;
    text-decoration: none;
}
#p-personal #pt-userpage a {
    font-weight: 600;
}

/* ---------- 编辑区 (可视化/源代码) ---------- */
.mw-editform textarea {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.6rem;
}
.mw-editform textarea:focus {
    border-color: #2a4b7c;
    box-shadow: 0 0 0 3px rgba(42, 75, 124, 0.15);
}

/* ---------- 消息框 (模板消息) ---------- */
.messagebox,
.ambox {
    border-left: 5px solid #2a4b7c;
    background: #f8f9fa;
    padding: 0.6rem 1rem;
    margin: 0.8rem 0;
    border-radius: 3px;
}
.ambox-warning {
    border-left-color: #dc3545;
    background: #fef2f2;
}
.ambox-notice {
    border-left-color: #0d6efd;
    background: #f0f7ff;
}
.ambox-move {
    border-left-color: #6c757d;
}

/* ---------- 特殊页面表格 ---------- */
.mw-specialpage-table {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-collapse: collapse;
}
.mw-specialpage-table th {
    background: #e9ecef;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}
.mw-specialpage-table td {
    padding: 0.4rem 0.8rem;
    border-top: 1px solid #dee2e6;
}

/* ---------- 移动端自适应 ---------- */
@media (max-width: 768px) {
    .mw-body {
        padding: 1rem;
    }
    #firstHeading {
        font-size: 1.5rem;
    }
    #mw-panel {
        display: none; /* 在小屏幕隐藏侧边栏,使用汉堡菜单或顶部导航 (取决于皮肤) */
    }
    .wikitable {
        font-size: 0.85rem;
    }
    .wikitable th,
    .wikitable td {
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .mw-body {
        padding: 0.8rem;
    }
    #firstHeading {
        font-size: 1.25rem;
    }
    #p-search #searchInput {
        width: 70%;
    }
}

/* ---------- 打印样式 ---------- */
@media print {
    body {
        background: #ffffff;
        color: #000000;
    }
    #mw-panel,
    #p-personal,
    #mw-navigation,
    .infobox {
        display: none;
    }
    .mw-body {
        padding: 0.5in;
    }
    a {
        color: #000000;
        text-decoration: underline;
    }
    .wikitable {
        border: 1px solid #aaa;
    }
    .wikitable th {
        background: #eee;
    }
}