/**
 * AI 助手覆盖样式 — 智能名片系统
 * 流式光标动画、消息气泡增强、输入框优化
 */

/* 流式输出时的闪烁光标 */
.chat-msg.ai .msg-content::after {
  content: '';
  display: none;
  width: 6px;
  height: 16px;
  background: #07c160;
  margin-left: 2px;
  animation: ai-cursor-blink 0.8s infinite;
  vertical-align: text-bottom;
  border-radius: 1px;
}

/* AI 消息正在流式输出时的光标 */
.chat-msg.ai.streaming .msg-content::after {
  display: inline-block;
}

@keyframes ai-cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 输入框 placeholder 优化 */
.wx-input-bar input::placeholder {
  color: #999;
  font-size: 15px;
}

/* 覆盖消息的淡入动画 */
.chat-msg[data-ai-override="true"] {
  animation: ai-msg-fade-in 0.3s ease-out;
}

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

/* AI 消息中的代码块样式 */
.chat-msg.ai .msg-content pre {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 4px 0;
  overflow-x: auto;
  font-size: 13px;
}

.chat-msg.ai .msg-content code {
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 13px;
}

.chat-msg.ai .msg-content pre code {
  background: none;
  padding: 0;
}

/* AI 消息中的链接样式 */
.chat-msg.ai .msg-content a {
  color: #07c160;
  text-decoration: none;
}

.chat-msg.ai .msg-content a:hover {
  text-decoration: underline;
}

/* 错误消息样式 */
.chat-msg.ai.error .msg-content {
  color: #e94560;
}

/* 流式加载时消息体的轻微脉冲 */
.chat-msg.ai.streaming .msg-body {
  animation: ai-body-pulse 2s ease-in-out infinite;
}


@keyframes ai-body-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}

/* 更多面板中的相册/拍摄启用状态 */
.more-panel-grid > div[data-enabled="true"] {
  opacity: 1 !important;
}

.more-panel-grid > div[data-enabled="true"] .more-panel-badge {
  display: none !important;
}

/* 图片消息样式 */
.chat-msg.user .msg-content img {
  max-width: 200px;
  border-radius: 8px;
  display: block;
}

/* AI 回复中的列表样式 */
.chat-msg.ai .msg-content ul,
.chat-msg.ai .msg-content ol {
  margin: 4px 0;
  padding-left: 20px;
}

.chat-msg.ai .msg-content li {
  margin: 2px 0;
}

/* ============ 欢迎引导消息 ============ */
.ai-welcome {
  padding: 4px 0;
}

.ai-welcome-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 6px;
}

.ai-welcome-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  color: #333;
}

.ai-welcome-desc {
  font-size: 13px;
  color: #888;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 12px;
}

.ai-welcome-section {
  margin-bottom: 10px;
}

.ai-welcome-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.ai-welcome-desc-sm {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.ai-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f0f5ff;
  color: #07c160;
  border: 1px solid #d0e8ff;
  user-select: none;
}

.ai-chip:hover {
  background: #e0efff;
  border-color: #07c160;
  transform: translateY(-1px);
}

.ai-chip:active {
  transform: translateY(0);
}

.ai-chip-ps {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.ai-chip-ps:hover {
  background: #ffe0b2;
  border-color: #e65100;
}

.ai-welcome-tip {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  margin-top: 10px;
  padding: 6px 8px;
  background: #fafafa;
  border-radius: 6px;
  line-height: 1.4;
}

/* ============ AI图片处理工具卡片（注入到 .ai-tools，与原卡片保持一致） ============ */
.tool-card-ai-ps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex: 1;
  min-width: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tool-card-ai-ps:active {
  transform: scale(0.95);
}
.tool-card-ai-ps .tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.tool-card-ai-ps .tool-label {
  font-size: 10px;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
}

@media screen and (min-width: 768px) {
  body.ai-pc-mode .ai-page .tool-card-ai-ps {
    flex: none;
    min-width: 90px;
    padding: 12px 16px;
    border-radius: 12px;
  }
  body.ai-pc-mode .ai-page .tool-card-ai-ps .tool-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  body.ai-pc-mode .ai-page .tool-card-ai-ps .tool-label {
    font-size: 13px;
  }
}

/* 横屏手机 */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .tool-card-ai-ps {
    padding: 4px 6px;
  }
  .tool-card-ai-ps .tool-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .tool-card-ai-ps .tool-label {
    font-size: 9px;
  }
}

