:root {
  color-scheme: dark;
  --bg: #071113;
  --panel: #101b1f;
  --panel-2: #13272b;
  --text: #eef7f4;
  --muted: #9fb3b1;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #39d98a;
  --accent-2: #4cc9f0;
  --warn: #ffd166;
  --bad: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(57, 217, 138, 0.2), transparent 32rem),
    linear-gradient(135deg, #071113 0%, #0a171e 48%, #101514 100%);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 31, 0.84);
  box-shadow: var(--shadow);
}

.top-actions {
  position: absolute;
  top: 18px;
  right: 18px;
}

.language-toggle {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 96px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: contain;
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.brand p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.query-panel {
  display: grid;
  gap: 14px;
}

label,
.eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

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

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081215;
  color: var(--text);
  outline: none;
}

input {
  padding: 0 16px;
}

select {
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 217, 138, 0.18);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #061012;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.tools-row {
  display: grid;
  grid-template-columns: 1fr 92px 92px;
  gap: 10px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
}

.hidden-ui {
  display: none !important;
}

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

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 31, 0.76);
}

.stat-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
}

.stat-card p {
  color: var(--muted);
  line-height: 1.6;
}

.tron-info-card {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 31, 0.76);
}

.tron-info-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.tron-info-grid {
  display: grid;
  align-content: center;
  gap: 10px;
}

.tron-info-grid p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.tron-info-grid p span:last-child {
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.transactions-panel {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 31, 0.76);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.collect-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.tab-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #061012;
}

.tab-button.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.section-head h2 {
  margin-top: 6px;
  font-size: 24px;
}

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

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.pager span {
  min-width: 96px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

td {
  color: var(--text);
  font-size: 14px;
}

.hash-link,
.copy-value {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: 700;
  text-align: left;
  transform: none;
}

.hash-link {
  color: var(--accent-2);
  text-decoration: none;
  word-break: break-all;
}

.address-text {
  color: var(--text);
  word-break: break-all;
}

.copy-value:hover {
  text-decoration: underline;
  transform: none;
}

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

.direction-out {
  color: var(--warn);
  font-weight: 800;
}

.direction-self,
.direction-unknown {
  color: var(--muted);
  font-weight: 800;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.result-card {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 27, 31, 0.76);
}

.main-result {
  display: grid;
  align-content: start;
  gap: 14px;
}

.main-result h2 {
  font-size: 26px;
}

.link-list,
.sample-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.link-list a,
.sample-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.sample-list button {
  width: 100%;
  text-align: left;
}

.link-list a::after {
  content: "打开";
  color: var(--accent);
  font-size: 13px;
}

.status-ok {
  border-color: rgba(57, 217, 138, 0.42);
}

.status-warn {
  border-color: rgba(255, 209, 102, 0.5);
}

.status-bad {
  border-color: rgba(255, 107, 107, 0.5);
}

@media (max-width: 760px) {
  body {
    background: #071113;
  }

  .shell {
    width: min(100% - 14px, 1120px);
    padding: 8px 0 18px;
  }

  .hero {
    gap: 18px;
    padding: 16px;
    padding-top: 62px;
    border-radius: 8px;
  }

  .top-actions {
    top: 14px;
    right: 14px;
  }

  .language-toggle {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .brand {
    gap: 12px;
    padding-right: 72px;
  }

  .brand-logo {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 24px;
    line-height: 1;
  }

  .brand p {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.45;
  }

  label,
  .eyebrow {
    font-size: 13px;
  }

  .query-row,
  .tools-row,
  .result-grid,
  .stats-grid,
  .tx-tabs {
    grid-template-columns: 1fr;
  }

  input,
  select,
  button {
    min-height: 46px;
  }

  input {
    padding: 0 12px;
    font-size: 15px;
  }

  .tools-row {
    grid-template-columns: 1fr 1fr;
  }

  .tools-row select {
    grid-column: 1 / -1;
  }

  .stats-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .tron-info-card {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
  }

  .tron-info-card strong {
    display: none;
  }

  .tron-info-grid {
    gap: 6px;
  }

  .tron-info-grid p {
    font-size: 13px;
    line-height: 1.35;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card strong {
    margin: 7px 0 6px;
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .stat-card p {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
  }

  .transactions-panel {
    margin-top: 10px;
    padding: 14px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-head h2 {
    margin-top: 4px;
    font-size: 21px;
  }

  .collect-status {
    justify-content: center;
    min-height: 36px;
    width: 100%;
    font-size: 13px;
  }

  .tx-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  .tab-button {
    min-height: 42px;
    font-size: 14px;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(19, 39, 43, 0.72);
  }

  td {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 10px;
    padding: 7px 0;
    border: 0;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .hash-link {
    word-break: break-all;
  }

  .empty-cell {
    display: block;
    padding: 18px 8px;
    text-align: center;
  }

  .empty-cell::before {
    content: none;
  }

  .pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .pager span {
    min-width: 72px;
    align-self: center;
    font-size: 13px;
  }

  .pager button {
    min-height: 42px;
    font-size: 14px;
  }

  .brand {
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .hero {
    padding-top: 58px;
  }

  .brand {
    padding-right: 0;
  }

  .top-actions {
    top: 12px;
    right: 12px;
  }

  h1 {
    font-size: 22px;
  }

  .tx-tabs,
  .pager {
    grid-template-columns: 1fr;
  }

  .pager span {
    order: -1;
    justify-self: center;
  }
}
