:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --ink: #152033;
  --muted: #637083;
  --line: #d9e1ea;
  --blue: #1f5f9e;
  --blue-dark: #143d66;
  --gold: #9a6b18;
  --green: #1d7a55;
  --red: #a33737;
  --shadow: 0 16px 40px rgba(31, 45, 61, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue-dark);
  font-weight: 850;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-dark);
  color: #ffffff;
}

.topbar nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar nav a {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.topbar nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.hero,
.section,
.footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 28px;
  padding: 34px 0 28px;
}

.hero-copy,
.hero-panel,
.section article,
.account-shell,
.proof-panel,
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 500px;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
td,
th,
code {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  color: #0d1628;
  font-size: 54px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: #111a2d;
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  color: #14223a;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.boundary-strip,
.actions,
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.boundary-strip {
  margin-top: 28px;
}

.boundary-strip span,
.status,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f2fa;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.status.pending,
.status.reviewed,
.status.generated {
  background: #fff4ce;
  color: var(--gold);
}

.status.active,
.status.signed,
.status.approved,
.status.vested {
  background: #e7f6ef;
  color: var(--green);
}

.status.frozen,
.status.cancelled {
  background: #fae7e7;
  color: var(--red);
}

.actions {
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  font: inherit;
  cursor: pointer;
}

.button.primary {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #ffffff;
}

.button.compact {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.hero-panel {
  min-height: 500px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.pool-chart {
  width: 250px;
  height: 250px;
  margin: 24px auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 144deg, #e8eef5 144deg 360deg);
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
}

.pool-chart strong {
  font-size: 54px;
  line-height: 1;
}

.pool-chart span {
  max-width: 150px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.mini-grid article,
.metric-grid article {
  min-height: 90px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.mini-grid span,
.metric-grid span,
.proof-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mini-grid strong,
.metric-grid strong,
.proof-summary strong {
  display: block;
  margin-top: 8px;
  color: #111a2d;
  font-size: 24px;
  line-height: 1.25;
}

.section {
  padding: 58px 0 0;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 14px;
}

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

.card-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-grid article,
.formula-grid article {
  min-height: 168px;
  padding: 22px;
}

.card-grid p,
.formula-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.coefficient {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff4ce;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.band {
  width: 100%;
  margin-top: 58px;
  padding: 48px max(24px, calc((100% - 1180px) / 2));
  background: #111a2d;
  color: #ffffff;
}

.band h2 {
  color: #ffffff;
}

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

.pool-layout article {
  min-height: 190px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.pool-layout span {
  color: #d8e1ec;
  font-weight: 800;
}

.pool-layout strong {
  display: block;
  margin: 12px 0;
  font-size: 46px;
  line-height: 1;
}

.pool-layout p {
  margin: 0;
  color: #d8e1ec;
}

.pool-layout .highlight {
  background: #fff4ce;
  color: #2d2107;
}

.pool-layout .highlight span,
.pool-layout .highlight p {
  color: #6f5312;
}

.formula-grid {
  margin-bottom: 14px;
}

code {
  display: block;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #111a2d;
  color: #e8eef5;
  font-family: "Aptos Mono", Consolas, monospace;
  font-size: 13px;
  white-space: normal;
  word-break: break-all;
}

.proof-panel,
.account-shell,
.admin-panel {
  padding: 24px;
}

.proof-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.proof-summary article {
  min-height: 96px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  box-shadow: none;
}

.hash-text {
  font-size: 12px !important;
  font-family: "Aptos Mono", Consolas, monospace;
  word-break: break-all;
}

.proof-path {
  margin-top: 18px;
}

.proof-path code {
  margin-top: 8px;
  background: #f4f7fa;
  color: #1f2937;
}

.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.account-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 320px;
}

.account-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.account-shell > h3 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.login-shell > p,
.panel-message p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  font: inherit;
}

.form-message {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.panel-message {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

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

th {
  color: var(--blue-dark);
  background: #e8eef5;
  font-size: 13px;
}

td {
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.admin-panel .table-wrap {
  margin-top: 16px;
}

.footer {
  margin-top: 58px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .hero,
  .pool-layout,
  .card-grid.three,
  .card-grid.five,
  .proof-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .topbar {
    position: static;
    display: block;
    padding: 16px 18px;
  }

  .topbar nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 12px;
  }

  .hero,
  .section,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .proof-panel,
  .account-shell,
  .admin-panel {
    padding: 22px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 24px;
  }

  .lead {
    font-size: 17px;
  }

  .mini-grid,
  .metric-grid,
  .formula-grid,
  .login-form,
  .pool-layout,
  .card-grid.three,
  .card-grid.five,
  .proof-summary {
    grid-template-columns: 1fr;
  }

  .account-header,
  .account-side {
    display: grid;
    justify-content: stretch;
  }

  .pool-chart {
    width: 214px;
    height: 214px;
  }

  table {
    min-width: 100%;
    table-layout: auto;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .footer {
    display: block;
  }

  .footer span {
    display: block;
    margin-bottom: 6px;
  }
}
