* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  line-height: 1.6;
}
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; justify-content: center; align-items: flex-start; }

.panel {
  width: 100%;
  max-width: 760px;
  background: #fff;
  margin: 24px 16px;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.panel h2 { font-size: 18px; margin-bottom: 16px; }
.material { white-space: pre-wrap; font-size: 16px; }
.panel.done { text-align: center; padding: 60px 24px; }

.btn { border: none; border-radius: 8px; padding: 10px 20px; font-size: 15px; cursor: pointer; }
.btn.primary { background: #3b82f6; color: #fff; margin-top: 20px; }
.btn.primary:disabled { background: #93c5fd; cursor: not-allowed; }
.btn.send { background: #3b82f6; color: #fff; border-radius: 999px; padding: 0 20px; }

/* 问卷 */
.qform .q { margin-bottom: 18px; }
.qform .q .q-title { font-weight: 600; margin-bottom: 8px; }
.qform .opt { display: block; padding: 6px 0; cursor: pointer; }
.qform textarea {
  width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit;
}
.scale { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scale label { display: flex; flex-direction: column; align-items: center; font-size: 13px; }

/* 对话 */
.chat-wrap {
  width: 100%; max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; height: 100vh; padding: 12px;
}
.intro {
  background: #eff6ff; border: 1px solid #dbeafe; color: #1e40af;
  font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px;
}
/* 对话模式切换开关 */
.chat-topbar { display: flex; align-items: center; gap: 10px; padding: 8px 4px; margin-bottom: 4px; }
.chat-topbar .mode-cap { font-size: 13px; color: #6b7280; }
.chat-topbar .mode-text { font-size: 13px; font-weight: 600; color: #1f2937; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #3b82f6; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px 2px; }
.msg { max-width: 80%; padding: 10px 14px; font-size: 15px; word-break: break-word; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #3b82f6; color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.ai { align-self: flex-start; background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 16px 16px 16px 4px; }
.msg.typing { color: #9ca3af; }
.dot { animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }

/* 输入框上方的单个提示气泡（与上方对话留出间距 + 细分隔线） */
.suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 16px 2px 8px; margin-top: 8px; border-top: 1px solid #eef0f3; }
.suggestions:empty { display: none; }
.sugg-label { font-size: 12px; color: #9ca3af; padding-left: 4px; }
.chip {
  max-width: 100%; text-align: left; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af;
  border-radius: 14px; padding: 9px 14px; font-size: 14px; line-height: 1.45; cursor: pointer;
  transition: background .15s, border-color .15s, transform .04s;
}
.chip:hover { background: #dbeafe; border-color: #93c5fd; }
.chip:active { transform: translateY(1px); }

.next-bar { display: none; padding: 6px 2px; }
.next-bar.show { display: block; }

.composer { display: flex; gap: 8px; padding: 8px 2px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid #d1d5db; border-radius: 20px;
  padding: 10px 14px; font: inherit; max-height: 120px;
}

@media (max-width: 600px) {
  .panel { margin: 0; border-radius: 0; min-height: 100vh; }
  .msg { max-width: 86%; }
}
