/* ============================================================
   AIHelper 智能体 · 示范网站
   主题色可在下方 CSS 变量中统一调整
   ============================================================ */

:root {
  --primary: #4f7cff;
  --primary-dark: #3b5fe0;
  --accent: #8b5cf6;
  --gradient: linear-gradient(135deg, #4f7cff 0%, #8b5cf6 100%);
  --bg: #0b1020;
  --bg-alt: #101731;
  --card: #141c3a;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf8;
  --text-dim: #9aa4c4;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 124, 255, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-ghost:hover { border-color: var(--primary); color: #cfe0ff; }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.3s;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--text-dim); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 12% 20%, rgba(79, 124, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at 85% 75%, rgba(139, 92, 246, 0.2), transparent 60%),
    radial-gradient(400px 300px at 60% 10%, rgba(56, 189, 248, 0.12), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #cfe0ff;
  background: rgba(79, 124, 255, 0.14);
  border: 1px solid rgba(79, 124, 255, 0.35);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 520px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 40px; }
.stat { display: flex; flex-direction: column; }
.stat strong {
  font-size: 30px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { color: var(--text-dim); font-size: 13px; }

/* ---------- 聊天卡片（Hero） ---------- */
.chat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: perspective(1200px) rotateY(-4deg) rotateX(2deg) translateY(0); }
  50% { transform: perspective(1200px) rotateY(-4deg) rotateX(2deg) translateY(-10px); }
}
.chat-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}
.chat-card-title { flex: 1; font-size: 13px; color: var(--text-dim); }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #7ee2a8;
  background: rgba(126, 226, 168, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #7ee2a8;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.chat-card-body {
  padding: 18px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-card-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--card-border);
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounce 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- 消息气泡 ---------- */
.msg { display: flex; gap: 10px; align-items: flex-start; }
.avatar {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--gradient);
  color: #fff;
}
.avatar.user { background: #2b3560; }
.bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 82%;
}
.msg-user { justify-content: flex-end; }
.msg-user .bubble {
  background: rgba(79, 124, 255, 0.18);
  border-color: rgba(79, 124, 255, 0.3);
}
.msg-user .avatar { order: 2; }

/* ---------- Section 通用 ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: 16px; }

/* ---------- 卡片 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(79, 124, 255, 0.45); }
.card-icon { font-size: 34px; margin-bottom: 16px; }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 14.5px; }

.scene-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}
.scene-card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, 0.5); }
.scene-emoji { font-size: 38px; margin-bottom: 14px; }
.scene-card h3 { font-size: 18px; margin-bottom: 10px; }
.scene-card p { color: var(--text-dim); font-size: 14px; }

/* ---------- 演示窗口 ---------- */
.demo-section { background: linear-gradient(180deg, var(--bg) 0%, #0e1530 100%); }
.suggest { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s;
}
.chip:hover { border-color: var(--primary); color: #cfe0ff; background: rgba(79, 124, 255, 0.1); }

.demo-window {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}
.demo-title { flex: 1; font-size: 13px; color: var(--text-dim); }
.demo-clear {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 12.5px;
}
.demo-clear:hover { color: #ff9e9e; }
.demo-body {
  padding: 22px;
  min-height: 340px;
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.demo-input-row {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}
.demo-input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.demo-input-row input:focus { border-color: var(--primary); }
.demo-input-row input::placeholder { color: #56618a; }
.btn-send { border-radius: 12px; padding: 12px 24px; }

.msg-typing .bubble::after {
  content: "";
  display: inline-block;
  width: 4px; height: 14px;
  margin-left: 4px;
  background: var(--primary);
  vertical-align: middle;
  animation: caret 0.8s infinite;
}
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------- 工作原理 ---------- */
.how-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 48px;
}
.flow-step {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  position: relative;
}
.step-num {
  font-size: 26px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.flow-step h3 { font-size: 17px; margin-bottom: 8px; }
.flow-step p { color: var(--text-dim); font-size: 13.5px; }
.flow-arrow {
  align-self: center;
  font-size: 22px;
  color: var(--primary);
  font-weight: 700;
}

.arch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 26px;
  border: 1px dashed rgba(79, 124, 255, 0.4);
  border-radius: var(--radius);
  background: rgba(79, 124, 255, 0.05);
}
.arch-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px;
  padding: 10px 18px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.arch-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gradient);
}
.arch-arrow { color: var(--accent); font-weight: 700; font-size: 18px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
}
.faq-arrow { transition: transform 0.3s; color: var(--primary); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  color: var(--text-dim);
  font-size: 14.5px;
}
.faq-item.open .faq-a { max-height: 320px; }
.faq-a p { padding: 0 22px 20px; }
.faq-a code {
  background: rgba(79, 124, 255, 0.14);
  color: #cfe0ff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

/* ---------- 模型配置弹窗 ---------- */
.demo-mode { color: var(--text-dim); background: rgba(255, 255, 255, 0.08); }
.demo-mode.live {
  color: #7ee2a8;
  background: rgba(126, 226, 168, 0.12);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 19px; margin-bottom: 10px; }
.modal-tip { color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; }
.modal label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 14px 0 6px;
}
.modal input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.modal input:focus { border-color: var(--primary); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cfg-test-result {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  min-height: 18px;
}
.cfg-test-result.ok { color: #7ee2a8; }
.cfg-test-result.fail { color: #ff9e9e; }
.cfg-test-result.testing { color: var(--text-dim); }

/* ---------- 错误提示气泡 ---------- */
.msg-error .avatar { background: #b3563b; }
.msg-error .bubble {
  background: rgba(255, 120, 120, 0.1);
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffc9c9;
  font-size: 13px;
}

/* ---------- 滚动条 ---------- */
.demo-body::-webkit-scrollbar { width: 6px; }
.demo-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.demo-body::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 110px; }
  .chat-card { transform: none; animation: none; max-width: 560px; margin: 0 auto; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .how-flow { grid-template-columns: repeat(2, 1fr); }
  .flow-arrow { display: none; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--card-border);
    padding: 10px 0;
    transform: translateY(-120%);
    transition: transform 0.3s;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 24px; }
  .nav-toggle { display: flex; }
  .grid-3, .grid-4, .how-flow { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .demo-input-row { flex-direction: column; }
  .btn-send { width: 100%; }
}