/* ============ 展开功能详情 ============ */
.ai-expand-toggle {
  display: inline-block;
  flex-shrink: 0;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  transition: all 0.15s;
}
.ai-expand-toggle:hover {
  color: #07c160;
  border-color: #07c160;
}
.ai-expand-toggle.open {
  color: #07c160;
  border-color: #07c160;
  background: #f0fff4;
}
.ai-expand-list {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #eee;
}
.ai-expand-item {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  padding: 2px 0;
  border-bottom: 1px dotted #eee;
}
.ai-expand-item:last-child {
  border-bottom: none;
}

/* 智能问答展开列表（芯片风格） */
.ai-expand-list-qa {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-chip-qa {
  display: inline-block;
  font-size: 13px;
  color: #666;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 5px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.ai-chip-qa:hover {
  color: #07c160;
  border-color: #07c160;
  background: #f0fff4;
}
.ai-chip-qa:active {
  transform: scale(0.95);
}

/* ============ PS 操作结果卡片 ============ */
.ps-result-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  padding: 14px;
  color: #e0e0e0;
  font-size: 14px;
  max-width: 320px;
  overflow: hidden;
}

.ps-card-header {
  font-size: 15px;
  font-weight: 600;
  color: #4fc3f7;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ps-plan {
  background: rgba(79, 195, 247, 0.1);
  border-left: 3px solid #4fc3f7;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.ps-ops {
  color: #888;
  font-size: 12px;
  margin-bottom: 10px;
}

.ps-manual {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 10px;
}

.ps-manual-label {
  color: #8b949e;
  font-size: 11px;
  margin-bottom: 4px;
}

.ps-manual-cmd {
  color: #58a6ff;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
  line-height: 1.4;
  max-height: 60px;
  overflow-y: auto;
}

.ps-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.ps-copy-btn, .ps-refresh-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.ps-copy-btn {
  background: #238636;
  color: #fff;
}

.ps-copy-btn:hover {
  background: #2ea043;
}

.ps-refresh-btn {
  background: #1f6feb;
  color: #fff;
}

.ps-refresh-btn:hover {
  background: #388bfd;
}

.ps-refresh-btn:disabled {
  background: #2ea043;
  cursor: default;
}

