/* memoplus4dsh intro site — dark, modern, animated. No external deps. */

:root {
  --bg: #0a0e1a;
  --bg-alt: #0e1424;
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e6eaf2;
  --text-dim: #9aa3b8;
  --accent: #818cf8;
  --accent2: #22d3ee;
  --grad: linear-gradient(100deg, #818cf8, #22d3ee);
  --good: #34d399;
  --bad: #f87171;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
code, pre { font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
b { color: #fff; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--card-border); }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  padding: 7px 16px; border-radius: 99px; color: #fff !important;
  background: var(--grad); font-weight: 600;
}
@media (max-width: 640px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
#graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; padding: 120px 24px 80px; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 99px; font-size: 13px;
  color: var(--accent2); border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07); margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 76px); line-height: 1.12; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 24px;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { font-size: clamp(16px, 2.2vw, 20px); color: var(--text-dim); max-width: 640px; margin: 0 auto 40px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 72px; flex-wrap: wrap; }
.btn {
  padding: 14px 32px; border-radius: 12px; font-size: 16px; font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 40px rgba(34, 211, 238, 0.45); }
.btn-ghost { border: 1px solid var(--card-border); color: var(--text); background: var(--card); }
.hero-stats { display: flex; gap: 56px; justify-content: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stat-num { font-size: clamp(30px, 4vw, 44px); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.stat-label em { font-style: normal; opacity: 0.7; }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-hint span { display: block; width: 22px; height: 34px; border: 1.5px solid var(--text-dim); border-radius: 12px; position: relative; }
.scroll-hint span::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px;
  background: var(--accent2); border-radius: 2px; transform: translateX(-50%);
  animation: scroll-dot 1.6s ease-in-out infinite;
}
@keyframes scroll-dot { 0% { opacity: 1; top: 6px; } 70% { opacity: 0; top: 18px; } 100% { opacity: 0; top: 6px; } }

/* ---------- 通用 section ---------- */
.section { padding: 110px 0; position: relative; overflow: hidden; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: #0a0f1e; }
/* 环境光晕：品牌双色径向渐变，各区错开位置，z-index 在内容之下 */
.section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 420px at 86% 8%, rgba(129, 140, 248, 0.07), transparent 70%),
    radial-gradient(520px 400px at 6% 92%, rgba(34, 211, 238, 0.05), transparent 70%);
}
.section-alt::before {
  background:
    radial-gradient(620px 420px at 10% 6%, rgba(129, 140, 248, 0.06), transparent 70%),
    radial-gradient(540px 420px at 92% 94%, rgba(34, 211, 238, 0.05), transparent 70%);
}
.section-dark::before {
  background:
    radial-gradient(680px 460px at 50% -10%, rgba(129, 140, 248, 0.08), transparent 70%),
    radial-gradient(560px 420px at 96% 60%, rgba(34, 211, 238, 0.05), transparent 70%);
}
.section > .container { position: relative; z-index: 1; }
h2 { font-size: clamp(30px, 4.5vw, 44px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.section-sub { color: var(--text-dim); font-size: 17px; margin-bottom: 56px; }

/* ---------- 愿景宣言 ---------- */
.vision { padding: 90px 0 70px; text-align: center; }
.vision-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--accent2); text-transform: uppercase; margin-bottom: 26px;
}
.vision-slogan {
  font-size: clamp(24px, 3.6vw, 38px); font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.45; margin-bottom: 26px;
}
.vision-desc { font-size: 16.5px; color: var(--text); opacity: 0.85; line-height: 1.85; margin-bottom: 26px; }
.vision-text { color: var(--text-dim); font-size: 15px; line-height: 2.0; }
.vision-text em { color: var(--accent2); font-style: normal; }

/* 滚动显现 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 痛点对比 ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .versus { grid-template-columns: 1fr; } .vs-arrow { transform: rotate(90deg); } }
.vs-card {
  border-radius: var(--radius); padding: 30px; border: 1px solid var(--card-border);
  background: var(--card);
}
.vs-bad { border-color: rgba(248, 113, 113, 0.25); }
.vs-good { border-color: rgba(52, 211, 153, 0.3); box-shadow: 0 0 50px rgba(52, 211, 153, 0.06); }
.vs-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.vs-bad .vs-title { color: var(--bad); }
.vs-good .vs-title { color: var(--good); }
.vs-files {
  font-size: 12.5px; color: var(--text-dim); background: rgba(0,0,0,0.3);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; line-height: 1.9;
}
.vs-card ul { list-style: none; }
.vs-card li { padding: 5px 0 5px 20px; position: relative; color: var(--text-dim); font-size: 14.5px; }
.vs-card li::before { content: "·"; position: absolute; left: 4px; color: var(--accent2); font-weight: 800; }
.vs-arrow { font-size: 34px; color: var(--accent); font-weight: 800; }
.vs-graph { width: 100%; max-width: 300px; display: block; margin: 0 auto 18px; }
.vg-edge line { stroke: rgba(129, 140, 248, 0.4); stroke-width: 1.5; stroke-dasharray: 4 4; animation: dash-flow 2.4s linear infinite; }
.vg-node circle { fill: rgba(34, 211, 238, 0.16); stroke: var(--accent2); stroke-width: 1.5; }
.vg-core { fill: rgba(129, 140, 248, 0.2); stroke: var(--accent); stroke-width: 2; animation: pulse 2.4s ease-in-out infinite; }
@keyframes dash-flow { to { stroke-dashoffset: -16; } }
@keyframes pulse { 0%, 100% { r: 22; opacity: 1; } 50% { r: 26; opacity: 0.75; } }

/* ---------- 创新点卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  border-radius: var(--radius); padding: 28px 26px; border: 1px solid var(--card-border);
  background: var(--card); transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-5px); border-color: rgba(129, 140, 248, 0.4);
  box-shadow: 0 16px 44px rgba(99, 102, 241, 0.14);
}
.card-icon { font-size: 28px; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--text-dim); }
.card code { font-size: 12.5px; color: var(--accent2); background: rgba(34,211,238,0.08); padding: 1px 6px; border-radius: 5px; }

/* ---------- 架构流水线 ---------- */
.pipeline {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px;
}
@media (max-width: 760px) { .pipeline { grid-template-columns: 1fr; } }
.pipe-col { display: flex; flex-direction: column; gap: 0; }
.pipe-label { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent2); margin-bottom: 16px; text-transform: uppercase; }
.pipe-node {
  position: relative; border: 1px solid var(--card-border); background: var(--card);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 34px; font-weight: 600; font-size: 15px;
  opacity: 0; transform: translateX(-18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i) * 0.12s);
}
.pipeline.visible .pipe-node, .reveal.visible .pipe-node { opacity: 1; transform: none; }
.pipe-node small { display: block; font-weight: 400; font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.pipe-node::after {
  content: ""; position: absolute; left: 24px; bottom: -34px; width: 2px; height: 34px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  background-size: 100% 200%;
  animation: pipe-flow 1.4s linear infinite;
}
.pipe-node:last-child::after { display: none; }
.pipe-node.pipe-sink { border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.06); }
@keyframes pipe-flow { 0% { background-position: 0 100%; } 100% { background-position: 0 -100%; } }
.arch-points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .arch-points { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .arch-points { grid-template-columns: 1fr; } }
.ap { border-radius: 12px; padding: 18px 20px; background: var(--card); border: 1px solid var(--card-border); }
.ap b { display: block; margin-bottom: 6px; font-size: 15px; }
.ap span { font-size: 13px; color: var(--text-dim); }
.ap code { font-size: 12px; color: var(--accent2); }

