:root {
  color-scheme: light;

  --papyrus: #e8d4a8;
  --sheet: #f6ebc8;
  --ink: #1a120c;
  --lapis: #1c3a7a;
  --gold-line: #8a6918;
  --gold-on-ink: #c9962b; /* 仅深色底点缀，不作浅底线或字 */
  --ochre: #9c3b2a;
  --muted: #4a3c2c;
  --input-face: #ffffff;
  --line: #6b5a40;

  --paper-100: #fbf6e8;
  --paper-200: #f6ebc8;
  --paper-300: #e8d4a8;
  --paper-400: #d2ba86;
  --paper-500: #a8905e;
  --paper-600: #6b5a40;
  --paper-700: #4a3c2c;
  --paper-800: #2e2418;
  --paper-900: #1a120c;

  --lapis-100: #e8eef7;
  --lapis-200: #c5d2ea;
  --lapis-300: #8fa4d0;
  --lapis-400: #4d6aab;
  --lapis-500: #2a4d8f;
  --lapis-600: #1c3a7a;
  --lapis-700: #162e61;
  --lapis-800: #102248;
  --lapis-900: #0a1730;

  --font-display: "Source Serif 4", "Source Serif 4 600", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-glyph-egypt: "Noto Sans Egyptian Hieroglyphs", var(--font-body);
  --font-glyph-runic: "Noto Sans Runic", var(--font-body);
  --font-glyph-ogham: "Noto Sans Ogham", var(--font-body);
  --font-glyph-cuneiform: "Noto Sans Cuneiform", var(--font-body);

  --text-meta: 13px;
  --text-body: 16px;
  --text-lead: 18px;
  --text-title: 20px;
  --text-h1: 24px;          /* 桌面改为 32px */
  --text-glyph: 44px;       /* 桌面改为 64px */
  --text-sign: 28px;
  --leading-body: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-card: 12px;
  --radius-ctrl: 8px;
  --radius-lexicon: 8px;

  --stroke-input: 1.5px solid var(--line);
  --stroke-gold: 2px solid var(--gold-line);
  --shadow-sheet: 0 3px 0 #c4a86a;
  --shadow-drawer: 0 16px 40px rgba(26, 18, 12, 0.18);
  --focus-ring: 3px solid var(--ochre);

  --header-h: 56px;
  --tap: 44px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 120ms;
}

@media (min-width: 44rem) {
  :root {
    --text-h1: 32px;
    --text-glyph: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 1ms; }
}

:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

body {
  margin: 0;
  background-color: var(--papyrus);
  background-image:
    repeating-linear-gradient(90deg, transparent 0, transparent 11px, rgba(26, 18, 12, 0.03) 12px),
    repeating-linear-gradient(0deg, transparent 0, transparent 9px, rgba(138, 105, 24, 0.025) 10px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

h1, h2, .site-brand {
  font-family: var(--font-display);
  font-weight: 600;
}

.glyph-egypt { font-family: var(--font-glyph-egypt); font-weight: 400; }
.glyph-runic { font-family: var(--font-glyph-runic); font-weight: 400; }
.glyph-ogham { font-family: var(--font-glyph-ogham); font-weight: 400; }
.glyph-cuneiform { font-family: var(--font-glyph-cuneiform); font-weight: 400; }

.tool-result { font-size: var(--text-glyph); line-height: 1.2; }
.disclaimer { color: var(--muted); font-size: var(--text-body); }
.lexicon-card {
  border-radius: var(--radius-lexicon);
  background: var(--sheet);
  box-shadow: inset 3px 0 0 var(--lapis-600);
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/_a/source-serif-4-600.92f4377e54.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/_a/source-sans-3-400.4098b3fe1a.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/_a/source-sans-3-600.b5b3a75cd2.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

[hidden] {
  display: none !important;
}

h1 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-h1);
  line-height: 28px;
}

h2 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-title);
  line-height: 26px;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--lapis);
  text-underline-offset: .18em;
}

a:hover {
  color: var(--lapis-800);
}

.glyph {
  font-family: var(--glyph-font, "Source Sans 3"), var(--font-body);
  font-weight: 400;
}

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 3;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--sheet);
}

.site-wrap {
  width: min(100% - 2 * var(--space-4), 64rem);
  margin-inline: auto;
}

.site-header,
.site-footer {
  background: var(--sheet);
}

.site-header {
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 0 var(--gold-line);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-3);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  color: var(--ink);
  font-size: var(--text-title);
  line-height: 24px;
  text-decoration: none;
}

.brand-mark {
  flex: none;
}

.header-row .brand-full {
  display: none;
}

.site-menu {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  color: var(--lapis);
  background: var(--sheet);
  border: 1.5px solid var(--lapis);
  border-radius: var(--radius-ctrl);
  cursor: pointer;
}

