*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --bg: #0b0f1d;
  --bg-soft: #111729;
  --bg-card: #1a223a;
  --bg-card-2: #232c4a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --line: rgba(148,163,184,0.10);
  --gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 50%, #10b981 100%);
  --bubble-user: #4f46e5;
  --bubble-bot: #1f2940;
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  font-size: 15px;
}

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(11,15,29,0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  font-size: 1.35rem; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; gap: 1.6rem; list-style: none; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--primary); color: #fff !important; border: none;
  padding: 0.5rem 1.2rem; border-radius: 8px;
  font-weight: 600; transition: all 0.3s;
}
.nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(99,102,241,0.4); }

/* ===== HERO ===== */
.hero {
  min-height: 88vh; display: flex; align-items: center; justify-content: center;
  padding: 7rem 2rem 4rem; text-align: center;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: -25% -25% -25% -25%;
  background:
    radial-gradient(ellipse at 25% 30%, rgba(99,102,241,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 60%, rgba(6,182,212,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(16,185,129,0.10) 0%, transparent 55%);
  filter: blur(40px);
  animation: bgFloat 22s ease-in-out infinite;
}
@keyframes bgFloat {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(2%,-2%) rotate(1deg); }
}
.hero-content { position: relative; z-index: 1; max-width: 900px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25);
  padding: 0.4rem 1.2rem; border-radius: 100px;
  font-size: 0.85rem; color: #a5b4fc; margin-bottom: 1.5rem;
}
.hero-badge .dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.45; } }
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 900; line-height: 1.15;
  letter-spacing: -1.5px; margin-bottom: 1.4rem;
}
.hero h1 .gradient {
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 680px; margin: 0 auto 2.4rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }
.btn-primary {
  background: var(--gradient); color: #fff; border: none;
  padding: 0.85rem 2.2rem; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-block;
  box-shadow: 0 4px 24px rgba(99,102,241,0.32);
  transition: all 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(99,102,241,0.45); }
.btn-primary.big { font-size: 1.05rem; padding: 1rem 2.6rem; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid rgba(148,163,184,0.3); padding: 0.85rem 2.2rem;
  border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: all 0.3s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.hero-stats {
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
  padding-top: 1rem;
}
.hero-stats > div { text-align: center; }
.hero-stats b {
  display: block; font-size: 1.8rem; font-weight: 900;
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-stats span { font-size: 0.85rem; color: var(--text-muted); }

/* ===== SECTIONS ===== */
section { padding: 6rem 2rem; }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 3.5rem; }
.section-header h2 { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 0.8rem; }
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

/* ===== PAIN ===== */
.pain { background: var(--bg-soft); }
.pain-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem; max-width: 1200px; margin: 0 auto;
}
.pain-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.8rem; transition: all 0.3s;
}
.pain-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,0.3); }
.pain-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.pain-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.pain-card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }

/* ===== DEMO ===== */
.demo-section { background: var(--bg); }
.demo-shell {
  max-width: 1200px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
}
.scenario-bar {
  padding: 1rem 1.5rem;
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--line);
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
}
.scenario-bar-label { color: var(--text-muted); font-size: 0.9rem; }
.scenario-list { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.scenario-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; border-radius: 999px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3);
  color: #c7d2fe; font-size: 0.88rem; cursor: pointer;
  transition: all 0.2s; user-select: none;
}
.scenario-chip:hover { background: rgba(99,102,241,0.25); transform: translateY(-1px); }
.scenario-chip:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.demo-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; }
  .trace-pane { border-left: none !important; border-top: 1px solid var(--line); }
}