/* ---------- 评测 ---------- */
.bench-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 36px; }
@media (max-width: 960px) { .bench-grid { grid-template-columns: 1fr; } }
.bench-card { border-radius: var(--radius); padding: 26px; border: 1px solid var(--card-border); background: var(--card); }
.bench-head { font-size: 15.5px; font-weight: 700; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: baseline; }
.bench-head span { font-size: 12px; color: var(--accent2); font-weight: 600; letter-spacing: 0.08em; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 52px; gap: 10px; align-items: center; margin-bottom: 13px; }
.bar-name { font-size: 12.5px; color: var(--text-dim); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-name.ours { color: #fff; font-weight: 700; }
.bar-track { height: 18px; border-radius: 6px; background: rgba(255,255,255,0.05); overflow: hidden; }
.bar {
  height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, rgba(129,140,248,0.55), rgba(34,211,238,0.55));
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-ours { background: var(--grad); box-shadow: 0 0 16px rgba(99, 102, 241, 0.5); }
.bar-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bench-note { font-size: 12.5px; color: var(--text-dim); margin-top: 16px; border-top: 1px solid var(--card-border); padding-top: 14px; }
.bench-foot { text-align: left; color: var(--text-dim); font-size: 14px; margin: 14px 0 0; line-height: 1.7; }
.bench-foot-start { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--card-border); }
.bench-foot-links { margin-top: 18px; font-size: 14.5px; }
.bench-foot-links a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }
.bench-foot-links a:hover { opacity: .8; }
.bench-foot-note { font-size: 12.5px; opacity: .75; }

/* ---------- 快速开始 ---------- */
.terminal {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--card-border);
  background: #0c1120; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  margin-bottom: 36px;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--card-border); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #f87171; }
