MediaWiki:Common.css:修订间差异

来自虾仁维基
跳转到导航 跳转到搜索
虾仁留言 | 贡献
添加搜索框和当前页高亮样式
Wdmxhfg留言 | 贡献
audit 2026-07-29: 迁移古卷新墨主题 CSS 至 MediaWiki:Common.css
第1行: 第1行:
/* 虾仁维基 - 自定义侧边栏导航样式 */
:root {
/* 配合 Common.js 使用 */
  --xr-red: #C41E3A;
 
  --xr-red-dark: #9B182D;
/* --- 隐藏原生侧边栏 --- */
  --xr-paper: #F5F0E8;
#mw-panel .portal { display: none !important; }
  --xr-paper-dark: #E8E1D5;
 
  --xr-ink: #333333;
/* --- 自定义侧边栏容器 --- */
  --xr-bamboo: #2E5A3B;
#mw-panel {
  --xr-link: #1A5276;
    padding: 0 !important;
}
 
 
/* --- 搜索框 --- */
.xn-search {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
}
.xn-search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #c8ccd1;
    border-radius: 3px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.xn-search-input:focus {
    border-color: #36c;
    box-shadow: 0 0 0 1px #36c;
}
 
/* --- 当前页面高亮 --- */
.xn-link.xn-active-link {
    background: #eaf3ff;
}
.xn-link .xn-active {
    font-weight: 600;
    color: #000 !important;
}
 
/* --- Section --- */
.xn-section {
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
    padding: 0;
}
.xn-section:last-child { border-bottom: none; }
 
/* --- Header (Section title) --- */
.xn-header {
    position: relative;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    line-height: 1.4;
}
.xn-header:hover { background: #f5f5f5; }
 
/* Chevron indicator */
.xn-expandable::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #888;
    margin-right: 6px;
    vertical-align: middle;
    transition: transform 0.15s;
    position: relative;
    top: -1px;
}
.xn-expandable.xn-collapsed::before {
    transform: rotate(-90deg);
}
 
/* --- Body (collapsible content) --- */
.xn-body {
    padding: 0 0 4px 0;
}
}


/* --- Links --- */
body.skin-vector-legacy {
.xn-link {
  background-color: var(--xr-paper);
    padding: 3px 10px 3px 20px;
  background-image: linear-gradient(180deg, #F5F0E8 0%, #EDE6D8 100%);
    font-size: 12px;
  color: var(--xr-ink);
}
.xn-link a {
    color: #0645ad;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1px 0;
}
.xn-link a:hover {
    text-decoration: underline;
    color: #0645ad;
}
.xn-link a:visited {
    color: #0b0080;
}
}


/* Missing page indicator */
#mw-head-base {
.xn-link.xn-missing a {
  background: var(--xr-red);
    color: #ba0000;
  height: 4px;
}
.xn-link.xn-missing a:hover {
    color: #ba0000;
    text-decoration: underline;
}
}


/* Active page highlight */
#mw-page-base {
.xn-link a[href*="index.php"] {
  background: transparent;
    /* MediaWiki will handle active page styling */
}
}


