:root {
  color: #242520;
  background: #f7f6f2;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --paper: #f7f6f2;
  --ink: #242520;
  --muted: #52564f;
  --rule: #d8d9ce;
  --blue: #244be8;
  --panel: #e9edf8;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
::selection { background: #dce3ff; }

.frame { width: min(calc(100% - 2 * clamp(18px, 5vw, 72px)), 1272px); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: .75rem;
  left: 1rem;
  z-index: 10;
  color: white;
  background: var(--ink);
  padding: .65rem 1rem;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1.5rem;
  min-height: 4.6rem;
  padding-block: .45rem;
  border-bottom: 1px solid var(--rule);
}
.nameplate,
.masthead nav a,
.footer a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  text-decoration: none;
}
.nameplate { font-weight: 700; letter-spacing: -.02em; }
.nameplate span { color: var(--blue); }
.masthead nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 clamp(.75rem, 2vw, 1.6rem); font-size: .89rem; }
.language-switch { padding-inline: .7rem; border-radius: .65rem; background: #eeede7; white-space: nowrap; }
.masthead a:hover, .footer a:hover { color: var(--blue); }

.opening {
  display: grid;
  grid-template-columns: minmax(13rem, .8fr) minmax(0, 1.6fr);
  gap: clamp(1.8rem, 4vw, 4.8rem);
  align-items: center;
  padding-block: clamp(2rem, 5vw, 5rem);
}
.intro h1 {
  margin: 0;
  color: var(--ink);
  font: 400 clamp(2.8rem, 5.35vw, 5.25rem)/1.04 var(--serif);
  letter-spacing: -.07em;
}
html[lang="zh-Hans"] .intro h1 { font-size: clamp(2.6rem, 4.7vw, 4.55rem); line-height: 1.18; letter-spacing: -.075em; }
.intro p { max-width: 27rem; margin: 1.2rem 0 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.13rem); }

.workbench {
  min-width: 0;
  padding: clamp(.9rem, 2.4vw, 1.8rem);
  background: var(--panel);
  border: 1px solid #dce1ef;
  border-radius: 1.15rem;
}
.workbench-heading h2, .products h2 {
  margin: 0;
  font: 400 clamp(1.75rem, 3.4vw, 2.55rem)/1.25 var(--serif);
  letter-spacing: -.04em;
}
.workbench-heading p { margin: .45rem 0 1rem; color: #4a5570; font-size: .93rem; }
.editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.editor {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: .65rem .75rem;
  background: #fbfcff;
  border: 1px solid #dce1ef;
  border-radius: .7rem;
}
.result { background: #f0f4ff; }
.editor label { font-weight: 660; font-size: .83rem; margin: 0 0 .35rem; }
.editor textarea {
  width: 100%;
  min-width: 0;
  min-height: 7.8rem;
  padding: .25rem .15rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: .2rem;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.45;
}
.editor textarea::placeholder { color: #59637c; }
.controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 .7rem; margin-top: .65rem; }
.checkbox { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .45rem; font-size: .83rem; cursor: pointer; }
.checkbox input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--blue); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.actions button {
  min-height: 2.75rem;
  padding: .45rem .75rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .83rem;
  font-weight: 650;
}
.quiet { color: #2844a5; background: transparent; }
.quiet:hover:enabled { background: #dbe3ff; }
.primary { color: white; background: var(--blue); }
.primary:hover:enabled { background: #183bc7; }
.secondary { color: #2543a9; background: #fbfcff; }
.secondary:hover:enabled { border-color: #9baef1; }
.demo-status { min-height: 1.4rem; margin: .35rem 0 0; color: #404e70; font-size: .83rem; }

.products { padding-block: 1.35rem clamp(2.4rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.product-list { display: grid; grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.product {
  min-width: 0;
  display: grid;
  align-content: stretch;
  background: #efeee7;
  border-radius: .85rem;
  overflow: hidden;
}
.product:nth-child(2) { background: #e9eddb; }
.product:nth-child(3) { background: #eceaf1; }
.inktyper { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
.inktyper img {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  background: var(--panel);
  display: block;
  object-fit: cover;
}
.product-copy { padding: 1rem; display: flex; flex-direction: column; align-items: flex-start; }
.product h3 { font: 400 clamp(1.38rem, 2.3vw, 1.9rem)/1.13 var(--serif); letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
.product p { margin: .45rem 0 .3rem; color: var(--muted); font-size: .88rem; }
.product a { margin-top: auto; min-height: 2.75rem; display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: #223fa4; font-size: .87rem; font-weight: 650; }
.product a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--rule); gap: 0 1rem; color: var(--muted); padding-block: .35rem 1rem; font-size: .83rem; }

@media (max-width: 940px) {
  .opening { grid-template-columns: 1fr; }
  .intro { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; align-items: end; }
  .intro p { margin: 0 0 .2rem; }
  .inktyper { grid-template-columns: minmax(0, 1fr); }
  .inktyper img { aspect-ratio: 2.3; min-height: auto; height: auto; }
}

@media (max-width: 620px) {
  .masthead { align-items: start; flex-direction: column; gap: 0; }
  .intro { grid-template-columns: 1fr; gap: .9rem; }
  .intro h1 { letter-spacing: -.055em; }
  .editors, .product-list { grid-template-columns: 1fr; }
  .editor textarea { min-height: 6.25rem; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .inktyper { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
  .inktyper img { aspect-ratio: auto; min-height: 100%; height: auto; }
}
