:root {
  --bg: #080b11;
  --bg-soft: #0b111a;
  --panel: #0e1520;
  --panel-2: #111a26;
  --line: #1b2735;
  --line-soft: #16202d;
  --text: #dce6f2;
  --muted: #8494a8;
  --dim: #5d6b7d;
  --accent: #34d399;
  --accent-2: #22d3ee;
  --danger: #f87171;
  --warn: #fbbf24;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 420px at 12% -10%, rgba(52, 211, 153, 0.10), transparent 60%),
    radial-gradient(700px 380px at 92% -14%, rgba(34, 211, 238, 0.08), transparent 62%);
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #9ad7ff; text-decoration: none; }
a:hover { color: #c9ecff; text-decoration: underline; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.1px; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 11, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--dim);
  text-transform: uppercase;
  margin-left: 2px;
}
.mark {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
}

.search { flex: 1 1 auto; display: flex; min-width: 0; max-width: 560px; }
.search input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: #2c4a44; background: #0f1822; }
.search button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.search button:hover { background: #17222f; }

.chains { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chains::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #888); opacity: 0.75; }
.chip:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.chip.active { color: #fff; border-color: var(--c, var(--line)); background: color-mix(in srgb, var(--c, #888) 12%, transparent); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  margin-left: 2px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}
.lang-switch:hover { color: var(--text); border-color: #2b3a4d; text-decoration: none; }

.chip.active i { opacity: 1; box-shadow: 0 0 8px var(--c, #888); }

/* ---------- content ---------- */
main.wrap { flex: 1; padding: 30px 20px 64px; }

.hero { margin: 6px 0 22px; }
.crumb { font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.crumb a { color: var(--muted); }
.crumb b { margin: 0 7px; color: #2c3a4b; font-weight: 400; }
.crumb span { color: var(--muted); }

.hero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.3px;
  word-break: break-all;
}
.hero .sub { margin-top: 6px; color: var(--muted); word-break: break-all; font-size: 12.5px; }
.badges { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}
.badge.ok { color: #6ee7b7; border-color: #14532d; background: rgba(20, 83, 45, 0.35); }
.badge.bad { color: #fca5a5; border-color: #7f1d1d; background: rgba(127, 29, 29, 0.3); }
.badge.warn { color: #fcd34d; border-color: #78350f; background: rgba(120, 53, 15, 0.3); }

/* ---------- notice / form / actions ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }

.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  background: var(--panel);
}
.notice.ok { border-color: #14532d; background: rgba(20, 83, 45, 0.22); }
.notice.bad { border-color: #7f1d1d; background: rgba(127, 29, 29, 0.2); }
.notice.warn { border-color: #78350f; background: rgba(120, 53, 15, 0.2); }
.notice-title { font-weight: 650; font-size: 14px; margin-bottom: 4px; }
.notice.ok .notice-title { color: #6ee7b7; }
.notice.bad .notice-title { color: #fca5a5; }
.notice.warn .notice-title { color: #fcd34d; }
.notice-body { color: var(--muted); font-size: 13px; word-break: break-all; }

.inline-form {
  display: flex;
  gap: 0;
  margin: 0 0 18px;
  max-width: 620px;
}
.inline-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.inline-form input:focus { border-color: #2c4a44; }
.inline-form input::placeholder { color: var(--dim); }
.inline-form.multi { max-width: 760px; }
.inline-form.multi input, .inline-form.multi select {
  border-radius: 0;
  border-right: none;
  height: 40px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.inline-form.multi select { flex: 0 0 auto; cursor: pointer; }
.inline-form.multi input { flex: 1 1 160px; }
.inline-form.multi input:focus, .inline-form.multi select:focus { border-color: #2c4a44; }
.inline-form.multi input:first-child, .inline-form.multi select:first-child { border-radius: 10px 0 0 10px; }
.inline-form.multi button { border-radius: 0 10px 10px 0; }

.inline-form button {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.inline-form button:hover { background: #17222f; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.pager .muted { font-size: 12px; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .k { font-size: 11.5px; color: var(--muted); letter-spacing: 0.2px; }
.stat .v { font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; word-break: break-all; }
.stat .s { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: 0.1px; }
.panel-head .note { font-size: 11.5px; color: var(--dim); }
.panel-body { padding: 16px 18px; }

/* ---------- fields ---------- */
.fields { margin: 0; padding: 4px 18px 8px; }
.field {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.field:last-child { border-bottom: none; }
.field dt { color: var(--muted); font-size: 12.5px; }
.field dd { margin: 0; word-break: break-all; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field dd .copy {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.field:hover .copy { opacity: 1; }
.field dd .copy:hover { color: var(--text); border-color: #2b3a4d; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--dim);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  background: var(--bg-soft);
}
table.grid td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
table.grid td.cell.mono { color: #b9c9dd; }
table.grid td.empty { text-align: center; color: var(--dim); padding: 28px; }
table.grid td.num, .num { font-variant-numeric: tabular-nums; }

/* ---------- home ---------- */
.home-hero { text-align: center; margin: 24px 0 30px; }
.home-hero h1 { font-size: 32px; }
.home-hero .sub { margin-top: 10px; }

.price-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
@media (max-width: 980px) {
  .price-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .price-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  .price-strip { grid-template-columns: 1fr; }
}
.price-tile {
  display: block;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
a.price-tile:hover {
  text-decoration: none;
  border-color: #2b3a4d;
  transform: translateY(-2px);
}
.pt-top { display: flex; align-items: baseline; gap: 8px; }
.pt-sym { font-weight: 700; font-size: 13px; color: var(--c, var(--text)); font-family: var(--mono); }
.pt-name { font-size: 11.5px; color: var(--dim); }
.pt-price { font-size: 21px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pt-change { font-size: 12px; margin-top: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-change.up { color: #4ade80; }
.pt-change.down { color: #f87171; }
.pt-unit { color: var(--dim); margin-left: 6px; font-size: 11px; }
.pt-fee {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-soft);
  font-size: 11.5px;
}
.pt-fee-k { color: var(--dim); }
.pt-fee-v { color: var(--muted); font-variant-numeric: tabular-nums; }

.chain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 980px) {
  .chain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .chain-grid { grid-template-columns: 1fr; }
  .chains { gap: 4px; }
  .chip { padding: 4px 7px; font-size: 11.5px; gap: 4px; }
  .chip i { width: 5px; height: 5px; }
}
.chain-card {
  display: block;
  padding: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.chain-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--c);
  opacity: 0.85;
}
.chain-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); transform: translateY(-2px); }
.cc-top { display: flex; justify-content: space-between; align-items: center; }
.cc-name { font-size: 15px; font-weight: 650; }
.cc-sym { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.cc-height { font-size: 26px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; }
.cc-sub { font-size: 11.5px; color: var(--muted); }
.cc-desc { font-size: 12px; color: var(--dim); margin-top: 10px; }
.chain-card.is-error .cc-height { font-size: 15px; color: var(--warn); }

.home-note .prose p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.home-note .prose p:last-child { margin-bottom: 0; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.btn:hover { text-decoration: none; border-color: #2b3a4d; }

.footnote { color: var(--dim); font-size: 12px; margin: 4px 0 0; }

/* ---------- chart ---------- */
.chart-panel .chart-wrap { padding: 14px 14px 0; }
.chart-panel svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-label { fill: var(--dim); font-size: 11px; font-family: var(--mono); }
.chart-unit { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart-foot {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
  padding: 6px 20px 14px;
  color: var(--dim);
  font-size: 12px;
}
.chart-foot span { font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 12px;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .bar { height: auto; padding: 12px 20px; flex-wrap: wrap; gap: 10px; }
  .brand { order: 1; }
  .lang-switch { order: 2; margin-left: auto; }
  .chains { order: 3; flex: 1 1 100%; min-width: 0; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; overflow-x: visible; }
  .search { order: 4; flex: 1 1 100%; max-width: none; width: 100%; min-width: 0; }
  .hero h1 { font-size: 21px; }
  .home-hero h1 { font-size: 26px; }
  .field { grid-template-columns: 1fr; gap: 2px; }
  .stat .v { font-size: 18px; }
  table.grid td { max-width: 260px; }
}
