:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #c2410c;
  --blue: #2563eb;
  --good: #0f8a4b;
  --warn: #b45309;
  --bad: #b42318;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a.ghost-button {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
a.ghost-button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.small-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.small-button.danger {
  background: var(--bad);
}

.small-button.danger:hover {
  background: #8f1d14;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.94), rgba(255,255,255,0.74)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3Crect width='900' height='520' fill='%23e7eef8'/%3E%3Cg fill='none' stroke='%2391a4bd' stroke-width='2' opacity='0.55'%3E%3Cpath d='M80 250 C210 120 340 160 470 250 S730 390 830 210'/%3E%3Cpath d='M120 360 C270 250 370 280 490 335 S700 430 800 320'/%3E%3Cpath d='M160 145 C320 250 430 90 560 165 S760 120 835 80'/%3E%3C/g%3E%3Cg fill='%230f766e'%3E%3Ccircle cx='170' cy='150' r='7'/%3E%3Ccircle cx='470' cy='250' r='9'/%3E%3Ccircle cx='790' cy='315' r='7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.login-panel {
  align-self: center;
  justify-self: end;
  width: min(440px, calc(100vw - 36px));
  margin: 36px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 225, 236, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.brand-row h1,
.brand-row p {
  margin: 0;
}

.brand-row h1 {
  font-size: 30px;
  line-height: 1.1;
}

.brand-row p,
.brand-row span,
.fine-print,
.panel-head span,
.metric-card span,
.metric-card em,
.account-box span,
.doc-grid span {
  color: var(--muted);
}

.brand-mark,
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #123c69;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 42px;
}

.admin-login-form {
  margin-top: 18px;
}

.admin-login-link {
  position: fixed;
  right: 16px;
  bottom: 12px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.75;
}

.admin-login-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  width: min(360px, calc(100vw - 36px));
  padding: 24px;
  background: #fff;
  border: 1px solid rgba(217, 225, 236, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: none;
  background: none;
  padding: 0 4px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink, #0f172a);
}

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

.fine-print {
  margin: 2px 0 0;
  font-size: 13px;
}

.login-art {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-art::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  background:
    radial-gradient(circle at 28% 26%, rgba(15, 118, 110, 0.16), transparent 24%),
    radial-gradient(circle at 74% 68%, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  filter: blur(10px);
  animation: artGlow 12s ease-in-out infinite alternate;
}

.node-map {
  position: relative;
  width: min(520px, 80%);
  aspect-ratio: 1.15;
  transform: translateZ(0);
}

.node-map::before,
.node-map::after {
  content: "";
  position: absolute;
  inset: 16%;
  z-index: 0;
  border: 1px solid rgba(18, 60, 105, 0.28);
  border-radius: 999px;
  animation: orbitSpin 28s linear infinite;
}

.node-map::before {
  border-left-color: rgba(15, 118, 110, 0.68);
  border-top-color: rgba(37, 99, 235, 0.36);
}

.node-map::after {
  inset: 29%;
  border-right-color: rgba(194, 65, 12, 0.54);
  border-bottom-color: rgba(15, 118, 110, 0.42);
  animation-duration: 18s;
  animation-direction: reverse;
}

.flow-line {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 34%;
  height: 2px;
  overflow: hidden;
  transform-origin: left center;
  background: rgba(18, 60, 105, 0.12);
}

.flow-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -46%;
  width: 46%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.85), transparent);
  animation: dataFlow 2.8s ease-in-out infinite;
}

.flow-line-a {
  transform: rotate(210deg);
}

.flow-line-b {
  transform: rotate(318deg);
}

.flow-line-c {
  transform: rotate(142deg);
}

.flow-line-d {
  transform: rotate(28deg);
}

.flow-line-b::after {
  animation-delay: 0.55s;
}

.flow-line-c::after {
  animation-delay: 1.15s;
}

.flow-line-d::after {
  animation-delay: 1.7s;
}

.signal {
  position: absolute;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.12);
  animation: signalPulse 2.4s ease-out infinite;
}

.signal-a {
  left: 29%;
  top: 35%;
}

.signal-b {
  right: 29%;
  top: 29%;
  animation-delay: 0.8s;
}

.signal-c {
  right: 32%;
  bottom: 32%;
  background: #2563eb;
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.12);
  animation-delay: 1.55s;
}

.hub,
.node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.hub {
  z-index: 3;
  inset: 39%;
  background: var(--primary);
  color: #fff;
  animation: hubPulse 3.6s ease-in-out infinite;
}

.node {
  min-width: 112px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1;
  animation: nodeFloat 7s ease-in-out infinite;
}

.brand-logo {
  width: 21px;
  height: 21px;
  flex: none;
  display: block;
}

.brand-logo path {
  fill: currentColor;
}

.logo-openai {
  color: #111827;
}

.logo-claude {
  color: #c96442;
}

.logo-qianwen {
  color: #2563eb;
}

