/* =========================================================
   agent.css — 命理 AI Agent 对话页样式
   ========================================================= */

.agent-hero {
  text-align: center;
  padding: 24px 20px 12px;
}
.agent-hero .w-glyph {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--dai), #2a453f);
  color: #f7e9c9; font-size: 30px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; box-shadow: 0 4px 14px rgba(62,90,82,0.35);
  font-family: "KaiTi", "STKaiti", serif;
}
.agent-hero h1 { font-size: 28px; margin: 0 0 8px; color: var(--ink); }
.agent-hero .w-tag { color: var(--ink-soft); font-size: 15px; margin: 0 auto; text-align: center; max-width: 720px; }

/* 提示词快捷面板 */
.agent-presets {
  max-width: 860px; margin: 0 auto 18px; padding: 0 20px;
}
.agent-presets-title {
  font-size: 13px; color: var(--ink-soft); margin: 0 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.ap-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ap-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  color: var(--ink);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; cursor: pointer; transition: all .18s;
  font-family: inherit;
}
.ap-chip:hover {
  border-color: var(--zhu); color: var(--zhu);
  background: rgba(158,43,37,0.06);
}
.ap-chip.active {
  background: var(--zhu); border-color: var(--zhu); color: #f7e9c9;
}

/* 对话容器 */
.agent-chat {
  max-width: 860px; margin: 0 auto 28px; padding: 0 20px;
}
.agent-box {
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: min(70vh, 560px);
  overflow: hidden;
}
.agent-messages {
  flex: 1; overflow-y: auto; padding: 18px;
  scroll-behavior: smooth;
}
.agent-empty {
  text-align: center; color: var(--ink-soft); padding: 20px 10px;
}
.agent-empty-title { color: var(--zhu); display: block; margin-bottom: 4px; font-size: 16px; font-weight: 700; }
.agent-empty-tip { font-size: 13px; margin-bottom: 14px; color: var(--ink-soft); }

/* 引导提示词网格（8 个卡片 + 换一批） */
.agent-prompts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
}
.agent-prompt-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
  cursor: pointer;
  transition: all .18s;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.agent-prompt-card:hover {
  border-color: var(--zhu);
  background: rgba(158,43,37,0.06);
  color: var(--zhu);
  transform: translateY(-2px);
}
.ap-refresh {
  font-size: 13px;
  color: var(--zhe);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
}
.ap-refresh:hover { border-color: var(--zhu); color: var(--zhu); background: rgba(158,43,37,0.05); }

@media (max-width: 860px) {
  .agent-prompts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .agent-prompts-grid { grid-template-columns: 1fr; }
  .agent-prompt-card { min-height: 48px; }
}

