Template:Theme-HJ: Difference between revisions

From HUIJIA FUN
Mobile Avatar Frame Bug
Sync with zh: ink-green headings; 1px heading rules (full width on h1/h2, fading on h3-h6); Archive Zone mark on h2; no page-title rule; flat language-variant button and dropdown; English-only copy labels
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
<style>
<style>
/**
/**
  * HUIJIA FUN - TIMELESS CONSOLIDATED THEME (v3.5 EN)
  * HUIJIA FUN - TIMELESS THEME - HJ V5.0
  * Integrated Design: Forest Green / Academic Serif / Engineering Grid
  * VGR Design System: Archive Zone / site-wide default theme
  * Updates: Ported CN hierarchical heading decorations, enhanced padding, and font anti-aliasing.
  * Changes: uses VGR tokens; body text in Zhuque Fangsong; square corners, no shadows; keeps the dot pattern and graded heading rules;
*          scroll fade-ins removed; overrides the pink of Timeless and Tabber
  */
  */


/* --- 1. Imports & Root Variables --- */
/* === 0. Fonts ===
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@600;800&display=swap');
  Source Sans 3 / Source Serif 4 are the Latin halves of the same families as Noto Sans SC / Noto Serif SC (Source Han Sans / Serif).
  Latin first, Chinese second: English italics come from the Latin font, while Chinese stays upright. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@400;600&family=Source+Sans+3:ital,wght@0,400;0,500;0,700;1,400&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=JetBrains+Mono:wght@400;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/[email protected]/style.css');
/* Zhuque Fangsong: body font. Loaded in character slices, so only the glyphs a page uses are downloaded. SIL OFL 1.1 */
@import url('https://cdn.jsdelivr.net/npm/@chinese-fonts/[email protected]/dist/ZhuqueFangsong-Regular/result.css');


/* === 1. Tokens (light) === */
:root {
:root {
     --mw-primary: #025F32;
     /* Source colors */
     --mw-accent: #227F52;
    --src-huijia-green: #025F32;
     --mw-link: #008000;
     --src-dragon-green: #3B7E3D;
     --mw-bg-page: #E0EBE0;
    --src-gate-grey: #969682;
     --mw-bg-card: #FFFFFF;
    --src-plurimod-light: #C1E1A6;
     --mw-bg-sidebar: #C8D8C8;
    --src-huashao-blue: #002F9C;
     --mw-border: #A3B1A8;
 
     --mw-radius: 12px;
    /* Semantic colors */
     --font-heading: 'Montserrat', sans-serif;
    --paper: #F3F5F1;
     --font-body: 'Lora', serif;
    --paper-raised: #FFFFFF;
     --font-code: 'JetBrains Mono', monospace;
    --paper-sunk: #E7ECE5;
     --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.04);
    --ink: #16211B;
    --ink-muted: #4C5A51;
    --rule: #C9D3CA;
    --rule-strong: #7E8B81;
    --accent: #025F32;
     --accent-fill: #025F32;
    --on-accent: #FFFFFF;
     --accent-tint: #DCEBD9;
    --link: #0B6B3A;
     --link-new: #A8432F;
    --focus: #002F9C;
     --heading: #0F3D27;      /* heading text: ink green 12.2:1 */
    --heading-bar: #C8D8C8;   /* rule under sidebar group names */
     --heading-line: #8FB39A;  /* heading rules: full width on h1/h2, fading from h3 to h6 */
    --dot: #A3B1A8;           /* dot pattern on the content card */
 
     /* Type */
    --font-display: Huiwen, "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", serif;
    --font-serif: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
     --font-sans: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    /* Body: Fangsong, the tone of archives and official documents. Falls back to Noto Serif SC if it fails to load */
     --font-body: "Source Serif 4", "Zhuque Fangsong (technical preview)", "Noto Serif SC", "Source Han Serif SC", "FangSong", "STFangsong", serif;
    --font-latin: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    --font-scripture: "LXGW WenKai Screen", "Kaiti SC", STKaiti, KaiTi, serif;
     --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
 
    /* Spacing and radius */
     --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
    --space-6: 24px; --space-8: 32px; --space-12: 48px;
    --radius-none: 0; --radius-xs: 2px; --radius-sm: 4px; --radius-pill: 999px;
 
    /* Point the Timeless / Codex / FlowThread primary-color variables at Huijia Green, replacing the skin's pink */
    --color-primary: var(--accent);
    --color-progressive: var(--accent);
    --color-progressive--hover: var(--src-dragon-green);
    --background-color-progressive: var(--accent-fill);
    --border-color-progressive: var(--accent);
    --color-link: var(--link);
    --color-link--visited: var(--link);
    --color-link-red: var(--link-new);
 
    /* Legacy variable names, kept for other templates */
    --mw-primary: var(--accent);
    --mw-accent: var(--src-dragon-green);
    --mw-link: var(--link);
    --mw-border: var(--rule);
    --font-heading: var(--font-serif);
    --font-code: var(--font-mono);
}
 
