/* ==========================================
   AI懂我 · 对话 UI — chat-v2 样式
   Screen 1: 对话首页 / Screen 2: 对话界面 / Screen 3: 整理确认
   ========================================== */

/* --- Chat CSS Variables --- */
:root {
  --chat-purple: #5E6AD2;
  --chat-purple-light: #EEEDFB;
  --chat-purple-gradient: linear-gradient(135deg, #7562a6, #5E6AD2 50%, #9b85b8);
  --chat-orange: #E8A547;
  --chat-orange-light: #FDF5E6;
  --chat-green: #5B9B6F;
  --chat-green-light: #F0F7F2;
  --chat-bg: #F7F4FB;
  --chat-card: #FFFFFF;
  --chat-border: rgba(119, 98, 168, 0.08);
  --chat-text: #3D3327;
  --chat-text-secondary: #6B5D4F;
  --chat-text-muted: #A39588;
  --chat-white: #FFFFFF;
  --chat-bubble-ai: #FFFFFF;
  --chat-bubble-user: #5E6AD2;
  --chat-radius-sm: 8px;
  --chat-radius-md: 12px;
  --chat-radius-lg: 16px;
  --chat-radius-xl: 20px;
  --chat-radius-full: 9999px;
  --chat-shadow: 0 2px 12px rgba(82, 63, 113, 0.08);
  --chat-shadow-lg: 0 8px 32px rgba(82, 63, 113, 0.14);
}

/* ==========================================
   Screen 1: 对话首页 ChatHome
   ========================================== */

/* 身份信息行 */
.chat-home-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.chat-home-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7562a6, #9b85b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: #fff;
}

.chat-home-identity-info {
  flex: 1;
  min-width: 0;
}

.chat-home-identity-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--chat-text);
  line-height: 1.3;
}

.chat-home-identity-desc {
  font-size: 12px;
  color: var(--chat-text-muted);
  line-height: 1.3;
}

/* Hero 区域 */
.chat-home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 28px;
  position: relative;
}

/* 两个重叠的装饰气泡 */
.chat-home-deco-bubbles {
  position: relative;
  width: 120px;
  height: 100px;
  margin-bottom: 24px;
}

.chat-home-deco-bubble {
  position: absolute;
  border-radius: 50%;
}

.chat-home-deco-bubble.purple {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #7562a6, #5E6AD2);
  opacity: 0.85;
  top: 0;
  left: 10px;
}

.chat-home-deco-bubble.white {
  width: 64px;
  height: 64px;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.15);
  border: 2px solid rgba(94, 106, 210, 0.1);
  top: 20px;
  left: 40px;
}

.chat-home-hero-question {
  font-size: 20px;
  font-weight: 700;
  color: var(--chat-text);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

.chat-home-hero-hint {
  font-size: 13px;
  color: var(--chat-text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 260px;
}

/* 开始聊天按钮 */
.chat-home-btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 16px 0;
  border: none;
  border-radius: var(--chat-radius-lg);
  background: linear-gradient(135deg, #7562a6, #5E6AD2);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.3);
  transition: all 0.2s ease;
}

.chat-home-btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(94, 106, 210, 0.4);
}

.chat-home-btn-start:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(94, 106, 210, 0.25);
}

