:root {
  --bg: #080d0d;
  --bg-2: #0d1515;
  --card: #111b1a;
  --card-2: #162422;
  --ink: #f1f6f5;
  --ink-2: #b5c4c1;
  --muted: #768a86;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, .16);
  --amber: #f59e0b;
  --orange: #f97316;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* 顶栏 */
.topbar {
  position: fixed; inset: 0 0 auto; height: 66px; z-index: 40;
  background: rgba(8, 13, 13, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--teal); color: #041412;
  display: grid; place-items: center; font-weight: 900; font-size: 14px;
}
.brand small {
  font: 500 11px var(--mono); color: var(--muted);
  border-left: 1px solid var(--line-strong); padding-left: 12px; letter-spacing: .08em;
}
.nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--ink-2); }
.nav a:hover { color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-login { font-size: 13px; color: var(--ink-2); padding: 6px 10px; transition: color .14s; }
.nav-login:hover { color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-strong);
  transition: transform .14s, background .14s, border-color .14s, color .14s;
}
.btn:active { transform: scale(.985); }
.btn.sm { padding: 7px 13px; font-size: 12.5px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #080d0d; }
.btn.primary:hover { background: #ffffff; transform: translateY(-1px); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #041412; }
.btn.teal:hover { background: #2dd4bf; transform: translateY(-1px); }
.btn.ghost { background: rgba(255, 255, 255, .04); color: var(--ink); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .32); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 11.5px var(--mono); letter-spacing: .14em; color: #5eead4;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* ═══ 第 1 幕 #home：黑底聚光 · 超大立体乐高 codinghub 互动舞台 ═══ */
.hero {
  padding: 96px 0 48px;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(ellipse 70% 45% at 50% 46%, rgba(20, 184, 166, .13), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 100%, 28px 28px, 100% 100%;
  border-bottom: 1px solid var(--line);
}
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(38px, 4.8vw, 66px);
  line-height: 1.1; letter-spacing: -.035em; font-weight: 700; color: #fff;
}
.hero h1 em { font-style: normal; color: #5eead4; }
.hero-lead { margin: 0; font-size: 16px; color: var(--ink-2); max-width: 560px; line-height: 1.75; }
.hero-meta { text-align: right; font: 500 11.5px/1.8 var(--mono); color: var(--muted); }

.lego-stage-wrap {
  position: relative;
  margin: 22px -12px 18px;
  cursor: pointer;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 27, 26, .55);
  padding: 8px 12px;
}
.lego-stage-wrap canvas { width: 100%; height: auto; display: block; aspect-ratio: 1180 / 310; }
.lego-tip {
  position: absolute; bottom: 12px; right: 18px;
  font: 500 11.5px var(--mono); color: var(--muted);
  background: rgba(8, 13, 13, .72); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line);
}

.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.hero-btns { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); display: inline-block; }

/* ═══ 通用章节与产品窗口 ═══ */
.scene { padding: 84px 0; border-bottom: 1px solid var(--line); }
.scene.alt { background: var(--bg-2); }
.scene-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 26px; flex-wrap: wrap; }
.scene-head h2 { margin: 12px 0 0; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.15; letter-spacing: -.03em; font-weight: 700; color: #fff; }
.scene-head p { margin: 0; max-width: 440px; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }

.product-window {
  border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden;
  background: var(--card); box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}
.win-bar {
  min-height: 46px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #131f1e; border-bottom: 1px solid var(--line); font: 600 12px var(--mono); color: var(--ink-2);
}
.win-title { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.real-badge {
  font-family: var(--sans); font-size: 11px; font-weight: 600; color: #5eead4;
  background: rgba(20, 184, 166, .14); border: 1px solid rgba(20, 184, 166, .35);
  padding: 2px 9px; border-radius: 99px;
}
.win-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.studio-vp { position: relative; width: 100%; aspect-ratio: 16 / 9.2; background: #0c1726; overflow: hidden; }
.studio-vp iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.vp-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--ink-2); font-size: 14px; background: radial-gradient(circle at 50% 45%, rgba(20, 184, 166, .08), transparent 60%);
}
.board-notes {
  margin-top: 18px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--ink-2);
}
.board-notes b { font-family: var(--mono); color: #5eead4; margin-right: 6px; }

/* ═══ 第 3 幕 #workflow：暗夜剧场 · 6 角色小人走动交接 + 打回重做 ═══ */
.theatre-box {
  border-radius: 16px; background: var(--card);
  border: 1px solid var(--line-strong); overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .48);
}
.theatre-top {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  font: 600 11.5px var(--mono); color: var(--muted);
}
.theatre-state {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: #5eead4;
  padding: 4px 12px; border-radius: 99px; background: rgba(20, 184, 166, .16);
}
.theatre-state.warn { color: #fde68a; background: rgba(245, 158, 11, .22); }
.theatre-canvas-wrap { padding: 8px 12px 0; background: #0a1212; }
.theatre-canvas-wrap canvas { width: 100%; height: auto; display: block; aspect-ratio: 1120 / 360; }

.theatre-stations {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.t-station {
  padding: 10px 8px; border-radius: 9px; text-align: center;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  color: var(--ink-2); transition: background .15s, border-color .15s, transform .15s;
}
.t-station:hover { background: rgba(255, 255, 255, .08); transform: translateY(-2px); }
.t-station.active { background: rgba(20, 184, 166, .18); border-color: #5eead4; color: #fff; }
.t-station.returned { background: rgba(245, 158, 11, .2); border-color: #fbbf24; color: #fef3c7; }
.t-station i { display: block; font: 700 10.5px var(--mono); opacity: .7; font-style: normal; }
.t-station strong { display: block; font-size: 13.5px; margin-top: 2px; }

.theatre-foot {
  padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  border-top: 1px solid var(--line); background: #0c1414;
}
.theatre-foot h3 { margin: 0 0 6px; font-size: 19px; color: #fff; }
.theatre-foot p { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: 660px; line-height: 1.65; }
.theatre-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-btn {
  padding: 9px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--ink); background: rgba(255, 255, 255, .05);
}
.t-btn:hover { background: rgba(255, 255, 255, .12); }
.t-btn.warn { border-color: #f59e0b; color: #fde68a; background: rgba(245, 158, 11, .16); }

/* ═══ 第 4 幕 #agents：深色立体乐高角色积木组装台 ═══ */
.bricks-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px;
  padding: 26px 0 24px;
}
.role-brick {
  position: relative; text-align: left; padding: 24px 16px 18px; border-radius: 8px;
  background: var(--card-2); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--bc), transparent 55%);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--bc), #000 68%);
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), border-color .18s;
}
.role-brick::before, .role-brick::after {
  content: ""; position: absolute; top: -9px; width: 30px; height: 12px; border-radius: 50%;
  background: var(--bc); opacity: .88;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--bc), #000 50%);
}
.role-brick::before { left: 16%; }
.role-brick::after { right: 16%; }
.role-brick:hover { transform: translateY(-7px); border-color: var(--bc); }
.role-brick.active { transform: translateY(-12px); border-color: var(--bc); background: color-mix(in srgb, var(--bc) 16%, #111b1a); }
.role-brick small { display: block; font: 700 10px var(--mono); color: var(--bc); letter-spacing: .06em; }
.role-brick strong { display: block; font-size: 16.5px; margin: 10px 0 6px; font-weight: 700; color: #fff; }
.role-brick span { display: block; font-size: 11.5px; color: var(--ink-2); }

.role-brick-detail {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  padding: 22px 26px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line-strong);
}
.rb-detail-left strong { display: block; font-size: 21px; margin: 6px 0 4px; color: #fff; }
.rb-tag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--teal-soft); color: #5eead4; font: 600 11px var(--mono); }
.rb-agent { font-size: 12.5px; color: var(--muted); }
.rb-agent code { font-family: var(--mono); color: #5eead4; background: rgba(255, 255, 255, .06); padding: 2px 6px; border-radius: 4px; }
.role-brick-detail p { margin: 0; max-width: 640px; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }

/* ═══ 收尾幕：电影聚光 ═══ */
.finale {
  background: radial-gradient(ellipse 65% 60% at 50% 100%, rgba(20, 184, 166, .2), transparent 72%), #060a0a;
  padding: 90px 0 40px;
}
.finale h2 { margin: 18px 0 14px; font-size: clamp(38px, 5.4vw, 72px); line-height: 1.08; letter-spacing: -.04em; font-weight: 700; color: #fff; }
.finale h2 span { color: #5eead4; }
.finale p { margin: 0 0 32px; font-size: 16.5px; color: var(--ink-2); max-width: 580px; }
.finale-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-line {
  margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 500 12px var(--mono); color: var(--muted);
}

@media (max-width: 980px) {
  .bricks-grid { grid-template-columns: repeat(3, 1fr); gap: 26px 14px; }
  .theatre-stations { grid-template-columns: repeat(3, 1fr); }
  .nav, .brand small { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .bricks-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 84px 0 36px; }
}