/* === 1b. Tokens (dark)
  Applies only under MediaWiki's night-mode class and does not follow the system setting:
  Common.css and other templates are not dark-ready yet, so following the system would leave some elements dark-on-dark. */
html.skin-theme-clientpref-night {
    --paper: #111613;
    --paper-raised: #18201B;
    --paper-sunk: #0C100E;
    --ink: #E4EBE5;
    --ink-muted: #A2B0A6;
    --rule: #2A352E;
    --rule-strong: #667A6C;
    --accent: #C1E1A6;
    --accent-fill: #3B7E3D;
    --accent-tint: #1C2B21;
    --link: #8FD3A8;
    --link-new: #F0907E;
    --focus: #8FB0FF;
    --heading: #D2E8C6;
    --heading-bar: #2F4033;
    --heading-line: #4F7559;
    --dot: #2A352E;
    color-scheme: dark;
}
}


/* --- 2. Global Typography & Layout --- */
/* === 2. Page and body text === */
body {
body {
     background-color: var(--mw-bg-page);
     background-color: var(--paper);
     color: #2c3e50;
    color: var(--ink);
    font-family: var(--font-sans);
     font-size: 16px;
    line-height: 1.8;
    accent-color: var(--accent);
    -webkit-font-smoothing: antialiased;
}
 
/* Body text uses Fangsong; UI elements such as navigation, tables and buttons stay in sans (set in their own sections) */
.mw-parser-output {
     font-family: var(--font-body);
     font-family: var(--font-body);
     line-height: 1.75;
    font-size: 16px;
     -webkit-font-smoothing: antialiased; /* Ported from CN for crisper EN text */
     line-height: 1.9;
     letter-spacing: 0.02em;
}
}
.mw-parser-output b,
.mw-parser-output strong { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0; }


#mw-content-wrapper {
/* Chinese has no true italic: stop the browser from faking slanted Chinese; Latin italics work as usual */
    background: transparent;
i, em, cite, .mw-parser-output i { font-synthesis: none; }
    padding-top: 0px;
}


#mw-content {
::selection { background: var(--accent-fill); color: var(--on-accent); }
    background-color: var(--mw-bg-card);
    padding: 25px 30px; /* Ported from CN for better whitespace */
    border-radius: var(--mw-radius);
    border: 1px solid var(--mw-border);
    box-shadow: var(--shadow-subtle);
    background-image: radial-gradient(var(--mw-border) 0px, transparent 1px);
    background-size: 20px 20px;
}


/* --- 3. Avatar & Logo Symmetry --- */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#p-logo, .mw-portlet-logo {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 20px 0 !important;
    margin-bottom: 10px;
}


#p-logo img {
/* === 3. Header === */
     border-radius: 4px;
#mw-header-container {
     box-shadow: 0 4px 12px rgba(0,0,0,0.06);
     background: var(--paper-raised);
     transition: transform 0.2s ease;
     border-bottom: 1px solid var(--rule);
     box-shadow: none;
}
}
 
#p-banner, #p-banner a, .mw-wiki-title {
#p-logo img:hover {
    font-family: var(--font-sans);
     transform: translateY(-2px);
    font-weight: 500;
    letter-spacing: 0.04em;
     color: var(--ink) !important;
}
}


/* --- 4. Fixed Pill Search Bar --- */
/* === 4. Search box (the only pill shape) === */
#p-search {
#p-search {
     margin: 0 20px !important;
     margin: 0 20px !important;
Line 75: Line 151:
     align-items: center;
     align-items: center;
}
}
#searchform {
#searchform {
     background: #ffffff !important;
     background: var(--paper-raised) !important;
     border: 1px solid var(--mw-border) !important;
     border: 1px solid var(--rule-strong) !important;
     border-radius: 30px !important;  
     border-radius: var(--radius-pill) !important;
     display: flex !important;
     display: flex !important;
     flex-direction: row !important;
     flex-direction: row !important;
     align-items: center !important;
     align-items: center !important;
     padding: 2px 4px 2px 15px !important;
     padding: 2px 4px 2px 16px !important;
     transition: all 0.3s ease;
     max-width: 350px;
     overflow: hidden;
     overflow: hidden;
     max-width: 350px;  
     box-shadow: none !important;
    transition: border-color 0.2s ease;
}
}
#searchform:focus-within {
#searchform:focus-within {
     border-color: var(--mw-primary) !important;
     border-color: var(--accent) !important;
     box-shadow: 0 0 0 4px rgba(2, 95, 50, 0.1) !important;
     outline: 2px solid var(--focus);
    outline-offset: 2px;
}
}
#simpleSearch {
#simpleSearch {
     background: transparent !important;
     background: transparent !important;
