:root {
  --black: rgba(0, 0, 0, 0.95);
  --white: #ffffff;
  --warm-white: #f6f5f4;
  --warm-dark: #31302e;
  --gray-500: #615d59;
  --gray-300: #a39e98;
  --blue: #0075de;
  --blue-active: #005bab;
  --badge-bg: #f2f9ff;
  --border: 1px solid rgba(0, 0, 0, 0.1);
  --shadow-card: rgba(0, 0, 0, 0.04) 0 4px 18px,
    rgba(0, 0, 0, 0.027) 0 2px 8px,
    rgba(0, 0, 0, 0.02) 0 1px 3px;
  --action: rgb(55, 115, 210);
  --action-2: rgb(64, 130, 218);
  --control: rgb(218, 150, 20);
  --start: rgb(218, 160, 20);
  --sensing: rgb(72, 154, 186);
  --operator: rgb(65, 154, 66);
  --void: rgb(108, 78, 176);
  --variable: rgb(218, 118, 18);
  --bouncer: rgb(39, 145, 105);
  --freezer: rgb(85, 170, 205);
  --rollback: rgb(255, 116, 190);
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  border-bottom: var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: var(--gray-500);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--black);
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 56px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 32px 72px;
}

.hero h1 {
  max-width: 720px;
  margin: 0 0 18px;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  margin: 0 0 28px;
  color: var(--gray-500);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.55;
}

.eyebrow,
.section-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--gray-300);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.125px;
  text-transform: uppercase;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

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

.button.primary:hover {
  background: var(--blue-active);
}

.button.secondary {
  background: rgba(0, 0, 0, 0.05);
}

.hero-visual {
  min-width: 0;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border);
  border-radius: 8px;
  background: var(--warm-white);
  box-shadow: var(--shadow-card);
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px;
}

.section.warm {
  max-width: none;
  background: var(--warm-white);
  padding-left: 0;
  padding-right: 0;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p {
  margin: 0;
  color: var(--gray-500);
  font-size: 18px;
}

.intro-grid,
.accessory-grid,
.win-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.accessory-grid,
.win-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.guide-block {
  border: var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.info-card {
  padding: 24px;
}

.info-card h2,
.info-card h3 {
  margin: 8px 0 8px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.info-card p,
.guide-block p {
  margin: 0;
  color: var(--gray-500);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: #097fe8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.125px;
}

.badge.green {
  background: rgba(26, 174, 57, 0.1);
  color: #14862c;
}

.badge.teal {
  background: rgba(42, 157, 153, 0.1);
  color: #207c79;
}

.badge.cyan {
  background: rgba(85, 170, 205, 0.15);
  color: #247ba0;
}

.badge.orange {
  background: rgba(221, 91, 0, 0.12);
  color: #b64b00;
}

.badge.red {
  background: rgba(255, 82, 82, 0.12);
  color: #c93333;
}

.content-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: var(--border);
  border-radius: 8px;
  background: var(--white);
}

.toc a {
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.toc a:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--black);
}

.guide-stack {
  display: grid;
  gap: 20px;
}

.guide-block {
  padding: 28px;
  scroll-margin-top: 92px;
}

.guide-block h3 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.guide-block p + p,
.guide-block .example-row + p {
  margin-top: 16px;
}

.example-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 18px 0;
}

.mini-program {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  padding: 16px;
  border-radius: 8px;
  background: #303442;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.mini-program.loose {
  gap: 10px;
}

.block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.block.stack {
  width: 154px;
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 8px;
  padding-left: 12px;
  margin-bottom: 7px;
}

.block.stack::before {
  content: "";
  position: absolute;
  left: 24px;
  top: -1px;
  width: 30px;
  height: 7px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
}

.block.stack::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -7px;
  width: 30px;
  height: 10px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
}

.block.stack.start {
  background: var(--start);
}

.block.stack.start::before,
.block.event::before {
  display: none;
}

.block.stack.action {
  background: var(--action);
}

.block.stack.action.wide {
  width: 214px;
}

.block.stack.action.small {
  width: auto;
  min-width: 84px;
}

.block.stack.void {
  width: 180px;
  background: var(--void);
}

.block.stack.bouncer {
  width: 170px;
  background: var(--bouncer);
}

.block.stack.freezer {
  width: 170px;
  background: var(--freezer);
}

.block.stack.rollback {
  width: 214px;
  background: var(--rollback);
  outline: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.30),
    inset 0 -3px 0 rgba(0, 0, 0, 0.20);
}

.block.stack.rollback::before,
.block.stack.rollback::after {
  background: rgba(255, 255, 255, 0.32);
}

.block.stack.tiny {
  width: auto;
  min-width: 108px;
  min-height: 30px;
  margin: 0 2px;
}

.input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 20px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 9999px;
  background: #fff;
  color: #374150;
}

.dropdown {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 7px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.12);
}

.socket {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 54px;
  height: 18px;
  margin: 0 6px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.32);
  flex-shrink: 0;
}

.block.condition {
  min-width: 126px;
  height: 24px;
  background: var(--sensing);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  box-shadow: none;
}

.block.reporter {
  min-width: 190px;
  height: 26px;
  border-radius: 9999px;
  background: var(--sensing);
}

.block.event {
  min-width: 188px;
  height: 38px;
  justify-content: flex-start;
  gap: 2px;
  border-radius: 8px;
  background: var(--start);
}

.ui-chip,
.code-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: var(--border);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--warm-dark);
  font-size: 13px;
  font-weight: 800;
}

.code-chip {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
}

.monitor-demo {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(34, 38, 50, 0.94);
  border: 1px solid rgba(242, 148, 28, 0.72);
}

.monitor-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #c3cde1;
  font-size: 12px;
  font-weight: 800;
}

.monitor-row b {
  color: rgb(242, 148, 28);
}

.rule-list {
  margin: 14px 0;
  padding-left: 22px;
  color: var(--gray-500);
}

.rule-list li + li {
  margin-top: 8px;
}

.logic-ladder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.lane {
  padding: 14px;
  border-radius: 8px;
  background: #303442;
}

.lane-title {
  display: block;
  margin-bottom: 10px;
  color: #c3cde1;
  font-size: 12px;
  font-weight: 800;
}

.screenshot-frame {
  margin: 20px 0 0;
  padding: 10px;
  border: var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--border);
  border-radius: 6px;
  background: var(--warm-white);
}

.screenshot-frame figcaption {
  margin: 9px 2px 0;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.compact-shot {
  max-width: 430px;
}

.wide-shot {
  margin-top: 24px;
}

.screenshot-pair {
  display: grid;
  gap: 16px;
}

.screenshot-pair .screenshot-frame {
  margin-top: 0;
}

.capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: stretch;
}

.capture-steps {
  display: grid;
  gap: 14px;
}

.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.step span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
}

.step p {
  margin: 0;
  color: var(--gray-500);
  font-weight: 600;
}

.footer {
  border-top: var(--border);
  padding: 28px 32px;
  color: var(--gray-500);
  text-align: center;
  font-size: 14px;
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .capture-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .intro-grid,
  .accessory-grid,
  .win-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 560px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 20px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .hero,
  .section,
  .section-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding-top: 56px;
  }

  .hero p {
    font-size: 18px;
  }

  .example-row,
  .logic-ladder {
    grid-template-columns: 1fr;
  }

  .arena {
    min-height: 300px;
  }

  .guide-block,
  .info-card {
    padding: 20px;
  }
}
