:root {
  --scapi-text: #17233f;
  --scapi-muted: #68738b;
  --scapi-blue: #4b82ff;
  --scapi-violet: #7957f8;
  --scapi-soft: #f6f8ff;
  --scapi-line: rgba(93, 112, 174, 0.13);
  --scapi-shadow: 0 26px 80px rgba(67, 91, 159, 0.14);
}

body.scapi-public * {
  box-sizing: border-box;
}

body.scapi-public {
  min-height: 100vh;
  margin: 0;
  color: var(--scapi-text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 82% 10%, rgba(126, 93, 248, 0.18), transparent 34%),
    radial-gradient(circle at 55% 20%, rgba(86, 151, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f8faff 54%, #ffffff 100%);
}

.scapi-home {
  position: relative;
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 38px clamp(24px, 5vw, 92px) 70px;
  overflow: hidden;
}

.scapi-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.scapi-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #131c34;
  text-decoration: none;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 800;
  line-height: 1;
}

.scapi-logo-mark {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  padding: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(88, 104, 243, 0.24);
  animation: scapi-logo-pulse 5.6s ease-in-out infinite;
}

.scapi-nav-actions {
  display: flex;
  align-items: center;
  gap: 26px;
}

.scapi-doc-link,
.scapi-login-button {
  color: #111b33;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.scapi-login-button {
  min-width: 96px;
  padding: 14px 25px;
  border-radius: 10px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #745bff, #4c79ff);
  box-shadow: 0 14px 34px rgba(88, 92, 246, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.scapi-login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(88, 92, 246, 0.34);
}

.scapi-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.86fr);
  align-items: center;
  gap: 48px;
  min-height: 610px;
  padding-top: 42px;
}

.scapi-hero-copy {
  padding-left: clamp(0px, 4.6vw, 70px);
}

.scapi-hero h1 {
  margin: 0 0 22px;
  font-size: clamp(86px, 9vw, 136px);
  line-height: 0.92;
  letter-spacing: 0;
  font-weight: 900;
  background: linear-gradient(90deg, #3f86ff 0%, #7d55fa 78%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: scapi-title-flow 7s ease-in-out infinite;
}

.scapi-hero-line {
  margin: 0;
  color: #15213b;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.35;
}

.scapi-hero-line strong {
  color: #5a70ff;
}

.scapi-hero-subtitle {
  margin: 28px 0 56px;
  color: var(--scapi-muted);
  font-size: clamp(18px, 1.8vw, 25px);
  font-weight: 700;
}

.scapi-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  color: #1e2940;
  font-size: 20px;
  font-weight: 800;
}

.scapi-badges span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.scapi-divider {
  width: 1px;
  height: 28px;
  background: var(--scapi-line);
}

.scapi-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 36%, rgba(117, 86, 248, 0.18) 38% 100%);
  box-shadow: inset 0 0 0 2px rgba(116, 90, 250, 0.1);
}

.scapi-badge-icon.shield::before,
.scapi-badge-icon.bolt::before {
  display: block;
  color: #705cff;
  text-align: center;
  line-height: 32px;
  font-size: 18px;
}

.scapi-badge-icon.shield::before {
  content: "◆";
}

.scapi-badge-icon.bolt::before {
  content: "↯";
}

.scapi-hero-visual {
  position: relative;
  min-height: 480px;
}

.scapi-cube {
  position: absolute;
  top: 76px;
  left: 50%;
  width: clamp(260px, 31vw, 390px);
  aspect-ratio: 1;
  transform: translateX(-50%) rotate(-16deg);
  border-radius: 48px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(121, 105, 255, 0.16)),
    linear-gradient(315deg, rgba(255, 255, 255, 0.86), rgba(81, 104, 255, 0.23));
  box-shadow:
    0 44px 90px rgba(84, 100, 223, 0.22),
    inset 24px 24px 54px rgba(255, 255, 255, 0.72),
    inset -24px -24px 55px rgba(93, 93, 245, 0.24);
  animation: scapi-cube-float 7.5s ease-in-out infinite;
}

