:root {
  --bg: #080d13;
  --bg-soft: #0c121b;
  --panel: rgba(17, 25, 36, 0.84);
  --panel-strong: #121b27;
  --line: rgba(159, 184, 208, 0.17);
  --text: #e7eef5;
  --muted: #92a3b5;
  --accent: #47e6b1;
  --accent-2: #7cb9ff;
  --warn: #ffc76a;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #edf2f6;
  --bg-soft: #e6edf3;
  --panel: rgba(255, 255, 255, 0.8);
  --panel-strong: #ffffff;
  --line: rgba(34, 55, 73, 0.15);
  --text: #12202e;
  --muted: #5c6e7f;
  --accent: #07815c;
  --accent-2: #176fc6;
  --shadow: 0 18px 50px rgba(34, 60, 82, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 70%);
  opacity: .3;
}
body::before {
  content: "";
  position: fixed;
  width: 50vw;
  height: 50vw;
  left: -15vw;
  top: -22vw;
  z-index: -3;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-2) 22%, transparent);
  filter: blur(90px);
}

.section-shell { width: min(1180px, calc(100% - 44px)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
  background: color-mix(in srgb, var(--bg) 83%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent); font: 600 13px var(--mono); letter-spacing: .05em;
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 14px; letter-spacing: .02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.top-nav { display: flex; gap: 28px; color: var(--muted); font-size: 13px; }
.top-nav a { position: relative; padding: 10px 0; }
.top-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 4px; height: 1px; background: var(--accent); transition: right .2s ease; }
.top-nav a:hover { color: var(--text); }
.top-nav a:hover::after { right: 0; }
.icon-button {
  justify-self: end; width: 38px; height: 38px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.icon-button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.lang-button {
  min-width: 46px; height: 38px; padding: 0 10px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: 600 10px var(--mono); letter-spacing: .06em;
}
.lang-button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.hero { min-height: 720px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 76px; align-items: center; padding: 88px 0 70px; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font: 600 11px var(--mono); letter-spacing: .13em; }
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(42px, 5.8vw, 76px); line-height: 1.08; letter-spacing: -.045em; }
.hero h1 span { color: var(--muted); font-weight: 500; }
.hero-lead { max-width: 730px; margin: 30px 0 0; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.button.primary { color: #07130f; background: var(--accent); }
.button.ghost { border: 1px solid var(--line); color: var(--text); background: color-mix(in srgb, var(--panel) 65%, transparent); }
.button:hover { transform: translateY(-1px); }

.hero-panel { position: relative; min-height: 440px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, color-mix(in srgb, var(--panel-strong) 90%, transparent), color-mix(in srgb, var(--panel) 65%, transparent)); box-shadow: var(--shadow); overflow: hidden; }
.hero-panel::after { content: ""; position: absolute; inset: auto -15% -35% 5%; height: 55%; background: color-mix(in srgb, var(--accent) 10%, transparent); filter: blur(50px); }
.panel-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .08em; }
.panel-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.signal-map { position: relative; height: 292px; margin-top: 30px; }
.signal-node { position: absolute; display: grid; place-items: center; min-width: 110px; min-height: 64px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--bg-soft) 88%, transparent); font: 600 11px/1.5 var(--mono); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.ai-node { left: 6%; top: 3%; color: var(--accent-2); }
.tool-node { right: 2%; top: 28%; color: var(--accent); }
.stm-node { left: 10%; bottom: 2%; color: var(--warn); }
.hw-node { right: 4%; bottom: 1%; }
.signal-line { position: absolute; height: 1px; transform-origin: left center; background: linear-gradient(90deg, var(--line), var(--accent), var(--line)); opacity: .75; }
.line-a { width: 55%; left: 31%; top: 20%; transform: rotate(18deg); }
.line-b { width: 49%; left: 27%; top: 55%; transform: rotate(131deg); }
.line-c { width: 37%; left: 35%; bottom: 12%; transform: rotate(-2deg); }
.panel-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.panel-metrics div { padding: 12px; border-top: 1px solid var(--line); }
.panel-metrics strong { display: block; font: 600 18px var(--mono); color: var(--text); }
.panel-metrics span { color: var(--muted); font-size: 11px; }