Line 101: Line 176:
     align-items: center !important;
     align-items: center !important;
}
}
#searchInput {
#searchInput {
     background: transparent !important;
     background: transparent !important;
     border: none !important;
     border: none !important;
     box-shadow: none !important;
     box-shadow: none !important;
     font-family: var(--font-body);
     font-family: var(--font-sans);
     font-size: 0.9em !important;
     font-size: 14px !important;
     padding: 8px 0 !important;
     padding: 8px 0 !important;
     color: #333 !important;
     color: var(--ink) !important;
     width: 100% !important;
     width: 100% !important;
    outline: none;
}
}
#searchInput::placeholder { color: var(--ink-muted); }


/* --- 5. Headings with "◈" Decoration & Hierarchical Lines --- */
/* === 5. Logo === */
h1, h2, h3, h4, h5, h6 {
#p-logo, .mw-portlet-logo {
     font-family: var(--font-heading) !important;
     display: flex !important;
     font-weight: 400; /* Retained EN Montserrat weight */
     justify-content: center;
     letter-spacing: -0.01em;
     align-items: center;
     padding-bottom: 8px;
     padding: 20px 0 !important;
     margin-bottom: 1em;
     margin-bottom: 10px;
     overflow: hidden;  
}
     display: block;
#p-logo img {
     border-radius: var(--radius-none);
     box-shadow: none;
}
}


.mw-parser-output h1, .mw-parser-output h2, .mw-parser-output h3, .mw-parser-output h4, .mw-parser-output h5, .mw-parser-output h6 {
/* === 6. Left and right sidebars === */
     font-weight: 400;
.sidebar-chunk {
    background-color: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius-none);
    box-shadow: none;
    margin-bottom: var(--space-4);
    padding: var(--space-4);
}
.sidebar-chunk h2,
.sidebar-chunk h3,
.mw-portlet h3 {
    /* Group names (Navigation / Hubs / Setting Zone / Page tools…): Source Serif / Noto Serif SC */
    font-family: var(--font-serif) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em;
    text-transform: none;
    color: var(--ink) !important;
    border: none !important;
    border-bottom: 2px solid var(--heading-bar) !important;
    padding-bottom: 6px;
    margin-bottom: var(--space-3);
}
.sidebar-chunk li a,
.sidebar-chunk li a span,
.mw-portlet-body li a,
.mw-portlet-body li a span {
    /* Nav links: Zhuque Fangsong, matching the body text */
    color: var(--ink) !important;
    font-family: var(--font-body) !important;
    font-size: 15.5px;
    letter-spacing: 0.04em;
}
.sidebar-chunk li a:hover,
.mw-portlet-body li a:hover {
     color: var(--accent) !important;
    text-decoration: none;
}
}


/* Ported hierarchical underlines from CN */
/* === 7. Content card === */
.mw-parser-output h1 { border-bottom: 4px solid #C8D8C8; }
#mw-content-wrapper {
.mw-parser-output h2 { border-bottom: 4px solid rgba(200, 216, 200, 0.9); }
    background: transparent;
    padding-top: 0;
    box-shadow: none;
}
#mw-content {
    background-color: var(--paper-raised);
    /* dot pattern: 1px dots on a 20px grid */
    background-image: radial-gradient(var(--dot) 0px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-none);
    box-shadow: none;
    padding: var(--space-6) var(--space-8);
}


.mw-parser-output h3, .mw-parser-output h4, .mw-parser-output h5, .mw-parser-output h6 {
/* Page tabs (Read / Edit / History / Discussion): the selected tab uses Huijia Green instead of pink */
     border-bottom: none !important;
#mw-content-block .mw-portlet li a,
     position: relative;
#mw-content-block .mw-portlet li a .mw-ui-icon::before {
    color: var(--ink-muted) !important;
}
/* Page tab labels (Template / Discussion / Read / Edit / History): Zhuque Fangsong */
#mw-content-block .mw-portlet li a,
#mw-content-block .mw-portlet li a span {
    font-family: var(--font-body) !important;
    font-size: 15.5px;
    letter-spacing: 0.06em;
}
#mw-content-block .mw-portlet li.selected a,
#mw-content-block .mw-portlet li.selected a .mw-ui-icon::before {
     color: var(--accent) !important;
}
#mw-content-block .mw-portlet li.selected a {
     box-shadow: none !important;
}
}
#mw-content-block .mw-portlet li a:hover { color: var(--ink) !important; }


