跳转到内容

MediaWiki:Common.css:修订间差异

来自槌基百科
Replace global UI with 3 scoped themes: slate, dark, warm
Infobox: Wikipedia style for Classic, modern card scoped to themed modes
第284行: 第284行:
}
}
html.theme-warm .cdx-search-input__input { border-radius: 20px !important; border-color: #e8dcc8 !important; }
html.theme-warm .cdx-search-input__input { border-radius: 20px !important; border-color: #e8dcc8 !important; }
/* ═══════════════════════════════════════════════════════════════════
  CHARACTER INFOBOX — per-theme
  ═══════════════════════════════════════════════════════════════════ */
/* ── CLASSIC (no theme class): Wikipedia-faithful style ─────────── */
html:not([class*="theme-"]) table.infobox.biography {
    background: #f8f9fa !important;
    border: 1px solid #a2a9b1 !important;
    border-spacing: 3px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 22em !important;
    font-size: 88% !important;
    line-height: 1.6 !important;
    float: right !important;
    clear: right !important;
    margin: 0 0 1em 1em !important;
    padding: 3px !important;
}
html:not([class*="theme-"]) table.infobox.biography > caption {
    font-size: 125% !important;
    font-weight: bold !important;
    padding: 4px !important;
    color: #000 !important;
    background: none !important;
    border-radius: 0 !important;
    letter-spacing: normal !important;
    text-align: center !important;
}
/* Image header row — neutral grey, like Wikipedia biography boxes */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr:first-child > th {
    background: #cee0f2 !important;
    padding: 4px !important;
    border-radius: 0 !important;
    text-align: center !important;
}
html:not([class*="theme-"]) table.infobox.biography > tbody > tr:first-child > th img {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    max-width: 200px !important;
    object-fit: unset !important;
}
/* Label cells */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr > th {
    background: #eaecf0 !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 1em !important;
    padding: 3px 6px !important;
    vertical-align: top !important;
    white-space: nowrap !important;
    width: auto !important;
}
/* Value cells */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr > td {
    background: #f8f9fa !important;
    color: #000 !important;
    padding: 3px 6px !important;
    font-size: 1em !important;
    vertical-align: top !important;
}
/* ── SLATE / DARK / WARM: modern card style ─────────────────────── */
html[class*="theme-"] table.infobox.biography {
    background: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
    border-spacing: 0 !important;
    overflow: hidden;
    margin: 0 0 1.2em 1.5em !important;
    width: 240px !important;
}
html[class*="theme-"] table.infobox.biography > caption {
    background: #2c3a4a !important;
    color: #fff !important;
    font-size: 1.15em !important;
    font-weight: 700 !important;
    padding: 0.55em 0.8em !important;
    letter-spacing: 0.04em;
    border-radius: 14px 14px 0 0;
    caption-side: top;
    text-align: center !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr:first-child > th {
    background: #3d4f63 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-align: center !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr:first-child > th img {
    display: block !important;
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: top center !important;
    margin: 0 auto !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #eef0f3;
}
html[class*="theme-"] table.infobox.biography > tbody > tr > th {
    background: #f7f8fb !important;
    color: #555 !important;
    font-weight: 600 !important;
    font-size: 0.88em !important;
    padding: 0.45em 0.75em !important;
    white-space: nowrap;
    width: 38%;
    vertical-align: middle;
}
html[class*="theme-"] table.infobox.biography > tbody > tr > td {
    background: #ffffff !important;
    color: #222 !important;
    padding: 0.45em 0.75em !important;
    font-size: 0.9em !important;
    vertical-align: middle;
}
/* Dark theme overrides for the card interior */
html.theme-dark table.infobox.biography > tbody > tr > th {
    background: #252836 !important;
    color: #a0aec0 !important;
}
html.theme-dark table.infobox.biography > tbody > tr > td {
    background: #1a1d27 !important;
    color: #e2e8f0 !important;
}
html.theme-dark table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #2d3748;
}
/* Warm theme overrides */
html.theme-warm table.infobox.biography > caption {
    background: #7a4f1d !important;
}
html.theme-warm table.infobox.biography > tbody > tr:first-child > th {
    background: #9c6b2e !important;
}
html.theme-warm table.infobox.biography > tbody > tr > th {
    background: #f5ede0 !important;
    color: #6b4c1e !important;
}
html.theme-warm table.infobox.biography > tbody > tr > td {
    background: #faf6ef !important;
    color: #3d2b0f !important;
}
html.theme-warm table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #e8dcc8;
}

2026年3月12日 (四) 11:05的版本

/* 这里放置的CSS将应用于所有皮肤 */
.infobox {
    border: 1px solid #aaa;
    background-color: #f9f9f9;
    color: black;
    margin-bottom: 10px;
    padding: 15px;
    float: right;
    clear: right;
}

/* Hide unnecessary ConfirmAccount fields */
#wpRealName,
label[for="wpRealName"],
#wpCV,
label[for="wpCV"],
#wpNotes,
label[for="wpNotes"],
#wpSites,
label[for="wpSites"],
#wpTermsBox,
label[for="wpTermsBox"],
#mw-confirmaccount-info,
#mw-confirmaccount-terms {
    display: none !important;
}

