:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --white: #fffdf9;
  --ink: #222520;
  --muted: #5d6359;
  --line: #deddd3;
  --accent: #a64128;
  --accent-hover: #84321d;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a { color: inherit; text-decoration: none; }
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
  padding: 0 max(20px, calc((100% - 1112px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--white);
  gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; white-space: nowrap; }
.brand span, .back { font-size: 13px; font-weight: 650; color: var(--muted); }
.back:hover, .back:focus-visible { color: var(--accent); }
.shell { width: min(1112px, calc(100% - 40px)); margin: 0 auto; padding: 55px 0 64px; }
.intro { margin-bottom: 30px; }
h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 760; letter-spacing: -.045em; margin: 0; line-height: 1.2; }
.intro p { margin: 13px 0 0; color: var(--muted); line-height: 1.65; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--white); border-radius: 14px; padding: 24px; min-width: 0; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
fieldset { padding: 0; margin: 21px 0 0; border: 0; min-width: 0; display: grid; gap: 17px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: block; font-size: 14px; line-height: 1.4; font-weight: 650; min-width: 0; }
.optional { color: var(--muted); font-size: 12px; font-weight: 500; }
input, textarea, select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid #c6c8bd;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #656b62; font-size: 14px; }
.number-field { display: block; position: relative; }
.number-field input { padding-right: 30px; appearance: textfield; }
.number-field input::-webkit-inner-spin-button { appearance: none; }
.number-field > span { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.actions { margin-top: 22px; }
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--accent); color: white; }
.primary:not(:disabled):hover { background: var(--accent-hover); }
.primary:disabled { opacity: .7; cursor: wait; }
#form-status, .copy-status { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
#form-status[data-error] { color: #a22b21; }
#form-status:empty, .copy-status:empty { margin: 0; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); font-size: 14px; }
.secondary:hover { border-color: var(--muted); }
.empty {
  min-height: 311px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 24px 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #faf9f4;
  margin-top: 12px;
}
.empty-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #e7ccbf; border-radius: 9px; background: #f7ebe4; color: var(--accent); font-size: 24px; }
.empty p { margin: 13px 0 5px; font-weight: 650; }
.empty small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.language { color: var(--accent); display: inline-block; margin-top: 14px; font-weight: 750; font-size: 13px; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin: 10px 0 20px; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { width: fit-content; min-height: 44px; padding: 11px 3px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 650; }
details .message { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
@media (max-width: 760px) {
  .shell { padding-top: 32px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .intro { margin-bottom: 20px; }
  .panel { padding: 18px; }
  .empty { min-height: 180px; }
}
@media (max-width: 370px) {
  .brand span { display: none; }
  .pair { grid-template-columns: 1fr; }
}