.mw-parser-output h3::after, .mw-parser-output h4::after, .mw-parser-output h5::after, .mw-parser-output h6::after {
/* Language variant button: remove the underline the skin puts under the label; remove the skin's pink shadow from the dropdown */
    content: "";
#p-variants-desktop h3,
    display: block;
#p-variants-desktop-label { border-bottom: none !important; box-shadow: none !important; }
    position: absolute;
#p-variants-desktop .dropdown { box-shadow: none !important; }
    bottom: 0;
 
    left: 0;
/* Tabber (e.g. the Main Page "Site info / Create a page" tabs) */
    height: 4px;
.tabber__tab { color: var(--ink-muted) !important; font-family: var(--font-body) !important; font-size: 15.5px; letter-spacing: 0.06em; }
     background-color: #C8D8C8;
.tabber__tab[aria-selected="true"] { color: var(--accent) !important; }
     border-radius: 2px;
.tabber__indicator { background: var(--accent) !important; }
.tabber .tabbernav li a { color: var(--ink-muted) !important; font-family: var(--font-body) !important; letter-spacing: 0.06em; }
.tabber .tabbernav li.tabberactive a {
     color: var(--accent) !important;
     border-bottom-color: var(--accent) !important;
}
}


.mw-parser-output h3::after { width: 80%; opacity: 1; }
/* === 8. Headings ===
.mw-parser-output h4::after { width: 60%; opacity: 0.8; }
  Text in ink green (--heading). The page title has no rule. h1/h2: a full-width 1px green-grey rule; h2 gets the Archive Zone mark ■.
.mw-parser-output h5::after { width: 40%; opacity: 0.6; }
  h3-h6: a rule of the same color and weight (1px) fading out to the right, shorter and fainter at each level (same approach as Theme-VGR, in Archive Zone green-grey). */
.mw-parser-output h6::after { width: 20%; opacity: 0.4; }
h1.firstHeading {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--heading) !important;
    letter-spacing: 0.02em;
    border-bottom: none !important;
    padding-bottom: 10px;
    margin-bottom: var(--space-6);
    text-wrap: balance;
}


h1.firstHeading {
.mw-parser-output h1,
     font-family: var(--font-heading);
.mw-parser-output h2,
     color: var(--mw-primary) !important;
.mw-parser-output h3,
     font-size: 2em; /* Retained EN sizing */
.mw-parser-output h4,
     border-bottom: 4px solid var(--mw-bg-sidebar);
.mw-parser-output h5,
     padding-bottom: 8px;
.mw-parser-output h6 {
     margin-bottom: 1em;
     font-family: var(--font-serif) !important;
    font-weight: 600;
     color: var(--heading) !important;
     letter-spacing: 0.02em;
    text-wrap: balance;
     padding-bottom: var(--space-2);
     overflow: hidden;
     border: none !important;
}
}


h1.firstHeading::before {
/* h1/h2: full-width 1px rule, same color and weight as the h3-h6 fading rules */
     content: "◈";
.mw-parser-output h1,
     color: var(--mw-accent);
.mw-parser-output h2 {
    background: linear-gradient(var(--heading-line) 0 0) left bottom / 100% 1px no-repeat;
}
.mw-parser-output h1 {
    font-size: 26px;
    line-height: 1.3;
    margin: var(--space-8) 0 var(--space-3);
}
.mw-parser-output h2 {
     font-size: 23px;
    line-height: 1.35;
     margin: var(--space-8) 0 var(--space-3);
}
/* Archive Zone mark: a small solid square (drawn in CSS, font-independent, matching the sidebar ■) */
.mw-parser-output h2::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
     margin-right: 12px;
     margin-right: 12px;
     font-size: 0.8em;
    vertical-align: 0.2em;
     vertical-align: middle;
    background: var(--accent);
}
.toc h2::before, #toc h2::before, .mw-parser-output .toctitle h2::before { content: none; display: none; }
.toc h2, #toc h2, .mw-parser-output .toctitle h2 { background: none; }
 
.mw-parser-output h3 {
    font-size: 19px;
    line-height: 1.45;
    margin: var(--space-6) 0 var(--space-2);
}
.mw-parser-output h4 {
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink) !important;
    margin: var(--space-4) 0 var(--space-2);
}
.mw-parser-output h5 {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink) !important;
    margin: var(--space-4) 0 var(--space-1);
}
.mw-parser-output h6 {
    font-family: var(--font-sans) !important;
     font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
     color: var(--ink-muted) !important;
    margin: var(--space-4) 0 var(--space-1);
}
}


