:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --ink: #1f2328;
  --muted: #5f6b7a;
  --accent: #0085bf;
  --accent-strong: #005f8b;
  --ink-2: #343434;
  --card: #ffffff;
  --line: rgba(31, 35, 40, 0.12);
  --shadow: 0 20px 40px rgba(6, 18, 36, 0.08);
  --radius: 3px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216;
  --ink: #f3f5f7;
  --muted: #c0c7d1;
  --accent: #33a8dc;
  --accent-strong: #1b7faa;
  --ink-2: #e6ebf1;
  --card: #161b22;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  min-height: 100vh;
}

body.is-loading .page {
  opacity: 0;
}

.page-skeleton {
  display: none;
}

body.is-loading .page-skeleton {
  display: grid;
  gap: 18px;
  padding: 20px 0 40px;
}

.page-skeleton > div {
  height: 24px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(0, 133, 191, 0.08), rgba(0, 133, 191, 0.18), rgba(0, 133, 191, 0.08));
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

.page-skeleton .skeleton-top {
  height: 40px;
}

.page-skeleton .skeleton-hero {
  height: 160px;
}

.page-skeleton .skeleton-grid {
  height: 220px;
}

@keyframes skeleton {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

[data-theme="dark"] body {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

@media (max-width: 900px), (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  /* Top padding lives on the sticky header so it can "stick" flush to the viewport. */
  padding: 0 24px 48px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  background: rgba(246, 248, 251, 0.88);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .nav {
  background: rgba(15, 18, 22, 0.72);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.brand-logo {
  width: 110px;
  height: auto;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.brand-word {
  font-family: "JetBrains Mono", monospace;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-ligatures: none;
  text-rendering: geometricPrecision;
}

.nav__links {
  display: flex;
  gap: 14px;
  font-weight: 500;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  justify-content: center;
  font-size: 13px;
}

.nav__links a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.7;
  white-space: nowrap;
  font-size: 13px;
}

.nav__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  white-space: nowrap;
}

.button {
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav__cta .button {
  padding: 8px 14px;
  font-size: 13px;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 133, 191, 0.2);
}

.button--solid {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.button--ghost {
  background: var(--card);
}

.nav__toggles {
  display: flex;
  gap: 8px;
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding: 40px 0 20px;
  align-items: stretch;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 133, 191, 0.08);
  border: 1px solid rgba(0, 133, 191, 0.2);
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.1;
  margin: 16px 0 12px;
}

.hero__line {
  display: block;
}

.hero__line--accent {
  color: var(--accent);
}

.hero__lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.hero__cta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.cta-bar__item {
  font-size: 14px;
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}

.hero__cta-bar code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(0, 133, 191, 0.12);
  color: var(--accent-strong);
  padding: 3px 6px;
  border-radius: var(--radius);
  margin-left: 6px;
}

.hero__cta-bar .button {
  white-space: nowrap;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat__value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-strong);
}

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

.hero__board {
  display: grid;
  gap: 16px;
  align-content: start;
}

.board__card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.board__card--accent {
  border-color: rgba(0, 133, 191, 0.4);
  box-shadow: 0 18px 40px rgba(0, 133, 191, 0.15);
}

.board__title {
  font-weight: 700;
  margin-bottom: 8px;
}

.board__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.board__tags span {
  background: rgba(0, 133, 191, 0.12);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
}

.section {
  padding: 56px 0 24px;
}

.section__head {
  text-align: left;
  margin-bottom: 24px;
}

.section__head h2 {
  font-size: clamp(26px, 3vw, 38px);
  margin-bottom: 8px;
}

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

.section--insights {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}

.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.insights__intro p {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}

.insights__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.insights__values span {
  background: rgba(0, 133, 191, 0.1);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
}

.insights__carousel {
  display: grid;
  gap: 12px;
}

.insights__slides {
  position: relative;
  min-height: 140px;
}

.insight {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(0, 133, 191, 0.06);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.insight.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.insight h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.insight p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.insights__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.insights__dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 133, 191, 0.2);
}