/* ===== CHAT PANE ===== */
.chat-pane {
  display: flex; flex-direction: column; background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
  color: #111;
}
.chat-header {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, #ff6a00, #ff4d00);
  color: #fff;
}
.product-thumb { width: 42px; height: 42px; border-radius: 8px; background: rgba(255,255,255,0.2); object-fit: cover; }
.product-title { font-weight: 700; font-size: 0.95rem; }
.product-sub { font-size: 0.78rem; opacity: 0.85; }
.online-dot { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.chat-window {
  flex: 1;
  padding: 1.2rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.7rem;
  background: #ededed;
  max-height: 480px;
  scroll-behavior: smooth;
}
.bubble {
  max-width: 80%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
}
.bubble.bot {
  background: #fff;
  color: #111;
  align-self: flex-start;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.bubble.user {
  background: #95ec69;
  color: #111;
  align-self: flex-end;
  border-top-right-radius: 4px;
}
.bubble.welcome { background: #fff7e6; border: 1px solid #ffd591; color: #614600; align-self: center; max-width: 92%; text-align: center; font-size: 0.88rem; }
.bubble strong { color: #d4380d; font-weight: 700; }
.bubble.bot strong { color: #1d39c4; }
.bubble.bot .ref-pill {
  display: inline-block; background: #e6f4ff; color: #1d39c4;
  padding: 0 0.4rem; border-radius: 4px; font-size: 0.82rem;
}
.typing-cursor {
  display: inline-block; width: 6px; height: 1em; background: #555;
  margin-left: 2px; vertical-align: text-bottom; animation: blink 1s infinite;
}
@keyframes blink { 0%,50%{opacity:1} 50.1%,100%{opacity:0} }
.chat-input {
  display: flex; gap: 0.5rem; padding: 0.8rem;
  background: #f5f5f5; border-top: 1px solid #d9d9d9;
}
.chat-input input {
  flex: 1; border: 1px solid #d9d9d9; background: #fff;
  padding: 0.6rem 0.9rem; border-radius: 8px;
  font-size: 0.95rem; color: #111;
  outline: none;
}
.chat-input input:focus { border-color: var(--primary); }
.chat-input button {
  padding: 0.6rem 1.4rem;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}
.chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TRACE PANE ===== */
.trace-pane {
  background: #0a0f1d;
  color: #d1d5db;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.trace-header {
  padding: 0.8rem 1rem;
  background: #050810;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.trace-title { color: #c7d2fe; font-weight: 700; }
.trace-sub { color: var(--text-muted); font-size: 0.8rem; }
.trace-window {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  max-height: 480px;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.trace-placeholder { color: var(--text-dim); font-style: italic; text-align: center; padding: 2rem 0; }
.trace-step {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--primary);
  border-radius: 0 6px 6px 0;
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
.trace-step.running { border-left-color: #f59e0b; }
.trace-step.ok { border-left-color: #22c55e; }
.trace-step.err { border-left-color: #ef4444; }
.trace-icon { font-size: 1.05rem; flex-shrink: 0; line-height: 1.2; padding-top: 0.05rem; }
.trace-body { flex: 1; min-width: 0; }
.trace-line { color: #e5e7eb; }
.trace-line .tool-name { color: #a5b4fc; font-weight: 700; }
.trace-line .file-path { color: #fbbf24; word-break: break-all; }
.trace-line .pattern { color: #34d399; }
.trace-elapsed { font-size: 0.75rem; color: var(--text-dim); margin-left: 0.4rem; }
.trace-step .thinking { color: var(--text-dim); font-style: italic; }
.trace-window::-webkit-scrollbar { width: 6px; }
.trace-window::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ===== WORKFLOW ===== */
.workflow { background: var(--bg-soft); }
.steps {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1rem;
}
.step {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.6rem 1.8rem;
}
.step-num {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
  background: rgba(99,102,241,0.12); color: #a5b4fc;
  flex-shrink: 0;
}
.step h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== PRICING ===== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem; max-width: 1100px; margin: 0 auto;
}
.price-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 20px; padding: 2.2rem 2rem; text-align: center;
  transition: all 0.3s; position: relative;
}
.price-card:hover { transform: translateY(-3px); }
.price-card.featured {
  border-color: rgba(99,102,241,0.4);
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, var(--bg-card) 40%);
}
.featured-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gradient); color: #fff;
  padding: 0.3rem 1rem; border-radius: 100px;
  font-size: 0.78rem; font-weight: 700;
}
.price-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.price { font-size: 2.6rem; font-weight: 900; margin: 0.6rem 0 1rem; }
.price span { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; }
.price-card ul { list-style: none; text-align: left; margin-bottom: 2rem; }
.price-card li { padding: 0.4rem 0; font-size: 0.92rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.price-card li::before { content: "✓"; color: #22c55e; font-weight: 700; }
.price-card a { width: 100%; text-align: center; }

/* ===== CTA & FOOTER ===== */
.cta {
  text-align: center; padding: 5rem 2rem;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.08) 0%, transparent 70%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cta h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 1rem; }
.cta p { color: var(--text-muted); margin-bottom: 1.6rem; }
.cta-sub { font-size: 0.85rem; color: var(--text-dim); margin-top: 1rem; }
.footer { padding: 2.5rem 2rem; text-align: center; color: var(--text-dim); font-size: 0.82rem; }
.footer p { margin: 0.3rem 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links li:not(:last-child) { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .hero-stats { gap: 1.5rem; }
  .step { flex-direction: column; }
  section { padding: 4rem 1.2rem; }
}