h2 {
/* h3-h6: fade out to the right */
    color: var(--mw-primary) !important;
.mw-parser-output h3,
    border-bottom: 1px solid var(--mw-border);
.mw-parser-output h4,
     padding-bottom: 5px;
.mw-parser-output h5,
     margin-top: 2em;
.mw-parser-output h6 { position: relative; }
.mw-parser-output h3::after,
.mw-parser-output h4::after,
.mw-parser-output h5::after,
.mw-parser-output h6::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
     bottom: 0;
     background: linear-gradient(90deg, var(--heading-line), transparent);
}
}
.mw-parser-output h3::after { width: 85%; height: 1px; }
.mw-parser-output h4::after { width: 65%; height: 1px; opacity: 0.8; }
.mw-parser-output h5::after { width: 45%; height: 1px; opacity: 0.7; }
.mw-parser-output h6::after { width: 25%; height: 1px; opacity: 0.6; }


#personal h2,
#personal h2,
#personal .header-avatar {
#personal .header-avatar { overflow: visible; }
    overflow: visible;
 
}
/* === 9. Links === */
.mw-parser-output a,
#catlinks a { color: var(--link); text-decoration: none; }
.mw-parser-output a:visited { color: var(--link); }
.mw-parser-output a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mw-parser-output a.new,
.mw-parser-output a.new:visited { color: var(--link-new); }


/* --- 6. Source Code Beautification --- */
/* === 10. Code === */
code {
code {
     background-color: #f1f4f1;
     background-color: var(--paper-sunk);
     color: #b33939;
     color: var(--ink);
     padding: 3px 7px;
     padding: 2px 6px;
     border-radius: 6px;
     border-radius: var(--radius-xs);
     font-family: var(--font-code);
     font-family: var(--font-mono);
     font-size: 0.9em;
     font-size: 13px;
}
}
pre {
pre {
     background-color: #f9fbf9 !important;
    position: relative;
     border: 1px solid var(--mw-border) !important;
     background-color: var(--paper-sunk) !important;
     border-left: 6px solid var(--mw-primary) !important;
    color: var(--ink);
     padding: 20px !important;
     border: 1px solid var(--rule) !important;
    border-radius: var(--mw-radius);
     border-radius: var(--radius-none);
     font-family: var(--font-code) !important;
     padding: var(--space-4) !important;
     font-family: var(--font-mono) !important;
    font-size: 13px;
     line-height: 1.6;
     line-height: 1.6;
     overflow-x: auto;
     overflow-x: auto;
    color: #333;
}
}


/* --- 7. Sidebar Elements --- */
/* === 11. Tables (override Common.css's solid deep-green header row and zebra striping) === */
.sidebar-chunk {
.mw-parser-output table.wikitable {
     background-color: var(--mw-bg-sidebar);
    width: auto;
     border-radius: var(--mw-radius);
     background: var(--paper-raised);
     border: 1px solid rgba(0,0,0,0.05);
    color: var(--ink);
     margin-bottom: 20px;
    border: none;
     padding: 15px;
    border-top: 2px solid var(--accent);
     border-bottom: 1px solid var(--rule-strong);
     border-collapse: collapse;
    border-radius: var(--radius-none);
     box-shadow: none;
    overflow: visible;
    font-family: var(--font-sans);
     font-size: 14px;
}
}
 
.mw-parser-output table.wikitable > * > tr > th,
.sidebar-chunk h2 {
.mw-parser-output table.wikitable > tr > th {
     font-size: 0.85em; /* Retained EN uppercase styling */
    background: transparent;
     text-transform: uppercase;
    color: var(--accent);
     letter-spacing: 1.2px;
    font-family: var(--font-sans);
     font-size: 12px;
     font-weight: 700;
     letter-spacing: 0.08em;
    text-align: left;
    padding: 10px 12px;
     border: none;
     border: none;
     margin-bottom: 12px;
     border-bottom: 1px solid var(--rule-strong);
}
}
 
