:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --ink: #17201b;
  --muted: #5f6f66;
  --line: #d9e0dc;
  --blue: #255c99;
  --green: #24745a;
  --red: #b24b43;
  --gold: #9f6c1f;
  --shadow: 0 16px 40px rgba(23, 32, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(37, 92, 153, 0.08), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 18px;
}

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

h1 {
  font-size: clamp(2.1rem, 4vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow,
.kicker {
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rate-chip {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 42px;
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.intro p {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.official-price {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 150px;
  border-left: 4px solid var(--green);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 22px;
}

.official-price span {
  color: var(--muted);
  font-size: 0.88rem;
}

.official-price strong {
  font-size: 1.65rem;
  line-height: 1;
}

.official-price a {
  font-size: 0.86rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(330px, max-content) max-content;
  align-items: end;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.search-box,
.plan-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

button {
  align-self: end;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  border-color: var(--green);
  color: var(--green);
}

button:disabled {
  cursor: progress;
  opacity: 0.64;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(36, 116, 90, 0.2);
  border-color: var(--green);
}

.plan-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.plan-button {
  align-self: stretch;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border-color: var(--line);
  background: #f7faf8;
  color: var(--muted);
}

.refresh-button {
  min-width: 132px;
}

.plan-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.plan-button.active:hover {
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 20px 28px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  font-size: 1.45rem;
  line-height: 1.1;
}

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

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf8;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
}

tbody tr:hover {
  background: #f8fbfa;
}

.market-cell {
  display: grid;
  gap: 3px;
}

.market-cell strong {
  font-size: 0.96rem;
}

.market-cell span {
  color: var(--muted);
  font-size: 0.8rem;
}

.num {
  font-variant-numeric: tabular-nums;
}

.price-cell {
  display: grid;
  gap: 3px;
  min-width: 92px;
}

.price-cell strong {
  color: var(--ink);
  font-size: 0.92rem;
  white-space: nowrap;
}

.price-cell span {
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
}

.price-cell.empty strong,
.price-cell.empty span {
  color: var(--muted);
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef4f2;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.delta-pill.up {
  background: #fff1ef;
  color: var(--red);
}

.delta-pill.down {
  background: #eef7f3;
  color: var(--green);
}

.rightmost,
td.rightmost {
  text-align: right;
}

td.rightmost {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 34px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.footer-rate {
  margin-top: 6px;
  color: var(--ink);
  font-weight: 750;
}

@media (max-width: 860px) {
  .topbar,
  .intro,
  .controls,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .intro,
  .controls {
    padding: 22px;
  }

  .plan-buttons,
  .refresh-button {
    width: 100%;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    padding: 13px 14px;
  }

  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  .official-price {
    min-height: auto;
  }

  .metric {
    border-right: 0;
  }

  .metric {
    border-bottom: 1px solid var(--line);
    padding: 17px 22px;
  }

  .metric:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 540px) {
  main,
  .topbar,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.35rem;
  }
}
