Template:Main page/shared/styles.css
模板页面
更多操作
/* 卡车模拟中文维基首页
* 内容模型必须设置为“净化的 CSS / Sanitized CSS”。
*/
:root {
--home-accent: #d89b24;
--home-accent-soft: rgba(216, 155, 36, 0.14);
--home-surface: var(--background-color-base, #fff);
--home-surface-alt: var(--background-color-neutral-subtle, #f8f9fa);
--home-text: var(--color-base, #202122);
--home-muted: var(--color-subtle, #54595d);
--home-border: var(--border-color-base, #a2a9b1);
--home-border-subtle: var(--border-color-subtle, #eaecf0);
--home-radius: 12px;
--home-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
.home-page,
.home-page * {
box-sizing: border-box;
}
.home-page {
max-width: 1440px;
margin: 0 auto;
color: var(--home-text);
}
.home-page a {
text-decoration: none;
}
.home-page a:hover {
text-decoration: none;
}
.home-grid {
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
gap: 16px;
}
.home-header {
position: relative;
min-height: 390px;
margin-bottom: 14px;
overflow: hidden;
border-radius: 0 0 18px 18px;
background: #111820;
color: #fff;
}
.home-header__backdrop,
.home-header__backdrop .mw-file-description,
.home-header__backdrop .mw-file-element {
position: absolute;
inset: 0;
display: block;
width: 100%;
height: 100%;
}
.home-header__backdrop .mw-file-element {
object-fit: cover;
object-position: center 58%;
}
.home-header__shade {
position: absolute;
inset: 0;
background:
linear-gradient(90deg, rgba(7, 11, 15, 0.94) 0%, rgba(7, 11, 15, 0.75) 43%, rgba(7, 11, 15, 0.2) 76%, rgba(7, 11, 15, 0.35) 100%),
linear-gradient(0deg, rgba(7, 11, 15, 0.75) 0%, transparent 55%);
}
.home-header__content {
position: relative;
z-index: 1;
display: flex;
min-height: 390px;
max-width: 760px;
padding: 68px 56px 48px;
flex-direction: column;
justify-content: center;
}
.home-header__eyebrow,
.home-section-heading__eyebrow,
.home-card__label,
.home-button__eyebrow {
font-size: 0.78rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.home-header__eyebrow {
margin-bottom: 8px;
color: #f1be59;
}
.home-header__title {
font-size: clamp(2.25rem, 5vw, 4.25rem);
font-weight: 800;
letter-spacing: -0.045em;
line-height: 1.02;
}
.home-header__subtitle {
max-width: 680px;
margin-top: 16px;
color: rgba(255, 255, 255, 0.82);
font-size: 1.05rem;
line-height: 1.75;
}
.home-search {
max-width: 620px;
margin-top: 28px;
}
.home-search form {
display: flex;
gap: 8px;
}
.home-search .mw-inputbox-input {
min-width: 0;
height: 44px;
padding: 0 15px;
flex: 1;
border: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 8px;
background: rgba(255, 255, 255, 0.12);
box-shadow: none;
color: #fff;
backdrop-filter: blur(10px);
}
.home-search .mw-inputbox-input::placeholder {
color: rgba(255, 255, 255, 0.68);
}
.home-search .mw-ui-button,
.home-search input[type="submit"] {
height: 44px;
padding: 0 20px;
border: 0;
border-radius: 8px;
background: var(--home-accent);
color: #17120a;
font-weight: 700;
}
.home-status {
align-items: stretch;
margin-bottom: 30px;
padding: 0 18px;
border: 1px solid var(--home-border-subtle);
border-radius: var(--home-radius);
background: var(--home-surface);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.home-status__cell {
display: flex;
min-height: 64px;
padding: 12px 18px;
grid-column: span 3;
align-items: center;
gap: 12px;
border-left: 1px solid var(--home-border-subtle);
font-size: 1rem;
font-weight: 700;
}
.home-status__cell--label {
grid-column: span 2;
border-left: 0;
color: var(--home-muted);
font-size: 0.8rem;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.home-status__cell--event {
grid-column: span 4;
}
.home-status__game {
display: inline-flex;
min-width: 46px;
height: 26px;
padding: 0 8px;
align-items: center;
justify-content: center;
border-radius: 5px;
background: var(--home-accent-soft);
color: #976711;
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.05em;
}
.home-navigation {
margin: 0 0 32px;
}
.home-section-heading {
display: flex;
margin-bottom: 14px;
align-items: flex-end;
justify-content: space-between;
gap: 20px;
}
.home-section-heading__eyebrow,
.home-card__label,
.home-button__eyebrow {
color: #a36e13;
}
.home-section-heading__title {
margin-top: 2px;
font-size: 1.55rem;
font-weight: 800;
letter-spacing: -0.02em;
}
.home-section-heading__more {
font-size: 0.9rem;
}
.home-nav-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 10px;
}
.home-nav__item > a {
display: flex;
min-height: 78px;
padding: 14px;
align-items: center;
gap: 12px;
border: 1px solid var(--home-border-subtle);
border-radius: 10px;
background: var(--home-surface);
color: var(--home-text);
transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.home-nav__item > a:hover {
transform: translateY(-2px);
border-color: var(--home-accent);
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}
.home-nav__code {
display: inline-flex;
width: 42px;
height: 42px;
flex: 0 0 42px;
align-items: center;
justify-content: center;
border-radius: 8px;
background: var(--home-accent-soft);
color: #986711;
font-size: 0.7rem;
font-weight: 800;
letter-spacing: 0.06em;
}
.home-nav__text {
display: flex;
min-width: 0;
flex-direction: column;
}
.home-nav__text strong {
font-size: 0.98rem;
}
.home-nav__text small,
.home-project__content small,
.home-topic-list__item small,
.home-patch small {
margin-top: 2px;
color: var(--home-muted);
font-size: 0.78rem;
font-weight: 400;
line-height: 1.35;
}
.home-card {
position: relative;
min-width: 0;
overflow: hidden;
padding: 22px;
border: 1px solid var(--home-border-subtle);
border-radius: var(--home-radius);
background: var(--home-surface);
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.045);
}
.home-card--col3 { grid-column: span 3; }
.home-card--col4 { grid-column: span 4; }
.home-card--col5 { grid-column: span 5; }
.home-card--col8 { grid-column: span 8; }
.home-card--row3 { min-height: 280px; }
.home-card--row4 { min-height: 370px; }
.home-card__header {
margin-top: 7px;
font-size: 1.35rem;
font-weight: 800;
letter-spacing: -0.02em;
line-height: 1.25;
}
.home-card__description {
margin-top: 10px;
color: var(--home-muted);
line-height: 1.65;
}
.home-card__actions {
display: flex;
margin-top: 18px;
flex-wrap: wrap;
gap: 8px;
}
.home-action > a,
.home-action--quiet > a {
display: inline-flex;
min-height: 36px;
padding: 7px 13px;
align-items: center;
border-radius: 7px;
font-size: 0.88rem;
font-weight: 700;
}
.home-action > a {
background: var(--home-accent);
color: #17120a;
}
.home-action--quiet > a {
border: 1px solid var(--home-border-subtle);
background: var(--home-surface-alt);
color: var(--home-text);
}
.home-card--featured {
padding: 0;
background: #111820;
color: #fff;
}
.home-featured__media,
.home-featured__media .mw-file-description,
.home-featured__media .mw-file-element {
position: absolute;
inset: 0;
display: block;
width: 100%;
height: 100%;
}
.home-featured__media .mw-file-element {
object-fit: cover;
}
.home-featured__shade {
position: absolute;
inset: 0;
background: linear-gradient(0deg, rgba(5, 8, 11, 0.96) 0%, rgba(5, 8, 11, 0.55) 48%, rgba(5, 8, 11, 0.08) 100%);
}
.home-featured__content {
position: absolute;
z-index: 1;
left: 0;
right: 0;
bottom: 0;
padding: 30px;
}
.home-featured__content .home-card__label {
color: #f1be59;
}
.home-featured__title {
margin-top: 6px;
font-size: clamp(1.8rem, 3vw, 2.7rem);
font-weight: 800;
letter-spacing: -0.035em;
}
.home-featured__title a,
.home-featured__link a {
color: #fff;
}
.home-featured__description {
max-width: 760px;
margin-top: 9px;
color: rgba(255, 255, 255, 0.8);
line-height: 1.6;
}
.home-featured__link {
margin-top: 16px;
font-weight: 700;
}
.home-topic-list,
.home-link,
.home-project-list,
.home-patch-list {
display: flex;
margin-top: 16px;
flex-direction: column;
gap: 8px;
}
.home-topic-list__item {
display: flex;
padding: 9px 0;
flex-direction: column;
border-top: 1px solid var(--home-border-subtle);
}
.home-topic-list__item:first-child {
border-top: 0;
}
.home-topic-list__item > a {
font-weight: 700;
}
.home-stat-grid {
display: grid;
margin-top: 22px;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.home-stat {
display: flex;
padding: 13px 10px;
flex-direction: column;
border-radius: 8px;
background: var(--home-surface-alt);
}
.home-stat strong {
font-size: 1.3rem;
}
.home-stat span {
margin-top: 2px;
color: var(--home-muted);
font-size: 0.75rem;
}
.home-link__button > a {
display: flex;
min-height: 38px;
padding: 8px 11px;
align-items: center;
justify-content: space-between;
border: 1px solid var(--home-border-subtle);
border-radius: 7px;
background: var(--home-surface-alt);
color: var(--home-text);
font-size: 0.88rem;
font-weight: 650;
}
.home-link__button > a::after {
content: "→";
color: var(--home-muted);
}
.home-patch {
display: grid;
padding: 12px 0;
grid-template-columns: 48px minmax(0, 1fr);
gap: 12px;
border-top: 1px solid var(--home-border-subtle);
}
.home-patch:first-child {
border-top: 0;
}
.home-patch__game,
.home-project__code {
display: inline-flex;
height: 34px;
align-items: center;
justify-content: center;
border-radius: 6px;
background: #202932;
color: #fff;
font-size: 0.7rem;
font-weight: 800;
letter-spacing: 0.05em;
}
.home-patch > div,
.home-project__content {
display: flex;
min-width: 0;
flex-direction: column;
}
.home-card--button {
min-height: 108px;
padding: 0;
background: #171d23;
}
.home-card--button > a {
display: flex;
min-height: 108px;
padding: 20px;
flex-direction: column;
justify-content: center;
color: #fff;
transition: background 140ms ease, transform 140ms ease;
}
.home-card--button > a:hover {
background: rgba(216, 155, 36, 0.16);
}
.home-button__eyebrow {
color: #f1be59;
}
.home-button__title {
margin-top: 5px;
font-size: 1.05rem;
font-weight: 750;
}
.home-card--highlight {
background:
linear-gradient(135deg, var(--home-accent-soft), transparent 65%),
var(--home-surface);
}
.home-project {
display: grid;
padding: 12px 0;
grid-template-columns: 52px minmax(0, 1fr);
gap: 12px;
border-top: 1px solid var(--home-border-subtle);
}
.home-project:first-child {
border-top: 0;
}
.home-footer {
display: flex;
padding: 24px 4px 8px;
justify-content: flex-end;
gap: 8px;
color: var(--home-muted);
font-size: 0.78rem;
}
/* Vector 等皮肤通常会给首页附加默认标题;若首页仍出现重复 H1,可在
* MediaWiki:Common.css 中按首页 body class 单独隐藏,而不要全站隐藏。
*/
@media (max-width: 1100px) {
.home-nav-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-card--col3,
.home-card--col4,
.home-card--col5,
.home-card--col8 {
grid-column: span 6;
}
.home-status__cell--label {
grid-column: span 3;
}
.home-status__cell,
.home-status__cell--event {
grid-column: span 3;
}
}
@media (max-width: 720px) {
.home-header,
.home-header__content {
min-height: 430px;
}
.home-header {
border-radius: 0 0 14px 14px;
}
.home-header__content {
padding: 54px 24px 36px;
justify-content: flex-end;
}
.home-header__shade {
background: linear-gradient(0deg, rgba(7, 11, 15, 0.97) 0%, rgba(7, 11, 15, 0.68) 62%, rgba(7, 11, 15, 0.3) 100%);
}
.home-search form {
flex-direction: column;
}
.home-search .mw-ui-button,
.home-search input[type="submit"] {
width: 100%;
}
.home-status {
padding: 0;
}
.home-status__cell,
.home-status__cell--label,
.home-status__cell--event {
min-height: 54px;
grid-column: 1 / -1;
border-top: 1px solid var(--home-border-subtle);
border-left: 0;
}
.home-status__cell--label {
border-top: 0;
}
.home-section-heading {
align-items: flex-start;
flex-direction: column;
gap: 6px;
}
.home-nav-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-nav__item > a {
min-height: 104px;
align-items: flex-start;
flex-direction: column;
}
.home-card--col3,
.home-card--col4,
.home-card--col5,
.home-card--col8 {
grid-column: 1 / -1;
}
.home-card--row3,
.home-card--row4 {
min-height: auto;
}
.home-card--featured {
min-height: 390px;
}
.home-featured__content {
padding: 24px;
}
.home-stat-grid {
grid-template-columns: 1fr;
}
.home-footer {
justify-content: flex-start;
flex-wrap: wrap;
}
}
@media (max-width: 430px) {
.home-nav-grid {
grid-template-columns: 1fr;
}
.home-nav__item > a {
min-height: 74px;
align-items: center;
flex-direction: row;
}
}
/* MediaWiki 1.41+ 夜间模式 */
html.skin-theme-clientpref-night {
--home-surface: #202122;
--home-surface-alt: #27292d;
--home-text: #eaecf0;
--home-muted: #c8ccd1;
--home-border: #54595d;
--home-border-subtle: #3b3d42;
--home-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
@media (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
--home-surface: #202122;
--home-surface-alt: #27292d;
--home-text: #eaecf0;
--home-muted: #c8ccd1;
--home-border: #54595d;
--home-border-subtle: #3b3d42;
--home-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
}