.mw-parser-output table.wikitable > * > tr > td,
/* --- 8. Wikitables & Interactive Elements --- */
.mw-parser-output table.wikitable > tr > td {
table.wikitable {
     color: var(--ink);
    border-radius: var(--mw-radius);
     padding: 9px 12px;
    overflow: hidden;
     border: none;
    border: 1px solid var(--mw-border);
     border-bottom: 1px solid var(--rule);
    border-collapse: separate;
     vertical-align: top;
    border-spacing: 0;
}
 
table.wikitable th {
     background-color: var(--mw-bg-sidebar);
    color: var(--mw-primary);
    font-family: var(--font-heading);
     padding: 12px;
}
 
table.wikitable td {
     padding: 10px;
     border-top: 1px solid #f0f0f0;
}
 
a {
    color: var(--mw-link);
     text-decoration: none;
    transition: all 0.2s ease;
}
}
.mw-parser-output table.wikitable > tbody > tr:nth-of-type(even) { background: transparent; }
.mw-parser-output table.wikitable > tbody > tr:last-of-type > td { border-bottom: none; }
.mw-parser-output table.wikitable > tbody > tr:hover td { background: var(--accent-tint); color: var(--ink); }


a:hover {
/* === 12. Category bar and footer === */
    color: var(--mw-primary);
    text-decoration: underline dotted;
}
 
/* --- 9. Categorization & Footer --- */
#catlinks {
#catlinks {
     background-color: #f4f8f4;
     background-color: var(--paper-sunk);
     border: 1px solid var(--mw-border);
     border: 1px solid var(--rule);
     border-radius: var(--mw-radius);
     border-radius: var(--radius-none);
     padding: 15px;
     padding: var(--space-3) var(--space-4);
    font-size: 13px;
    color: var(--ink-muted);
}
}
.mw-footer {
.mw-footer {
     background-color: var(--mw-bg-sidebar);
     background-color: var(--paper-sunk);
     padding: 30px;
     color: var(--ink-muted);
     border-radius: var(--mw-radius) var(--mw-radius) 0 0;
     border-top: 1px solid var(--rule);
     margin-top: 40px;
    border-radius: var(--radius-none);
     border-top: 4px solid var(--mw-primary);
     margin-top: var(--space-12);
     padding: var(--space-6) var(--space-8);
    font-size: 13px;
}
}
.mw-footer a { color: var(--ink-muted); }
.mw-footer-container { background: transparent; }


/* --- 10. MOBILE FIXES (≤850px) --- */
/* === 13. Pink from Common.css (temporary override; better to fix Common.css itself later) === */
textarea:hover,
textarea:focus-visible { border-color: var(--accent) !important; box-shadow: none !important; }
.navbox th, .navbox-title { background: var(--accent-tint) !important; color: var(--ink); }
.navbox-abovebelow, th.navbox-group, .navbox-subgroup .navbox-title { background: var(--paper-sunk) !important; }
.navbox-subgroup .navbox-group, .navbox-subgroup .navbox-abovebelow { background: var(--paper) !important; }
.navbox-even { background: var(--paper) !important; }
.repost-circle, .repost-circle a.external { color: var(--accent) !important; border-color: var(--accent) !important; }
 
/* === 14. Mobile (≤850px) === */
@media screen and (max-width: 850px) {
@media screen and (max-width: 850px) {
    #mw-content { padding: var(--space-4); }
     /* Restore Timeless mobile nav (in case global rules interfere) */
     /* Restore Timeless mobile nav (in case global rules interfere) */
     #mw-mf-page-left, .dropdown, .dropdown-active,
     #mw-mf-page-left, .dropdown, .dropdown-active,
     #mw-site-navigation, #mw-related-navigation,
     #mw-related-navigation,
     #site-tools, #personal {
     #site-tools, #personal {
         height: auto !important;
         height: auto !important;
         max-height: none !important;
         max-height: none !important;
         overflow: visible !important;
         overflow: visible !important;
    }
    /* Cap the logo size so it can't blow up when the sidebar renders incorrectly */
    #p-logo img {
        max-width: 180px !important;
        width: auto !important;
        height: auto !important;
     }
     }


Line 286: Line 531:
         max-height: 70vh !important;
         max-height: 70vh !important;
         overflow-y: auto !important;
         overflow-y: auto !important;
         background-color: var(--mw-bg-card) !important;
         background-color: var(--paper-raised) !important;
         border: 1px solid var(--mw-border) !important;
         border: 1px solid var(--rule) !important;
         border-radius: var(--mw-radius) !important;
         border-radius: var(--radius-none) !important;
         box-shadow: var(--shadow-subtle) !important;
         box-shadow: none !important;
         z-index: 9999 !important;
         z-index: 9999 !important;
         position: relative !important;
         position: relative !important;
Line 299: Line 544:
     }
     }


     /* Hide the empty green sidebar/portlet shells */
     /* Hide the empty sidebar/portlet shells */
     .sidebar-chunk:empty,
     .sidebar-chunk:empty,
     .mw-portlet:empty,
     .mw-portlet:empty,
