/* AI 问答中心 · DeepTrip 式沉浸设计 v0.2
   本文件只在包含问答中心的页面加载，因此可直接覆盖该页的 Kadence 页面壳。
   模块自身样式一律 .ctc-* 前缀。 */

/* ============ 页面壳：仅隐藏重复页标题（问答中心已可嵌入任意版式页面） ============ */
.entry-header,
.entry-title { display: none !important; }

/* ============ 问答主体（可嵌入 hero 等容器，宽度自适应宿主） ============ */
.ctc-ai-ask {
  width: 100%; max-width: 100%; margin: 0;
  padding: 6px 0 4px; box-sizing: border-box;
}

/* 大标题：渐变字 */
.ctc-ai-ask__head { text-align: center; margin: 6px 0 30px; }
.ctc-ai-ask__title {
  font-size: clamp(34px, 6vw, 58px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.1; margin: 0 0 14px;
  background: linear-gradient(92deg, #7c5cff 0%, #3b82f6 52%, #12a5a0 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.ctc-ai-ask__sub {
  font-size: 16px; color: var(--global-palette5, #4b5563); margin: 0;
}

/* 对话流 */
.ctc-ai-ask__chat {
  display: flex; flex-direction: column; gap: 18px;
  margin: 0 auto 20px; max-width: 820px;
}
.ctc-ai-ask__turn { display: flex; flex-direction: column; gap: 10px; }
.ctc-ai-ask__msg {
  max-width: 88%; padding: 14px 18px; border-radius: 18px;
  font-size: 15px; line-height: 1.68; box-sizing: border-box;
}
.ctc-ai-ask__msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c5cff, #5b8cff);
  color: #fff; border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(124, 92, 255, .28);
}
.ctc-ai-ask__msg--ai {
  align-self: flex-start; width: 100%; max-width: 100%;
  background: #fff; color: var(--global-palette4, #111827);
  border: 1px solid rgba(17, 24, 39, .07);
  border-bottom-left-radius: 6px;
  box-shadow: 0 6px 22px rgba(6, 6, 6, .06);
}
/* 旧结构兼容：答案容器（无气泡包装时） */
.ctc-ai-answer {
  background: #fff; border: 1px solid rgba(17, 24, 39, .07);
  border-radius: 18px 18px 18px 6px; padding: 16px 20px;
  box-shadow: 0 6px 22px rgba(6, 6, 6, .06);
  font-size: 15px; line-height: 1.68; color: var(--global-palette4, #111827);
}
.ctc-ai-human {
  align-self: flex-end; max-width: 88%;
  padding: 14px 18px; border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #7c5cff, #5b8cff);
  color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, .28);
  font-size: 15px; line-height: 1.6;
}
/* 加载中 */
.ctc-ai-ask__msg--loading {
  color: var(--global-palette6, #9ca3af);
  display: inline-flex; align-items: center; gap: 8px;
}
.ctc-ai-ask__msg--loading::before {
  content: ''; width: 18px; height: 18px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2.5px solid rgba(124, 92, 255, .25);
  border-top-color: #7c5cff;
  animation: ctc-spin .8s linear infinite;
}
@keyframes ctc-spin { to { transform: rotate(360deg); } }

/* 预置问题 */
.ctc-ai-ask__pills {
  max-width: 820px; margin: 0 auto 18px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.ctc-ai-ask__pill {
  cursor: pointer; font-family: inherit;
  border: 1px solid var(--global-palette7, #e5e7eb); background: #fff;
  border-radius: 999px; padding: 10px 18px;
  font-size: 13.5px; color: var(--global-palette4, #111827);
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.ctc-ai-ask__pill:hover {
  border-color: #7c5cff; color: #7c5cff;
  background: #f7f4ff; transform: translateY(-1px);
}

/* 提问框：大卡 + 聚焦光环 */
.ctc-ai-ask__form {
  max-width: 820px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 12px;
  background: #fff; border: 1.5px solid var(--global-palette7, #e5e7eb);
  border-radius: 24px; padding: 14px 14px 14px 22px;
  box-shadow: 0 12px 36px rgba(17, 24, 39, .09);
  transition: border-color .15s, box-shadow .2s;
}
.ctc-ai-ask__form:focus-within {
  border-color: #7c5cff;
  box-shadow: 0 14px 44px rgba(124, 92, 255, .18);
}
#ctc-ai-ask-input {
  flex: 1; min-height: 46px;
  border: 0 !important; outline: none !important; box-shadow: none !important;
  background: transparent !important; resize: none;
  font-family: inherit; font-size: 15.5px; line-height: 1.55;
  color: var(--global-palette4, #111827); padding: 8px 0 !important;
}
#ctc-ai-ask-input::placeholder { color: var(--global-palette6, #9ca3af); }
.ctc-ai-ask__btn {
  flex: 0 0 auto; cursor: pointer; font-family: inherit;
  border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #7c5cff, #5b8cff);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 26px; letter-spacing: .01em;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.ctc-ai-ask__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, .35);
}
.ctc-ai-ask__btn:active { transform: translateY(0); }

/* 免责行 */
.ctc-ai-ask__disc {
  max-width: 820px; margin: 16px auto 0; text-align: center;
  font-size: 12.5px; line-height: 1.7; color: var(--global-palette6, #9ca3af);
}
.ctc-ai-ask__disc a { color: inherit; text-decoration: underline; }
.ctc-ai-ask__disc a:hover { color: #7c5cff; }
.ctc-ai-ask__nojs { text-align: center; margin-top: 24px; color: var(--global-palette5, #4b5563); }

/* ============ 答案内部组件（保留原模块语义，统一到新视觉） ============ */
.ctc-cites { margin: 12px 0 4px; }
.ctc-cite {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f7f4ff; border-radius: 999px; padding: 4px 12px;
  font-size: 11.5px; color: #7c5cff; margin: 0 6px 6px 0;
  text-decoration: none;
}
.ctc-cite:hover { background: #efe8ff; }
.ctc-deep-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: inherit;
  background: #fff; border: 1.5px solid #c8102e; color: #c8102e;
  border-radius: 999px; padding: 9px 20px;
  font-weight: 600; font-size: 12.5px; margin-top: 10px;
  transition: background .15s, color .15s;
}
.ctc-deep-btn:hover { background: #c8102e; color: #fff; }
.ctc-deep-btn:disabled { opacity: .45; cursor: default; }
.ctc-l1 {
  background: #eafaf1; border-left: 3px solid #1fae6e;
  border-radius: 0 12px 12px 0; padding: 14px 16px;
}
.ctc-l1__tag {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  color: #148a56; letter-spacing: .03em; margin-bottom: 8px;
}
.ctc-deep-block {
  border-left: 3px solid #c8102e; border-radius: 0 12px 12px 0;
  padding: 14px 16px; margin-top: 12px; background: #fff5f6;
}
.ctc-next-cards { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ctc-next-card {
  flex: 1; min-width: 160px; cursor: pointer;
  border: 1px solid rgba(17, 24, 39, .1); border-radius: 14px;
  padding: 12px 15px; font-size: 13px; text-decoration: none;
  color: var(--global-palette4, #111827); background: #fafafa;
  transition: border-color .15s, background .15s;
}
.ctc-next-card:hover { border-color: #7c5cff; background: #f7f4ff; }
.ctc-form-upgrade { margin-top: 14px; font-weight: 700; }
.ctc-form-upgrade a { color: #7c5cff; text-decoration: none; }
.ctc-form-upgrade a:hover { text-decoration: underline; }
.ctc-thumb {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 11.5px; color: var(--global-palette6, #9ca3af); margin-top: 10px;
}
.ctc-thumb:hover { color: #1fae6e; }
.ctc-disclaim { font-size: 10.5px; color: var(--global-palette6, #9ca3af); margin-top: 10px; }

/* ============ 移动端 ============ */
@media (max-width: 600px) {
  .ctc-ai-ask { padding: 18px 14px 36px; }
  .ctc-ai-ask__title { font-size: 30px; }
  .ctc-ai-ask__sub { font-size: 14px; }
  .ctc-ai-ask__form { border-radius: 18px; padding: 10px 10px 10px 16px; gap: 8px; }
  .ctc-ai-ask__btn { padding: 11px 18px; font-size: 14px; }
  .ctc-ai-ask__pills { gap: 8px; }
  .ctc-ai-ask__pill { padding: 8px 14px; font-size: 12.5px; }
  .ctc-next-cards { flex-direction: column; }
  .ctc-next-card { min-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ctc-ai-ask__msg--loading::before,
  .ctc-ai-ask__pill,
  .ctc-ai-ask__btn,
  .ctc-next-card { transition: none; animation: none; }
}