.site-menu:hover,
.site-menu:active {
  background: var(--lapis-100);
}

.site-menu[aria-expanded="false"] .menu-close-icon,
.site-menu[aria-expanded="true"] .menu-open-icon {
  display: none;
}

.site-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
}

.site-nav a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-2);
}

.site-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--lapis);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.menu-site-links {
  display: none;
}

@media (width < 48rem) {
  .site-menu:not([hidden]) + .site-nav {
    position: absolute;
    inset: var(--header-h) 0 auto;
    display: grid;
    max-height: calc(100dvh - var(--header-h));
    overflow: auto;
    padding: var(--space-2) var(--space-4);
    border-block: 1px solid var(--gold-line);
    background: var(--sheet);
    box-shadow: var(--shadow-drawer);
    transition: opacity 160ms var(--ease), transform 160ms var(--ease), visibility 160ms;
  }

  .site-menu[aria-expanded="false"]:not([hidden]) + .site-nav {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
  }

  .site-menu:not([hidden]) + .site-nav .menu-site-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--gold-line);
  }
}

@media (min-width: 48rem) {
  .header-row,
  .site-nav {
    flex-wrap: nowrap;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .header-row .brand-full {
    display: inline;
  }

  .site-menu,
  .brand-short {
    display: none;
  }
}

.page-intro {
  padding-block: var(--space-4) var(--space-3);
}

.page-lead {
  max-width: 67ch;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-lead);
  line-height: 1.5;
}

.tool-stage {
  display: flow-root;
}

.ad-reserve {
  width: min(100%, 320px);
  height: 50px;
  margin: var(--space-5) auto 0;
  background: var(--papyrus);
}

@media (width < 44rem) {
  .tool-stage {
    min-height: calc(100svh - var(--header-h));
  }
}

@media (min-width: 44rem) {
  .site-wrap {
    width: min(100% - 2 * var(--space-5), 64rem);
  }

  h1 {
    line-height: 36px;
  }

  .page-intro {
    padding-block: var(--space-6) var(--space-5);
  }

  .ad-reserve {
    width: 300px;
    height: 250px;
  }
}

.page-copy {
  max-width: 53rem;
  padding-bottom: var(--space-7);
  font-family: "Source Sans 3", var(--glyph-font, system-ui), system-ui, sans-serif;
}

.page-copy p {
  max-width: 70ch;
}

.page-copy li + li {
  margin-top: var(--space-1);
}

.page-copy code {
  padding: .12em .25em;
  border-radius: 4px;
  background: var(--sheet);
  font-size: .9em;
}

.legal-page {
  min-height: 58vh;
  padding-top: var(--space-6);
}

.legal-page h1 {
  margin-bottom: var(--space-4);
}

.chart {
  margin-block: var(--space-4) var(--space-5);
  overflow-x: auto;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-ctrl);
  background: var(--sheet);
}

.chart table {
  width: 100%;
  border-collapse: collapse;
}

.chart th,
.chart td {
  padding: var(--space-2) var(--space-1);
  text-align: start;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.chart thead {
  color: var(--ink);
  background: var(--papyrus);
  border-bottom: 1px solid var(--gold-line);
}

.chart tbody tr + tr {
  border-top: 1px solid var(--paper-400);
}

.chart-sign {
  display: block;
  font-size: var(--text-sign);
  line-height: 1.2;
}

.codepoints {
  display: block;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 18px;
}

.name-step {
  display: inline-block;
  margin-inline-end: var(--space-1);
}

.name-step .glyph {
  font-size: var(--text-title);
}

@media (min-width: 44rem) {
  .chart th,
  .chart td {
    padding-inline: var(--space-3);
  }
}

.related-tools ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.related-tools li,
.related-tools li + li {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--sheet);
}

.related-tools a,
.faq summary,
.changelog-date {
  font-weight: 600;
}

.related-tools p {
  margin: var(--space-1) 0 0;
  color: var(--muted);
}

.faq details {
  border-top: 1px solid var(--gold-line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--gold-line);
}

.faq summary {
  min-height: var(--tap);
  padding: var(--space-3) var(--space-1);
  cursor: pointer;
}

.faq p {
  padding-inline-start: var(--space-5);
}

.sources ul,
.changelog ul {
  padding-inline-start: var(--space-5);
}

.site-footer {
  border-top: 1px solid var(--gold-line);
}

.footer-row {
  padding-block: var(--space-3) var(--space-4);
}

.site-footer nav a,
.footer-updated {
  font-size: var(--text-meta);
  line-height: 18px;
}

.footer-updated {
  margin: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .site-menu:not([hidden]) + .site-nav {
    transition: none;
  }

  .site-menu[aria-expanded="false"]:not([hidden]) + .site-nav {
    transform: none;
  }
}
