:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #17201f;
  --muted: #62706d;
  --line: #dce5e2;
  --accent: #126e66;
  --accent-strong: #0b514b;
  --gold: #c7892b;
  --danger: #a33d3d;
  --shadow: 0 18px 48px rgba(21, 42, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(199, 137, 43, 0.14), transparent 28rem),
    linear-gradient(135deg, #eef4f2 0%, #f8faf9 48%, #edf2ef 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.rate-box,
.query-panel,
.metric-card,
.table-shell,
.status-line {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.rate-box {
  min-width: 190px;
  padding: 16px 18px;
  border-radius: 8px;
  text-align: right;
}

.rate-box span,
.metric-card span,
.section-title span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.rate-box strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 22px;
}

.query-panel {
  padding: 20px;
  border-radius: 8px;
}

.query-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

input {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 110, 102, 0.14);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--accent-strong);
}

.status-line {
  display: none;
  margin: 16px 0;
  padding: 13px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status-line.warning {
  display: block;
  border-color: rgba(163, 61, 61, 0.28);
  color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 116px;
  padding: 18px;
  border-radius: 8px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.15;
}

.table-shell {
  border-radius: 8px;
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td.hash {
  max-width: 280px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.amount-in {
  color: var(--accent-strong);
  font-weight: 800;
}

.amount-out {
  color: var(--danger);
  font-weight: 800;
}

.empty {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 18px;
  }

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

  .rate-box {
    text-align: left;
  }

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

  .metric-card {
    min-height: 94px;
  }
}

@media (max-width: 640px) {
  .table-scroll {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    padding: 8px 0;
  }

  tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
    font-size: 13px;
  }

  td::before {
    color: var(--muted);
    font-weight: 800;
  }

  td:nth-child(1)::before {
    content: "时间";
  }

  td:nth-child(2)::before {
    content: "方向";
  }

  td:nth-child(3)::before {
    content: "金额";
  }

  td:nth-child(4)::before {
    content: "确认数";
  }

  td:nth-child(5)::before {
    content: "哈希";
  }

  td.hash {
    max-width: none;
  }

  .empty {
    display: block;
    text-align: center;
  }

  .empty::before {
    content: "";
  }
}