/* --- Sub-section (剧情层, 虾仁论文) --- */
.mw-body {
.xn-subsection {
  background: #FFFFFF;
    padding-left: 8px;
  border: 1px solid var(--xr-paper-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-radius: 6px;
}
}


.xn-subheader {
h1, h2, h3, h4, h5, h6 {
    padding: 4px 8px 4px 12px;
  font-family: "KaiTi", "STKaiti", "BiauKai", "SimSun", serif;
    font-size: 12px;
  color: var(--xr-red-dark);
    font-weight: 500;
  border-bottom: 2px solid var(--xr-paper-dark);
    color: #555;
  padding-bottom: 0.3em;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    position: relative;
}
}
.xn-subheader:hover { background: #f0f0f0; }


.xn-subheader.xn-expandable::before {
a, .mw-parser-output a.external {
    content: '';
  color: var(--xr-link);
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #999;
    margin-right: 4px;
    vertical-align: middle;
    transition: transform 0.15s;
}
.xn-subheader.xn-expandable.xn-collapsed::before {
    transform: rotate(-90deg);
}
}


.xn-subbody {
a:hover, a:focus {
    padding-left: 8px;
  color: var(--xr-red);
}
.xn-subbody .xn-link {
    padding-left: 28px;
}
}


/* --- Sub-sub-section (金集 within 剧情段) --- */
.vector-menu-tabs .mw-list-item a {
.xn-subsubsection {
  border-radius: 4px 4px 0 0;
    padding-left: 4px;
}
}


.xn-subsubheader {
.vector-menu-tabs .mw-list-item.selected a {
    padding: 2px 6px 2px 16px;
  background: #FFFFFF;
    font-size: 11px;
  color: var(--xr-red);
    font-weight: 400;
  border-top: 2px solid var(--xr-red);
    color: #666;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    position: relative;
}
}
.xn-subsubheader:hover { background: #eee; }


.xn-subsubheader.xn-expandable::before {
#mw-panel .vector-menu-heading {
    content: '';
  color: var(--xr-red-dark);
    display: inline-block;
  font-weight: bold;
    width: 0;
  font-family: "KaiTi", "STKaiti", serif;
    height: 0;
  border-bottom: 1px solid var(--xr-paper-dark);
    border-left: 3px solid transparent;
  padding-bottom: 4px;
    border-right: 3px solid transparent;
    border-top: 4px solid #bbb;
    margin-right: 4px;
    vertical-align: middle;
    transition: transform 0.15s;
}
.xn-subsubheader.xn-expandable.xn-collapsed::before {
    transform: rotate(-90deg);
}
}


.xn-subsubbody {
.mw-parser-output .toc,
    padding-left: 10px;
#toc,
}
.toc {
.xn-subsubbody .xn-link {
  background: var(--xr-paper);
    padding-left: 36px;
  border: 1px solid var(--xr-paper-dark);
  border-radius: 6px;
}
}


/* --- Single item (共创入口) --- */
.mw-parser-output .toc .toctitle h2,
.xn-single {
.toc .toctitle h2 {
    padding: 8px 10px;
  color: var(--xr-red-dark);
    border-bottom: 1px solid #e0e0e0;
}
.xn-single a {
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.xn-single a:hover {
    color: #0645ad;
    text-decoration: underline;
}
 
/* --- Plus button --- */
.xn-plus {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: #999;
    text-decoration: none !important;
    border-radius: 3px;
    margin-left: 2px;
    vertical-align: middle;
    transition: all 0.15s;
    float: right;
    margin-top: 1px;
}
.xn-plus:hover {
    color: #0645ad !important;
    background: #e8f0fe;
    text-decoration: none !important;
}
 
/* --- Work section --- */
.xn-work {
    margin: 0;
    padding: 0;
}
 
/* --- Add work link --- */
.xn-add-work {
    padding: 6px 10px 6px 20px;
    font-size: 12px;
    border-top: 1px dashed #e0e0e0;
    margin-top: 2px;
}
.xn-add-work a {
    color: #888;
    text-decoration: none;
}
.xn-add-work a:hover {
    color: #0645ad;
    text-decoration: underline;
}
}


/* --- Loading state --- */
#p-logo a {
.xn-loading {
  background-size: contain;
    padding: 8px 10px 8px 20px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}
}


/* --- Special pages: show minimal sidebar --- */
#mw-head {
body.ns-special .xn-section,
  background: rgba(255,255,255,0.92);
body.ns-special .xn-work,
  backdrop-filter: blur(4px);
body.ns-special .xn-single {
    /* Keep sidebar visible on special pages for navigation */
}
}


/* --- Responsive / narrow sidebar tweaks --- */
.mw-editsection a {
@media (max-width: 600px) {
  color: var(--xr-bamboo);
    #mw-panel {
        width: 100% !important;
    }
    .xn-header {
        font-size: 14px;
        padding: 10px;
    }
    .xn-link {
        font-size: 13px;
    }
}
}


/* --- Transition for smooth toggle --- */
#footer {
.xn-body, .xn-subbody, .xn-subsubbody {
  border-top: 1px solid var(--xr-paper-dark);
    overflow: hidden;
  padding-top: 1em;
}
}

2026年7月29日 (三) 23:13的版本

:root {
  --xr-red: #C41E3A;
  --xr-red-dark: #9B182D;
  --xr-paper: #F5F0E8;
  --xr-paper-dark: #E8E1D5;
  --xr-ink: #333333;
  --xr-bamboo: #2E5A3B;
  --xr-link: #1A5276;
}

body.skin-vector-legacy {
  background-color: var(--xr-paper);
  background-image: linear-gradient(180deg, #F5F0E8 0%, #EDE6D8 100%);
  color: var(--xr-ink);
}

#mw-head-base {
  background: var(--xr-red);
  height: 4px;
}

#mw-page-base {
  background: transparent;
}

.mw-body {
  background: #FFFFFF;
  border: 1px solid var(--xr-paper-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-radius: 6px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "KaiTi", "STKaiti", "BiauKai", "SimSun", serif;
  color: var(--xr-red-dark);
  border-bottom: 2px solid var(--xr-paper-dark);
  padding-bottom: 0.3em;
}

a, .mw-parser-output a.external {
  color: var(--xr-link);
}

a:hover, a:focus {
  color: var(--xr-red);
}

.vector-menu-tabs .mw-list-item a {
  border-radius: 4px 4px 0 0;
}

.vector-menu-tabs .mw-list-item.selected a {
  background: #FFFFFF;
  color: var(--xr-red);
  border-top: 2px solid var(--xr-red);
}

#mw-panel .vector-menu-heading {
  color: var(--xr-red-dark);
  font-weight: bold;
  font-family: "KaiTi", "STKaiti", serif;
  border-bottom: 1px solid var(--xr-paper-dark);
  padding-bottom: 4px;
}

.mw-parser-output .toc,
#toc,
.toc {
  background: var(--xr-paper);
  border: 1px solid var(--xr-paper-dark);
  border-radius: 6px;
}

.mw-parser-output .toc .toctitle h2,
.toc .toctitle h2 {
  color: var(--xr-red-dark);
}

#p-logo a {
  background-size: contain;
}

#mw-head {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
}

.mw-editsection a {
  color: var(--xr-bamboo);
}

#footer {
  border-top: 1px solid var(--xr-paper-dark);
  padding-top: 1em;
}