:root {
  --bg: #070b12;
  --ink: #f7f9fc;
  --muted: #9ba8b5;
  --soft: #dce7ed;
  --line: rgba(161, 186, 201, 0.22);
  --panel: rgba(13, 20, 31, 0.84);
  --panel-strong: rgba(18, 28, 42, 0.96);
  --cyan: #45d4ff;
  --green: #65e7bd;
  --gold: #f4c768;
  --rose: #ff7c8a;
  --radius: 8px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow: hidden;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 12%, rgba(69, 212, 255, 0.16), transparent 32%),
    radial-gradient(circle at 18% 28%, rgba(244, 199, 104, 0.12), transparent 26%),
    linear-gradient(180deg, #070b12 0%, #0b121c 48%, #070b12 100%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.field-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05080d;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.splash.done {
  opacity: 0;
  visibility: hidden;
}

.splash-canvas {
  position: absolute;
  inset: 0;
}

.splash-core {
  position: relative;
  display: grid;
  width: min(320px, calc(100% - 40px));
  min-height: 164px;
  place-items: center;
  padding: 30px;
  border: 1px solid rgba(69, 212, 255, 0.38);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(101, 231, 189, 0.12), rgba(69, 212, 255, 0.08), rgba(244, 199, 104, 0.06)),
    rgba(8, 14, 22, 0.92);
  box-shadow: 0 0 48px rgba(69, 212, 255, 0.18);
}

.splash-core strong {
  font-size: 38px;
}

.splash-core small {
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(161, 186, 201, 0.13);
  background: rgba(7, 11, 18, 0.42);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(69, 212, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.brand-mark i {
  width: 18px;
  height: 18px;
  border: 3px solid var(--cyan);
  border-left-color: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(69, 212, 255, 0.48);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-login {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(161, 186, 201, 0.24);
  border-radius: var(--radius);
  color: var(--soft);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.nav-login:hover {
  color: var(--ink);
  border-color: rgba(69, 212, 255, 0.38);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(30px, 7vw, 90px);
  width: min(1180px, calc(100% - 64px));
  height: calc(100svh - 74px);
  margin: 0 auto;
  padding-bottom: 34px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 34px;
  font-size: clamp(48px, 7.4vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  color: #061019;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 14px 34px rgba(69, 212, 255, 0.22);
}

.ghost-button {
  color: var(--ink);
  border-color: rgba(161, 186, 201, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button.full {
  width: 100%;
}

.primary-button.small,
.ghost-button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.bubble-map {
  position: relative;
  height: min(620px, calc(100svh - 150px));
  min-height: 470px;
}

.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid rgba(161, 186, 201, 0.2);
  border-radius: 50%;
  text-align: center;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.17), transparent 34%),
    rgba(13, 20, 31, 0.76);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.28),
    inset 0 0 42px rgba(69, 212, 255, 0.08);
  backdrop-filter: blur(14px);
}

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

.bubble strong {
  font-size: clamp(18px, 1.8vw, 24px);
}

.bubble span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bubble-core {
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 190px;
  height: 190px;
  transform: translate(-50%, -50%);
  border-color: rgba(101, 231, 189, 0.44);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(101, 231, 189, 0.22), rgba(69, 212, 255, 0.16)),
    rgba(13, 20, 31, 0.9);
}

.bubble-core strong {
  font-size: 29px;
}

.bubble-a {
  left: 4%;
  top: 9%;
  width: 164px;
  height: 164px;
}

.bubble-b {
  right: 10%;
  top: 4%;
  width: 178px;
  height: 178px;
}

.bubble-c {
  left: 13%;
  bottom: 12%;
  width: 156px;
  height: 156px;
}

.bubble-d {
  right: 3%;
  bottom: 17%;
  width: 168px;
  height: 168px;
}

.bubble-e {
  left: 35%;
  top: 1%;
  width: 134px;
  height: 134px;
}

.bubble-f {
  left: 40%;
  bottom: 0;
  width: 150px;
  height: 150px;
}

.orbit-line {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  border: 1px solid rgba(69, 212, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.line-a {
  width: 520px;
  height: 260px;
  transform: translate(-50%, -50%) rotate(-20deg);
}

.line-b {
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
}

.line-c {
  width: 330px;
  height: 560px;
  transform: translate(-50%, -50%) rotate(30deg);
}

.workspace-modal {
  position: fixed;
  inset: 0;
  z-index: 18;
  overflow: auto;
  padding: 28px;
  background: rgba(2, 5, 9, 0.72);
}

.workspace-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.workspace-head,
.account-bar,
.redeem-box,
.cases-box,
.report-viewer,
.login-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px;
}

.account-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.account-bar div {
  padding: 18px 22px;
  background: var(--panel-strong);
}

.account-bar small {
  color: var(--muted);
  font-size: 12px;
}

.account-bar strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.redeem-box,
.cases-box,
.report-viewer {
  padding: 24px;
}

.redeem-box p,
.login-dialog p,
.case-item p {
  color: var(--muted);
  line-height: 1.68;
}

.redeem-form,
.box-heading,
.case-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.redeem-form {
  margin-top: 16px;
}

.redeem-form input {
  flex: 1;
}

label {
  display: grid;
  gap: 7px;
  color: #d8e5eb;
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(161, 186, 201, 0.28);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(69, 212, 255, 0.16);
}

.redeem-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(101, 231, 189, 0.3);
  border-radius: var(--radius);
  background: rgba(101, 231, 189, 0.08);
}

.box-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(161, 186, 201, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.case-item h4 {
  margin: 0 0 6px;
  font-size: 17px;
}

.case-item p {
  margin: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 999px;
  color: #061018;
  background: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.status-chip.report_ready,
.status-chip.reported,
.status-chip.delivered {
  background: var(--green);
}

.status-chip.running {
  background: var(--cyan);
}

.status-chip.analysis_failed {
  color: #fff;
  background: var(--rose);
}

.report-body {
  max-height: 760px;
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(161, 186, 201, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: #14202a;
  line-height: 1.74;
}

.report-body h1,
.report-body h2,
.report-body h3 {
  color: #102232;
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}

.report-body th,
.report-body td {
  padding: 9px;
  border: 1px solid #d6e0e7;
  text-align: left;
  vertical-align: top;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 5, 9, 0.72);
  cursor: pointer;
}

.login-dialog {
  position: relative;
  width: min(480px, 100%);
  padding: 28px;
  background: rgba(12, 20, 31, 0.96);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(161, 186, 201, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.login-dialog .icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid rgba(161, 186, 201, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.auth-tabs button.active {
  color: #061019;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: end;
  gap: 10px;
}

.code-row .ghost-button {
  min-height: 44px;
  padding: 0 10px;
  white-space: nowrap;
}

.login-note {
  margin: 14px 0 0;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 15px;
  border: 1px solid rgba(69, 212, 255, 0.28);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(10, 22, 31, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

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

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 760px);
    height: auto;
    min-height: calc(100svh - 74px);
    padding: 44px 0 56px;
  }

  .bubble-map {
    height: 520px;
  }
}

@media (max-width: 620px) {
  .brand small {
    display: none;
  }

  h1 {
    font-size: 44px;
  }

  .bubble-map {
    min-height: 430px;
    transform: scale(0.9);
    transform-origin: center top;
  }

  .bubble-a,
  .bubble-b,
  .bubble-c,
  .bubble-d,
  .bubble-e,
  .bubble-f {
    width: 132px;
    height: 132px;
  }

  .bubble-core {
    width: 160px;
    height: 160px;
  }

  .account-bar {
    grid-template-columns: 1fr;
  }

  .redeem-form,
  .case-item,
  .code-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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