.dot.is-active {
  background: var(--accent);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.pillar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pillar__index {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.pillar h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.pillar p {
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.pillar p.pillar__story {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0;
}

.pillar ul {
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.pillar ul strong {
  font-weight: 600;
  color: var(--ink);
}

.section--signal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 24px;
  box-shadow: var(--shadow);
}

.signal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
}

.signal__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.signal__map {
  background: rgba(0, 133, 191, 0.08);
  border: 1px solid rgba(0, 133, 191, 0.2);
  padding: 18px;
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
}

.signal__node {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 600;
}

.signal__node--accent {
  border-color: var(--accent);
  color: var(--accent);
}

.signal__line {
  height: 2px;
  background: rgba(0, 133, 191, 0.4);
}

.signal__branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.signal__branches span {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 12px;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.code-tabs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.code-tab {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow);
}

.code-tabs__panel {
  display: none;
}

.code-tabs__panel.is-active {
  display: block;
}

.code-block {
  background: #0c0d11;
  color: #f5f7ff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 60px rgba(4, 6, 20, 0.45);
  background-image: linear-gradient(145deg, rgba(0, 133, 191, 0.18), rgba(12, 13, 17, 0));
  border-top: 2px solid rgba(0, 133, 191, 0.5);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.code-lang {
  display: none;
}

body[data-lang="zh-CN"] .code-lang--zh {
  display: block;
}

body[data-lang="en"] .code-lang--en {
  display: block;
}

.code-block__title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #7dc4ff;
}

.code-block__result {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.code-block__label {
  font-size: 12px;
  color: rgba(245, 247, 255, 0.7);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

pre {
  font-family: "JetBrains Mono", monospace;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13px;
  color: #c9d6f2;
}

.stream-output {
  position: relative;
  min-height: 72px;
}

.stream-output code {
  white-space: pre-wrap;
}

.stream-caret {
  display: inline-block;
  margin-left: 2px;
  color: #7dc4ff;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

.hero__content,
.hero__board,
.pillar,
.signal,
.code-block,
.docs-card {
  animation: fadeUp 0.6s ease both;
}

.hero__board .board__card:nth-child(2) {
  animation-delay: 0.08s;
}

.hero__board .board__card:nth-child(3) {
  animation-delay: 0.16s;
}

.pillar:nth-child(2) { animation-delay: 0.06s; }
.pillar:nth-child(3) { animation-delay: 0.12s; }
.pillar:nth-child(4) { animation-delay: 0.18s; }
.pillar:nth-child(5) { animation-delay: 0.24s; }

.docs-card:nth-child(2) { animation-delay: 0.06s; }
.docs-card:nth-child(3) { animation-delay: 0.12s; }
.docs-card:nth-child(4) { animation-delay: 0.18s; }
.docs-card:nth-child(5) { animation-delay: 0.24s; }
.docs-card:nth-child(6) { animation-delay: 0.3s; }
.docs-card:nth-child(7) { animation-delay: 0.36s; }
.docs-card:nth-child(8) { animation-delay: 0.42s; }
.docs-card:nth-child(9) { animation-delay: 0.48s; }

.section--docs {
  padding-top: 16px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.docs-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.docs-card h3 {
  margin-bottom: 8px;
}

.docs-card p {
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.docs-card a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
}

.section--cta {
  padding-bottom: 80px;
}

.cta {
  background: linear-gradient(120deg, rgba(0, 133, 191, 0.95), rgba(52, 52, 52, 0.9));
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.cta__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.cta__qr {
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 76px;
  height: 76px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.cta__qr img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.footer__links {
  display: flex;
  gap: 16px;
}

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

@media (max-width: 960px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav__links {
    flex-wrap: wrap;
  }

  .hero__cta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 961px) {
  .hero__cta-bar {
    flex-wrap: nowrap;
  }
}

@media (max-width: 640px) {
  .nav__cta {
    width: 100%;
  }

  .nav__cta .button {
    flex: 1;
  }

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

  .footer {
    flex-direction: column;
  }
}