/* 消息气泡 */
.msg {
  display: flex; gap: 10px; margin-bottom: 14px;
  animation: msgIn .25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #f7e9c9;
  font-family: "KaiTi", "STKaiti", serif;
}
.msg.assistant .msg-avatar { background: linear-gradient(135deg, var(--zhu), #7d201c); }
.msg.user .msg-avatar { background: linear-gradient(135deg, var(--dai), #2a453f); }
.msg-body {
  max-width: min(86%, 620px);
  padding: 11px 14px; border-radius: 12px;
  font-size: 14.5px; line-height: 1.75;
  white-space: pre-wrap;
}
.msg.assistant .msg-body {
  background: #fff; border: 1px solid var(--border);
  border-top-left-radius: 3px;
}
.msg.user .msg-body {
  background: rgba(62,90,82,0.1); color: var(--ink);
  border-top-right-radius: 3px;
}
.msg-meta {
  font-size: 11px; color: var(--ink-soft); margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
}
.msg-actions {
  opacity: 0; transition: opacity .15s;
}
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button {
  background: transparent; border: none; color: var(--ink-soft);
  cursor: pointer; font-size: 12px; padding: 0;
}
.msg-actions button:hover { color: var(--zhu); }

/* 输入区 */
.agent-input {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: rgba(251,244,227,0.6);
  display: flex; flex-direction: column; gap: 10px;
}
.agent-input-row {
  display: flex; gap: 10px; align-items: flex-end;
}
.agent-input textarea {
  flex: 1; min-height: 46px; max-height: 160px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(120,100,70,0.35);
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 14.5px; line-height: 1.6;
  resize: vertical;
  outline: none;
}
.agent-input textarea:focus { border-color: var(--zhu); }
.agent-input .btn-send {
  flex: none; padding: 10px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--zhu), #7d201c);
  color: #f7e9c9; border: none; cursor: pointer; font-size: 14px;
  transition: opacity .15s;
}
.agent-input .btn-send:disabled { opacity: .5; cursor: not-allowed; }
.agent-input .btn-ghost {
  flex: none; padding: 8px 14px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--ink-soft); cursor: pointer; font-size: 13px;
}
.agent-input .btn-ghost:hover { border-color: var(--zhu); color: var(--zhu); }
.agent-input-hint {
  font-size: 12px; color: var(--ink-soft); display: flex; justify-content: space-between;
}
.agent-input-hint .warn { color: var(--zhu); }

/* 加载动画 */
.thinking {
  display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 13px;
}
.thinking i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 未配置提示 */
.agent-notice {
  max-width: 860px; margin: 0 auto 20px; padding: 0 20px;
}
.agent-notice .notice-card {
  background: rgba(158,43,37,0.08); border: 1px solid rgba(158,43,37,0.25);
  border-radius: 10px; padding: 12px 16px; color: var(--zhu); font-size: 13.5px;
}

/* 响应式 */
@media (max-width: 640px) {
  .agent-hero h1 { font-size: 22px; }
  .agent-box { height: calc(100vh - 260px); min-height: 320px; }
  .msg-body { max-width: 92%; font-size: 14px; }
}

/* =========================================================
   AI 一对一引导式问答弹层（agent.js openGuide 使用）
   ========================================================= */
.guide-mask {
  position: fixed; inset: 0; background: rgba(40,25,10,0.55); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: guideFadeIn .18s ease;
}
@keyframes guideFadeIn { from { opacity: 0; } to { opacity: 1; } }
.guide-box {
  position: relative; width: min(520px, 94vw); max-height: 86vh; overflow-y: auto;
  background: #fffdf8; border: 1px solid rgba(120,100,70,0.3); border-radius: 18px;
  padding: 28px 28px 24px; box-shadow: 0 20px 60px rgba(40,25,10,0.35);
  animation: guideSlideUp .22s ease;
}
@keyframes guideSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.guide-close {
  position: absolute; top: 12px; right: 16px; width: 32px; height: 32px; border: none; background: transparent;
  font-size: 26px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.guide-close:hover { color: var(--zhu); }
.guide-step { font-size: 12px; color: var(--zhe); font-weight: 600; margin-bottom: 4px; }
.guide-h { font-family: "KaiTi","STKaiti",serif; font-size: 22px; color: var(--ink); margin: 0 0 14px; }
.guide-bar { height: 4px; background: rgba(120,100,70,0.15); border-radius: 2px; overflow: hidden; margin-bottom: 16px; }
.guide-bar-f { height: 100%; background: linear-gradient(90deg, var(--zhu), var(--dai)); transition: width .25s; }
.guide-tip {
  font-size: 13px; color: var(--zhe); background: rgba(189,154,78,0.10); border: 1px solid rgba(189,154,78,0.3);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; line-height: 1.6;
}
.guide-tip .guide-link { color: var(--zhu); text-decoration: underline; }
.guide-q { font-size: 16px; color: var(--ink); font-weight: 600; margin-bottom: 10px; line-height: 1.6; }
.guide-input {
  display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 15px; color: var(--ink);
  background: #fff; margin-bottom: 16px;
}
.guide-input:focus { outline: none; border-color: var(--zhu); }
.guide-textarea { min-height: 80px; resize: vertical; }
.guide-select { background: #fff; }
.guide-birth-row { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr 0.7fr; gap: 8px; margin-bottom: 12px; }
.guide-birth { margin-bottom: 0; }
.guide-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.guide-back {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--ink-soft); cursor: pointer; font-size: 14px; font-family: inherit;
}
.guide-back:hover { border-color: var(--zhu); color: var(--zhu); }
.guide-next {
  flex: 1; padding: 11px 20px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--zhu), #7d201c); color: #f7e9c9;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: filter .15s;
}
.guide-next:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
  .guide-birth-row { grid-template-columns: 1fr 1fr; }
  .guide-box { padding: 22px 18px 18px; }
}
