MediaWiki:Common.css

来自心灵终结资料站
Lyx讨论 | 贡献2026年8月29日 (六) 15:03的版本
跳转到导航 跳转到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* ============================================================
   📦 完美整合版(解决所有冲突)
   全屏壁纸 + 半透明暗色主题 + 黑金侧边栏 + 顶栏完美对齐
   ============================================================ */

/* ============================================================
   区块 1:全局基础 & 壁纸背景
   ============================================================ */
html {
    background-color: #a8b8c8 !important; /* 兜底雪地蓝,防止死黑块 */
    background-image: url('https://mentalomega.wiki/wiki/images/a/aa/119654574_p0.png') !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

html, body {
    color: #e6edf3 !important;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* 干掉所有可能挡壁纸的纯黑外壳 */
html, body, #globalWrapper, #mw-page-base, #mw-head-base, #mw-data-after-content, 
#content, #mw-content-base, #bodyContent, #siteNotice, #mw-indicators, #p-logo {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================
   区块 2:标题样式
   ============================================================ */
h1, h2, h3, h4, h5, h6, .firstHeading, .mw-headline, #firstHeading, #siteSub, #contentSub {
    color: #f0f6fc !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

h2, h3, h4, h5, h6 {
    border-bottom-color: #30363d !important;
}

/* ============================================================
   区块 3:链接颜色
   ============================================================ */
a, a:visited, a:active, .mw-body a, .mw-body a:visited, #mw-panel a, #mw-panel a:visited {
    color: #58a6ff !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover, .mw-body a:hover {
    color: #79c0ff !important;
    text-decoration: underline !important;
}

a:visited {
    color: #a5b4fc !important;
}

/* ============================================================
   区块 4:主内容区(半透明暗色玻璃)
   ============================================================ */
.mw-body, #content, #mw-content-text, .ve-init-mw-desktopArticleTarget-targetContainer {
    background-color: rgba(13, 17, 23, 0.85) !important;
    color: #e6edf3 !important;
    border: 1px solid rgba(48, 54, 61, 0.6) !important;
    margin-left: 11em !important;
    box-sizing: border-box !important;
}

.mw-body p, #content p {
    color: #e6edf3 !important;
    line-height: 1.7;
}

/* 正文内容内部布局修复 */
.mw-body .mw-parser-output,
.mw-parser-output,
.mw-body-content {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    max-width: 100% !important;
    width: auto !important;
    margin: 0 !important;
}

/* ============================================================
   区块 5:表格样式(统一半透明)
   ============================================================ */
table, .wikitable, .mw-datatable {
    background-color: rgba(13, 17, 23, 0.85) !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
}

table th, .wikitable th {
    background-color: #21262d !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
    font-weight: 600;
}

table td, .wikitable td {
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

table tr:nth-child(even), .wikitable tr:nth-child(even) {
    background-color: rgba(22, 27, 34, 0.85) !important;
}

table tr:nth-child(odd), .wikitable tr:nth-child(odd) {
    background-color: rgba(13, 17, 23, 0.85) !important;
}

table tr:hover, .wikitable tr:hover {
    background-color: #1c2333 !important;
}

/* ============================================================
   区块 6:代码块 & 信息框
   ============================================================ */
pre, .mw-code, code, tt, kbd, samp {
    background-color: rgba(13, 17, 23, 0.85) !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.92em;
}

.messagebox, .infobox, .ambox, .toc, #toc, .mw-notification {
    background-color: rgba(13, 17, 23, 0.85) !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
    border-radius: 6px;
}

/* ============================================================
   区块 7:侧边栏(半透明 + 黑金风格)
   ============================================================ */
#mw-panel {
    background-color: rgba(13, 17, 23, 0.85) !important;
    border-right: 1px solid rgba(33, 38, 45, 0.6) !important;
    width: 11em !important;
    min-width: 160px !important;
    max-width: 210px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
}

#p-logo {
    padding: 0.5em 0 0.3em 0.8em !important;
    border-bottom: 1px solid #21262d !important;
    margin: 0 !important;
}

#p-logo a {
    background-size: 128px !important;
    background-position: center center !important;
    display: block !important;
    width: 10em !important;
    height: 160px !important;
    text-decoration: none !important;
}