.scapi-cube::before,
.scapi-cube::after {
  position: absolute;
  inset: 42px;
  content: "";
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.scapi-cube::after {
  inset: auto 42px 28px auto;
  width: 44px;
  height: 210px;
  border-radius: 24px;
  background: linear-gradient(180deg, #9175ff, #666ff8);
  opacity: 0.7;
}

.scapi-cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.scapi-ai-disc {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 34% 28%, #95a9ff, #6758ff 58%, #4f55e5);
  box-shadow: 0 22px 44px rgba(85, 81, 236, 0.34);
  transform: rotate(16deg);
  animation: scapi-disc-breathe 4.8s ease-in-out infinite;
}

.scapi-ai-disc svg {
  width: 78px;
  height: 78px;
}

.scapi-base {
  position: absolute;
  top: 356px;
  left: 50%;
  width: min(500px, 76%);
  height: 110px;
  border-radius: 26px;
  transform: translateX(-50%) perspective(640px) rotateX(58deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(205, 216, 255, 0.58));
  box-shadow: 0 44px 70px rgba(82, 106, 208, 0.22);
  animation: scapi-base-shadow 7.5s ease-in-out infinite;
}

.scapi-orbit {
  position: absolute;
  left: 50%;
  top: 215px;
  width: 570px;
  height: 140px;
  border: 2px solid rgba(92, 116, 244, 0.16);
  border-radius: 50%;
  --scapi-orbit-start: -14deg;
  --scapi-orbit-end: 346deg;
  transform: translateX(-50%) rotate(var(--scapi-orbit-start));
  animation: scapi-orbit-drift 18s linear infinite;
}

.scapi-orbit.two {
  width: 450px;
  --scapi-orbit-start: 25deg;
  --scapi-orbit-end: 385deg;
  transform: translateX(-50%) rotate(var(--scapi-orbit-start));
  animation-duration: 24s;
  animation-direction: reverse;
}

.scapi-orbit::before,
.scapi-orbit::after {
  position: absolute;
  width: 20px;
  height: 20px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, #fff 20%, #7490ff 72%);
  box-shadow: 0 0 22px rgba(102, 121, 255, 0.42);
}

.scapi-orbit::before {
  left: 32px;
  top: 42px;
}

.scapi-orbit::after {
  right: 58px;
  bottom: 20px;
}

.scapi-models {
  text-align: center;
}

.scapi-models h2 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.2;
  font-weight: 900;
}

.scapi-section-mark {
  display: block;
  width: 34px;
  height: 4px;
  margin: 18px auto 36px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4c89ff, #7d55ff);
}

.scapi-model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  width: min(100%, 1240px);
  margin: 0 auto;
}

