:root {
  --bg: #020304;
  --paper: rgba(255, 255, 255, 0.075);
  --paper-strong: rgba(255, 255, 255, 0.12);
  --ink: rgba(255, 255, 255, 0.92);
  --muted: rgba(235, 245, 255, 0.62);
  --faint: rgba(235, 245, 255, 0.38);
  --line: rgba(255, 255, 255, 0.16);
  --soft: rgba(255, 255, 255, 0.08);
  --accent: #7dd3fc;
  --accent-2: #a7f3d0;
  --warn: #f6c177;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 18% -10%, rgba(94, 234, 212, 0.18), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(96, 165, 250, 0.2), transparent 30%),
    linear-gradient(180deg, #050607 0%, #020304 55%, #000 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.48;
}

code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 28px 40px 22px;
  background: rgba(8, 10, 12, 0.58);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.view-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 9, 0.62);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.nav-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num title"
    "num sub";
  column-gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

.nav-item.active {
  color: #001014;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(167, 243, 208, 0.95), rgba(125, 211, 252, 0.95));
  transform: translateY(-1px);
}

.nav-item span {
  grid-area: num;
  color: inherit;
  opacity: 0.75;
  font-size: 12px;
}

.nav-item b {
  grid-area: title;
  font-size: 14px;
}

.nav-item small {
  grid-area: sub;
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.dek {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.meta {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.meta b {
  overflow-wrap: anywhere;
}

main {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-heading {
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.view-heading.with-action {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.view-heading h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.view-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.section {
  margin-bottom: 24px;
}

.section-card {
  margin-top: 14px;
}

.section-head,
.table-toolbar,
.metric-tools {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head h2,
.panel h2 {
  margin-bottom: 0;
}

.section-head p,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.download {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  font-size: 13px;
  box-shadow: var(--shadow);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.summary-card,
.panel,
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.summary-card {
  padding: 15px;
  min-height: 92px;
}

.summary-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.summary-value {
  color: var(--accent);
  font-size: 26px;
  font-weight: 760;
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.filters.glass {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

input::placeholder {
  color: var(--faint);
}

input,
select {
  width: 100%;
  padding: 7px 10px;
}

button {
  padding: 7px 11px;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

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

.table-wrap {
  overflow: auto;
  max-height: 720px;
  max-width: 100%;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(24, 28, 32, 0.92);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(125, 211, 252, 0.12);
}

td.metric-cell {
  min-width: 210px;
  white-space: normal;
}

td.source-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-layout,
.grid-two {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
  align-items: start;
}

.ledger-detail {
  margin-top: 14px;
}

.panel {
  padding: 14px;
}

.record-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
}

.explication {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.kv-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.kv-grid div {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.kv-grid div:nth-child(odd) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.kv-grid div:nth-child(even) {
  overflow-wrap: anywhere;
}

.kv-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.definition-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.definition-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
}

.definition-item,
.metric-card,
.compact-item,
.source-item {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.definition-item strong,
.metric-card strong,
.compact-item strong {
  display: block;
  margin-bottom: 4px;
}

.metric-tools {
  align-items: center;
  margin-bottom: 0;
}

.metric-tools input {
  max-width: 420px;
}

.dictionary-panel {
  margin-bottom: 12px;
}

.dictionary-toolbar {
  margin-bottom: 10px;
}

.metric-searchbar {
  display: grid;
  grid-template-columns: auto minmax(300px, 520px);
  gap: 14px;
  align-items: center;
  margin: 2px 0 10px;
}

.metric-searchbar h2 {
  margin-bottom: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 0;
}

.metric-meta {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.mini-table table {
  min-width: 0;
  table-layout: auto;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.issue-panel h2 {
  margin-bottom: 10px;
}

.range-panel h2 {
  margin-bottom: 10px;
}

.governance-board {
  columns: 2 420px;
  column-gap: 14px;
}

.governance-board .panel {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  min-height: 84px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.category-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.category-card span {
  color: var(--accent-2);
  font-size: 23px;
  font-weight: 760;
}

.visual-tabs {
  display: grid;
  gap: 8px;
}

.visual-tab {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.visual-tab.active {
  color: #001014;
  background: linear-gradient(135deg, #a7f3d0, #7dd3fc);
  border-color: transparent;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.visual-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
}

.visual-index {
  position: sticky;
  top: 92px;
  align-self: start;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.visual-index h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.chart-card {
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.chart-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.chart-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart {
  width: 100%;
  height: 282px;
}

.source-item a:hover {
  text-decoration: underline;
}

@media (max-width: 1120px) {
  .view-nav {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .visual-layout {
    grid-template-columns: 1fr;
  }

  .visual-index {
    position: static;
    min-height: 0;
  }

  .visual-tabs {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    overflow-x: auto;
  }

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

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

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

@media (max-width: 760px) {
  .topbar {
    display: block;
    padding: 24px 18px 20px;
  }

  .meta {
    margin-top: 16px;
    text-align: left;
  }

  main {
    width: min(100% - 24px, 1480px);
    padding-top: 18px;
  }

  .view-nav {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    padding: 8px 12px;
  }

  .nav-item {
    min-height: 56px;
    padding: 9px 10px;
  }

  .view-heading.with-action {
    display: block;
  }

  h1 {
    font-size: 25px;
  }

  .summary-grid,
  .category-grid,
  .filters,
  .detail-layout,
  .grid-two,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .definition-list.compact,
  .metric-searchbar {
    grid-template-columns: 1fr;
  }

  .governance-board {
    columns: 1;
  }

  .section-head,
  .table-toolbar,
  .metric-tools {
    display: block;
  }

  .download,
  .pager {
    margin-top: 10px;
  }

  .metric-searchbar .metric-tools {
    margin-top: 0;
  }

  .metric-searchbar .metric-tools input {
    margin-top: 6px;
  }

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

  .kv-grid div:nth-child(even) {
    border-bottom: 1px solid var(--line);
  }

  th,
  td {
    padding: 8px;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  #dataTable th:nth-child(4),
  #dataTable td:nth-child(4),
  #dataTable th:nth-child(8),
  #dataTable td:nth-child(8),
  #dataTable th:nth-child(9),
  #dataTable td:nth-child(9) {
    display: none;
  }

  #dataTable th:nth-child(1),
  #dataTable td:nth-child(1) {
    width: 42px;
  }

  #dataTable th:nth-child(2),
  #dataTable td:nth-child(2) {
    width: 82px;
  }

  #dataTable th:nth-child(3),
  #dataTable td:nth-child(3) {
    width: 54px;
  }

  #dataTable th:nth-child(5),
  #dataTable td:nth-child(5) {
    width: auto;
  }

  #dataTable th:nth-child(6),
  #dataTable td:nth-child(6) {
    width: 78px;
  }

  #dataTable th:nth-child(7),
  #dataTable td:nth-child(7) {
    width: 58px;
  }

  #dataTable td,
  #dataTable th,
  td.metric-cell,
  td.source-cell {
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }
}
