/* ========================================
   Z-INDEX 层级结构说明
   ========================================
   0-9:   基础背景层 (最低层)
   10-19: 内容层
   20-29: 功能层
   30-39: 交互层
   40-49: 弹窗层
   50+:   最高层 (模态框、提示等)
   ======================================== */

/* ========================================
   主题样式
   ======================================== */

/* 深色主题 */

@import "./styles/logo.css";
@import "./styles/filePreview.css";

.theme-dark {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --border-color: #404040;
  --accent-color: #10a37f;
}

body.theme-dark {
  background: #1a1a1a;
  /* 深灰色背景，更接近图片风格 */
  color: #e4e7eb;
}

body.theme-dark .container {
  background: #1a1a1a;
}

body.theme-dark .main-content,
body.theme-dark .chat-area {
  background: #1a1a1a;
  /* 统一深灰色背景 */
}

body.theme-dark .sidebar {
  background: #2d2d2d;
  /* 侧边栏深灰色背景，与主背景有层次感 */
  border-right-color: #404040;
  /* 边框颜色 */
}

body.theme-dark .welcome-section {
  background: transparent;
  border: none;
  box-shadow: none;
}

body.theme-dark .welcome-title,
body.theme-dark .welcome-subtitle {
  color: #ffffff !important;
}

body.theme-dark .input-wrapper {
  background: #2d2d2d;
  border: 1px solid #404040;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  color: #ffffff;
}

body.theme-dark .message-input {
  color: #ffffff;
}

body.theme-dark .message-input::placeholder {
  color: #999999;
}

body.theme-dark .suggested-card {
  background: #2d2d2d;
  border: 1px solid #404040;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

/* 深色模式 - 建议卡片文本 */
body.theme-dark .suggested-card p,
.theme-dark .suggested-card p {
  color: #ffffff !important;
}

body.theme-dark .prompt-btn {
  background: #404040;
  border: 1px solid #555555;
  color: #ffffff;
}

body.theme-dark .chat-view .input-container,
body.theme-dark .input-container {
  background: transparent;
}

.theme-dark .main-content {
  background: var(--bg-primary);
}

.theme-dark .chat-area {
  background: var(--bg-primary);
}

.theme-dark .input-wrapper {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.theme-dark .message-input {
  background: transparent;
  color: var(--text-primary);
}

.theme-dark .message-input::placeholder {
  color: var(--text-secondary);
}

.theme-dark .suggested-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.theme-dark .suggested-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-dark .welcome-title {
  color: #ffffff !important;
}

.theme-dark .welcome-subtitle {
  color: #ffffff !important;
}

/* ========================================
   深色模式完整样式优化
   ======================================== */

/* 深色模式 - 消息容器 */
body.theme-dark .messages-container,
.theme-dark .messages-container {
  background: #1a1a1a;
}

/* 深色模式 - 消息内容 */
body.theme-dark .message-content,
.theme-dark .message-content {
  color: #ffffff;
}

body.theme-dark .user-message .message-content,
.theme-dark .user-message .message-content {
  color: #ffffff;
}

/* 深色模式 - 用户消息悬停效果 */
body.theme-dark .user-message:hover .message-content,
.theme-dark .user-message:hover .message-content {
  background: rgba(135, 206, 235, 0.15);
  box-shadow: 0 2px 12px rgba(135, 206, 235, 0.2);
  color: #ffffff;
}

body.theme-dark .assistant-message .message-content,
.theme-dark .assistant-message .message-content {
  color: #ffffff;
}

/* 深色模式 - 助手消息悬停效果 */
body.theme-dark .assistant-message:hover .message-content,
.theme-dark .assistant-message:hover .message-content {
  background: rgba(135, 206, 235, 0.12);
  box-shadow: 0 2px 12px rgba(135, 206, 235, 0.2);
  color: #ffffff;
}

/* 深色模式 - 消息内容中的所有文字元素设为白色 */
body.theme-dark .message-content,
body.theme-dark .message-content *,
.theme-dark .message-content,
.theme-dark .message-content * {
  color: #ffffff !important;
}

/* 深色模式 - 标题文字 */
body.theme-dark .message-content h1,
body.theme-dark .message-content h2,
body.theme-dark .message-content h3,
body.theme-dark .message-content h4,
body.theme-dark .message-content h5,
body.theme-dark .message-content h6,
.theme-dark .message-content h1,
.theme-dark .message-content h2,
.theme-dark .message-content h3,
.theme-dark .message-content h4,
.theme-dark .message-content h5,
.theme-dark .message-content h6 {
  color: #ffffff !important;
}

/* 深色模式 - 黑体/强调文字 */
body.theme-dark .message-content strong,
body.theme-dark .message-content b,
.theme-dark .message-content strong,
.theme-dark .message-content b {
  color: #ffffff !important;
  font-weight: 600;
}

/* 深色模式 - 斜体文字 */
body.theme-dark .message-content em,
body.theme-dark .message-content i,
.theme-dark .message-content em,
.theme-dark .message-content i {
  color: #ffffff !important;
}

/* 深色模式 - 段落文字 */
body.theme-dark .message-content p,
.theme-dark .message-content p {
  color: #ffffff !important;
}

/* 深色模式 - 列表文字 */
body.theme-dark .message-content li,
body.theme-dark .message-content ul,
body.theme-dark .message-content ol,
.theme-dark .message-content li,
.theme-dark .message-content ul,
.theme-dark .message-content ol {
  color: #ffffff !important;
}

/* 深色模式 - 表格文字 */
body.theme-dark .message-content th,
body.theme-dark .message-content td,
.theme-dark .message-content th,
.theme-dark .message-content td {
  color: #ffffff !important;
}

/* 深色模式 - 引用块文字 */
body.theme-dark .message-content blockquote,
body.theme-dark .message-content blockquote p,
.theme-dark .message-content blockquote,
.theme-dark .message-content blockquote p {
  color: #ffffff !important;
}

/* 深色模式 - 删除线文字 */
body.theme-dark .message-content del,
body.theme-dark .message-content s,
.theme-dark .message-content del,
.theme-dark .message-content s {
  color: #ffffff !important;
}

/* 深色模式 - 链接文字（保持链接的特殊颜色） */
body.theme-dark .message-content a,
.theme-dark .message-content a {
  color: #87ceeb !important;
}

body.theme-dark .message-content a:hover,
.theme-dark .message-content a:hover {
  color: #a8d8f0 !important;
}

/* 深色模式 - 代码块文字 */
body.theme-dark .message-content code:not(pre code),
.theme-dark .message-content code:not(pre code) {
  color: #87ceeb !important;
}

body.theme-dark .message-content pre code,
.theme-dark .message-content pre code {
  color: #ffffff !important;
}

/* 深色模式 - 侧边栏内容 */
body.theme-dark .sidebar-content,
.theme-dark .sidebar-content {
  background: transparent;
}

body.theme-dark .search-section,
.theme-dark .search-section {
  border-bottom-color: #404040;
}

body.theme-dark .search-input,
.theme-dark .search-input {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .search-input:focus,
.theme-dark .search-input:focus {
  background: #404040;
  border-color: #87ceeb;
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.2);
}

body.theme-dark .search-input::placeholder,
.theme-dark .search-input::placeholder {
  color: #999999;
}

body.theme-dark .search-icon,
.theme-dark .search-icon {
  color: #999999;
}

/* 深色模式 - 区域标题 */
body.theme-dark .section-title,
.theme-dark .section-title {
  color: #cccccc;
}

body.theme-dark .section-title i,
.theme-dark .section-title i {
  color: #87ceeb;
}

/* 深色模式 - 工作区项 */
body.theme-dark .workspace-item,
.theme-dark .workspace-item {
  color: #cccccc;
}

body.theme-dark .workspace-item:hover,
.theme-dark .workspace-item:hover {
  background: #404040;
  color: #87ceeb;
}

body.theme-dark .workspace-item i,
.theme-dark .workspace-item i {
  color: #87ceeb;
}

/* 深色模式 - 聊天历史 */
body.theme-dark .chat-history-item,
.theme-dark .chat-history-item {
  color: #cccccc;
}

body.theme-dark .chat-history-item:hover,
.theme-dark .chat-history-item:hover {
  background: #404040;
  color: #ffffff;
}

body.theme-dark .chat-history-item.active,
.theme-dark .chat-history-item.active {
  background: #404040;
  color: #87ceeb;
}

body.theme-dark .chat-history-item i,
.theme-dark .chat-history-item i {
  color: #87ceeb;
}

body.theme-dark .chat-history-title,
.theme-dark .chat-history-title {
  color: inherit;
}

body.theme-dark .chat-history-time,
.theme-dark .chat-history-time {
  color: #999999;
}

body.theme-dark .chat-history-action-btn,
.theme-dark .chat-history-action-btn {
  color: #999999;
}

body.theme-dark .chat-history-action-btn:hover,
.theme-dark .chat-history-action-btn:hover {
  background: #404040;
  color: #ffffff;
}

body.theme-dark .clear-history-btn,
.theme-dark .clear-history-btn {
  color: #999999;
}

body.theme-dark .clear-history-btn:hover,
.theme-dark .clear-history-btn:hover {
  background: #3a1f1f;
  color: #f87171;
}

body.theme-dark .refresh-chat-history-btn,
.theme-dark .refresh-chat-history-btn {
  color: #999999;
}

body.theme-dark .refresh-chat-history-btn:hover:not(:disabled),
.theme-dark .refresh-chat-history-btn:hover:not(:disabled) {
  background: rgba(61, 212, 168, 0.12);
  color: #3dd4a8;
}

/* 深色模式 - 模型选择器 */
body.theme-dark .setting-label,
.theme-dark .setting-label {
  color: #cccccc;
}

body.theme-dark .model-select,
.theme-dark .model-select {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .model-select:focus,
.theme-dark .model-select:focus {
  border-color: #87ceeb;
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.2);
}

body.theme-dark .model-select:hover,
.theme-dark .model-select:hover {
  border-color: #555555;
}

/* 深色模式 - 用户资料 */
body.theme-dark .user-profile,
.theme-dark .user-profile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.theme-dark .user-profile:hover,
.theme-dark .user-profile:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(61, 212, 168, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body.theme-dark .user-name,
.theme-dark .user-name {
  color: #f1f5f9;
}

body.theme-dark .user-status,
.theme-dark .user-status {
  color: #cccccc;
}

body.theme-dark .settings-btn,
.theme-dark .settings-btn {
  color: #cccccc;
}

body.theme-dark .settings-btn:hover,
.theme-dark .settings-btn:hover {
  background: #404040;
  color: #ffffff;
}

/* 深色模式 - 用户下拉菜单 */
body.theme-dark .user-dropdown,
.theme-dark .user-dropdown {
  background: #2d3238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.45);
}

body.theme-dark .user-dropdown-header,
.theme-dark .user-dropdown-header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 100%
  );
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .user-dropdown-name,
.theme-dark .user-dropdown-name {
  color: #f1f5f9;
}

body.theme-dark .user-dropdown-plan,
.theme-dark .user-dropdown-plan {
  color: #94a3b8;
}

body.theme-dark .user-dropdown-submenu,
.theme-dark .user-dropdown-submenu {
  background: #2d3238;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.45);
}

body.theme-dark .language-option:hover,
.theme-dark .language-option:hover {
  background-color: rgba(61, 212, 168, 0.12);
}

body.theme-dark .language-option-title,
.theme-dark .language-option-title {
  color: #f1f5f9;
}

body.theme-dark .language-option-subtitle,
.theme-dark .language-option-subtitle {
  color: #94a3b8;
}

body.theme-dark .user-dropdown-divider,
.theme-dark .user-dropdown-divider {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12) 15%,
    rgba(255, 255, 255, 0.12) 85%,
    transparent
  );
}

body.theme-dark .user-dropdown-item,
.theme-dark .user-dropdown-item {
  color: #e2e8f0;
}

body.theme-dark .user-dropdown-item:hover,
.theme-dark .user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.theme-dark .user-dropdown-item i,
.theme-dark .user-dropdown-item i {
  color: #94a3b8;
}

body.theme-dark .user-dropdown-item:hover i,
.theme-dark .user-dropdown-item:hover i {
  color: #3dd4a8;
}

/* 深色模式 - 思考过程 */
body.theme-dark .assistant-message .message-content details.thinking-process,
.theme-dark .assistant-message .message-content details.thinking-process {
  background: rgba(135, 206, 235, 0.08);
  border: 1px solid rgba(135, 206, 235, 0.25);
  border-radius: 8px;
}

body.theme-dark
  .assistant-message
  .message-content
  details.thinking-process:hover,
.theme-dark .assistant-message .message-content details.thinking-process:hover {
  background: rgba(135, 206, 235, 0.12);
  border-color: rgba(135, 206, 235, 0.35);
}

body.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  summary,
.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  summary {
  color: #87ceeb;
}

body.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  summary:hover,
.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  summary:hover {
  background: rgba(135, 206, 235, 0.15);
}

body.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  > *:not(summary),
.theme-dark
  .assistant-message
  .message-content
  details.thinking-process
  > *:not(summary) {
  color: #b0b8c4;
}

/* 深色模式 - 消息操作按钮 */
body.theme-dark .message-action-btn,
.theme-dark .message-action-btn {
  color: #6b7280;
}

body.theme-dark .message-action-btn:hover,
.theme-dark .message-action-btn:hover {
  background: #252d3a;
  color: #e4e7eb;
}

/* 深色模式 - 聊天视图 */
body.theme-dark .chat-view .main-content,
body.theme-dark .chat-view .chat-area,
body.theme-dark .chat-view .messages-container,
.theme-dark .chat-view .main-content,
.theme-dark .chat-view .chat-area,
.theme-dark .chat-view .messages-container {
  background: #1a1a1a;
}

/* 深色模式 - 顶部栏 */
body.theme-dark .chat-top-bar,
.theme-dark .chat-top-bar {
  background: transparent;
  border-bottom: 1px solid #404040;
}

