:root {
  --bg: #f4f8f7;
  --card: #ffffff;
  --text: #15342c;
  --muted: #5f746b;
  --line: #d7e4df;
  --brand: #0c7d57;
  --brand-deep: #0a5b3f;
  --accent: #d7773c;
  --shadow: 0 20px 46px rgba(21, 52, 44, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(12, 125, 87, 0.12), transparent 32%),
    radial-gradient(circle at 100% 0, rgba(215, 119, 60, 0.1), transparent 28%),
    linear-gradient(180deg, #fbfdfc 0%, var(--bg) 100%);
}

.page {
  width: calc(100vw - 64px);
  max-width: none;
  min-width: 320px;
  margin: 0 auto;
  position: relative;
  height: 100vh;
  padding: 8px 0 30px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero {
  padding: 8px 10px;
}

h1,
h2,
p {
  margin: 0;
}

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

h1 {
  margin-top: 0;
  font-size: clamp(20px, 2.5vw, 27px);
  letter-spacing: -0.03em;
}

.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-start;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  cursor: pointer;
  font-size: 13px;
}

button.secondary {
  color: var(--text);
  background: #eef4f1;
  border: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.pane {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

h2 {
  font-size: 18px;
}

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

textarea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  line-height: 1.6;
  background: #fbfdfc;
  color: var(--text);
  resize: none;
}

textarea:focus {
  outline: none;
  border-color: rgba(12, 125, 87, 0.5);
  box-shadow: 0 0 0 4px rgba(12, 125, 87, 0.08);
  background: #fff;
}

textarea.error {
  border-color: rgba(178, 70, 70, 0.62);
  box-shadow: 0 0 0 4px rgba(178, 70, 70, 0.12);
}

.result-view {
  margin: 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  line-height: 1.6;
  background: #fbfdfc;
  color: var(--text);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.result-view .json-key {
  color: #0a5b3f;
  font-weight: 700;
}

.result-view .json-string {
  color: #b24646;
}

.result-view .json-number {
  color: #175fa6;
}

.result-view .json-boolean {
  color: #8d4aa6;
  font-weight: 700;
}

.result-view .json-null {
  color: #7a6a58;
  font-style: italic;
}

.status {
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.status.ok {
  color: var(--brand);
}

.status.error {
  color: #b24646;
}

@media (max-width: 960px) {
  .page {
    width: calc(100% - 18px);
    height: 100vh;
    padding: 10px 0 14px;
    overflow: auto;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: clamp(280px, 44vh, 420px);
    height: auto;
  }

  .result-view {
    min-height: clamp(280px, 44vh, 420px);
    height: auto;
  }
}