.intro-strip { display: grid; grid-template-columns: 180px 1fr; gap: 36px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.intro-strip p { margin: 0; color: var(--muted); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.intro-strip div { color: var(--muted); }
.intro-strip strong { color: var(--text); }

.content-section { padding: 118px 0 24px; scroll-margin-top: 76px; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(260px, 410px); gap: 60px; align-items: end; margin-bottom: 42px; }
.section-heading h2, .next-section h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; letter-spacing: -.035em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 14px; }

.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.topic-card { min-height: 235px; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--panel) 76%, transparent); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.topic-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--panel-strong) 88%, transparent); }
.feature-card { grid-row: span 2; min-height: 484px; }
.card-index { color: var(--accent); font: 600 10px var(--mono); letter-spacing: .08em; }
.topic-card h3 { margin: 38px 0 10px; font-size: 22px; }
.topic-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tag { display: inline-block; margin-top: 26px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font: 500 10px var(--mono); }
.compare-table { margin-top: 34px; border-top: 1px solid var(--line); }
.compare-table div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.compare-table span { color: var(--accent-2); font: 600 11px var(--mono); }
.compare-table strong { font-size: 12px; font-weight: 500; }
.text-link { display: inline-block; margin-top: 24px; color: var(--accent); font-size: 12px; font-weight: 600; }
.source-card { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-2) 7%, var(--panel)), var(--panel)); }
.source-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.source-links a { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 500 10px var(--mono); }
.source-links a:hover { color: var(--text); border-color: var(--accent-2); }

.workflow { margin-top: 16px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 72%, transparent); }
.workflow-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 34px; }
.workflow-head .eyebrow { margin: 0; }
.workflow-head h3 { margin: 0; font-size: 18px; }
.workflow-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
.flow-box { min-height: 88px; display: grid; align-content: center; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.flow-box small { color: var(--muted); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.flow-box strong { font-size: 12px; }
.flow-box.accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.flow-arrow { color: var(--muted); font: 400 17px var(--mono); }
.workflow-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; }

.embedded-section { padding-top: 140px; }
.stack-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stack-strip span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font: 500 10px var(--mono); }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.project-card { min-height: 350px; display: flex; flex-direction: column; padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 78%, transparent); transition: border-color .2s ease, transform .2s ease; }
.project-card:hover { border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); transform: translateY(-3px); }
.project-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font: 500 9px var(--mono); letter-spacing: .08em; }
.status { padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line); }
.status.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.status.lab { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.status.study { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line)); }
.project-card h3 { margin: 58px 0 12px; font-size: 25px; letter-spacing: -.02em; }
.project-card > p { margin: 0; color: var(--muted); font-size: 14px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.project-meta span { padding: 5px 8px; border-radius: 6px; background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--muted); font: 500 9px var(--mono); }
.project-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.project-footer span { color: var(--muted); font: 500 10px var(--mono); }
.project-footer strong { font-size: 11px; font-weight: 500; text-align: right; }

.library-section { padding-top: 140px; }
.library-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.library-card { min-height: 230px; padding: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.library-card > span { color: var(--accent); font: 500 10px var(--mono); }
.library-card h3 { margin: 62px 0 10px; font-size: 17px; }
.library-card p { margin: 0; color: var(--muted); font-size: 12px; }

.next-section { display: grid; grid-template-columns: 1.4fr .6fr; gap: 70px; align-items: end; margin-top: 126px; padding-top: 60px; padding-bottom: 60px; border-top: 1px solid var(--line); }
.next-section > p { margin: 0; color: var(--muted); font-size: 13px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 26px; padding-bottom: 36px; border-top: 1px solid var(--line); color: var(--muted); font: 500 10px var(--mono); }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 46px; padding-top: 72px; }
  .hero-panel { min-height: 400px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card { grid-row: auto; min-height: 280px; }
  .workflow-row { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
  .next-section { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 680px) {
  .section-shell { width: min(100% - 28px, 1180px); }
  .site-header { padding-inline: 14px; min-height: 68px; }
  .brand-copy small { display: none; }
  .hero { padding-top: 54px; }
  .hero h1 { font-size: clamp(38px, 12vw, 56px); }
  .hero-lead { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-panel { min-height: 380px; }
  .signal-node { min-width: 98px; font-size: 10px; }
  .intro-strip { grid-template-columns: 1fr; gap: 10px; }
  .content-section { padding-top: 90px; }
  .topic-grid, .project-grid, .library-grid { grid-template-columns: 1fr; }
  .topic-card, .feature-card { min-height: 220px; }
  .workflow { padding: 20px; }
  .workflow-head { display: block; }
  .workflow-head h3 { margin-top: 10px; }
  .project-card { min-height: 320px; }
  .project-card h3 { margin-top: 42px; }
  .library-card { min-height: 180px; }
  .library-card h3 { margin-top: 38px; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