/* 深色模式 - 参数控制 */
body.theme-dark .param-section,
.theme-dark .param-section {
  background: transparent;
  border-top: 1px solid #404040;
}

body.theme-dark .floating-param-label,
.theme-dark .floating-param-label {
  color: #cccccc;
}

body.theme-dark .floating-param-input,
.theme-dark .floating-param-input {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .floating-param-input:focus,
.theme-dark .floating-param-input:focus {
  border-color: #87ceeb;
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.2);
}

body.theme-dark .param-btn,
.theme-dark .param-btn {
  color: #cccccc;
}

body.theme-dark .param-btn:hover,
.theme-dark .param-btn:hover {
  background: #404040;
  color: #87ceeb;
}

/* 深色模式 - 新聊天按钮 */
body.theme-dark .new-chat-button,
.theme-dark .new-chat-button {
  --new-chat-bg1: #15c896;
  --new-chat-bg2: #0fb07d;
  --new-chat-bg3: #0a8f63;
  --new-chat-glow: rgba(15, 176, 125, 0.38);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 8px 24px var(--new-chat-glow);
}

body.theme-dark .new-chat-button:hover,
.theme-dark .new-chat-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(15, 176, 125, 0.45);
}

body.theme-dark .new-chat-button:focus-visible,
.theme-dark .new-chat-button:focus-visible {
  outline-color: #3dd4a8;
}

