/* AGY 对话页公共功能样式，不包含具体页面主题 */

/* ============================================================
 * 公共 CSS 变量定义
 * ============================================================
 * 所有主题共享的颜色变量，具体主题可覆盖特定值
 */
:root {
  /* 品牌色系列 - 湖北政务蓝 */
  --brand-50: #f0f6ff;
  --brand-100: #e0edff;
  --brand-200: #c2dbfe;
  --brand-300: #9bbffc;
  --brand-400: #5f95f4;
  --brand-500: #3b71db;
  --brand-600: #2E54A1;
  --brand-700: #244485;
  --brand-800: #1b356a;
  --brand-900: #142750;
  --brand-950: #0d1a36;

  /* 状态色 */
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --danger-500: #ef4444;
  --danger-600: #dc2626;

  /* 中性色 */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

[v-cloak] {
  display: none !important;
}

.carousel-card {
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  transform-style: preserve-3d;
}

/* 所有主题统一使用的智能体对话头像 */
.agent-chat-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.16);
}

.agent-chat-avatar__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 信用修复主体：桌面端左右栏独立滚动，工作区标题栏保持固定 */
.repair-workspace {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.repair-workspace-grid {
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.repair-workspace-column {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

@media (max-width: 1023px) {
  .repair-workspace {
    overflow-y: auto;
  }

  .repair-workspace-grid {
    height: auto;
  }

  .repair-workspace-column {
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .agent-chat-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

/* Markdown 渲染与代码高亮 */
.md-content {
  font-size: 14px;
  line-height: 1.75;
  color: #334155;
}

.md-content p {
  margin: 0.4rem 0;
}

.md-content pre {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.6rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.md-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(226, 232, 240, 0.6);
  color: #be123c;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 12.5px;
}

.md-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.md-content ul,
.md-content ol {
  padding-left: 1.25rem;
  margin: 0.4rem 0;
}

.md-content ul { list-style-type: disc; }
.md-content ol { list-style-type: decimal; }

/* 思考过程折叠面板 */
.think-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.think-toggle {
  width: 100%;
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
}

.think-toggle:hover {
  background: #f1f5f9;
  color: #334155;
}

.think-body {
  padding: 0.75rem 0.85rem;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

/* 模态弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dialog-card {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 28rem;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast 提示 */
.toast-wrap {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
}

.toast-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.toast-card.success { background: #059669; }
.toast-card.error { background: #dc2626; }
.toast-card.info { background: #2563eb; }

/* 视图切换动画 */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-slide-enter-from {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
}

/* 发送与停止按钮通用基础居中样式 */
.chat-send-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  text-align: center !important;
  line-height: 1 !important;
}

.chat-send-btn i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  width: auto !important;
  height: auto !important;
}

/* ============================================================
 * 适老化 / 长者模式 (Elderly Mode) 专属增强样式
 * ============================================================
 */

/* 0. 根容器全局字号 */
html.elderly-mode,
body.elderly-mode,
#app.elderly-mode {
  font-size: 18px !important;
}

/* 1. 对话气泡与 Markdown 正文字号、行高放大 */
.elderly-mode .md-content,
.elderly-mode .md-content p,
.elderly-mode #workspace-body p,
.elderly-mode #workspace-body .space-y-5 p,
.elderly-mode #workspace-body .space-y-3 p,
.elderly-mode #workspace-body .space-y-2 p {
  font-size: 18px !important;
  line-height: 1.85 !important;
  letter-spacing: 0.2px !important;
}

.elderly-mode .md-content li {
  font-size: 18px !important;
  line-height: 1.8 !important;
  margin-bottom: 6px !important;
}

.elderly-mode .md-content h1 {
  font-size: 24px !important;
  line-height: 1.4 !important;
}

.elderly-mode .md-content h2 {
  font-size: 22px !important;
  line-height: 1.4 !important;
}

.elderly-mode .md-content h3 {
  font-size: 20px !important;
  line-height: 1.45 !important;
}

.elderly-mode .md-content h4,
.elderly-mode .md-content h5,
.elderly-mode .md-content h6 {
  font-size: 18px !important;
  line-height: 1.45 !important;
}

.elderly-mode .md-content code {
  font-size: 16px !important;
}

.elderly-mode .md-content pre {
  font-size: 15px !important;
}

.elderly-mode .md-content table {
  font-size: 16px !important;
}

/* 用户提问气泡 */
.elderly-mode .space-y-3 > .flex.justify-end [class*="rounded-2xl"],
.elderly-mode [class*="rounded-2xl"][class*="text-sm"],
.elderly-mode [class*="rounded-2xl"][class*="text-\[13px\]"] {
  font-size: 18px !important;
  line-height: 1.8 !important;
}

/* 2. 快捷提问推荐卡片 (Suggested Questions) 放大与热区扩展 */
.elderly-mode button.rounded-full,
.elderly-mode button[class*="rounded-full"] {
  font-size: 16px !important;
  line-height: 1.6 !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
}

/* 3. 底部输入框与发送按钮 */
.elderly-mode textarea {
  font-size: 18px !important;
  line-height: 1.6 !important;
  min-height: 52px !important;
}

.elderly-mode textarea::placeholder {
  font-size: 16px !important;
}

.elderly-mode button:has(.fa-paper-plane),
.elderly-mode button:has(.fa-square),
.elderly-mode .chat-send-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.elderly-mode button:has(.fa-paper-plane) .fa-paper-plane,
.elderly-mode button:has(.fa-square) .fa-square,
.elderly-mode .chat-send-btn .fa-paper-plane,
.elderly-mode .chat-send-btn .fa-square,
.elderly-mode .chat-send-btn i {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  min-height: unset !important;
  font-size: 18px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
}

/* 4. 深度思考折叠面板 */
.elderly-mode .think-panel {
  font-size: 15px !important;
}
.elderly-mode .think-toggle {
  font-size: 15px !important;
  padding: 10px 14px !important;
}
.elderly-mode .think-body {
  font-size: 15px !important;
  line-height: 1.7 !important;
}

/* 5. 消息操作工具栏 (点赞、点踩、重试、复制等) */
.elderly-mode .flex.items-center.gap-3\.5 {
  font-size: 14px !important;
  gap: 18px !important;
}
.elderly-mode .flex.items-center.gap-3\.5 button {
  font-size: 14px !important;
  padding: 4px 6px !important;
}

/* 6. 工作台顶部导航与操作按钮 */
.elderly-mode header h1 {
  font-size: 22px !important;
}
.elderly-mode header p {
  font-size: 14px !important;
}
.elderly-mode main .min-h-\[64px\] h3 {
  font-size: 18px !important;
}
.elderly-mode main .min-h-\[64px\] button {
  font-size: 14px !important;
  padding: 8px 16px !important;
}

/* 7. 首页大厅卡片与搜索框适老放大 */
.elderly-mode .hero-glow h2 {
  font-size: 36px !important;
}
.elderly-mode .hero-glow p {
  font-size: 16px !important;
  line-height: 1.8 !important;
}
.elderly-mode .hero-glow input {
  font-size: 16px !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}
.elderly-mode .hero-glow button {
  font-size: 15px !important;
  padding: 10px 20px !important;
}
.elderly-mode .glass-card h3 {
  font-size: 18px !important;
}
.elderly-mode .glass-card p {
  font-size: 15px !important;
  line-height: 1.7 !important;
}

/* 8. 侧边栏历史记录列表 */
.elderly-mode aside .text-sm {
  font-size: 16px !important;
}
.elderly-mode aside input {
  font-size: 15px !important;
}

