:root {
  --bg: #0d1117;
  --bg-soft: #0a0e14;
  --bg-card: #111826;
  --bg-card-hover: #16202f;
  --border: #1f2a3a;
  --text: #e6edf3;
  --text-dim: #8b98a9;
  --text-faint: #5c6a7d;
  --accent: #34d399;
  --accent-dim: #10b981;
  --blue: #58a6ff;
  --red: #f7523f;
  --yellow: #ffd43b;
  --mono:
    "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", Menlo,
    monospace;
  --sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --nav-h: 56px;
  --radius: 12px;
  --maxw: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 网格底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 50% 0%,
      rgba(52, 211, 153, 0.08),
      transparent 55%
    ),
    linear-gradient(rgba(88, 166, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 166, 255, 0.045) 1px, transparent 1px);
  background-size:
    100% 100%,
    42px 42px,
    42px 42px;
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(88, 166, 255, 0.12);
  color: #9ecbff;
  padding: 2px 6px;
  border-radius: 5px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13, 17, 23, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.nav__logo {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  white-space: nowrap;
}

.nav__logo:hover {
  text-decoration: none;
}

.nav__logo .bolt {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav__links a {
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
}

.nav__links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav__links a.is-active {
  color: var(--accent);
  background: rgba(52, 211, 153, 0.1);
}

.nav__cta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav__cta:hover {
  background: rgba(52, 211, 153, 0.1);
  text-decoration: none;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
}

.nav__toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(13, 17, 23, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .nav.open .nav__links {
    display: flex;
  }

  .nav__links a {
    display: block;
    padding: 12px 24px;
    border-radius: 0;
  }

  .nav__toggle {
    display: block;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.07);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 22px;
}

.hero__badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin-top: 20px;
  max-width: 640px;
  color: var(--text-dim);
  font-size: clamp(15px, 2vw, 17px);
}

.hero__ctas {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 8px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #06231a;
}

.btn--primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

/* 终端窗口 */
.hero__terminal {
  margin-top: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  max-width: 860px;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #151c28;
  border-bottom: 1px solid var(--border);
}

.term__bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.term__bar .dot:nth-child(1) {
  background: #ff5f57;
}
.term__bar .dot:nth-child(2) {
  background: #febc2e;
}
.term__bar .dot:nth-child(3) {
  background: #28c840;
}

.term__title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.term__body {
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 2;
  overflow-x: auto;
}

.term__line {
  color: var(--text-dim);
  white-space: pre;
}

/* 最后一行（状态行）允许换行，避免窄屏横向溢出 */
.term__line:last-child {
  white-space: normal;
}

.term__line .ok {
  color: var(--accent);
}

.term__cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Section 通用 ---------- */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.section__head {
  margin-bottom: 40px;
}

.section__kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section h2 {
  margin-top: 8px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section__lead {
  margin-top: 12px;
  color: var(--text-dim);
  max-width: 720px;
  font-size: 15px;
}

/* ---------- 架构研究 ---------- */
.arch-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.arch-row {
  display: grid;
  grid-template-columns: 130px 200px 1fr;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.arch-row:last-child {
  border-bottom: none;
}

.arch-row:hover {
  background: var(--bg-card-hover);
}

.arch-row__lang {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.arch-row__lang::before {
  content: "▸";
  color: var(--accent);
  font-size: 14px;
}

.arch-row__role {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.arch-row__detail {
  font-size: 14px;
  color: var(--text-dim);
}

@media (max-width: 760px) {
  .arch-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* 数据流 */
.dataflow {
  margin-top: 26px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  background: rgba(88, 166, 255, 0.03);
}

.dataflow h3 {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--blue);
  margin-bottom: 12px;
}

.dataflow ol {
  list-style: none;
  counter-reset: df;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
}

.dataflow li {
  counter-increment: df;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-dim);
}

.dataflow li::before {
  content: "→";
  color: var(--accent);
  margin-right: 10px;
}

.dataflow li:first-child::before {
  content: "▸";
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.card__icon {
  font-size: 26px;
}

.card__tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 4px;
  padding: 1px 7px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 10px;
}

.card p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------- 挑战（编号列表） ---------- */
.challenge-list {
  display: grid;
  gap: 14px;
}

.challenge-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.challenge-item:hover {
  border-color: rgba(247, 82, 63, 0.4);
}

.challenge-item__icon {
  font-size: 22px;
  text-align: center;
  padding-top: 2px;
}

.challenge-item h3 {
  font-size: 15.5px;
  font-weight: 700;
}

.challenge-item p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------- 路线图 ---------- */
.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.phase {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: var(--bg-card);
  position: relative;
}

.phase:hover {
  border-color: rgba(52, 211, 153, 0.45);
}

.phase__badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--bg);
  background: var(--accent);
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
}

.phase h3 {
  margin-top: 12px;
  font-size: 15.5px;
}

.phase ul {
  margin-top: 8px;
  list-style: none;
}

.phase li {
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
  margin-top: 4px;
}

.phase li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 72px;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(52, 211, 153, 0.04));
}

.footer h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
}

.footer h2 .grad {
  background: linear-gradient(100deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer p {
  margin: 14px auto 28px;
  color: var(--text-dim);
  max-width: 560px;
  font-size: 15px;
}

.footer__ctas {
  justify-content: center;
}

.footer__meta {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.footer__meta a {
  color: var(--text-faint);
}

.footer__meta a:hover {
  color: var(--accent);
}