/* 深色模式 - 升级按钮 */
body.theme-dark .upgrade-btn,
.theme-dark .upgrade-btn {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .upgrade-btn:hover,
.theme-dark .upgrade-btn:hover {
  background: #404040;
  border-color: #87ceeb;
  color: #87ceeb;
}

/* 深色模式 - 发送和附件按钮 */
body.theme-dark .send-btn,
.theme-dark .send-btn {
  background: #10a37f;
  color: white;
}

body.theme-dark .send-btn:hover,
.theme-dark .send-btn:hover {
  background: #0d8a6b;
}

body.theme-dark .send-btn:disabled,
.theme-dark .send-btn:disabled {
  background: #2a3441;
  color: #6b7280;
  cursor: not-allowed;
}

body.theme-dark .attach-btn,
.theme-dark .attach-btn {
  color: #cccccc;
}

/* 隐藏+号附件按钮 */
.attach-btn {
  display: none !important;
}

body.theme-dark .attach-btn:hover,
.theme-dark .attach-btn:hover {
  background: #404040;
  color: #ffffff;
}

/* 深色模式 - 更多选项菜单 */
body.theme-dark .more-options-menu,
.theme-dark .more-options-menu {
  background: #2d2d2d;
  border-color: #404040;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.theme-dark .more-options-item,
.theme-dark .more-options-item {
  color: #ffffff;
}

body.theme-dark .more-options-item:hover,
.theme-dark .more-options-item:hover {
  background: #404040;
}

body.theme-dark .more-options-item.danger,
.theme-dark .more-options-item.danger {
  color: #f87171;
}

body.theme-dark .more-options-item.danger:hover,
.theme-dark .more-options-item.danger:hover {
  background: #3a1f1f;
  color: #fca5a5;
}

/* 深色模式 - 用户下拉菜单项 */
body.theme-dark .user-dropdown-email,
.theme-dark .user-dropdown-email {
  color: #94a3b8;
}

body.theme-dark .user-dropdown-profile,
.theme-dark .user-dropdown-profile {
  color: #f1f5f9;
}

body.theme-dark .user-dropdown-check,
.theme-dark .user-dropdown-check {
  color: #3dd4a8;
  background: rgba(61, 212, 168, 0.15);
}

body.theme-dark .user-avatar,
.theme-dark .user-avatar {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 0 1px rgba(61, 212, 168, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.35);
}

body.theme-dark .user-avatar:hover,
.theme-dark .user-avatar:hover {
  box-shadow:
    0 0 0 1px rgba(61, 212, 168, 0.55),
    0 4px 16px rgba(61, 212, 168, 0.2);
}

/* 深色模式 - 思考指示器 */
body.theme-dark .thinking-indicator,
.theme-dark .thinking-indicator {
  color: #cccccc;
}

body.theme-dark .thinking-dot,
.theme-dark .thinking-dot {
  background: #87ceeb;
}

/* 深色模式 - 代码块 */
body.theme-dark .message-content pre,
.theme-dark .message-content pre {
  background: #2d2d2d;
  border: 1px solid #404040;
}

body.theme-dark .message-content code,
.theme-dark .message-content code {
  background: rgba(135, 206, 235, 0.15);
  color: #87ceeb;
}

body.theme-dark .message-content pre code,
.theme-dark .message-content pre code {
  background: transparent;
  color: #ffffff;
}

/* 深色模式 - 链接（已在上面统一定义，这里保留作为备用） */

/* 深色模式 - 引用块 */
body.theme-dark .message-content blockquote,
.theme-dark .message-content blockquote {
  border-left-color: #87ceeb;
  background: rgba(135, 206, 235, 0.1);
  color: #ffffff;
}

/* 深色模式 - 表格 */
body.theme-dark .message-content table,
.theme-dark .message-content table {
  border-color: #404040;
}

body.theme-dark .message-content th,
.theme-dark .message-content th {
  background: #2d2d2d;
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .message-content td,
.theme-dark .message-content td {
  border-color: #404040;
  color: #ffffff;
}

body.theme-dark .message-content tr:nth-child(even),
.theme-dark .message-content tr:nth-child(even) {
  background: rgba(135, 206, 235, 0.05);
}

/* 深色模式 - 水平线 */
body.theme-dark .message-content hr,
.theme-dark .message-content hr {
  border-color: #404040;
}

/* 深色模式 - 滚动条 */
body.theme-dark .messages-container::-webkit-scrollbar-thumb,
.theme-dark .messages-container::-webkit-scrollbar-thumb {
  background: rgba(135, 206, 235, 0.3);
}

body.theme-dark .messages-container:hover::-webkit-scrollbar-thumb,
.theme-dark .messages-container:hover::-webkit-scrollbar-thumb {
  background: rgba(135, 206, 235, 0.5);
}

body.theme-dark .sidebar-content::-webkit-scrollbar-thumb,
.theme-dark .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(135, 206, 235, 0.3);
}

body.theme-dark .sidebar-content:hover::-webkit-scrollbar-thumb,
.theme-dark .sidebar-content:hover::-webkit-scrollbar-thumb {
  background: rgba(135, 206, 235, 0.5);
}

/* 自动主题 - 跟随系统 */
@media (prefers-color-scheme: dark) {
  .theme-auto {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e4e7eb;
    --text-secondary: #9ca3af;
    --border-color: #2a3441;
    --accent-color: #87ceeb;
  }

  .theme-auto body {
    background: #0f1419;
    color: #e4e7eb;
  }

  .theme-auto .container {
    background: #0f1419;
  }

  .theme-auto .sidebar {
    background: #1a1f2e;
    border-right-color: #2a3441;
  }

  .theme-auto .new-chat-button {
    --new-chat-bg1: #15c896;
    --new-chat-bg2: #0fb07d;
    --new-chat-bg3: #0a8f63;
    --new-chat-glow: rgba(15, 176, 125, 0.38);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 1px 2px rgba(0, 0, 0, 0.35),
      0 8px 24px var(--new-chat-glow);
  }

  .theme-auto .new-chat-button:hover {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 2px 4px rgba(0, 0, 0, 0.4),
      0 12px 32px rgba(15, 176, 125, 0.45);
  }

  .theme-auto .new-chat-button:focus-visible {
    outline-color: #3dd4a8;
  }

  .theme-auto .user-profile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  .theme-auto .user-profile:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(61, 212, 168, 0.28);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }

  .theme-auto .user-name {
    color: #f1f5f9;
  }

  .theme-auto .user-dropdown {
    background: #2d3238;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.25),
      0 16px 40px rgba(0, 0, 0, 0.45);
  }

  .theme-auto .user-dropdown-header {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 100%
    );
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .theme-auto .user-dropdown-email {
    color: #94a3b8;
  }

  .theme-auto .user-dropdown-name {
    color: #f1f5f9;
  }

  .theme-auto .user-dropdown-plan {
    color: #94a3b8;
  }

  .theme-auto .user-dropdown-check {
    color: #3dd4a8;
    background: rgba(61, 212, 168, 0.15);
  }

  .theme-auto .user-dropdown-submenu {
    background: #2d3238;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .theme-auto .language-option:hover {
    background-color: rgba(61, 212, 168, 0.12);
  }

  .theme-auto .language-option-title {
    color: #f1f5f9;
  }

  .theme-auto .language-option-subtitle {
    color: #94a3b8;
  }

  .theme-auto .user-dropdown-divider {
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.12) 15%,
      rgba(255, 255, 255, 0.12) 85%,
      transparent
    );
  }

  .theme-auto .user-dropdown-item {
    color: #e2e8f0;
  }

  .theme-auto .user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .theme-auto .user-dropdown-item i {
    color: #94a3b8;
  }

  .theme-auto .user-dropdown-item:hover i {
    color: #3dd4a8;
  }

  .theme-auto .user-avatar {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow:
      0 0 0 1px rgba(61, 212, 168, 0.35),
      0 2px 10px rgba(0, 0, 0, 0.35);
  }

  .theme-auto .main-content,
  .theme-auto .chat-area {
    background: #0f1419;
  }

  .theme-auto .input-wrapper {
    background: #1c222d;
    border-color: #27313d;
    color: #f4f6fb;
  }

  .theme-auto .message-input {
    background: transparent;
    color: #f4f6fb;
  }

  .theme-auto .message-input::placeholder {
    color: #a1aec4;
  }

  .theme-auto .suggested-card {
    background: #181d26;
    border-color: #242d38;
    color: #f4f6fb;
  }

  .theme-auto .suggested-card:hover {
    background: #1e2532;
    border-color: #2a3441;
  }

  /* 自动主题深色模式 - 建议卡片文本 */
  .theme-auto .suggested-card p {
    color: #ffffff !important;
    /* 白色文字 */
  }

  .theme-auto .welcome-title,
  .theme-auto .welcome-subtitle {
    color: #ffffff !important;
  }

  /* 自动主题深色模式下所有语言模式的标题和副标题都设为白色 */
  .theme-auto [data-lang="tibetan"] .welcome-title,
  .theme-auto .tibetan-mode .welcome-title,
  .theme-auto [data-lang="tibetan"] .welcome-subtitle,
  .theme-auto .tibetan-mode .welcome-subtitle,
  .theme-auto [data-lang="chinese"] .welcome-title,
  .theme-auto .chinese-mode .welcome-title,
  .theme-auto [data-lang="chinese"] .welcome-subtitle,
  .theme-auto .chinese-mode .welcome-subtitle,
  .theme-auto [data-lang="english"] .welcome-title,
  .theme-auto .english-mode .welcome-title,
  .theme-auto [data-lang="english"] .welcome-subtitle,
  .theme-auto .english-mode .welcome-subtitle {
    color: #ffffff !important;
  }

  /* 自动主题深色模式下模型名设为白色 */
  .theme-auto .model-name {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 应用所有深色模式样式 */
  .theme-auto .messages-container {
    background: #0f1419;
  }

  .theme-auto .message-content {
    color: #e4e7eb;
  }

  .theme-auto .user-message .message-content,
  .theme-auto .assistant-message .message-content {
    color: #e4e7eb;
  }

  /* 自动主题深色模式 - 用户消息悬停效果 */
  .theme-auto .user-message:hover .message-content {
    background: rgba(135, 206, 235, 0.15);
    /* 浅蓝色背景，清晰可见 */
    box-shadow: 0 2px 12px rgba(135, 206, 235, 0.2);
    color: #e4e7eb;
    /* 确保文字颜色清晰 */
  }

  /* 自动主题深色模式 - 助手消息悬停效果 */
  .theme-auto .assistant-message:hover .message-content {
    background: rgba(135, 206, 235, 0.12);
    /* 浅蓝色背景，清晰可见 */
    box-shadow: 0 2px 12px rgba(135, 206, 235, 0.2);
    color: #e4e7eb;
    /* 确保文字颜色清晰 */
  }

  /* 自动主题深色模式 - 消息内容中的所有文字元素设为白色 */
  .theme-auto .message-content,
  .theme-auto .message-content * {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 标题文字 */
  .theme-auto .message-content h1,
  .theme-auto .message-content h2,
  .theme-auto .message-content h3,
  .theme-auto .message-content h4,
  .theme-auto .message-content h5,
  .theme-auto .message-content h6 {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 黑体/强调文字 */
  .theme-auto .message-content strong,
  .theme-auto .message-content b {
    color: #ffffff !important;
    font-weight: 600;
  }

  /* 自动主题深色模式 - 斜体文字 */
  .theme-auto .message-content em,
  .theme-auto .message-content i {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 段落文字 */
  .theme-auto .message-content p {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 列表文字 */
  .theme-auto .message-content li,
  .theme-auto .message-content ul,
  .theme-auto .message-content ol {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 表格文字 */
  .theme-auto .message-content th,
  .theme-auto .message-content td {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 引用块文字 */
  .theme-auto .message-content blockquote,
  .theme-auto .message-content blockquote p {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 删除线文字 */
  .theme-auto .message-content del,
  .theme-auto .message-content s {
    color: #ffffff !important;
  }

  /* 自动主题深色模式 - 链接文字（保持链接的特殊颜色） */
  .theme-auto .message-content a {
    color: #87ceeb !important;
    /* 链接保持浅蓝色 */
  }

  .theme-auto .message-content a:hover {
    color: #a8d8f0 !important;
    /* 悬停时更亮的蓝色 */
  }

  /* 自动主题深色模式 - 代码块文字 */
  .theme-auto .message-content code:not(pre code) {
    color: #87ceeb !important;
    /* 代码保持浅蓝色 */
  }

  .theme-auto .message-content pre code {
    color: #ffffff !important;
    /* 代码块内文字为白色 */
  }

  .theme-auto .search-input {
    background: #1e2532;
    border-color: #2a3441;
    color: #e4e7eb;
  }

  .theme-auto .search-input:focus {
    background: #252d3a;
    border-color: #87ceeb;
  }

  .theme-auto .chat-history-item {
    color: #9ca3af;
  }

  .theme-auto .chat-history-item:hover {
    background: #252d3a;
    color: #e4e7eb;
  }

  .theme-auto .chat-history-item.active {
    background: #1e3a5f;
    color: #87ceeb;
  }

  .theme-auto .model-select {
    background: #1e2532;
    border-color: #2a3441;
    color: #e4e7eb;
  }

  .theme-auto .assistant-message .message-content details.thinking-process {
    background: rgba(135, 206, 235, 0.08);
    border-color: rgba(135, 206, 235, 0.25);
  }

  .theme-auto
    .assistant-message
    .message-content
    details.thinking-process
    summary {
    color: #87ceeb;
  }

  .theme-auto
    .assistant-message
    .message-content
    details.thinking-process
    > *:not(summary) {
    color: #b0b8c4;
  }
}

/* ========================================
   全局重置和基础样式
   ======================================== */

/* 重置所有元素的默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 藏文字体定义 */
@font-face {
  font-family: "SUNSHINE-UCHEN";
  src: url("./fonts/SUNSHINE-UCHEN.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  /* 优化字体加载 */
}

/* 阳光吾坚体字体定义（如果文件存在） */
@font-face {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  src:
    url("./fonts/阳光吾坚体.woff2") format("woff2"),
    url("./fonts/阳光吾坚体.woff") format("woff"),
    url("./fonts/阳光吾坚体.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 藏文字体样式类 */
.tibetan-text {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-weight: 500;
  line-height: 1.6;
}

html {
  height: 100%;
  overflow: hidden;
  /* 禁止整页滚动条，滚动交给主内容区内部 */
}

/* 页面主体样式 */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", sans-serif;
  background: #faf9f5;
  /*  */
  color: #333333;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
}

/* ========================================
   主容器布局
   ======================================== */

/* 主容器：使用flex布局，包含侧边栏和主内容区 */
.container {
  display: flex;
  align-items: stretch;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #faf9f5;
  /* 统一背景色 */
  backdrop-filter: none;
  /* 毛玻璃效果 */
}

/* ========================================
   左侧边栏样式
   ======================================== */

/* 侧边栏容器：固定宽度，垂直布局；撑满视口高度，避免底部露出主区深色底 */
.sidebar {
  width: 350px;
  background: #faf9f5;
  /* 统一背景色 */
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 100%;
  min-height: 100dvh;
  border-right: 1px solid #e2e6eb;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
  /* 高于底部固定输入层与免责声明，避免左下角「穿透」灰条 */
  position: relative;
  overflow: visible;
  /* 允许下拉菜单显示 */
}

/* 侧边栏收起状态 - 显示小型边侧栏 */
.sidebar.collapsed {
  width: 75px;
  min-width: 75px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏展开状态 */
.sidebar.expanded {
  width: 320px;
  min-width: 320px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏动画状态 */
.sidebar.animating {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 浮动按钮动画状态 */
.floating-sidebar-btn.animating {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  /* 降低z-index，确保侧边栏在蒙层之上 */
  display: none;
}

.sidebar-overlay.show {
  display: block;
}

/* 参数设置区域 */
.param-section {
  padding: 16px 28px;
  border-bottom: 1px solid #e8e8e8;
}

.param-section:last-child {
  border-bottom: none;
}

/* 参数标签样式 */
.floating-param-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
}

/* 参数输入框样式 */
.floating-param-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  color: #333333;
  background-color: #ffffff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.floating-param-input:focus {
  outline: none;
  border-color: #87ceeb;
  box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

.floating-param-input:hover {
  border-color: #b0c4de;
}

/* 参数输入框数值样式 */
.floating-param-input::-webkit-outer-spin-button,
.floating-param-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.floating-param-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 参数输入容器 */
.param-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* 参数调节按钮容器 */
.param-controls {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 参数调节按钮 */
.param-btn {
  width: 24px;
  height: 16px;
  border: none;
  background: #f8f9fa;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s ease;
  border-radius: 3px;
  user-select: none;
}

.param-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.param-btn:active {
  background: #dee2e6;
  transform: scale(0.95);
}

.param-btn:disabled {
  background: #f8f9fa;
  color: #ced4da;
  cursor: not-allowed;
}

/* 增加按钮 */
.param-increase {
  border-bottom: 1px solid #dee2e6;
}

/* 减少按钮 */
.param-decrease {
  border-top: 1px solid #dee2e6;
}

/* 新建聊天按钮 */
.new-chat-btn {
  width: 40px;
  height: 40px;
  background: #faf9f5;
  border: 2px solid #b0c4de;
  border-radius: 50%;
  padding: 0;
  color: #333333;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

/* 新建聊天按钮悬停效果 */
.new-chat-btn:hover {
  background: #e8f4fd;
  border-color: #4a90e2;
  color: #4a90e2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.new-chat-btn:hover .btn-logo {
  transform: scale(1.1);
  /* 悬停时稍微放大 */
}

/* 按钮图标样式 */
.btn-icon {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  /* 将图片转为白色 */
  transition: all 0.2s ease;
}

/* 新对话按钮logo样式 */
.new-chat-btn .btn-logo {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  width: 24px;
  /* 增加宽度，确保logo可见 */
  height: 24px;
  object-fit: contain;
  margin-right: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  z-index: 10;
  /* 确保在最上层 */
  position: relative;
  /* 确保z-index生效 */
}

.new-chat-btn .fallback-icon {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 24px;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.fallback-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 侧边栏头部 */
.sidebar-header {
  padding: 12px 50px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

/* 收起状态下去掉侧边栏头部的下边框 */
.sidebar.collapsed .sidebar-header {
  border-bottom: none;
}

/* 新建对话按钮 */
.new-chat-button {
  --new-chat-bg1: #14b885;
  --new-chat-bg2: #0d9f6e;
  --new-chat-bg3: #0a7d58;
  --new-chat-glow: rgba(13, 159, 110, 0.35);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 12px;
  background: linear-gradient(
    152deg,
    var(--new-chat-bg1) 0%,
    var(--new-chat-bg2) 48%,
    var(--new-chat-bg3) 100%
  );
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    filter 0.22s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(10, 90, 60, 0.08),
    0 6px 20px var(--new-chat-glow);
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1;
  max-width: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.new-chat-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 80% at 20% 0%,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 55%
  );
  pointer-events: none;
  opacity: 0.85;
}

.new-chat-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 45%,
    transparent 90%
  );
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.new-chat-button:hover::before {
  left: 120%;
}

.new-chat-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 4px rgba(10, 90, 60, 0.1),
    0 10px 28px rgba(13, 159, 110, 0.42);
  filter: brightness(1.03);
}

.new-chat-button:active {
  transform: translateY(0);
  transition-duration: 0.12s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 1px 2px rgba(10, 90, 60, 0.12),
    0 4px 14px rgba(13, 159, 110, 0.28);
  filter: brightness(0.97);
}

.new-chat-button:focus {
  outline: none;
}

.new-chat-button:focus-visible {
  outline: 2px solid #0d9f6e;
  outline-offset: 3px;
}

.new-chat-button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition:
    transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1),
    background 0.22s ease,
    box-shadow 0.22s ease;
  position: relative;
  z-index: 1;
}

.new-chat-button:hover .new-chat-button-icon {
  background: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: scale(1.06);
}

.new-chat-button:active .new-chat-button-icon {
  transform: scale(0.96);
}

.new-chat-button-icon i {
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.new-chat-button:hover .new-chat-button-icon i {
  transform: rotate(90deg) scale(1.05);
}

/* 新建对话文字 */
.new-chat-text {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}

/* 侧边栏内容区域：不整体滚动，由内部 chat-history-list 单独滚动 */
.sidebar-content {
  flex: 1;
  min-height: 0;
  padding: 10px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* 侧边栏收起时隐藏内容 */
.sidebar.collapsed .sidebar-content {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  overflow: hidden;
}

/* 侧边栏展开时显示内容 */
.sidebar.expanded .sidebar-content {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* 搜索区域 */
.search-section {
  padding: 0 20px 15px 20px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 15px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #999;
  font-size: 14px;
  z-index: 0;
  /* 最低层 */
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 35px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  background: #f8f9fa;
  color: #333;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #87ceeb;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.1);
}

.search-input::placeholder {
  color: #999;
  font-size: 13px;
}

/* 区域标题 */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.section-title i {
  font-size: 16px;
  color: #87ceeb;
}

/* 工作区区域 */
.workspace-section {
  margin-bottom: 20px;
}

.workspace-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 0 15px;
}

.workspace-item:hover {
  background: #f0f8ff;
  color: #87ceeb;
}

.workspace-item i {
  font-size: 16px;
  color: #87ceeb;
}

/* 聊天历史区域：标题固定，仅列表区域滚动 */
.chat-history-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.chat-history-section > .section-title {
  flex-shrink: 0;
}

/* 列表区域：整块可滚动，「加载更多」在列表内容之后随滚动 */
.chat-history-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-history-list-wrap .chat-history-list,
.chat-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-history-items {
  display: block;
  min-height: 0;
}

.chat-history-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 30px);
  margin: 6px 15px 10px 15px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #0d9f6e;
  background: rgba(13, 159, 110, 0.08);
  border: 1px solid rgba(13, 159, 110, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* display:flex 会盖过 [hidden] 的默认隐藏，需显式配合 JS 的 hidden 属性 */
.chat-history-load-more[hidden] {
  display: none !important;
}

.chat-history-load-more:hover:not(:disabled) {
  background: rgba(13, 159, 110, 0.14);
  border-color: rgba(13, 159, 110, 0.35);
}

.chat-history-load-more:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.theme-dark .chat-history-load-more,
.theme-dark .chat-history-load-more {
  color: #3dd4a8;
  background: rgba(61, 212, 168, 0.1);
  border-color: rgba(61, 212, 168, 0.25);
}

body.theme-dark .chat-history-load-more:hover:not(:disabled),
.theme-dark .chat-history-load-more:hover:not(:disabled) {
  background: rgba(61, 212, 168, 0.16);
  border-color: rgba(61, 212, 168, 0.4);
}

.chat-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  /* padding: 10px 20px; */
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 5px 15px 5px 15px;
  position: relative;
  font-size: 14px;
}

.chat-history-item:hover {
  background: #f0f8ff;
  color: #333;
}

.chat-history-item.active {
  background: #e6f3ff;
  color: #87ceeb;
  font-weight: 500;
}

.chat-history-item i {
  font-size: 14px;
  color: #87ceeb;
  flex-shrink: 0;
}

.chat-history-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.chat-history-time {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}

.chat-history-actions {
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-history-item:hover .chat-history-actions {
  opacity: 1;
}

.chat-history-action-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.chat-history-action-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.chat-history-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.refresh-chat-history-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.refresh-chat-history-btn:hover:not(:disabled) {
  background: #e8f5e9;
  color: #0d9f6e;
}

.refresh-chat-history-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.clear-history-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.clear-history-btn:hover {
  background: #ffebee;
  color: #f44336;
}

/* 模型设置区域（侧栏底部：位于用户上方，双列横向 + 与用户区间距 16px） */
.model-settings-section {
  margin-bottom: 20px;
}

.sidebar-footer .model-settings-section {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.sidebar-footer .model-settings-section .param-section {
  flex: 1;
  min-width: 0;
  border-bottom: none;
  padding: 0;
}

.sidebar-footer .model-settings-section .floating-param-label {
  font-size: 11px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.sidebar-footer .model-settings-section .floating-param-input {
  padding: 8px 28px 8px 10px;
  font-size: 13px;
}

.sidebar.collapsed .model-settings-section {
  display: none;
}

body.theme-dark .sidebar-footer .model-settings-section .param-section,
.theme-dark .sidebar-footer .model-settings-section .param-section {
  border-top: none;
}

.model-selector-section {
  padding: 0 20px 15px 20px;
}

.setting-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.model-select:focus {
  outline: none;
  border-color: #87ceeb;
  box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.1);
}

.model-select:hover {
  border-color: #b0c4de;
}

/* 用户资料区域（侧栏底部账号条，整块可点开菜单） */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 12px 10px 12px;
  position: relative;
  overflow: visible;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 230, 235, 0.95);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.user-profile .user-dropdown {
  cursor: default;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(13, 159, 110, 0.22);
  box-shadow:
    0 2px 8px rgba(13, 159, 110, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5b6578 0%, #4b5563 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(13, 159, 110, 0.25),
    0 2px 8px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.22s ease;
}

.user-avatar:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(13, 159, 110, 0.45),
    0 4px 14px rgba(13, 159, 110, 0.2);
}

/* 字母头像样式 */
.avatar-letter {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
  line-height: 1;
}

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #fff;
  border: 1px solid rgba(226, 230, 235, 0.98);
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  min-width: 272px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.1, 0.64, 1);
  margin-bottom: 14px;
  margin-right: -270px;
  /* 不可 hidden，否则「语言」右侧 flyout 子菜单会被裁切无法显示 */
  overflow: visible;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉头部：账号摘要 */
.user-dropdown-header {
  padding: 14px 14px 12px 14px;
  background: linear-gradient(
    180deg,
    rgba(250, 249, 245, 0.9) 0%,
    rgba(255, 255, 255, 0.5) 100%
  );
  border-bottom: 1px solid rgba(226, 230, 235, 0.85);
}

.user-dropdown-email {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 2px 0;
}

.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5b6578 0%, #4b5563 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(13, 159, 110, 0.2),
    0 2px 8px rgba(15, 23, 42, 0.1);
}

.user-dropdown-info {
  flex: 1;
  min-width: 0;
}

.user-dropdown-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-plan {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.3;
}

.user-dropdown-check {
  color: #0d9f6e;
  font-size: 15px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 159, 110, 0.1);
  border-radius: 50%;
}

/* 菜单项 */
.user-dropdown-menu {
  padding: 6px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 0 2px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 10px;
}

.user-dropdown-item:hover {
  background: rgba(13, 159, 110, 0.08);
  color: #0f172a;
}

.user-dropdown-item.has-submenu {
  position: relative;
  padding-right: 12px;
}

.submenu-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
  color: #a0aec0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.submenu-toggle:hover {
  color: #718096;
}

.user-dropdown-submenu {
  position: absolute;
  top: auto;
  left: calc(100% + 8px);
  background: #fff;
  border: 1px solid rgba(226, 230, 235, 0.98);
  border-radius: 14px;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 16px 36px rgba(15, 23, 42, 0.14);
  min-width: max-content;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s cubic-bezier(0.34, 1.1, 0.64, 1);
  z-index: 1002;
}

.user-dropdown-item.has-submenu.open .user-dropdown-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.user-dropdown-item.has-submenu.open .item-arrow {
  transform: rotate(90deg);
}

.language-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-radius: 10px;
}

.language-option:hover {
  background-color: rgba(13, 159, 110, 0.08);
}

.language-option-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.language-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}

.language-option-subtitle {
  font-size: 12px;
  color: #718096;
}

.language-option-check {
  font-size: 13px;
  color: #0d9f6e;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.language-option.active .language-option-check {
  opacity: 1;
}

@media (max-width: 768px) {
  .user-dropdown-submenu {
    position: static;
    margin-top: 6px;
    left: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border-radius: 6px;
    border: 1px solid #edf2f7;
  }

  .user-dropdown-item.has-submenu.open .user-dropdown-submenu {
    transform: none;
  }
}

.user-dropdown-item span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.user-dropdown-item i {
  font-size: 14px;
  color: #718096;
  width: 16px;
  text-align: center;
}

.user-dropdown-item .item-arrow {
  color: #a0aec0;
  font-size: 11px;
  margin-left: auto;
}

/* 分隔线 */
.user-dropdown-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(226, 230, 235, 0.95) 12%,
    rgba(226, 230, 235, 0.95) 88%,
    transparent
  );
  margin: 6px 10px;
  border: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .user-dropdown {
    min-width: 240px;
    right: -10px;
    margin-right: -270px;
    /* 调整移动端偏移量 */
  }

  .user-dropdown-header {
    padding: 14px 14px 10px 14px;
  }

  .user-dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-dropdown {
    min-width: 220px;
    right: -20px;
    margin-right: -40px;
    /* 调整小屏幕偏移量 */
  }

  .user-dropdown-header {
    padding: 12px 12px 8px 12px;
  }

  .user-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
  }
}

.avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-status {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.settings-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.settings-btn:hover {
  background: #e9ecef;
  color: #333;
}

/* 升级按钮 */
.upgrade-btn {
  width: calc(100% - 40px);
  margin: 0 20px 15px 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
  border: none;
  color: #333;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.upgrade-btn i {
  font-size: 16px;
}

/* 工作区和搜索区域 */
.workspace-section,
.search-section {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  padding: 0 30px;
  margin-bottom: 20px;
}

/* 工作区项目和搜索项目 */
.workspace-item,
.search-item {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #b0b0b0;
  cursor: pointer;
  transition: background-color 0.2s;
  /* 背景色过渡动画 */
}

/* 工作区项目和搜索项目悬停效果 */
.workspace-item:hover,
.search-item:hover {
  background: #87ceeb;
  color: #333333;
}

.workspace-item:hover .btn-icon,
.search-item:hover .btn-icon {
  filter: brightness(0) invert(1);
  /* 悬停时保持白色 */
  transform: scale(1.1);
  /* 悬停时稍微放大 */
}

/* 侧边栏底部区域 */
.sidebar-footer {
  padding: 20px 28px;
  border-top: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  flex-shrink: 0;
}

/* 侧边栏收起时显示简化底部 */
.sidebar.collapsed .sidebar-footer {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  padding: 15px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 收起状态下隐藏文字内容 */
.sidebar.collapsed .user-info,
.sidebar.collapsed .settings-btn span {
  display: none;
}

/* 收起状态下只显示头像和设置图标 */
.sidebar.collapsed .user-profile {
  flex-direction: column;
  gap: 8px;
  margin: 0 8px 8px 8px;
  padding: 10px 8px;
}

.sidebar.collapsed .user-avatar {
  width: 36px;
  height: 36px;
}

.sidebar.collapsed .settings-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 侧边栏展开时显示底部 */
.sidebar.expanded .sidebar-footer {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ========================================
   主内容区域样式
   ======================================== */

/* 主内容区域：占据剩余空间，垂直布局；不增高整页，由子级 .chat-area 内部滚动 */
.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #faf9f5;
  /* 统一背景色 */
  position: relative;
  padding-top: 0;
  /* 去掉顶部内边距，让内容从顶部开始 */
  z-index: 0;
  /* 最低层 - 基础背景层 */
  margin-top: 0;
  /* 移除顶部边距 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0;
}

/* 当侧边栏收起时，主内容区域调整边距 */
.sidebar.collapsed ~ .main-content {
  margin-left: 0;
}

/* 当侧边栏展开时，主内容区域正常边距 */
.sidebar.expanded ~ .main-content {
  margin-left: 0;
}

/* ========================================
   顶部栏样式 - 已删除
   ======================================== */

/* 可拖拽的侧边栏切换按钮容器 */
.draggable-sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  cursor: move;
  user-select: none;
  transition: all 0.3s ease;
}

.draggable-sidebar-toggle:hover {
  transform: scale(1.05);
}

.draggable-sidebar-toggle.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  z-index: 1001;
}

/* 侧边栏切换按钮样式已移除 - 使用浮动logo按钮 */

/* 模型选择器 - 功能栏设计 */
.model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  /* 确保按钮可以点击 */
}

/* 模型名称 */
.model-name {
  font-family: "Times New Roman";
  font-size: 30px;
  font-weight: 600;
  color: #000000;
  margin-top: 10px;
}

/* 深色模式下模型名设为白色 */
body.theme-dark .model-name,
.theme-dark .model-name {
  color: #ffffff !important;
}

/* 下拉箭头和加号图标 */
.fa-chevron-down {
  color: #b0b0b0;
  font-size: 12px;
  cursor: pointer;
}

/* 设为默认文本 */
.set-default {
  font-size: 12px;
  color: #b0b0b0;
  margin-left: 8px;
}

/* 语言切换按钮容器 - 功能栏设计 */
.language-toggle {
  display: flex;
  align-items: center;
  position: relative;
  pointer-events: auto;
  /* 确保可以接收鼠标事件 */
}

/* 语言切换按钮 */
.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #333333;
  padding: 10px 16px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10005;
  /* 提高z-index，确保按钮可点击 */
  pointer-events: auto;
  min-width: 120px;
  justify-content: space-between;
}

/* 语言切换按钮悬停效果 */
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 语言切换按钮激活状态 */
.lang-btn.active {
  background: #10a37f;
  border-color: #10a37f;
  color: #333333;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* 语言切换按钮激活状态悬停 */
.lang-btn.active:hover {
  background: #0d8a6b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 163, 127, 0.4);
}

/* 语言图标容器 */
.lang-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

/* 语言图标 */
.lang-icon i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

/* 语言内容容器 */
.lang-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: space-between;
}

/* 语言切换按钮文字 */
.lang-text {
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

/* 语言箭头 */
.lang-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.lang-arrow i {
  font-size: 12px;
  transition: transform 0.3s ease;
}

/* 下拉菜单打开时箭头旋转 */
.lang-btn.active .lang-arrow i {
  transform: rotate(180deg);
}

/* 语言选择下拉菜单 */
.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(45, 45, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  z-index: 10010;
  /* 提高z-index，确保在所有元素之上 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* 下拉菜单显示状态 */
.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 语言选项 */
.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  color: #10a37f;
}

/* 语言选项悬停效果 */
.lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

/* 语言选项激活状态 */
.lang-option.active {
  background: rgba(16, 163, 127, 0.2);
  color: #10a37f;
}

/* 语言选项激活状态悬停 */
.lang-option.active:hover {
  background: rgba(16, 163, 127, 0.3);
}

/* 语言旗帜 */
.lang-flag {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* 语言名称 */
.lang-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

/* 语言英文名称 */
.lang-name-en {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* 语言选项选中指示器 */
.lang-option.active::after {
  content: "✓";
  position: absolute;
  right: 16px;
  color: #10a37f;
  font-weight: bold;
  font-size: 14px;
}

/* 响应式设计 - 移动端语言切换 */
@media (max-width: 768px) {
  .lang-btn {
    padding: 8px 12px;
    min-width: 100px;
  }

  .lang-text {
    font-size: 13px;
  }

  .lang-dropdown {
    min-width: 180px;
    right: -10px;
  }

  .lang-option {
    padding: 10px 12px;
  }

  .lang-name {
    font-size: 13px;
  }

  .lang-name-en {
    font-size: 11px;
  }
}

/* 语言切换动画 */
@keyframes langSwitch {
  0% {
    opacity: 0.7;
    transform: scale(0.95);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 语言切换时的动画效果 */
.lang-switching {
  animation: langSwitch 0.3s ease-out;
}

/* 成功提示横幅 */
.success-banner {
  background: #10a37f;
  /* 绿色背景 */
  color: #374151;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* 成功文本样式 */
.success-text {
  font-weight: 700;
}

/* 横幅消息样式 */
.banner-message {
  font-weight: 400;
}

/* ========================================
   聊天区域样式
   ======================================== */

/* 功能栏 - 包含语言切换、模型名、logo等 */
.chat-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: transparent;
  /* 透明背景，融入浅蓝色区域 */
  position: absolute;
  /* 绝对定位，相对于chat-area */
  pointer-events: none;
  /* 让功能栏不阻挡鼠标事件 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  /* 适中的层级，不覆盖聊天内容 */
  width: 100%;
  height: 60px;
  /* 设置固定高度 */
  pointer-events: auto;
  /* 允许接收鼠标事件 */
  background: #faf9f5;
  z-index: 100;
}

/* 聊天顶部功能栏左侧区域 */
.chat-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  /* 确保可点击 */
}

/* 聊天顶部功能栏右侧区域 */
.chat-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  /* 确保可点击 */
}

/* 聊天区域：欢迎页在此区域内滚动；聊天页由 .messages-container 滚动 */
.chat-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #faf9f5;
  /* 统一背景色 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  /* 移除内边距，让消息容器自己控制 */
  position: relative;
  /* 确保z-index生效 */
  z-index: 1;
  /* 基础背景层 */
  margin-top: 0;
  /* 移除顶部边距，让子元素自己控制位置 */
}

/* 欢迎区域 */
.welcome-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  background: #faf9f5;
  /* 统一背景色 */
  padding: 40px 20px 120px 20px;
  /* 增加底部内边距，为固定元素留出空间 */
  border-radius: 16px;
  /* 圆角设计 */
  box-shadow: none;
  /* 移除阴影效果 */
  backdrop-filter: none;
  /* 移除毛玻璃效果 */
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 60px;
  /* 为功能栏留出空间，让欢迎区域从功能栏下方开始 */
  padding-top: 40px;
  /* 恢复正常顶部内边距 */
}

/* Logo容器 */
.logo-container {
  position: absolute;
  top: 17%;
  left: 8%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.logo-container::before,
.logo-container::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.logo-container::before {
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    rgba(255, 230, 90, 0.61) 0%,
    rgba(255, 179, 0, 0.55) 40%,
    rgba(255, 179, 0, 0) 65%
  );
  filter: blur(2px);
  animation: solarPulse 4s ease-in-out infinite;
  opacity: 0.85;
}

.logo-container::after {
  width: 190px;
  height: 190px;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.55) 0deg 12deg,
    rgba(255, 200, 40, 0) 12deg 24deg
  );
  mask-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.85) 30%,
    rgba(0, 0, 0, 0.08) 65%,
    rgba(0, 0, 0, 0) 70%
  );
  animation: solarRotate 7s linear infinite;
  opacity: 0.9;
}