/* Make biography field one-line */
#wpBio {
    height: 2em !important;
}

/* Hide description text below biography label */
#mw-confirmaccount-bio > p {
    display: none !important;
}

/* Fully hide the "Other Information" section */
fieldset:has(legend#mw-confirmaccount-attach) {
    display: none !important;
}

/* ── AllPages: 4-column layout ─────────────────────────────────────── */
.mw-allpages-body {
    column-count: 1 !important; /* neutralise MediaWiki's default 2-col on this wrapper */
}
.mw-allpages-chunk {
    column-count: 4;
    column-gap: 1.5em;
    list-style: none;
    padding: 0;
}
.mw-allpages-chunk li {
    break-inside: avoid;
    padding: 0.15em 0;
}
@media (max-width: 900px) {
    .mw-allpages-chunk { column-count: 2; }
}
@media (max-width: 500px) {
    .mw-allpages-chunk { column-count: 1; }
}

/* ── Character infobox: modern card style ───────────────────────── */

/* Card shell */
table.infobox.biography {
    background: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18) !important;
    border-spacing: 0 !important;
    overflow: hidden;
    margin: 0 0 1.2em 1.5em !important;
    width: 240px !important;
}

/* Character name caption */
table.infobox.biography > caption {
    background: #2c3a4a !important;
    color: #ffffff !important;
    font-size: 1.15em !important;
    font-weight: 700 !important;
    padding: 0.55em 0.8em !important;
    letter-spacing: 0.04em;
    border-radius: 14px 14px 0 0;
    caption-side: top;
}

/* Image header row — replace the dated blue with dark neutral */
table.infobox.biography > tbody > tr:first-child > th {
    background: #3d4f63 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-align: center !important;
}

/* Image fills the header area */
table.infobox.biography > tbody > tr:first-child > th img {
    display: block !important;
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: top center !important;
    margin: 0 auto !important;
}

/* Data rows */
table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #eef0f3;
}

/* Label cells */
table.infobox.biography > tbody > tr > th {
    background: #f7f8fb !important;
    color: #555 !important;
    font-weight: 600 !important;
    font-size: 0.88em !important;
    padding: 0.45em 0.75em !important;
    white-space: nowrap;
    width: 38%;
    vertical-align: middle;
}

/* Value cells */
table.infobox.biography > tbody > tr > td {
    background: #ffffff !important;
    color: #222 !important;
    padding: 0.45em 0.75em !important;
    font-size: 0.9em !important;
    vertical-align: middle;
}