.logo-ernie {
  color: #1d4ed8;
}

.node-a { left: 5%; top: 16%; }
.node-b { right: 9%; top: 10%; animation-delay: -1.4s; }
.node-c { left: 13%; bottom: 11%; animation-delay: -2.5s; }
.node-d { right: 5%; bottom: 19%; animation-delay: -3.7s; }

@keyframes artGlow {
  from {
    opacity: 0.72;
    transform: translate3d(-10px, -6px, 0) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate3d(10px, 8px, 0) scale(1.03);
  }
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dataFlow {
  0% {
    left: -46%;
    opacity: 0;
  }

  18%,
  78% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes signalPulse {
  0% {
    opacity: 0;
    transform: scale(0.64);
  }

  38%,
  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.72);
  }
}

@keyframes hubPulse {
  0%,
  100% {
    box-shadow: 0 16px 40px rgba(23, 32, 51, 0.08), 0 0 0 0 rgba(15, 118, 110, 0.28);
  }

  50% {
    box-shadow: 0 16px 40px rgba(23, 32, 51, 0.08), 0 0 0 14px rgba(15, 118, 110, 0);
  }
}

@keyframes nodeFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-art::before,
  .node-map::before,
  .node-map::after,
  .flow-line::after,
  .signal,
  .hub,
  .node {
    animation: none;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #101828;
  color: #fff;
}

.compact .brand-mark {
  background: var(--primary);
}

.compact strong,
.compact span {
  display: block;
}