.scapi-model-card {
  min-height: 236px;
  padding: 28px 24px 26px;
  border: 1px solid rgba(111, 130, 199, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--scapi-shadow);
  transform: translateY(0);
  animation: scapi-card-rise 780ms ease backwards, scapi-card-float 7s ease-in-out infinite;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.scapi-model-card:nth-child(2) {
  animation-delay: 90ms, 1.1s;
}

.scapi-model-card:nth-child(3) {
  animation-delay: 180ms, 2.2s;
}

.scapi-model-card:nth-child(4) {
  animation-delay: 270ms, 3.3s;
}

.scapi-model-card:hover {
  border-color: rgba(91, 125, 255, 0.18);
  transform: translateY(-6px);
  box-shadow: 0 30px 86px rgba(67, 91, 159, 0.18);
}

.scapi-model-card strong {
  display: block;
  margin-bottom: 20px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  background: linear-gradient(90deg, #438bff, #8052ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scapi-model-icon {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px;
  border-radius: 50%;
  color: #4a86ff;
  background: linear-gradient(135deg, rgba(69, 134, 255, 0.15), rgba(116, 94, 255, 0.06));
}

.scapi-model-icon.purple {
  color: #7a55ff;
  background: linear-gradient(135deg, rgba(126, 85, 255, 0.18), rgba(100, 151, 255, 0.06));
}

.scapi-model-icon::before {
  content: "✺";
  font-size: 44px;
  line-height: 1;
  animation: scapi-icon-spin 9s linear infinite;
}

.scapi-model-card p {
  margin: 0;
  color: #566178;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.75;
}

.scapi-docs-page {
  background:
    radial-gradient(circle at 88% 0%, rgba(126, 93, 248, 0.14), transparent 32%),
    radial-gradient(circle at 18% 8%, rgba(75, 130, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f7f9ff 58%, #ffffff 100%);
}

.scapi-docs-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 38px clamp(20px, 5vw, 72px) 70px;
}

.scapi-docs-hero {
  width: min(780px, 100%);
  padding: 78px 0 34px;
}

.scapi-docs-kicker {
  margin: 0 0 12px;
  color: #5c6df5;
  font-size: 15px;
  font-weight: 900;
}

.scapi-docs-hero h1 {
  margin: 0 0 18px;
  color: #14203a;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
  font-weight: 900;
}

.scapi-docs-hero p:last-child {
  margin: 0;
  color: #59647b;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.7;
}

.scapi-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.scapi-docs-grid article,
.scapi-docs-card {
  border: 1px solid rgba(111, 130, 199, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 68px rgba(67, 91, 159, 0.1);
}

.scapi-docs-grid article {
  padding: 18px;
}

.scapi-docs-grid span {
  display: block;
  margin-bottom: 10px;
  color: #68738b;
  font-size: 13px;
  font-weight: 800;
}

.scapi-docs-grid code,
.scapi-docs-card code {
  color: #2747ca;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 14px;
  font-weight: 700;
}

.scapi-docs-content {
  display: grid;
  gap: 20px;
}

.scapi-docs-card {
  padding: clamp(20px, 3vw, 30px);
}

.scapi-docs-card h2 {
  margin: 0 0 14px;
  color: #17233f;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.scapi-docs-card p,
.scapi-docs-card dd {
  margin: 0 0 12px;
  color: #566178;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.75;
}

.scapi-docs-card a {
  color: #3d63f2;
  font-weight: 800;
  text-decoration: none;
}

.scapi-docs-card pre {
  overflow-x: auto;
  margin: 14px 0 0;
  padding: 16px;
  border: 1px solid rgba(86, 111, 199, 0.12);
  border-radius: 10px;
  background: #f5f7ff;
}

.scapi-docs-card pre code {
  color: #1e2a44;
  font-weight: 650;
  line-height: 1.65;
  white-space: pre;
}

.scapi-docs-card dl {
  margin: 0;
}

.scapi-docs-card dt {
  margin: 16px 0 6px;
  color: #17233f;
  font-size: 16px;
  font-weight: 900;
}

.scapi-docs-card dt:first-child {
  margin-top: 0;
}

.scapi-purchase-balance-link {
  font-weight: 600 !important;
}

.scapi-purchase-balance-link svg {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

.scapi-purchase-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.5em;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8em;
  font-weight: 800;
  background: #2563eb;
}

.scapi-settings-card {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.scapi-settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.scapi-settings-card h2 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.scapi-settings-card p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.scapi-settings-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  background: #dbeafe;
}

.scapi-settings-label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.scapi-settings-row {
  display: flex;
  gap: 10px;
}

.scapi-settings-row input {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  padding: 0 12px;
}

.scapi-settings-row button {
  flex: 0 0 auto;
  min-width: 86px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: #2563eb;
}

.scapi-settings-row button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.scapi-settings-status {
  min-height: 20px;
  margin-top: 10px;
  color: #66708a;
  font-size: 13px;
}

.scapi-settings-status[data-type="success"] {
  color: #168052;
}

.scapi-settings-status[data-type="error"] {
  color: #c2413a;
}

.scapi-settings-status[data-type="warn"] {
  color: #9a5b00;
}

@keyframes scapi-title-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes scapi-logo-pulse {
  0%,
  100% {
    transform: skewY(-8deg) translateY(0);
    box-shadow: 0 14px 30px rgba(88, 104, 243, 0.24);
  }

  50% {
    transform: skewY(-8deg) translateY(-3px);
    box-shadow: 0 20px 40px rgba(88, 104, 243, 0.32);
  }
}

@keyframes scapi-cube-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-16deg);
  }

  50% {
    transform: translateX(-50%) translateY(-18px) rotate(-12deg);
  }
}

@keyframes scapi-disc-breathe {
  0%,
  100% {
    transform: rotate(16deg) scale(1);
    box-shadow: 0 22px 44px rgba(85, 81, 236, 0.34);
  }

  50% {
    transform: rotate(16deg) scale(1.06);
    box-shadow: 0 28px 58px rgba(85, 81, 236, 0.42);
  }
}

@keyframes scapi-base-shadow {
  0%,
  100% {
    transform: translateX(-50%) perspective(640px) rotateX(58deg) scale(1);
    opacity: 1;
  }

  50% {
    transform: translateX(-50%) perspective(640px) rotateX(58deg) scale(0.94);
    opacity: 0.78;
  }
}

@keyframes scapi-orbit-drift {
  from {
    transform: translateX(-50%) rotate(var(--scapi-orbit-start));
  }

  to {
    transform: translateX(-50%) rotate(var(--scapi-orbit-end));
  }
}

@keyframes scapi-card-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scapi-card-float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -5px;
  }
}

