MediaWiki:Citizen.css:修订间差异
MediaWiki界面页面
更多操作
mp-left/right加align-self:stretch + last-child display:flex |
回退首页布局至原始grid |
||
| (未显示同一用户的1个中间版本) | |||
| 第246行: | 第246行: | ||
} | } | ||
} | } | ||
.mp-left, .mp-right { | .mp-left, .mp-right { | ||
display: flex; | display: flex; | ||
2026年5月14日 (四) 23:24的最新版本
/* =============================================
LTS Wiki - 像素直角 Minecraft 风格 (Citizen)
无圆角 · 硬边 · 浅色主题
============================================= */
/* ---------------------------------------------
1. 全局 CSS 变量(浅色主题 + 0 圆角)
--------------------------------------------- */
:root {
/* 基础文字颜色 */
--color-base: #202122;
--color-base--hover: #404244;
--color-emphasized: #101418;
--color-subtle: #54595d;
--color-placeholder: #72777d;
--color-disabled: #a2a9b1;
--color-inverted: #ffffff;
/* 链接色 - Minecraft 草绿色 */
--color-progressive: #3a971e;
--color-progressive--hover: #2d7316;
--color-progressive--active: #1f4f0e;
--color-visited: #6a60b0;
/* 强调与状态色 */
--color-destructive: #bf3c2c;
--color-destructive--hover: #9f3526;
--color-error: #bf3c2c;
--color-warning: #886425;
--color-success: #177860;
/* 圆角 —— 全部强制为 0 */
--border-radius-base: 0px;
--border-radius-medium: 0px;
--border-radius-large: 0px;
--border-radius-pill: 0px;
/* 字体大小 */
--font-size-small: 0.875rem;
--font-size-medium: 1rem;
--font-size-large: 1.125rem;
}
img {
image-rendering: crisp-edges;
image-rendering: pixelated;
image-rendering: pixelated;
}
/* ---------------------------------------------
2. 全局基础样式
--------------------------------------------- */
body {
background-color: #F4FCF9;
color: var(--color-base);
font-family: 'Inter', 'HarmonyOS Sans SC', '思源黑体', system-ui, sans-serif;
}
/* 内容区背景 */
.mw-body {
background-color: #ffffff;
border: 2px solid var(--border-color-base);
}
/* 链接颜色 */
a {
color: var(--color-progressive);
}
a:visited {
color: var(--color-visited);
}
a:hover {
color: var(--color-progressive--hover);
}
/* 搜索框 - 直角 */
.citizen-search-box input {
background-color: #ffffff;
border: 1.5px solid #C8DDD5;
color: var(--color-base);
}
/* ---------------------------------------------
3. 卡片与容器样式(直角、硬边)
--------------------------------------------- */
.citizen-body-container .card,
.mw-body-content > div:not(.no-card) {
background-color: #ffffff;
border: 1.5px solid #C8DDD5;
border-radius: 0px;
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
padding: 1rem;
margin-bottom: 1.5rem;
transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s cubic-bezier(0.4,0,0.2,1);
}
.citizen-body-container .card:hover,
.block-border:hover {
transform: translateY(-2px);
box-shadow: var(--box-shadow-hover);
}
/* 清除所有伪元素生成的内阴影/边框 */
.block-border::before,
.block-border::after {
display: none !important;
}
/* 强制所有元素无圆角 */
* {
border-radius: 0px !important;
}
/* ---------------------------------------------
4. 表格样式(像素边框)
--------------------------------------------- */
.wikitable {
background-color: #ffffff;
border: 1.5px solid #C8DDD5;
}
.wikitable th {
background-color: var(--background-color-neutral);
color: var(--color-progressive);
border: 1px solid var(--border-color-base);
}
.wikitable td {
border: 1px solid var(--border-color-subtle);
}
.wikitable tr:nth-child(even) {
background-color: var(--background-color-neutral-subtle);
}
/* ---------------------------------------------
6. 首页专用区块(直角)
--------------------------------------------- */
.home-hero {
background: linear-gradient(135deg, #EBF7F3 0%, #E6FAF3 100%);
border: 1.5px solid #C8DDD5;
padding: 2rem;
text-align: center;
margin-bottom: 2rem;
}
/* 三列卡片等宽布局 */
.home-feature-cell {
padding: 0 8px;
vertical-align: top;
}
/* 区块边框效果(游戏中的“边界”感) */
.mw-parser-output .block-border {
border: 1.5px solid #C8DDD5;
background-color: #ffffff;
padding: 8px;
margin: 8px 0;
position: relative;
box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
/* ---------------------------------------------
7. 辅助工具类
--------------------------------------------- */
.text-green {
color: var(--color-progressive);
}
.bg-green-subtle {
background-color: var(--background-color-progressive-subtle);
}
.border-green {
border-color: var(--color-progressive) !important;
}
.rounded-card {
border-radius: 0px !important;
background: white;
border: 2px solid var(--border-color-subtle);
padding: 1rem;
}
/* =============================================
复用自 Minecraft Wiki/styles.css
============================================= */
/* ── 全局盒模型 ── */
.mp-wrapper *,
.mp-wrapper *::before,
.mp-wrapper *::after {
box-sizing: border-box;
}
.mp-wrapper {
display: flex;
flex-wrap: wrap;
width: 100%;
gap: 6px;
}
/* ── 两栏网格 ── */
.mp-inline-sections {
display: grid;
grid-template-columns: 1fr;
grid-template-areas: "site" "left" "right";
gap: 6px;
width: 100%;
}
.mp-section-site {
grid-area: site;
display: flex;
flex-direction: column;
gap: 6px;
}
.mp-left { grid-area: left; }
.mp-right { grid-area: right; }
@media screen and (min-width: 990px) {
.mp-inline-sections {
grid-template-columns: 2fr 1fr;
grid-template-rows: auto 1fr;
grid-template-areas: "left site" "left right";
}
}
.mp-left, .mp-right {
display: flex;
flex-direction: column;
gap: 6px;
align-self: stretch;
}
.mp-left > :last-child,
.mp-right > :last-child {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
/* 粘性侧边栏 */
.mp-sticky {
position: sticky;
top: 20px;
}
.skin-citizen .mp-sticky {
top: calc(var(--citizen-header-height, 56px) + 20px);
}
/* ── 卡片(直角、内阴影浮雕感)── */
.mp-section {
border: 1.5px solid #C8DDD5;
background-color: #fcfcfc;
box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,184,124,0.03);
padding: 12px;
}
.mp-wrapper > .mp-section { width: 100%; }
.mp-section.mp-section-full { width: 100%; }
.mp-section-center { text-align: center; }
/* 标题 */
.mp-wrapper h2 {
font-family: revert;
font-weight: bold;
font-size: 1.2em;
margin-top: 0 !important;
margin-bottom: 0.4em;
}
.mp-section > h2:first-child {
margin-top: 0 !important;
}
/* MW 1.45 标题类 margin 重置 */
.mw-heading {
margin-top: 0 !important;
margin-bottom: 0.4em !important;
}
.mp-section .mp-button-wrapper + .mp-button-wrapper {
margin-top: 6px !important;
}
.mp-button-wrapper + .mp-button-wrapper {
margin-top: 6px;
}
.mp-title {
border: none;
margin: 0;
padding: 0 !important;
}
/* ── 高亮卡片(图片背景)── */
.mp-highlight-wrapper {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.mp-highlight {
flex: 1 1 0;
min-width: 280px;
min-height: calc(150px + 5vh);
max-height: 300px;
position: relative;
padding: 0;
overflow: hidden;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-color: #2a5a2a;
box-shadow: inset -2px -2px #0000001a, inset 2px 2px #fff1;
color: #fff !important;
font-size: small;
text-shadow: 1px 1px 4px #000;
}
.mp-highlight *:not(a) { color: #fff !important; }
.mp-highlight a { color: #bed9ff !important; }
.mp-highlight-image {
position: absolute;
inset: 0;
overflow: hidden;
}
.mp-highlight-image img {
object-fit: cover;
width: 100%;
height: 100%;
max-height: 300px;
}
.mp-highlight-top-description {
background: linear-gradient(180deg, #0008 24px, transparent);
padding: 12px;
position: absolute;
top: 0;
width: 100%;
}
.mp-highlight-bottom-description {
background: linear-gradient(to top, #0008 50%, transparent);
padding: 0 12px 10px;
position: absolute;
bottom: 0;
width: 100%;
}
/* ── 按钮(3D 按压效果)── */
.mp-wrapper {
--button-color: #ebebeb;
--button-color-progressive: #3a971e;
--button-text-color: #202122;
--button-border-color: rgba(0,0,0,0.4);
}
.mp-button {
width: 100%;
gap: 6px;
cursor: pointer;
position: relative;
text-align: center;
background-color: var(--button-color);
color: var(--button-text-color);
border: 2px solid var(--button-border-color);
font-size: 1em;
font-weight: bold;
transition: all 0.1s;
}
.mp-button.mp-button-progressive {
background-color: var(--button-color-progressive);
--button-text-color: #fff;
}
body.mediawiki .mp-button > * {
width: calc(100% + 4px);
height: calc(100% + 4px);
margin: -2px;
color: var(--button-text-color) !important;
text-decoration: none;
display: flex;
gap: 6px;
padding: 8px 10px 14px !important;
align-items: center;
justify-content: center;
}
.mp-button::after {
display: block;
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
box-shadow: 0 -6px 0 0 #686868 inset,
2px 2px 0 0 rgba(178,178,178,0.5) inset,
-2px -8px 0 0 rgba(153,153,153,0.5) inset;
mix-blend-mode: hard-light;
transition: 0.1s;
pointer-events: none;
}
.mp-button:active::after {
box-shadow: 2px 2px 0 0 rgba(178,178,178,0.5) inset,
-2px -2px 0 0 rgba(153,153,153,0.5) inset;
background-color: #0000001a;
}
.mp-button:hover:not(:active)::after {
background-color: #ffffff1a;
}
body.mediawiki .mp-button:active > * {
transform: translateY(1px);
}
.mp-button:active {
transform: translateY(2px);
}
/* 按钮组 */
.mp-button-wrapper {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.mp-button-wrapper .mp-button {
flex: 1 0 0;
white-space: nowrap;
}
/* 折叠按钮(不需要折叠功能可省略) */
/* ... 保留原样会很长,如需请告知,我先不贴 */
/* 社交图标栏 */
.mp-social-wrapper {
display: grid;
grid-auto-columns: minmax(0, 1fr);
grid-auto-flow: column;
gap: 4px;
}
.mp-button.mp-social-qq { background-color: #1ebafc; --button-text-color: #fff; }
.mp-button.mp-social-kook { background-color: #5865f2; --button-text-color: #fff; }
.mp-button.mp-social-web { background-color: #3a971e; --button-text-color: #fff; }
/* 图标网格 */
.mp-icon-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 8px;
--icon-base-width: 90px;
--icon-max-width: 200px;
}
.mp-icon {
flex: 1 auto;
width: var(--icon-base-width);
max-width: var(--icon-max-width);
display: flex;
flex-direction: column;
}
.mp-icon-link {
flex: 1;
margin: -2px 0 0;
font-size: 14px;
}
.mp-icon-img {
display: flex;
align-items: center;
justify-content: center;
background-color: #00000030;
box-shadow: inset 0 2px #00000015, inset 0 -2px #ffffff30;
border: 1.5px solid rgba(0,0,0,0.3);
}
.mp-icon-img a { padding: 12px; display: block; }
.mp-icon-img img {
width: 60px !important;
height: 60px !important;
filter: drop-shadow(2px 2px 1px #00000030);
object-fit: contain;
}
.mp-icon:active .mp-icon-img { transform: translateY(2px); }
/* 响应式缩小 */
@media screen and (max-width: 950px) {
.mp-icon-link { font-size: 12px; }
.mp-icon-img a { padding: 6px; }
.mp-icon-img img { width: 40px !important; height: 40px !important; }
}
/* 时间线 */
.mp-timeline {
display: flex;
flex-direction: column;
margin-left: 10px;
}
.mp-timeline dl {
padding-left: 15px;
border-left: 2px solid #bbb;
display: flex;
gap: 0 0.5em;
flex-wrap: wrap;
align-content: center;
max-height: 60px;
}
.mp-timeline dl:not(:last-child) { padding-bottom: 8px; }
.mp-timeline dt { position: relative; }
.mp-timeline dl > dt::before {
content: "";
position: absolute;
left: -23px;
top: 4px;
width: 14px;
height: 14px;
background-color: var(--button-color-progressive);
border: 2px solid #202122;
}
.mp-timeline dl, .mp-timeline dt, .mp-timeline dd { margin: 0; }
.mp-timeline dd { opacity: 0.8; }
.mp-timeline dd:before { content: "– "; }
/* 平台版本行 */
.mp-platform-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 6px;
}
.mp-platform {
min-width: 300px;
display: flex;
gap: 5px;
align-items: center;
}