.compact span {
  color: #b8c1d1;
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-tabs button {
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  color: #d9e1ec;
  min-height: 42px;
  padding: 0 10px;
}

.nav-tabs span {
  width: 24px;
  color: #8fd7cf;
  text-align: center;
}

.nav-tabs button.active,
.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.account-menu-wrap {
  margin-top: auto;
  position: relative;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.account-box {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.account-box:hover,
.account-box[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.avatar {
  width: 38px;
  height: 38px;
  background: #475467;
}

.account-box strong,
.account-box span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-box span {
  color: #b8c1d1;
  font-size: 12px;
}

.account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(217, 225, 236, 0.18);
  border-radius: 8px;
  background: #182230;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  z-index: 5;
}

.account-menu button,
.account-menu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  text-decoration: none;
}

.account-menu button:hover,
.account-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.metric-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.metric-card em {
  font-size: 13px;
  font-style: normal;
}

.log-summary {
  margin: 14px 0 6px;
}

.log-summary .metric-card {
  padding: 14px;
}

.log-summary .metric-card strong {
  font-size: 18px;
}

.dashboard-grid,
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head span.warn {
  color: var(--warn);
}

.usage-chart {
  height: 270px;
  display: grid;
  grid-template-columns: repeat(14, minmax(16px, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 18px;
}

.bar {
  min-height: 32px;
  display: grid;
  align-items: end;
  gap: 4px;
}

.bar i {
  display: block;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #0f766e, #2563eb);
}

.bar span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.share-list,
.key-list,
.route-list,
.budget-list,
.webhook-list,
.cost-breakdown,
.config-list,
.usage-user-list,
.recharge-list,
.admin-user-list {
  display: grid;
  gap: 12px;
}

.share-item,
.key-item,
.route-item,
.budget-item,
.webhook-item,
.config-list div,
.usage-user-row,
.recharge-row,
.admin-user-card,
.cost-row,
.doc-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.key-group-list {
  display: grid;
  gap: 16px;
}

.key-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
  display: grid;
  gap: 12px;
}

.key-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.key-group-head strong {
  font-size: 15px;
}

.key-group-head > div span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.key-group-head > span {
  color: var(--muted);
  font-size: 13px;
}

.key-subsection {
  display: grid;
  gap: 8px;
}

.key-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.key-subhead strong {
  font-size: 13px;
  color: #334155;
}

.key-subhead span {
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2f8;
  color: #475467;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.prev-name {
  color: var(--muted);
  font-style: italic;
}

.share-line {
  height: 8px;
  background: #edf2f7;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.share-line i,
.budget-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 99px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e8f5ee;
  color: var(--good);
}

.status.warn {
  background: #fff4e5;
  color: var(--warn);
}

.status.bad {
  background: #fdecec;
  color: var(--bad);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.inline-form.key-create-form {
  grid-template-columns: auto;
  justify-content: start;
}

.search-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  max-width: 520px;
}

.key-item,
.route-item,
.webhook-item,
.cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.key-usage {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 10px;
}

.key-usage-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 13px;
  margin: 4px 0 0;
  padding: 0;
  text-align: left;
}

.key-usage-toggle:hover,
.key-usage-toggle:focus-visible {
  color: var(--brand);
}

.key-usage-grid,
.wallet-grid,
.admin-user-detail,
.admin-user-stats {
  display: grid;
  gap: 10px;
}

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

.usage-line,
.recharge-row {
  display: grid;
  gap: 3px;
  margin-top: 7px;
}

.usage-line span,
.recharge-row span,
.admin-user-card span {
  color: var(--muted);
  font-size: 13px;
}

.wallet-grid {
  grid-template-columns: minmax(220px, 320px) minmax(180px, 320px);
  align-items: center;
}

.wallet-balance {
  display: grid;
  gap: 4px;
}

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

.wallet-balance strong {
  font-size: 28px;
}

.wallet-form {
  grid-template-columns: minmax(120px, 1fr) auto;
  margin-bottom: 0;
}

.admin-user-card {
  display: grid;
  gap: 12px;
}

.admin-token-adjust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  background: #f6f8fb;
  padding: 10px;
}

.admin-token-adjust > div:first-child {
  display: grid;
  gap: 3px;
}

.admin-token-adjust-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-token-adjust-controls input {
  width: 170px;
  min-height: 30px;
}

.admin-user-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.admin-user-title,
.admin-user-actions {
  display: grid;
  gap: 5px;
}

.admin-user-actions {
  justify-items: end;
}

.admin-user-head strong,
.admin-user-head span,
.admin-user-detail strong,
.admin-user-detail span {
  display: block;
}

.admin-user-head > div:last-child {
  text-align: right;
}

.admin-user-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-user-stats span {
  border-radius: 6px;
  background: #f6f8fb;
  padding: 8px;
}

.admin-user-detail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.key-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.key-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.usage-user-list {
  margin-top: 12px;
}

.usage-user-row {
  display: grid;
  gap: 4px;
}

.usage-user-row span {
  color: var(--muted);
  font-size: 13px;
}

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

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.rank-idx {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eef2f8;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.rank-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.rank-main strong {
  font-size: 14px;
}

.rank-main span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  flex: none;
  font-weight: 700;
  font-size: 14px;
  color: #1d2939;
}

.access-trend {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(14, minmax(42px, 1fr));
  gap: 10px;
  align-items: end;
  overflow-x: auto;
  padding: 12px 2px 4px;
}

.access-trend-day {
  min-width: 42px;
  display: grid;
  grid-template-rows: 184px auto auto;
  gap: 5px;
  align-items: end;
  text-align: center;
}

.access-bar-pair {
  height: 184px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
}

.access-bar-pair i {
  display: block;
  width: min(14px, 42%);
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
}

.access-bar-pv {
  background: linear-gradient(180deg, #3b82f6, #1f6feb);
}

.access-bar-uv {
  background: linear-gradient(180deg, #34d399, #0f9f8f);
}

.access-trend-day strong {
  color: #163458;
  font-size: 12px;
}

.access-trend-day span,
.access-note-panel p {
  color: var(--muted);
  font-size: 12px;
}

.access-note-panel {
  align-content: start;
}

.access-note-panel p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.access-table {
  min-width: 620px;
}

.key-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #344054;
  word-break: break-all;
}

.config-list strong,
.config-list span,
.doc-grid strong,
.doc-grid span {
  display: block;
}

.budget-bar {
  height: 10px;
  border-radius: 99px;
  background: #edf2f7;
  overflow: hidden;
  margin: 10px 0 8px;
}

pre {
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #101828;
  color: #ecfdf3;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.doc-content {
  display: grid;
  gap: 12px;
  color: var(--ink);
  word-break: break-word;
}

.doc-content > * {
  margin: 0;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  color: var(--ink);
  line-height: 1.25;
}

.doc-content h1 {
  font-size: 24px;
}

.doc-content h2 {
  font-size: 20px;
}

.doc-content h3 {
  font-size: 17px;
}

.doc-content h4 {
  font-size: 15px;
}

.doc-content p,
.doc-content li,
.doc-content blockquote,
.doc-content td,
.doc-content th {
  font-size: 14px;
  line-height: 1.7;
}

.doc-content ul,
.doc-content ol {
  margin: 0;
  padding-left: 22px;
}

.doc-content blockquote {
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: #f8fafc;
  color: var(--muted);
}

.doc-content a {
  color: var(--brand);
  text-decoration: none;
}

.doc-content a:hover {
  text-decoration: underline;
}

.doc-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2ff;
  color: #1e3a8a;
}

.doc-content pre {
  white-space: pre;
  word-break: normal;
}

.doc-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.doc-content hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: #e5e7eb;
}

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

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.doc-content th,
.doc-content td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: #f8fafc;
  font-weight: 700;
}

.docs-form {
  display: grid;
  gap: 12px;
}

