:root {
  --bg: #f5f7fb;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #657084;
  --line: #dce4f0;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --navy: #172033;
  --soft-blue: #eef4ff;
  --shadow: 0 18px 44px rgba(23, 32, 51, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.12), transparent 28rem),
    linear-gradient(180deg, #fff 0%, var(--bg) 36%);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.55;
}

body.intro-running {
  overflow: hidden;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 99, 235, 0.28), transparent 24rem),
    radial-gradient(circle at 12% 86%, rgba(22, 163, 74, 0.16), transparent 22rem),
    linear-gradient(180deg, #020617 0%, #07122d 54%, #0f172a 100%);
  transition: opacity 900ms ease, visibility 900ms ease;
}

.intro-overlay.done {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

#logoParticleCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#xmakerLogoSource {
  display: none;
}

.intro-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(48px, 9vh, 92px);
  display: grid;
  gap: 2px;
  width: min(520px, calc(100% - 40px));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  opacity: 0;
  animation: captionPulse 4.8s ease forwards;
}

.intro-caption span {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.intro-caption strong {
  color: white;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.site-header,
main,
.footer {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 900ms ease, transform 900ms ease;
}

body.intro-complete .site-header,
body.intro-complete main,
body.intro-complete .footer {
  opacity: 1;
  transform: translateY(0);
}

@keyframes captionPulse {
  0%, 12% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  30%, 68% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 32px;
  border-bottom: 1px solid rgba(220, 228, 240, 0.86);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
}

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

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 1.02fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 40px 0 32px;
}

.hero-copy {
  display: grid;
  gap: 22px;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(38px, 5.6vw, 70px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

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

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 900;
}

.btn.primary {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.btn.secondary {
  color: var(--blue);
  background: white;
}

.hero-visual img {
  display: block;
  width: 100%;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.section {
  padding: 42px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
}

.section-head p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
}

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

.principles article,
.lesson-detail,
.demo-screen,
.demo-notes,
.workflow article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.principles article {
  padding: 18px;
}

.principles span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: var(--radius);
  background: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.principles h3 {
  margin: 16px 0 8px;
  font-size: 20px;
}

.principles p,
.lesson-card p,
.detail-row p,
.demo-notes li {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-btn {
  min-height: 36px;
  padding: 7px 11px;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font-size: 13px;
  font-weight: 900;
}

.filter-btn.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.lesson-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.48fr);
  gap: 18px;
  align-items: start;
}

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

.lesson-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.lesson-card:hover,
.lesson-card.active {
  border-color: #9db9ff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.13);
}

.lesson-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-no {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: var(--radius);
  background: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.phase {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.lesson-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.lesson-card p {
  margin: 0;
  font-size: 14px;
}

.lesson-detail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  padding: 20px;
}

.lesson-detail h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.detail-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.detail-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-row p {
  margin: 0;
}

.demo-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 18px;
  align-items: stretch;
}

.demo-screen {
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.browser-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
}

.browser-bar span:first-child {
  background: #ef4444;
}

.browser-bar span:nth-child(2) {
  background: #f59e0b;
}

.browser-bar span:nth-child(3) {
  background: #22c55e;
}

.browser-bar strong {
  margin-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.demo-preview {
  min-height: 360px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.9), rgba(255, 255, 255, 0.95)),
    #fff;
}

.lesson-demo {
  display: grid;
  gap: 14px;
}

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

.demo-title h4 {
  margin: 0;
  font-size: 26px;
}

.mock-chip {
  padding: 7px 10px;
  color: var(--blue);
  border-radius: 999px;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 900;
}

.mock-grid,
.page-grid,
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mock-card,
.page-tile,
.metric-tile {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.mock-card strong,
.page-tile strong,
.metric-tile strong {
  display: block;
  margin-bottom: 8px;
}

.mock-code,
pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: #dbeafe;
  border-radius: var(--radius);
  background: #0f172a;
  font-size: 13px;
}

.file-tree {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.tree-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: #f8fafc;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
}

.tree-row span:last-child {
  color: var(--muted);
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
}

.app-home {
  padding: 20px;
  color: white;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #172033, #2563eb);
}

.app-home h4 {
  margin: 0 0 10px;
  font-size: 30px;
}

.app-home p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.nav-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.nav-demo span {
  padding: 8px 10px;
  color: var(--blue);
  border-radius: var(--radius);
  background: var(--soft-blue);
  font-size: 13px;
  font-weight: 900;
}

.form-demo {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.input-line {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.fake-input {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.fake-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: white;
  border-radius: var(--radius);
  background: var(--blue);
  font-weight: 900;
}

.api-box {
  display: grid;
  grid-template-columns: 180px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.api-route {
  padding: 18px;
  color: #fff;
  background: #0f172a;
  font-family: Menlo, Consolas, monospace;
}

.api-json {
  padding: 18px;
  color: #dbeafe;
  background: #172033;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.chart-demo {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.chart-bar {
  display: grid;
  align-items: end;
  gap: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-bar i {
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.chat-demo {
  display: grid;
  gap: 10px;
}

.bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.bubble.user {
  justify-self: end;
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.hardware-demo {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.board {
  display: grid;
  place-items: center;
  min-height: 150px;
  border-radius: var(--radius);
  background: #0f172a;
}

.led {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 30px rgba(22, 163, 74, 0.7);
}

.hardware-lines {
  display: grid;
  gap: 8px;
}

.desktop-demo {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.window-demo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.window-demo header {
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.window-demo div {
  padding: 18px;
}

.guide-list {
  display: grid;
  gap: 10px;
}

.guide-list p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.demo-notes {
  padding: 22px;
}

.demo-notes h3 {
  margin: 0 0 12px;
}

.demo-notes ol {
  margin: 0;
  padding-left: 21px;
}

.demo-notes li + li {
  margin-top: 9px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow article {
  padding: 18px;
}

.workflow h3 {
  margin: 0 0 12px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: white;
  background: var(--navy);
}

.footer span {
  color: rgba(255, 255, 255, 0.74);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .principles,
  .lesson-workbench,
  .lesson-grid,
  .demo-board,
  .workflow {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    justify-content: flex-start;
  }

  .lesson-detail {
    position: static;
  }

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

  .api-box,
  .hardware-demo,
  .input-line {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.intro-running {
    overflow: auto;
  }

  .intro-overlay {
    display: none;
  }

  .site-header,
  main,
  .footer {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
