MediaWiki:Common.css:修订间差异
外观
删除的内容 添加的内容
Maintenance script(留言 | 贡献) 首页样式小幅优化(选择器收敛与中间断点) |
Maintenance script(留言 | 贡献) 重构 Common.css 以适配 Citizen 首页样式 |
||
| 第1行: | 第1行: | ||
/* 全局字体 |
/* 全局字体:交给 Citizen 的字体变量优先处理,保留中文系统字体兜底。 */ |
||
body { |
body { |
||
font-family: var(--font-family-citizen-base), var(--font-family-language-base), |
|||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, |
|||
system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", |
|||
"Noto Sans |
"Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif; |
||
"Microsoft YaHei", "WenQuanYi Micro Hei", "SimSun", "SimHei", |
|||
"Songti SC", "KaiTi", "MingLiU", "PMingLiU", "Microsoft JhengHei", "Malgun Gothic"; |
|||
} |
} |
||
/* 2026-01-11: load Mainpage-specific styles from dedicated page */ |
|||
/* 全站重定向链接样式 */ |
/* 全站重定向链接样式 */ |
||
.mw-redirect { |
.mw-redirect { |
||
color: var(--color-success, #14866d); |
|||
color: #008000 !important; /* 使用 hex 颜色值,提高优先级 */ |
|||
font-weight: 500; |
font-weight: 500; |
||
} |
} |
||
/* 重定向链接悬停效果 */ |
|||
.mw-redirect:hover { |
.mw-redirect:hover { |
||
color: |
color: var(--color-success--hover, #0f6f59); |
||
text-decoration: underline; |
text-decoration: underline; |
||
} |
} |
||
/* 导航框样式迁移至 Template:Navbox/styles.css */ |
|||
/* 语言链接样式 */ |
/* 语言链接样式 */ |
||
| 第36行: | 第28行: | ||
margin-right: 10px; |
margin-right: 10px; |
||
} |
} |
||
/* 2026-01-12: 首页样式从 LocalSettings.php 迁移到此处(仅首页生效) */ |
|||
/* 首页:使用页面内 wrapper,避免依赖英文 Main Page 页面名。 */ |
|||
body.page-Main_Page .banner { |
|||
.mw-parser-output .mw-mainpage { |
|||
height: auto !important; |
|||
display: flex |
display: flex; |
||
flex-direction: column |
flex-direction: column; |
||
gap: 1rem; |
|||
justify-content: center !important; |
|||
align-items: center !important; |
|||
background: linear-gradient(135deg, #8B0000, #B22222) !important; /* 改进对比度 */ |
|||
color: white !important; |
|||
font-weight: bold !important; |
|||
border-radius: 12px !important; |
|||
padding: 12px 24px !important; |
|||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; |
|||
text-align: center !important; |
|||
margin: 20px 0 !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-hero, |
|||
body.page-Main_Page .banner-text { |
|||
.mw-parser-output .mw-mainpage-section, |
|||
margin: 0 !important; |
|||
.mw-parser-output .mw-mainpage-card { |
|||
line-height: 1.4 !important; |
|||
border: 1px solid var(--border-color-base, #c8ccd1); |
|||
border-radius: var(--border-radius-medium, 8px); |
|||
background: var(--color-surface-1, #fff); |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-hero { |
|||
body.page-Main_Page .banner .chinese-text { |
|||
padding: 1.5rem; |
|||
font-size: 24px !important; |
|||
background: |
|||
font-weight: 700 !important; |
|||
linear-gradient(135deg, var(--background-color-progressive-subtle, rgba(51, 102, 204, 0.12)), transparent 62%), |
|||
var(--color-surface-2, #f8f9fa); |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-kicker { |
|||
body.page-Main_Page .banner .english-text { |
|||
margin: 0 0 0.5rem; |
|||
color: var(--color-progressive, #36c); |
|||
font-weight: 500 !important; |
|||
font-size: 0.875rem; |
|||
font-weight: 700; |
|||
letter-spacing: 0; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-quote { |
|||
/* 当屏幕宽度大于 768px(如平板和大屏幕设备) */ |
|||
margin: 0; |
|||
@media screen and (min-width: 768px) { |
|||
color: var(--color-emphasized, #202122); |
|||
body.page-Main_Page .banner .chinese-text { |
|||
font-size: 1.35rem; |
|||
font-weight: 700; |
|||
} |
|||
line-height: 1.55; |
|||
body.page-Main_Page .banner .english-text { |
|||
font-size: 18px !important; |
|||
} |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-quote-secondary { |
|||
/* 当屏幕宽度小于 480px(如手机设备) */ |
|||
margin-top: 0.75rem; |
|||
@media screen and (max-width: 480px) { |
|||
font-size: 1rem; |
|||
body.page-Main_Page .banner .chinese-text { |
|||
font-weight: 500; |
|||
} |
|||
body.page-Main_Page .banner .english-text { |
|||
font-size: 14px !important; |
|||
} |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-quote-source { |
|||
/* 内容块样式 */ |
|||
margin: 0.25rem 0 0; |
|||
body.page-Main_Page .content-box { |
|||
color: var(--color-subtle, #54595d); |
|||
margin: 10px !important; |
|||
font-size: 0.875rem; |
|||
padding: 20px !important; |
|||
border-radius: 10px !important; |
|||
border: 1px solid #e0e0e0 !important; |
|||
-webkit-transition: -webkit-transform 0.3s ease, box-shadow 0.3s ease !important; |
|||
transition: transform 0.3s ease, box-shadow 0.3s ease !important; |
|||
will-change: transform !important; /* 性能优化 */ |
|||
backface-visibility: hidden !important; /* 性能优化 */ |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-section, |
|||
body.page-Main_Page .content-box:hover { |
|||
.mw-parser-output .mw-mainpage-card { |
|||
-webkit-transform: translateY(-5px) !important; |
|||
padding: 1rem; |
|||
-moz-transform: translateY(-5px) !important; |
|||
transform: translateY(-5px) !important; |
|||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18) !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-section-heading { |
|||
body.page-Main_Page .content-box:focus { |
|||
margin-bottom: 0.75rem; |
|||
outline: 2px solid #0066cc !important; /* 可访问性改进 */ |
|||
outline-offset: 2px !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage h2 { |
|||
margin-top: 0; |
|||
position: relative !important; |
|||
padding-bottom: |
padding-bottom: 0.45rem; |
||
border-bottom: 1px solid var(--border-color-base, #c8ccd1); |
|||
color: var(--color-emphasized, #202122); |
|||
border-bottom: 2px solid red !important; |
|||
color: #333333 !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage p { |
|||
body.page-Main_Page .content-box p { |
|||
color: var(--color-base, #202122); |
|||
line-height: 1.6 !important; |
|||
line-height: 1.7; |
|||
color: #666666 !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-section-heading p, |
|||
/* Flex 容器 */ |
|||
.mw-parser-output .mw-mainpage-card > p, |
|||
body.page-Main_Page .flex-container { |
|||
.mw-parser-output .mw-mainpage-quote-source { |
|||
display: flex !important; |
|||
color: var(--color-subtle, #54595d); |
|||
justify-content: space-between !important; |
|||
gap: 20px !important; |
|||
flex-wrap: wrap !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-tag-list { |
|||
body.page-Main_Page .flex-container .content-box { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
min-width: 300px !important; |
|||
gap: 0.5rem; |
|||
max-width: 33.33% !important; |
|||
box-sizing: border-box !important; |
|||
} |
|||
/* 中等屏幕优化 */ |
|||
@media (max-width: 900px) { |
|||
body.page-Main_Page .flex-container .content-box { |
|||
max-width: 50% !important; |
|||
} |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-tag-list a { |
|||
display: inline-flex; |
|||
/* 移动端优化 */ |
|||
align-items: center; |
|||
@media (max-width: 768px) { |
|||
min-height: 2rem; |
|||
body.page-Main_Page .flex-container { |
|||
padding: 0.25rem 0.75rem; |
|||
flex-direction: column !important; |
|||
border: 1px solid var(--border-color-base, #c8ccd1); |
|||
gap: 15px !important; /* 统一间距 */ |
|||
border-radius: 999px; |
|||
} |
|||
background: var(--color-surface-2, #f8f9fa); |
|||
color: var(--color-emphasized, #202122); |
|||
body.page-Main_Page .flex-container .content-box { |
|||
font-weight: 500; |
|||
max-width: 100% !important; /* 移除限制 */ |
|||
text-decoration: none; |
|||
width: 100% !important; |
|||
margin-bottom: 0 !important; /* 统一使用 gap */ |
|||
} |
|||
body.page-Main_Page .banner .chinese-text, |
|||
body.page-Main_Page .banner .english-text { |
|||
text-align: center !important; |
|||
} |
|||
body.page-Main_Page .banner .chinese-text { |
|||
font-size: 20px !important; |
|||
} |
|||
body.page-Main_Page .banner .english-text { |
|||
font-size: 14px !important; |
|||
} |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-tag-list a:hover { |
|||
/* 为减少动画的用户提供支持 */ |
|||
border-color: var(--color-progressive, #36c); |
|||
@media (prefers-reduced-motion: reduce) { |
|||
background: var(--background-color-progressive-subtle, rgba(51, 102, 204, 0.12)); |
|||
body.page-Main_Page .content-box { |
|||
color: var(--color-progressive, #36c); |
|||
-webkit-transition: none !important; |
|||
transition: none !important; |
|||
} |
|||
body.page-Main_Page .content-box:hover { |
|||
-webkit-transform: none !important; |
|||
-moz-transform: none !important; |
|||
transform: none !important; |
|||
} |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-grid { |
|||
/* 暗色模式覆盖(Citizen: night) */ |
|||
display: grid; |
|||
.skin-theme-clientpref-night body.page-Main_Page .banner { |
|||
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); |
|||
background: linear-gradient(135deg, #3a0c0c, #5a1a1a) !important; |
|||
gap: 1rem; |
|||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45) !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-grid-secondary { |
|||
.skin-theme-clientpref-night body.page-Main_Page .content-box { |
|||
grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); |
|||
border-color: #2f2f2f !important; |
|||
background-color: #1c1c1c !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-card { |
|||
.skin-theme-clientpref-night body.page-Main_Page .content-box:hover { |
|||
min-width: 0; |
|||
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5) !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-card ul { |
|||
.skin-theme-clientpref-night body.page-Main_Page .content-box:focus { |
|||
margin-bottom: 0; |
|||
outline-color: #5ea0ff !important; |
|||
} |
} |
||
.mw-parser-output .mw-mainpage-card li { |
|||
.skin-theme-clientpref-night body.page-Main_Page .content-box h2 { |
|||
margin: 0.25rem 0; |
|||
border-bottom-color: #b94a4a !important; |
|||
color: #ffffff !important; |
|||
} |
} |
||
@media (max-width: 768px) { |
|||
.skin-theme-clientpref-night body.page-Main_Page .content-box p { |
|||
.mw-parser-output .mw-mainpage-hero { |
|||
color: #cccccc !important; |
|||
padding: 1rem; |
|||
} |
|||
.mw-parser-output .mw-mainpage-quote { |
|||
font-size: 1.15rem; |
|||
} |
|||
.mw-parser-output .mw-mainpage-grid, |
|||
.mw-parser-output .mw-mainpage-grid-secondary { |
|||
grid-template-columns: 1fr; |
|||
} |
|||
} |
} |
||
2026年7月16日 (四) 18:13的版本
/* 全局字体:交给 Citizen 的字体变量优先处理,保留中文系统字体兜底。 */
body {
font-family: var(--font-family-citizen-base), var(--font-family-language-base),
system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
"Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* 全站重定向链接样式 */
.mw-redirect {
color: var(--color-success, #14866d);
font-weight: 500;
}
.mw-redirect:hover {
color: var(--color-success--hover, #0f6f59);
text-decoration: underline;
}
/* 语言链接样式 */
#p-lang ul {
list-style: none;
padding: 0;
margin: 10px 0;
}
#p-lang li {
display: inline-block;
margin-right: 10px;
}
/* 首页:使用页面内 wrapper,避免依赖英文 Main Page 页面名。 */
.mw-parser-output .mw-mainpage {
display: flex;
flex-direction: column;
gap: 1rem;
}
.mw-parser-output .mw-mainpage-hero,
.mw-parser-output .mw-mainpage-section,
.mw-parser-output .mw-mainpage-card {
border: 1px solid var(--border-color-base, #c8ccd1);
border-radius: var(--border-radius-medium, 8px);
background: var(--color-surface-1, #fff);
}
.mw-parser-output .mw-mainpage-hero {
padding: 1.5rem;
background:
linear-gradient(135deg, var(--background-color-progressive-subtle, rgba(51, 102, 204, 0.12)), transparent 62%),
var(--color-surface-2, #f8f9fa);
}
.mw-parser-output .mw-mainpage-kicker {
margin: 0 0 0.5rem;
color: var(--color-progressive, #36c);
font-size: 0.875rem;
font-weight: 700;
letter-spacing: 0;
}
.mw-parser-output .mw-mainpage-quote {
margin: 0;
color: var(--color-emphasized, #202122);
font-size: 1.35rem;
font-weight: 700;
line-height: 1.55;
}
.mw-parser-output .mw-mainpage-quote-secondary {
margin-top: 0.75rem;
font-size: 1rem;
font-weight: 500;
}
.mw-parser-output .mw-mainpage-quote-source {
margin: 0.25rem 0 0;
color: var(--color-subtle, #54595d);
font-size: 0.875rem;
}
.mw-parser-output .mw-mainpage-section,
.mw-parser-output .mw-mainpage-card {
padding: 1rem;
}
.mw-parser-output .mw-mainpage-section-heading {
margin-bottom: 0.75rem;
}
.mw-parser-output .mw-mainpage h2 {
margin-top: 0;
padding-bottom: 0.45rem;
border-bottom: 1px solid var(--border-color-base, #c8ccd1);
color: var(--color-emphasized, #202122);
}
.mw-parser-output .mw-mainpage p {
color: var(--color-base, #202122);
line-height: 1.7;
}
.mw-parser-output .mw-mainpage-section-heading p,
.mw-parser-output .mw-mainpage-card > p,
.mw-parser-output .mw-mainpage-quote-source {
color: var(--color-subtle, #54595d);
}
.mw-parser-output .mw-mainpage-tag-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.mw-parser-output .mw-mainpage-tag-list a {
display: inline-flex;
align-items: center;
min-height: 2rem;
padding: 0.25rem 0.75rem;
border: 1px solid var(--border-color-base, #c8ccd1);
border-radius: 999px;
background: var(--color-surface-2, #f8f9fa);
color: var(--color-emphasized, #202122);
font-weight: 500;
text-decoration: none;
}
.mw-parser-output .mw-mainpage-tag-list a:hover {
border-color: var(--color-progressive, #36c);
background: var(--background-color-progressive-subtle, rgba(51, 102, 204, 0.12));
color: var(--color-progressive, #36c);
}
.mw-parser-output .mw-mainpage-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
gap: 1rem;
}
.mw-parser-output .mw-mainpage-grid-secondary {
grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
}
.mw-parser-output .mw-mainpage-card {
min-width: 0;
}
.mw-parser-output .mw-mainpage-card ul {
margin-bottom: 0;
}
.mw-parser-output .mw-mainpage-card li {
margin: 0.25rem 0;
}
@media (max-width: 768px) {
.mw-parser-output .mw-mainpage-hero {
padding: 1rem;
}
.mw-parser-output .mw-mainpage-quote {
font-size: 1.15rem;
}
.mw-parser-output .mw-mainpage-grid,
.mw-parser-output .mw-mainpage-grid-secondary {
grid-template-columns: 1fr;
}
}