.docs-editor {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.docs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-status {
  color: var(--muted);
  font-size: 12px;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell,
  .dashboard-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .inline-form {
    grid-template-columns: 1fr 1fr;
  }

  .key-usage-grid,
  .wallet-grid,
  .admin-user-detail,
  .admin-user-stats {
    grid-template-columns: 1fr;
  }

  .admin-token-adjust {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .field-row {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .metric-grid,
  .inline-form,
  .wallet-form,
  .doc-grid,
  .nav-tabs {
    grid-template-columns: 1fr;
  }

  .key-item {
    grid-template-columns: 1fr;
  }

  .key-actions {
    justify-content: flex-start;
  }

  .admin-token-adjust-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-token-adjust-controls input {
    width: 100%;
  }

  .usage-chart {
    gap: 4px;
  }

  .access-trend {
    grid-template-columns: repeat(14, 44px);
  }
}

.pay-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.5);
}

.pay-modal.hidden {
  display: none;
}

.pay-modal-card {
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  background: #fff;
  border: 1px solid rgba(217, 225, 236, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.pay-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pay-modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.pay-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.pay-frame-wrap {
  display: grid;
  place-items: center;
  min-height: 520px;
  background: #f8fafc;
  border: 1px solid rgba(217, 225, 236, 0.6);
  border-radius: 6px;
}

.pay-frame-wrap iframe {
  border: none;
  width: 380px;
  max-width: 100%;
  height: 520px;
}

.pay-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.pay-foot.hidden {
  display: none;
}

.pay-status {
  margin: 0;
  font-size: 13px;
  color: var(--ink, #0f172a);
}

/* Public landing page */
.landing-page {
  --landing-blue: #1f6feb;
  --landing-cyan: #1fc7b6;
  --landing-deep: #102747;
  --landing-muted: #607089;
  --landing-line: #dce8f5;
  --landing-shadow: 0 16px 38px rgba(31, 111, 235, 0.1);
  min-width: 320px;
  overflow-x: hidden;
  color: var(--landing-deep);
  background: radial-gradient(circle at 8% 0%, rgba(31, 199, 182, 0.13), transparent 30rem), linear-gradient(180deg, #f8fcff, #fff 30%, #f8fbff);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.landing-page a {
  color: inherit;
  text-decoration: none;
}

.landing-page h1,
.landing-page h2,
.landing-page h3,
.landing-page p {
  margin-top: 0;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(1200px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  padding: 12px 0;
  background: rgba(248, 252, 255, 0.9);
  backdrop-filter: blur(18px);
}

.landing-brand,
.landing-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--landing-deep);
  font-weight: 800;
}

.landing-brand img,
.landing-footer-brand img,
.landing-page .brand-row img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  object-fit: cover;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #3f526e;
  font-size: 14px;
}

.landing-nav a:hover {
  color: var(--landing-blue);
}

.landing-page .landing-header-action,
.landing-page .landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-page .landing-header-action {
  flex: 0 0 auto;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--landing-blue), var(--landing-cyan));
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.16);
}

.landing-page .landing-button {
  padding: 0 20px;
}

.landing-page .landing-button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--landing-blue), var(--landing-cyan));
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.2);
}

.landing-page .landing-button-secondary {
  color: var(--landing-deep);
  border: 1px solid var(--landing-line);
  background: rgba(255, 255, 255, 0.9);
}

.landing-page .landing-header-action:hover,
.landing-page .landing-button:hover {
  transform: translateY(-1px);
  background-color: initial;
}

.landing-section-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.88fr);
  gap: 42px;
  align-items: center;
  padding: 36px 0 42px;
}

.landing-eyebrow {
  margin-bottom: 10px;
  color: #0b8d92;
  font-size: 13px;
  font-weight: 800;
}

.landing-hero h1 {
  max-width: 660px;
  margin-bottom: 18px;
  color: var(--landing-deep);
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.08;
}

.landing-hero-lede {
  max-width: 650px;
  margin-bottom: 20px;
  color: #425773;
  font-size: 17px;
  line-height: 1.78;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.landing-hero-points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 650px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.landing-hero-points li {
  min-height: 48px;
  padding: 13px 10px;
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 16px;
  color: #20405f;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.06);
}

.landing-product-preview,
.landing-console-preview,
.landing-card,
.landing-bottom-cta {
  border: 1px solid rgba(31, 111, 235, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--landing-shadow);
}

.landing-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.landing-card:hover {
  border-color: rgba(31, 111, 235, 0.18);
  box-shadow: 0 18px 42px rgba(31, 111, 235, 0.13);
  transform: translateY(-2px);
}

.landing-product-preview {
  padding: 16px;
}

.landing-window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e7eff8;
}

.landing-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c8d7e8;
}

.landing-window-bar span:first-child {
  background: #5ad7c9;
}

.landing-window-bar strong {
  margin-left: auto;
  color: #24405f;
  font-size: 13px;
}

.landing-api-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.landing-api-grid > div,
.landing-metric-grid > div {
  padding: 14px;
  border: 1px solid #e6eef8;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.05), rgba(31, 199, 182, 0.06));
}

.landing-page small {
  display: block;
  margin-bottom: 4px;
  color: var(--landing-muted);
  font-size: 12px;
}