.term-bar i:nth-child(2) { background: #fbbf24; }
.term-bar i:nth-child(3) { background: #34d399; }
.term-bar span { margin-left: 8px; font-size: 12px; color: var(--text-dim); }
.term-body { padding: 22px 24px; font-size: 14px; line-height: 2.0; overflow-x: auto; }
.term-body .c { color: #64748b; }
.term-body .p { color: var(--accent2); font-weight: 700; }
.qs-points .qs { padding: 8px 0; color: var(--text-dim); font-size: 15px; }
.qs code { color: var(--accent2); background: rgba(34,211,238,0.08); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--card-border); padding: 34px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-dim); font-size: 13.5px; }
.footer b { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 实景动画 demo ---------- */
.demo-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  grid-template-rows: auto auto;
  gap: 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #0b101f;
  padding: 20px;
  min-height: 480px;
}
@media (max-width: 900px) { .demo-stage { grid-template-columns: 1fr; } }
.demo-pane {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
}
.demo-pane-bottom { grid-column: 1 / -1; min-height: 150px; }
.pane-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent2);
  margin-bottom: 12px; text-transform: uppercase;
}
.pane-label small { color: var(--text-dim); font-weight: 400; letter-spacing: 0; text-transform: none; }

/* 对话气泡 */
.chat-area { display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; flex: 1; }
.chat-bubble {
  max-width: 92%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.55;
  opacity: 0; transform: translateY(10px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.chat-bubble.show { opacity: 1; transform: none; }
.chat-user { align-self: flex-end; background: rgba(129, 140, 248, 0.16); border: 1px solid rgba(129, 140, 248, 0.3); }
.chat-assistant { align-self: flex-start; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); color: var(--text-dim); }

/* 抽取行 */
.extract-area { flex: 1; display: flex; align-items: center; }
.extract-row {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.9;
  color: var(--accent2); word-break: break-all; white-space: pre-wrap;
}
.extract-row .pipe { color: var(--text-dim); }
.extract-row::after { content: "▌"; animation: caret 0.9s step-end infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* 记忆图 svg */
#demo-graph { width: 100%; flex: 1; }
.dg-edge { stroke: rgba(129, 140, 248, 0.45); stroke-width: 1.5; transition: opacity 0.6s, stroke 0.6s; }
.dg-edge.history { stroke: rgba(129, 140, 248, 0.5); stroke-dasharray: 4 4; }
.dg-edge.hot { stroke: var(--accent2); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6)); }
.dg-node { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s; transform-box: fill-box; transform-origin: center; }
.dg-node circle { fill: rgba(129, 140, 248, 0.18); stroke: var(--accent); stroke-width: 1.5; transition: fill 0.4s, stroke 0.4s; }
.dg-node text { fill: var(--text); font-size: 10.5px; text-anchor: middle; }
.dg-node .dg-time { fill: var(--text-dim); font-size: 8px; }
.dg-node.history { opacity: 0.9; }
.dg-node.history circle { fill: rgba(129, 140, 248, 0.12); stroke: rgba(129, 140, 248, 0.6); stroke-dasharray: 3 3; }
.dg-node.hot circle { fill: rgba(34, 211, 238, 0.35); stroke: var(--accent2); }
.dg-node.hot { filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.7)); }
.dg-node.entering { transform: scale(0); }
.dg-node.shown { transform: scale(1); }

/* 问答区 */
.qa-area { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }
.qa-query, .qa-inject, .qa-answer {
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; line-height: 1.6;
  opacity: 0; transform: translateY(8px); transition: opacity 0.45s, transform 0.45s;
}
.qa-query.show, .qa-inject.show, .qa-answer.show { opacity: 1; transform: none; }
.qa-query { background: rgba(129, 140, 248, 0.14); border: 1px solid rgba(129, 140, 248, 0.3); align-self: flex-start; font-weight: 600; }
.qa-inject {
  background: rgba(34, 211, 238, 0.06); border: 1px dashed rgba(34, 211, 238, 0.35);
  font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; color: var(--text-dim);
}
.qa-inject b { color: var(--accent2); font-weight: 600; }
.qa-inject .history-line { opacity: 0.62; }
.qa-inject .history-tag { color: var(--accent); font-size: 10px; }
.qa-answer { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.35); color: #d1fae5; }

/* 进度点 */
.demo-progress { position: absolute; top: 14px; right: 16px; display: flex; gap: 6px; }
.demo-progress i {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
  transition: background 0.3s, transform 0.3s;
}
.demo-progress i.on { background: var(--accent2); transform: scale(1.3); }

/* 图面板内的时间轴：过去与现在同时存在 */
.dg-timeline {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding: 8px 10px 4px;
  border-top: 1px dashed rgba(129, 140, 248, 0.35);
  position: relative;
}
.dg-timeline::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 8px;
  border-top: 1px dashed rgba(129, 140, 248, 0.35);
}
.dg-tick { position: relative; font-size: 10.5px; color: var(--text-dim); padding-top: 12px; }
.dg-tick::before {
  content: ""; position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--card-border); border: 1px solid rgba(129, 140, 248, 0.4);
  transition: background 0.4s, box-shadow 0.4s;
}
.dg-tick.on { color: var(--accent2); }
.dg-tick.on::before { background: var(--accent2); box-shadow: 0 0 8px rgba(34, 211, 238, 0.8); }