.ps-output-area {
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.ps-output-img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.ps-status-tip {
  text-align: center;
  font-size: 13px;
  padding: 4px;
  margin-bottom: 4px;
  animation: ai-msg-fade-in 0.3s ease-out;
}

/* ============================================================
   响应式适配 — 电脑端 / 平板 / 手机
   ============================================================ */

/* ---- 平板端（481px ~ 767px）：微小调整 ---- */
@media screen and (min-width: 481px) and (max-width: 767px) {
  .ai-page {
    max-width: 100%;
  }
  .ai-chat {
    padding: 16px 20px 120px;
  }
  .msg-body {
    max-width: 80%;
  }
  .ai-pc-sidebar {
    display: none !important;
  }
}

/* ---- 电脑端（>=768px）：左侧导航栏 + 真正桌面化聊天区 ---- */
@media screen and (min-width: 768px) {
  body.ai-pc-mode {
    background: #eef1f5;
  }

  /* 解锁原版 #app / .app-container 的 750px 限制 */
  body.ai-pc-mode #app {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    min-height: 100vh;
  }
  body.ai-pc-mode .app-container[data-v-79ecf97c] {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: #f5f6fa;
  }

  /* 隐藏手机底部导航栏 */
  body.ai-pc-mode .bottom-nav[data-v-44ef10a3] {
    display: none !important;
  }

  /* 左侧导航栏 */
  body.ai-pc-mode .ai-pc-sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 10000;
    background: #1a1a2e;
    color: #fff;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
  body.ai-pc-mode .ai-pc-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 0 20px;
  }
  body.ai-pc-mode .ai-pc-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
  }
  body.ai-pc-mode .ai-pc-brand-icon {
    font-size: 30px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
  }
  body.ai-pc-mode .ai-pc-brand-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  body.ai-pc-mode .ai-pc-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
  }
  body.ai-pc-mode .ai-pc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
  }
  body.ai-pc-mode .ai-pc-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  body.ai-pc-mode .ai-pc-nav-item.active {
    background: rgba(102, 126, 234, 0.25);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  }
  body.ai-pc-mode .ai-pc-nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
  }
  body.ai-pc-mode .ai-pc-nav-label {
    font-weight: 500;
  }
  body.ai-pc-mode .ai-pc-nav-footer {
    padding: 14px 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  body.ai-pc-mode .ai-pc-nav-home {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
  }
  body.ai-pc-mode .ai-pc-nav-home:hover {
    color: #fff;
    background: rgba(102, 126, 234, 0.15);
  }

  /* 右侧 AI 页面铺满剩余宽度 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0;
    box-shadow: none;
    background: #f5f6fa;
  }

  /* 桌面端头部：完全隐藏，品牌已在左侧导航栏 */
  body.ai-pc-mode .ai-header[data-v-5a08e359] {
    display: none !important;
  }

  /* 顶部工具栏：平铺、加宽，留出顶部呼吸空间 */
  body.ai-pc-mode .ai-tools[data-v-5a08e359] {
    display: flex !important;
    padding: 16px 24px 10px !important;
    gap: 14px !important;
    overflow-x: visible !important;
    background: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .tool-card[data-v-5a08e359] {
    flex: none;
    min-width: 90px;
    padding: 12px 16px;
    border-radius: 12px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .tool-icon[data-v-5a08e359] {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .tool-label[data-v-5a08e359] {
    font-size: 13px;
  }

  /* 聊天区域：居中、限宽，更像桌面聊天应用 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-chat[data-v-5a08e359] {
    padding: 24px 32px 150px;
    background: #f5f6fa;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-chat > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 消息气泡：更宽、更大气 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .chat-msg[data-v-5a08e359] {
    margin-bottom: 24px;
    gap: 14px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .msg-body[data-v-5a08e359] {
    max-width: 70%;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .msg-content[data-v-5a08e359] {
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .msg-avatar[data-v-5a08e359] {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  /* 底部输入区 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .bottom-area[data-v-5a08e359] {
    background: #fff;
    border-top: 1px solid #e8e8e8;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .wx-input-bar[data-v-5a08e359] {
    border-radius: 0;
    padding: 14px 28px;
    background: #fff;
    gap: 12px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .wx-input-box[data-v-5a08e359] {
    height: 46px;
    border-radius: 12px;
    background: #f5f6fa;
    border: 1px solid #e8e8e8;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .wx-input-box[data-v-5a08e359] input {
    font-size: 15px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .wx-send-btn[data-v-5a08e359] {
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 15px;
  }

  /* 底部建议问题：平铺换行 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-suggestions[data-v-5a08e359] {
    padding: 12px 28px;
    overflow-x: visible;
    flex-wrap: wrap;
    background: #fff;
    gap: 10px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-suggestions[data-v-5a08e359] span {
    flex: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 16px;
  }

  /* 桌面端欢迎消息：不要消息头像，整体居中卡片 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] {
    display: block;
    margin-bottom: 16px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-avatar[data-v-5a08e359] {
    display: none;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-body[data-v-5a08e359] {
    max-width: 100%;
    margin: 0 auto;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-content[data-v-5a08e359] {
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  /* 欢迎消息：桌面端两栏紧凑布局 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome {
    padding: 0;
    max-width: 960px;
    margin: 0 auto;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-header {
    text-align: center;
    margin-bottom: 12px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-icon {
    font-size: 36px;
    margin-bottom: 2px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-title {
    font-size: 18px;
    margin-bottom: 2px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-desc {
    font-size: 13px;
    margin-bottom: 0;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-section {
    margin-bottom: 0;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-section-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-desc-sm {
    font-size: 11px;
    margin-bottom: 6px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-chips {
    gap: 6px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-chip {
    padding: 6px 10px;
    font-size: 12px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome-tip {
    font-size: 11px;
    padding: 6px 10px;
    margin-top: 0;
  }

  /* PS 结果卡片 */
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ps-result-card {
    max-width: 600px;
    padding: 18px;
  }

  body.ai-pc-mode .ai-page[data-v-5a08e359] .tech-footer {
    display: none;
  }
}

/* ---- 大屏电脑端（>=1024px） ---- */
@media screen and (min-width: 1024px) {
  body.ai-pc-mode .ai-pc-sidebar {
    width: 260px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-chat[data-v-5a08e359] {
    padding: 24px 48px 140px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .msg-body[data-v-5a08e359] {
    max-width: 65%;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-welcome {
    max-width: 960px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ps-result-card {
    max-width: 680px;
  }
}

/* ---- 超宽屏（>=1440px） ---- */
@media screen and (min-width: 1440px) {
  body.ai-pc-mode .ai-pc-sidebar {
    width: 280px;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
  }
  body.ai-pc-mode .ai-page[data-v-5a08e359] .ai-chat[data-v-5a08e359] {
    padding: 28px 56px 150px;
  }
}

/* ======== 图片处理 — 对话引导流样式 ======== */

/* 引导消息卡片 */
.flow-guide-msg {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.flow-guide-icon {
  font-size: 42px;
  margin-bottom: 10px;
}
.flow-guide-text {
  font-size: 15px;
  color: #333;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* 水印文字输入 */
.flow-guide-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.flow-text-input {
  flex: 1;
  max-width: 220px;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.flow-text-input:focus {
  border-color: #667eea;
}
.flow-text-submit {
  padding: 8px 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.flow-text-submit:hover {
  opacity: 0.9;
}

/* 上传按钮 */
.flow-upload-row {
  margin-bottom: 10px;
}
.flow-upload-btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
.flow-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}
.flow-upload-btn:active {
  transform: scale(0.97);
}
.flow-upload-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

/* 取消链接 */
.flow-cancel-row {
  margin-top: 4px;
}
.flow-cancel-link {
  font-size: 13px;
  color: #999;
  cursor: pointer;
}
.flow-cancel-link:hover {
  color: #666;
}

/* 已失效的引导卡片 */
.flow-guide-inactive {
  opacity: 0.6;
  filter: grayscale(0.5);
}
.flow-guide-inactive .flow-guide-text {
  color: #999;
}


/* 提示文字 */
.flow-tip {
  margin-top: 8px;
  color: #fa5151;
  font-size: 13px;
}

/* 处理进度 */
.flow-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
}
.flow-progress-icon {
  font-size: 36px;
  animation: flow-spin 1.5s linear infinite;
}
@keyframes flow-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.flow-progress-text {
  margin: 10px 0 14px;
  font-size: 14px;
  color: #666;
}
.flow-progress-bar {
  width: 160px;
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
}
.flow-progress-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  animation: flow-progress-anim 1.2s ease-in-out infinite;
}
@keyframes flow-progress-anim {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* 结果交付卡片 */
.flow-result-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e8f5e9;
}
.flow-result-header {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #2e7d32;
  background: #f0fdf0;
  border-bottom: 1px solid #e8f5e9;
}

/* ============ 滑动对比器 ============ */
.flow-compare-wrap {
  padding: 16px;
  background: #fafafa;
}
.flow-compare-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.flow-compare-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}
.flow-compare-original {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.flow-compare-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  cursor: ew-resize;
  z-index: 10;
}
.flow-compare-line {
  width: 2px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  margin: 0 auto;
}
.flow-compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #555;
}
.flow-compare-labels {
  display: flex;
  justify-content: space-between;
  padding: 6px 0 0;
  font-size: 12px;
  color: #888;
}
.flow-compare-label-original { color: #999; }
.flow-compare-label-result { color: #2e7d32; font-weight: 600; }

.flow-result-actions {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #f0f0f0;
}
.flow-action-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.12s, opacity 0.12s;
}
.flow-action-btn:active {
  transform: scale(0.96);
}
.flow-download-btn {
  background: #667eea;
  color: #fff;
}
.flow-share-btn {
  background: #07c160;
  color: #fff;
}
.flow-retry-btn {
  background: #f5f5f5;
  color: #555;
}
.flow-download-btn:hover, .flow-share-btn:hover {
  opacity: 0.88;
}
.flow-retry-btn:hover {
  background: #eee;
}

/* ============ 追问芯片 ============ */
.ai-followup-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}
.ai-followup-label {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
  margin-right: 4px;
}
.ai-chip-followup {
  display: inline-block;
  font-size: 13px;
  color: #07c160;
  background: #f0fff4;
  border: 1px solid #c8e6c9;
  border-radius: 16px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-chip-followup:hover {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
}
.ai-chip-followup:active {
  transform: scale(0.95);
}

/* ============ 打字光标动画 ============ */
.ai-typing-cursor {
  display: inline;
  animation: ai-cursor-blink 0.8s ease-in-out infinite;
  color: #07c160;
  font-weight: bold;
}
@keyframes ai-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* 引导消息和结果消息 — 在桌面端居中限宽 */
@media screen and (min-width: 768px) {
  .chat-msg.flow-guide .msg-body,
  .chat-msg.flow-guide .msg-content,
  .chat-msg.flow-progress-msg .msg-body,
  .chat-msg.flow-progress-msg .msg-content,
  .chat-msg.flow-result-msg .msg-body,
  .chat-msg.flow-result-msg .msg-content {
    max-width: 520px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ---- 手机/平板竖屏端（<768px）：全屏适配 ---- */
@media screen and (max-width: 767px) {
  /* 全屏布局 */
  .ai-page {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .ai-pc-sidebar {
    display: none !important;
  }

  /* 欢迎消息：全宽、隐藏头像、透明背景 */
  .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] {
    display: block;
    margin-bottom: 12px;
  }
  .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-avatar[data-v-5a08e359] {
    display: none;
  }
  .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-body[data-v-5a08e359] {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .ai-page[data-v-5a08e359] .chat-msg.ai.ai-welcome-msg[data-v-5a08e359] .msg-content[data-v-5a08e359] {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* 欢迎区域内部 */
  .ai-welcome {
    padding: 4px 0;
    width: 100%;
  }
  .ai-welcome-header {
    text-align: center;
    margin-bottom: 10px;
  }
  .ai-welcome-icon {
    font-size: 32px;
  }
  .ai-welcome-title {
    font-size: 15px;
  }
  .ai-welcome-desc {
    font-size: 12px;
    padding: 0 8px;
  }

  /* 芯片区域：换行排列 */
  .ai-welcome-section {
    margin-bottom: 8px;
  }
  .ai-welcome-section-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .ai-welcome-chips {
    gap: 6px;
  }
  .ai-chip {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  /* AI 回复消息：放宽宽度限制 */
  .ai-page[data-v-5a08e359] .chat-msg.ai[data-v-5a08e359] .msg-body[data-v-5a08e359] {
    max-width: 88% !important;
  }

  /* 聊天区 padding 适配 */
  .ai-chat {
    padding: 12px 12px 110px !important;
  }

  /* 输入栏适配 */
  .wx-input-bar {
    padding: 8px 10px !important;
  }
  .wx-input-bar input {
    font-size: 15px !important;
  }

  /* 展开功能详情：字号缩小 */
  .ai-followup-chips {
    padding: 8px 12px;
    gap: 6px;
  }
  .ai-chip-followup {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 14px;
  }
  .ai-expand-toggle {
    font-size: 11px;
    padding: 3px 6px;
  }
  .ai-expand-list {
    padding: 8px 10px;
  }
  .ai-expand-item {
    font-size: 12px;
    line-height: 1.7;
  }

  /* 滑动对比器：手机端适配 */
  .flow-compare-wrap {
    padding: 10px;
  }
  .flow-compare-container {
    border-radius: 6px;
  }
  .flow-compare-img {
    max-height: 280px;
  }
  .flow-compare-handle {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .flow-compare-labels {
    font-size: 11px;
  }
  .flow-result-card {
    border-radius: 10px;
  }
  .flow-result-header {
    padding: 10px 14px;
    font-size: 13px;
  }
  .flow-result-actions {
    padding: 10px 12px;
    gap: 8px;
  }
  .flow-action-btn {
    padding: 8px 0;
    font-size: 13px;
  }

  /* 顶部 header */
  .ai-header {
    padding: 10px 14px !important;
    position: relative;
  }
  .ai-header h1 {
    font-size: 15px !important;
  }

  /* 手机端「更多」菜单按钮（⋮ 三点） */
  .ai-mobile-menu-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  .ai-mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.35);
  }

  /* 手机端下拉菜单 */
  .ai-mobile-menu {
    position: fixed;
    top: 48px;
    right: 12px;
    z-index: 9999;
    min-width: 150px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    pointer-events: none;
  }
  .ai-mobile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .ai-mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
  }
  .ai-mobile-menu-item:last-child {
    border-bottom: none;
  }
  .ai-mobile-menu-item:active {
    background: #f5f5f5;
  }
  .ai-mobile-menu-icon {
    font-size: 16px;
  }
}

/* ---- 手机端（<=480px）：更紧凑 ---- */
@media screen and (max-width: 480px) {
  .ai-page {
    max-width: 100%;
    margin-left: 0;
    width: 100% !important;
  }
  .ai-pc-sidebar {
    display: none !important;
  }
  .ai-chip {
    font-size: 11px;
    padding: 5px 8px;
  }
  .ai-welcome-icon {
    font-size: 28px;
  }
  .ai-welcome-title {
    font-size: 14px;
  }
  .ai-welcome-desc {
    font-size: 11px;
  }
}

/* ---- 横屏手机适配 ---- */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .ai-page {
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0;
    margin-left: 0;
    width: 100% !important;
    border-radius: 0;
  }
  .ai-pc-sidebar {
    display: none !important;
  }
  .ai-header {
    padding: 8px 16px;
    padding-top: 8px;
  }
  .ai-header h1 {
    font-size: 14px;
  }
  .ai-tools {
    padding: 4px 0 2px;
  }
  .tool-card {
    padding: 4px 6px;
  }
  .tool-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .tool-label {
    font-size: 9px;
  }
  .ai-chat {
    padding: 8px 12px 80px;
  }
  .chat-msg {
    margin-bottom: 8px;
  }
  .msg-avatar {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .msg-content {
    padding: 8px 12px;
    font-size: 13px;
  }
  .wx-input-bar {
    padding: 4px 8px;
  }
  .wx-input-box {
    height: 34px;
  }
}

/* ============ 人工客服回复样式 ============ */
.admin-reply-msg .msg-content {
  background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf9 100%) !important;
  border-left: 3px solid #1890ff !important;
  font-size: 15px;
  line-height: 1.8;
}
body.ai-pc-mode .admin-reply-msg .msg-content {
  max-width: 700px;
}

@keyframes ai-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}


@keyframes ai-modal-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}



/* --- 空提示 --- */





  /* ===== AI 图片处理 独立对话框（V23/V24 体验还原） ===== */
  .ai-ps-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
  }
  .ai-ps-dialog {
    width: min(900px, 94vw); height: min(640px, 90vh);
    background: #fff; border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  }
  .ai-ps-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
  }
  .ai-ps-title { font-size: 16px; font-weight: 600; }
  .ai-ps-close { font-size: 20px; cursor: pointer; line-height: 1; opacity: 0.9; }
  .ai-ps-close:hover { opacity: 1; }
  .ai-ps-body { flex: 1; display: flex; overflow: hidden; }
  .ai-ps-side {
    width: 220px; border-right: 1px solid #eee; overflow-y: auto;
    padding: 10px; background: #fafafa;
  }
  .ai-ps-feat {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    font-size: 14px; color: #333; margin-bottom: 4px;
  }
  .ai-ps-feat:hover { background: #f0f0f0; }
  .ai-ps-feat.active { background: #667eea; color: #fff; }
  .ai-ps-feat-icon { font-size: 18px; }
  .ai-ps-conv { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .ai-ps-messages { flex: 1; overflow-y: auto; padding: 16px; }
  .ai-ps-msg { margin-bottom: 12px; font-size: 14px; line-height: 1.6; }
  .ai-ps-msg-user { text-align: right; }
  .ai-ps-msg-user > * { display: inline-block; background: #667eea; color: #fff; padding: 8px 12px; border-radius: 12px; text-align: left; max-width: 80%; }
  .ai-ps-user-img { max-width: 160px; border-radius: 10px; }
  .ai-ps-guide { background: #f5f6fa; border-radius: 12px; padding: 12px 14px; }
  .ai-ps-guide-icon { font-size: 22px; margin-bottom: 6px; }
  .ai-ps-guide-upload { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .ai-ps-upload-btn {
    background: #07c160; color: #fff; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: 14px; cursor: pointer;
  }
  .ai-ps-upload-btn:hover { opacity: 0.9; }
  .ai-ps-upload-hint { font-size: 12px; color: #999; }
  .ai-ps-guide-input { margin-top: 10px; display: flex; gap: 8px; }
  .ai-ps-guide-input input { flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; }
  .ai-ps-guide-input button { background: #667eea; color: #fff; border: none; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
  .ai-ps-progress { background: #fff7e6; border: 1px solid #ffe7a3; border-radius: 12px; padding: 12px 14px; }
  .ai-ps-progress-bar { height: 6px; background: #eee; border-radius: 4px; margin-top: 8px; overflow: hidden; }
  .ai-ps-progress-fill { height: 100%; width: 60%; background: #667eea; border-radius: 4px; animation: aiPsSpin 1.1s ease-in-out infinite; }
  @keyframes aiPsSpin { 0% { transform: translateX(-100%); } 100% { transform: translateX(160%); } }
  .ai-ps-msg-result { background: #f0fbf4; border: 1px solid #c8ecd9; border-radius: 12px; padding: 12px 14px; }
  .ai-ps-result-title { font-weight: 600; margin-bottom: 8px; color: #07c160; }
  .ai-ps-result-compare { display: flex; gap: 12px; }
  .ai-ps-compare-item { flex: 1; }
  .ai-ps-compare-label { font-size: 12px; color: #888; margin-bottom: 4px; }
  .ai-ps-compare-item img { width: 100%; border-radius: 8px; border: 1px solid #eee; }
  .ai-ps-result-actions { margin-top: 10px; display: flex; gap: 8px; }
  .ai-ps-result-actions button { border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
  .ai-ps-download-btn { background: #07c160; color: #fff; }
  .ai-ps-retry-btn { background: #667eea; color: #fff; }
  .ai-ps-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #eee; }
  .ai-ps-input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; font-size: 14px; }
  .ai-ps-send { background: #667eea; color: #fff; border: none; border-radius: 10px; padding: 10px 18px; cursor: pointer; }
  @media screen and (max-width: 767px) {
    .ai-ps-overlay { padding: 0; }
    .ai-ps-dialog { width: 100vw; height: 100vh; border-radius: 0; }
    .ai-ps-side { width: 140px; }
    .ai-ps-feat-name { font-size: 12px; }
  }

