/* folio-theme: folio-classic-v1 */
  /* Palatino is a system font, no @font-face needed */
  @font-face {
    font-family: "JetBrains Mono";
    src: url("assets/fonts/JetBrainsMono.woff2") format("woff2");
    font-weight: 400 500;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: "LXGW WenKai";
    src: local("LXGW WenKai"), local("霞鹜文楷"),
         url("assets/fonts/LXGWWenKai-Regular.ttf") format("truetype"),
         url("https://raw.githubusercontent.com/lxgw/LxgwWenKai/main/fonts/TTF/LXGWWenKai-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: "LXGW WenKai";
    src: local("LXGW WenKai"), local("霞鹜文楷"),
         url("assets/fonts/LXGWWenKai-Medium.ttf") format("truetype"),
         url("https://raw.githubusercontent.com/lxgw/LxgwWenKai/main/fonts/TTF/LXGWWenKai-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }
  

  :root {
    --color-surface-page:    #F6F0EA;
    --color-surface-card:        #FBF7F3;
    --color-border-default:    #E6DACD;
    --dark-surface: #2E2521;
    --color-text-primary:    #191514;

    --color-accent-brand:        #B83D2E;

    --color-text-warm:    #3A312D;
    --color-text-secondary:        #5A4A43;
    --color-text-muted:        #756A63;

    --color-border-soft:  #E5DBCD;

    /* Slide-scale spacing */
    --slide-pad:    80px;

    --serif: "Source Serif 4", Charter, Georgia, "LXGW WenKai", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", Palatino, serif;
    --sans: var(--serif);
    --mono: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, Monaco,
            "LXGW WenKai", "Source Han Serif SC", monospace;
  }

  html[lang="zh-CN"] {
    --serif: "LXGW WenKai", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", Georgia, serif;
    --sans: var(--serif);
  }

  /* Language switcher */
  .lang-switch {
    position: fixed;
    top: 24px;
    right: 32px;
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    gap: 0;
    z-index: 100;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
  }
  .lang-switch a {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-soft);
    cursor: pointer;
    background: var(--color-surface-card);
    transition: background 0.15s, color 0.15s;
  }
  .lang-switch a:first-child { border-radius: 4px 0 0 4px; }
  .lang-switch a:last-child { border-radius: 0 4px 4px 0; border-left: none; }
  .lang-switch a.active {
    background: var(--color-accent-brand);
    color: var(--color-surface-card);
    border-color: var(--color-accent-brand);
  }
  .lang-switch a:hover:not(.active) {
    background: var(--color-border-default);
    color: var(--color-text-primary);
  }
  .lang-switch.hidden {
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
  }

  /* Page transition */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }

  /* Print rules: keep warm background, avoid harsh page breaks */
  @page { size: A4; margin: 14mm 16mm; background: #F6F0EA; }
  @media print {
    body { background: #F6F0EA; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .page { padding: 0 !important; max-width: 100% !important; }
    section { page-break-inside: auto; margin-bottom: 36px; }
    .hero, .section-head, .family, .comp, .shadow-demo, .tint, .swatch, .radius, blockquote, pre, tr, .anti > div { break-inside: avoid; page-break-inside: avoid; }
    .hero h1 { font-size: 76px; }
    h2.section-title { font-size: 26px; }
    .comp-grid, .swatches, .tint-strip, .family-grid, .shadow-row, .anti { break-inside: auto; }
  }
  body {
    background: var(--color-surface-page);
    color: var(--color-text-primary);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  html[lang="zh-CN"] body { letter-spacing: 0.35px; }
  html[lang="en"] body { letter-spacing: 0; }
  html[lang="en"] .section-title { letter-spacing: -0.3px; }
  html[lang="en"] .manifesto { letter-spacing: 0; }
  html[lang="zh-CN"] .section-title { letter-spacing: 0; }

  .page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 88px 64px 120px;
    animation: fadeIn 0.4s ease-out;
  }

  /* ---------- Hero ---------- */
  .hero {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--color-border-soft);
    margin-bottom: 48px;
  }
  .hero-tokens {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 18px;
  }
  .hero-tokens span {
    display: flex;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .hero-tokens b {
    color: var(--color-text-warm);
    font-weight: 500;
  }
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
  }
  .action-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--color-border-soft);
    border-radius: 6px;
    color: var(--color-text-warm);
    background: var(--color-surface-card);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  }
  .action-link.primary {
    color: var(--color-surface-card);
    background: var(--color-accent-brand);
    border-color: var(--color-accent-brand);
  }
  .action-link:hover {
    border-color: var(--color-accent-brand);
    color: var(--color-text-primary);
  }
  .action-link.primary:hover {
    color: var(--color-surface-card);
    background: #A93428;
  }
  .action-link:active {
    transform: translateY(1px);
  }
  .action-link:focus-visible,
  .specimen-card:focus-visible,
  .demo-card a:focus-visible,
  .chart-card a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #F1D2CC, 0 0 0 4px rgba(184,61,46,0.16);
  }
  .eyebrow {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 18px;
  }
  .hero-links {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .hero-links a {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s;
  }
  .hero-links a:hover {
    color: var(--color-text-warm);
  }
  .hero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 106px;
    line-height: 1.05;
    letter-spacing: -1.2px;
    margin: 0 0 14px;
    color: var(--color-text-primary);
  }
  .hero h1 .cn {
    display: inline-block;
    margin-left: 16px;
    letter-spacing: 0;
    color: var(--color-accent-brand);
  }
  .hero .tagline {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 21px;
    line-height: 1.35;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 920px;
  }

  .section-rail {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--color-border-soft);
    margin: -18px 0 48px;
  }
  .section-rail a {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    color: var(--color-text-warm);
    text-decoration: none;
    border-right: 1px solid var(--color-border-soft);
    border-bottom: 1px solid var(--color-border-soft);
    font-size: 13px;
    line-height: 1.3;
    transition: background 0.18s ease, color 0.18s ease;
  }
  .section-rail a:nth-child(6n) { border-right: none; }
  .section-rail a:last-child { border-right: none; }
  .section-rail span {
    color: var(--color-accent-brand);
    font-family: var(--mono);
    font-size: 11px;
  }
  .section-rail a:hover {
    background: rgba(251, 247, 243, 0.74);
    color: var(--color-text-primary);
  }
  .section-rail a:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(184,61,46,0.28);
  }

  /* ---------- Section ---------- */
  section { margin-bottom: 72px; }
  .section-head { margin-bottom: 24px; }
  .section-num {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-accent-brand);
    letter-spacing: 0.4px;
    margin: 0 0 6px;
  }
  .section-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 32px;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin: 0;
    display: block;
    letter-spacing: 0.4px;
  }
  .section-lede {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text-secondary);
    margin: 14px 0 0;
  }

  /* ---------- Manifesto ---------- */
  .manifesto {
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.65;
    letter-spacing: 0.05em;
    color: var(--color-text-primary);
    margin: 0 0 28px;
    font-weight: 400;
  }
  .manifesto em {
    color: var(--color-accent-brand);
    font-style: normal;
  }

  .rules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--color-border-soft);
  }
  .rules li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 4px;
    padding: 18px 24px 18px 0;
    border-bottom: 1px solid var(--color-border-soft);
    align-items: start;
  }
  .rules li:nth-child(odd) { padding-right: 32px; border-right: 1px solid var(--color-border-soft); padding-left: 0; }
  .rules li:nth-child(even) { padding-left: 32px; }
  .rules .n {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 20px;
    color: var(--color-accent-brand);
    line-height: 1;
    padding-top: 0;
  }
  .rules p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-warm);
  }
  .rules code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-accent-brand);
    background: #F7E6E1;
    padding: 1px 5px;
    border-radius: 2px;
  }

  /* ---------- Archive Index ---------- */
  .master-index-shell,
  .archive-sidebar,
  .archive-main,
  .catalog-index,
  .specimen-matrix,
  .web-guidance-panel {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-soft);
  }
  .master-index-shell {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
    align-items: start;
  }
  .archive-sidebar {
    padding: 22px 20px 24px;
    border-right: 1px solid var(--color-border-soft);
    border-top: none;
    border-left: none;
    border-bottom: none;
    background: linear-gradient(180deg, rgba(233, 222, 212, 0.22) 0%, rgba(251, 247, 243, 0.96) 100%);
  }
  .archive-main {
    padding: 22px;
    border: none;
    background: transparent;
  }
  .archive-kicker,
  .catalog-overline,
  .archive-label {
    margin: 0 0 8px;
    color: var(--color-accent-brand);
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.4px;
  }
  .archive-statement {
    margin: 0 0 16px;
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.5;
    color: var(--color-text-primary);
  }
  .archive-notes {
    display: grid;
    gap: 10px;
  }
  .archive-note {
    padding-top: 10px;
    border-top: 1px solid var(--color-border-soft);
  }
  .archive-note:first-child {
    padding-top: 0;
    border-top: none;
  }
  .archive-value {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.2;
    color: var(--color-text-primary);
  }
  .archive-desc {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.55;
  }
  .catalog-copy,
  .catalog-note {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.55;
  }
  .catalog-index,
  .specimen-matrix {
    padding: 0;
    background: transparent;
    border: none;
  }
  .web-guidance-panel {
    padding: 24px;
    border: 1px solid var(--color-border-soft);
    background: rgba(251, 247, 243, 0.58);
  }
  .archive-main {
    display: grid;
    grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.82fr);
    gap: 28px;
  }
  .catalog-head {
    margin-bottom: 12px;
  }
  .catalog-title {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 26px;
    line-height: 1.2;
    color: var(--color-text-primary);
  }
  .catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--color-text-primary);
  }
  .catalog-table th,
  .catalog-table td {
    text-align: left;
    vertical-align: top;
    padding: 9px 10px;
    border-bottom: 1px solid var(--color-border-soft);
  }
  .catalog-table th {
    color: var(--color-text-muted);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
  }
  .catalog-table tr:last-child td {
    border-bottom: none;
  }
  .catalog-table td:first-child,
  .catalog-table th:first-child {
    width: 64px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .catalog-table td:last-child,
  .catalog-table th:last-child {
    width: 136px;
  }
  .specimen-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .specimen-card {
    display: block;
    color: inherit;
    text-decoration: none;
  }
  .specimen-card img {
    display: block;
    width: 100%;
    border: 1px solid var(--color-border-soft);
    background: var(--color-surface-page);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  .specimen-card:hover img {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(184, 61, 46, 0.14);
  }
  .specimen-meta {
    display: block;
    margin-top: 7px;
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.45;
  }
  .catalog-note {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-soft);
  }

  /* ---------- Color ---------- */
  .swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
  }
  .swatch {
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    background: var(--color-surface-card);
    overflow: hidden;
    transition: box-shadow 0.2s;
  }
  .swatch:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  }
  .swatch .chip {
    height: 96px;
    border-bottom: 1px solid var(--color-border-default);
  }
  .swatch .info {
    padding: 12px 14px 14px;
  }
  .swatch .name {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 15px;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.25;
  }
  .swatch .role {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 3px 0 6px;
    line-height: 1.4;
  }
  .swatch .hex {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-text-muted);
    letter-spacing: 0.4px;
  }
  .swatch.brand .name { color: var(--color-accent-brand); }
  .swatch.dark .chip { border-bottom-color: var(--color-text-primary); }

  .subhead {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    color: var(--color-text-warm);
    margin: 40px 0 14px;
  }

  /* tag tint table */
  .tint-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    background: var(--color-surface-page);
  }
  .tint {
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    background: var(--color-surface-card);
    padding: 18px 16px 14px;
  }
  .tint .sample {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent-brand);
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 0.4px;
    margin-left: -1px;
    margin-bottom: 10px;
  }
  .tint .opacity {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 2px;
  }
  .tint .hex {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-text-muted);
  }
  .tint.default { outline: 1.5px solid var(--color-accent-brand); outline-offset: -1.5px; }
  .tint.default .opacity { color: var(--color-accent-brand); }
  .tint .flag {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.8px;
    color: var(--color-accent-brand);
    margin-bottom: 8px;
    text-transform: uppercase;
    display: block;
    height: 11px;
  }

  /* ---------- Type ---------- */
  .type-grid {
    display: grid;
    grid-template-columns: 180px 1fr 160px;
    column-gap: 40px;
    row-gap: 0;
    border-top: 1px solid var(--color-border-soft);
  }
  .type-row {
    display: contents;
  }
  .type-row > * {
    padding: 22px 0;
    border-bottom: 1px solid var(--color-border-soft);
    align-self: stretch;
  }
  .type-label {
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--color-text-muted);
    padding-top: 22px;
  }
  .type-specs {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    text-align: right;
    padding-top: 22px;
  }
  .type-specs b { color: var(--color-text-warm); font-weight: 500; }
  .type-sample.display {
    font-family: var(--serif); font-weight: 500;
    font-size: 54px; line-height: 1.1; color: var(--color-text-primary);
    letter-spacing: -0.5px;
  }
  html[lang="zh-CN"] .type-sample.display {
    font-size: 48px;
  }
  html[lang="zh-CN"] .type-sample.display { letter-spacing: 0.5px; }
  .type-sample.h1 {
    font-family: var(--serif); font-weight: 500;
    font-size: 30px; line-height: 1.2; color: var(--color-text-primary);
  }
  .type-sample.h2 {
    font-family: var(--serif); font-weight: 500;
    font-size: 22px; line-height: 1.25; color: var(--color-text-primary);
  }
  .type-sample.h3 {
    font-family: var(--serif); font-weight: 500;
    font-size: 17px; line-height: 1.3; color: var(--color-text-primary);
  }
  .type-sample.lede {
    font-family: var(--serif); font-weight: 500;
    font-size: 15px; line-height: 1.55; color: var(--color-text-primary);
    max-width: 540px;
  }
  .type-sample.body {
    font-family: var(--serif); font-weight: 500;
    font-size: 14px; line-height: 1.55; color: var(--color-text-warm);
    max-width: 540px;
  }
  .type-sample.dense {
    font-family: var(--serif); font-weight: 500;
    font-size: 14px; line-height: 1.4; color: var(--color-text-warm);
    max-width: 540px;
  }
  .type-sample.caption {
    font-family: var(--serif); font-weight: 500;
    font-size: 12px; line-height: 1.45; color: var(--color-text-secondary);
  }
  .type-sample.label {
    font-family: var(--serif); font-weight: 500;
    font-size: 12px; line-height: 1.35; color: var(--color-accent-brand);
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  /* family cards */
  .family-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
  }
  .family {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    padding: 28px 24px 22px;
    transition: box-shadow 0.2s;
  }
  .family:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  }
  .family .glyph {
    font-weight: 500;
    font-size: 80px;
    line-height: 1;
    color: var(--color-text-primary);
    margin: 0 0 18px;
    letter-spacing: -1px;
    height: 80px;
    display: flex;
    align-items: center;
  }
  .family.serif .glyph { font-family: var(--serif); }
  .family.sans .glyph { font-family: var(--sans); }
  .family.mono .glyph { font-family: var(--mono); font-weight: 500; font-size: 64px; }
  .family .role {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    color: var(--color-text-primary);
    margin: 0 0 4px;
  }
  .family .name {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-family: var(--mono);
    margin: 0 0 12px;
  }
  .family .use {
    font-size: 12px;
    color: var(--color-text-warm);
    line-height: 1.55;
    margin: 0;
  }

  /* ---------- Spacing ---------- */
  .space-table {
    width: 100%;
    border-collapse: collapse;
  }
  .space-table th, .space-table td {
    text-align: left;
    padding: 14px 16px 14px 0;
    border-bottom: 1px solid var(--color-border-soft);
    font-size: 14px;
    color: var(--color-text-warm);
    vertical-align: middle;
  }
  .space-table th {
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--color-text-muted);
    padding-top: 0;
  }
  .space-table td.name {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 15px;
    color: var(--color-text-primary);
    width: 120px;
  }
  .space-table td.val { font-family: var(--mono); font-size: 13px; color: var(--color-text-secondary); width: 130px; }
  .space-table td.bar {
    width: 280px;
  }
  .bar span {
    display: block;
    height: 4px;
    background: var(--color-border-default);
    border-radius: 2px;
  }
  .space-table td.use { color: var(--color-text-secondary); font-size: 13px; }

  /* radius row */
  .radii {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
  }
  .radius {
    text-align: center;
    flex: 0 0 auto;
  }
  .radius .box {
    width: 72px;
    height: 72px;
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    margin-bottom: 8px;
  }
  .radius .r { font-family: var(--mono); font-size: 12px; color: var(--color-text-warm); }
  .radius .r b { color: var(--color-accent-brand); font-weight: 500; }
  .radius .label { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }

  /* ---------- Components ---------- */
  .comp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: stretch;
  }
  .comp {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-soft);
    border-radius: 8px;
    padding: 28px 28px 24px;
    transition: border-color 0.18s ease, background 0.18s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .comp:hover {
    border-color: var(--color-border-default);
    background: rgba(251, 247, 243, 0.7);
  }
  .comp h4 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 16px;
    color: var(--color-text-primary);
    margin: 0 0 4px;
  }
  .comp .hint {
    font-size: 12px;
    color: var(--color-text-muted);
    font-family: var(--mono);
    margin: 0 0 20px;
  }
  .comp .demo { margin-bottom: 4px; flex: 1; }

  /* Buttons */
  .btn {
    display: inline-block;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.4px;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  }
  .btn-primary {
    background: var(--color-accent-brand);
    color: var(--color-surface-card);
    box-shadow: 0 0 0 1px var(--color-accent-brand);
  }
  .btn-secondary {
    background: var(--color-border-default);
    color: var(--color-text-warm);
    box-shadow: 0 0 0 1px var(--color-border-default);
  }
  .btn-ghost {
    background: transparent;
    color: var(--color-accent-brand);
    box-shadow: 0 0 0 1px var(--color-accent-brand);
  }
  .btn:hover:not(:disabled) {
    box-shadow: 0 0 0 1px var(--color-accent-brand), 0 4px 18px rgba(0,0,0,0.05);
  }
  .btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 0 0 1px var(--color-accent-brand);
  }
  .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #F1D2CC, 0 0 0 4px rgba(184,61,46,0.16);
  }
  .btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  /* Tags */
  .tag {
    display: inline-block;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 2px;
    color: var(--color-accent-brand);
    letter-spacing: 0.4px;
  }
  .tag.calm { background: #F7E6E1; }
  .tag.standard { background: #F1D2CC; border-radius: 4px; padding: 2px 8px; }
  .tag.brush {
    background: linear-gradient(to right, #E2B3A8, #F1D2CC 70%, #F7E6E1);
  }

  /* Quote */
  .quote {
    border-left: 2px solid var(--color-accent-brand);
    padding: 4px 0 4px 14px;
    color: var(--color-text-secondary);
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
  }

  /* Metrics */
  .metrics {
    display: flex;
    gap: 28px;
  }
  .metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .metric-value {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--color-accent-brand);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .metric-label {
    font-size: 12px;
    color: var(--color-text-secondary);
  }

  .featured-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-soft);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
    padding: 18px 20px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .featured-card:hover {
    border-color: var(--color-border-default);
    box-shadow: 0 4px 20px rgba(0,0,0,0.045);
    transform: translateY(-1px);
  }

  /* Section title inline sample: size-led hierarchy, no decoration */
  .sample-section-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 20px;
    color: var(--color-text-primary);
    display: block;
  }

  /* Code block */
  .code {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    padding: 12px 14px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    color: var(--color-text-primary);
    margin: 0;
    white-space: pre;
    overflow-x: auto;
  }
  .code .k { color: var(--color-accent-brand); }
  .code .c { color: var(--color-text-muted); }

  /* List */
  ul.dash {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-warm);
  }
  ul.dash li { position: relative; padding-left: 14px; }
  ul.dash li::before {
    content: "\2013";
    position: absolute;
    left: 0;
    color: var(--color-accent-brand);
  }

  /* Shadows demo */
  .shadow-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
  }
  .shadow-demo {
    background: var(--color-surface-card);
    border-radius: 12px;
    padding: 24px 20px;
    min-height: 110px;
    transition: box-shadow 0.2s;
  }
  .shadow-demo:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  }
  .shadow-demo .t {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 15px;
    color: var(--color-text-primary);
    margin: 0 0 4px;
  }
  .shadow-demo .s {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.5;
  }
  .sd-ring { box-shadow: 0 0 0 1px var(--color-border-default); }
  .sd-whisper { box-shadow: 0 4px 24px rgba(0,0,0,0.05); }
  .sd-alt { background: var(--color-text-primary); color: #b0aea5; }
  .sd-alt .t { color: var(--color-surface-card); font-family: var(--serif); }
  .sd-alt .s { color: #b0aea5; }

  /* Decision table */
  .decision {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }
  .decision th, .decision td {
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid var(--color-border-soft);
    text-align: left;
    vertical-align: top;
  }
  .decision th {
    font-size: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 500;
    padding-top: 0;
  }
  .decision td.task {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-primary);
    width: 38%;
  }
  .decision td.how { color: var(--color-text-warm); }
  .decision td.how code {
    font-family: var(--mono);
    font-size: 12px;
    background: #F7E6E1;
    color: var(--color-accent-brand);
    padding: 1px 5px;
    border-radius: 2px;
  }

  /* Demo grid */
  .demo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
  }
  .demo-card a img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--color-border-default);
    transition: box-shadow 0.2s;
  }
  .demo-card a img:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  }
  .demo-card .demo-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 10px 0 0;
  }
  .demo-card .demo-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 2px 0 0;
  }

  .travel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .travel-grid .demo-card a {
    display: block;
  }
  .travel-grid .demo-card a img {
    display: block;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  /* Chart showcase */
  .chart-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
  }
  .chart-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    padding: 16px 16px 12px;
  }
  .chart-card svg {
    width: 100%;
    height: auto;
    display: block;
  }
  .chart-card svg text {
    font-family: var(--sans);
  }
  .chart-label {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent-brand);
    letter-spacing: 0.3px;
    margin-bottom: 10px;
    text-transform: uppercase;
  }
  .chart-caption {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 8px 0 0;
    line-height: 1.4;
  }

  /* Brand footer */
  .footer {
    margin-top: 24px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border-soft);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
  }
  .footer .mark {
    display: flex;
    gap: 16px;
    align-items: center;
  }
  .footer .mark img { width: 56px; height: 56px; }
  .footer .mark .wm-name {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 28px;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1;
  }
  .footer .mark .wm-sub {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 4px 0 0;
  }
  .footer .colophon {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.6;
    max-width: 420px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .footer .colophon b { color: var(--color-text-warm); font-weight: 500; }

  /* Anti-patterns */
  .anti {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
  }
  .anti > div {
    padding: 18px 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.55;
  }
  .anti .no {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
  }
  .anti .yes {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    border-left: 3px solid var(--color-accent-brand);
  }
  .anti h5 {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--color-text-muted);
  }
  .anti .yes h5 { color: var(--color-accent-brand); }
  .anti p {
    margin: 0;
    color: var(--color-text-warm);
  }
  .anti code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--color-accent-brand);
    background: #F7E6E1;
    padding: 1px 4px;
    border-radius: 2px;
  }

