:root {
  color-scheme: light;
  --ink: #19283d;
  --muted: #68758a;
  --line: #dde5f0;
  --line-strong: #cfd9e7;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --page: #f3f7ff;
  --blue: #4d8ff7;
  --blue-deep: #3377e5;
  --green: #42a56f;
  --amber: #d8952d;
  --red: #db5b64;
  --shadow: 0 18px 55px rgba(70, 101, 145, 0.11);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfdff 0, #f3f7ff 36%, #eef5ff 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
  opacity: 0.32;
}

.ambient-one {
  top: -20rem;
  right: -8rem;
  background: radial-gradient(circle, #a9c9ff, transparent 68%);
}

.ambient-two {
  bottom: -26rem;
  left: -12rem;
  background: radial-gradient(circle, #b9e8ff, transparent 68%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1840px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 30px;
}

.topbar,
.hero,
.control-panel,
.summary-card,
.table-panel {
  border: 1px solid rgba(214, 224, 238, 0.92);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 20px;
  border-radius: 20px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #66a6ff, #447ff1);
  box-shadow: 0 9px 20px rgba(68, 127, 241, 0.28);
}

.brand-mark svg,
.update-icon svg,
.search-box svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.cache-pill,
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.cache-pill {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #dce6f3;
  border-radius: 999px;
  color: #4f6077;
  background: #f7faff;
  font-size: 13px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8da0b8;
  box-shadow: 0 0 0 4px rgba(141, 160, 184, 0.13);
}

[data-status="fresh"] .status-dot {
  background: #49ad77;
  box-shadow: 0 0 0 4px rgba(73, 173, 119, 0.14);
}

[data-status="partial"] .status-dot,
[data-status="stale"] .status-dot {
  background: #e0a13e;
  box-shadow: 0 0 0 4px rgba(224, 161, 62, 0.14);
}

[data-status="error"] .status-dot {
  background: #df626a;
  box-shadow: 0 0 0 4px rgba(223, 98, 106, 0.14);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: 16px;
  padding: 30px 32px;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.97) 0%, rgba(247, 251, 255, 0.96) 55%, rgba(232, 242, 255, 0.92) 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: #3273cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.update-note {
  display: flex;
  min-width: 340px;
  gap: 13px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(108, 157, 229, 0.24);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
}

.update-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: #eaf3ff;
}

.update-note strong,
.update-note span {
  display: block;
}

.update-note strong {
  font-size: 14px;
}

.update-note div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 20px;
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fc;
}

.tab {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #5d697b;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tab:hover {
  color: var(--blue-deep);
}

.tab:focus-visible,
.search-box:focus-within {
  outline: 3px solid rgba(77, 143, 247, 0.22);
  outline-offset: 2px;
}

.tab.is-active {
  color: var(--blue-deep);
  background: white;
  box-shadow: 0 4px 15px rgba(67, 100, 147, 0.11);
}

.range-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.meta-divider {
  width: 1px;
  height: 15px;
  background: var(--line-strong);
}

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

.summary-card {
  position: relative;
  min-height: 164px;
  padding: 20px;
  overflow: hidden;
  border-radius: 20px;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #5e6b7e;
  font-size: 14px;
  font-weight: 720;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
}

