:root {
  color-scheme: dark;
  --bg: #07100d;
  --surface: #0b1713;
  --surface-2: #0f1e19;
  --surface-3: #13241e;
  --line: rgba(203, 229, 218, 0.1);
  --line-strong: rgba(203, 229, 218, 0.18);
  --text: #f2f7f4;
  --muted: #8ca199;
  --muted-2: #62766e;
  --accent: #68e6a8;
  --accent-deep: #153d2c;
  --negative: #ff7c83;
  --negative-deep: #3b1e22;
  --warning: #f5c96a;
  --radius-card: 14px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --font-sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 78, 59, 0.1), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.12;
}

.ambient-one {
  top: -18rem;
  right: -10rem;
  background: #58dba0;
}

.ambient-two {
  top: 38rem;
  left: -28rem;
  background: #2a8a62;
}

.shell {
  width: min(1380px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 66px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 13, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 32px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.market-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.market-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(104, 230, 168, 0.08);
}

.refresh-button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.refresh-button:hover {
  border-color: rgba(104, 230, 168, 0.35);
  background: var(--surface-3);
}

.refresh-button:active {
  transform: translateY(1px);
}

.refresh-button[disabled] {
  cursor: wait;
  color: var(--muted);
}

.main {
  padding-top: 54px;
  padding-bottom: 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding-bottom: 38px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

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

h1 {
  max-width: 1080px;
  margin-bottom: 17px;
  font-size: clamp(40px, 4.7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.asof-panel {
  min-width: 224px;
  padding: 18px 20px;
  border-left: 1px solid var(--line-strong);
}

.asof-panel span,
.asof-panel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.asof-panel strong {
  display: block;
  margin: 6px 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 650;
}

.metrics {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.metric {
  min-height: 136px;
  padding: 24px;
  border-left: 1px solid var(--line);
}

.metric:first-child {
  border-left: 0;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  min-height: 45px;
  margin: 9px 0 5px;
  font-family: var(--font-mono);
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.045em;
}

.metric-primary {
  background:
    linear-gradient(135deg, rgba(104, 230, 168, 0.12), transparent 66%),
    var(--surface);
}

.metric-primary strong {
  color: var(--accent);
}

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

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.segment {
  min-width: 62px;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.segment.active {
  background: var(--accent);
  color: #07130e;
}

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

.select-wrap select,
.search-wrap input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.select-wrap select {
  min-width: 128px;
  padding: 0 34px 0 13px;
  cursor: pointer;
}

.search-wrap input {
  width: 190px;
  padding: 0 14px;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

.list-section {
  min-height: 500px;
}

.list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.list-heading h2 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.list-heading p,
.list-heading > span {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.desktop-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(11, 23, 19, 0.78);
}

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

.performance-table th {
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.performance-table th:first-child,
.performance-table th:nth-child(2),
.performance-table th:nth-child(3) {
  text-align: left;
}

.performance-table th:first-child {
  width: 15%;
}

.performance-table th:nth-child(2) {
  width: 7%;
}

.performance-table th:nth-child(3) {
  width: 12%;
}

.performance-table th:nth-child(8) {
  width: 11%;
}

.performance-table th:last-child {
  width: 5%;
}

.performance-table td {
  height: 74px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  vertical-align: middle;
}

.performance-table tr:last-child td {
  border-bottom: 0;
}

.performance-table tbody tr {
  transition: background 160ms ease;
}

.performance-table tbody tr:hover {
  background: rgba(104, 230, 168, 0.035);
}

.performance-table td:first-child,
.performance-table td:nth-child(2),
.performance-table td:nth-child(3) {
  text-align: left;
}

.token-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
}

.token-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(104, 230, 168, 0.18);
  border-radius: 50%;
  background: var(--accent-deep);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.token-name {
  min-width: 0;
}

.token-name strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-name small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.badge {
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 650;
}

.badge-spot {
  background: var(--accent-deep);
  color: var(--accent);
}

.badge-contract {
  background: #2f2a16;
  color: var(--warning);
}

.date-cell {
  color: var(--text);
  font-family: var(--font-sans) !important;
}

.date-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.price-muted {
  color: var(--muted);
}

.change {
  display: inline-block;
  min-width: 72px;
  font-weight: 700;
}

.positive {
  color: var(--accent);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--muted);
}

.sparkline {
  display: block;
  width: 96px;
  height: 32px;
  margin-left: auto;
  overflow: visible;
}

.sparkline path {
  vector-effect: non-scaling-stroke;
}

.detail-link {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.detail-link:hover {
  border-color: rgba(104, 230, 168, 0.35);
  color: var(--accent);
}

.mobile-cards {
  display: none;
}

.empty-state {
  padding: 72px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

footer {
  padding-top: 28px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.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;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 1080px) {
  .shell {
    width: min(100% - 32px, 960px);
  }

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

  .metric:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .performance-table th:nth-child(4),
  .performance-table td:nth-child(4),
  .performance-table th:nth-child(8),
  .performance-table td:nth-child(8) {
    display: none;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 680px);
  }

  .topbar {
    height: 60px;
  }

  .market-status {
    display: none;
  }

  .main {
    padding-top: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 30px;
  }

  h1 {
    max-width: 620px;
    font-size: clamp(38px, 11vw, 54px);
    line-height: 1.05;
  }

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

  .asof-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    min-width: 0;
    padding: 15px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .asof-panel strong {
    margin: 0;
    text-align: right;
  }

  .asof-panel small {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

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

  .metric {
    min-height: 118px;
    padding: 19px 17px;
  }

  .metric strong {
    min-height: 34px;
    font-size: 26px;
  }

  .control-bar {
    display: block;
    margin-bottom: 30px;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 10px;
  }

  .select-wrap select,
  .search-wrap input {
    width: 100%;
    min-width: 0;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .list-heading {
    align-items: start;
  }

  .list-heading p {
    max-width: 260px;
    line-height: 1.5;
  }

  .desktop-table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 10px;
  }

  .mobile-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: rgba(11, 23, 19, 0.84);
  }

  .mobile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-card-head .token-cell {
    flex: 1;
  }

  .mobile-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 14px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .mobile-stat span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-stat strong {
    font-family: var(--font-mono);
    font-size: 15px;
  }

  .mobile-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
  }

  .mobile-card-foot .sparkline {
    width: 120px;
    margin: 0;
  }
}

@media (max-width: 420px) {
  .shell {
    width: calc(100% - 22px);
  }

  .brand img {
    height: 28px;
  }

  .refresh-button {
    padding-inline: 13px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric:first-child {
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
