@font-face {
  font-family: "Hudum";
  src: url("./fonts/hudum.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --ink: #253a32;
  --muted: #6e746a;
  --line: #e1e4da;
  --green: #2e5147;
  --soft: #eaf0e7;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); text-decoration: underline; }
button, a, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid #608b6c; }
button { transition: background .15s, color .15s; }
[hidden] { display: none !important; }
.shell { max-width: 1240px; padding: 0 48px; margin: 0 auto; }
.site-header { height: 94px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; font-size: 22px; font-weight: 650; letter-spacing: -.7px; }
.brand:hover { text-decoration: none; }
.brand-light { font-weight: 400; }
.brand-mark { font: 31px "Hudum", sans-serif; width: 36px; height: 37px; border-radius: 8px; color: var(--paper); background: var(--green); margin-right: 12px; display: grid; place-items: center; }
.brand-tag { font: 9px var(--mono); letter-spacing: 1.2px; color: var(--muted); padding: 6px 8px; border: 1px solid #d6dacf; border-radius: 4px; margin-left: 15px; }
.source-link { font-size: 13px; color: var(--muted); }
.source-link span { padding-left: 7px; }
.intro { display: flex; justify-content: space-between; align-items: center; padding: 49px 0 37px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 10px var(--mono); letter-spacing: 1.8px; color: var(--green); margin: 0 0 19px; }
.eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: #668664; }
h1 { font-size: clamp(27px, 3.1vw, 39px); font-weight: 550; letter-spacing: -.9px; margin: 0 0 16px; }
h1 span { color: #7c8875; }
.headline-zh { display: block; font-size: .62em; font-weight: 450; margin-top: 12px; letter-spacing: 0; }
.translation { display: block; margin-top: 3px; }
.intro-copy { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.8; }
.intro-note { display: flex; align-items: center; gap: 20px; margin-right: 14px; color: #7b8575; }
.note-line { writing-mode: vertical-lr; font: 32px "Hudum", sans-serif; height: 94px; }
.intro-note > span:last-child { font: 10px/1.9 var(--mono); letter-spacing: 1px; }
.workspace { display: grid; grid-template-columns: 1fr 1.05fr; align-items: stretch; gap: 22px; }
.panel { background: #fffefa; border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow: hidden; }
.panel-heading { min-height: 66px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 15px 24px; border-bottom: 1px solid var(--line); gap: 10px; }
h2 { margin: 0; font-size: 16px; font-weight: 550; }
.panel-heading h2 { display: flex; align-items: center; gap: 10px; }
.step { font: 10px var(--mono); color: #8a9385; margin-right: 3px; }
.section-en { color: #7b8175; font-size: 10px; font-weight: 400; letter-spacing: .8px; margin-left: 2px; }
.text-button { background: transparent; color: var(--muted); border: 0; font-size: 12px; padding: 7px 4px; }
.text-button:hover { color: var(--ink); }
.copy-button { font-size: 11px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); min-width: 49px; white-space: nowrap; }
.copy-button:hover:enabled { background: var(--soft); color: var(--green); }
.mongolian { font-family: "Hudum", "PingFang SC", sans-serif; font-weight: 400; }
.input { display: block; width: calc(100% - 48px); height: 148px; margin: 23px 24px 0; padding: 6px 0; font-size: 44px; line-height: 1.8; background: transparent; color: var(--ink); border: 0; resize: vertical; min-height: 100px; max-height: 500px; }
.input::placeholder { color: #adb4a6; }
.input:focus { outline-offset: 7px; border-radius: 3px; }
.input-meta, .result-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; font: 9px var(--mono); letter-spacing: .8px; color: #818a79; }
.input-meta { padding: 9px 24px 14px; }
.help { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 0 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 24px 0; align-items: center; }
.toolbar-label { font-size: 11px; color: var(--muted); margin-right: 5px; white-space: nowrap; }
.toolbar button { font: 10px var(--mono); border: 1px solid var(--line); border-radius: 4px; background: #f8f9f4; color: #617259; padding: 6px 7px; }
.toolbar button:hover { background: #e7eee2; }
.samples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 24px 22px; }
.samples button { font-size: 11px; border: 0; border-radius: 20px; background: #edf1e9; color: #4f674a; padding: 6px 10px; }
.samples button:hover { background: #dce6d5; }
.code-details { border-top: 1px solid var(--line); padding: 17px 24px 20px; }
.code-details summary { cursor: pointer; color: #596651; font-size: 11px; user-select: none; }
.code-details summary span { font: 9px var(--mono); color: #8d9484; margin-left: 6px; letter-spacing: 1px; }
.codepoints { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 13px; max-height: 130px; overflow: auto; }
.codepoint { font: 10px/1.5 var(--mono); color: #69765e; background: #f0f2eb; padding: 4px 6px; border-radius: 3px; }
.codepoint.control { color: #95702d; background: #f7efd9; }
.codepoint.unsupported { color: #ab473a; background: #fceae5; }
.results { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.shape-panel { flex: 0 0 auto; }
.shape-output { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 86px; padding: 20px 24px 10px; font: 18px/1.6 var(--mono); max-height: 220px; overflow: auto; }
.shape-unit { color: #335b4b; }
.shape-plus { color: #b7c1ae; font-size: 12px; margin: 0 2px; }
.result-foot { padding: 8px 24px 18px; }
.norm-panel { flex: 1; }
.norm-body { padding: 9px 24px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 15px; }
.norm-output { font-size: 35px; line-height: 1.9; margin: 8px 0; overflow-wrap: anywhere; min-width: 0; max-height: 140px; overflow: auto; }
.status-tag { font-size: 10px; color: #6d7b59; background: #eef2e4; padding: 5px 7px; margin-bottom: 10px; border-radius: 4px; }
.norm-help { margin-bottom: 15px; }
.norm-panel .code-details { padding-top: 13px; padding-bottom: 16px; }
.placeholder { color: #929888; font: 12px/1.7 -apple-system, BlinkMacSystemFont, sans-serif; }
#norm-placeholder { margin: 13px 24px 20px; }
.error { font: 11px/1.8 var(--mono); color: #a44633; background: #fff3ed; border-left: 2px solid #d8a08c; padding: 9px 12px; margin: 12px 24px 18px; overflow-wrap: anywhere; max-height: 160px; overflow: auto; white-space: pre-wrap; }
.comparison { display: grid; grid-template-columns: 1.1fr 1fr 1fr; margin-top: 22px; background: #eef1e8; min-height: 255px; }
.comparison-intro { padding: 29px 30px; }
.comparison-intro .eyebrow { margin-bottom: 13px; font-size: 9px; }
.comparison-intro h2 { font-size: 20px; }
.comparison-intro p:not(.eyebrow) { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 11px 0 20px; }
.match-status { display: inline-flex; font-size: 10px; color: #6a765e; border: 1px solid #cfd9c7; border-radius: 4px; padding: 6px 9px; }
.match-status.match { color: #365e40; background: #e1eadb; }
.preview-column { padding: 25px 25px 15px; min-width: 0; border-left: 1px solid #dce2d3; }
.preview-label { display: flex; align-items: baseline; gap: 9px; font-size: 11px; color: #5d6b54; }
.preview-label span { font: 9px var(--mono); color: #939c8a; letter-spacing: 1px; }
.preview-scroll { overflow: auto; height: 182px; margin-top: 18px; }
.vertical { writing-mode: vertical-lr; text-orientation: mixed; font-size: 40px; line-height: 1.65; height: 160px; overflow-wrap: anywhere; margin: 0; white-space: pre-wrap; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 24px 0 30px; color: #818977; font: 10px/1.8 var(--mono); }
.footer-dot { padding: 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .shell { padding: 0 25px; }
  .intro-note { display: none; }
  .workspace { gap: 16px; }
  .comparison { grid-template-columns: 1fr 1fr 1fr; }
  .comparison-intro { padding: 26px 22px; }
  .preview-column { padding: 26px 18px 15px; }
}

@media (max-width: 650px) {
  .shell { padding: 0 18px; }
  .site-header { height: 77px; }
  .brand { font-size: 20px; }
  .brand-tag { display: none; }
  .intro { padding: 33px 0 27px; }
  .intro-copy { font-size: 12px; max-width: 300px; }
  .eyebrow { font-size: 9px; }
  .workspace { grid-template-columns: 1fr; }
  .section-en { display: inline; }
  .input { height: 119px; }
  .panel-heading { min-height: 58px; }
  .comparison { grid-template-columns: 1fr 1fr; }
  .comparison-intro { grid-column: 1 / -1; border-bottom: 1px solid #dce2d3; padding: 23px; }
  .comparison-intro p:not(.eyebrow) { margin: 8px 0 13px; }
  .comparison-intro br { display: none; }
  .preview-column:nth-child(2) { border-left: 0; }
  .preview-label { flex-wrap: wrap; gap: 5px; }
  footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
