:root {
  --page: #f5faf6;
  --panel: #ffffff;
  --panel-soft: #edf7ef;
  --green: #1f8a4c;
  --green-dark: #126437;
  --green-light: #dff3e5;
  --line: #cfe3d4;
  --text: #173323;
  --muted: #668274;
  --warning: #f3a935;
  --shadow: 0 14px 36px rgba(31, 93, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0, var(--page) 260px),
    var(--page);
}

button,
code,
pre,
table,
input {
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei", monospace;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

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

.eyebrow,
.section-title p {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 0;
  color: var(--green-dark);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 900;
}

h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.status-strip {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.ordered-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: #fff;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(31, 138, 76, 0.08);
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.hero-panel,
.content-grid,
.bottom-grid {
  display: grid;
  gap: 18px;
}

.hero-panel {
  grid-template-columns: minmax(440px, 1.35fr) minmax(320px, 0.9fr);
  margin-bottom: 18px;
}

.content-grid {
  grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
  margin-bottom: 18px;
}

.bottom-grid {
  grid-template-columns: minmax(340px, 0.72fr) minmax(560px, 1.28fr);
}

.panel,
.live-card,
.query-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel,
.live-card,
.query-card {
  padding: 22px;
}

.section-title {
  margin-bottom: 18px;
}

.compact-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.live-card .section-title {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.temperature-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 230px;
  border: 1px solid #bfe1c9;
  border-radius: 10px;
  color: var(--green-dark);
  background: linear-gradient(180deg, #f2fbf4, #e3f5e8);
  text-align: center;
}

.temperature-main span {
  font-size: clamp(78px, 9vw, 132px);
  line-height: 1;
  font-weight: 900;
}

.temperature-main small {
  transform: translateY(12px);
  color: var(--green);
  font-size: 40px;
  font-weight: 900;
}

.live-meta {
  display: grid;
  gap: 12px;
}

.live-meta div,
.query-result,
.info-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfefc;
}

.live-meta div {
  padding: 17px;
}

.live-meta span,
.query-form label,
.info-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.live-meta strong {
  color: var(--green-dark);
  font-size: 24px;
}

.helper-text {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.query-form {
  margin-bottom: 16px;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 10px;
}

.query-row input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 18px;
  outline: none;
}

.query-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--green);
  cursor: pointer;
}

button:hover {
  background: var(--green-dark);
}

.query-result {
  min-height: 132px;
  padding: 18px;
}

.query-result span {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-light);
  font-size: 13px;
  font-weight: 800;
}

.query-result strong {
  display: block;
  margin-bottom: 9px;
  color: var(--green-dark);
  font-size: 30px;
}

.query-result p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.query-result.miss span {
  color: #8a5c05;
  background: #fff3d7;
}

.query-result.empty span {
  color: #8c2f24;
  background: #ffe4df;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 10px;
  min-height: 88px;
  padding: 14px;
}

.info-item span,
.info-item code {
  grid-column: 1;
}

.info-item code {
  overflow: hidden;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-item button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 42px;
  align-self: center;
}

.info-item.featured {
  border-color: #8acb9d;
  background: #f0faf3;
}

.chart-shell {
  height: 278px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfefc;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.json-sample {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: #f7fcf8;
  line-height: 1.6;
  white-space: pre-wrap;
}

.field-list {
  display: grid;
  gap: 9px;
}

.field-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.field-list code {
  color: var(--green-dark);
  font-weight: 900;
}

.field-list span {
  color: var(--muted);
  font-weight: 700;
}

.records-wrap {
  max-height: 333px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 15px;
}

th {
  color: var(--green-dark);
  background: var(--green-light);
}

td {
  color: var(--text);
}

td code {
  color: var(--green-dark);
  font-weight: 800;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  font-weight: 900;
  background: var(--green-light);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  opacity: 0;
  transform: translateY(12px);
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-dark);
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .topbar,
  .compact-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel,
  .content-grid,
  .bottom-grid,
  .live-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 720px);
    padding-top: 14px;
  }

  .status-strip,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .info-grid,
  .query-row {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .info-item button {
    grid-column: 1;
    grid-row: auto;
  }

  th,
  td {
    padding: 11px 8px;
    font-size: 13px;
  }
}