@media (prefers-reduced-motion: reduce) {
  .page,
  .action-link,
  .section-rail a,
  .specimen-card img,
  .swatch,
  .comp,
  .shadow-demo,
  .btn,
  .featured-card {
    animation: none !important;
    transition: none !important;
  }
  .specimen-card:hover img,
  .action-link:active,
  .btn:hover,
  .btn:active,
  .featured-card:hover {
    transform: none !important;
  }
}

@media (max-width: 768px) {
  /* Container + spacing */
  .page { padding: 48px 20px 64px; }
  section { margin-bottom: 48px; }
  .section-head { margin-bottom: 20px; }

  /* Typography scale */
  .hero h1 { font-size: 46px; letter-spacing: -0.6px; margin-bottom: 10px; }
  .hero h1 .cn { margin-left: 8px; }
  .hero .tagline { font-size: 17px; }
  .hero-actions { gap: 8px; margin-top: 18px; }
  .action-link { min-height: 40px; }
  .hero-tokens { gap: 14px; margin-top: 14px; }
  .section-title { font-size: 24px; }
  .manifesto { font-size: 17px; line-height: 1.5; }
  .subhead { font-size: 16px; margin: 28px 0 12px; }

  /* Grids: single column */
  .demo-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .travel-grid { grid-template-columns: 1fr; gap: 14px; }
  .demo-card { min-width: 0; }
  .demo-card .demo-desc { overflow-wrap: break-word; word-break: break-word; }
  .master-index-shell {
    grid-template-columns: 1fr;
  }
  .archive-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-border-soft);
  }
  .archive-main { grid-template-columns: 1fr; gap: 22px; padding: 20px; }
  .specimen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .tint-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .rules { grid-template-columns: 1fr; }
  .rules li:nth-child(odd) { padding-right: 0; border-right: none; }
  .rules li:nth-child(even) { padding-left: 0; }
  .type-grid { grid-template-columns: 1fr; row-gap: 0; }
  .type-row { display: block; padding: 16px 0; border-bottom: 1px solid var(--color-border-soft); }
  .type-row > * { border-bottom: none; padding: 4px 0; }
  .family-grid { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr; }
  .shadow-row { grid-template-columns: 1fr; }
  .anti { grid-template-columns: 1fr; }
  .chart-showcase { grid-template-columns: 1fr; }

  /* Table: hide bar column */
  .space-table td.bar { display: none; }

  /* Type samples */
  .type-sample.display { font-size: 36px; }
  html[lang="zh-CN"] .type-sample.display { font-size: 28px; letter-spacing: 0.3px; }
  .family .glyph { font-size: 48px; }
  .family .glyph.mono { font-size: 40px; }

  /* Footer */
  .footer { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer .colophon { text-align: left; max-width: 100%; }
  .footer .mark .wm-name { font-size: 22px; }

  /* Lang switch + eyebrow */
  .lang-switch { top: 16px; right: 16px; }
  .eyebrow { justify-content: flex-start; gap: 8px; }
  .eyebrow-date { display: none; }
  .hero-tokens { display: none; }

  /* Misc */
  .hero { padding-bottom: 32px; margin-bottom: 36px; }
  .section-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: -14px 0 36px;
  }
  .section-rail a {
    border-bottom: 1px solid var(--color-border-soft);
  }
  .section-rail a:nth-child(6n) { border-right: 1px solid var(--color-border-soft); }
  .section-rail a:nth-child(2n) { border-right: none; }
  .section-rail a:last-child { border-bottom: 1px solid var(--color-border-soft); }
  .archive-statement { font-size: 18px; }
  .catalog-title { font-size: 22px; }
  .comp { padding: 20px 16px 16px; }
  .family { padding: 20px 16px 16px; }
  .radius .box { width: 56px; height: 56px; }
}

