/* ============================================
   首页智能体对话（纯前端，内嵌卡片形态，常驻展开）
   浅色商务风，跟随站点 :root 变量
   ============================================ */

/* ---------- 首页 Hero：文案（约 1/3）+ 助手（约 2/3） ---------- */
.hero--solo {
  /* 不再撑满一屏并垂直居中：贴合内容高度，消除大片空白 */
  min-height: auto;
  padding: calc(var(--nav-h) + 40px) 0 60px;
}

.hero--solo .hero__inner {
  grid-template-columns: 1fr 3fr;
  gap: 44px;
  align-items: center;
}

.hero--solo .hero__title {
  font-size: clamp(21px, 1.95vw, 28px);
  line-height: 1.4;
}

.hero--solo .hero__desc {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.85;
  max-width: 100%;
}

.hero__ai {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  justify-self: stretch;
}

@media (max-width: 1080px) {
  .hero--solo .hero__inner {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .hero__ai {
    max-width: none;
    justify-self: stretch;
  }
}

/* ---------- 助手卡片 ---------- */
.ai-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 592px;
  background: #fff;
  border: 1px solid var(--line-soft, #e3eaf3);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(20, 40, 70, 0.04),
    0 18px 44px rgba(20, 40, 70, 0.1);
  overflow: hidden;
}

/* 顶部渐变细条 */
.ai-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-600, #1d5fd6), #3b82f6 55%, var(--cyan-500, #06b6d4));
  z-index: 2;
}

.ai-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #f2f7fe 0%, #f7fbff 60%, #eff8fb 100%);
  border-bottom: 1px solid var(--line-soft, #e3eaf3);
  flex: none;
}

.ai-panel__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600, #1d5fd6), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 6px 14px rgba(29, 95, 214, 0.28);
}

.ai-panel__avatar svg { width: 23px; height: 23px; }

.ai-panel__title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--brand-900, #0f2540);
}

.ai-panel__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim, #6b7d92);
  margin-top: 3px;
}

.ai-panel__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* ---------- 消息区 ---------- */
.ai-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 10px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.ai-msg {
  max-width: min(88%, 620px);
  font-size: 13.8px;
  line-height: 1.68;
  animation: ai-msg-in 0.25s ease both;
}

@keyframes ai-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg--bot {
  align-self: flex-start;
  color: var(--ink, #1c2b3a);
  background: #fff;
  border: 1px solid var(--line-soft, #e3eaf3);
  border-radius: 4px 14px 14px 14px;
  padding: 11px 14px;
  box-shadow: 0 2px 8px rgba(28, 43, 58, 0.05);
}

.ai-msg--user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600, #1d5fd6), #3b82f6);
  border-radius: 14px 4px 14px 14px;
  padding: 10px 13px;
  box-shadow: 0 4px 12px rgba(29, 95, 214, 0.22);
}

.ai-msg a {
  color: var(--blue-600, #1d5fd6);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.ai-msg a:hover { border-bottom-style: solid; }

.ai-msg b { font-weight: 600; }

/* 模型返回的表格行 → 「字段 · 值」 */
.ai-msg .ai-row {
  display: block;
  font-size: 12.6px;
  color: #4a5a6e;
  padding: 4px 0;
  border-bottom: 1px dashed #e8eef6;
}

.ai-msg .ai-row:last-child { border-bottom: none; }

/* 消息内的快捷跳转 */
.ai-msg .ai-links {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-msg .ai-links a {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef4fc;
  border: 1px solid #d8e6f8;
  border-bottom: 1px solid #d8e6f8;
}

/* 打字中的三个点 */
.ai-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line-soft, #e3eaf3);
  border-radius: 4px 14px 14px 14px;
}

.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9db6d4;
  animation: ai-dot 1.1s infinite ease-in-out;
}

.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- 建议问题 ---------- */
.ai-panel__chips {
  flex: none;
  display: flex;
  gap: 7px;
  padding: 10px 14px;
  overflow-x: auto;
  background: #fbfdff;
  border-top: 1px solid #edf2f8;
  scrollbar-width: none;
}

.ai-panel__chips::-webkit-scrollbar { display: none; }

.ai-chip {
  flex: none;
  font-size: 12.5px;
  color: var(--blue-600, #1d5fd6);
  background: #fff;
  border: 1px solid #d8e6f8;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-chip:hover { background: #eef4fc; border-color: #b9d2f2; }

/* ---------- 输入区 ---------- */
.ai-panel__input {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--line-soft, #e3eaf3);
}

.ai-panel__input input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe4ef;
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13.8px;
  font-family: inherit;
  color: var(--ink, #1c2b3a);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-panel__input input:focus {
  border-color: var(--blue-600, #1d5fd6);
  box-shadow: 0 0 0 3px rgba(29, 95, 214, 0.12);
  background: #fff;
}

.ai-panel__send {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600, #1d5fd6), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(29, 95, 214, 0.26);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ai-panel__send:hover { opacity: 0.92; transform: translateY(-1px); }
.ai-panel__send svg { width: 19px; height: 19px; }

.ai-panel__foot {
  flex: none;
  font-size: 10.5px;
  color: #93a5ba;
  text-align: center;
  padding: 0 12px 9px;
  background: #fff;
}

/* ---------- 联系我们表单 ---------- */
.ai-form {
  align-self: stretch;
  background: #fff;
  border: 1px solid #d8e6f8;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(28, 43, 58, 0.06);
  animation: ai-msg-in 0.25s ease both;
}

.ai-form__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-900, #0f2540);
  margin-bottom: 10px;
}

.ai-form__input,
.ai-form__area {
  display: block;
  width: 100%;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink, #1c2b3a);
  background: #fbfcfe;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-form__area {
  resize: vertical;
  min-height: 68px;
  line-height: 1.6;
}

.ai-form__input:focus,
.ai-form__area:focus {
  border-color: var(--blue-600, #1d5fd6);
  box-shadow: 0 0 0 3px rgba(29, 95, 214, 0.12);
  background: #fff;
}

.ai-form__input:disabled,
.ai-form__area:disabled {
  background: #f3f6fa;
  color: #8fa0b4;
}

.ai-form__actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.ai-form__submit {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600, #1d5fd6), #3b82f6);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(29, 95, 214, 0.24);
  transition: opacity 0.15s ease;
}

.ai-form__submit:hover { opacity: 0.92; }

.ai-form__submit:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.ai-form__cancel {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-lo, #5b6b80);
  background: #fff;
  cursor: pointer;
}

.ai-form__cancel:hover { background: #f4f7fb; }

.ai-form__note {
  font-size: 12.5px;
  line-height: 1.6;
  margin-top: 9px;
}

.ai-form__note:empty { margin-top: 0; }

.ai-form__ok { color: #17845a; }
.ai-form__tip { color: #7d8ea3; font-size: 12px; }
.ai-form__err { color: #c0392b; }

.ai-form__note a {
  color: var(--blue-600, #1d5fd6);
  font-weight: 600;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .ai-panel { height: 460px; border-radius: 16px; }
  .hero--solo .hero__title { font-size: clamp(24px, 6.4vw, 32px); }
}