.landing-api-grid strong {
  color: #163458;
  font-size: 15px;
}

.landing-request-panel {
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
}

.landing-request-title,
.landing-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #24405f;
  font-weight: 800;
}

.landing-request-title > strong,
.landing-preview-top > strong {
  color: #0b8d92;
  font-size: 12px;
}

.landing-request-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-request-list li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  background: #fff;
  animation: landingRequestFade 0.5s ease both;
}

.landing-request-list li:nth-child(2) { animation-delay: 0.06s; }
.landing-request-list li:nth-child(3) { animation-delay: 0.12s; }

@keyframes landingRequestFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-request-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--landing-cyan);
  box-shadow: 0 0 0 5px rgba(31, 199, 182, 0.12);
}

.landing-switch-dot {
  background: var(--landing-blue);
  box-shadow: 0 0 0 5px rgba(31, 111, 235, 0.12);
}

.landing-request-list strong {
  display: block;
  color: #163458;
  font-size: 14px;
}

.landing-request-list em {
  color: #0b8d92;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.landing-section-block {
  padding: 54px 0;
}

.landing-anchor {
  display: block;
  height: 1px;
  scroll-margin-top: 78px;
}

.landing-tinted {
  width: 100%;
  padding-right: max(16px, calc((100% - 1200px) / 2));
  padding-left: max(16px, calc((100% - 1200px) / 2));
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.05), rgba(31, 199, 182, 0.07));
}

.landing-section-heading {
  max-width: 820px;
  margin-bottom: 18px;
}

.landing-section-heading > p:not(.landing-eyebrow),
.landing-card p,
.landing-usage-copy p,
.landing-bottom-cta p,
.landing-faq-list p {
  color: var(--landing-muted);
  line-height: 1.72;
}

.landing-page main h2 {
  margin-bottom: 10px;
  color: var(--landing-deep);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
}

.landing-page main h3 {
  margin-bottom: 8px;
  color: #163458;
  font-size: 19px;
  line-height: 1.35;
}

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

.landing-support-card,
.landing-feature-card {
  min-height: 178px;
  padding: 22px;
}

.landing-support-card {
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.06), rgba(31, 199, 182, 0.04)), #fff;
}

.landing-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.landing-feature-list li {
  padding: 7px 10px;
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 999px;
  color: #245072;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.78);
}

.landing-process-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(31, 111, 235, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(31, 111, 235, 0.07);
}

.landing-process-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.landing-process-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--landing-blue), var(--landing-cyan));
}

.landing-process-step strong {
  color: #163458;
  font-size: 16px;
}

.landing-process-arrow {
  align-self: center;
  justify-self: center;
  width: 18px;
  height: 18px;
  border-top: 2px solid rgba(31, 111, 235, 0.34);
  border-right: 2px solid rgba(31, 111, 235, 0.34);
  transform: rotate(45deg);
}

.landing-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.landing-line-icon {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border: 1px solid rgba(31, 111, 235, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(31, 199, 182, 0.1));
}

.landing-line-icon::before,
.landing-line-icon::after { position: absolute; content: ""; }
.landing-redundancy::before { inset: 11px 9px; border-top: 2px solid var(--landing-blue); border-bottom: 2px solid var(--landing-cyan); }
.landing-redundancy::after { top: 14px; left: 12px; width: 18px; height: 12px; border-right: 2px solid var(--landing-blue); border-left: 2px solid var(--landing-cyan); }
.landing-switch::before { top: 13px; left: 10px; width: 22px; height: 2px; background: var(--landing-blue); box-shadow: 0 12px 0 var(--landing-cyan); }
.landing-switch::after { top: 9px; right: 8px; width: 8px; height: 8px; border-top: 2px solid var(--landing-blue); border-right: 2px solid var(--landing-blue); transform: rotate(45deg); }
.landing-monitor::before { top: 12px; left: 9px; width: 24px; height: 15px; border: 2px solid var(--landing-blue); border-radius: 5px; }
.landing-monitor::after { right: 10px; bottom: 10px; left: 10px; height: 2px; background: var(--landing-cyan); }
.landing-logs::before { top: 11px; left: 10px; width: 22px; height: 2px; background: var(--landing-blue); box-shadow: 0 8px 0 var(--landing-cyan), 0 16px 0 var(--landing-blue); }
.landing-logs::after { top: 9px; right: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--landing-cyan); box-shadow: 0 8px 0 var(--landing-blue), 0 16px 0 var(--landing-cyan); }

.landing-usage-section {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(460px, 1fr);
  gap: 36px;
  align-items: center;
}

.landing-usage-copy { max-width: 500px; }
.landing-console-preview { padding: 18px; }

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

.landing-metric-grid > div { min-height: 84px; }
.landing-metric-grid strong { display: block; color: #14375e; font-size: 18px; }

.landing-console-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.landing-console-table > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  background: #fff;
}

