MediaWiki:Common.css:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第37行: | 第37行: | ||
/* ========================================================================== | /* ========================================================================== | ||
3. 现代矩形自适应导航 (核心逻辑) | 3. 现代矩形自适应导航 (核心逻辑 - 彻底去内框增强版) | ||
========================================================================== */ | ========================================================================== */ | ||
/* | /* 3.1 基础显隐逻辑 */ | ||
.adaptive-nav input[type="radio"] { display: none !important; } | |||
/* | .nav-content { | ||
display: none; | |||
overflow: hidden; | |||
background: var(--color-surface-2, rgba(0, 0, 0, 0.05)); | |||
border-radius: 10px; | |||
animation: navSlideIn 0.3s ease-out; | |||
} | |||
.nav-content:not(.mw-collapsed) { display: block !important; } | |||
/* 3.2 现代卡片按钮样式 (强制清洗皮肤样式) */ | |||
.nav-text-btn { | .nav-text-btn { | ||
all: unset; /* | all: unset; /* 抹除基础样式 */ | ||
position: relative; | position: relative; | ||
cursor: pointer; | cursor: pointer; | ||
display: flex !important; | display: flex !important; | ||
align-items: center; | align-items: center; | ||
justify-content: flex-start; | justify-content: flex-start; | ||
height: 64px; | height: 64px; | ||
padding: 0 24px; | padding: 0 24px; | ||
| 第56行: | 第65行: | ||
color: var(--color-base, #333) !important; | color: var(--color-base, #333) !important; | ||
border-radius: 10px; | border-radius: 10px; | ||
/* | /* 默认背景:没图时与网页背景融合或稍微显眼一点 */ | ||
background-color: var(--color-surface-1, #f9f9f9); | background-color: var(--color-surface-1, #f9f9f9) !important; | ||
border: 1px solid var(--border-color-base, rgba(0,0,0,0.1)); | background-image: none; | ||
border-bottom: 4px solid rgba(0, 0, 0, 0.15); | border: 1px solid var(--border-color-base, rgba(0,0,0,0.1)) !important; | ||
border-bottom: 4px solid rgba(0, 0, 0, 0.15) !important; | |||
transition: all 0.2s ease; | transition: all 0.2s ease; | ||
overflow: hidden; | overflow: hidden; | ||
z-index: 1; | z-index: 1; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
} | } | ||
/* | /* 【关键】彻底杀死 Citizen 皮肤产生的内框 */ | ||
.nav-text-btn, | |||
.nav-text-btn:hover, | |||
.nav-text-btn:active, | |||
.nav-text-btn.mw-customtoggle { | |||
background-image: none !important; /* 去掉皮肤自带的浅蓝色渐变 */ | |||
box-shadow: none !important; /* 去掉悬停时的发光内框 */ | |||
} | |||
/* 强制 span 内部无样式 */ | |||
.nav-text-btn span { | .nav-text-btn span { | ||
background: transparent !important; | background: transparent !important; | ||
padding: 0 !important; | padding: 0 !important; | ||
border: none !important; | border: none !important; | ||
display: inline-block; | display: inline-block; | ||
z-index: 2; | z-index: 2; | ||
} | } | ||
/* | /* 遮罩逻辑:仅在【手动】添加 has-bg-image 类名时激活 */ | ||
.has-bg-image::before { | .nav-text-btn.has-bg-image::before { | ||
content: ""; | content: ""; | ||
position: absolute; | position: absolute; | ||
top: 0; left: 0; width: 100%; height: 100%; | top: 0; left: 0; width: 100%; height: 100%; | ||
background: linear-gradient(to right, rgba(0,0,0,0. | background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%); | ||
z-index: 1; | z-index: 1; | ||
} | } | ||
.has-bg-image | .nav-text-btn.has-bg-image { color: #fff !important; } | ||
.nav-text-btn.has-bg-image span { text-shadow: 2px 2px 4px rgba(0,0,0,0.8); } | |||
/* 3.3 交互反馈 */ | |||
.nav-text-btn:hover { filter: brightness(0.98); border-color: var(--color-primary, #36c) !important; } | |||
.nav-text-btn:active { transform: translateY(2px); border-bottom-width: 1px !important; } | |||
/* 3.4 按钮背景个性化配置区 */ | |||
.btn-bg-1 { background-size: cover; background-position: center; } | |||
.btn-bg-2 { background-size: cover; background-position: center; } | |||
.btn-bg-3 { background-size: cover; background-position: center; } | |||
.btn-bg-4 { background-size: cover; background-position: center; } | |||
/* ========================================================================== | |||
4. 自适应逻辑 (PC网格 vs 移动端手风琴) | |||
========================================================================== */ | |||
@media (min-width: 769px) { | |||
.adaptive-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; } | |||
.nav-module { display: contents; } | |||
.nav-text-btn { grid-row: 1; } | |||
.nav-content { grid-row: 2; grid-column: 1 / 5; margin-top: 10px; } | |||
} | |||
@media (max-width: 768px) { | |||
.adaptive-nav { display: block; } | |||
.nav-module { margin-bottom: 8px; } | |||
.nav-text-btn { width: 100%; } | |||
.nav-content { border-radius: 0 0 10px 10px; margin-top: -4px; border: 1px solid rgba(0, 0, 0, 0.1); border-top: none; } | |||
} | } | ||
@keyframes navSlideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } } | |||
/* ========================================================================== | /* ========================================================================== | ||
4. 自适应分屏逻辑 (PC网格 vs 移动端手风琴) | 4. 自适应分屏逻辑 (PC网格 vs 移动端手风琴) | ||
2026年4月2日 (四) 01:21的版本
/* ==========================================================================
1. 系统界面清理 & 基础修正
========================================================================== */
#ca-viewsource, #ca-history, #ca-talk {
display: none !important;
}
pre {
white-space: pre-wrap;
overflow-wrap: break-word;
}
.wikitable {
max-width: 100%;
margin: 1em 0;
}
/* ==========================================================================
2. 交互组件:黑幕 (Heimu)
========================================================================== */
.heimu, .heimu rt {
background-color: var(--color-base, #252525);
color: var(--color-base, #252525);
text-shadow: none;
transition: color 0.13s linear, background-color 0.13s linear;
user-select: none;
}
.heimu a, a .heimu, .new .heimu {
color: var(--color-base, #252525);
}
span.heimu:hover, span.heimu:active {
background-color: transparent;
color: var(--color-base--inverted, #ffffff) !important;
user-select: text;
}
span.heimu:hover a, a:hover span.heimu { color: var(--color-primary, #add8e6) !important; }
/* ==========================================================================
3. 现代矩形自适应导航 (核心逻辑 - 彻底去内框增强版)
========================================================================== */
/* 3.1 基础显隐逻辑 */
.adaptive-nav input[type="radio"] { display: none !important; }
.nav-content {
display: none;
overflow: hidden;
background: var(--color-surface-2, rgba(0, 0, 0, 0.05));
border-radius: 10px;
animation: navSlideIn 0.3s ease-out;
}
.nav-content:not(.mw-collapsed) { display: block !important; }
/* 3.2 现代卡片按钮样式 (强制清洗皮肤样式) */
.nav-text-btn {
all: unset; /* 抹除基础样式 */
position: relative;
cursor: pointer;
display: flex !important;
align-items: center;
justify-content: flex-start;
height: 64px;
padding: 0 24px;
font-weight: bold;
font-size: 18px;
color: var(--color-base, #333) !important;
border-radius: 10px;
/* 默认背景:没图时与网页背景融合或稍微显眼一点 */
background-color: var(--color-surface-1, #f9f9f9) !important;
background-image: none;
border: 1px solid var(--border-color-base, rgba(0,0,0,0.1)) !important;
border-bottom: 4px solid rgba(0, 0, 0, 0.15) !important;
transition: all 0.2s ease;
overflow: hidden;
z-index: 1;
box-sizing: border-box;
}
/* 【关键】彻底杀死 Citizen 皮肤产生的内框 */
.nav-text-btn,
.nav-text-btn:hover,
.nav-text-btn:active,
.nav-text-btn.mw-customtoggle {
background-image: none !important; /* 去掉皮肤自带的浅蓝色渐变 */
box-shadow: none !important; /* 去掉悬停时的发光内框 */
}
/* 强制 span 内部无样式 */
.nav-text-btn span {
background: transparent !important;
padding: 0 !important;
border: none !important;
display: inline-block;
z-index: 2;
}
/* 遮罩逻辑:仅在【手动】添加 has-bg-image 类名时激活 */
.nav-text-btn.has-bg-image::before {
content: "";
position: absolute;
top: 0; left: 0; width: 100%; height: 100%;
background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
z-index: 1;
}
.nav-text-btn.has-bg-image { color: #fff !important; }
.nav-text-btn.has-bg-image span { text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }
/* 3.3 交互反馈 */
.nav-text-btn:hover { filter: brightness(0.98); border-color: var(--color-primary, #36c) !important; }
.nav-text-btn:active { transform: translateY(2px); border-bottom-width: 1px !important; }
/* 3.4 按钮背景个性化配置区 */
.btn-bg-1 { background-size: cover; background-position: center; }
.btn-bg-2 { background-size: cover; background-position: center; }
.btn-bg-3 { background-size: cover; background-position: center; }
.btn-bg-4 { background-size: cover; background-position: center; }
/* ==========================================================================
4. 自适应逻辑 (PC网格 vs 移动端手风琴)
========================================================================== */
@media (min-width: 769px) {
.adaptive-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.nav-module { display: contents; }
.nav-text-btn { grid-row: 1; }
.nav-content { grid-row: 2; grid-column: 1 / 5; margin-top: 10px; }
}
@media (max-width: 768px) {
.adaptive-nav { display: block; }
.nav-module { margin-bottom: 8px; }
.nav-text-btn { width: 100%; }
.nav-content { border-radius: 0 0 10px 10px; margin-top: -4px; border: 1px solid rgba(0, 0, 0, 0.1); border-top: none; }
}
@keyframes navSlideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
/* ==========================================================================
4. 自适应分屏逻辑 (PC网格 vs 移动端手风琴)
========================================================================== */
/* PC端:横向排列按钮,内容横跨整行 */
@media (min-width: 769px) {
.adaptive-nav {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
margin: 20px 0;
}
.nav-module { display: contents; }
.nav-text-btn { grid-row: 1; }
.nav-content {
grid-row: 2;
grid-column: 1 / 5;
margin-top: 10px;
border: 1px solid var(--border-color-base, rgba(255, 255, 255, 0.1));
}
#game-1:checked ~ .nav-module #content-1,
#game-2:checked ~ .nav-module #content-2,
#game-3:checked ~ .nav-module #content-3,
#game-4:checked ~ .nav-module #content-4 {
display: block;
}
}
/* 移动端:按钮堆叠,内容就地展开 */
@media (max-width: 768px) {
.adaptive-nav { display: block; padding: 0 5px; }
.nav-module { margin-bottom: 8px; }
.nav-text-btn { width: 100%; }
.nav-content {
border-radius: 0 0 10px 10px;
margin-top: -4px;
border: 1px solid rgba(0, 0, 0, 0.1);
border-top: none;
}
/* 移动端特殊:由于 display: contents 失效,直接按顺序显示内容 */
#game-1:checked ~ .nav-module:nth-of-type(1) #content-1,
#game-2:checked ~ .nav-module:nth-of-type(2) #content-2,
#game-3:checked ~ .nav-module:nth-of-type(3) #content-3,
#game-4:checked ~ .nav-module:nth-of-type(4) #content-4 {
display: block;
}
}
/* ==========================================================================
5. 首页网格与内容样式 (原本保留)
========================================================================== */
.home-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
}
.home-card {
background: var(--color-surface-1);
border: 1px solid var(--border-color-base);
border-radius: 12px;
padding: 24px;
transition: all 0.3s ease;
}
.nav-sub-text {
margin-top: 12px;
font-weight: 600;
font-size: 14px;
color: var(--color-base);
}
@keyframes slideIn {
from { opacity: 0; transform: translateY(-5px); }
to { opacity: 1; transform: translateY(0); }
}