/* Logo样式 */
.logo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: none;
  /* 移除阴影 */
  transition: transform 0.3s ease;
  background: transparent;
  /* 透明背景 */
  padding: 0;
  /* 移除内边距 */
  border: none;
  /* 移除边框 */
  opacity: 1;
  /* 调整透明度，0.0为完全透明，1.0为完全不透明 */
  position: relative;
  z-index: 2;
  /*margin-top: 0px;*/
}

.logo:hover {
  transform: scale(1.05);
}

@keyframes solarPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.7;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.95;
  }
}

@keyframes solarRotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* GLM Logo */
.glm-logo {
  margin-bottom: 24px;
  color: #374151;
}

/* 欢迎标题 - 基础样式，不设置字体大小和字体族，由语言模式样式控制 */
.welcome-title {
  margin-bottom: 10px;
  /* 进一步缩小标题和副标题之间的间距 */
  text-align: center;
  opacity: 1;
  position: relative;
  z-index: 0;
  /* 最低层 */
}

/* 欢迎副标题 - 基础样式，不设置字体大小和字体族，由语言模式样式控制 */
.welcome-subtitle {
  margin-top: -10px;
  /* 负边距让副标题更贴近标题 */
  margin-bottom: 45px;
  opacity: 1;
  position: relative;
  z-index: 0;
  /* 最低层 */
}

/* 藏文模式：主标题为藏文、副标题为中文 */
[data-lang="tibetan"] .welcome-title,
body.tibetan-mode .welcome-title {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 35px;
  font-weight: 380;
  line-height: 1.3;
  color: #000000;
  text-align: center;
  letter-spacing: 0.008em;
}

[data-lang="tibetan"] .welcome-subtitle,
body.tibetan-mode .welcome-subtitle {
  font-family:
    "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB",
    "WenQuanYi Micro Hei", sans-serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.5;
  color: #000000;
  text-align: center;
  letter-spacing: 0.485em;
  margin-left: 45px;
}

