:root {
  color-scheme: light;
  --bg: #f6fbff;
  --paper: rgba(255, 255, 255, 0.86);
  --ink: #07111f;
  --muted: #607086;
  --line: rgba(24, 54, 86, 0.13);
  --blue: #1978ff;
  --cyan: #00c8f8;
  --mint: #21d6a3;
  --violet: #6d5dfc;
  --shadow: 0 26px 80px rgba(20, 58, 96, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(0, 200, 248, 0.12), transparent 26rem),
    radial-gradient(circle at 84% 8%, rgba(109, 93, 252, 0.1), transparent 25rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--ink);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1824px, calc(100% - 64px));
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  box-shadow: var(--shadow);
  position: relative;
}

.shell::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(10, 42, 70, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 42, 70, 0.052) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
  content: "";
}

.topbar,
.hero,
.feature-strip,
.admin-layout {
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 42px 64px 0;
}

.brand,
.nav,
.console-pill,
.hero-actions,
.stats,
.feature-strip,
.panel-title,
.node,
.metric-row,
.form-grid,
.admin-topbar {
  display: flex;
  align-items: center;
}

.brand {
  gap: 16px;
  font-size: 1.34rem;
  font-weight: 820;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(25, 120, 255, 0.25);
  border-radius: 17px;
  background: #fff;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  content: "";
}

.brand-mark::before {
  top: 13px;
  left: 12px;
}

.brand-mark::after {
  right: 11px;
  bottom: 12px;
  border-color: var(--cyan);
}

.brand-mark span {
  position: absolute;
  width: 23px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform: rotate(-36deg);
}

.nav {
  gap: 10px;
  justify-self: center;
}

.nav a {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid rgba(7, 36, 68, 0.14);
  border-radius: 999px;
  color: #31465e;
  line-height: 50px;
  background: rgba(255, 255, 255, 0.72);
}

.console-pill {
  justify-self: end;
  gap: 12px;
  min-height: 58px;
  padding: 0 27px;
  border-radius: 999px;
  background: #07111f;
  color: #fff;
  font-weight: 760;
}

.console-pill span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--mint);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(540px, 1.05fr);
  gap: 54px;
  align-items: center;
  min-height: 720px;
  padding: 76px 64px 34px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--blue);
  font-weight: 850;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(4.2rem, 7vw, 7.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h1 span {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.9rem, 2.8vw, 3.2rem);
}

.lede {
  max-width: 780px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.28rem;
  line-height: 1.78;
}

.hero-actions {
  gap: 24px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: #07111f;
  color: #fff;
  font-weight: 820;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: #17324f;
}

.stats {
  gap: 80px;
  margin-top: 84px;
}

.stat strong {
  display: block;
  font-size: 2.65rem;
}

.stat span {
  color: var(--muted);
}

.gateway-card {
  position: relative;
  min-height: 580px;
  border: 2px solid rgba(25, 120, 255, 0.82);
  border-radius: 42px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 36px 96px rgba(20, 58, 96, 0.13);
}

.gateway-card::before {
  position: absolute;
  inset: 40px;
  border: 1px solid rgba(25, 120, 255, 0.7);
  border-radius: 31px;
  background: rgba(242, 250, 255, 0.72);
  content: "";
}

.rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
}

.rings span {
  position: absolute;
  inset: var(--inset);
  border: 2px solid rgba(25, 120, 255, var(--alpha));
  border-radius: 50%;
}

.rings span:nth-child(2) {
  border-color: rgba(109, 93, 252, 0.72);
}

.core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border: 2px solid rgba(25, 120, 255, 0.6);
  border-radius: 28px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.core strong {
  font-size: 2.5rem;
}

.core small {
  color: var(--blue);
  font-weight: 800;
}

.node {
  position: absolute;
  z-index: 2;
  gap: 11px;
  min-height: 56px;
  padding: 0 22px;
  border: 1px solid rgba(7, 36, 68, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 44px rgba(20, 58, 96, 0.11);
  font-weight: 820;
}

.node i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
}