.landing-console-table span { color: var(--landing-muted); font-size: 13px; }
.landing-console-table strong { color: #17375e; font-size: 13px; }

.landing-faq-list { display: grid; gap: 10px; }
.landing-faq-list details { border: 1px solid rgba(31, 111, 235, 0.11); border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(31, 111, 235, 0.05); }
.landing-faq-list summary { cursor: pointer; padding: 15px 18px; color: #163458; font-weight: 800; }
.landing-faq-list details p { margin: 0; padding: 0 18px 16px; }

.landing-page .landing-inline-contact {
  display: inline;
  min-height: auto;
  margin: 0 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--landing-blue);
  font: inherit;
  font-weight: 700;
  background: transparent;
  box-shadow: none;
  vertical-align: baseline;
}

.landing-page .landing-inline-contact:hover {
  color: #0b8d92;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.landing-bottom-cta {
  margin-top: 10px;
  margin-bottom: 42px;
  padding: 34px;
  text-align: center;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(31, 199, 182, 0.1)), #fff;
}

.landing-bottom-cta .landing-actions { justify-content: center; }

.landing-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.3fr);
  gap: 34px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
  border-top: 1px solid var(--landing-line);
}

.landing-footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.landing-footer-links h2 { margin-bottom: 10px; color: #163458; font-size: 15px; }
.landing-footer-links a,
.landing-page .landing-footer-button { display: block; min-height: auto; margin: 7px 0; padding: 0; border: 0; color: var(--landing-muted); font: inherit; text-align: left; background: transparent; }
.landing-footer-links a:hover,
.landing-page .landing-footer-button:hover { color: var(--landing-blue); background: transparent; }
.landing-copyright { grid-column: 1 / -1; margin: 0; color: #7a8799; font-size: 14px; }

.landing-contact-popover {
  position: fixed;
  z-index: 30;
  width: min(320px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(31, 111, 235, 0.14);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 39, 71, 0.18);
}

.landing-contact-popover[hidden] { display: none; }

.landing-contact-popover::before {
  position: absolute;
  bottom: -8px;
  left: var(--contact-arrow-left, 50%);
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(31, 111, 235, 0.14);
  border-bottom: 1px solid rgba(31, 111, 235, 0.14);
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.landing-contact-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 15px;
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--landing-blue), var(--landing-cyan));
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.16);
}

.landing-contact-popover h2 {
  margin: 0 34px 8px 0;
  color: var(--landing-deep);
  font-size: 20px;
  line-height: 1.35;
}

.landing-contact-popover p {
  margin: 0 0 16px;
  color: var(--landing-muted);
  font-size: 14px;
  line-height: 1.7;
}

.landing-contact-action {
  display: block;
  padding: 11px 13px;
  overflow-wrap: anywhere;
  border: 1px solid var(--landing-line);
  border-radius: 12px;
  color: var(--landing-blue) !important;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  background: #f8fbff;
}

.landing-contact-action:hover {
  border-color: rgba(31, 111, 235, 0.3);
  background: #eef6ff;
}

.landing-page .landing-popover-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--landing-line);
  border-radius: 50%;
  color: #50637d;
  font-size: 20px;
  line-height: 1;
  background: #f8fbff;
  box-shadow: none;
}

.landing-page .landing-popover-close:hover {
  color: var(--landing-blue);
  border-color: rgba(31, 111, 235, 0.32);
  background: #f8fbff;
}

.landing-page .login-modal { z-index: 25; }
.landing-page .login-panel { align-self: auto; justify-self: auto; width: min(500px, calc(100vw - 36px)); margin: 0; padding: 26px; }
.landing-page .login-panel .brand-row { align-items: center; }
.landing-page .login-panel .brand-row h2 { margin: 0 0 4px; font-size: 20px; }
.landing-page .login-panel .brand-row p { margin: 0; font-size: 13px; }
.landing-page .login-form { margin-top: 24px; }
.landing-page .modal-close { min-height: 32px; border-radius: 50%; }