.metric-value {
  display: block;
  margin-top: 19px;
  font-size: clamp(27px, 2.4vw, 37px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.metric-caption {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.spark {
  position: absolute;
  right: -7px;
  bottom: 18px;
  width: 104px;
  height: 34px;
  border-top: 3px solid currentColor;
  border-radius: 50% 44% 0 0;
  opacity: 0.1;
  transform: rotate(-7deg);
}

.spark::after {
  position: absolute;
  top: -9px;
  right: 17px;
  width: 50px;
  height: 27px;
  border-top: 3px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: rotate(19deg);
}

.accent-blue .metric-icon { color: #387be7; background: #e9f1ff; }
.accent-blue .metric-value, .accent-blue .spark { color: #377ce7; }
.accent-violet .metric-icon { color: #7a65d8; background: #f0edff; }
.accent-violet .metric-value, .accent-violet .spark { color: #745fd1; }
.accent-cyan .metric-icon { color: #299fc1; background: #e8f8fc; }
.accent-cyan .metric-value, .accent-cyan .spark { color: #2995b4; }
.accent-amber .metric-icon { color: #d38b20; background: #fff4e2; }
.accent-amber .metric-value, .accent-amber .spark { color: #c98522; }
.accent-green .metric-icon { color: #379c64; background: #e8f7ee; }
.accent-green .metric-value, .accent-green .spark { color: #3c9e68; }

.table-panel {
  margin-top: 16px;
  overflow: hidden;
  border-radius: 23px;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
}

.table-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.search-box {
  display: flex;
  width: min(390px, 42vw);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #8190a4;
  background: #fbfcfe;
}

.search-box svg {
  width: 19px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: #708097;
}

.status-banner {
  margin: 0 24px 16px;
  padding: 10px 13px;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  color: #657287;
  background: #f7faff;
  font-size: 12px;
  font-weight: 620;
}

.status-banner[data-status="partial"],
.status-banner[data-status="stale"] {
  border-color: #efdfbd;
  color: #8b671f;
  background: #fffaf0;
}

.status-banner[data-status="error"] {
  border-color: #f0d2d4;
  color: #a33d46;
  background: #fff6f6;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid #edf1f6;
  scrollbar-color: #cfd9e7 transparent;
  scrollbar-width: thin;
}

.table-scroll:focus-visible {
  outline: 3px solid rgba(77, 143, 247, 0.25);
  outline-offset: -3px;
}

table {
  width: 100%;
  min-width: 1690px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  height: 64px;
  padding: 0 17px;
  border-bottom: 1px solid #e9eef4;
  white-space: nowrap;
}

th {
  height: 55px;
  color: #69778b;
  background: #fafbfd;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
}

th.number,
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr {
  --row-background: #fff;
  background: var(--row-background);
  transition: background 140ms ease;
}

tbody tr:nth-child(even) {
  --row-background: #fcfdff;
}

tbody tr:hover {
  --row-background: #f3f8ff;
}

tbody tr.top-rank {
  --row-background: #f4f8ff;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 66px;
  min-width: 66px;
  background: var(--row-background, #fafbfd);
}

thead th:first-child,
thead th:nth-child(2) {
  z-index: 4;
  background: #fafbfd;
}

th:nth-child(2),
td:nth-child(2) {
  position: sticky;
  left: 66px;
  z-index: 2;
  width: 220px;
  min-width: 220px;
  background: var(--row-background, #fafbfd);
  box-shadow: 10px 0 16px -16px rgba(36, 55, 81, 0.5);
}

.rank-badge {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  color: #65748a;
  background: white;
  font-weight: 780;
}

.rank-badge.rank-1 { color: #a56d12; border-color: #f0d9a8; background: #fff8e9; }
.rank-badge.rank-2 { color: #65738a; border-color: #d6dee9; background: #f6f8fb; }
.rank-badge.rank-3 { color: #a76740; border-color: #ead0c1; background: #fff5ef; }

.key-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.key-symbol {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #397ddb;
  background: #eaf3ff;
  font-size: 11px;
  font-weight: 850;
}

.key-name {
  max-width: 155px;
  overflow: hidden;
  font-weight: 720;
  text-overflow: ellipsis;
}

.token-value {
  color: #34445b;
  font-weight: 650;
}

.rate {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 65px;
  color: #26754b;
  font-weight: 720;
}

.rate.is-low {
  color: #c35e65;
}

.failure-count {
  color: #bd525b;
  font-weight: 720;
}

.share-cell {
  min-width: 150px;
}

.share-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-track {
  appearance: none;
  -webkit-appearance: none;
  width: 78px;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e9eff7;
}

.share-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #e9eff7;
}

.share-track::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, #69a8ff, #4d87ee);
}

.share-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #69a8ff, #4d87ee);
}

.share-text {
  min-width: 49px;
  color: #526178;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.loading-row td,
.empty-row td {
  height: 130px;
  color: var(--muted);
  text-align: center;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 24px;
  color: #8290a3;
  background: #fbfcfe;
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 6px 0;
  color: #66758a;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1220px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card:nth-child(4),
  .summary-card:nth-child(5) {
    min-height: 145px;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 1840px);
    padding-top: 12px;
  }

  .topbar {
    min-height: 66px;
    border-radius: 17px;
  }

  .brand small {
    display: none;
  }

  .cache-pill {
    max-width: 48vw;
    overflow: hidden;
  }

  .cache-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    display: block;
    padding: 24px 22px;
  }

  .update-note {
    min-width: 0;
    margin-top: 20px;
  }

  .control-panel {
    display: block;
    overflow: hidden;
  }

  .tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    min-width: 105px;
    flex: 1 0 auto;
    padding: 0 13px;
  }

  .range-meta {
    justify-content: flex-start;
    margin: 12px 4px 2px;
    text-align: left;
  }

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

  .summary-card {
    min-height: 146px;
  }

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

  .search-box {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 16px, 1840px);
    padding-bottom: 18px;
  }

  .topbar,
  .hero,
  .control-panel,
  .summary-card,
  .table-panel {
    box-shadow: 0 10px 35px rgba(70, 101, 145, 0.09);
  }

  .topbar {
    padding: 11px 13px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 15px;
  }

  .cache-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .hero {
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .hero-copy {
    font-size: 13px;
  }

  .update-note {
    padding: 13px;
  }

  .update-note strong {
    font-size: 13px;
  }

  .update-note div > span {
    line-height: 1.5;
  }

  .control-panel {
    padding: 10px;
    border-radius: 17px;
  }

  .range-meta {
    display: grid;
    gap: 4px;
  }

  .meta-divider {
    display: none;
  }

  .summary-grid {
    gap: 10px;
  }

  .summary-card,
  .summary-card:nth-child(4),
  .summary-card:nth-child(5) {
    min-height: 132px;
    padding: 15px;
    border-radius: 17px;
  }

  .card-label {
    gap: 7px;
    font-size: 12px;
  }

  .metric-icon {
    width: 27px;
    height: 27px;
  }

  .metric-value {
    margin-top: 15px;
    font-size: 25px;
  }

  .metric-caption {
    margin-top: 8px;
    font-size: 10px;
  }

  .spark {
    display: none;
  }

  .summary-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  .table-heading {
    padding: 20px 16px 15px;
  }

  .status-banner {
    margin: 0 16px 14px;
  }

  .table-footer {
    padding: 0 16px;
  }

  th:first-child,
  td:first-child,
  th:nth-child(2),
  td:nth-child(2) {
    position: static;
    box-shadow: none;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 180px;
    min-width: 180px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
