:root {
  color-scheme: light;
  --paper: #f3f6f4;
  --paper-deep: #e8eeeb;
  --ink: #0d2733;
  --ink-soft: #425a63;
  --teal: #0d6d69;
  --teal-light: #d7ebe7;
  --line: #cbd6d2;
  --line-dark: #8da29e;
  --risk: #b64232;
  --risk-bg: #f6dfda;
  --gold: #a98c54;
  --white: #fcfdfc;
  --shadow: 0 18px 50px rgba(13, 39, 51, 0.08);
  font-family: Aptos, Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(13, 39, 51, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 39, 51, 0.024) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar,
main,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-dark);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: "Arial Narrow", sans-serif;
  font-weight: 800;
}

.brand-name,
.brand-cn,
.eyebrow,
.topbar-meta,
.section-note,
footer,
.panel-count,
.audit-badge {
  margin: 0;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.brand-name {
  font-size: 0.74rem;
  font-weight: 800;
}

.brand-cn {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.data-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-weight: 800;
}

.data-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-light);
}

main {
  padding: 52px 0 28px;
}

.closing-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.closing-copy {
  position: relative;
  padding: clamp(28px, 5vw, 70px);
}

.closing-copy::after {
  content: "USD";
  position: absolute;
  right: 28px;
  bottom: 6px;
  color: rgba(13, 39, 51, 0.045);
  font-family: "Arial Narrow", sans-serif;
  font-size: clamp(5rem, 13vw, 11rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.eyebrow-row,
.section-heading,
.panel-heading,
.total-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.69rem;
  font-weight: 800;
}

.period-chip,
.panel-count,
.audit-badge {
  padding: 6px 9px;
  border: 1px solid var(--line-dark);
  background: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.68rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Arial Narrow", "PingFang SC", sans-serif;
  font-weight: 760;
  letter-spacing: -0.035em;
}

h1 {
  margin-top: 34px;
  color: var(--ink-soft);
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 560;
}

.total-value {
  position: relative;
  z-index: 1;
  margin: 14px 0 30px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(3rem, 7.2vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.96;
  font-variant-numeric: tabular-nums;
}

.total-caption {
  position: relative;
  z-index: 1;
  justify-content: flex-start;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.total-caption a {
  color: var(--teal);
  font-weight: 700;
  text-underline-offset: 4px;
}

.control-stamp {
  display: grid;
  place-content: center;
  gap: 26px;
  padding: 36px;
  border-left: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.completion-ring {
  --completion: 0deg;
  display: grid;
  width: 158px;
  height: 158px;
  margin-inline: auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal-light) var(--completion), rgba(255, 255, 255, 0.12) 0);
}

.completion-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: var(--ink);
}

.completion-ring > div {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  text-align: center;
}

.completion-ring strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 2rem;
  font-weight: 500;
}

.completion-ring span {
  margin-top: 4px;
  color: #b9c8c5;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.stamp-list {
  display: grid;
  gap: 11px;
  width: 260px;
  margin: 0;
}

.stamp-list > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stamp-list dt,
.stamp-list dd {
  margin: 0;
  font-size: 0.76rem;
}

.stamp-list dt {
  color: #9fb1ae;
}

.stamp-list dd {
  text-align: right;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.risk-text {
  color: #ffb3a8;
}

.liquidity-section {
  padding: 54px 0 48px;
  border-bottom: 1px solid var(--line-dark);
}

.section-heading {
  align-items: end;
  margin-bottom: 26px;
}

h2 {
  margin-top: 7px;
  font-size: clamp(1.45rem, 2.8vw, 2.7rem);
}

.section-note {
  max-width: 420px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.7;
  text-align: right;
}

.liquidity-band {
  display: flex;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
}

.band-segment {
  position: relative;
  min-width: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.48);
  transition: flex-basis 500ms cubic-bezier(0.22, 1, 0.36, 1), filter 150ms ease;
}

.band-segment:hover,
.band-segment:focus-visible {
  z-index: 2;
  filter: brightness(1.12);
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.band-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 24px;
  margin-top: 18px;
}

.legend-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.72rem;
}

.legend-item i {
  width: 9px;
  height: 9px;
  background: var(--legend-color);
}

.legend-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-item strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.69rem;
  font-weight: 600;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
  gap: 26px;
  padding: 42px 0;
}

.ledger-panel,
.entity-panel,
.audit-panel {
  min-width: 0;
  border: 1px solid var(--line-dark);
  background: rgba(252, 253, 252, 0.86);
}