/* 待确认提醒卡 */
.chat-home-pending-card {
  margin: 0 16px 16px;
  background: var(--chat-orange-light);
  border: 1px solid rgba(232, 165, 71, 0.25);
  border-radius: var(--chat-radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-home-pending-card:hover {
  background: #FEF3E0;
  border-color: rgba(232, 165, 71, 0.4);
}

.chat-home-pending-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-home-pending-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chat-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.chat-home-pending-label {
  font-size: 11px;
  font-weight: 700;
  color: #8C6A00;
  background: rgba(232, 165, 71, 0.2);
  padding: 2px 8px;
  border-radius: var(--chat-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.chat-home-pending-text {
  font-size: 14px;
  font-weight: 600;
  color: #8C6A00;
}

.chat-home-pending-arrow {
  font-size: 16px;
  color: var(--chat-orange);
  font-weight: 700;
}

/* 查看全部聊天记录 */
.chat-home-records-link {
  display: block;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--chat-text-secondary);
  cursor: pointer;
  text-decoration: none;
}

.chat-home-records-link:hover {
  color: var(--chat-purple);
}

/* 脚注 */
.chat-home-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 11px;
  color: var(--chat-text-muted);
  border-top: 1px solid var(--chat-border);
}

/* ==========================================
   Screen 2: 对话界面 ChatConversation
   ========================================== */

/* 顶部栏 */
.chat-conv-topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(250, 248, 253, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--chat-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-conv-btn-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--chat-text);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
}

.chat-conv-btn-back:hover {
  background: rgba(0, 0, 0, 0.04);
}

.chat-conv-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--chat-text);
}

.chat-conv-btn-end {
  padding: 6px 14px;
  border: 1.5px solid rgba(94, 106, 210, 0.3);
  border-radius: var(--chat-radius-full);
  background: var(--chat-purple-light);
  color: var(--chat-purple);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chat-conv-btn-end:hover {
  background: var(--chat-purple);
  color: #fff;
}

/* AI 状态栏 */
.chat-conv-status-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--chat-purple-light);
  border-bottom: 1px solid rgba(94, 106, 210, 0.1);
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-conv-status-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7562a6, #5E6AD2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.chat-conv-status-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chat-conv-status-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--chat-purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-conv-status-sub {
  font-size: 12px;
  color: var(--chat-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-conv-status-text {
  flex: 1;
  font-size: 13px;
  color: var(--chat-purple);
  font-weight: 500;
}

.chat-conv-status-draft {
  font-size: 12px;
  color: var(--chat-text-muted);
}

.chat-conv-status-arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--chat-purple);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 消息列表 */
.chat-conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* 日期分隔符 */
.chat-date-divider {
  text-align: center;
  padding: 16px 0 8px;
}

.chat-date-divider span {
  font-size: 12px;
  color: #A39588;
  background: var(--chat-bg);
  padding: 3px 12px;
  border-radius: var(--chat-radius-full);
}

/* AI 气泡 — 左边白色 */
.chat-bubble-ai {
  align-self: flex-start;
  max-width: 82%;
  background: var(--chat-white);
  color: var(--chat-text);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  word-break: break-word;
  animation: chatBubbleIn 0.25s ease;
}

/* 用户气泡 — 右边紫色底白字 */
.chat-bubble-user {
  align-self: flex-end;
  max-width: 82%;
  background: var(--chat-bubble-user);
  color: var(--chat-white);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  animation: chatBubbleIn 0.25s ease;
}