/* 中文模式：主标题为中文、副标题为藏文 */
[data-lang="chinese"] .welcome-title,
body.chinese-mode .welcome-title {
  font-family:
    "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB",
    "WenQuanYi Micro Hei", sans-serif;
  font-size: 38px;
  font-weight: 350;
  line-height: 1.3;
  color: #000000;
  text-align: center;
  letter-spacing: 0.485em;
  margin-left: 35px;
}

[data-lang="chinese"] .welcome-subtitle,
body.chinese-mode .welcome-subtitle {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 35px;
  font-weight: 550;
  line-height: 1.3;
  color: #000000;
  text-align: center;
  letter-spacing: 0.008em;
}

/* 英文模式：主标题为英文、副标题为藏文 */
[data-lang="english"] .welcome-title,
body.english-mode .welcome-title {
  font-family: "Times New Roman";
  font-size: 36px;
  font-weight: 550;
  line-height: 1.2;
  color: #000000;
  text-align: center;
  margin-left: 45px;
  letter-spacing: 0.001em;
}

[data-lang="english"] .welcome-subtitle,
body.english-mode .welcome-subtitle {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 35px;
  font-weight: 550;
  line-height: 1.5;
  color: #000000;
  text-align: center;
  letter-spacing: 0.075em;
  margin-left: 45px;
}

/* 深色模式下强制覆盖所有语言模式的标题和副标题为白色 */
body.theme-dark [data-lang="tibetan"] .welcome-title,
body.theme-dark .tibetan-mode .welcome-title,
body.theme-dark [data-lang="tibetan"] .welcome-subtitle,
body.theme-dark .tibetan-mode .welcome-subtitle,
body.theme-dark [data-lang="chinese"] .welcome-title,
body.theme-dark .chinese-mode .welcome-title,
body.theme-dark [data-lang="chinese"] .welcome-subtitle,
body.theme-dark .chinese-mode .welcome-subtitle,
body.theme-dark [data-lang="english"] .welcome-title,
body.theme-dark .english-mode .welcome-title,
body.theme-dark [data-lang="english"] .welcome-subtitle,
body.theme-dark .english-mode .welcome-subtitle,
.theme-dark [data-lang="tibetan"] .welcome-title,
.theme-dark .tibetan-mode .welcome-title,
.theme-dark [data-lang="tibetan"] .welcome-subtitle,
.theme-dark .tibetan-mode .welcome-subtitle,
.theme-dark [data-lang="chinese"] .welcome-title,
.theme-dark .chinese-mode .welcome-title,
.theme-dark [data-lang="chinese"] .welcome-subtitle,
.theme-dark .chinese-mode .welcome-subtitle,
.theme-dark [data-lang="english"] .welcome-title,
.theme-dark .english-mode .welcome-title,
.theme-dark [data-lang="english"] .welcome-subtitle,
.theme-dark .english-mode .welcome-subtitle {
  color: #ffffff !important;
}

/* 提示区域 */
.suggested-section {
  margin-top: 20px;
  /* 减少顶部边距，让建议区更靠近输入栏 */
  padding: 20px;
}

/* 建议卡片网格 */
.suggested-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* 响应式网格 */
  gap: 16px;
  max-width: 1000px;
  margin: -20px auto 0 auto;
  /* 减少顶部边距，让建议区更靠近输入栏 */
}

/* 建议卡片 */
.suggested-card {
  background: rgba(255, 255, 255, 0.1);
  /* 半透明白色背景，与欢迎区域融合 */
  border: 2px solid rgba(255, 255, 255, 0.3);
  /* 半透明白色边框 */
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  /* 过渡动画 */
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
  /* 毛玻璃效果 */
}

/* 建议卡片悬停效果 */
.suggested-card:hover {
  background: rgba(255, 255, 255, 0.2);
  /* 悬停时更亮的半透明背景 */
  border-color: rgba(255, 255, 255, 0.5);
  /* 悬停时更亮的边框 */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 建议卡片点击效果 */
.suggested-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 建议卡片文本 */
.suggested-card p {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  color: #333333;
  font-size: 22px;
  line-height: 1.5;
  flex: 1;
}

/* 提示按钮 */
.prompt-btn {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #333333;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  transition: all 0.2s;
  /* 过渡动画 */
}

/* 提示按钮悬停效果 */
.prompt-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #333333;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   消息样式
   ======================================== */

/* 消息容器 */
.messages-container {
  flex: 1;
  min-height: 0;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 60px 20px 0 20px;
  /* 恢复原始padding */
  position: relative;
  display: none;
  /* 默认隐藏，只有在聊天模式下才显示 */
  z-index: 10;
  /* 提高层级，确保在功能栏之上 */
  margin-top: 0;
  /* 移除顶部边距，让消息从页面顶端开始 */
  overflow-y: auto;
  overflow-x: hidden;
  /* 滚动条样式 */
  scrollbar-width: thin;
  /* Firefox 显示细滚动条 */
  scrollbar-color: rgba(135, 206, 235, 0.6) rgba(0, 0, 0, 0.05);
  /* Firefox 滚动条颜色 */
  -ms-overflow-style: scrollbar;
  /* IE/Edge 显示滚动条 */
}

/* Webkit浏览器的滚动条样式 - ChatGPT风格 */
.messages-container::-webkit-scrollbar {
  width: 6px;
  /* 更细的滚动条宽度 */
  background: transparent;
  /* 透明背景 */
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
  /* 完全透明的轨道 */
  border-radius: 3px;
  /* 圆角 */
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  /* 非常淡的滑块颜色 */
  border-radius: 3px;
  /* 圆角 */
  transition: all 0.2s ease;
  /* 平滑过渡动画 */
  opacity: 0;
  /* 默认透明 */
}

.messages-container:hover::-webkit-scrollbar-thumb {
  opacity: 1;
  /* 悬停时显示 */
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
  /* 悬停时稍深 */
}

/* 聊天视图模式下的消息容器对齐 */
.chat-view .messages-container {
  max-width: 800px;
  /* 与输入栏基础宽度保持一致 */
  padding-left: 16px;
  /* 与输入栏左对齐，保持与input-container的padding一致 */
  padding-right: 16px;

}

/* 聊天视图模式 */
.chat-view .welcome-section {
  display: none;
  /* 隐藏欢迎页面 */
}

.chat-view .messages-container {
  display: flex;
  flex-direction: column;
  /* 显示消息容器，在 .chat-area 内占满剩余高度并自行滚动 */
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 60px;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 275px);
  z-index: 20;
  /* 确保在功能栏之上 */
  overflow-y: auto;
}

.chat-view .input-wrapper {
  padding: 16px 20px;
  /* 超大屏幕输入框内边距 */
}

/* 超大屏幕消息容器对齐 */
.chat-view .messages-container {
  max-width: 1000px;
  /* 与输入栏宽度保持一致 */
  padding-left: 20px;
  /* 与输入栏内边距保持一致 */
  padding-right: 20px;
  /* 与输入栏内边距保持一致 */
}

/* 聊天视图：侧栏外主列不整体滚动，仅消息列表区域滚动 */
.chat-view .chat-area {
  background: #faf9f5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-view .main-content {
  background: #faf9f5;
  /* 统一背景色 */
}

/* 聊天视图模式下的输入栏样式 */
.chat-view .input-container {
  font-size: 22px;
  position: fixed;
  bottom: 0;
  /* 与底边距离为0 */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 20px 0 20px;
  background: transparent;
  /* 输入栏容器透明背景 */
  border: none;
  /* 移除边框 */
  box-shadow: none;
  /* 移除阴影 */
}

/* 消息基础样式 */
.message {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 22px;
  margin-bottom: 8px;
  /* 进一步减小底部边距，让消息更紧凑 */
  max-width: 80%;
  /* 恢复原始最大宽度 */
  display: flex;
  /* flex布局：头像在左，内容在右 */
  align-items: flex-start;
  gap: 12px;
  word-wrap: break-word;
  /* 长文本自动换行 */
  animation: messageSlideIn 0.3s ease-out;
  /* 消息滑入动画 */
  transition: all 0.3s ease;
  /* 平滑过渡 */
  position: relative;
  /* 为操作按钮提供定位上下文 */
  z-index: 30;
  /* 确保消息在功能栏之上 */
}

/* 消息内容容器 - 包含消息内容和操作按钮 */
.message-content-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  /* 允许内容收缩 */
  position: relative;
  /* 为操作按钮提供定位上下文 */
  z-index: 31;
  /* 确保内容在功能栏之上 */
}

/* 消息内容区域 - 已移除包装器，直接布局 */

/* 消息头像样式 */
.message-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #10a37f, #1a7f64);
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.2);
  overflow: hidden;
  position: relative;
  z-index: 31;
  /* 确保头像在功能栏之上 */
}

/* 助手头像图片样式 */
.message-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* 用户消息头像样式 - 字母头像 */
.user-message .message-avatar {
  background: #6b7280;
  /* 类似Claude的灰色背景 */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid #33363a;
  /* 添加细边框 */
}

/* 用户消息头像字母样式 */
.user-message .message-avatar .avatar-letter {
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  user-select: none;
}

/* 移除默认图标，使用图片头像 */

/* 消息悬停效果 - 已移除底层矩形效果 */

/* 消息滑入动画 */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 用户消息样式 */
.user-message {
  margin-left: auto;
  /* 右对齐 */
  margin-right: 0;
  /* 确保右对齐到容器边缘 */
  max-width: 85%;
  /* 最大宽度限制 */
  min-width: 80px;
  /* 最小宽度避免过窄 */
  width: fit-content;
  /* 宽度根据内容自适应 */
  flex-direction: row-reverse;
  /* 头像在右侧，内容在左侧 */
}

/* 用户消息内容区域 */
.user-message .message-content {
  background: transparent;
  color: #333;
  box-shadow: none;
  padding: 12px 16px;
  /* 减小padding，降低消息内容容器高度 */
  border-radius: 18px;
  /* 设置默认圆角，与悬停状态保持一致 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* 文本换行和自适应设置 */
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  /* 保持换行符和空格 */
  width: 100%;
  /* 确保内容区域占满容器 */
}

/* 用户消息悬停效果 */
.user-message:hover .message-content {
  background: rgba(248, 249, 250, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  /* padding和border-radius已在默认状态设置，悬停时保持不变 */
}

/* 短消息样式 - 确保有内容时保持最小宽度 */
.user-message:has(.message-content:not(:empty)) {
  min-width: 80px;
  /* 与主样式保持一致的最小宽度 */
}

/* 助手消息样式 */
.assistant-message {
  max-width: 90%;
  /* 增加最大宽度 */
  min-width: fit-content;
  /* 最小宽度适应内容 */
  width: fit-content;
  /* 宽度适应内容 */
  margin-left: 0;
  /* 确保左对齐到容器边缘 */
  margin-right: auto;
  /* 左对齐 */
  flex-direction: row;
  /* 头像在左侧，内容在右侧（默认布局） */
  gap: 12px;
  /* 确保头像与消息内容间距与用户消息一致 */
}

/* 助手消息内容区域 - 默认无背景框 */
.assistant-message .message-content {
  color: #333;
  background: none;
  border-radius: 18px;
  /* 设置默认圆角，与悬停状态保持一致 */
  box-shadow: none;
  padding: 12px 16px;
  /* 减小padding，降低消息内容容器高度 */
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 0%;
}

/* 助手消息悬停效果 - 悬停时显示圆角矩形框 */
.assistant-message:hover .message-content {
  background: linear-gradient(
    135deg,
    rgba(240, 240, 240, 0.7) 0%,
    rgba(248, 248, 248, 0.7) 100%
  );
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  /* padding和border-radius已在默认状态设置，悬停时保持不变 */
}

/* 助手消息气泡尾巴 - 已移除 */

/* 短消息样式 - 限制最小宽度避免过窄 */
.assistant-message:has(.message-content:not(:empty)) {
  min-width: 150px;
  /* 助手消息最小宽度稍大一些 */
}

/* 超长消息样式 - 限制最大宽度避免过宽 */
.assistant-message .message-content {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 助手消息长度分类样式 */
.assistant-message.short-message {
  min-width: 100px;
  /* 很短的助手消息 */
  max-width: 250px;
}

.assistant-message.medium-message {
  min-width: 150px;
  /* 中等长度的助手消息 */
  max-width: 500px;
}

.assistant-message.long-message {
  min-width: 200px;
  /* 长助手消息 */
  max-width: 90%;
}

/* 消息内容文本 */
.message-content {
  line-height: 1.6;
  font-size: 18px;
  flex: 1;
  min-width: 0;
  /* 允许内容收缩 */
  position: relative;
  z-index: 31;
  /* 确保内容在功能栏之上 */
}

/* 流式消息样式 */
.streaming-message {
  position: relative;
  animation: messageSlideIn 0.3s ease-out;
}

.streaming-content {
  position: relative;
  overflow: hidden;
}

.streaming-text {
  display: inline;
  animation: textReveal 0.1s ease-out;
}

.streaming-cursor {
  display: inline-block;
  animation: blink 1.2s infinite;
  font-weight: bold;
  color: #10a37f;
  margin-left: 2px;
  font-size: 18px;
  vertical-align: baseline;
}

/* 光标闪烁动画 */
@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* 文字显示动画 */
@keyframes textReveal {
  from {
    opacity: 0.7;
    transform: translateY(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 流式消息完成后的样式 */
.message:not(.streaming-message) .streaming-cursor {
  display: none;
}

/* 流式消息的渐变效果 */
/*.streaming-message .message-content {
    background: linear-gradient(135deg, #E6F3FF 0%, #F0F8FF 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* 流式消息的脉冲效果 - 已注释 */

/* 用户消息内容文本 */
.user-message .message-content {
  color: #333333;
  /* 白色文字 */
}

/* 助手消息内容文本 */
.assistant-message .message-content {
  color: #333333;
  /* 白色文字 */
}

/* 消息操作按钮容器 */
.message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  /* 减少顶部边距，让按钮更靠近消息内容 */
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  /* 改为相对定位，避免重叠 */
  z-index: 32;
  /* 确保操作按钮在功能栏之上 */
  justify-content: flex-end;
  /* 右对齐 */
  width: fit-content;
  padding: 6px 10px 8px;
  /* 减少内边距，让按钮更紧凑 */
  background: none;
  /* 半透明白色背景 */
  /*border: 1px solid rgba(0, 0, 0, 0.1);*/
  /*border-radius: 20px; /* 圆角 */
  /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 轻微阴影 */
  backdrop-filter: blur(10px);
  /* 毛玻璃效果 */
}

.message:hover .message-actions {
  opacity: 1;
}

/* 消息操作按钮 */
.message-action-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 10;
  /* 确保按钮在侧边栏之上 */
  font-size: 14px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
}

.message-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* 用户消息的操作按钮 */
.user-message .message-action-btn {
  background: none;
  color: #666;
}

.user-message .message-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  transform: scale(1.1);
}

/* 桌面端用户消息操作按钮始终显示 */
.user-message .message-actions {
  opacity: 1;
}

/* 助手消息的操作按钮 */
.assistant-message .message-action-btn {
  background: none;
  color: #666;
}

.assistant-message .message-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  transform: scale(1.1);
}

/* 桌面端助手消息操作按钮默认隐藏，悬停时显示 */
.assistant-message .message-actions {
  opacity: 1;
}

.assistant-message:hover .message-actions {
  opacity: 1;
}

/* 操作按钮激活状态 */
.message-action-btn.active {
  box-shadow: none;
}

/* 点赞按钮激活状态 */
.message-action-btn[title="点赞"].active {
  background: none;
  color: #10a37f;
  border: none;
}

/* 点踩按钮激活状态 */
.message-action-btn[title="点踩"].active {
  background: none;
  color: #ef4444;
  border: none;
}

/* 更多选项菜单 */
.more-options-menu {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 120px;
  z-index: 1000;
}

.more-options-menu .menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #333333;
}

