:root {
  --aichat-primary: #27AE60;
  --aichat-primary-hover: #219653;
  --aichat-bg: #F2F5F3;
  --aichat-soft: #F4FAF7;
  --aichat-border: #E8F5EE;
  --aichat-text: #222222;
  --aichat-muted: #666666;
  --aichat-danger: #E53935;
  --aichat-safe-bottom: env(safe-area-inset-bottom, 0px);
  --aichat-viewport-height: 100%;
}

html, body.aichat-body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--aichat-bg);
  color: var(--aichat-text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#aichat-app { width: 100%; height: 100%; }
.aichat-root { width: 100%; height: 100%; }
.aichat-overlay { position: relative; z-index: 50; }

.aichat-scroll { scrollbar-width: thin; }
.aichat-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.aichat-scroll::-webkit-scrollbar-thumb { background: #DCEBE2; border-radius: 999px; }

.aichat-mobile-frame {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #FFFFFF;
}

.aichat-growing { transition: height .12s ease; }
.aichat-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--aichat-border);
  color: var(--aichat-primary);
  font-weight: 600;
}

/* 仅对话气泡正文保留放大字号 */
.aichat-body [data-chat-list] [class*="text-[14.5px]"] { font-size: 19px !important; line-height: 1.75 !important; }
.aichat-body-mobile [data-chat-list] [class*="text-[14.5px]"] { font-size: 17px !important; line-height: 1.75 !important; }

/* 左侧会话区：浅绿主色 + 柔和波浪色块，不使用网格线/圆点 */
.aichat-sidebar-surface {
  background-color: #EEF7F1;
  background-image:
    linear-gradient(168deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0) 48%),
    radial-gradient(ellipse 120% 62% at 50% 112%, rgba(39,174,96,0.10), transparent 72%),
    radial-gradient(ellipse 100% 52% at 96% 6%, rgba(246,222,188,0.18), transparent 74%),
    radial-gradient(ellipse 90% 48% at 2% 48%, rgba(255,255,255,0.48), transparent 76%);
  background-size: 100% 100%;
}

.aichat-body-mobile .aichat-sidebar-surface {
  background-size: 180% 180%;
  animation: aichat-wave 14s ease-in-out infinite;
}

@keyframes aichat-wave {
  0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0; }
  50% { background-position: 2% 1%, -2% 1%, 2% -1%, -1% 2%; }
}

/* 移动端适配底部安全区与动态视口高度 */
.aichat-body-mobile .aichat-mobile-frame {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  height: var(--aichat-viewport-height, 100dvh);
  transform: translateY(var(--aichat-viewport-offset-top, 0px));
}

.aichat-body-mobile .aichat-input-area {
  padding-bottom: calc(12px + var(--aichat-safe-bottom, env(safe-area-inset-bottom, 0px)));
}

/* 键盘弹出时安全区已被键盘覆盖，临时去掉安全区 padding */
.aichat-body-mobile.aichat-keyboard-open .aichat-input-area {
  padding-bottom: 12px;
}

/* 移动端左侧抽屉底部用户信息避开安全区 */
.aichat-body-mobile .aichat-sidebar-footer {
  padding-bottom: calc(12px + var(--aichat-safe-bottom, env(safe-area-inset-bottom, 0px)));
}