Line 316: Line 561:
         padding: 0 !important;
         padding: 0 !important;
     }
     }
    #mw-content-block { background: transparent !important; }
    .mw-parser-output table.wikitable {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
}
/* === 15. Reading progress bar and copy button === */
#reading-progress-container {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--rule);
    z-index: 9999;
    pointer-events: none;
}
#reading-progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent-fill);
}
}
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    color: var(--on-accent);
    background: var(--accent-fill);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}
pre:hover .code-copy-btn,
.code-copy-btn:focus-visible { opacity: 1; }


@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
</style>
</style>
<script>
<script>
/**
/**
  * HUIJIA FUN - UI ENHANCEMENTS (v4.1)
  * HUIJIA FUN - UI ENHANCEMENTS (v5.0)
  * Fix: Moved Reading Progress Bar to bottom to prevent header overlap.
  * Kept: bottom reading progress bar, code copy button
  * Features: Bottom Progress Bar, Code Copy Buttons, Smooth Reveal.
  * Removed: scroll fade-ins (headings started transparent and vanished if the script failed)
  */
  */
 
(function () {
(function() {
     "use strict";
     "use strict";
    if (window.__hjThemeLoaded) return;  /* don't run twice when a page includes the template twice */
    window.__hjThemeLoaded = true;


     const injectStyles = () => {
     var LABEL = { copy: "Copy", done: "Copied", fail: "Copy failed" };
        const style = document.createElement('style');
        style.innerHTML = `
            /* Reading Progress Bar - Moved to Bottom */
            #reading-progress-container {
                position: fixed;
                bottom: 0; /* Changed from top: 0 */
                left: 0;
                width: 100%;
                height: 5px;
                background: rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(2px);
                z-index: 9999;
                border-top: 1px solid rgba(0,0,0,0.05);
            }
            #reading-progress-bar {
                height: 100%;
                width: 0%;
                background: var(--mw-primary, #025F32);
                box-shadow: 0 0 10px var(--mw-accent, #227F52);
                transition: width 0.15s ease-out;
            }
 
            /* Code Block Copy Button Fix */
            .code-copy-btn {
                position: absolute;
                top: 10px;
                right: 10px;
                background: var(--mw-primary, #025F32);
                color: white;
                border: none;
                border-radius: 6px;
                padding: 5px 10px;
                font-size: 11px;
                font-family: var(--font-heading);
                font-weight: bold;
                cursor: pointer;
                opacity: 0;
                transition: all 0.2s ease;
                z-index: 50;
            }
            pre:hover .code-copy-btn {
                opacity: 1;
            }
            .code-copy-btn:hover {
                background: var(--mw-accent, #227F52);
                transform: scale(1.05);
            }
            pre { position: relative; overflow: visible !important; }
 
            /* Entrance Animations */
            .reveal-on-scroll {
                opacity: 0;
                transform: translateY(15px);
                transition: opacity 0.6s ease-out, transform 0.6s ease-out;
            }
            .reveal-on-scroll.is-visible {
                opacity: 1;
                transform: translateY(0);
            }
        `;
        document.head.appendChild(style);
    };


     const initProgressBar = () => {
     function initProgressBar() {
         const container = document.createElement('div');
         if (document.getElementById("reading-progress-container")) return;
         container.id = 'reading-progress-container';
        var container = document.createElement("div");
         const bar = document.createElement('div');
         container.id = "reading-progress-container";
         bar.id = 'reading-progress-bar';
         var bar = document.createElement("div");
         bar.id = "reading-progress-bar";
         container.appendChild(bar);
         container.appendChild(bar);
         document.body.appendChild(container);
         document.body.appendChild(container);


         window.addEventListener('scroll', () => {
         var ticking = false;
             const winScroll = window.pageYOffset || document.documentElement.scrollTop;
        function update() {
             const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
             var top = window.pageYOffset || document.documentElement.scrollTop;
             const scrolled = (winScroll / height) * 100;
             var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
             bar.style.width = scrolled + "%";
             bar.style.width = (height > 0 ? (top / height) * 100 : 0) + "%";
         });
             ticking = false;
     };
        }
        window.addEventListener("scroll", function () {
            if (!ticking) { ticking = true; window.requestAnimationFrame(update); }
         }, { passive: true });
        update();
     }


     const initCopyButtons = () => {
     function initCopyButtons() {
         const codeBlocks = document.querySelectorAll('pre');
         document.querySelectorAll("#mw-content pre").forEach(function (block) {
        codeBlocks.forEach((block) => {
             if (block.querySelector(".code-copy-btn")) return;
             if (block.querySelector('.code-copy-btn')) return; // Prevent duplicates
             var btn = document.createElement("button");
             const btn = document.createElement('button');
            btn.type = "button";
             btn.className = 'code-copy-btn';
             btn.className = "code-copy-btn";
             btn.innerText = 'COPY';
             btn.textContent = LABEL.copy;
           
             btn.addEventListener("click", function () {
             btn.addEventListener('click', () => {
                 var clone = block.cloneNode(true);
                 const text = block.innerText.replace('COPY', '').trim();
                var own = clone.querySelector(".code-copy-btn");
                 navigator.clipboard.writeText(text).then(() => {
                if (own) own.remove();
                     btn.innerText = 'COPIED!';
                 var text = clone.textContent.trim();
                     setTimeout(() => btn.innerText = 'COPY', 2000);
                var done = function (label) {
                 });
                     btn.textContent = label;
                     setTimeout(function () { btn.textContent = LABEL.copy; }, 2000);
                 };
                if (navigator.clipboard && navigator.clipboard.writeText) {
                    navigator.clipboard.writeText(text).then(
                        function () { done(LABEL.done); },
                        function () { done(LABEL.fail); }
                    );
                } else {
                    done(LABEL.fail);
                }
             });
             });
             block.appendChild(btn);
             block.appendChild(btn);
         });
         });
     };
     }


     const initScrollReveal = () => {
     function init() {
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.classList.add('is-visible');
                }
            });
        }, { threshold: 0.05 });
 
        const items = document.querySelectorAll('#mw-content h2, #mw-content h3, .thumbinner, table.wikitable');
        items.forEach(item => {
            item.classList.add('reveal-on-scroll');
            observer.observe(item);
        });
    };
 
    // Execution
    document.addEventListener("DOMContentLoaded", () => {
        injectStyles();
         initProgressBar();
         initProgressBar();
         initCopyButtons();
         initCopyButtons();
         initScrollReveal();
    }
     });
 
    if (document.readyState === "loading") {
         document.addEventListener("DOMContentLoaded", init);
     } else {
        init();
    }
})();
})();
</script>
</script>
Line 456: Line 690:
</includeonly><noinclude>{{Theme-HJ}}
</includeonly><noinclude>{{Theme-HJ}}
==Description==
==Description==
===Origin===
'''Theme-HJ''' is the theme for HUIJIA FUN's Archive Zone and the site-wide default pages, built strictly on the VGR Design System. Its features: a cool, green-tinted grey paper ground, a "Huijia Green" accent, square corners and no shadows; the content card carries a dot pattern, and headings are set in ink green on thin green-grey rules: full width under level-1 and level-2 headings (level 2 also carries the Archive Zone mark ■), fading out to the right and getting shorter at each level below.
Author: [[User:PlurimodSU|PlurimodSU]]
 
