:root {
  color-scheme: light;
  --ink: #17231e;
  --muted: #66736d;
  --line: #dfe7e2;
  --paper: #f5f8f6;
  --surface: #ffffff;
  --green: #145b3f;
  --green-soft: #e2f1e9;
  --orange: #e87a2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, #e7f3ec 0, transparent 32rem),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.status-badge {
  flex: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-badge.preview {
  background: #fff0e4;
  color: #a9490f;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 44px 0 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(255 255 255 / 70%);
  overflow: hidden;
}

.metrics div {
  display: grid;
  gap: 5px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong {
  font-size: 30px;
}

.metrics span,
.hint,
.score,
.coverage-note {
  color: var(--muted);
  font-size: 13px;
}

.coverage-note {
  margin: 0 0 22px;
}

.ask-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgb(25 63 45 / 7%);
}

.ask-panel {
  padding: 28px;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid #cad6cf;
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

button {
  align-self: stretch;
  min-width: 150px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: white;
  padding: 0 24px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #0d472f;
}

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

.hint {
  margin: 12px 0 0;
}

.result-panel {
  margin-top: 22px;
  padding: 30px;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-heading h2,
.result-panel h3 {
  margin: 0;
}

#answer-mode {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.answer {
  margin: 18px 0 28px;
  white-space: pre-wrap;
  line-height: 1.8;
}

.citations {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.citations article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fafcfb;
}

.citation-heading {
  color: var(--green);
  font-weight: 800;
}

.citations p {
  margin: 9px 0;
  color: #3f4d46;
  line-height: 1.65;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .shell {
    padding-top: 30px;
  }

  .hero,
  .input-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-badge {
    justify-self: start;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics div:nth-child(2) {
    border-right: 0;
  }

  .metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  button {
    min-height: 52px;
  }
}