/* 板块标题 */
#mw-panel .portal h3,
#mw-panel .portal .vector-menu-heading {
    color: #f0f6fc !important;
    font-weight: 600 !important;
    font-size: 0.85em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid #21262d !important;
    padding: 0.5em 0 0.35em 0.6em !important;
    background: transparent !important;
    white-space: nowrap !important;
}

/* 侧边栏链接 */
#mw-panel .portal .vector-menu-content ul,
#mw-panel .portal .body ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#mw-panel .portal .vector-menu-content ul li a,
#mw-panel .portal .body ul li a {
    display: block !important;
    padding: 0.35em 0.6em 0.35em 0.8em !important;
    color: #c9d1d9 !important;
    text-decoration: none !important;
    border-left: 2px solid transparent !important;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15) !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#mw-panel .portal .vector-menu-content ul li a:hover,
#mw-panel .portal .body ul li a:hover {
    color: #f0f6fc !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-left-color: #fbcb3e !important;
    border-bottom-color: rgba(255, 215, 0, 0.45) !important;
}

#mw-panel .portal:not(:last-child)::after {
    content: '' !important;
    display: block !important;
    height: 1px !important;
    background: #21262d !important;
    margin: 0.1em 0.8em !important;
}

#mw-panel .portal .vector-menu-heading .mw-collapsible-text {
    display: none !important;
}

/* ============================================================
   区块 8:顶部导航(完美对齐 + 半透明)
   ============================================================ */
#mw-head {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: calc(100% - 11em) !important;
    background-color: rgba(13, 17, 23, 0.85) !important; 
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    box-sizing: border-box !important;
    height: 45px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* 清空顶栏内部所有子元素的纯色背景 */
#mw-head > div,
#mw-head > div > div,
#mw-head > div > ul,
#mw-head > div > ul > li,
#mw-head .vector-menu-tabs,
#mw-head .vector-menu-dropdown,
#mw-head #p-personal,
#mw-head #p-personal ul,
#mw-head #p-personal ul li {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

#left-navigation, #right-navigation, .vector-menu-tabs {
    float: left !important;
    margin: 0 !important;
    padding: 0 !important;
}

#right-navigation {
    float: right !important;
}

/* 搜索框对齐(保持输入框和放大镜不分离) */
#simpleSearch {
    transform: translateY(-4px) !important;
}

#searchInput, #searchQuery, .vector-search-box-input, #simpleSearch input {
    color: #e6edf3 !important;
    border-color: #30363d !important;
    border-radius: 6px;
    background-color: transparent !important;
}

#searchInput:focus, #searchQuery:focus {
    border-color: #58a6ff !important;
    outline: none;
}

/* ============================================================
   区块 9:分类与底部
   ============================================================ */
#catlinks, #footer, #footer-info, #footer-places, #footer-icons {
    background-color: rgba(13, 17, 23, 0.85) !important;
    border-color: #30363d !important;
    color: #8b949e !important;
    margin-left: 11em !important;
    box-sizing: border-box !important;
}

#catlinks a, #footer a {
    color: #58a6ff !important;
}

#catlinks a:hover, #footer a:hover {
    color: #79c0ff !important;
}

/* ============================================================
   区块 10:目录(TOC)排版优化
   ============================================================ */
#toc, .toc {
    padding: 10px 15px !important;
    margin: 0 0 20px 0 !important;
    width: auto !important;
    max-width: 100% !important;
    background-color: rgba(13, 17, 23, 0.85) !important;
    box-sizing: border-box !important;
}

#toc ul, .toc ul, #toc li, .toc li {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

#toc ul ul, .toc ul ul {
    padding-left: 1.5em !important;
}

/* ============================================================
   区块 11:编辑框及其他输入框
   ============================================================ */
#wpTextbox1, .mw-editform #wpTextbox1, textarea, input[type="text"], input[type="search"] {
    background-color: rgba(13, 17, 23, 0.90) !important;
    color: #e6edf3 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    caret-color: #58a6ff !important;
}

#wpTextbox1:focus, textarea:focus {
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15) !important;
    outline: none !important;
}

/* 编辑按钮 */
#wpSave, #wpPreview, #wpDiff {
    background-color: #21262d !important;
    color: #f0f6fc !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 8px 20px !important;
}