.more-options-menu .menu-item:hover {
  background: #f5f5f5;
}

.more-options-menu .menu-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  color: #666666;
}

.more-options-menu .menu-item:hover i {
  color: #333333;
}

/* 反馈通知样式 */
.feedback-notification {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 操作按钮图标动画 */
.message-action-btn i {
  transition: transform 0.2s ease;
}

.message-action-btn:hover i {
  transition: transform 0.2s ease;
}

/* 移除激活状态图标的缩放效果，保持图标大小不变 */

/* 操作按钮组布局优化 */
.message-actions {
  flex-wrap: wrap;
  gap: 6px;
}

/* 移动端操作按钮优化 */
@media (max-width: 768px) {
  .message-actions {
    gap: 4px;
  }

  .message-action-btn {
    padding: 4px 6px;
    font-size: 12px;
  }

  .more-options-menu {
    min-width: 100px;
  }

  .more-options-menu .menu-item {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ========================================
   输入框样式
   ======================================== */

/* 输入容器基础样式 */
.input-container {
  position: fixed;
  bottom: 0;
  /* 与底边距离为0 */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  padding: 0;
  /* 移除内边距，删除白色方块 */
  background: transparent;
  /* 透明背景，删除白色方形块 */
  border: none;
  /* 移除边框 */
  box-shadow: none;
  /* 移除阴影 */
}

/* 欢迎页面的输入栏样式 */
.input-container.welcome-input {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  position: static;
  /* 静态定位，不固定在底部 */
  background: transparent;
  /* 透明背景 */
  border-top: none;
  /* 移除顶部边框 */
  box-shadow: none;
  /* 移除阴影 */
  padding: 140px 0 0 0;
  /* 增加顶部内边距，让输入栏往下移动 */
  margin-bottom: -20px;
  /* 负边距让输入栏和建议区更靠近 */
  max-width: 800px;
  /* 限制最大宽度 */
  margin-left: auto;
  /* 居中对齐 */
  margin-right: auto;
  /* 居中对齐 */
}

/* 聊天页面输入栏样式 */
.input-container.chat-input {
  position: fixed;
  /* 固定定位：上移，为底部版权 + AI 免责声明留出空间 */
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 0;
  /* 左对齐 */
  right: 0;
  /* 右对齐 */
  background: transparent;
  /* 移除背景色 */
  border: none;
  /* 移除边框 */
  box-shadow: none;
  /* 移除阴影 */
  padding: 0 16px 16px;
  /* 恢复内边距，用于间距 */
  z-index: 100;
  /* 确保在其他元素之上 */
  display: none;
  /* 默认隐藏，只在聊天视图时显示 */
}

/* 聊天视图时显示聊天输入栏 */
.chat-view .input-container.chat-input {
  display: block;
}

/* 桌面/平板：底部输入栏从侧栏右侧起算，避免固定层在侧栏下缘透出主区深色底 */
@media (min-width: 481px) {
  body.chat-view
    .sidebar.collapsed
    ~ .main-content
    .input-container.chat-input {
    left: 75px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body.chat-view .sidebar.expanded ~ .main-content .input-container.chat-input {
    left: 280px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 769px) {
  body.chat-view .sidebar.expanded ~ .main-content .input-container.chat-input {
    left: 240px;
    right: 0;
    width: auto;
  }
}

/* 聊天视图时隐藏欢迎输入栏 */
.chat-view .input-container.welcome-input {
  display: none;
}

/* AI生成内容免责声明（层级低于侧栏，避免盖住侧栏底部） */
.ai-disclaimer {
  font-family: "SUNSHINE-UCHEN", "阳光吾坚体";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  background: transparent;
  padding: 4px 16px 8px 16px;
  z-index: 65;
  margin: 0;
  pointer-events: none;
  /* 防止阻挡其他元素的点击 */
  display: none;
  /* 默认隐藏 */
  font-size: 9px;
  font-weight: 400;
  line-height: 1.25;
  color: #b0b0b0;
  letter-spacing: 0.01em;
}

/* 欢迎页面隐藏AI声明 */
.welcome-section ~ .ai-disclaimer {
  display: none;
}

/* 聊天页面：免责声明在版权信息之上（版权贴底，由 #copyrightSection 承担） */
.chat-view .ai-disclaimer {
  display: block;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  z-index: 65;
  padding: 1px 16px 3px;
  /* 不透明底，完全遮住后方滚动的消息内容 */
  background-color: #faf9f5;
  background: #faf9f5;
  font-size: 12px;
  color: #000000;
}

body.theme-dark.chat-view .ai-disclaimer,
.theme-dark.chat-view .ai-disclaimer {
  background-color: var(--bg-primary, #1a1a1a);
  background: var(--bg-primary, #1a1a1a);
  color: #6a6a6a;
}

@media (min-width: 481px) {
  body.chat-view .sidebar.collapsed ~ .main-content .ai-disclaimer {
    left: 75px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body.chat-view .sidebar.expanded ~ .main-content .ai-disclaimer {
    left: 280px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 769px) {
  body.chat-view .sidebar.expanded ~ .main-content .ai-disclaimer {
    left: 240px;
    right: 0;
    width: auto;
  }
}

.disclaimer-text {
  font-size: 9px;
  color: inherit;
  line-height: 1.25;
  opacity: 1;
  margin: 0;
  font-weight: 400;
}

/* 中文模式下的免责声明 */
[data-lang="chinese"] .disclaimer-text,
body.chinese-mode .disclaimer-text {
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

/* 英文模式下的免责声明 */
[data-lang="english"] .disclaimer-text,
body.english-mode .disclaimer-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* 藏文模式下的免责声明 */
[data-lang="tibetan"] .disclaimer-text,
body.tibetan-mode .disclaimer-text,
body[data-lang="tibetan"] .disclaimer-text {
  font-family: "SUNSHINE-UCHEN", "阳光吾坚体", sans-serif;
}

/* 输入框容器 */
.input-wrapper {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  /* 纯白色背景，类似图片 */
  backdrop-filter: none;
  /* 移除毛玻璃效果 */
  border-radius: 32px;
  /* 更大的圆角，类似图片 */
  padding: 16px 20px;
  /* 增加内边距，让输入栏更高 */
  gap: 16px;
  /* 增加元素间距 */
  max-width: 1000px;
  /* 放宽输入栏宽度 */
  margin: 10px auto;
  /* 添加上下边距，替代容器的内边距 */
  border: 1px solid #e5e7eb;
  /* 更细的边框，类似图片 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* 更柔和的阴影 */
  transition: all 0.3s ease;
  /* 平滑过渡动画 */
  min-height: 80px;
  /* 增加最小高度，类似图片中的高度 */
  position: relative;
  z-index: 100;
  /* 确保输入包装器在合适层级 */
  pointer-events: auto;
  /* 确保子元素可以点击 */
}

.input-main {
  display: flex;
  position: relative;
  gap: 16px;
  /* 增加元素间距 */
  width: 100%;
  align-items: center;
  /* 改为居中对齐，类似图片中的样式 */
}

.input-btn {
  display: flex;
  gap: 16px;
  /* 增加元素间距 */
  align-items: center;
  /* 改为居中对齐，类似图片中的样式 */
}

@keyframes inputPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* 附件、发送按钮基础样式 */
.attach-btn,
.send-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  /* 更深的灰色，类似图片 */
  cursor: pointer;
  padding: 12px;
  /* 增加内边距，让按钮更大 */
  border-radius: 8px;
  /* 稍微增加圆角 */
  transition: all 0.3s ease;
  /* 平滑过渡动画 */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  /* 增加最小宽度 */
  min-height: 44px;
  /* 增加最小高度 */
}

/* 附件按钮悬停效果 */
.attach-btn:hover {
  background: #f3f4f6;
  /* 浅灰色背景，类似图片 */
  color: #374151;
  transform: scale(1.05);
  /* 放大效果 */
}

/* 发送按钮样式 */
.send-btn {
  background: #10a37f;
  /* 纯色背景，类似图片 */
  color: #ffffff;
  /* 白色文字 */
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.2);
  /* 更柔和的阴影 */
  border: none;
  cursor: pointer;
  padding: 12px;
  /* 增加内边距 */
  border-radius: 50%;
  /* 圆形按钮 */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  /* 增加最小宽度 */
  min-height: 44px;
  /* 增加最小高度 */
  width: 44px;
  /* 固定宽度，确保是正方形 */
  height: 44px;
  /* 固定高度，确保是正方形 */
  position: relative;
  z-index: 1000;
  /* 确保按钮在最上层 */
  pointer-events: auto;
  /* 确保按钮可以点击 */
}

/* 发送按钮悬停效果 */
.send-btn:hover {
  background: #0d8a6b;
  /* 更深的绿色，类似图片 */
  transform: scale(1.05);
  /* 放大效果 */
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  /* 增强阴影 */
}

/* 发送按钮点击效果 */
.send-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

/* 发送按钮加载状态 */
.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(1);
}

/* 发送按钮图标样式 */
.send-btn i {
  font-size: 14px;
  font-weight: bold;
}

.tool-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.tool-button.active {
  background: #eff6ff;
  border-color: #0d8a6b;
  color: #0d8a6b;
}

.tool-button i {
  font-size: 14px;
}

/* 语音输入按钮 */
.voice-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 4px;
}

.voice-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.voice-btn:active {
  transform: scale(0.95);
}

.voice-icon {
  width: 22px;
  height: 22px;
}

.voice-btn.recording {
  background: #ef4444;
  color: white;
  animation: pulse 1.5s infinite;
}

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

  50% {
    opacity: 0.7;
  }
}

.voice-btn i {
  font-size: 16px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .voice-btn {
    width: 32px;
    height: 32px;
    margin-left: 6px;
  }

  .voice-btn i {
    font-size: 14px;
  }
}

/* 终止按钮样式 */
.stop-btn {
  background: #9ca3af;
  /* 浅灰色背景 */
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.3);
  /* 浅灰色阴影 */
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  /* 圆形按钮 */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  /* 固定宽度，确保是正方形 */
  height: 44px;
  /* 固定高度，确保是正方形 */
  min-width: 44px;
  /* 最小宽度 */
  min-height: 44px;
  /* 最小高度 */
}

/* 终止按钮悬停效果 */
.stop-btn:hover {
  background: #6b7280;
  /* 稍深的浅灰色 */
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.4);
  /* 浅灰色阴影 */
}

/* 终止按钮点击效果 */
.stop-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.3);
}

/* 终止按钮图标样式 */
.stop-btn i {
  font-size: 14px;
  font-weight: bold;
}

/* 语音按钮样式 */
/*.voice-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.voice-btn:hover {
    background: #333;
    color: #fff;
}*/

/* 波形按钮样式 */
.waveform-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

*/ .waveform-btn:hover {
  background: #333;
  color: #fff;
}

/* 消息输入框 */
.message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #333333;
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  font-size: 22px;
  outline: none;
  padding: 8px 0;
  /* 减少上下内边距，让文字居中 */
  resize: none;
  min-height: 24px;
  /* 减少最小高度 */
  max-height: 120px;
  /* 增加最大高度，允许更多内容 */
  overflow-y: auto;
  /* 改为auto，当内容超过最大高度时显示滚动条 */
  line-height: 1.5;
  /* 增加行高，让文字更舒适 */
  transition: height 0.2s ease;
  /* 添加平滑过渡动画 */
  box-sizing: border-box;
  /* 确保padding包含在高度计算中 */
  /* 隐藏滚动条但保持滚动功能 */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

/* 隐藏Webkit浏览器的滚动条 */
.message-input::-webkit-scrollbar {
  display: none;
}

/* 输入框占位符样式 */
.message-input::placeholder {
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
  color: #9ca3af;
  /* 更柔和的灰色，类似图片 */
  font-size: 22px;
  /* 与输入框字体大小保持一致 */
}

/* 输入框Logo */
.input-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff6b35;
  /* 橙色背景 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  /* 防止收缩 */
}