.panel-heading {
  min-width: 0;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div {
  min-width: 0;
}

.panel-heading h2 {
  font-size: 1.55rem;
}

.bank-ledger {
  display: grid;
  min-width: 0;
}

.bank-row {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.bank-row:last-child {
  border-bottom: 0;
}

.bank-row summary {
  display: grid;
  grid-template-columns: 42px minmax(170px, 1fr) minmax(130px, 1.4fr) 120px 62px;
  align-items: center;
  gap: 16px;
  padding: 17px 24px;
  cursor: pointer;
  list-style: none;
}

.bank-row summary::-webkit-details-marker {
  display: none;
}

.bank-row summary:hover {
  background: var(--paper);
}

.rank {
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
}

.bank-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-track,
.entity-track {
  height: 5px;
  background: var(--paper-deep);
}

.share-track i,
.entity-track i {
  display: block;
  width: var(--share);
  height: 100%;
  background: var(--bank-color, var(--teal));
}

.bank-amount,
.bank-share,
.currency-value,
.entity-amount {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.bank-amount {
  text-align: right;
  font-weight: 650;
  white-space: nowrap;
}

.bank-share {
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: right;
}

.currency-drawer {
  display: grid;
  gap: 8px;
  padding: 3px 24px 18px 82px;
  background: var(--paper);
}

.currency-line {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: baseline;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.currency-code {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 800;
}

.currency-value {
  color: var(--ink);
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 26px;
  min-width: 0;
}

.entity-list {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 24px;
}

.entity-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.entity-copy {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  font-size: 0.76rem;
}

.entity-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-amount {
  flex: 0 0 auto;
  font-weight: 700;
  white-space: nowrap;
}

.audit-badge {
  border-color: var(--risk);
  background: var(--risk-bg);
  color: var(--risk);
}

.audit-list {
  display: grid;
}

.audit-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.audit-item:last-child {
  border-bottom: 0;
}

.audit-code {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--risk);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 800;
}

.audit-item h3,
.audit-item p {
  margin: 0;
}

.audit-item h3 {
  font-size: 0.84rem;
}

.audit-item p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.55;
}

.method-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line-dark);
}

.method-strip p {
  margin: 0;
  padding: 20px 22px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.5;
}

.method-strip p + p {
  border-left: 1px solid var(--line);
}

.method-strip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.62rem;
}

.error-banner {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  display: grid;
  gap: 4px;
  max-width: 420px;
  padding: 16px 18px;
  border: 1px solid var(--risk);
  background: var(--risk-bg);
  color: var(--risk);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
}

@media (max-width: 1020px) {
  .closing-sheet,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .control-stamp {
    grid-template-columns: 180px 1fr;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .analysis-grid {
    gap: 20px;
  }

  .band-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1440px);
  }

  .topbar {
    min-height: 76px;
  }

  .topbar-meta > span:last-child,
  .brand-name {
    display: none;
  }

  main {
    padding-top: 24px;
  }

  .closing-copy {
    padding: 28px 22px 36px;
  }

  .eyebrow-row,
  .section-heading,
  .total-caption {
    align-items: flex-start;
    flex-direction: column;
  }

  .total-value {
    margin: 18px 0 26px;
    font-size: clamp(2rem, 11.4vw, 4.2rem);
    letter-spacing: -0.09em;
  }

  .control-stamp {
    grid-template-columns: 1fr;
    padding: 28px 22px;
  }

  .stamp-list {
    width: 100%;
  }

  .liquidity-section {
    padding: 38px 0;
  }

  .section-note {
    text-align: left;
  }

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

  .bank-row summary {
    grid-template-columns: 30px minmax(0, 1fr) minmax(106px, auto);
    gap: 10px;
    padding: 16px;
  }

  .panel-heading {
    gap: 10px;
    padding: 20px 16px;
  }

  .panel-heading h2 {
    font-size: 1.35rem;
  }

  .bank-row .share-track,
  .bank-share {
    display: none;
  }

  .currency-drawer {
    padding: 4px 16px 16px 56px;
  }

  .entity-list {
    padding: 20px 16px;
  }

  .currency-line {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .currency-line > span:nth-child(2) {
    display: none;
  }

  .currency-value {
    grid-column: 2;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .method-strip {
    grid-template-columns: 1fr;
  }

  .method-strip p + p {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  footer {
    flex-direction: column;
  }
}

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