/* Last row — round bottom corners */
table.infobox.biography > tbody > tr:last-child > th,
table.infobox.biography > tbody > tr:last-child > td {
    border-radius: 0 0 0 14px;
}
table.infobox.biography > tbody > tr:last-child > td:last-child {
    border-radius: 0 0 14px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   THEME SYSTEM  —  applied via <html class="theme-{name}">
   Themes: slate | dark | warm
   Default (no class) = plain MediaWiki
   ═══════════════════════════════════════════════════════════════════ */

/* ── SHARED: section-edit pill (all themes) ─────────────────────── */
.mw-editsection { font-size: 0.75em; background: #f0f4f8; border-radius: 4px; padding: 0 0.4em; }
.mw-editsection a { color: #4a7fa5 !important; }

/* ┌─────────────────────────────────────────────────────────────────┐
   │  THEME: SLATE  (cool blue-grey)                                 │
   └─────────────────────────────────────────────────────────────────┘ */
html.theme-slate body { background-color: #eef0f4 !important; }
html.theme-slate #content, html.theme-slate .mw-body {
    background: #fff; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.09);
    border: none !important; padding: 1.8em 2em !important; margin-top: .8em;
}
html.theme-slate h1.firstHeading, html.theme-slate #firstHeading {
    font-size: 1.9em; font-weight: 800; color: #2c3a4a;
    border-bottom: 3px solid #4a7fa5 !important; padding-bottom: .3em; margin-bottom: .7em;
}
html.theme-slate .mw-body-content h2 {
    font-size: 1.3em; font-weight: 700; color: #2c3a4a;
    border-bottom: none !important; border-left: 4px solid #4a7fa5;
    padding: .25em 0 .25em .65em; margin: 1.4em 0 .6em;
    background: #f7f8fb; border-radius: 0 6px 6px 0;
}
html.theme-slate .mw-body-content h3 {
    font-size: 1.1em; font-weight: 700; color: #2c3a4a;
    border-bottom: 1px solid #e0e4ea !important; padding-bottom: .2em;
}
html.theme-slate .mw-body-content p { line-height: 1.8; color: #1f2937; }
html.theme-slate .mw-body-content a { color: #3671b5; }
html.theme-slate .mw-body-content a:hover { color: #2c3a4a; }
html.theme-slate .mw-table-of-contents, html.theme-slate #toc, html.theme-slate .toc {
    background: #f7f8fb; border: 1px solid #e0e4ea !important;
    border-radius: 10px; padding: .8em 1.2em !important;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
html.theme-slate .mw-body-content table:not(.infobox) th {
    background: #2c3a4a !important; color: #fff !important; padding: .5em .8em !important;
}
html.theme-slate .mw-body-content table:not(.infobox) td {
    padding: .45em .8em !important; border-bottom: 1px solid #e0e4ea;
}
html.theme-slate .mw-body-content table:not(.infobox) tr:nth-child(even) td { background: #f7f8fb; }
html.theme-slate .mw-body-content blockquote {
    border-left: 4px solid #4a7fa5; background: #f7f8fb;
    padding: .6em 1em; border-radius: 0 6px 6px 0; font-style: italic;
}
html.theme-slate .cdx-search-input__input { border-radius: 20px !important; }

/* ┌─────────────────────────────────────────────────────────────────┐
   │  THEME: DARK  (night mode)                                      │
   └─────────────────────────────────────────────────────────────────┘ */
html.theme-dark body { background-color: #0f1117 !important; color: #e2e8f0 !important; }
html.theme-dark #content, html.theme-dark .mw-body {
    background: #1a1d27 !important; border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,.5); border: 1px solid #2d3748 !important;
    padding: 1.8em 2em !important; color: #e2e8f0;
}
html.theme-dark h1.firstHeading, html.theme-dark #firstHeading {
    font-size: 1.9em; font-weight: 800; color: #e2e8f0;
    border-bottom: 3px solid #4a9edd !important; padding-bottom: .3em;
}
html.theme-dark .mw-body-content h2 {
    font-size: 1.3em; font-weight: 700; color: #e2e8f0;
    border-bottom: none !important; border-left: 4px solid #4a9edd;
    padding: .25em 0 .25em .65em; margin: 1.4em 0 .6em;
    background: #252836; border-radius: 0 6px 6px 0;
}
html.theme-dark .mw-body-content h3 {
    color: #cbd5e0; border-bottom: 1px solid #2d3748 !important; padding-bottom: .2em;
}
html.theme-dark .mw-body-content p { line-height: 1.8; color: #cbd5e0; }
html.theme-dark .mw-body-content a { color: #63b3ed; }
html.theme-dark .mw-body-content a:hover { color: #90cdf4; }
html.theme-dark .mw-body-content a.new { color: #fc8181; }
html.theme-dark .mw-table-of-contents, html.theme-dark #toc, html.theme-dark .toc {
    background: #252836; border: 1px solid #2d3748 !important;
    border-radius: 10px; padding: .8em 1.2em !important; color: #e2e8f0;
}
html.theme-dark .mw-body-content table:not(.infobox) th {
    background: #2d3748 !important; color: #e2e8f0 !important; padding: .5em .8em !important;
}
html.theme-dark .mw-body-content table:not(.infobox) td {
    background: #1a1d27; color: #cbd5e0; padding: .45em .8em !important;
    border-bottom: 1px solid #2d3748;
}
html.theme-dark .mw-body-content table:not(.infobox) tr:nth-child(even) td { background: #252836; }
html.theme-dark .mw-body-content blockquote {
    border-left: 4px solid #4a9edd; background: #252836;
    padding: .6em 1em; border-radius: 0 6px 6px 0; color: #a0aec0;
}
html.theme-dark .vector-menu-content-list a { color: #90cdf4 !important; }
html.theme-dark .cdx-search-input__input {
    background: #252836 !important; border-color: #4a5568 !important; color: #e2e8f0 !important;
    border-radius: 20px !important;
}
html.theme-dark #mw-panel, html.theme-dark .vector-sidebar { color: #e2e8f0; }

/* ┌─────────────────────────────────────────────────────────────────┐
   │  THEME: WARM  (parchment / warm gold)                           │
   └─────────────────────────────────────────────────────────────────┘ */
html.theme-warm body { background-color: #f0ebe0 !important; }
html.theme-warm #content, html.theme-warm .mw-body {
    background: #faf6ef !important; border-radius: 10px;
    box-shadow: 0 2px 12px rgba(120,90,40,.12); border: 1px solid #e8dcc8 !important;
    padding: 1.8em 2em !important;
}
html.theme-warm h1.firstHeading, html.theme-warm #firstHeading {
    font-size: 1.9em; font-weight: 800; color: #5c3d11;
    border-bottom: 3px solid #c8922a !important; padding-bottom: .3em;
}
html.theme-warm .mw-body-content h2 {
    font-size: 1.3em; font-weight: 700; color: #5c3d11;
    border-bottom: none !important; border-left: 4px solid #c8922a;
    padding: .25em 0 .25em .65em; margin: 1.4em 0 .6em;
    background: #f5ede0; border-radius: 0 6px 6px 0;
}
html.theme-warm .mw-body-content h3 {
    color: #6b4c1e; border-bottom: 1px solid #e8dcc8 !important; padding-bottom: .2em;
}
html.theme-warm .mw-body-content p { line-height: 1.8; color: #3d2b0f; }
html.theme-warm .mw-body-content a { color: #9c6b1e; }
html.theme-warm .mw-body-content a:hover { color: #5c3d11; }
html.theme-warm .mw-table-of-contents, html.theme-warm #toc, html.theme-warm .toc {
    background: #f5ede0; border: 1px solid #e8dcc8 !important; border-radius: 10px; padding: .8em 1.2em !important;
}
html.theme-warm .mw-body-content table:not(.infobox) th {
    background: #7a4f1d !important; color: #fff !important; padding: .5em .8em !important;
}
html.theme-warm .mw-body-content table:not(.infobox) td {
    padding: .45em .8em !important; border-bottom: 1px solid #e8dcc8;
}
html.theme-warm .mw-body-content table:not(.infobox) tr:nth-child(even) td { background: #f5ede0; }
html.theme-warm .mw-body-content blockquote {
    border-left: 4px solid #c8922a; background: #f5ede0;
    padding: .6em 1em; border-radius: 0 6px 6px 0; font-style: italic; color: #6b4c1e;
}
html.theme-warm .cdx-search-input__input { border-radius: 20px !important; border-color: #e8dcc8 !important; }

/* ═══════════════════════════════════════════════════════════════════
   CHARACTER INFOBOX — per-theme
   ═══════════════════════════════════════════════════════════════════ */

/* ── CLASSIC (no theme class): Wikipedia-faithful style ─────────── */
html:not([class*="theme-"]) table.infobox.biography {
    background: #f8f9fa !important;
    border: 1px solid #a2a9b1 !important;
    border-spacing: 3px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 22em !important;
    font-size: 88% !important;
    line-height: 1.6 !important;
    float: right !important;
    clear: right !important;
    margin: 0 0 1em 1em !important;
    padding: 3px !important;
}
html:not([class*="theme-"]) table.infobox.biography > caption {
    font-size: 125% !important;
    font-weight: bold !important;
    padding: 4px !important;
    color: #000 !important;
    background: none !important;
    border-radius: 0 !important;
    letter-spacing: normal !important;
    text-align: center !important;
}
/* Image header row — neutral grey, like Wikipedia biography boxes */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr:first-child > th {
    background: #cee0f2 !important;
    padding: 4px !important;
    border-radius: 0 !important;
    text-align: center !important;
}
html:not([class*="theme-"]) table.infobox.biography > tbody > tr:first-child > th img {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    max-width: 200px !important;
    object-fit: unset !important;
}
/* Label cells */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr > th {
    background: #eaecf0 !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 1em !important;
    padding: 3px 6px !important;
    vertical-align: top !important;
    white-space: nowrap !important;
    width: auto !important;
}
/* Value cells */
html:not([class*="theme-"]) table.infobox.biography > tbody > tr > td {
    background: #f8f9fa !important;
    color: #000 !important;
    padding: 3px 6px !important;
    font-size: 1em !important;
    vertical-align: top !important;
}

/* ── SLATE / DARK / WARM: modern card style ─────────────────────── */
html[class*="theme-"] table.infobox.biography {
    background: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
    border-spacing: 0 !important;
    overflow: hidden;
    margin: 0 0 1.2em 1.5em !important;
    width: 240px !important;
}
html[class*="theme-"] table.infobox.biography > caption {
    background: #2c3a4a !important;
    color: #fff !important;
    font-size: 1.15em !important;
    font-weight: 700 !important;
    padding: 0.55em 0.8em !important;
    letter-spacing: 0.04em;
    border-radius: 14px 14px 0 0;
    caption-side: top;
    text-align: center !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr:first-child > th {
    background: #3d4f63 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-align: center !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr:first-child > th img {
    display: block !important;
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: top center !important;
    margin: 0 auto !important;
}
html[class*="theme-"] table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #eef0f3;
}
html[class*="theme-"] table.infobox.biography > tbody > tr > th {
    background: #f7f8fb !important;
    color: #555 !important;
    font-weight: 600 !important;
    font-size: 0.88em !important;
    padding: 0.45em 0.75em !important;
    white-space: nowrap;
    width: 38%;
    vertical-align: middle;
}
html[class*="theme-"] table.infobox.biography > tbody > tr > td {
    background: #ffffff !important;
    color: #222 !important;
    padding: 0.45em 0.75em !important;
    font-size: 0.9em !important;
    vertical-align: middle;
}
/* Dark theme overrides for the card interior */
html.theme-dark table.infobox.biography > tbody > tr > th {
    background: #252836 !important;
    color: #a0aec0 !important;
}
html.theme-dark table.infobox.biography > tbody > tr > td {
    background: #1a1d27 !important;
    color: #e2e8f0 !important;
}
html.theme-dark table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #2d3748;
}
/* Warm theme overrides */
html.theme-warm table.infobox.biography > caption {
    background: #7a4f1d !important;
}
html.theme-warm table.infobox.biography > tbody > tr:first-child > th {
    background: #9c6b2e !important;
}
html.theme-warm table.infobox.biography > tbody > tr > th {
    background: #f5ede0 !important;
    color: #6b4c1e !important;
}
html.theme-warm table.infobox.biography > tbody > tr > td {
    background: #faf6ef !important;
    color: #3d2b0f !important;
}
html.theme-warm table.infobox.biography > tbody > tr + tr {
    border-top: 1px solid #e8dcc8;
}