/* 输入框Logo图片 */
.input-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* 响应式设计 - 移动端footer样式 */
@media (max-width: 768px) {
  .footer {
    font-size: 0.9rem;
    line-height: 1.1;
    /* 移动端行距更紧凑 */
    gap: 3px;
    /* 移动端元素间距更小 */
    padding: 8px 15px;
    /* 移动端减少内边距 */
  }

  /* 移动端logo样式 */
  .logo {
    width: 90px;
    height: 90px;
  }

  .logo-container {
    margin-bottom: 15px;
  }
}
/* ========================================
   滚动条样式 - 显示在右侧
   ======================================== */

/* 消息容器的滚动条样式已在上方设置，显示在右侧 */

/* 滚动条增强效果 */
.messages-container {
  scroll-behavior: smooth;
  /* 平滑滚动 */
}

/* 滚动条淡入淡出动画 */
@keyframes scrollbarFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scrollbarFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* 滚动时显示滚动条 */
.messages-container.scrolling::-webkit-scrollbar-thumb {
  opacity: 1;
  animation: scrollbarFadeIn 0.2s ease;
}

/* 停止滚动后隐藏滚动条 */
.messages-container:not(.scrolling):not(:hover)::-webkit-scrollbar-thumb {
  animation: scrollbarFadeOut 0.5s ease 1s forwards;
}

/* 侧边栏滚动条样式 - ChatGPT风格 */
.sidebar-content::-webkit-scrollbar,
.chat-history-list::-webkit-scrollbar {
  width: 4px;
  /* 更细的滚动条宽度 */
  background: transparent;
  /* 透明背景 */
}

/* 侧边栏滚动条轨道样式 */
.sidebar-content::-webkit-scrollbar-track,
.chat-history-list::-webkit-scrollbar-track {
  background: transparent;
  /* 完全透明的轨道 */
  border-radius: 2px;
  /* 圆角 */
}

/* 侧边栏滚动条滑块样式 */
.sidebar-content::-webkit-scrollbar-thumb,
.chat-history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  /* 非常淡的滑块颜色 */
  border-radius: 2px;
  /* 圆角 */
  transition: all 0.2s ease;
  /* 平滑过渡动画 */
  opacity: 0;
  /* 默认透明 */
}

/* 侧边栏悬停时显示滚动条 */
.sidebar-content:hover::-webkit-scrollbar-thumb,
.chat-history-list:hover::-webkit-scrollbar-thumb {
  opacity: 1;
  /* 悬停时显示 */
}

/* 侧边栏滚动条滑块悬停效果 */
.sidebar-content::-webkit-scrollbar-thumb:hover,
.chat-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
  /* 悬停时稍深 */
}

/* Firefox 滚动条设置 - ChatGPT风格 */
.messages-container {
  scrollbar-width: thin;
  /* Firefox 显示细滚动条 */
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
  /* 淡色滑块，透明轨道 */
}

.sidebar-content,
.chat-history-list {
  scrollbar-width: thin;
  /* Firefox 显示细滚动条 */
  scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
  /* 更淡的滑块，透明轨道 */
}

/* IE/Edge 滚动条设置 */
.messages-container {
  -ms-overflow-style: scrollbar;
  /* IE/Edge 显示滚动条 */
}

.sidebar-content,
.chat-history-list {
  -ms-overflow-style: scrollbar;
  /* IE/Edge 显示滚动条 */
}

/* ========================================
   加载动画样式
   ======================================== */

/* 打字指示器容器 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 20px;
  background: #faf9f5;
  /* 统一背景色 */
  border: 1px solid #b0c4de;
  border-radius: 12px;
  max-width: 80px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  /* 轻微阴影 */
}

/* 打字动画点 */
.typing-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #10a37f 0%, #0d8a6b 100%);
  /* 绿色渐变 */
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
  /* 无限循环动画 */
  box-shadow: 0 2px 4px rgba(16, 163, 127, 0.3);
  /* 绿色阴影 */
}

/* 第一个点的动画延迟 */
.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

/* 第二个点的动画延迟 */
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

/* 打字动画关键帧 */
@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    /* 缩小到80% */
    opacity: 0.5;
    /* 半透明 */
  }

  40% {
    transform: scale(1);
    /* 正常大小 */
    opacity: 1;
    /* 完全不透明 */
  }
}

/* 思考状态指示器 - 动态助手头像 */
.thinking-indicator {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px auto;
  /* 上下边距，左右自动居中 */
  padding: 0 20px;
  /* 左右内边距相等 */
  animation: thinkingSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  max-width: 800px;
  /* 限制最大宽度 */
  width: 100%;
  /* 占满容器宽度 */
  box-sizing: border-box;
  /* 确保padding包含在宽度内 */
}

.thinking-avatar {
  width: 40px;
  height: 40px;
  position: relative;
  flex-shrink: 0;
}

.thinking-icon {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: thinkingPulse 2s ease-in-out infinite;
}

.thinking-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 0;
  /* 最低层 */
  animation: thinkingBounce 1.5s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 思考头像的呼吸光晕效果 */
.thinking-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, #10a37f, #1a7f64, #10a37f);
  border-radius: 50%;
  z-index: 0;
  animation: thinkingGlow 2s ease-in-out infinite;
}

/* 思考头像的旋转光效 */
.thinking-icon::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  background: conic-gradient(transparent, rgba(16, 163, 127, 0.3), transparent);
  border-radius: 50%;
  z-index: -1;
  animation: thinkingRotate 3s linear infinite;
}

.thinking-dots {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  background: #10a37f;
  border-radius: 50%;
  animation: thinkingDotBounce 1.4s ease-in-out infinite both;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

.thinking-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0s;
}

.thinking-text {
  color: #10a37f;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  position: relative;
  z-index: 0;
  /* 最低层 */
  margin-top: 8px;
  animation: thinkingTextFade 2s ease-in-out infinite;
}

/* 思考动画关键帧 */
@keyframes thinkingSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes thinkingShimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes thinkingPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

@keyframes thinkingGlow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes thinkingTextFade {
  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

@keyframes thinkingRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes thinkingDotBounce {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 思考消息样式 */
.thinking-message {
  display: flex;
  align-items: flex-start;
  margin: 10px 0;
  animation: slideInUp 0.3s ease-out;
}

.thinking-avatar {
  width: 40px;
  height: 40px;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
}

.thinking-avatar-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.thinking-message .thinking-icon {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #10a37f, #1a7f64);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  animation: thinkingPulse 2s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.thinking-message .thinking-dots {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.thinking-message .thinking-dot {
  width: 6px;
  height: 6px;
  background: #10a37f;
  border-radius: 50%;
  animation: thinkingBounce 1.4s ease-in-out infinite;
}

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

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

.thinking-content {
  background: rgba(16, 163, 127, 0.1);
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(16, 163, 127, 0.2);
}

.thinking-content .thinking-text {
  color: #10a37f;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

/* 流式消息中的思考头像 - 与思考指示器保持一致 */
.streaming-message .thinking-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  margin-right: 12px;
  flex-shrink: 0;
}

.streaming-message .thinking-avatar-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.streaming-message .thinking-avatar .thinking-icon {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: thinkingPulse 2s ease-in-out infinite;
}

.streaming-message .thinking-avatar .thinking-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 0;
  /* 最低层 */
  animation: thinkingBounce 1.5s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 流式消息中思考头像的呼吸光晕效果 */
.streaming-message .thinking-avatar .thinking-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, #10a37f, #1a7f64, #10a37f);
  border-radius: 50%;
  z-index: 0;
  animation: thinkingGlow 2s ease-in-out infinite;
}

/* 流式消息中思考头像的旋转光效 */
.streaming-message .thinking-avatar .thinking-icon::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  background: conic-gradient(transparent, rgba(16, 163, 127, 0.3), transparent);
  border-radius: 50%;
  z-index: -1;
  animation: thinkingRotate 3s linear infinite;
}

/* 助手头像样式 */
.assistant-avatar {
  width: 40px;
  height: 40px;
  background: transparent;
  /* 去掉背景色 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: none;
  /* 去掉阴影 */
}

.assistant-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes thinkingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  40% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 浮动侧边栏按钮 */
.floating-sidebar-btn {
  position: fixed;
  width: 48px;
  height: 48px;
  background: #fcfdfd04;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  transition: all 0.3s ease;
  z-index: 1002;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  animation: buttonPulse 2s infinite;
  overflow: hidden;
  /* 确保图片不会超出圆形边界 */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 浮动按钮图片样式 */
.floating-sidebar-btn img {
  width: 120%;
  height: 120%;
  object-fit: cover;
  /* 保持图片比例，填充整个圆形区域 */
  border-radius: 50%;
  /* 确保图片也是圆形 */
  transition: all 0.3s ease;
}

/* 浮动按钮悬停时图片效果 */
.floating-sidebar-btn:hover img {
  transform: scale(1.05);
}

/* 按钮脉冲动画 */
@keyframes buttonPulse {
  0% {
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  }

  50% {
    box-shadow: 0 4px 20px rgba(16, 163, 127, 0.5);
  }

  100% {
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  }
}

/* 预设位置样式 */
.floating-sidebar-btn.position-top-left {
  top: 20px;
  left: 20px;
}

.floating-sidebar-btn.position-top-right {
  top: 10px;
  right: 20px;
  left: auto;
}

.floating-sidebar-btn.position-bottom-left {
  bottom: 40px;
  left: 20px;
  top: auto;
}

.floating-sidebar-btn.position-bottom-right {
  bottom: 40px;
  right: 20px;
  top: auto;
  left: auto;
}

.floating-sidebar-btn.position-center-left {
  top: 45%;
  left: 20px;
  transform: translateY(-50%) scale(0.8);
}

.floating-sidebar-btn.position-center-right {
  top: 45%;
  right: 20px;
  left: auto;
  transform: translateY(-50%) scale(0.8);
}

.floating-sidebar-btn.position-custom {
  /* 自定义位置通过内联样式设置 */
  position: fixed;
}

/* 拖拽模式样式 */
.floating-sidebar-btn.dragging-mode {
  cursor: move !important;
  z-index: 10000 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
  box-shadow: 0 8px 20px rgba(16, 163, 127, 0.5);
}

/* 拖拽状态样式 */
.floating-sidebar-btn.dragging {
  cursor: grabbing !important;
  transform: scale(1.1) !important;
  box-shadow: 0 8px 30px rgba(16, 163, 127, 0.6) !important;
  animation: none !important;
  z-index: 10001 !important;
}

/* 拖拽时的视觉反馈 */
.floating-sidebar-btn.drag-hint {
  animation: dragHint 1s ease-in-out infinite alternate;
}

@keyframes dragHint {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  }

  100% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.5);
  }
}

.floating-sidebar-btn:hover {
  background: #0d8a6b;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.4);
}

.floating-sidebar-btn:active {
  transform: scale(0.95);
}

/* 浮动按钮始终隐藏，因为侧边栏收起时仍可见 */
/* 收起状态下显示浮动按钮 */
.sidebar.collapsed ~ .main-content .floating-sidebar-btn,
.sidebar.collapsed + .floating-sidebar-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* 展开状态下隐藏浮动按钮 */
.sidebar.expanded ~ .main-content .floating-sidebar-btn,
.sidebar.expanded + .floating-sidebar-btn {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

/* 响应式设计 - 移动端浮动按钮 */
@media (max-width: 480px) {
  .floating-sidebar-btn {
    width: 44px;
    height: 44px;
  }

  .floating-sidebar-btn.position-top-left {
    top: 35px;
    left: 15px;
  }

  .floating-sidebar-btn.position-top-right {
    top: 5px;
    right: 15px;
  }

  .floating-sidebar-btn.position-bottom-left {
    bottom: 35px;
    left: 15px;
  }

  .floating-sidebar-btn.position-bottom-right {
    bottom: 35px;
    right: 15px;
  }

  .floating-sidebar-btn.position-center-left {
    left: 15px;
  }

  .floating-sidebar-btn.position-center-right {
    right: 15px;
  }
}

/* 收起状态下隐藏新建对话按钮 */
.sidebar.collapsed .new-chat-button {
  display: none;
}

/* 小型边侧栏图标区域 */
.mini-sidebar-icons {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 12px 8px;
  border-bottom: none;
  margin-top: -8px;
  position: relative;
  /* 为按钮提供定位上下文 */
  z-index: 1002;
  /* 确保在侧边栏之上 */
  flex-shrink: 0;
}

/* 收起状态下显示小型图标 */
.sidebar.collapsed .mini-sidebar-icons {
  display: flex;
}

/* 小型切换按钮 */
.mini-toggle-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #faf9f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  margin-bottom: 4px;
  position: relative;
  /* 允许按钮伸出侧边栏 */
  margin-right: -16px;
  /* 向右伸出16px，让按钮一半在侧边栏外 */
  z-index: 1003;
  /* 确保在侧边栏之上 */
}

.mini-toggle-btn:hover {
  background: #f0f8ff;
  border-color: #87ceeb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
}

.mini-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(135, 206, 235, 0.3);
}

.toggle-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* 小型图标按钮 */
.mini-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #faf9f5;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 25px;
  position: relative;
  /* 允许按钮伸出侧边栏 */
  margin-right: -16px;
  /* 向右伸出16px，让按钮一半在侧边栏外 */
  z-index: 1003;
  /* 确保在侧边栏之上 */
  margin-bottom: 4px;
}

.mini-icon-btn:hover {
  background: #f0f8ff;
  border-color: #87ceeb;
  color: #87ceeb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
}

.mini-icon-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(135, 206, 235, 0.3);
}

/* 游客使用次数指示器样式 */
.guest-usage-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #fff8e6 0%, #fff3cc 100%);
  border: 1px solid #f5d76e;
  border-radius: 20px;
  font-size: 13px;
  color: #b8860b;
  margin-left: 12px;
  box-shadow: 0 2px 8px rgba(245, 215, 110, 0.3);
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.guest-usage-indicator i {
  font-size: 12px;
  color: #daa520;
  flex-shrink: 0;
}

.guest-usage-indicator .guest-usage-text {
  white-space: nowrap;
}