==Origin==
Author: [[User:PlurimodSU|Marina Malinti]]


===Note===
===Note===
To use this theme on a page, simply add the following code directly to the page's source code:
To use this theme on a page, simply add the following code directly to the page's source code:
<pre>{{Theme-HJ}}</pre>
<pre>{{Theme-HJ}}</pre>
==Test==
A body paragraph with an [[Main Page|internal link]], a [[Nonexistent Page|red link]] and some <code>inline code</code>. ''English italic stays italic; 中文不会被压斜。''
===Subheading 3===
====Subheading 4====
=====Subheading 5=====
======Subheading 6======
{| class="wikitable"
! Event !! S.C. !! O.
|-
| Sample event A || 1999 || 0
|-
| Sample event B || 2021 || 22
|}
<pre>{{Theme-HJ}}</pre>
==Test 2==
===Subheading 3===
====Subheading 4====
=====Subheading 5=====
======Subheading 6======
[[Category:Template-Theme]]
[[Category:Template-Theme]]
</noinclude>
</noinclude>

Latest revision as of 10:35, 13 October 2026

Description

Theme-HJ is the theme for HUIJIA FUN's Archive Zone and the site-wide default pages, built strictly on the VGR Design System. Its features: a cool, green-tinted grey paper ground, a "Huijia Green" accent, square corners and no shadows; the content card carries a dot pattern, and headings are set in ink green on thin green-grey rules: full width under level-1 and level-2 headings (level 2 also carries the Archive Zone mark ■), fading out to the right and getting shorter at each level below.

Origin

Author: Marina Malinti

Note

To use this theme on a page, simply add the following code directly to the page's source code:

{{Theme-HJ}}

Test

A body paragraph with an internal link, a red link and some inline code. English italic stays italic; 中文不会被压斜。

Subheading 3

Subheading 4

Subheading 5
Subheading 6
Event S.C. O.
Sample event A 1999 0
Sample event B 2021 22
{{Theme-HJ}}

Test 2

Subheading 3

Subheading 4

Subheading 5
Subheading 6