@media (max-width: 980px) {
  .landing-nav { display: none; }
  .landing-hero,
  .landing-usage-section { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 30px; }
  .landing-hero-points,
  .landing-card-grid,
  .landing-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-process-flow { grid-template-columns: 1fr; }
  .landing-process-arrow { width: 14px; height: 14px; margin-left: 10px; transform: rotate(135deg); }
  .landing-footer { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .landing-header,
  .landing-section-shell,
  .landing-footer { width: min(calc(100% - 28px), 1200px); }
  .landing-header { gap: 12px; }
  .landing-brand span { font-size: 16px; }
  .landing-page .landing-header-action { min-height: 40px; padding: 0 13px; font-size: 13px; }
  .landing-hero { gap: 26px; padding: 22px 0 34px; }
  .landing-hero h1 { font-size: 38px; }
  .landing-hero-lede { font-size: 16px; }
  .landing-actions,
  .landing-page .landing-button { width: 100%; }
  .landing-hero-points,
  .landing-support-grid,
  .landing-card-grid,
  .landing-metric-grid,
  .landing-footer-links { grid-template-columns: 1fr; }
  .landing-hero-points li { white-space: normal; }
  .landing-product-preview,
  .landing-console-preview,
  .landing-card,
  .landing-bottom-cta { border-radius: 20px; }
  .landing-section-block { padding: 42px 0; }
  .landing-tinted { padding-right: 14px; padding-left: 14px; }
  .landing-bottom-cta { padding: 30px 20px; }
  .landing-process-flow { gap: 34px; padding: 18px; }
  .landing-console-table > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .landing-page .login-panel { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-request-list li { animation: none; }
}

/* Dashboard pages use the same visual language as the public home page. */
.dashboard-page {
  --bg: #f7fbff;
  --panel: rgba(255, 255, 255, 0.96);
  --text: #102747;
  --ink: #102747;
  --muted: #607089;
  --line: #dce8f5;
  --primary: #1f6feb;
  --primary-dark: #175ec7;
  --brand: #1f6feb;
  --shadow: 0 16px 38px rgba(31, 111, 235, 0.1);
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 0%, rgba(31, 199, 182, 0.13), transparent 32rem),
    linear-gradient(180deg, #f8fcff, #fff 42%, #f8fbff);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-page .app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.dashboard-page .sidebar {
  z-index: 8;
  gap: 26px;
  padding: 24px 20px;
  color: var(--text);
  border-right: 1px solid rgba(31, 111, 235, 0.1);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 10px 0 36px rgba(31, 111, 235, 0.045);
  backdrop-filter: blur(18px);
}

.dashboard-page .console-brand {
  color: var(--text);
  text-decoration: none;
}

.dashboard-page .console-brand img {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.14);
}

.dashboard-page .console-brand strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.dashboard-page .compact span {
  margin-top: 2px;
  color: var(--muted);
}

.dashboard-page .nav-tabs {
  gap: 8px;
}

.dashboard-page .nav-tabs button {
  gap: 11px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  color: #415776;
  font-weight: 700;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-page .nav-tabs span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: #edf5ff;
}

.dashboard-page .nav-tabs button.active,
.dashboard-page .nav-tabs button:hover {
  color: #fff;
  background: linear-gradient(135deg, #1f6feb, #1fc7b6);
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.16);
  transform: translateY(-1px);
}

.dashboard-page .nav-tabs button.active span,
.dashboard-page .nav-tabs button:hover span {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.dashboard-page .account-menu-wrap {
  border-top-color: var(--line);
}

.dashboard-page .account-box {
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.dashboard-page .account-box:hover,
.dashboard-page .account-box[aria-expanded="true"] {
  border-color: rgba(31, 111, 235, 0.12);
  background: #f1f7ff;
}

.dashboard-page .avatar {
  color: #fff;
  background: linear-gradient(135deg, #1f6feb, #1fc7b6);
  box-shadow: 0 7px 16px rgba(31, 111, 235, 0.18);
}

.dashboard-page .account-box span {
  color: var(--muted);
}

.dashboard-page .account-menu {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-page .account-menu button,
.dashboard-page .account-menu a {
  color: var(--text);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.dashboard-page .account-menu button:hover,
.dashboard-page .account-menu a:hover {
  color: var(--primary);
  background: #edf5ff;
}

.dashboard-page .main {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 46px) 46px;
}

.dashboard-page .topbar {
  min-height: 70px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(31, 111, 235, 0.1);
}

.dashboard-page .eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-page .topbar h2 {
  color: var(--text);
  font-size: clamp(25px, 2.4vw, 32px);
  letter-spacing: -0.025em;
}

.dashboard-page button,
.dashboard-page a.ghost-button {
  border-radius: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #1f6feb, #1fc7b6);
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.13);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dashboard-page button:hover,
.dashboard-page a.ghost-button:hover {
  background: linear-gradient(135deg, #1f6feb, #1fc7b6);
  box-shadow: 0 11px 23px rgba(31, 111, 235, 0.19);
  transform: translateY(-1px);
}

.dashboard-page .nav-tabs button,
.dashboard-page .account-box,
.dashboard-page .account-menu button,
.dashboard-page .account-menu a,
.dashboard-page .key-usage-toggle {
  box-shadow: none;
}

.dashboard-page .key-usage-toggle,
.dashboard-page .key-usage-toggle:hover,
.dashboard-page .key-usage-toggle:focus-visible {
  min-height: auto;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.dashboard-page .key-usage-toggle:hover,
.dashboard-page .key-usage-toggle:focus-visible {
  color: var(--primary);
}

.dashboard-page button:disabled:hover {
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.13);
  transform: none;
}

.dashboard-page .icon-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.08);
}

.dashboard-page .icon-button:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1f6feb, #1fc7b6);
}

.dashboard-page input,
.dashboard-page select,
.dashboard-page .docs-editor {
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.dashboard-page input:focus,
.dashboard-page select:focus,
.dashboard-page .docs-editor:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
}

.dashboard-page .tab-panel.active {
  gap: 20px;
}

.dashboard-page .metric-grid {
  gap: 16px;
}

.dashboard-page .metric-card,
.dashboard-page .panel {
  border-color: rgba(31, 111, 235, 0.11);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(31, 111, 235, 0.07);
}

.dashboard-page .metric-card {
  position: relative;
  gap: 10px;
  min-height: 132px;
  padding: 21px;
  overflow: hidden;
}

.dashboard-page .metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 199, 182, 0.14), transparent 68%);
}

