MediaWiki:Mobile.css
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* All CSS here will be loaded for users of the mobile site */
/* ============================================================
移动端首页样式 — 欧美克制风格
核心:中性基底 + 单一品牌强调色
============================================================ */
:root {
/* 中性基底 */
--canvas-bg: #ffffff;
--surface-subtle: #f7f8fa; /* 卡片/分隔区域的浅灰底 */
--text-primary: #111111; /* 近黑,保证可读性 */
--text-secondary: #5f6368; /* 辅助文字 */
--border-hairline: #e8eaed; /* 1px 极细分隔线 */
/* 品牌强调色 — 唯一需要你修改的地方 */
--brand-accent: #2a6ebb; /* ← 替换为你的品牌色 */
--brand-accent-soft: rgba(42, 110, 187, 0.08); /* 品牌色的8%透明度,用于背景点缀 */
/* 几何与间距 */
--radius-card: 12px; /* 欧美流行 8–14px 的中等圆角,非大圆角 */
--spacing-unit: 16px;
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* ---------- 画布与排版 ---------- */
body {
background: var(--canvas-bg) !important;
color: var(--text-primary);
font-size: 16px;
line-height: 1.65;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
.mw-body-content {
padding: calc(var(--spacing-unit) * 0.75) var(--spacing-unit) calc(var(--spacing-unit) * 2.5);
}
/* ---------- 标题:强调色只作为“功能性标记”出现 ---------- */
/* 页面主标题:不使用大面积品牌色块,只用一条细的强调色下划线 */
.mw-body-content h1.firstHeading {
font-size: 1.55rem;
font-weight: 650;
letter-spacing: -0.01em;
margin: 8px 0 20px;
padding-bottom: 10px;
border-bottom: 2px solid var(--brand-accent);
}
/* 分区标题:强调色仅作为左侧细竖条,极克制 */
.mw-body-content h2 {
font-size: 1.2rem;
font-weight: 600;
letter-spacing: -0.005em;
margin: 32px 0 12px;
padding-left: 10px;
border-left: 3px solid var(--brand-accent);
}
/* ---------- 内容区块:浅灰底 + 极细边框,替代重阴影 ---------- */
/* 将首页常见列表/内容块处理为“轻表面”,而非浮动卡片 */
.mw-body-content ul,
.mw-body-content .mw-parser-output > div:not(.mw-heading) {
background: var(--surface-subtle);
border: 1px solid var(--border-hairline);
border-radius: var(--radius-card);
padding: 6px 16px;
margin: 12px 0;
box-shadow: var(--shadow-card);
list-style: none;
}
.mw-body-content ul li {
padding: 10px 0;
border-bottom: 1px solid var(--border-hairline);
line-height: 1.55;
}
.mw-body-content ul li:last-child {
border-bottom: none;
}
/* ---------- 链接:品牌色是唯一“有颜色”的文本 ---------- */
.mw-body-content a {
color: var(--brand-accent);
text-decoration: none;
font-weight: 500;
-webkit-tap-highlight-color: transparent;
}
.mw-body-content a:active {
opacity: 0.65;
}
/* 已访问链接不引入第二种强调色,仅降低透明度 */
.mw-body-content a:visited {
color: var(--brand-accent);
opacity: 0.8;
}
/* ---------- 按钮/输入类元素 ---------- */
.mw-body-content .mw-ui-button,
.mw-body-content button,
.mw-body-content input[type="submit"] {
min-height: 44px;
border-radius: 8px;
font-weight: 600;
border: none;
background: var(--brand-accent);
color: #ffffff;
padding: 0 20px;
}
/* 次要按钮:描边风格,避免品牌色泛滥 */
.mw-body-content .mw-ui-button.mw-ui-quiet,
.mw-body-content .mw-ui-button.mw-ui-progressive {
background: transparent;
color: var(--brand-accent);
border: 1.5px solid var(--brand-accent);
}
/* ---------- 图片与媒体 ---------- */
.mw-body-content img {
max-width: 100%;
height: auto;
border-radius: 8px;
}
/* ---------- 可选:极淡的品牌色页面顶部氛围(非常克制) ---------- */
/* 如果你希望页面顶部有一丝品牌感,可以取消注释下面这段。
它只在最顶部添加一个几乎不可见的渐变,不会形成“色块”。 */
/*
.mw-body {
background-image: linear-gradient(to bottom, var(--brand-accent-soft), transparent 120px);
background-repeat: no-repeat;
}
*/
/* ---------- 小屏收紧 ---------- */
@media (max-width: 480px) {
.mw-body-content {
padding-left: 14px;
padding-right: 14px;
}
.mw-body-content h1.firstHeading {
font-size: 1.4rem;
}
.mw-body-content h2 {
margin-top: 26px;
}
}