:root {
  --paper: #f3f0e8;
  --ink: #24241f;
  --muted: #716f64;
  --line: #c9c3b5;
  --red: #a23a2a;
  --green: #2d6252;
  --panel: #faf8f1;
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.6 var(--sans);
}
button,
select,
textarea,
input {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
header {
  height: 66px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.96);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
}
.brand b {
  font: 700 24px var(--serif);
}
.brand span,
.kicker {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 4px;
}
nav button {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
}
nav button.active {
  border-color: var(--red);
  color: var(--red);
}
.identity {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 12px;
}
.view {
  display: none;
  width: min(1380px, calc(100% - 32px));
  margin: auto;
  padding: 36px 0 60px;
}
.view.active {
  display: block;
}
.language-bar {
  display: grid;
  grid-template-columns: 1fr 48px 1fr 170px;
  gap: 8px;
  margin-bottom: 10px;
}
.language-bar select,
.dropzone select {
  border: 1px solid var(--line);
  padding: 11px;
  background: var(--panel);
  color: var(--ink);
}
#swap {
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 18px;
}
.desk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 520px;
}
.desk article {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}
.desk article + article {
  border-left: 1px solid var(--line);
}
.pane-head,
.desk footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.desk footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.pane-head > span {
  font-weight: 700;
  color: var(--ink);
}
textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
#source,
.output {
  min-height: 410px;
  padding: 26px;
  font: 18px/1.85 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.output.empty {
  color: #99968b;
}
.primary {
  padding: 9px 22px;
  background: var(--red);
  color: #fffaf0;
}
.context {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.context summary {
  cursor: pointer;
}
.context textarea {
  min-height: 100px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.section-intro {
  max-width: 700px;
  margin-bottom: 30px;
}
.section-intro h1 {
  font: 700 clamp(30px, 5vw, 56px)/1.1 var(--serif);
  margin: 5px 0 12px;
}
.dropzone {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px dashed var(--line);
  background: var(--panel);
  text-align: center;
}
.dropzone strong {
  font: 700 24px var(--serif);
}
.dropzone span {
  color: var(--muted);
}
.dropzone div {
  display: flex;
  gap: 8px;
}
.layout-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  max-width: 520px;
}
.layout-option > input {
  width: 18px;
  height: 18px;
}
.layout-option span {
  display: grid;
}
.layout-option small {
  color: var(--muted);
}
.job {
  margin-top: 16px;
}
.history-list {
  display: grid;
}
.history-item {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.history-item time {
  color: var(--muted);
}
.history-item p {
  margin: 0;
  white-space: pre-wrap;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      90deg,
      transparent 49.8%,
      rgba(162, 58, 42, 0.08) 50%,
      transparent 50.2%
    ),
    var(--paper);
}
.login-panel {
  width: min(420px, calc(100% - 32px));
  padding: 48px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--red);
  color: white;
  font: 700 25px var(--serif);
}
.login-mark {
  width: 56px;
  height: 56px;
}
.login h1 {
  font: 700 54px/1 var(--serif);
  margin: 20px 0 14px;
}
.login form {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}
.login label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}
.login input {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.login form button {
  padding: 12px;
  background: var(--ink);
  color: var(--paper);
}
@media (max-width: 760px) {
  header {
    grid-template-columns: 1fr auto;
    height: auto;
    padding-block: 10px;
  }
  .brand span,
  .identity > span {
    display: none;
  }
  nav {
    grid-row: 2;
    grid-column: 1/-1;
    justify-content: center;
  }
  .desk {
    grid-template-columns: 1fr;
  }
  .desk article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .language-bar {
    grid-template-columns: 1fr 44px 1fr;
  }
  .language-bar #mode {
    grid-column: 1/-1;
  }
  .history-item {
    grid-template-columns: 1fr;
  }
  .view {
    padding-top: 20px;
  }
  .dropzone div {
    flex-direction: column;
  }
}