.dashboard-page .metric-card strong {
  color: #14375e;
  font-size: 30px;
  letter-spacing: -0.025em;
}

.dashboard-page .metric-card span,
.dashboard-page .metric-card em,
.dashboard-page .panel-head span {
  color: var(--muted);
}

.dashboard-page .panel {
  padding: 21px;
}

.dashboard-page .panel-head {
  margin-bottom: 18px;
}

.dashboard-page .panel-head h3 {
  color: #163458;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.dashboard-page .share-item,
.dashboard-page .key-item,
.dashboard-page .route-item,
.dashboard-page .budget-item,
.dashboard-page .webhook-item,
.dashboard-page .config-list div,
.dashboard-page .usage-user-row,
.dashboard-page .recharge-row,
.dashboard-page .admin-user-card,
.dashboard-page .cost-row,
.dashboard-page .doc-grid div,
.dashboard-page .rank-row,
.dashboard-page .key-group {
  border-color: rgba(31, 111, 235, 0.1);
  border-radius: 13px;
  background: #fbfdff;
}

.dashboard-page .key-group {
  padding: 16px;
}

.dashboard-page .key-subhead strong,
.dashboard-page .rank-value,
.dashboard-page .key-value {
  color: #274362;
}

.dashboard-page .tag,
.dashboard-page .rank-idx {
  color: #1f5fac;
  background: #eaf3ff;
}

.dashboard-page .share-line,
.dashboard-page .budget-bar {
  background: #eaf2fb;
}

.dashboard-page .share-line i,
.dashboard-page .budget-bar i,
.dashboard-page .bar i {
  background: linear-gradient(180deg, #1f6feb, #1fc7b6);
}

.dashboard-page th {
  color: #718098;
}

.dashboard-page th,
.dashboard-page td {
  border-bottom-color: #e7eff8;
}

.dashboard-page tbody tr:hover {
  background: #f8fbff;
}

.dashboard-page .wallet-balance {
  padding: 18px;
  border: 1px solid rgba(31, 111, 235, 0.11);
  border-radius: 14px;
  background: linear-gradient(135deg, #f1f7ff, #f0fffc);
}

.dashboard-page .wallet-balance strong {
  color: #14375e;
}

.dashboard-page pre {
  border-radius: 13px;
  background: #102747;
}

.dashboard-page .doc-content blockquote,
.dashboard-page .doc-content th {
  background: #f3f8ff;
}

.dashboard-page .doc-content code {
  color: #174f93;
  background: #eaf3ff;
}

.dashboard-page .toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #102747;
  box-shadow: 0 18px 38px rgba(16, 39, 71, 0.2);
}

.dashboard-page .pay-modal {
  background: rgba(16, 39, 71, 0.48);
  backdrop-filter: blur(5px);
}

.dashboard-page .pay-modal-card {
  border-color: rgba(31, 111, 235, 0.12);
  border-radius: 18px;
  box-shadow: 0 22px 56px rgba(16, 39, 71, 0.18);
}

.dashboard-page .pay-frame-wrap {
  border-color: var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

@media (max-width: 980px) {
  .dashboard-page .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-page .sidebar {
    position: relative;
    height: auto;
    gap: 18px;
    padding: 18px clamp(16px, 4vw, 28px);
    border-right: 0;
    border-bottom: 1px solid rgba(31, 111, 235, 0.1);
    box-shadow: 0 10px 30px rgba(31, 111, 235, 0.05);
  }

  .dashboard-page .nav-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-page .nav-tabs button {
    justify-content: center;
  }

  .dashboard-page .account-menu-wrap {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .dashboard-page .account-box {
    max-width: 360px;
  }
}

@media (max-width: 620px) {
  .dashboard-page .sidebar,
  .dashboard-page .main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .dashboard-page .main {
    padding-top: 22px;
  }

  .dashboard-page .topbar {
    min-height: 0;
  }

  .dashboard-page .nav-tabs {
    grid-template-columns: 1fr;
  }

  .dashboard-page .nav-tabs button {
    justify-content: flex-start;
  }

  .dashboard-page .metric-card,
  .dashboard-page .panel {
    border-radius: 15px;
  }

  .dashboard-page .metric-card {
    min-height: 116px;
  }
}