/* 草稿卡片 — 左边4px紫色竖条 */
.chat-draft-card {
  align-self: flex-start;
  max-width: 90%;
  background: var(--chat-white);
  border-radius: 0 var(--chat-radius-md) var(--chat-radius-md) 0;
  border-left: 4px solid var(--chat-purple);
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  animation: chatBubbleIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-draft-card-info {
  flex: 1;
  min-width: 0;
}

.chat-draft-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--chat-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-draft-card-summary {
  font-size: 10.5px;
  color: var(--chat-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-draft-card-arrow {
  font-size: 16px;
  color: var(--chat-purple);
  font-weight: 700;
  flex-shrink: 0;
}

/* 系统提示 — 居中灰色小字 */
.chat-system-msg {
  text-align: center;
  padding: 8px 0;
}

.chat-system-msg span {
  font-size: 12px;
  color: var(--chat-text-muted);
  background: transparent;
  padding: 3px 12px;
}

/* 快捷回复行 — 横向滚动 */
.chat-quick-replies {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.chat-quick-replies::-webkit-scrollbar {
  display: none;
}

.chat-quick-reply-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1.5px solid rgba(94, 106, 210, 0.25);
  border-radius: var(--chat-radius-full);
  background: var(--chat-white);
  color: var(--chat-purple);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  scroll-snap-align: start;
  transition: all 0.2s ease;
}

.chat-quick-reply-btn:hover {
  background: var(--chat-purple-light);
  border-color: var(--chat-purple);
}

.chat-quick-reply-btn:active {
  background: var(--chat-purple);
  color: #fff;
}

.chat-quick-replies-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  color: var(--chat-text-muted);
  font-size: 16px;
}

/* 底部输入区 */
.chat-conv-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--chat-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.chat-conv-btn-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(94, 106, 210, 0.25);
  background: transparent;
  color: var(--chat-purple);
  font-size: 20px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-conv-btn-plus:hover {
  background: var(--chat-purple-light);
}

.chat-conv-editor {
  flex: 1;
  min-height: 36px;
  max-height: 88px;
  padding: 8px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  background: var(--chat-bg);
  color: var(--chat-text);
  overflow-y: auto;
  word-break: break-word;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.chat-conv-editor:focus {
  border-color: var(--chat-purple);
  background: #fff;
}

.chat-conv-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--chat-text-muted);
  pointer-events: none;
}

.chat-conv-btn-voice {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--chat-text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chat-conv-btn-voice:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--chat-text);
}

.chat-conv-btn-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--chat-purple);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chat-conv-btn-send:hover {
  background: #4F5BC4;
  transform: scale(1.05);
}

.chat-conv-btn-send:active {
  transform: scale(0.95);
}

.chat-conv-btn-send:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* 收起快捷回复 */
.chat-quick-replies.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
}

/* 气泡动画 */
@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 打字指示器 */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ==========================================
   Screen 3: 整理确认页 ChatReview
   ========================================== */

/* 顶部栏 */
.chat-review-topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(250, 248, 253, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--chat-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-review-btn-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--chat-text);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
}

.chat-review-btn-back:hover {
  background: rgba(0, 0, 0, 0.04);
}

.chat-review-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--chat-text);
  margin-right: 32px;
}

/* 说明条 — 浅紫底 */
.chat-review-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--chat-purple-light);
  border-bottom: 1px solid rgba(94, 106, 210, 0.1);
  font-size: 13px;
}

.chat-review-info-count {
  font-weight: 600;
  color: var(--chat-purple);
}

.chat-review-info-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--chat-text-muted);
}

.chat-review-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.chat-review-legend-dot.orange {
  background: var(--chat-orange);
}

.chat-review-legend-dot.green {
  background: var(--chat-green);
}

/* 草稿卡片列表 */
.chat-review-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 草稿卡片 */
.chat-review-draft-card {
  background: var(--chat-white);
  border-radius: 0 var(--chat-radius-md) var(--chat-radius-md) 0;
  box-shadow: var(--chat-shadow);
  overflow: hidden;
  transition: all 0.2s ease;
}

.chat-review-draft-card.pending {
  border-left: 4px solid var(--chat-orange);
}

.chat-review-draft-card.confirmed {
  border-left: 4px solid var(--chat-green);
}

.chat-review-draft-header {
  display: flex;
  align-items: center;
  padding: 12px 14px 8px;
  gap: 8px;
}

.chat-review-draft-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--chat-radius-full);
  flex-shrink: 0;
}

.chat-review-draft-card.pending .chat-review-draft-status {
  background: var(--chat-orange-light);
  color: #8C6A00;
}

.chat-review-draft-card.confirmed .chat-review-draft-status {
  background: var(--chat-green-light);
  color: #2E7D0F;
}