@keyframes scapi-icon-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scapi-logo-mark,
  .scapi-hero h1,
  .scapi-cube,
  .scapi-ai-disc,
  .scapi-base,
  .scapi-orbit,
  .scapi-model-card,
  .scapi-model-icon::before {
    animation: none !important;
  }
}

.dark .scapi-settings-card,
html.dark .scapi-settings-card {
  border-color: #374151;
  background: #111827;
}

.dark .scapi-settings-card h2,
html.dark .scapi-settings-card h2,
.dark .scapi-settings-label,
html.dark .scapi-settings-label {
  color: #f9fafb;
}

.dark .scapi-settings-card p,
html.dark .scapi-settings-card p,
.dark .scapi-settings-status,
html.dark .scapi-settings-status {
  color: #d1d5db;
}

@media (max-width: 980px) {
  .scapi-home {
    padding: 24px 20px 44px;
  }

  .scapi-brand {
    font-size: 28px;
  }

  .scapi-logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 27px;
  }

  .scapi-doc-link {
    display: none;
  }

  .scapi-login-button {
    min-width: 82px;
    padding: 12px 18px;
    font-size: 16px;
  }

  .scapi-hero {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding-top: 54px;
  }

  .scapi-hero-copy {
    padding-left: 0;
  }

  .scapi-hero h1 {
    font-size: clamp(72px, 22vw, 112px);
  }

  .scapi-hero-line {
    font-size: clamp(23px, 6.4vw, 31px);
  }

  .scapi-hero-subtitle {
    margin-bottom: 34px;
  }

  .scapi-hero-visual {
    min-height: 470px;
    margin-bottom: 18px;
  }

  .scapi-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .scapi-docs-shell {
    padding: 24px 20px 46px;
  }

  .scapi-docs-hero {
    padding-top: 56px;
  }

  .scapi-docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .scapi-hero-visual {
    min-height: 462px;
    margin-top: 12px;
    margin-bottom: 22px;
  }

  .scapi-cube {
    top: 50px;
  }

  .scapi-base {
    top: 336px;
  }

  .scapi-models {
    position: relative;
    z-index: 2;
  }

  .scapi-model-grid {
    grid-template-columns: 1fr;
  }

  .scapi-badges {
    gap: 16px;
    font-size: 17px;
  }

  .scapi-divider {
    display: none !important;
  }

  .scapi-settings-row {
    flex-direction: column;
  }

  .scapi-settings-row button {
    width: 100%;
  }
}