#wpSave:hover, #wpPreview:hover, #wpDiff:hover {
    background-color: #30363d !important;
}

/* ============================================================
   区块 12:滚动条
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background: #0d1117;
}
::-webkit-scrollbar-track {
    background: #0d1117;
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ============================================================
   区块 13:杂项
   ============================================================ */
::placeholder {
    color: #8b949e !important;
    opacity: 0.7;
}

::selection {
    background: #1f6feb !important;
    color: #ffffff !important;
}

img, figure {
    background-color: transparent !important;
    border: none !important;
    border-radius: 4px;
}

























/* --- 单位信息卡片样式 (全局生效) --- */

.mw-card-box {
    width: 100% !important;
    background-color: transparent !important; /* 去掉原来的浅灰背景,直接透出深色底 */
    border: 1px solid #444; /* 边框改为深灰色,更契合暗黑主题 */
    padding: 0;
    border-spacing: 0;
    border-collapse: collapse;
    table-layout: fixed;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); /* 阴影加深 */
}

.mw-card-header {
    /* 默认深黑背景,如果页面传入了变量则使用传入的颜色 */
    background-color: var(--unit-header-bg, #1a1a1a); 
    color: var(--theme-color, #0077FF); /* 标题文字使用主题色 */
    font-weight: bold;
    padding: 12px 18px;
    text-align: left;
    border-bottom: 3px solid var(--theme-color, #0077FF);
    font-size: 1.2em;
}

.mw-card-body {
    padding: 15px 18px;
    color: #ddd; /* 文字改为浅色,配合暗黑主题 */
}

.mw-card-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px 30px;
    box-sizing: border-box;
}

.mw-card-col {
    flex: 1;
    line-height: 1.7;
    min-width: 120px;
    word-break: break-word;
}

/* 单位信息卡片:图标彻底透明,没有底色 */
.mw-card-icon-box {
    background-color: transparent !important; /* 彻底去掉底色 */
    border: none !important;
    padding: 0 !important; /* 去掉多余的边距 */
}

.mw-card-divider {
    padding: 0;
    border-bottom: 1px solid #333; /* 暗色分割线 */
}

/* 核心修复:图片区 */
.mw-card-image-frame {
    text-align: center;
    padding: 15px;
    background-color: transparent !important; /* 去掉白色背景! */
    border: none; /* 去掉边框 */
    margin: 0;
}

.mw-card-image-frame img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.mw-card-caption {
    color: #888; /* 图片说明文字颜色调暗 */
    margin-top: 6px;
    display: block;
}

.mw-card-footer {
    padding: 15px 18px;
    line-height: 1.8;
    color: #ccc; /* 文字颜色 */
}

.mw-card-code {
    padding: 15px 18px;
}

.mw-card-code-divider {
    padding: 0;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
}

/* 修复代码块白底 */
.mw-card-code-block {
    white-space: pre-wrap !important;      /* 保留换行,自动换行 */
    word-break: break-word !important;     /* 长单词换行 */
    tab-size: 4 !important;                /* 制表符宽度 */
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
    font-size: 13px !important;
    line-height: 1.8 !important;           /* 增加行高,更舒适 */
    padding: 16px 20px !important;
    background-color: #0d1117 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    overflow-x: auto !important;
    max-height: 500px !important;          /* 内容太多时滚动 */
}

.mw-card-code-block {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    background-color: #1e1e1e !important; /* 暗黑代码背景 */
    border: 1px solid #444 !important;
    color: #a9b7c6; /* 代码文字颜色 */
    padding: 10px;
}

/* 移动端优化 */
@media screen and (max-width: 800px) {
    .mw-card-header {
        padding: 10px 12px;
        font-size: 1.1em;
    }
    .mw-card-flex {
        flex-direction: column;
        gap: 10px;
    }
    .mw-card-icon-box {
        align-self: flex-end;
    }
}

/* 强制独立表格的间距与模板统一 */
.mw-card-box .mw-card-body,
.mw-card-box .mw-card-footer,
.mw-card-box .mw-card-image-frame,
.mw-card-box .mw-card-code {
    padding: 15px 18px !important;
}