.chat-review-draft-menu {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--chat-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.chat-review-draft-menu:hover {
  background: rgba(0, 0, 0, 0.04);
}

.chat-review-draft-body {
  padding: 0 14px 12px;
}

.chat-review-draft-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--chat-text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.chat-review-draft-summary {
  font-size: 10.5px;
  color: var(--chat-text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.chat-review-draft-confirmed-note {
  font-size: 12px;
  color: var(--chat-green);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 草稿卡片内模块标签 */
.chat-review-draft-module {
  font-size: 11px;
  color: var(--chat-text-muted);
  background: rgba(94, 106, 210, 0.06);
  padding: 2px 8px;
  border-radius: var(--chat-radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

/* 草稿来源对话预览 */
.chat-review-draft-source {
  font-size: 11px;
  color: var(--chat-text-muted);
  line-height: 1.4;
  padding: 6px 8px;
  margin: 6px 0;
  background: var(--chat-bg);
  border-radius: var(--chat-radius-sm);
  border-left: 2px solid rgba(94, 106, 210, 0.2);
}

/* 草稿元信息行 */
.chat-review-draft-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--chat-text-muted);
  margin-top: 6px;
  flex-wrap: wrap;
}

/* 展开编辑按钮 */
.chat-review-btn-expand {
  padding: 6px 14px;
  border: 1.5px solid rgba(94, 106, 210, 0.2);
  border-radius: var(--chat-radius-full);
  background: transparent;
  color: var(--chat-purple);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-review-btn-expand:hover {
  background: rgba(94, 106, 210, 0.06);
  border-color: var(--chat-purple);
}

/* 放弃按钮 */
.chat-review-btn-discard {
  padding: 6px 14px;
  border: 1.5px solid rgba(212, 101, 74, 0.2);
  border-radius: var(--chat-radius-full);
  background: transparent;
  color: #D4654A;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-review-btn-discard:hover {
  background: rgba(212, 101, 74, 0.06);
  border-color: #D4654A;
}

/* 展开后结构化字段 */
.chat-review-draft-fields {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--chat-border);
  display: none;
}

.chat-review-draft-card.expanded .chat-review-draft-fields {
  display: block;
}

.chat-review-draft-field {
  margin-bottom: 8px;
}

.chat-review-draft-field-label {
  font-size: 11px;
  color: var(--chat-text-muted);
  margin-bottom: 3px;
  font-weight: 500;
}

.chat-review-draft-field-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--chat-radius-sm);
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  background: var(--chat-bg);
  color: var(--chat-text);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.chat-review-draft-field-input:focus {
  border-color: var(--chat-purple);
  background: #fff;
}

/* 操作按钮 */
.chat-review-draft-actions {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  flex-wrap: wrap;
}

.chat-review-btn-modify {
  padding: 6px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--chat-radius-full);
  background: transparent;
  color: var(--chat-text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-review-btn-modify:hover {
  border-color: var(--chat-purple);
  color: var(--chat-purple);
}

.chat-review-btn-confirm {
  padding: 6px 14px;
  border: none;
  border-radius: var(--chat-radius-full);
  background: var(--chat-purple);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-review-btn-confirm:hover {
  background: #4F5BC4;
}

.chat-review-btn-detail {
  padding: 6px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--chat-radius-full);
  background: transparent;
  color: var(--chat-text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-review-btn-detail:hover {
  border-color: var(--chat-text-muted);
  color: var(--chat-text);
}

/* 底部固定栏 */
.chat-review-bottom-bar {
  position: sticky;
  bottom: 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

.chat-review-btn-confirm-all {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: var(--chat-radius-lg);
  background: linear-gradient(135deg, #7562a6, #5E6AD2);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.3);
  transition: all 0.2s ease;
}

.chat-review-btn-confirm-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(94, 106, 210, 0.4);
}

.chat-review-btn-confirm-all:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.chat-review-btn-later {
  width: 100%;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--chat-text-muted);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease;
}

.chat-review-btn-later:hover {
  color: var(--chat-text-secondary);
}

/* ==========================================
   成功弹窗
   ========================================== */

.chat-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chat-success-dialog {
  background: #fff;
  border-radius: var(--chat-radius-xl);
  padding: 32px 24px 24px;
  text-align: center;
  max-width: 300px;
  width: 85%;
  box-shadow: var(--chat-shadow-lg);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--chat-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.chat-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--chat-text);
  margin-bottom: 8px;
}

.chat-success-desc {
  font-size: 14px;
  color: var(--chat-text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.chat-success-btn {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: var(--chat-radius-md);
  background: var(--chat-purple);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-success-btn:hover {
  background: #4F5BC4;
}

/* ==========================================
   草案菜单弹出
   ========================================== */

.chat-draft-menu-popup {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border-radius: var(--chat-radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 4px;
  z-index: 100;
  min-width: 120px;
  animation: fadeInOverlay 0.15s ease;
}

.chat-draft-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--chat-text);
  text-align: left;
  cursor: pointer;
  border-radius: var(--chat-radius-sm);
  font-family: inherit;
  transition: background 0.15s ease;
}

.chat-draft-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.chat-draft-menu-item.danger {
  color: #D4654A;
}

/* ==========================================
   聊天容器布局
   ========================================== */

.chat-page-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 600px;
  background: var(--chat-bg);
}

.chat-page-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ==========================================
   空状态
   ========================================== */

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.chat-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.chat-empty-state-text {
  font-size: 14px;
  color: var(--chat-text-muted);
  line-height: 1.5;
}

/* ==========================================
   v3 新增样式
   ========================================== */

/* --- 继续上次对话按钮 --- */
.chat-home-btn-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 14px 0;
  border: 1.5px solid rgba(94, 106, 210, 0.3);
  border-radius: var(--chat-radius-lg);
  background: var(--chat-white);
  color: var(--chat-purple);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.chat-home-btn-continue:hover {
  background: var(--chat-purple-light);
  border-color: var(--chat-purple);
}

/* --- 历史对话列表 --- */
.chat-history-section {
  margin: 12px 16px;
  border-top: 1px solid var(--chat-border);
  padding-top: 12px;
}

.chat-history-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--chat-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding: 0 4px;
}

.chat-history-item {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-radius: var(--chat-radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-history-item:hover {
  background: rgba(94, 106, 210, 0.04);
}

.chat-history-item-info {
  flex: 1;
  min-width: 0;
}

.chat-history-item-preview {
  font-size: 13px;
  color: var(--chat-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.chat-history-item-meta {
  font-size: 11px;
  color: var(--chat-text-muted);
  margin-top: 2px;
}

.chat-history-item-arrow {
  font-size: 16px;
  color: var(--chat-text-muted);
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 8px;
}

/* --- 流式输出气泡 --- */
.chat-stream-bubble {
  min-height: 20px;
  position: relative;
}

.chat-stream-bubble.streaming::after {
  content: '|';
  display: inline;
  animation: blink 0.8s step-end infinite;
  color: var(--chat-purple);
  font-weight: 400;
  margin-left: 1px;
  opacity: 0.8;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- 错误气泡 --- */
.chat-bubble-error {
  background: #FFF0F0 !important;
  border: 1px solid rgba(212, 101, 74, 0.3) !important;
  border-radius: 16px 16px 16px 4px !important;
  color: #B8382E !important;
}

.chat-error-text {
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.chat-error-retry-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(212, 101, 74, 0.4);
  border-radius: var(--chat-radius-full);
  background: #fff;
  color: #D4654A;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-error-retry-btn:hover {
  background: #D4654A;
  color: #fff;
  border-color: #D4654A;
}

/* --- 语音录制脉冲动画 --- */
.chat-conv-btn-voice.recording {
  background: rgba(212, 101, 74, 0.12);
  color: #D4654A;
  animation: voicePulse 1.2s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 101, 74, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 101, 74, 0);
    transform: scale(1.08);
  }
}
