:root {
  color: #16233d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 64px 0;
}

.hero {
  max-width: 720px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #5474c8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.hero-copy {
  margin-bottom: 0;
  color: #587092;
  font-size: 17px;
  line-height: 1.7;
}

.guide-link {
  display: inline-block;
  margin-top: 16px;
  color: #315fcf;
  font-weight: 800;
  text-decoration: none;
}

.guide-link:hover {
  text-decoration: underline;
}

.panel {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #dbe5fa;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 35px rgb(44 75 139 / 8%);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  color: #2b3c5d;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd8ef;
  border-radius: 10px;
  color: #172744;
  outline: none;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: #4c76e5;
  box-shadow: 0 0 0 4px rgb(76 118 229 / 12%);
}

small {
  color: #7184a5;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.options,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #465b7c;
  font-size: 14px;
}

.toggle input {
  width: 16px;
  height: 16px;
}

.interval-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #465b7c;
  font-size: 14px;
}

.interval-field input {
  width: 76px;
  padding: 7px 9px;
}

.actions {
  margin-top: 28px;
}

button {
  border: 0;
  border-radius: 10px;
  background: #315fcf;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 22px;
}

button:hover:not(:disabled) {
  background: #234eae;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.secondary {
  background: #edf2fc;
  color: #38527d;
}

.status-message {
  min-height: 22px;
  margin: 20px 0 0;
  color: #6d7f9f;
}

.status-message.loading {
  color: #315fcf;
}

.status-message.success {
  color: #178049;
}

.status-message.error {
  color: #c52d45;
}

.batch-query {
  display: flex;
  gap: 14px;
  align-items: end;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #e2e9f7;
}

.batch-field {
  flex: 1;
  margin: 0;
}

.batch-query button {
  flex: 0 0 auto;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.summary {
  color: #587092;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-card {
  position: relative;
  padding: 20px;
  border: 1px solid #dce5f7;
  border-radius: 12px;
  background: #fbfcff;
}


.task-status {
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 999px;
  background: #eef2f9;
  color: #637795;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
}

.task-status.success {
  background: #e3f8ec;
  color: #08783e;
}

.task-status.failed {
  background: #ffeaed;
  color: #b3263a;
}

.task-status.processing,
.task-status.queued {
  background: #e5edff;
  color: #315fcf;
}

.source-link {
  overflow: hidden;
  color: #677c9e;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content,
.raw-response pre {
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  background: #17233a;
  color: #dbe8ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 14px;
  white-space: pre-wrap;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.result-subtitle-title {
  margin: 16px 0 8px;
  color: #38527d;
}

.subtitle-content {
  max-height: 260px;
}

.download-link {
  border: 1px solid #cbd8ef;
  border-radius: 8px;
  color: #315fcf;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  text-decoration: none;
}

.download-link:hover {
  background: #e9effe;
}

.empty-result {
  margin: 0;
  color: #627695;
}

.raw-response {
  margin-top: 22px;
}

.raw-response summary {
  cursor: pointer;
  color: #486693;
  font-weight: 700;
  padding: 8px 0;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 30px;
}

.doc-header h1 {
  margin-bottom: 10px;
}

.doc-header p {
  max-width: 700px;
  margin-bottom: 0;
}

.back-link {
  flex: 0 0 auto;
  color: #315fcf;
  font-weight: 800;
  text-decoration: none;
}

.doc-section + .doc-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e2e9f7;
}

.doc-section h2 {
  margin-bottom: 12px;
}

.doc-section p,
.doc-list {
  color: #465b7c;
  line-height: 1.7;
}

.doc-list {
  margin: 0;
  padding-left: 22px;
}

.doc-list li + li {
  margin-top: 7px;
}

.code-block {
  overflow: auto;
  margin: 16px 0 0;
  border-radius: 8px;
  background: #17233a;
  color: #dbe8ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  white-space: pre;
}

.inline-code {
  border-radius: 4px;
  background: #edf2fc;
  color: #294e9c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 5px;
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1080px);
    padding: 34px 0;
  }

  .result-heading {
    align-items: start;
    flex-direction: column;
  }

  .doc-header {
    align-items: start;
    flex-direction: column-reverse;
  }

  .batch-query {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-query button {
    width: 100%;
  }

  .task-status {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
  }
}
