MediaWiki:Common.css
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* 虾仁维基 - 自定义侧边栏导航样式 */
/* 配合 Common.js 使用 */
/* --- 隐藏原生侧边栏 --- */
#mw-panel .portal { display: none !important; }
/* --- 自定义侧边栏容器 --- */
#mw-panel {
padding: 0 !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 --- */
.xn-link {
padding: 3px 10px 3px 20px;
font-size: 12px;
}
.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 */
.xn-link.xn-missing a {
color: #ba0000;
}
.xn-link.xn-missing a:hover {
color: #ba0000;
text-decoration: underline;
}
/* Active page highlight */
.xn-link a[href*="index.php"] {
/* MediaWiki will handle active page styling */
}
/* --- Sub-section (剧情层, 虾仁论文) --- */
.xn-subsection {
padding-left: 8px;
}
.xn-subheader {
padding: 4px 8px 4px 12px;
font-size: 12px;
font-weight: 500;
color: #555;
cursor: pointer;
user-select: none;
transition: background 0.15s;
position: relative;
}
.xn-subheader:hover { background: #f0f0f0; }
.xn-subheader.xn-expandable::before {
content: '';
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 {
padding-left: 8px;
}
.xn-subbody .xn-link {
padding-left: 28px;
}
/* --- Sub-sub-section (金集 within 剧情段) --- */
.xn-subsubsection {
padding-left: 4px;
}
.xn-subsubheader {
padding: 2px 6px 2px 16px;
font-size: 11px;
font-weight: 400;
color: #666;
cursor: pointer;
user-select: none;
transition: background 0.15s;
position: relative;
}
.xn-subsubheader:hover { background: #eee; }
.xn-subsubheader.xn-expandable::before {
content: '';
display: inline-block;
width: 0;
height: 0;
border-left: 3px solid transparent;
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 {
padding-left: 10px;
}
.xn-subsubbody .xn-link {
padding-left: 36px;
}
/* --- Single item (共创入口) --- */
.xn-single {
padding: 8px 10px;
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 --- */
.xn-loading {
padding: 8px 10px 8px 20px;
font-size: 12px;
color: #999;
font-style: italic;
}
/* --- Special pages: show minimal sidebar --- */
body.ns-special .xn-section,
body.ns-special .xn-work,
body.ns-special .xn-single {
/* Keep sidebar visible on special pages for navigation */
}
/* --- Responsive / narrow sidebar tweaks --- */
@media (max-width: 600px) {
#mw-panel {
width: 100% !important;
}
.xn-header {
font-size: 14px;
padding: 10px;
}
.xn-link {
font-size: 13px;
}
}
/* --- Transition for smooth toggle --- */
.xn-body, .xn-subbody, .xn-subsubbody {
overflow: hidden;
}