:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  color: #202b38;
  background: #fff;
  --ink: #202b38;
  --muted: #59697a;
  --line: #dde3df;
  --action: #303933;
  --action-hover: #222a25;
  --search-action: #405668;
  --search-hover: #33495a;
  --home-ink: #252d35;
  --home-muted: #60707b;
  --accent: #36574a;
  --accent-soft: #edf2ee;
  --pale: #f4f6f5;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid #667f70; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; line-height: 1.35; }
h3 { font-size: 16px; }
.shell { width: min(960px, calc(100% - 48px)); margin-inline: auto; }
.query-width { width: min(632px, calc(100% - 56px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.header, .search-area, .quotes { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--home-ink); }
.header { border-bottom: 1px solid #e8ecf0; background: #fff; }
.header-inner { width: min(1000px, calc(100% - 56px)); min-height: 61px; margin-inline: auto; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand img { width: 27px; height: 27px; }
.header-button { background: none; border: 0; min-height: 44px; padding: 0 0 0 10px; color: var(--home-muted); font-size: 13px; }
.header-button:hover { color: var(--search-action); text-decoration: underline; text-underline-offset: 3px; }

.search-area { padding: 69px 0 21px; }
.search-area h1 { text-align: center; font-size: clamp(23px, 4vw, 30px); line-height: 1.4; font-weight: 500; margin-bottom: 24px; }
main:has(.address-result) .search-area { padding-block: 24px 22px; }
main:has(.address-result) .search-area h1 { font-size: clamp(20px, 3vw, 23px); margin-bottom: 12px; }
.search-area:has(#panel-bulk:not([hidden])) h1 { margin-bottom: 18px; }
.query-row { display: flex; align-items: stretch; padding: 4px; background: #fff; border: 1px solid #d6dee5; border-radius: 7px; }
.query-row:focus-within { border-color: #8498a8; box-shadow: 0 0 0 2px #40566820; }
.search-field { flex: 1; min-width: 0; position: relative; }
.search-icon { position: absolute; inset: 50% auto auto 13px; width: 13px; height: 13px; transform: translateY(-55%); border: 1.5px solid currentColor; border-radius: 50%; color: var(--home-muted); pointer-events: none; }
.search-icon::after { content: ""; position: absolute; top: 9px; left: 9px; width: 6px; height: 1.5px; border-radius: 1px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
#search { width: 100%; min-height: 42px; padding: 8px 10px 8px 41px; border: 0; background: transparent; color: var(--home-ink); font-size: 14px; }
#search:focus { outline: 0; }
::placeholder { color: #606e7e; opacity: 1; }
#search::placeholder { color: var(--home-muted); }
.primary { border: 1px solid var(--action); border-radius: 5px; background: var(--action); color: white; font-size: 15px; padding: 8px 18px; font-weight: 650; white-space: nowrap; }
.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.search-submit { flex: none; width: 77px; padding-inline: 0; border-radius: 4px; background: var(--search-action); border-color: var(--search-action); font-weight: 500; }
.search-submit:hover { background: var(--search-hover); border-color: var(--search-hover); }
.search-submit:focus-visible { outline-color: var(--search-action); outline-offset: 2px; }
#panel-bulk label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 650; }
.query-bottom { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-top: 8px; color: var(--muted); font-size: 13px; }
textarea, input[type=number], select, input[type=date] { min-width: 0; border: 1px solid #cbd3ce; background: #fff; color: var(--ink); border-radius: 5px; padding: 7px 9px; }
textarea { display: block; width: 100%; min-height: 96px; resize: vertical; }
.query-status { margin-top: 11px; color: #415a75; font-size: 14px; }
.query-status.error { color: #a32d38; }

.search-history { position: absolute; z-index: 4; inset: calc(100% + 6px) auto auto 0; width: min(100%, 420px); background: #fff; border: 1px solid #d9e2eb; border-radius: 6px; box-shadow: 0 5px 13px #1633541a; }
.history-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 11px; color: var(--muted); border-bottom: 1px solid #edf1f5; font-size: 13px; }
.history-head button { border: 0; background: transparent; padding: 2px 3px; color: var(--accent); font-size: inherit; }
#history-list { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.history-option { padding: 7px 11px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.history-option:hover, .history-option[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }

.quotes { text-align: center; padding-bottom: 22px; }
.market { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding-block: 13px; border-radius: 6px; background: #f3f6f8; }
.market > div { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding-inline: 5px; }
.market > div + div { border-left: 1px solid #e0e6eb; }
.market dt { color: var(--home-muted); font-size: 13px; }
.market dd { margin: 0; font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
#price-status { margin-top: 12px; color: var(--home-muted); font-size: 12px; }

footer { color: #546476; margin-top: 20px; border-top: 1px solid #edf0f3; }
.footer-inner { min-height: 58px; font-size: 13px; }
.footer-inner a { text-decoration: underline; text-underline-offset: 2px; }

.results { padding-bottom: 19px; scroll-margin-top: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.results .card { padding: 14px 16px; margin-top: 10px; }
.results .card:first-child { margin-top: 0; }
.result-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.result-title > div:first-child { min-width: 0; }
.result-title small { font-size: 13px; color: var(--muted); margin-left: 5px; font-weight: 500; }
.result-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.identifier { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; font-size: 14px; color: var(--accent); margin-top: 4px; }
.outline { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #cbd3ce; background: #fff; border-radius: 5px; color: #3c4941; padding: 5px 8px; font-size: 13px; white-space: nowrap; }
.outline:hover { background: var(--accent-soft); color: var(--accent); }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin: 8px 0 0; }
.detail-list div { padding: 7px 0; border-bottom: 1px solid #e5ebf0; min-width: 0; }
.detail-list dt { font-size: 13px; color: var(--muted); }
.detail-list dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 14px; }
.results .card.address-result { padding: 0; }
.wallet-result { background: #f5f7f6; padding: 12px 16px; border-radius: 5px 5px 0 0; border-bottom: 1px solid var(--line); }
.wallet-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 6px 15px; }
.wallet-address { min-width: 0; }
.wallet-address h2 { font-size: 15px; }
.wallet-head .outline { padding: 2px 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.wallet-head .outline:hover { color: var(--action-hover); }
.wallet-facts { display: grid; grid-template-columns: minmax(205px, 1fr) minmax(0, 1.9fr); gap: 14px 20px; align-items: start; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.wallet-facts .detail-list { margin: 0; gap: 8px 12px; }
.wallet-facts .detail-list div { border: 0; padding: 0; }
.wallet-facts dd { font-variant-numeric: tabular-nums; }
.wallet-balances dd { font-weight: 700; font-size: 17px; }
.wallet-facts .wallet-meta { grid-template-columns: minmax(50px, .7fr) minmax(136px, 1.5fr) minmax(54px, .75fr); border-left: 1px solid var(--line); padding-left: 18px; }
.wallet-meta dd { color: #34433a; }
.transfer-result { padding: 12px 16px 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 7px; margin-top: 11px; }
.stat { min-width: 0; background: var(--pale); border-radius: 5px; padding: 8px 9px; }
.stat span { color: var(--muted); font-size: 13px; display: block; }
.stat strong { display: block; font-size: 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.transfer-heading { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.asset-switch { display: inline-flex; gap: 7px; }
.asset-switch button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; padding: 5px 8px; min-width: 43px; font-size: 14px; font-weight: 650; }
.asset-switch button:hover { color: var(--accent); }
.asset-switch button[aria-pressed=true] { color: var(--accent); border-bottom-color: #597866; }
.filters { display: flex; gap: 7px 9px; flex-wrap: wrap; align-items: end; margin-top: 10px; }
.date-inputs { display: flex; flex-wrap: wrap; gap: 7px 9px; }
.filters label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); max-width: 100%; }
.filters select, .filters input { min-height: 33px; font-size: 13px; padding: 5px 7px; }
.filters input[type=number] { width: 96px; }
.filters .filter-apply { background: var(--accent-soft); border-color: #cbd7ce; color: var(--accent); }
.filters .filter-apply:hover { background: #e2ebe4; }
.filters button[type=reset] { padding: 5px 2px; font-size: 13px; }
.scope-label { padding-top: 8px; }
.transfer-totals { display: flex; gap: 4px 11px; flex-wrap: wrap; align-items: baseline; color: #344a60; font-size: 13px; font-variant-numeric: tabular-nums; }
.scope-label + .transfer-totals { margin-top: 5px; }
.total-label { min-width: 92px; }
.total-unit { color: var(--muted); }
.range-totals { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; margin-top: 3px; }
.range-totals button { font-size: 13px; }
.good { color: #126b47 !important; }
.bad { color: #ab3442 !important; }
.result-note { font-size: 13px; color: var(--muted); margin-top: 5px; }
.table-wrap { overflow-x: auto; margin-top: 7px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; white-space: nowrap; }
th, td { padding: 7px 8px; border-bottom: 1px solid #e1e8ee; }
th { background: #f1f4f2; color: #45564d; font-weight: 650; }
tbody tr:hover { background: #f7f9f7; }
td a, .text-button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.text-button { border: 0; background: none; padding: 0; }
.counterparty { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.copy-value, .record-time { border: 0; background: none; padding: 0; text-align: left; }
.copy-value { color: var(--accent); font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; max-width: 100%; }
.copy-value:hover { text-decoration: underline; text-underline-offset: 3px; }
.record-time { color: var(--ink); text-decoration: underline; text-decoration-color: #a0aea4; text-underline-offset: 3px; }
.record-time:hover { color: var(--accent); text-decoration-color: currentColor; }
td.amount { font-variant-numeric: tabular-nums; }
.amount-tag { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #eef2f5; font-weight: 650; }
.amount-tag.good { background: #e8f5ed; }
.amount-tag.bad { background: #fcecf0; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pager label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.pager select { font-size: 13px; padding: 4px; }
.pager [aria-current=page] { color: var(--accent); font-weight: 700; border-color: #cbd7ce; background: var(--accent-soft); }
.pager button:disabled, .pager select:disabled { cursor: default; }
.block-box { margin-top: 9px; }
#copy-status:not(:empty) { position: fixed; z-index: 10; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--action); color: #fff; border-radius: 5px; padding: 7px 13px; font-size: 13px; white-space: nowrap; pointer-events: none; }

@media (max-width: 650px) {
  .wallet-facts { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .wallet-facts .wallet-meta { border-left: 0; border-top: 1px solid var(--line); padding: 7px 0 0; }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 28px); }
  .header-inner, .query-width { width: calc(100% - 32px); }
  .header-inner { min-height: 53px; }
  .search-area { padding: 59px 0 20px; }
  .search-area h1 { margin-bottom: 20px; }
  .search-icon { left: 9px; }
  #search { min-height: 44px; padding-inline: 33px 6px; font-size: 16px; }
  .search-submit { width: 62px; }
  .results .card { padding: 10px; }
  .wallet-result, .transfer-result { padding-inline: 10px; }
  .market { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .market > div:nth-child(odd) { border-left: 0; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 0; }
}

@media (max-width: 360px) {
  .search-icon { display: none; }
  #search { padding-inline-start: 10px; }
  #search::placeholder { font-size: 14px; }
}
