/* Agent-Pilot V2.0 · Editorial-Pro Style
 * Light theme + dark toggle; primary = Feishu Blue #3370FF */

:root {
  --bg: #fafaf9;
  --bg2: #ffffff;
  --bg3: #f4f4f3;
  --fg: #0a0a09;
  --fg2: #4a4a48;
  --fg3: #8a8a87;
  --line: #e7e7e4;
  --line2: #d6d6d2;
  --accent: #3370FF;
  --accent-soft: #e8f0ff;
  --accent-dark: #1E3A5F;
  --ok: #10B981;
  --warn: #F59E0B;
  --bad: #EF4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
}
[data-theme="dark"] {
  --bg: #0a0a09;
  --bg2: #131311;
  --bg3: #1c1c1a;
  --fg: #f5f5f3;
  --fg2: #b9b9b3;
  --fg3: #767672;
  --line: #2a2a27;
  --line2: #3a3a36;
  --accent: #6699FF;
  --accent-soft: rgba(102,153,255,0.12);
  --accent-dark: #a0c0ff;
  --shadow: 0 2px 12px rgba(0,0,0,.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 80px 28px; }
.divider { height: 1px; background: var(--line); width: min(900px, calc(100% - 56px)); margin: 0 auto; }

/* Nav */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topbar .logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em;
}
.topbar .logo .dot {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: blink 1.6s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }
.topbar .links { display: flex; align-items: center; gap: 20px; font-size: .88rem; color: var(--fg2); }
.topbar .links a:hover { color: var(--accent); }
.theme-btn { font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; }
.theme-btn:hover { background: var(--bg3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; font-weight: 500; font-size: .9rem;
  transition: all .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2060ee; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(51,112,255,.3); }
.btn-ghost { border: 1px solid var(--line2); color: var(--fg2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero { padding-top: 60px; }
.hero .tag {
  font-family: var(--mono); font-size: .76rem; color: var(--accent);
  letter-spacing: .08em; margin-bottom: 20px;
  padding: 6px 14px; background: var(--accent-soft); border-radius: 20px;
  display: inline-block;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 768px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .subtitle { color: var(--fg2); font-size: 1rem; line-height: 1.7; margin-bottom: 24px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.meta-row { font-size: .82rem; color: var(--fg3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-row .sep { color: var(--line2); }
.stats { display: flex; gap: 24px; margin-top: 20px; }
.stats .stat { text-align: center; }
.stats .stat .v { font-size: 1.4rem; font-weight: 700; color: var(--accent); font-family: var(--mono); }
.stats .stat .k { font-size: .75rem; color: var(--fg3); }

/* IM Simulator */
.imsim-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.imsim-bar {
  background: var(--bg3); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; font-size: .78rem;
  border-bottom: 1px solid var(--line);
}
.imsim-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.imsim-bar .dot.r { background: #EF4444; }
.imsim-bar .dot.y { background: #F59E0B; }
.imsim-bar .dot.g { background: #10B981; }
.imsim-bar .title { flex: 1; color: var(--fg2); margin-left: 8px; }
.imsim-bar .badge {
  font-family: var(--mono); font-size: .68rem; padding: 3px 8px;
  background: var(--accent-soft); color: var(--accent); border-radius: 4px;
}
.imsim-body { background: var(--bg2); padding: 16px; min-height: 300px; max-height: 360px; overflow-y: auto; }
.imsim-stream { display: flex; flex-direction: column; gap: 10px; }
.imsim-controls {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.imsim-controls button {
  width: 28px; height: 28px; border-radius: 4px; font-size: .9rem;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
}
.imsim-controls button:hover { background: var(--accent-soft); color: var(--accent); }
.imsim-controls .progress { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.imsim-controls .progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.imsim-controls .label { font-family: var(--mono); font-size: .7rem; color: var(--fg3); }

/* Sim message bubbles */
.sim-msg { padding: 8px 12px; border-radius: 8px; font-size: .85rem; max-width: 85%; animation: fadeUp .3s ease; }
.sim-msg.user { background: var(--accent-soft); color: var(--accent-dark); align-self: flex-end; }
.sim-msg.bot { background: var(--bg3); color: var(--fg); align-self: flex-start; }
.sim-msg.agent { background: #f0fdf4; color: #166534; align-self: flex-start; border-left: 3px solid var(--ok); }
[data-theme="dark"] .sim-msg.agent { background: rgba(16,185,129,.1); color: #6ee7b7; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Section titles */
.section-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.section-title em { font-style: normal; color: var(--accent); }
.section-desc { color: var(--fg2); font-size: 1rem; margin-bottom: 32px; }

/* Pain cards */
.pain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.pain-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-align: center; box-shadow: var(--shadow);
}
.pain-card .pain-icon { font-size: 2rem; margin-bottom: 8px; }
.pain-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--bad); margin-bottom: 6px; }
.pain-card p { font-size: .85rem; color: var(--fg2); }

/* Solution box */
.solution-box {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 28px; margin-top: 24px;
}
.solution-box h3 { color: var(--accent); font-size: 1.1rem; margin-bottom: 8px; }
.solution-box p { color: var(--fg); font-size: .95rem; }

/* Pipeline flow */
.pipeline-flow {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  padding: 24px 0; margin-bottom: 32px;
}
.agent-node {
  flex-shrink: 0; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-align: center;
  min-width: 120px; box-shadow: var(--shadow); transition: all .2s;
}
.agent-node:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(51,112,255,.15); }
.agent-node .agent-icon { font-size: 1.6rem; margin-bottom: 6px; }
.agent-node h4 { font-size: .82rem; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.agent-node p { font-size: .72rem; color: var(--fg3); line-height: 1.3; }
.pipe-arrow { font-size: 1.2rem; color: var(--accent); flex-shrink: 0; }

/* Pipeline detail */
.pipeline-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.detail-card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.detail-card h4 { font-size: .9rem; color: var(--accent); margin-bottom: 6px; }
.detail-card p { font-size: .85rem; color: var(--fg2); }

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.feature-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: all .2s;
}
.feature-card:hover { border-color: var(--accent); }
.f-badge {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  padding: 3px 8px; background: var(--accent-soft); color: var(--accent);
  border-radius: 4px; margin-bottom: 8px;
}
.feature-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: .85rem; color: var(--fg2); }

/* Demo */
.demo-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 32px;
}
.demo-bar {
  background: var(--bg3); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; font-size: .78rem;
  border-bottom: 1px solid var(--line);
}
.demo-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-bar .dot.r { background: #EF4444; }
.demo-bar .dot.y { background: #F59E0B; }
.demo-bar .dot.g { background: #10B981; }
.demo-bar .title { flex: 1; color: var(--fg2); margin-left: 8px; }
.demo-body { background: var(--bg2); padding: 20px; }
.chat-messages { min-height: 200px; max-height: 400px; overflow-y: auto; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; animation: fadeUp .3s ease; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.msg.user .msg-avatar { background: var(--bg3); }
.msg-content { background: var(--bg3); border-radius: 12px; padding: 10px 14px; max-width: 70%; font-size: .88rem; line-height: 1.5; }
.msg.user .msg-content { background: var(--accent); color: #fff; }
.msg-content p { margin-bottom: 4px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content .agent-step { font-family: var(--mono); font-size: .76rem; color: var(--ok); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

.chat-suggestions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.suggest-btn {
  padding: 8px 14px; border-radius: 20px; font-size: .82rem;
  border: 1px solid var(--line); color: var(--fg2); transition: all .2s;
}
.suggest-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: .9rem; outline: none; transition: border-color .2s;
}
.chat-input-row input:focus { border-color: var(--accent); }

/* Demo links */
.demo-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.demo-link-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-align: center; transition: all .2s; text-decoration: none;
}
.demo-link-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(51,112,255,.1); }
.demo-link-card h4 { font-size: 1rem; margin-bottom: 4px; }
.demo-link-card p { font-size: .82rem; color: var(--fg3); }

/* Tech grid */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
.tech-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.tech-card h4 { font-size: .95rem; font-weight: 700; color: var(--ok); margin-bottom: 6px; }
.tech-card p { font-size: .85rem; color: var(--fg2); line-height: 1.5; }

/* Architecture box */
.arch-box {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.arch-box h3 { font-size: 1.1rem; color: var(--accent); margin-bottom: 12px; }
.arch-diagram { font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--fg2); overflow-x: auto; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.team-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center; box-shadow: var(--shadow);
}
.avatar-placeholder { font-size: 2.5rem; margin-bottom: 12px; }
.team-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.team-card .role { font-size: .82rem; color: var(--accent); font-weight: 500; display: block; margin-bottom: 8px; }
.team-card p { font-size: .85rem; color: var(--fg2); margin-bottom: 12px; }
.team-links { display: flex; justify-content: center; gap: 12px; font-size: .82rem; }
.team-links a { color: var(--accent); }
.team-links a:hover { text-decoration: underline; }

/* Footer */
.footer {
  border-top: 1px solid var(--line); padding: 24px 28px;
  font-size: .82rem; color: var(--fg3); text-align: center;
}
.footer .inner { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer a { color: var(--accent); }
.footer .sep { color: var(--line2); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* PRD Coverage grid */
.prd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.prd-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; transition: all .2s;
}
.prd-card.pass { border-left: 4px solid var(--ok); }
.prd-card.bonus { border-left: 4px solid var(--warn); }
.prd-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.prd-badge {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 700;
  padding: 3px 8px; background: var(--accent-soft); color: var(--accent); border-radius: 4px; margin-bottom: 6px;
}
.prd-card h4 { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.prd-req { font-size: .78rem; color: var(--fg3); margin-bottom: 4px; }
.prd-impl { font-size: .82rem; color: var(--fg2); }
.prd-status { position: absolute; top: 12px; right: 12px; font-size: .72rem; font-weight: 600; color: var(--ok); }
.prd-card.bonus .prd-status { color: var(--warn); }

/* Before/After comparison */
.compare-grid { display: flex; align-items: stretch; gap: 20px; }
@media (max-width: 768px) { .compare-grid { flex-direction: column; } }
.compare-card { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.compare-card.before { border-top: 3px solid var(--bad); }
.compare-card.after { border-top: 3px solid var(--ok); }
.compare-card h3 { font-size: 1rem; margin-bottom: 12px; }
.compare-card.before h3 { color: var(--bad); }
.compare-card.after h3 { color: var(--ok); }
.compare-card ul { list-style: none; }
.compare-card li { padding: 6px 0; font-size: .88rem; border-bottom: 1px solid var(--line); }
.compare-card li:last-child { border-bottom: none; }
.compare-card .up { font-size: .72rem; color: var(--ok); font-weight: 600; margin-left: 6px; }
.compare-arrow { display: flex; align-items: center; font-size: 2rem; color: var(--accent); font-weight: 700; }
@media (max-width: 768px) { .compare-arrow { justify-content: center; transform: rotate(90deg); } }

/* Animated counter */
.stats .stat .v { font-size: 1.4rem; font-weight: 700; color: var(--accent); font-family: var(--mono); }

/* Responsive */
@media (max-width: 768px) {
  .topbar .links { gap: 12px; font-size: .8rem; }
  .pipeline-flow { gap: 4px; }
  .agent-node { min-width: 90px; padding: 10px; }
  .pipe-arrow { font-size: .9rem; }
}