.guest-usage-indicator:hover {
  background: linear-gradient(135deg, #fff3cc 0%, #ffeeb3 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 215, 110, 0.4);
}

/* 次数用尽时的样式 */
.guest-usage-indicator.exhausted {
  background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
  border-color: #ff6b6b;
  color: #cc0000;
}

.guest-usage-indicator.exhausted i {
  color: #ff4757;
}

/* 顶部栏左侧区域调整 - 支持游客指示器 */
.chat-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 小屏幕优化 */
@media (max-width: 768px) {
  .guest-usage-indicator {
    padding: 4px 10px;
    font-size: 11px;
    margin-left: 8px;
  }

  .guest-usage-indicator i {
    font-size: 10px;
  }
}

/* 更小屏幕下隐藏图标只显示文字 */
@media (max-width: 480px) {
  .guest-usage-indicator i {
    display: none;
  }

  .guest-usage-indicator {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* 藏文模式下的调整 */
body.tibetan-mode .guest-usage-indicator {
  font-size: 12px;
}

/* 小型侧边栏中的新建聊天按钮 */
.new-chat-btn-small {
  background: #007bff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-left: 8px;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.new-chat-btn-small:hover {
  background: #0056b3;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.new-chat-btn-small:active {
  transform: scale(0.95);
}

/* 位置控制面板样式 */
.position-controls {
  margin-top: 10px;
}

/* 拖拽提示样式 */
.drag-tip-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  cursor: pointer;
}

.drag-tip-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 300px;
}

.drag-tip-content h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 18px;
}

.drag-tip-content p {
  margin: 5px 0;
  color: #666;
  font-size: 14px;
}

.drag-tip {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 300px;
  animation: dragTipSlideIn 0.3s ease;
}

.drag-tip-icon {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
}

.drag-tip h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 18px;
}

.drag-tip p {
  margin: 5px 0;
  color: #666;
  font-size: 14px;
}

.drag-tip-actions {
  margin-top: 20px;
}

@keyframes dragTipSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 位置保存提示样式 */
.position-saved-tip {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10002;
  opacity: 1;
  transition: opacity 0.3s ease;
  animation: positionSavedSlideIn 0.3s ease;
}

.tip-content {
  background: #10a37f;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
  font-size: 14px;
  font-weight: 500;
}

.tip-icon {
  font-size: 16px;
}

@keyframes positionSavedSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.position-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.position-row label {
  min-width: 80px;
  font-size: 14px;
  color: #666;
}

.position-row select,
.position-row input[type="number"] {
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 120px;
}

.position-row input[type="number"] {
  min-width: 80px;
}

.position-row button {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.position-row button:hover {
  background: #e9e9e9;
  border-color: #ccc;
}

.position-row button.btn-small {
  padding: 4px 8px;
  font-size: 11px;
}

#customPositionRow {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #eee;
}

#customPositionRow label {
  font-size: 12px;
  color: #888;
  min-width: 60px;
}

#customPositionRow input {
  min-width: 60px;
  font-size: 12px;
}

/* 图片设置区域样式 */
.image-settings-section {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.section-header i {
  font-size: 16px;
}

.image-settings-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.current-image-preview {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.preview-placeholder i {
  font-size: 24px;
}

#previewImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.image-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.option-label i {
  font-size: 14px;
  width: 16px;
}

.image-input,
.image-file-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.image-input:focus,
.image-file-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.image-file-input {
  cursor: pointer;
}

.image-file-input::-webkit-file-upload-button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 8px;
}

.image-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.apply-image-btn,
.clear-image-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.apply-image-btn {
  background: var(--accent-color);
  color: white;
}

.apply-image-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.clear-image-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.clear-image-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* 图片设置区域在移动端的样式 */
@media (max-width: 768px) {
  .image-settings-section {
    margin-top: 15px;
    padding-top: 15px;
  }

  .current-image-preview {
    height: 100px;
  }

  .image-actions {
    flex-direction: column;
  }

  .apply-image-btn,
  .clear-image-btn {
    padding: 10px 12px;
  }
}

/* 图片设置动画效果 */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.image-error-message,
.image-success-message {
  animation: slideIn 0.3s ease;
}

/* ========================================
   Markdown样式
   ======================================== */

/* 助手消息中的Markdown内容样式 */
.assistant-message .message-content {
  /* 重置一些默认样式，让Markdown内容正常显示 */
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 标题样式 */
.assistant-message .message-content h1,
.assistant-message .message-content h2,
.assistant-message .message-content h3,
.assistant-message .message-content h4,
.assistant-message .message-content h5,
.assistant-message .message-content h6 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
  color: #333;
}

.assistant-message .message-content h1 {
  font-size: 1.5em;
  border-bottom: 2px solid #e1e5e9;
  padding-bottom: 8px;
}

.assistant-message .message-content h2 {
  font-size: 1.3em;
  border-bottom: 1px solid #e1e5e9;
  padding-bottom: 6px;
}

.assistant-message .message-content h3 {
  font-size: 1.1em;
}

.assistant-message .message-content h4,
.assistant-message .message-content h5,
.assistant-message .message-content h6 {
  font-size: 1em;
}

/* 段落样式 */
.assistant-message .message-content p {
  margin: 8px 0;
  line-height: 1.6;
}

/* 列表样式 */
.assistant-message .message-content ul,
.assistant-message .message-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.assistant-message .message-content li {
  margin: 4px 0;
  line-height: 1.5;
}

.assistant-message .message-content ul li {
  list-style-type: disc;
}

.assistant-message .message-content ol li {
  list-style-type: decimal;
}

/* 嵌套列表 */
.assistant-message .message-content ul ul,
.assistant-message .message-content ol ol,
.assistant-message .message-content ul ol,
.assistant-message .message-content ol ul {
  margin: 2px 0;
}

/* 引用样式 */
.assistant-message .message-content blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 4px solid #10a37f;
  background-color: #f8f9fa;
  border-radius: 0 4px 4px 0;
  color: #555;
  font-style: italic;
}

.assistant-message .message-content blockquote p {
  margin: 0;
}

/* 代码样式 */
.assistant-message .message-content code {
  background-color: #f1f3f4;
  color: #d63384;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

.assistant-message .message-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
  line-height: 1.4;
}

.assistant-message .message-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* 代码块标题 */
.assistant-message .message-content pre[class*="language-"] {
  position: relative;
}

.assistant-message .message-content pre[class*="language-"]::before {
  content: attr(class);
  position: absolute;
  top: 0;
  right: 0;
  background: #e1e5e9;
  color: #666;
  padding: 4px 8px;
  font-size: 0.8em;
  border-radius: 0 6px 0 4px;
  text-transform: uppercase;
}

/* 表格样式 */
.assistant-message .message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 0.9em;
}

.assistant-message .message-content th,
.assistant-message .message-content td {
  border: 1px solid #e1e5e9;
  padding: 8px 12px;
  text-align: left;
}

.assistant-message .message-content th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.assistant-message .message-content tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* 链接样式 */
.assistant-message .message-content a {
  color: #10a37f;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s ease;
}

.assistant-message .message-content a:hover {
  border-bottom-color: #10a37f;
}

/* 强调样式 */
.assistant-message .message-content strong,
.assistant-message .message-content b {
  font-weight: 600;
  color: #333;
}

.assistant-message .message-content em,
.assistant-message .message-content i {
  font-style: italic;
  color: #555;
}

/* 删除线样式 */
.assistant-message .message-content del,
.assistant-message .message-content s {
  text-decoration: line-through;
  color: #999;
}

/* 水平分割线 */
.assistant-message .message-content hr {
  border: none;
  height: 1px;
  background-color: #e1e5e9;
  margin: 16px 0;
}

/* 图片样式 */
.assistant-message .message-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 任务列表样式 */
.assistant-message .message-content input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}

.assistant-message .message-content li:has(input[type="checkbox"]) {
  list-style: none;
  margin-left: -24px;
}

/* 内联数学公式样式（如果支持） */
.assistant-message .message-content .math {
  font-family: "Times New Roman", serif;
  font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .assistant-message .message-content h1 {
    font-size: 1.3em;
  }

  .assistant-message .message-content h2 {
    font-size: 1.2em;
  }

  .assistant-message .message-content pre {
    font-size: 0.8em;
    padding: 8px;
  }

  .assistant-message .message-content table {
    font-size: 0.8em;
  }

  .assistant-message .message-content th,
  .assistant-message .message-content td {
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  .assistant-message .message-content h1 {
    font-size: 1.2em;
  }

  .assistant-message .message-content h2 {
    font-size: 1.1em;
  }

  .assistant-message .message-content pre {
    font-size: 0.75em;
    padding: 6px;
  }

  .assistant-message .message-content ul,
  .assistant-message .message-content ol {
    padding-left: 20px;
  }
}

.user-dropdown-item .item-arrow {
  color: #a0aec0;
  transition: transform 0.2s ease;
}

.user-dropdown-item.has-submenu.open .item-arrow {
  transform: rotate(90deg);
}

.user-dropdown-item.has-submenu.open {
  background-color: #f7fafc;
}

.user-dropdown-item.has-submenu.open span i {
  color: #2d3748;
}

.user-dropdown-item.has-submenu.open .submenu-toggle,
.user-dropdown-item.has-submenu.open .item-arrow {
  color: #2d3748;
}

/* ========================================
      思考过程可折叠样式
      ======================================== */

/* 思考过程容器 */
.assistant-message .message-content details.thinking-process {
  background: rgba(16, 163, 127, 0.05);
  border: 1px solid rgba(16, 163, 127, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  transition: all 0.3s ease;
}

.assistant-message .message-content details.thinking-process:hover {
  background: rgba(16, 163, 127, 0.08);
  border-color: rgba(16, 163, 127, 0.3);
}

/* 思考过程标题 */
.assistant-message .message-content details.thinking-process summary {
  cursor: pointer;
  font-weight: 600;
  color: #10a37f;
  padding: 8px;
  border-radius: 4px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.assistant-message .message-content details.thinking-process summary:hover {
  background: rgba(16, 163, 127, 0.1);
}

/* 移除默认的三角标记 */
.assistant-message
  .message-content
  details.thinking-process
  summary::-webkit-details-marker {
  display: none;
}

.assistant-message .message-content details.thinking-process summary::marker {
  content: "";
}

/* 添加自定义展开/收起图标 */
.assistant-message .message-content details.thinking-process summary::before {
  content: "▶";
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.8em;
}

.assistant-message
  .message-content
  details.thinking-process[open]
  summary::before {
  transform: rotate(90deg);
}

/* 思考过程展开后的内容区留白 */
.assistant-message .message-content details.thinking-process .thinking-content {
  padding: 8px 4px 4px 4px;
}

/* 思考过程内容 */
.assistant-message .message-content details.thinking-process[open] {
  padding-bottom: 16px;
}

.assistant-message .message-content details.thinking-process > *:not(summary) {
  margin-top: 12px;
  padding: 0 4px;
  color: #555;
  font-size: 0.95em;
  line-height: 1.6;
}

/* 版权所有 */
.copyright-info {
  padding-bottom: 16px;
}
.copyright-info a,
.copyright-info span {
  font-size: 13px;
  color: #666666;
  text-decoration: none;
  font-family:
    "SUNSHINE-UCHEN", "阳光吾坚体", "Microsoft Himalaya", "Tibetan Machine Uni",
    "Kailasa", "Lohit Tibetan", sans-serif;
}

.copyright-info img {
  width: 11px;
  height: 11px;
  margin-right: 2px;
  margin-left: 4px;
}

#copyrightSection {
  margin-top: auto;
}

/* 聊天视图：底部依次为「版权（最底）→ AI 免责声明 → 输入框（整体上移）」 */
.chat-view #copyrightSection.copyright-info {
  margin-top: 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 2px 16px calc(4px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  pointer-events: none;
  /* 不透明底，与聊天区背景一致，遮住后方内容 */
  background-color: #faf9f5;
  background: #faf9f5;
}

.chat-view #copyrightSection.copyright-info a {
  pointer-events: auto;
}

body.theme-dark.chat-view #copyrightSection.copyright-info,
.theme-dark.chat-view #copyrightSection.copyright-info {
  background-color: var(--bg-primary, #1a1a1a);
  background: var(--bg-primary, #1a1a1a);
}

@media (min-width: 481px) {
  body.chat-view
    .sidebar.collapsed
    ~ .main-content
    #copyrightSection.copyright-info {
    left: 75px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body.chat-view
    .sidebar.expanded
    ~ .main-content
    #copyrightSection.copyright-info {
    left: 280px;
    right: 0;
    width: auto;
  }
}

@media (min-width: 769px) {
  body.chat-view
    .sidebar.expanded
    ~ .main-content
    #copyrightSection.copyright-info {
    left: 240px;
    right: 0;
    width: auto;
  }
}

/* ========== 全局确认弹窗（替代原生 confirm） ========== */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 16px;
  box-sizing: border-box;
}

.app-confirm-dialog {
  background: #ffffff;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.app-confirm-title {
  padding: 18px 20px 0;
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.app-confirm-message {
  padding: 12px 20px 20px;
  font-size: 15px;
  color: #4b5563;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
  flex-wrap: wrap;
}

.app-confirm-btn {
  min-width: 88px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  transition:
    filter 0.15s ease,
    background 0.15s ease;
}

.app-confirm-btn:hover {
  filter: brightness(0.97);
}

.app-confirm-btn-primary {
  background: #10a37f;
  border-color: #10a37f;
  color: #ffffff;
}

.app-confirm-btn-primary:hover {
  filter: brightness(1.05);
}

body.theme-dark .app-confirm-dialog,
.theme-dark .app-confirm-dialog {
  background: #252525;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.theme-dark .app-confirm-title,
.theme-dark .app-confirm-title {
  color: #f3f4f6;
}

body.theme-dark .app-confirm-message,
.theme-dark .app-confirm-message {
  color: #d1d5db;
}

body.theme-dark .app-confirm-btn,
.theme-dark .app-confirm-btn {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

body.theme-dark .app-confirm-btn-primary,
.theme-dark .app-confirm-btn-primary {
  background: #10a37f;
  border-color: #10a37f;
  color: #ffffff;
}