@media (max-width: 640px) {
  .section-rail { grid-template-columns: 1fr; }
  .section-rail a { border-right: none; }
  .section-rail a:nth-child(6n) { border-right: none; }
  .archive-sidebar { padding: 18px; }
  .archive-main { padding: 18px; }
  .catalog-table,
  .catalog-table tbody,
  .catalog-table tr,
  .catalog-table td,
  .catalog-table th {
    display: block;
    width: 100%;
  }
  .catalog-table tr:first-child {
    display: none;
  }
  .catalog-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-soft);
  }
  .catalog-table td {
    padding: 3px 0;
    border-bottom: none;
  }
  .catalog-table td:first-child,
  .catalog-table td:last-child {
    width: auto;
  }
  .specimen-grid {
    grid-template-columns: 1fr;
  }
}

  /* ========== SCHEME GALLERY ========== */
  /* Generated by scripts/build_scheme_comparison.py --inject. The swatches show
     each scheme's own colours and are exempt from the theme bake. */
  .schemes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0 0 14px;
  }
  .scheme {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-default);
    border-radius: 4pt;
    padding: 16px 16px 14px;
  }
  .scheme-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
  }
  .scheme-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0;
  }
  .scheme-id {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--color-text-muted);
  }
  .scheme-flag {
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-accent-brand);
    border: 1px solid var(--color-accent-brand-tint);
    background: var(--color-accent-brand-tint);
    border-radius: 2px;
    padding: 1px 5px;
  }
  .scheme-note {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
    min-height: 38px;
  }
  .scheme-chips {
    display: flex;
    gap: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--color-border-default);
  }
  .scheme-chip {
    flex: 1;
    height: 26px;
  }
  .scheme-count {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--color-text-muted);
    margin: 8px 0 0;
  }
  .scheme-foot {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
  }
  .scheme-foot code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--color-accent-brand-tint);
    color: var(--color-accent-brand);
    padding: 1px 5px;
    border-radius: 2px;
  }
