:root {
  color-scheme: light;
  --ink: #111411;
  --muted: #5d665f;
  --paper: #fbfaf4;
  --panel: #ffffff;
  --line: #d8d3c5;
  --accent: #15634b;
  --accent-ink: #ffffff;
  --warn: #8d5a00;
  --error: #a32929;
  --ok: #15634b;
  font-family: "Avenir Next", "Gill Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(17, 20, 17, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 20, 17, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  color: var(--ink);
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14vh 0 72px;
}

.hero {
  border-top: 2px solid var(--ink);
  padding-top: 34px;
}

.hero.compact {
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0 0 32px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(42px, 9vw, 96px);
  line-height: 0.95;
  font-weight: 500;
}

.query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 12px;
  align-items: end;
}

.stack-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  padding: 0 16px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 99, 75, 0.14);
}

button {
  height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
}

.status[data-tone="ok"] {
  color: var(--ok);
}

.status[data-tone="warn"] {
  color: var(--warn);
}

.status[data-tone="error"] {
  color: var(--error);
}

.result,
.recent {
  margin-top: 34px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.code-panel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.code-label {
  color: var(--muted);
}

#code-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 12vw, 92px);
  line-height: 0.9;
  font-weight: 500;
  color: var(--accent);
}

.message-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 0;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.recent h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

li:first-child {
  border-top: 0;
}

li span,
li small {
  color: var(--muted);
}

.admin-link {
  position: fixed;
  right: 18px;
  bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 24px, 920px);
    padding-top: 9vh;
  }

  h1 {
    font-size: 46px;
  }

  .query-form,
  .message-meta {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .code-panel {
    display: grid;
  }
}