.node.openai {
  top: 70px;
  left: 84px;
}

.node.claude {
  top: 70px;
  right: 84px;
}

.node.gemini {
  bottom: 86px;
  left: 92px;
}

.node.upstream {
  right: 84px;
  bottom: 86px;
}

.node.claude i {
  background: var(--violet);
}

.node.gemini i {
  background: var(--cyan);
}

.node.upstream i {
  background: var(--mint);
}

.route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-svg path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  opacity: 0.78;
}

.route-svg path:nth-child(even) {
  stroke: var(--cyan);
}

.mini-panel {
  position: absolute;
  z-index: 3;
  width: 278px;
  padding: 22px;
  border: 1px solid rgba(7, 36, 68, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 64px rgba(20, 58, 96, 0.14);
}

.mini-panel.route {
  top: 210px;
  left: -40px;
}

.mini-panel.billing {
  top: 246px;
  right: -40px;
}

.panel-title {
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 850;
}

.panel-title span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint);
}

.metric-row {
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 13px;
  color: #2e4055;
  background: #f1f8fd;
}

.metric-row + .metric-row {
  margin-top: 10px;
}

.metric-row b {
  color: var(--blue);
}

.billing-value {
  font-size: 2.75rem;
  font-weight: 900;
}

.meter {
  height: 14px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f0f7;
}

.meter span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.flow-pill {
  position: absolute;
  right: 190px;
  bottom: -36px;
  min-height: 62px;
  padding: 0 36px;
  border-radius: 999px;
  background: #07111f;
  color: #fff;
  line-height: 62px;
  box-shadow: 0 20px 44px rgba(7, 17, 31, 0.18);
}

.flow-pill span {
  margin: 0 28px;
  color: var(--cyan);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding: 0 64px 44px;
}

.feature-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 50px rgba(20, 58, 96, 0.08);
}

.feature-card {
  min-height: 118px;
  padding: 24px 28px;
}

.feature-card small {
  color: var(--blue);
  font-weight: 900;
}

.feature-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-body {
  background: #f5f9fc;
}

.admin-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 20px auto;
}

.admin-topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.admin-card {
  padding: 22px;
}

.admin-card h2,
.admin-card h3 {
  margin: 0 0 18px;
}

.login-card {
  max-width: 520px;
  margin: 12vh auto;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #40536a;
  font-size: 0.92rem;
  font-weight: 750;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(7, 36, 68, 0.14);
  border-radius: 14px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 76px;
  padding-top: 12px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid rgba(7, 36, 68, 0.09);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: #53667d;
  font-size: 0.86rem;
}

.muted {
  color: var(--muted);
}

.notice {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #eef8ff;
  color: #24415f;
  line-height: 1.55;
}

.pay-box {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.pay-box img {
  display: block;
  width: 260px;
  height: 260px;
  border: 12px solid #fff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(20, 58, 96, 0.12);
}

code {
  padding: 2px 6px;
  border-radius: 7px;
  background: #eef6fc;
  color: #16375b;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.admin-metric strong {
  display: block;
  font-size: 1.8rem;
}

@media (max-width: 1120px) {
  .shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 24px 20px 0;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 58px 20px 34px;
  }

  .feature-strip,
  .admin-layout,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .feature-strip {
    padding: 0 20px 34px;
  }

  .gateway-card {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .console-pill {
    padding: 0 18px;
  }

  h1 {
    font-size: 4rem;
  }

  h1 span {
    font-size: 1.72rem;
  }

  .stats {
    gap: 24px;
    flex-wrap: wrap;
  }

  .gateway-card {
    transform: scale(0.82);
    transform-origin: top center;
    margin-bottom: -80px;
  }

  .mini-panel.route {
    left: -18px;
  }

  .mini-panel.billing {
    right: -18px;
  }

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

  .pay-box {
    grid-template-columns: 1fr;
  }
}
