    :root {
      --primary: #8B5CF6;          /* 主紫色 */
      --primary-dark: #6D28D9;      /* 深紫 */
      --primary-light: #EDE9FE;     /* 浅紫背景 */
      --primary-rgb: 139, 92, 246;
      --bg-light: #F9FAFB;          /* 页面背景 */
      --border-light: #E5E7EB;      /* 边框色 */
      --text-primary: #1F2937;      /* 主要文本 */
      --text-secondary: #4B5563;    /* 次要文本 */
      --text-muted: #9CA3AF;        /* 弱化文本 */
      --white: #FFFFFF;
      --gray-hover: #F3F4F6;        /* 悬浮背景 */
      --input-border: #D1D5DB;
      --success: #10B981;            /* 成功绿 */
      --warning: #F59E0B;
      --danger: #EF4444;
    }

    .temporarily-hidden-platform {
      display: none !important;
    }

    /* Hide internal scoring embedded in results saved by earlier releases. */
    details.query-path-quality {
      display: none !important;
    }

    /* 监控浮层样式 */
    .monitor-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 100;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .monitor-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 20px;
      background-color: var(--white);
      border-bottom: 1px solid var(--border-light);
    }
    .monitor-header h3 {
      font-weight: 600;
      color: var(--text-primary);
      font-size: 1rem;
      margin: 0;
    }
    .close-monitor {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 6px;
      transition: all 0.2s;
    }
    .close-monitor:hover {
      background-color: var(--gray-hover);
      color: var(--text-primary);
    }
    #monitor-iframe {
      flex: 1;
      width: 100%;
      border: none;
    }

    /* 监控按钮高亮样式 */
    #jiankong-list.active {
      background-color: var(--primary-light);
      border-left: 3px solid var(--primary);
    }

    /* Markdown样式 */
    .markdown-content {
      line-height: 1.6;
      color: var(--text-primary);
      background: transparent;
      padding: 0;
      border-radius: 0;
      font-family: inherit;
      font-size: 15px;
    }
    .markdown-content h1 {
      font-size: 1.2em;
      color: var(--text-primary);
      border-bottom: 1px solid var(--border-light);
      padding-bottom: 0.3em;
    }
    .markdown-content h2 {
      font-size: 1.1em;
      margin: 0.5em 0 0.5em 0;
      color: var(--text-secondary);
    }
    .markdown-content h3 {
      font-size: 1em;
      font-weight: 500;
      margin: 1em 0 0.5em 0;
      color: var(--text-secondary);
    }
    .markdown-content p {
      margin: 0.8em 0;
    }
    .markdown-content ul, .markdown-content ol {
      margin: 0.5em 0;
      padding-left: 1.5em;
    }
    .markdown-content li {
      margin: 0.4em 0;
    }
    .markdown-content strong {
      font-weight: 400;
      color: var(--primary);
    }
.markdown-content em {
      font-style: italic;
      color: var(--text-muted);
    }

    /* 基础样式 */
    body {
      transition: background-color 0.3s, color 0.3s;
      font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
      height: 100vh;
      overflow: hidden;
      margin: 0;
      padding: 0 !important;;
      background-color: var(--white) !important;;
      color: var(--text-primary);
    }

    /* 布局样式 */
    .content-wrapper {
      height: 100vh;
      display: flex;
    }

    .narrow-sidebar {
      width: 50px;
      background-color: var(--white);
      border-right: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
    }

    /* 消息样式 */
    .message-user {
      border-radius: 8px 8px 4px 8px;
      background: var(--gray-hover);
      color: var(--text-primary);
      max-width: 90%;
      margin-left: auto;
      position: relative;
      padding: 12px;
      margin-bottom: 16px;
      border: 1px solid var(--border-light);
        font-size: 14px;
    font-family: monospace;
    }

    .message-ai {
      border-radius: 8px 8px 8px 4px;
      background-color: var(--white);
      color: var(--text-primary);
      max-width: 90%;
      margin-right: auto;
      position: relative;
    }

    /* 输入区域样式 */
    .message-input-div {
      position: relative;
      box-sizing: border-box;
      height: 44px;
      min-height: 44px;
      min-width: 0;
      max-height: 120px;
      overflow-y: hidden;
      padding: 12px;
      border: none;
      border-radius: 7px 7px 0 0;
      font-size: 14px;
      background-color: transparent;
      outline: none;
      width: 100%;
    }
    .message-input-div:focus,
    .message-input-div:focus-visible {
      outline: none !important;
      border: none !important;
      box-shadow: none !important;
      --tw-ring-offset-shadow: 0 0 #0000 !important;
      --tw-ring-shadow: 0 0 #0000 !important;
    }
    .message-input-div[data-placeholder]:is(:empty, [data-empty="true"])::before {
      content: attr(data-placeholder);
      position: absolute;
      top: 8px;
      left: 12px;
      right: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--text-muted);
      pointer-events: none;
    }

    .models-container {
      position: absolute; 
      left: 10px;        
      bottom: 8px;    
      display: flex;
      gap: 8px;
      margin-top: 0;   
      padding: 0;      
      z-index: 10;     
    }

    /* Anchor the mode selector to the composer instead of normal page flow. */
    .composer-row > .models-container {
      position: absolute !important;
      top: auto !important;
      right: auto !important;
      left: 10px !important;
      bottom: 8px !important;
      align-self: auto !important;
      margin: 0 !important;
    }

    .model-tag {
      display: flex;
      align-items: center;
      background: var(--white);
      border-radius: 8px;
      padding: 0px 10px;
      cursor: pointer;
      transition: all 0.3s ease;
      border: 1px solid var(--input-border);
      color: var(--text-secondary);
      font-size: 12px;
      height: 28.5px;
    }
    .model-tag.active {
      border-color: var(--primary);
      color: var(--primary);
    }
    .model-tag.active .custom-icon {
      color: var(--primary);
    }
    
    /* 修复后的自定义图标样式 */
    .custom-icon {
      width: 20px;
      height: 20px;
      margin-right: 5px;
      transition: color 0.3s ease;
      color: currentColor;
    }

    .input-container {
      position: relative;
      margin: 5px auto 0px auto;
      max-width: 800px;
      width: calc(100% - 40px);
    }

    .composer-row {
      position: relative;
      overflow: visible;
      padding-bottom: 46px;
      border: 1px solid var(--input-border);
      border-radius: 8px;
      background-color: var(--white);
      box-sizing: border-box;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    /* Keep existing child positioning (notably the mode selector's absolute anchor). */
    .composer-row > * {
      z-index: 1;
    }

    .composer-row:focus-within {
      border-color: var(--primary);
      box-shadow: none;
    }

    .voice-hold-area {
      display: none;
    }

    .voice-hold-btn {
      flex: 1;
      min-width: 0;
      height: 52px;
      border: 1px solid #c4b5fd;
      border-radius: 12px;
      background: #fafaff;
      color: var(--text-primary);
      font-size: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }

    .voice-hold-btn i {
      color: var(--primary);
      font-size: 22px;
    }

    .voice-waveform {
      display: none;
      height: 30px;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 0 28px;
      border-radius: 14px;
      background: linear-gradient(180deg, rgba(139, 92, 246, 0.04), rgba(139, 92, 246, 0.12));
    }

    .voice-waveform i {
      display: block;
      width: 4px;
      height: 7px;
      border-radius: 999px;
      background: #8b5cf6;
      opacity: 0.72;
      transform-origin: center;
    }

    html.voice-recording .voice-waveform { display: flex; }
    html.voice-recording .voice-waveform i { animation: voice-wave 0.95s ease-in-out infinite alternate; }
    html.voice-recording .voice-waveform i:nth-child(2n) { animation-delay: -0.18s; }
    html.voice-recording .voice-waveform i:nth-child(3n) { animation-delay: -0.35s; }
    html.voice-recording .voice-waveform i:nth-child(4n) { animation-delay: -0.52s; }

    @keyframes voice-wave {
      from { height: 7px; opacity: 0.45; }
      to { height: 23px; opacity: 1; }
    }

    .voice-hold-btn.recording {
      position: relative;
      z-index: 1;
      color: var(--primary);
      border-color: var(--primary);
      background: #ffffff;
      box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.16);
    }

    html.voice-recording .composer-row::before {
      content: "";
      position: absolute;
      z-index: 0;
      inset: -12px -10px -14px;
      border-radius: 20px;
      pointer-events: none;
      background:
        radial-gradient(ellipse at 50% 100%, rgba(var(--primary-rgb), 0.34) 0%, rgba(var(--primary-rgb), 0.20) 38%, transparent 76%),
        radial-gradient(ellipse at 50% 0%, rgba(var(--primary-rgb), 0.16) 0%, transparent 66%),
        linear-gradient(180deg, color-mix(in srgb, var(--primary-light) 72%, white), color-mix(in srgb, var(--primary-light) 58%, white));
      filter: blur(10px);
      opacity: 0.92;
      animation: voice-doubao-glow 1.8s ease-in-out infinite;
    }

    html.voice-recording .composer-row {
      border-color: var(--primary);
      background: #f8fbff;
      background: color-mix(in srgb, var(--primary-light) 35%, white);
    }

    @keyframes voice-doubao-glow {
      0%, 100% { opacity: 0.58; transform: scaleX(0.96); }
      50% { opacity: 0.92; transform: scaleX(1.02); }
    }

    .keyboard-mode-btn {
      flex: 0 0 48px;
      width: 48px;
      height: 48px;
      margin-left: 8px;
      border: 1px solid var(--border-light);
      border-radius: 50%;
      background: var(--white);
      color: var(--text-primary);
      font-size: 20px;
    }

    .voice-session-controls {
      display: none;
    }

    html.voice-input-mode .message-input-div,
    html.voice-input-mode .models-container,
    html.voice-input-mode .composer-workspace-switch,
    html.voice-input-mode .send-button-container,
    html.voice-input-mode #voice-input-btn {
      display: none !important;
    }

    html.voice-input-mode .composer-row {
      min-height: 68px;
      padding: 8px !important;
    }

    html.voice-input-mode .voice-hold-area {
      position: absolute;
      inset: 8px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-end;
      gap: 8px;
    }

    .task-schedule-modal-card {
      width: min(250px, calc(100vw - 20px));
      max-width: calc(100vw - 20px);
      padding: 12px !important;
      box-sizing: border-box;
    }

    .task-time-picker {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
      align-items: center;
      gap: 6px;
      width: 100%;
      height: 176px;
      overflow: hidden;
      padding: 8px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      background: #f8fafc;
      box-sizing: border-box;
    }

    .task-time-group {
      min-width: 0;
      min-height: 0;
      height: 100%;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .task-time-label {
      color: #6b7280;
      font-size: 12px;
      line-height: 20px;
      text-align: center;
    }

    .task-time-column {
      min-width: 0;
      min-height: 0;
      height: 132px;
      max-height: 132px;
      flex: 0 0 132px;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: none;
      scroll-snap-type: y proximity;
      border-radius: 6px;
      background: #fff;
    }

    .task-time-column::-webkit-scrollbar {
      display: none;
    }

    .task-time-option {
      width: 100%;
      min-height: 38px;
      display: block;
      border: 0;
      border-radius: 4px;
      background: transparent;
      color: #4b5563;
      font-size: 17px;
      line-height: 38px;
      text-align: center;
      scroll-snap-align: center;
    }

    .task-time-option.active {
      background: #ede9fe;
      color: #6d28d9;
      font-weight: 650;
    }

    .task-time-separator {
      color: #6b7280;
      font-size: 22px;
      line-height: 1;
      text-align: center;
    }

    .task-schedule-modal-card .mt-4 {
      gap: 8px;
    }

    .task-schedule-modal-card .mt-4 button {
      flex: 1 1 0;
      min-width: 0;
      white-space: nowrap;
      padding-left: 10px;
      padding-right: 10px;
    }

    .composer-workspace-switch {
      position: absolute;
      right: 80px;
      bottom: 4px;
      width: auto;
      height: 32px;
      box-sizing: border-box;
      z-index: 12;
    }

    .composer-workspace-switch__trigger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-width: 78px;
      height: 32px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #5e576c;
      font-size: 13px;
      line-height: 1;
      letter-spacing: 0;
      white-space: nowrap;
      cursor: pointer;
      transition: background-color 0.16s ease;
    }

    .welcome-mode-label {
      font-weight: 700;
      letter-spacing: 0;
    }

    .welcome-mode-label--work {
      color: #176b5b;
    }

    .welcome-mode-label--development {
      color: #6d4bd8;
    }

    .composer-workspace-switch__trigger:hover,
    .composer-workspace-switch__trigger[aria-expanded="true"] {
      background: #f3f4f6;
    }

    .composer-workspace-switch__trigger > i:first-child {
      width: 16px;
      color: #5e576c;
      font-size: 14px;
      text-align: center;
    }

    .composer-workspace-switch__chevron {
      margin-left: 1px;
      color: #5e576c;
      font-size: 9px;
      transition: transform 0.16s ease;
    }

    .composer-workspace-switch__trigger[aria-expanded="true"] .composer-workspace-switch__chevron {
      transform: rotate(180deg);
    }

    .composer-workspace-switch__menu {
      position: absolute;
      right: 0;
      bottom: calc(100% + 6px);
      display: grid;
      gap: 2px;
      min-width: 112px;
      padding: 4px;
      border: 0;
      border-radius: 6px;
      background: #fff;
      box-shadow: 0 8px 24px rgb(15 23 42 / 14%);
    }

    .composer-workspace-switch__menu[hidden] {
      display: none;
    }

    .composer-workspace-switch__option {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      height: 32px;
      padding: 0 9px;
      border: 0;
      border-radius: 4px;
      background: transparent;
      color: var(--text-primary);
      font-size: 13px;
      font-weight: 400;
      line-height: 32px;
      letter-spacing: 0;
      white-space: nowrap;
      cursor: pointer;
      transition: background-color 0.16s ease;
    }

    .composer-workspace-switch__option.is-active {
      background: transparent;
      font-weight: 600;
    }

    .composer-workspace-switch__option:hover,
    .composer-workspace-switch__option:focus-visible {
      background: #f3f4f6;
    }

    .composer-workspace-switch__option:focus-visible {
      outline: none;
    }

    .composer-workspace-switch__option:disabled {
      cursor: default;
      opacity: 0.6;
    }

    .send-button-container {
      position: absolute;
      right: 10px;
      bottom: 5px;
    }

    .send-button {
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 50%;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .send-button:hover {
      background: var(--primary-dark);
    }

    .chat-header {
      padding: 5px 20px;
      background-color: var(--white);
      display: flex;
      align-items: center;
      position: relative;
      z-index: 60;
      height: 50px;
      border-bottom: 1px solid var(--border-light);
    }

    .chat-header .flex.items-center.space-x-4 {
      position: absolute;
      right: 20px;
      top: 50%;
      transform: translateY(-50%);
    }

    .chat-header #current-chat-title {
      flex-grow: 1;
      text-align: center;
    }

/* 标题自动省略 */
#current-chat-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;           /* 允许 flex 子元素收缩到比内容更小 */
  margin-right: 48px;    /* 保持原有右侧间距 */
}

.knowledge-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0;
}
.knowledge-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: var(--white);
  font-family: inherit;
  font-size: 14px;
}
.knowledge-table th,
.knowledge-table td {
  border: 1px solid var(--border-light);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.knowledge-table th {
  background: var(--bg-light);
  font-weight: 600;
}
.compact-result-table td:first-child {
  width: 42%;
  color: var(--text-secondary);
  font-weight: 600;
}


    .logo-container {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 10px auto 15px;
    }

    .logo-container i {
      color: white;
      font-size: 20px;
    }

    /* 侧边栏菜单样式 */
    .menu-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
      transition: all 0.2s ease;
      justify-content: center;
      text-align: center;
    }

    .menu-item:hover {
      background-color: var(--gray-hover);
    }
    .menu-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 5px;
    }

    /* Dark sidebar themes need white menu glyphs for contrast. The brand logo
       and new-chat button sit outside .sidebar-menu and remain unchanged. */
    html[data-sidebar-contrast="light"] .narrow-sidebar > .sidebar-primary > .sidebar-menu img {
      filter: brightness(0) invert(1);
    }

    .menu-text {
      display: none;
      font-size: 11px;
      color: var(--text-secondary);
      line-height: 1.2;
    }

    /* 聊天项样式 */
    .chat-item {
      position: relative;
      padding: 10px 15px 10px 40px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .chat-item:hover {
      background-color: var(--gray-hover);
    }

    .chat-item.active {
      background-color: var(--primary-light);
      border-left: 3px solid var(--primary);
    }

    .chat-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
    }

    .chat-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 25px;
    }

    .chat-preview {
      font-size: 12px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .delete-chat {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      border-radius: 4px;
      opacity: 0;
      transition: all 0.2s ease;
    }

    .chat-item:hover .delete-chat {
      opacity: 1;
    }

    .delete-chat:hover {
      color: var(--danger);
      background-color: rgba(239, 68, 68, 0.1);
    }

    /* 文件上传样式 */
    .file-upload {
      display: none;
    }

    /* 添加隐藏类 */
    .hidden {
      display: none !important;
    }

    /* 输入区域包装器样式 */
    .bg-white.border-t.border-gray-300 {
      display: flex;
      justify-content: center;
      padding: 0;
    }

    .file-list {
      max-width: 800px;
      margin: 0 auto;
      justify-content: flex-start;
      left: 0;
      right: 0;
    }

    .file-item {
      display: flex;
      align-items: center;
      background-color: var(--gray-hover);
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 12px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .remove-file {
      margin-left: 5px;
      cursor: pointer;
      color: var(--text-muted);
    }

    .workflow-agent-form-wrapper {
      width: min(720px, 100%);
      margin: 8px auto 16px;
    }

    .workflow-agent-form {
      padding: 18px;
      border: 1px solid var(--input-border);
      border-radius: 8px;
      background: var(--white);
      box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
    }

    .workflow-agent-form-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
    }

    .workflow-agent-form-icon {
      display: grid;
      width: 42px;
      height: 42px;
      flex: 0 0 42px;
      place-items: center;
      overflow: hidden;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      background: #f8fafc;
      color: var(--primary);
      font-size: 18px;
    }

    .workflow-agent-form-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .workflow-agent-form-header h3 {
      margin: 0;
      color: var(--text-primary);
      font-size: 16px;
      font-weight: 600;
    }

    .workflow-agent-form-header p,
    .workflow-agent-form-description {
      margin: 2px 0 0;
      color: var(--text-muted);
      font-size: 12px;
    }

    .workflow-agent-form-description {
      margin-bottom: 14px;
      line-height: 1.6;
    }

    .workflow-agent-field {
      display: flex;
      flex-direction: column;
      gap: 7px;
      margin-top: 12px;
    }

    .workflow-agent-field > span {
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 600;
    }

    .workflow-agent-field textarea,
    .workflow-agent-field input[type="url"] {
      width: 100%;
      border: 1px solid var(--input-border);
      border-radius: 6px;
      background: var(--white);
      color: var(--text-primary);
      font-size: 14px;
      outline: none;
    }

    .workflow-agent-field textarea {
      min-height: 84px;
      resize: vertical;
      padding: 10px 12px;
    }

    .workflow-agent-field input[type="url"] {
      height: 40px;
      padding: 0 12px;
    }

    .workflow-agent-field textarea:focus,
    .workflow-agent-field input[type="url"]:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
    }

    .workflow-agent-dropzone {
      display: flex;
      min-height: 112px;
      width: 100%;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      border: 1px dashed #cbd5e1;
      border-radius: 7px;
      background: #f8fafc;
      color: var(--text-secondary);
      cursor: pointer;
      transition: border-color 0.2s ease, background-color 0.2s ease;
    }

    .workflow-agent-dropzone > i {
      color: var(--primary);
      font-size: 22px;
    }

    .workflow-agent-dropzone strong {
      font-size: 14px;
      font-weight: 600;
    }

    .workflow-agent-dropzone small {
      color: var(--text-muted);
      font-size: 12px;
    }

    .workflow-agent-dropzone:hover,
    .workflow-agent-dropzone.dragging {
      border-color: var(--primary);
      background: rgba(var(--primary-rgb), 0.06);
    }

    .workflow-agent-file-list {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
    }

    .workflow-agent-file-item {
      position: relative;
      display: block;
      width: 92px;
      height: 72px;
      flex: 0 0 92px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      background: #fff;
      color: var(--text-secondary);
      font-size: 12px;
    }

    .workflow-agent-file-item .workflow-source-button.compact {
      display: grid;
      width: 100%;
      height: 100%;
      padding: 0;
      place-items: center;
      border: 0;
      border-radius: 8px;
      background: transparent;
    }

    .workflow-agent-file-item .workflow-source-button.compact:hover {
      border: 0;
      background: rgba(var(--primary-rgb), 0.06);
    }

    .workflow-source-thumbnail {
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 7px;
      object-fit: cover;
    }

    .workflow-source-file-icon {
      color: var(--primary);
      font-size: 27px;
      line-height: 1;
    }

    .workflow-source-file-type {
      position: absolute;
      right: 5px;
      bottom: 4px;
      max-width: calc(100% - 10px);
      overflow: hidden;
      color: var(--text-secondary);
      font-size: 9px;
      font-weight: 700;
      line-height: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .workflow-agent-file-item > button[aria-label^="移除"] {
      display: grid;
      position: absolute;
      z-index: 2;
      top: -7px;
      right: -7px;
      width: 22px;
      height: 22px;
      flex: 0 0 22px;
      place-items: center;
      border: 2px solid #fff;
      border-radius: 50%;
      background: #111827;
      color: #fff;
      font-size: 11px;
      cursor: pointer;
    }

    .workflow-agent-file-item > button[aria-label^="移除"]:hover {
      background: #000;
      color: #fff;
    }

    .workflow-source-button {
      display: inline-flex;
      min-width: 0;
      max-width: 100%;
      align-items: center;
      gap: 7px;
      padding: 7px 9px;
      border: 1px solid #dbe1ea;
      border-radius: 5px;
      background: transparent;
      color: #374151;
      font-size: 12px;
      text-align: left;
      cursor: pointer;
    }
    .workflow-source-button:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: rgba(var(--primary-rgb), 0.04);
    }
    .workflow-source-button > span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .workflow-source-button.compact {
      flex: 1 1 auto;
      padding: 2px 0;
      border: 0;
      background: transparent;
    }
    .workflow-result-sources {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid #e5e7eb;
    }
    .workflow-result-sources > span {
      display: block;
      margin-bottom: 7px;
      color: #6b7280;
      font-size: 12px;
    }
    .workflow-result-source-list {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }
    .workflow-source-preview-overlay {
      position: fixed;
      z-index: 10000;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(17, 24, 39, 0.52);
    }
    .workflow-source-preview {
      display: flex;
      width: min(1080px, 94vw);
      height: min(820px, 88vh);
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #dbe1ea;
      border-radius: 6px;
      background: #fff;
      box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
    }
    .workflow-source-preview > header {
      display: flex;
      min-height: 52px;
      flex: 0 0 auto;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 12px 8px 16px;
      border-bottom: 1px solid #e5e7eb;
    }
    .workflow-source-preview > header > strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .workflow-source-preview > header > div { display: flex; gap: 4px; }
    .workflow-source-icon-button {
      display: grid;
      width: 36px;
      height: 36px;
      place-items: center;
      border: 0;
      border-radius: 4px;
      background: transparent;
      color: #4b5563;
      text-decoration: none;
      cursor: pointer;
    }
    .workflow-source-icon-button:hover { background: #f3f4f6; color: #111827; }
    .workflow-source-preview-body {
      display: grid;
      min-height: 0;
      flex: 1 1 auto;
      place-items: center;
      overflow: auto;
      background: #f8fafc;
    }
    .workflow-source-preview-body > img {
      display: block;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }
    .workflow-source-preview-body > iframe {
      width: 100%;
      height: 100%;
      border: 0;
      background: #fff;
    }
    .workflow-source-preview-body > pre {
      width: 100%;
      min-height: 100%;
      margin: 0;
      padding: 18px;
      overflow: auto;
      background: #fff;
      color: #1f2937;
      font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .workflow-source-preview-fallback {
      display: grid;
      max-width: 420px;
      place-items: center;
      gap: 10px;
      padding: 28px;
      color: #6b7280;
      text-align: center;
    }
    .workflow-source-preview-fallback > i { color: var(--primary); font-size: 36px; }
    .workflow-source-preview-fallback > strong { color: #1f2937; }

    .workflow-agent-form-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 16px;
    }

    .workflow-agent-form-actions > span {
      color: var(--text-muted);
      font-size: 12px;
    }

    .agent-browser-action-plan {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid rgba(var(--primary-rgb), 0.24);
      border-radius: 6px;
      background: rgba(var(--primary-rgb), 0.06);
    }
    .agent-browser-action-title {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--text-primary);
      font-size: 14px;
    }
    .agent-browser-action-title i { color: var(--primary); }
    .agent-browser-action-plan ul {
      margin: 8px 0;
      padding-left: 20px;
      color: var(--text-secondary);
      font-size: 13px;
    }
    .agent-browser-apply-btn,
    .agent-feedback-form button {
      border: 0;
      border-radius: 6px;
      padding: 8px 12px;
      color: #fff;
      background: var(--primary);
      cursor: pointer;
    }
    .agent-browser-apply-btn:hover,
    .agent-feedback-form button:hover { background: var(--primary-dark); }
    .agent-form-result-summary {
      margin: 0 0 8px;
      color: var(--text-secondary);
      font-size: 13px;
    }
    .agent-form-result-fields {
      display: grid;
      gap: 1px;
      margin: 0;
      overflow: hidden;
      border: 1px solid var(--border-light);
      border-radius: 6px;
      background: var(--border-light);
    }
    .agent-form-result-fields > div {
      display: grid;
      grid-template-columns: minmax(100px, 0.42fr) minmax(0, 1fr);
      gap: 12px;
      padding: 9px 11px;
      background: var(--surface);
    }
    .agent-form-result-fields dt { color: var(--text-secondary); font-size: 12px; }
    .agent-form-result-fields dd { margin: 0; color: var(--text-primary); font-size: 13px; overflow-wrap: anywhere; }
    .agent-artifact-download {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      margin-top: 12px;
      padding: 8px 12px;
      border: 1px solid rgba(var(--primary-rgb), 0.3);
      border-radius: 6px;
      color: var(--primary);
      text-decoration: none;
      font-size: 13px;
      font-weight: 600;
    }
.agent-api-result {
      margin-top: 12px;
      overflow: hidden;
      border: 1px solid #bbf7d0;
      border-radius: 6px;
      background: transparent;
    }
    .agent-api-result:has(.fa-circle-xmark) {
      border-color: #fecaca;
    }
    .agent-api-result:has(.fa-circle-xmark) .agent-api-result-header { color: #991b1b; }
    .agent-api-result-header {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 8px 0;
      color: #166534;
      font-size: 13px;
    }
    .agent-api-result-header span {
      margin-left: auto;
      font-size: 12px;
    }
    .agent-api-result pre {
      max-height: 180px;
      margin: 0;
      overflow: auto;
      border-top: 1px solid #dcfce7;
      padding: 8px 0;
      background: transparent;
      color: var(--text-secondary);
      font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    .agent-feedback {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid var(--border-light);
      color: var(--text-secondary);
      font-size: 12px;
    }
    .agent-feedback > button {
      border: 1px solid var(--border-light);
      border-radius: 6px;
      background: var(--white);
      color: var(--text-secondary);
      padding: 6px 9px;
      cursor: pointer;
    }
    .agent-feedback > button:hover { border-color: var(--primary); color: var(--primary); }
    .agent-feedback-form {
      flex: 1 0 100%;
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 8px;
    }
    .agent-feedback-form textarea {
      min-height: 68px;
      resize: vertical;
      border: 1px solid var(--input-border);
      border-radius: 6px;
      padding: 8px;
      outline: none;
    }
    .agent-feedback-form textarea:focus { border-color: var(--primary); }

    @media (max-width: 640px) {
      .agent-feedback-form { grid-template-columns: 1fr; }
      .agent-feedback-form button { width: 100%; }
      .agent-feedback { display: none !important; }
    }

    .workflow-agent-submit {
      display: inline-flex;
      min-width: 116px;
      height: 40px;
      align-items: center;
      justify-content: center;
      gap: 7px;
      border: 0;
      border-radius: 6px;
      background: var(--primary);
      color: #fff;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
    }

    .workflow-agent-submit:disabled {
      cursor: wait;
      opacity: 0.65;
    }

    .message-input-div.workflow-agent-locked {
      cursor: pointer;
      background: #f3f4f6;
      color: var(--text-secondary);
    }

    html.workflow-agent-active .composer-workspace-switch,
    html.workflow-agent-active #voice-input-btn,
    html.workflow-agent-active .send-button-container {
      opacity: 0.35;
      pointer-events: none;
    }

    @media (max-width: 640px) {
      .workflow-agent-form-wrapper {
        width: 100%;
        margin-top: 4px;
      }

      .workflow-agent-form {
        padding: 14px;
      }

      .workflow-agent-form-actions {
        align-items: stretch;
        flex-direction: column;
      }

      .workflow-agent-submit {
        width: 100%;
      }
    }

    .remove-file:hover {
      color: var(--danger);
    }

    /* 动画效果 */
    .typing-indicator {
      display: inline-flex;
      align-items: center;
    }

    .typing-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background-color: var(--text-secondary);
      margin: 0 3px;
      opacity: 0.6;
      animation: typing-animation 1.4s infinite ease-in-out;
    }

    .typing-dot:nth-child(1) {
      animation-delay: 0s;
    }
    .typing-dot:nth-child(2) {
      animation-delay: 0.2s;
    }
    .typing-dot:nth-child(3) {
      animation-delay: 0.4s;
    }

    @keyframes typing-animation {
      0%,
      60%,
      100% {
        transform: translateY(0);
        opacity: 0.6;
      }
      30% {
        transform: translateY(-10px);
        opacity: 1;
      }
    }

    .fade-in {
      animation: fadeIn 0.3s ease-in-out;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* 滚动条样式 */
    .custom-scrollbar::-webkit-scrollbar {
      width: 6px;
    }

    .custom-scrollbar::-webkit-scrollbar-track {
      background: transparent;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb {
      background: var(--text-muted);
      border-radius: 3px;
    }

    /* 右侧面板样式 */
    .right-panel-container {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .main-content {
      display: flex;
      flex-direction: column;
      flex: 1 1 100%;
      transition: flex-basis 0.18s ease;
      min-width: 0;
    }

    .main-content.narrow {
      flex: 1 1 auto;
    }

    .right-panel-resizer {
      display: none;
      position: relative;
      flex: 0 0 2px;
      cursor: col-resize;
      touch-action: none;
      outline: none;
      z-index: 2;
      opacity: 0;
      transition: opacity 0.15s ease;
    }

    .right-panel-resizer.active {
      display: block;
    }

    .right-panel-resizer.active:hover,
    .right-panel-resizer.active:focus-visible,
    .right-panel-resizer.active.dragging {
      opacity: 1;
    }

    .right-panel-resizer::before {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 2px;
      background: var(--border-light);
      transition: background-color 0.15s ease, width 0.15s ease;
    }

    .right-panel-resizer:hover::before,
    .right-panel-resizer:focus-visible::before,
    .right-panel-resizer.dragging::before {
      width: 3px;
      background: var(--primary);
    }

    body.resizing-right-panel {
      cursor: col-resize;
      user-select: none;
    }

    body.resizing-right-panel iframe {
      pointer-events: none;
    }

    body.resizing-right-panel .main-content,
    body.resizing-right-panel .right-panel {
      transition: none;
    }

    .right-panel {
      flex: 0 0 0%;
      background-color: var(--white);
      border-left: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
      transition: flex-basis 0.18s ease, opacity 0.12s ease;
      opacity: 0;
      overflow: hidden;
      min-width: 0;
    }

    .right-panel.active {
      flex: 0 0 calc(70% - 4px);
      opacity: 1;
      min-width: 320px;
      border-radius: 8px;
      box-sizing: border-box;
    }

    /* Maximize the result workspace inside the app chrome. */
    .right-panel.expanded {
      position: relative;
      flex: 1 1 100% !important;
      width: 100% !important;
      max-width: none !important;
      min-width: 0 !important;
      height: 100% !important;
      border-left: 0;
      border-radius: 8px;
      box-shadow: none;
    }

    .right-panel-container.panel-workspace-maximized .main-content,
    .right-panel-container.panel-workspace-maximized .right-panel-resizer {
      display: none !important;
    }

    .right-panel.active + .main-content {
      flex: 1 1 30%;
    }

    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 20px;
    }

    .panel-content {
      flex: 1;
      min-width: 0;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      contain: layout paint;
    }

    .iframe-container,
    .cached-panel-frame {
      display: flex;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
    }

    .panel-content iframe {
      display: block;
      flex: 1 1 auto;
      width: 100%;
      min-width: 0;
      height: 100%;
      border: none;
    }

    .close-panel {
      cursor: pointer;
      color: var(--text-secondary);
    }
    .close-panel:hover {
      color: var(--text-primary);
    }

    /* 欢迎页面样式 */
    .welcome-container {
      max-width: 800px;
      margin: 0 auto;
      text-align: center;
      padding-top: 2rem;
    }

    /* 修改聊天容器样式 */
    #chat-container {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
      overflow-x: clip;
    }

    /* 聊天消息容器 - 限制最大宽度 */
    .chat-messages-wrapper {
      max-width: 800px;
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* 调整消息气泡的最大宽度 */
    .message-user {
      max-width: 100%;
      width: fit-content;
    }

    .message-ai {
      max-width: 100%;
    }

    /* 确保欢迎页面也居中 */
    #welcome-page {
      flex: 1;
      overflow-y: auto;
      display: flex;
      justify-content: center;
    }

    .welcome-container {
      max-width: 800px;
      width: 100%;
      text-align: center;
      padding-top: 2rem;
    }

    /* 模态框样式 */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }

    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .modal-content {
      background-color: var(--white);
      border-radius: 8px;
      width: 90%;
      max-width: 500px;
      transform: translateY(20px);
      transition: transform 0.3s ease;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    .modal-overlay.active .modal-content {
      transform: translateY(0);
    }

    /* 其他样式 */
    .sql-result {
      background-color: var(--gray-hover);
      padding: 10px;
      border-radius: 4px;
      margin-top: 10px;
      font-family: monospace;
      font-size: 14px;
      overflow-x: auto;
      border: 1px solid var(--border-light);
    }

.table-result {
    border-radius: 0.25rem;
    overflow: hidden;  /* 让圆角生效 */
    border: 0;
    margin: 8px 0 0;
}

.agent-api-result-error {
    color: #b91c1c;
    margin-left: 8px;
    overflow-wrap: anywhere;
}

.agent-workflow-result {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.agent-result-wrapper,
.agent-result-message {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.agent-run-message {
    color: var(--text-primary);
}
.agent-mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 8px;
    background: #f1f1fb;
    color: #161419;
    font-size: 14px;
    font-weight: 500;
}
.expert-stream-container.agent-stream-container {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}
.agent-run-status {
    margin-top: 8px;
    color: #4b5563;
    font-size: 13px;
}
.agent-run-status.failed { color: #b91c1c; }
.expert-progress-line {
    position: relative;
    padding: 3px 0 3px 18px;
    color: #4b5563;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.55;
}
.expert-progress-line::before {
    position: absolute;
    top: 10px;
    left: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    content: "";
}
.expert-progress-line.step { color: #1f2937; font-weight: 550; }
.expert-progress-line.step::before { background: #7c3aed; }
.expert-progress-line.complete { color: #166534; }
.expert-progress-line.complete::before { background: #16a34a; }
.expert-progress-line.warning { color: #92400e; }
.expert-progress-line.warning::before { background: #f59e0b; }
.expert-progress-line.error { color: #b91c1c; }
.expert-progress-line.error::before { background: #dc2626; }
.agent-result-action-card {
    margin-top: 8px;
    padding: 0;
    border-radius: 8px;
    background: #f8f9fc;
}
.expert-link-btn.agent-result-view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    text-align: left;
}
.agent-result-panel-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fff;
}
.agent-result-panel-view > .agent-api-result {
    flex: 0 0 auto;
    margin: 12px 16px 0;
}
.agent-result-panel-frame {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
}
@media (max-width: 640px) {
    .expert-stream-container.agent-stream-container { max-height: 260px; padding: 12px; font-size: 12px; }
    .agent-result-panel-view > .agent-api-result { margin: 8px 10px 0; }
    .workflow-source-preview-overlay { padding: 8px; }
    .workflow-source-preview { width: 100%; height: 92vh; }
}
.table-result table {
    width: 100%;
    border-collapse: collapse;
}
.table-result th,
.table-result td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.table-result tr:last-child td {
    border-bottom: none;
}

.chart-result {
    border-radius: 0.25rem;
    padding: 16px;
    background-color: var(--bg-light);
}
.view-data-btn {
    border-radius: 20px;  /* 更圆的按钮 */
    padding: 6px 14px;
    font-size: 13px;
    background-color: var(--primary);
    color: white;
    border: none;
    transition: opacity 0.2s;
}
.view-data-btn:hover {
    opacity: 0.9;
}
    /* 消息操作按钮 - 已移除满意/不满意和深度分析，但保留样式以防万一 */
    .message-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      visibility: hidden;
      height: 0px;
    }

    /* 复制按钮栏样式 */
    .copy-buttons-bar {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 12px;
    }
    .copy-btn {
      padding: 4px 12px;
      border-radius: 16px;
      border: 1px solid var(--border-light);
      background: var(--white);
      cursor: pointer;
      font-size: 12px;
      transition: all 0.2s ease;
    }
    .copy-btn:hover {
      background-color: var(--gray-hover);
      border-color: var(--primary);
      color: var(--primary);
    }
    .kb-source-btn {
      max-width: min(360px, 100%);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--text-muted);
    }

    .share-modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 12000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(15, 23, 42, 0.45);
    }
    .share-modal {
      width: min(420px, 100%);
      padding: 20px;
      border: 1px solid var(--border-light);
      border-radius: 8px;
      background: var(--white);
      box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    }
    .share-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .share-modal-header h3 {
      margin: 0;
      color: var(--text-primary);
      font-size: 16px;
      font-weight: 600;
    }
    .share-modal-close {
      width: 32px;
      height: 32px;
      border: 0;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
    }
    .share-modal-hint {
      margin: 10px 0 16px;
      color: var(--text-muted);
      font-size: 12px;
      line-height: 1.6;
    }
    .share-platform-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
      gap: 10px;
    }
    .share-platform-option {
      min-width: 0;
      min-height: 78px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: 1px solid var(--border-light);
      border-radius: 8px;
      background: var(--white);
      color: var(--text-primary);
      cursor: pointer;
    }
    .share-platform-option:hover {
      border-color: var(--primary);
      background: var(--gray-hover);
    }
    .share-platform-option i { font-size: 22px; }
    .share-platform-option span { font-size: 12px; }
    .share-platform-option.wechat i { color: #07c160; }
    .share-platform-option.dingtalk i { color: #1677ff; }
    .share-platform-option.feishu i { color: #3370ff; }
    .share-platform-option.copy i { color: #475569; }

    .wechat-share-modal { width: min(390px, 100%); }
    .wechat-share-modal .share-modal-header h3 i { margin-right: 6px; color: #07c160; }
    .wechat-qr-wrap {
      position: relative;
      display: grid;
      width: 208px;
      min-height: 208px;
      margin: 0 auto 14px;
      padding: 12px;
      place-items: center;
      border: 1px solid var(--border-light);
      border-radius: 8px;
      background: #fff;
    }
    .wechat-qr-code { display: block; width: 184px; height: 184px; }
    .wechat-qr-code canvas,
    .wechat-qr-code img { display: block; width: 184px !important; height: 184px !important; }
    .wechat-qr-loading { color: var(--text-muted); font-size: 12px; text-align: center; }
    .wechat-share-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
    .wechat-share-actions .action-button {
      display: inline-flex;
      min-height: 40px;
      padding: 0 14px;
      align-items: center;
      justify-content: center;
      gap: 7px;
      border: 1px solid var(--border-light);
      border-radius: 6px;
      color: var(--text-primary);
      background: #fff;
      cursor: pointer;
    }
    .wechat-share-actions .action-button.primary { border-color: #07c160; color: #fff; background: #07c160; }
    .wechat-share-actions .action-button.primary:hover { background: #06ad56; }
    @media (max-width: 640px) {
      .share-modal-overlay { padding: 14px; align-items: flex-end; }
      .share-modal { padding: 18px 16px; }
      .share-platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .wechat-share-actions { display: grid; grid-template-columns: 1fr 1fr; }
      .wechat-share-actions .action-button { width: 100%; padding: 0 8px; }
    }

    .ontology-more-btn[disabled] { cursor: wait; opacity: 0.7; }
    .ontology-modal { max-height: min(680px, 90vh); overflow-y: auto; }
    .ontology-modal .share-modal-header {
      position: relative;
      justify-content: center;
      min-height: 32px;
      padding: 0 40px;
    }
    .ontology-modal .share-modal-header h3 { text-align: center; }
    .ontology-modal .share-modal-close {
      position: absolute;
      top: 50%;
      right: 0;
      transform: translateY(-50%);
    }
    .ontology-suggestion-groups { display: grid; gap: 16px; }
    .ontology-suggestion-group { display: grid; gap: 8px; }
    .ontology-suggestion-group h4 {
      display: flex;
      align-items: center;
      gap: 7px;
      margin: 0;
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 600;
    }
    .ontology-suggestion-group h4 i { color: var(--primary); }
    .ontology-suggestion-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 0 0 12px;
      color: var(--text-muted);
      font-size: 12px;
    }
    .ontology-refresh-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-width: 92px;
      min-height: 34px;
      padding: 7px 12px;
      border: 1px solid var(--primary);
      border-radius: 7px;
      background: var(--white);
      color: var(--primary);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .ontology-refresh-btn:hover { background: var(--gray-hover); }
    .ontology-refresh-btn:disabled { cursor: wait; opacity: 0.6; }
    .ontology-suggestion-list { display: grid; gap: 10px; }
    .ontology-suggestion-card {
      display: flex;
      flex-direction: column;
      gap: 5px;
      width: 100%;
      padding: 12px 14px;
      border: 1px solid var(--border-light);
      border-radius: 8px;
      background: var(--white);
      color: var(--text-primary);
      text-align: left;
      cursor: pointer;
    }
    .ontology-suggestion-card:hover { border-color: var(--primary); background: var(--gray-hover); }
    .ontology-suggestion-card strong { font-size: 14px; font-weight: 600; }
    .ontology-suggestion-card > span { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
    .ontology-suggestion-card small { color: var(--text-muted); font-size: 11px; }
    .ontology-suggestion-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }
    .ontology-suggestion-meta span { color: inherit; font-size: inherit; }
    .ontology-suggestion-source { font-weight: 600; }
    .ontology-empty { margin: 0; color: var(--text-muted); font-size: 13px; text-align: center; }

    @media (max-width: 480px) {
      .share-modal-overlay {
        align-items: flex-end;
        padding: 0;
      }
      .share-modal {
        width: 100%;
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        border-width: 1px 0 0;
        border-radius: 8px 8px 0 0;
      }
    }

    /* 新建聊天按钮样式 */
    .new-chat-btn {
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 15px 5px;
    }

    .new-chat-btn i {
      margin-right: 0;
    }

.new-chat-btn span {
      display: block;
    }

/* Query-result monitoring dialog. */
.query-monitor-popover { position: fixed; z-index: 10040; box-sizing: border-box; width: min(250px, calc(100vw - 20px)); overflow: visible; padding: 0; border: 1px solid #d7dce2; border-radius: 8px; background: #fff; box-shadow: 0 14px 36px rgba(15,23,42,.2); }
.query-monitor-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #e2e8f0; }
.query-monitor-header h3 { margin: 0; color: #172033; font-size: 15px; }
.query-monitor-close { width: 28px; height: 28px; border: 0; background: transparent; color: #64748b; cursor: pointer; }
.query-monitor-form { display: flex; flex-direction: column; }
.query-monitor-schedule { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 7px; padding: 12px; color: #334155; font-size: 12px; font-weight: 650; }
.query-monitor-schedule select { width: 100%; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: #1e293b; font-size: 12px; }
.organization-collaborator-picker { position: relative; margin: 0 12px 13px; }
.organization-collaborator-trigger { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: #334155; text-align: left; cursor: pointer; }
.organization-collaborator-trigger::after { content: "\f078"; float: right; margin-top: 2px; font: 900 12px/1 "Font Awesome 6 Free"; color: #64748b; }
.organization-collaborator-menu { position: absolute; z-index: 2; top: calc(100% + 5px); left: 0; right: 0; max-height: 184px; overflow: auto; padding: 6px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.16); color: #64748b; font-size: 12px; }
.organization-collaborator-option { display: flex; min-height: 34px; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 4px; color: #1e293b; cursor: pointer; }
.organization-collaborator-option:hover { background: #f1f5f9; }
.organization-collaborator-option input { width: 16px; height: 16px; accent-color: #111827; }
.organization-collaborator-empty { display: block; padding: 8px; text-align: center; }
.task-schedule-modal-card > .organization-collaborator-picker { margin: 16px 0 0; }
.query-monitor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 9px 12px; border-top: 1px solid #e2e8f0; }
.query-monitor-actions button { min-width: 0; min-height: 32px; padding: 0 5px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: #334155; font-size: 11px; white-space: nowrap; cursor: pointer; }
.query-monitor-actions button.primary { border-color: #111827; background: #111827; color: #fff; }
.query-monitor-actions button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 680px) { .query-monitor-popover { width: min(250px, calc(100vw - 20px)); } }
.business-action__comparison { margin-top: 10px; border-top: 1px solid #e2e8f0; }
.business-action__comparison-row { display: grid; grid-template-columns: minmax(100px, 1.2fr) repeat(2, minmax(0, 1fr)); border-bottom: 1px solid #e2e8f0; }
.business-action__comparison-row > * { min-width: 0; padding: 9px 10px; overflow-wrap: anywhere; }
.business-action__comparison-row > * + * { border-left: 1px solid #edf0f4; }
.business-action__comparison-row.is-header { background: #f8fafc; color: #64748b; font-size: 11px; font-weight: 650; }
.business-action__comparison-row strong { color: #334155; font-size: 12px; font-weight: 650; }
.business-action__comparison-row:not(.is-header) span { color: #172033; font-size: 13px; }
.business-action__comparison-current.is-changed { background: #fff1f2; color: #dc2626 !important; font-weight: 700; }
.business-action__next-run { align-self: center; color: #64748b; font-size: 11px; }

    /* 新增：主聊天区域容器的样式 */
    .chat-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
      position: relative;
    }

    /* 左侧面板样式 - 修改为从chat-area内部滑出 */
    .left-panel {
      position: absolute;
      --left-panel-width: 350px;
      left: calc(-1 * var(--left-panel-width));
      top: 56px;
      bottom: 0;
      width: var(--left-panel-width);
      background-color: var(--white);
      border-right: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
      transition: all 0.3s ease;
      z-index: 50;
    }

    .left-panel.active {
      left: 0;
    }

    .left-panel .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 20px;
      border-bottom: 1px solid var(--border-light);
      background-color: var(--white);
      flex-shrink: 0;
    }

    .left-panel .panel-header h3 {
      margin: 0;
      color: var(--text-primary);
      font-size: 14px;
      font-weight: 500;
    }

    .left-panel .close-panel {
      width: 28px;
      height: 28px;
      padding: 0;
      border: 0;
      background: transparent;
    }

    .left-panel .panel-content {
      padding: 0;
      flex: 1;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .chat-history-panel {
      display: flex;
      flex-direction: column;
      min-height: 0;
      flex: 1;
      overflow: hidden;
      padding: 16px;
    }

    #chat-history-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
    }

    /* 左侧面板中的新建聊天按钮 */
    #new-chat-left {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      margin: 0 0 12px;
      padding: 12px;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    #new-chat-left:hover {
      background: var(--primary-dark);
    }
    #new-chat-left span {
      display: inline !important;
    }

    .history-list-state {
      padding: 36px 12px;
      text-align: center;
      color: var(--text-secondary);
      font-size: 13px;
    }

    .history-chat-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 32px;
      gap: 8px;
      align-items: center;
      padding: 10px 8px 10px 12px;
      border-bottom: 1px solid var(--border-light);
    }

    .history-chat-open {
      min-width: 0;
      padding: 0;
      border: 0;
      background: transparent;
      text-align: left;
      cursor: pointer;
    }

    .history-chat-title {
      display: block;
      color: var(--text-primary);
      font-size: 14px;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .history-chat-time {
      display: block;
      margin-top: 4px;
      color: var(--text-muted);
      font-size: 12px;
    }

    .history-chat-open:hover .history-chat-title {
      color: var(--primary);
    }

    .history-chat-delete {
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #fecaca;
      border-radius: 6px;
      background: var(--white);
      color: #dc2626;
      cursor: pointer;
    }

    .history-chat-delete:hover {
      background: #fef2f2;
    }

    /* 左侧聊天列表项样式 */
    #left-chat-list .chat-item {
      position: relative;
      padding: 12px 15px 12px 45px;
      cursor: pointer;
      transition: all 0.2s ease;
      border-radius: 6px;
      margin-bottom: 4px;
    }

    #left-chat-list .chat-item:hover {
      background-color: var(--gray-hover);
    }

    #left-chat-list .chat-item.active {
      background-color: var(--primary-light);
      border-left: 3px solid var(--primary);
    }

    #left-chat-list .chat-icon {
      position: absolute;
      left: 15px;
      top: 50%;
      transform: translateY(-50%);
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
    }

    #left-chat-list .chat-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 25px;
    }

    #left-chat-list .chat-preview {
      font-size: 12px;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #left-chat-list .delete-chat {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      border-radius: 4px;
      opacity: 0;
      transition: all 0.2s ease;
    }

    #left-chat-list .chat-item:hover .delete-chat {
      opacity: 1;
    }

    #left-chat-list .delete-chat:hover {
      color: var(--danger);
      background-color: rgba(239, 68, 68, 0.1);
    }

    /* 遮罩层 - 仅覆盖chat-area区域 */
    .chat-area-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 40;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }

    .chat-area-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    /* 模型信息模态框样式 */
    .model-info-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
    }

    .model-info-modal.active {
      opacity: 1;
      visibility: visible;
    }

    .model-info-content {
      background-color: var(--white);
      border-radius: 8px;
      width: 90%;
      max-width: 600px;
      max-height: 80vh;
      overflow-y: auto;
      transform: translateY(20px);
      transition: transform 0.3s ease;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    }

    .model-info-modal.active .model-info-content {
      transform: translateY(0);
    }

    .model-info-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .model-info-body {
      padding: 20px;
    }

    .model-info-footer {
      padding: 20px;
      border-top: 1px solid var(--border-light);
      display: flex;
      justify-content: flex-end;
    }

    /* 加载和错误提示样式 */
    .loading-indicator {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 200px;
      color: var(--text-secondary);
    }

    .loading-spinner {
      width: 40px;
      height: 40px;
      border: 4px solid var(--gray-hover);
      border-top: 4px solid var(--primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 10px;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .error-message {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-secondary);
    }

    .link-buttons {
      display: flex;
      gap: 10px;
      justify-content: center;
      margin-top: 20px;
    }

    .link-button {
      padding: 8px 16px;
      border: 1px solid var(--border-light);
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .link-button.primary {
      background-color: var(--primary);
      color: white;
      border-color: var(--primary);
    }
    .link-button.primary:hover {
      background-color: var(--primary-dark);
    }
    .link-button.secondary {
      background-color: var(--white);
      color: var(--text-primary);
    }
    .link-button.secondary:hover {
      background-color: var(--gray-hover);
    }

    /* 智能体推荐样式 */
    .agent-recommendations {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid var(--border-light);
    }

    .agent-recommendations-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
    }

    .agent-recommendations-title i {
      margin-right: 6px;
      color: var(--primary);
    }


    .agent-recommendation-btn {
      background-color: var(--bg-light);
      border: 1px solid var(--border-light);
      border-radius: 8px;
      padding: 10px 14px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s ease;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      width: 100%;
      text-align: left;
    }

    .agent-recommendation-btn:hover {
      background-color: var(--gray-hover);
      border-color: var(--primary);
    }

    .agent-recommendation-btn i {
      margin-right: 4px;
      color: var(--primary);
    }

    /* 智能体输入指示器 */
    .agent-input-indicator {
      display: flex;
      align-items: center;
      font-size: 12px;
      color: var(--primary);
      margin-bottom: 0px;
      padding: 4px 8px;
      background-color: var(--primary-light);
      border-radius: 4px;
      border-left: 3px solid var(--primary);
    }

    .agent-input-indicator i {
      margin-right: 6px;
    }

    .agent-input-indicator button {
      margin-left: auto;
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 2px;
      border-radius: 2px;
    }

    .agent-input-indicator button:hover {
      color: var(--text-primary);
      background-color: var(--border-light);
    }

    /* 可编辑参数样式 */
    .editable-param {
      background-color: var(--primary-light);
      color: var(--primary-dark);
      padding: 2px 4px;
      border-radius: 4px;
      cursor: pointer;
      border: 1px dashed var(--primary);
      transition: all 0.2s ease;
    }

    .editable-param:hover {
      background-color: #e0e7ff;
      border-style: solid;
    }

    .param-value {
      background-color: #f0fdf4;
      color: #15803d;
      padding: 2px 4px;
      border-radius: 4px;
      border: 1px solid #bbf7d0;
    }

    /* 参数选择器样式 */
    .param-selector {
      position: absolute;
      background: var(--white);
      border: 1px solid var(--border-light);
      border-radius: 6px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      z-index: 100;
      padding: 8px;
      max-height: 200px;
      overflow-y: auto;
    }

    .param-option {
      padding: 6px 10px;
      cursor: pointer;
      border-radius: 4px;
      transition: background-color 0.2s;
    }

    .param-option:hover {
      background-color: var(--gray-hover);
    }

    .date-picker {
      padding: 8px;
      border-radius: 6px;
      border: 1px solid var(--input-border);
    }

    /* 新增：应用选择下拉框样式 */
    .app-selector {
      position: relative;
      display: inline-block;
    }

    .app-selector select {
      padding: 4px 10px;
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
      background-color: var(--white);
      color: var(--text-secondary);
      border: 1px solid var(--input-border);
      outline: none;
      min-width: 100px;
    }

    /* 新增：建议推荐样式 */
    .suggestion-recommendations-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
    }

    .suggestion-recommendations-title i {
      margin-right: 6px;
      color: #8b5cf6;
        margin-left: 5px;
    }

.suggestion-recommendations-list,
.agent-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 按钮之间的间距 */
    align-items: flex-start;
}

    .suggestion-recommendation-btn {
      background-color: #f9fafb;
      border-radius: 0.25rem;
      padding: 10px 14px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s ease;
      color: #1f2937;
      display: flex;
      align-items: center;
      text-align: left;
    }

    .suggestion-recommendation-btn:hover {
      background-color: #f2f2f2;
    }

    .suggestion-recommendation-btn i {
      margin-left: 4px;
      color: #333333;
    }

    .typing-dot {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: var(--text-secondary);
      margin: 0 2px;
      animation: typing-dot-pulse 1.4s infinite ease-in-out;
    }

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

    .typing-dot:nth-child(3) {
      animation-delay: 0.4s;
    }
.system-message {
  animation: fadeIn 0.3s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* 图片预览模态框 */
.image-preview-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
}
.image-preview-content {
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.image-preview-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.image-preview-close:hover {
  color: #bbb;
}
.chat-messages-wrapper img {
  cursor: pointer;
  transition: opacity 0.2s;
}
.chat-messages-wrapper img:hover {
  opacity: 0.9;
}
.voice-btn.recording {
      background-color: #ef4444 !important;
      color: white !important;
      animation: pulse 1.2s infinite;
    }
.voice-btn.voice-unavailable,
.voice-btn.voice-unavailable:hover {
      opacity: 0.45;
      cursor: not-allowed;
      background: transparent;
    }
    @keyframes pulse {
      0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
      70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
      100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    }
    /* 专家模式流式显示框样式 */
    .expert-stream-container {
      max-height: 400px;
      overflow-y: auto;
      background: #1e1e2f;
      color: #f8f8f2;
      border-radius: 12px;
      padding: 16px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .expert-stream-container a {
      color: #4caf50;
      text-decoration: underline;
    }
    .expert-card {
      background: #f8f9fc;
      padding: 8px;
      margin-top: 8px;
      border-radius: 8px;
    }
    .expert-link-btn {
      color: #1e1e2f;
      padding: 6px 6px;
      font-size: 14px;
      cursor: pointer;
    }
    .expert-link-btn:hover { color: #1e3c72; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
    @keyframes typing-dot-pulse {
      0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
      30% { transform: translateY(-4px); opacity: 1; }
    }
/* 统一悬停效果：排除新建聊天按钮和logo区域 */
.narrow-sidebar button:not(#new-chat-btn):hover,
.narrow-sidebar .menu-item:hover {
  /*background-color: #f3f4f682;*/
}

    .voice-btn.recording {
      background-color: #ef4444 !important;
      color: white !important;
      animation: pulse 1.2s infinite;
    }
.voice-btn.voice-unavailable,
.voice-btn.voice-unavailable:hover {
      opacity: 0.45;
      cursor: not-allowed;
      background: transparent;
    }
    @keyframes pulse {
      0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
      70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
      100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    }
    .expert-stream-container {
      max-height: 400px;
      overflow-y: auto;
      background: #1e1e2f;
      color: #f8f8f2;
      border-radius: 12px;
      padding: 16px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .expert-stream-container a {
      color: #4caf50;
      text-decoration: underline;
    }
    .expert-card {
      background: #f8f9fc;
      padding: 8px;
      margin-top: 8px;
      border-radius: 8px;
    }
    .expert-link-btn {
      color: #1e1e2f;
      padding: 6px 6px;
      font-size: 14px;
      cursor: pointer;
    }
    .expert-link-btn:hover { color: #1e3c72; }
    /* 图片预览模态 */
    .image-preview-modal {
      display: none;
      position: fixed;
      z-index: 9999;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0,0,0,0.9);
      justify-content: center;
      align-items: center;
    }
    .image-preview-content {
      max-width: 90%;
      max-height: 90%;
      margin: auto;
      display: block;
      border-radius: 8px;
      box-shadow: 0 0 30px rgba(0,0,0,0.5);
    }
    .image-preview-close {
      position: absolute;
      top: 20px;
      right: 35px;
      color: #fff;
      font-size: 40px;
      font-weight: bold;
      cursor: pointer;
      transition: 0.3s;
    }
    .image-preview-close:hover { color: #bbb; }
    .chat-messages-wrapper img { cursor: pointer; transition: opacity 0.2s; }
    .chat-messages-wrapper img:hover { opacity: 0.9; }
    /* 追问指示器 */
    .follow-up-indicator {
      background: #f0f4ff;
      padding: 4px 8px;
      border-radius: 6px;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
    }
      #group-company-selector select {
  padding: 4px 6px;
  font-size: 12px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
      .workflow-dropdown::-webkit-scrollbar {
    width: 6px;
}
.workflow-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.workflow-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.workflow-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
.workflow-dropdown { min-width: 340px; max-width: min(460px, calc(100vw - 24px)); }
.workflow-dropdown > div { white-space: normal; }
.dashboard-code-block {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}
.menu-icon {
  position: relative;
}
.menu-icon:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 100%;           /* 紧贴图标右侧 */
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;   /* 如果依然被裁，可改为 normal 并限制最大宽度 */
  font-size: 12px;
  z-index: 9999;         /* 足够高 */
  margin-left: 15px;
  /* 新增：防止溢出父容器时被裁剪 */
  pointer-events: none;   /* 避免提示影响鼠标事件 */
}
/* 输入框滚动条 */
#message-input {
  max-height: 120px;
  overflow-y: hidden;
  word-wrap: break-word;
  outline: none;
  line-height: 1.6;
  padding: 8px 12px;
  scrollbar-width: thin; /* Firefox */
  flex: 1 1 auto;
  min-height: 44px;
}
#message-input::-webkit-scrollbar {
  width: 4px;
}
#message-input::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
#message-input::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

/* 如果监控按钮已有独立激活样式，可保留但会被上述规则覆盖，也可删除原有规则 */
/* 呼吸动画 */
@keyframes breath {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 应用到占位符容器 */
.loading-placeholder {
    animation: breath 2s ease-in-out infinite;
}
/* 颜色选择器增强样式 */
.color-picker {
position: absolute;top: 38px;right: -10px;
  width: 220px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 1000;
}
.color-picker-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.color-option:hover {
  border-color: var(--primary);
}
.color-option.selected {
  border-color: var(--primary-dark);
  transform: scale(1.1);
}
.opacity-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opacity-control label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}
#opacity-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) 100%);
  border-radius: 2px;
  outline: none;
}
#opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
}

    .knowledge-item {
        padding: 10px;
    }
    .knowledge-item h3 {
        margin-top: 0;
        color: #2c3e50;
        font-size: 1.1em;
        border-bottom: 1px solid #ddd;
        padding-bottom: 5px;
    }
    .knowledge-item p {
        margin: 10px 0;
        line-height: 1.5;
    }
    .knowledge-item a {
        color: #3498db;
        text-decoration: none;
    }
    .knowledge-item a:hover {
        text-decoration: underline;
    }
    .knowledge-item hr {
        margin-top: 10px;
        border: 0;
        border-top: 1px solid #ddd;
    }

/* 知识库卡片样式 */
.knowledge-card {
}
.knowledge-card .kb-item {
    position: relative;
    padding-left: 24px;
    margin: 8px 0;
    line-height: 1.5;
    color: #c3c4c7;
}
.knowledge-card .kb-detail {
    padding: 0px 10px;
    margin-left: 7px;
}
.knowledge-card .kb-item::before {
    content: "●";
    position: absolute;
    left: 4px;
    color: #c3c4c7;
    font-size: 8px;
    top: 2px;
}
.knowledge-card strong {
    color: #4b5563;
    font-weight: 600;
}

/* ===== 响应式适配 ===== */
/* ===== 响应式适配 ===== */
/* 移动端：隐藏底部导航栏（原侧边栏） */
@media (max-width: 768px) {
  .message-ai.p-4 {
    padding: 8px !important;
  }

  /* 完全隐藏侧边栏（底部栏） */
  .narrow-sidebar {
    display: none !important;
  }

  .composer-workspace-switch,
  #panel-files-toggle,
  #panel-history-toggle,
  .answer-page-link {
    display: none !important;
  }
/* 右侧面板全屏 */
  .right-panel.active {
    flex: 0 0 100% !important;
    width: 100%;
    min-width: 100%;
  }
  .right-panel-resizer {
    display: none !important;
  }
  .main-content.narrow {
    flex: 0 0 0% !important;
    display: none;
  }

  /* 移除聊天区域底部预留空间（原为避开底部栏） */
  .chat-area {
    padding-bottom: 0 !important;
  }
  .left-panel {
    --left-panel-width: min(300px, 80vw);
    top: 52px;
  }
  .app-selector{
display: none;
}
}

/* 微信小程序 WebView：使用动态视口和安全区，避免输入区被系统栏遮挡。 */
html.wx-miniprogram,
html.wx-miniprogram body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

html.wx-miniprogram body {
  position: fixed;
  inset: 0;
}

html.wx-miniprogram .content-wrapper {
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0 !important;
  box-sizing: border-box;
}

html.wx-miniprogram .narrow-sidebar {
  display: none !important;
}

html.wx-miniprogram .chat-area,
html.wx-miniprogram .right-panel-container,
html.wx-miniprogram .main-content {
  width: 100%;
  min-width: 0;
}

html.wx-miniprogram .chat-header {
  min-height: 52px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}

html.wx-miniprogram #chat-container {
  padding: 12px 15px !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

html.wx-miniprogram .input-container {
  width: calc(100% - 30px) !important;
  margin: 5px 15px 10px !important;
}

html.wx-miniprogram #xunkuai-disclaimer {
  display: block !important;
  margin: 4px auto 2px !important;
  padding: 0 8px 4px !important;
  line-height: 1.25;
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
}

@media (max-width: 768px) {
  #chat-container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .chart-result {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 4px;
    border-radius: 4px;
    overflow: hidden;
  }

  .chart-result > [id^="echarts-"],
  .chart-result > [id^="echarts_"],
  .chart-result .chart-container,
  .chart-result canvas {
    width: 100% !important;
    max-width: 100%;
  }

  .chart-result [id^="echarts-"],
  .chart-result [id^="echarts_"],
  .chart-result .chart-container {
    height: 300px !important;
    min-height: 0 !important;
  }

  .chart-result .chart-table-switch {
    margin-bottom: 4px !important;
  }

  .composer-row {
    padding-bottom: 38px !important;
  }

  .input-container {
    margin-bottom: 0 !important;
  }
}

/* Unified text/voice business actions rendered inside the conversation. */
.business-action {
  width: min(100%, 760px);
  color: #1f2937;
}

.business-action__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.business-action__header > div { display: grid; gap: 2px; min-width: 0; }
.business-action__header strong { font-size: 16px; letter-spacing: 0; overflow-wrap: anywhere; }
.business-action__header > div span { color: #64748b; font-size: 13px; }
.business-action__status { flex: 0 0 auto; color: #2563eb; font-size: 13px; }
.business-action__status.is-complete { color: #047857; }
.business-action__status.is-error { color: #dc2626; max-width: 220px; text-align: right; }
.business-action__question,
.business-action__empty { margin: 14px 0 0; color: #64748b; font-size: 14px; }

.business-action__table-wrap { margin-top: 12px; max-width: 100%; overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 6px; }
.business-action__table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.business-action__table-wrap th,
.business-action__table-wrap td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.business-action__table-wrap th { color: #475569; background: #f8fafc; font-weight: 600; }
.business-action__table-wrap tr:last-child td { border-bottom: 0; }

.business-action__form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; margin-top: 14px; }
.business-action__form label { display: grid; gap: 6px; color: #475569; font-size: 13px; font-weight: 600; }
.business-action__form label.is-wide,
.business-action__form .is-wide { grid-column: 1 / -1; }
.business-action__form input,
.business-action__form select,
.business-action__form textarea { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #1f2937; font: inherit; }
.business-action__form textarea { min-height: 72px; resize: vertical; }
.business-action__form input:focus,
.business-action__form select:focus,
.business-action__form textarea:focus { border-color: #2563eb; outline: 2px solid rgba(37,99,235,.12); }

.business-action__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.business-action__button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 6px; color: #334155; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.business-action__button:hover { border-color: #2563eb; color: #2563eb; }
.business-action__button.is-primary { border-color: #2563eb; color: #fff; background: #2563eb; }
.business-action__button.is-danger { border-color: #dc2626; color: #b91c1c; background: #fff; }
.business-action__button.is-danger:hover { border-color: #b91c1c; color: #fff; background: #b91c1c; }
.business-action__button:disabled { opacity: .55; cursor: default; }
.business-action__changes { display: grid; grid-template-columns: minmax(100px,auto) 1fr; gap: 7px 14px; margin: 12px 0 0; font-size: 13px; }
.business-action__changes dt { color: #64748b; }
.business-action__changes dd { margin: 0; font-weight: 600; }
.business-action__share { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.business-action__share img { width: 92px; height: 92px; border: 1px solid #e2e8f0; object-fit: contain; }
.business-action__share > div { display: grid; gap: 5px; min-width: 0; }
.business-action__share a { color: #2563eb; font-weight: 600; overflow-wrap: anywhere; }
.business-action__share span { color: #64748b; font-size: 13px; }
.business-action__assignment { display: flex; width: 100%; min-width: 0; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 12px; border: 1px solid #d9dee7; border-radius: 6px; background: #fff; color: #1f2937; text-align: left; cursor: pointer; }
.business-action__assignment:hover { border-color: #94a3b8; background: #f8fafc; }
.business-action__assignment-people { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 7px; }
.business-action__person { display: inline-flex; min-width: 0; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.business-action__person-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-action__avatar { position: relative; display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; overflow: hidden; border: 1px solid #d7dce2; border-radius: 50%; background: #eef2f7; color: #334155; font-size: 12px; font-weight: 700; }
.business-action__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.business-action__assignment-label { color: #64748b; font-size: 12px; white-space: nowrap; }
.business-action__assignment-open { flex: 0 0 auto; color: #475569; font-size: 12px; white-space: nowrap; }

@media (max-width: 640px) {
  .business-action__form { grid-template-columns: 1fr; }
  .business-action__form label.is-wide,
  .business-action__form .is-wide { grid-column: auto; }
  .business-action__button { flex: 1 1 auto; }
}

html.wx-miniprogram .input-container,
html.wx-miniprogram #system-pages-bar {
  width: calc(100% - 20px) !important;
  margin-left: 10px !important;
  margin-right: 10px !important;
}

html.wx-miniprogram .input-container {
  margin-bottom: 10px !important;
}

html.wx-miniprogram .composer-row {
  padding-bottom: 38px !important;
}

html.wx-miniprogram .models-container {
  display: none !important;
}

/* One hold-to-talk surface for browser, app WebView and Mini Program. */
@media (max-width: 767px) {
  html.voice-input-mode .input-container,
  html.voice-input-mode #system-pages-bar {
    width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  html.voice-input-mode .input-container {
    margin-bottom: 10px !important;
  }

  html.voice-input-mode #xunkuai-disclaimer {
    display: block !important;
    margin: 4px auto 2px !important;
    padding: 0 8px 4px !important;
    line-height: 1.25;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
  }
}

html.voice-input-mode .composer-row {
  min-height: 60px !important;
  height: 60px !important;
  padding: 0 !important;
  border-radius: 12px;
  background: #fff;
}

html.voice-input-mode .voice-hold-area {
  inset: 0 !important;
  gap: 0 !important;
  flex-direction: row;
  align-items: center;
}

html.voice-input-mode .voice-hold-btn {
  width: calc(100% - 58px) !important;
  height: 58px !important;
  min-height: 58px;
  border: 0 !important;
  border-radius: 10px;
  background: #fff !important;
  color: #8b5cf6 !important;
  box-shadow: none;
  font-size: 17px;
  cursor: pointer;
}

html.voice-input-mode .voice-hold-btn i {
  display: none !important;
}

html.voice-input-mode .keyboard-mode-btn {
  position: static;
  flex: 0 0 58px;
  margin: 0;
  width: 58px !important;
  height: 58px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-hold-area {
  position: fixed !important;
  z-index: 1200;
  inset: auto 0 0 !important;
  width: 100vw;
  height: min(42vh, 340px);
  min-height: 240px;
  display: block !important;
  overflow: hidden;
  background: linear-gradient(
    to top,
    rgba(245, 232, 218, 0.98) 0%,
    rgba(173, 207, 237, 0.98) 38%,
    rgba(173, 207, 237, 0.76) 72%,
    rgba(173, 207, 237, 0) 100%
  );
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-waveform {
  position: absolute;
  z-index: 2;
  top: auto;
  right: auto;
  bottom: max(66px, env(safe-area-inset-bottom, 0px)) !important;
  left: 50%;
  width: min(240px, 64vw);
  height: 54px;
  padding: 0;
  display: flex;
  gap: 3px;
  transform: translateX(-50%);
  background: transparent;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-waveform i {
  flex: 1 1 3px;
  width: 3px;
  max-width: 4px;
  height: var(--voice-wave-height, 14px);
  opacity: 0.88;
  background: #43515d;
  animation: voice-immersive-wave 0.82s ease-in-out infinite alternate;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-waveform i:nth-child(3n + 1) {
  --voice-wave-height: 9px;
  --voice-wave-duration: 0.76s;
  animation-delay: -0.2s;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-waveform i:nth-child(3n + 2) {
  --voice-wave-height: 20px;
  --voice-wave-duration: 0.9s;
  animation-delay: -0.46s;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-waveform i:nth-child(3n) {
  --voice-wave-height: 32px;
  --voice-wave-duration: 0.7s;
  animation-delay: -0.64s;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .voice-hold-btn {
  position: absolute;
  z-index: 3;
  top: auto;
  bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 100px));
  left: 50%;
  width: max-content !important;
  max-width: calc(100vw - 48px);
  height: auto !important;
  min-height: 0;
  padding: 8px 14px;
  transform: translateX(-50%);
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: #1f2937 !important;
  box-shadow: none !important;
  font-size: 16px;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .keyboard-mode-btn {
  display: none !important;
}

html.voice-input-mode:is(.voice-recording, .voice-cancel-preview) .composer-row::before {
  content: "";
  display: block;
  position: fixed;
  z-index: 1199;
  inset: 0;
  border-radius: 0;
  background: rgba(71, 85, 105, 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  filter: none;
  opacity: 1;
  animation: none;
  transform: none;
  pointer-events: none;
}

html.voice-input-mode.voice-cancel-preview .voice-hold-area {
  background: linear-gradient(
    to top,
    rgba(255, 218, 220, 0.98) 0%,
    rgba(246, 146, 153, 0.98) 38%,
    rgba(246, 146, 153, 0.76) 72%,
    rgba(246, 146, 153, 0) 100%
  );
}

html.voice-input-mode.voice-cancel-preview .voice-waveform i {
  animation-play-state: paused;
}

@keyframes voice-immersive-wave {
  0% { transform: scaleY(0.55); opacity: 0.5; }
  55% { transform: scaleY(0.86); opacity: 0.9; }
  100% { transform: scaleY(1.18); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html.voice-input-mode.voice-recording .voice-waveform i {
    animation-duration: 1.8s;
  }
}

html.wx-miniprogram .main-content > .bg-white {
  flex: 0 0 auto;
  padding-bottom: 0 !important;
}

html.wx-miniprogram .right-panel.active {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
}

html.wx-miniprogram .right-panel-resizer {
  display: none !important;
}

/* The WebView uses the same browser-to-XFYUN voice path as desktop. */
html.wx-miniprogram.mini-keyboard-mode #voice-input-btn {
  display: block !important;
  right: 50px !important;
  bottom: 1px !important;
}

html.wx-miniprogram.mini-keyboard-mode .voice-hold-area {
  display: none !important;
}

/* Visual consistency overrides: typography and spacing only. */
:root {
  --ui-font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: var(--ui-font-sans) !important;
  letter-spacing: 0;
}

body {
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.chat-header {
  height: 56px;
  padding: 0 24px;
}

.chat-header #current-chat-title {
  font-size: 18px !important;
  line-height: 1.3;
  font-weight: 600;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 180px);
  margin: 0 !important;
  text-align: center;
}

#chat-container {
  padding: 24px 28px;
}

.chat-messages-wrapper {
  max-width: 800px;
  gap: 14px;
}

.chat-messages-wrapper > * {
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.scroll-to-bottom {
  position: fixed;
  left: 50%;
  bottom: 142px;
  z-index: 38;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #334155;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.scroll-to-bottom.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

body.right-panel-open .scroll-to-bottom {
  display: none;
}

@media (max-width: 768px) {
  .scroll-to-bottom { bottom: 150px; }
}

.message-user {
  font-family: var(--ui-font-sans) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  padding: 11px 14px;
  margin-bottom: 12px;
}

.message-ai,
.message-ai .markdown-content,
.agent-result-panel-view {
  font-family: var(--ui-font-sans) !important;
  font-size: 15px !important;
  line-height: 1.76 !important;
}

.markdown-content {
  font-size: 15px !important;
  line-height: 1.78 !important;
}

.markdown-content h1 {
  font-size: 24px !important;
  line-height: 1.35 !important;
  margin: 0 0 16px !important;
}

.markdown-content h2 {
  font-size: 20px !important;
  line-height: 1.4 !important;
  margin: 22px 0 10px !important;
}

.markdown-content h3 {
  font-size: 17px !important;
  line-height: 1.45 !important;
  margin: 18px 0 8px !important;
}

.markdown-content p {
  margin: 0 0 12px !important;
}

.markdown-content li {
  line-height: 1.72 !important;
  margin: 5px 0 !important;
}

.markdown-content strong {
  font-weight: 650 !important;
}

.agent-mode-indicator,
.expert-mode-indicator {
  font-size: 14px !important;
  line-height: 1.5 !important;
  padding: 11px 14px !important;
  border-radius: 8px;
}

.expert-stream-container,
.expert-stream-container.agent-stream-container {
  font-family: var(--ui-font-sans) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px !important;
}

.expert-progress-line {
  font-family: var(--ui-font-sans) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}

.right-panel > .panel-header {
  flex: 0 0 48px;
  min-height: 48px;
  position: relative;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid #34373c;
  color: #f8fafc;
  background: #17191d;
  overflow: visible;
}

.panel-workspace-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.panel-workspace-actions--end {
  margin-left: auto;
}

.right-panel > .panel-header #right-panel-current-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.right-panel-tabs {
  display: flex;
  flex: 1 1 auto;
  align-self: stretch;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.right-panel-tabs::-webkit-scrollbar {
  display: none;
}

.right-panel-tab {
  display: flex;
  position: relative;
  flex: 0 1 240px;
  min-width: 136px;
  max-width: 280px;
  align-items: center;
  color: #aeb4bd;
  border-bottom: 3px solid transparent;
  background: transparent;
}

.right-panel-tab::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 1px;
  background: #34373c;
}

.right-panel-tab.active {
  color: #fff;
  background: transparent;
}

.right-panel-tab-select {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 10px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.right-panel-tab-select i {
  flex: 0 0 auto;
  font-size: 12px;
  color: currentColor;
}

.right-panel-tab-select span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-panel-tab-close {
  display: inline-grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-right: 5px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #8f96a1;
  background: transparent;
  cursor: pointer;
}

.right-panel-tab-close:hover,
.right-panel-tab-close:focus-visible {
  color: #fff;
  background: #30343a;
}

.right-panel > .panel-header #expand-panel,
.right-panel > .panel-header .close-panel,
.right-panel > .panel-header #panel-files-toggle,
.right-panel > .panel-header #panel-history-toggle {
  display: inline-grid;
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #aeb4bd;
  background: transparent;
}

.right-panel > .panel-header #expand-panel:hover,
.right-panel > .panel-header .close-panel:hover,
.right-panel > .panel-header #panel-files-toggle:hover,
.right-panel > .panel-header #panel-history-toggle:hover,
.right-panel > .panel-header #panel-history-toggle[aria-expanded="true"] {
  color: #fff;
  background: #30343a;
}

.right-panel > .panel-header #panel-history-toggle:disabled {
  color: #cbd5e1;
  cursor: default;
  background: transparent;
}

.panel-history-count {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border: 1px solid #fff;
  border-radius: 7px;
  color: #fff;
  background: #dc2626;
  font-size: 9px;
  line-height: 12px;
  text-align: center;
}

.panel-history-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 10px;
  width: min(340px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.panel-history-heading {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  font-size: 13px;
}

.panel-history-heading button {
  border: 0;
  color: #64748b;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.panel-history-heading button:hover {
  color: #dc2626;
}

.panel-history-list {
  max-height: 320px;
  padding: 6px;
  overflow-y: auto;
}

.panel-history-item {
  display: grid;
  width: 100%;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  color: #334155;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.panel-history-item:hover,
.panel-history-item:focus-visible {
  background: #f1f5f9;
}

.panel-history-item span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-history-item i,
.panel-history-item time {
  color: #94a3b8;
  font-size: 11px;
}

.panel-history-empty {
  padding: 22px 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.right-panel {
  background: #f8fafc;
}

.page-builder-process {
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--white);
  container-type: inline-size;
  font-weight: 400;
}

.page-builder-process-message {
  width: 100%;
  max-width: 100%;
  margin: 4px 0 12px;
}

.page-builder-process__summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-light);
}
.page-builder-process__summary > div { min-width: 0; }

.page-builder-process__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-light);
  font-size: 14px;
}

.page-builder-process__summary strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.page-builder-process__summary p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-builder-process__status {
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--primary-light);
}

.page-builder-process__status.is-success { color: #047857; background: #ecfdf5; }
.page-builder-process__status.is-error { color: #b91c1c; background: #fef2f2; }
.page-builder-process__status.is-waiting { color: #9a6700; background: #fff8df; }

.page-builder-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}

.page-builder-steps li {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-light);
}
.page-builder-steps li > div { min-width: 0; overflow-wrap: anywhere; }

.page-builder-steps li:last-child { border-right: 0; }
.page-builder-steps li > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--input-border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
  background: var(--white);
}
.page-builder-steps strong { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 500; line-height: 1.5; }
.page-builder-steps small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; line-height: 1.5; }
.page-builder-steps li.is-active { color: var(--text-secondary); background: color-mix(in srgb, var(--primary-light) 45%, var(--white)); }
.page-builder-steps li.is-active > span { color: var(--theme-on-primary, #fff); border-color: var(--primary); background: var(--primary); }
.page-builder-steps li.is-active strong { color: var(--primary-dark); }
.page-builder-steps li.is-done > span { color: #047857; border-color: color-mix(in srgb, var(--success) 35%, var(--border-light)); background: color-mix(in srgb, var(--success) 10%, var(--white)); }
.page-builder-steps li.is-done > span { font-size: 0; }
.page-builder-steps li.is-done > span::before { content: '\f00c'; font: 12px/1 "Font Awesome 6 Free"; font-weight: 900; }
.page-builder-steps li.is-done strong { color: var(--text-primary); }

.page-builder-clarification {
  margin: 0;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}
.page-builder-clarification > strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}
.page-builder-clarification__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.page-builder-clarification__option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 7px;
  color: var(--text-primary);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}
.page-builder-clarification__option:hover { border-color: var(--primary); background: var(--gray-hover); }
.page-builder-clarification__option.is-selected { border-color: var(--primary); background: var(--primary-light); }
.page-builder-clarification__option:disabled { cursor: default; opacity: .72; }
.page-builder-clarification__radio {
  width: 16px;
  height: 16px;
  border: 2px solid var(--input-border);
  border-radius: 50%;
  background: var(--white);
}
.page-builder-clarification__option.is-selected .page-builder-clarification__radio {
  border: 5px solid var(--primary);
}
.page-builder-clarification__copy { min-width: 0; }
.page-builder-clarification__copy strong,
.page-builder-clarification__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-builder-clarification__copy strong { color: var(--text-primary); font-size: 13px; font-weight: 500; }
.page-builder-clarification__copy small { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }

.page-builder-model {
  overflow: auto;
  max-height: min(680px, calc(100vh - 330px));
  padding: 0;
}
.page-builder-clarification.page-builder-model { padding: 0; }
.page-builder-model__head,
.page-builder-model__section-head,
.page-builder-model__toolbar,
.page-builder-model__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-builder-model__head { padding: 15px 16px 10px; }
.page-builder-model__head strong,
.page-builder-model__head small { display: block; }
.page-builder-model__head strong { color: #172033; font-size: 15px; }
.page-builder-model__head small { margin-top: 3px; color: #64748b; font-size: 12px; }
.page-builder-model__head > span {
  overflow: hidden;
  max-width: 42%;
  padding: 4px 8px;
  border-radius: 4px;
  color: #475569;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #f1f5f9;
}
.page-builder-model__notice {
  margin: 0 16px 14px;
  padding: 9px 11px;
  color: #475569;
  border-left: 3px solid #0f9f76;
  background: #f0fdf8;
  font-size: 12px;
  line-height: 1.55;
}
.page-builder-model__notice i { margin-right: 6px; color: #078760; }
.page-builder-model__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 0 16px 14px;
}
.page-builder-model__toolbar label { display: grid; gap: 5px; }
.page-builder-model__toolbar label > span { color: #64748b; font-size: 11px; font-weight: 650; }
.page-builder-model__selection { margin: 0 16px 12px; color: #64748b; font-size: 12px; overflow-wrap: anywhere; }
.page-builder-model__table-picker input[type="search"] { width: 100%; min-width: 0; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.page-builder-model__ontology { margin-right: auto; max-width: 65%; font-size: 13px; }
.page-builder-model__ontology span { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.page-builder-model__ontology input { width: auto; accent-color: var(--primary-color, #7856d8); }
.page-builder-model__ontology small { display: block; margin-top: 5px; color: #64748b; font-size: 11px; line-height: 1.5; }
.page-builder-model__table-picker > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
}
.page-builder-icon-action {
  display: grid;
  width: 36px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  background: #fff;
  cursor: pointer;
}
.page-builder-icon-action:hover { color: #1d4ed8; border-color: #93b4ee; background: #eff6ff; }
.page-builder-icon-action:disabled { color: #94a3b8; background: #f8fafc; cursor: not-allowed; }
.page-builder-model select,
.page-builder-model input[type="text"] {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  background: #fff;
  font: 12px/1.2 var(--ui-font-sans);
}
.page-builder-model select:focus,
.page-builder-model input[type="text"]:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.page-builder-model__section-head {
  min-height: 44px;
  padding: 8px 16px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.page-builder-model__section-head strong { color: #334155; font-size: 13px; }
.page-builder-model__section-head > span { color: #64748b; font-size: 11px; }
.page-builder-er__zoom {
  display: inline-grid;
  grid-template-columns: 28px 48px 28px 28px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.page-builder-er__zoom button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid #e2e8f0;
  color: #475569;
  background: transparent;
  cursor: pointer;
}
.page-builder-er__zoom button:first-child { border-left: 0; }
.page-builder-er__zoom button:hover { color: #1d4ed8; background: #eff6ff; }
.page-builder-er__zoom output { color: #475569; font-size: 10px; text-align: center; }
.page-builder-er {
  overflow: auto;
  margin: 12px 16px 0;
  border: 1px solid #303030;
  border-radius: 7px;
  background-color: #171717;
  background-image: radial-gradient(#353535 1px, transparent 1px);
  background-size: 18px 18px;
}
.page-builder-er__stage { position: relative; min-width: 100%; min-height: 250px; }
.page-builder-er__canvas {
  position: relative;
  min-width: 620px;
  min-height: 250px;
  transform-origin: 0 0;
}
.page-builder-er__lines,
.page-builder-er__nodes {
  position: absolute;
  inset: 0;
}
.page-builder-er__lines { overflow: visible; pointer-events: none; }
.page-builder-er__relation-line {
  fill: none;
  stroke: #8b9bad;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.page-builder-er__relation-line.is-inner { stroke: #28b487; }
.page-builder-er__relation-point { fill: #171717; stroke: #c8d1dc; stroke-width: 2; }
.page-builder-er__node {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  padding: 0;
  border: 1px solid #3b3b3b;
  border-radius: 5px;
  color: #e5e7eb;
  background: #202020;
  box-shadow: 0 7px 18px rgb(0 0 0 / 28%);
  font-family: var(--ui-font-sans);
  text-align: left;
}
.page-builder-er__node:hover,
.page-builder-er__node:focus-visible { border-color: #7c8da1; outline: none; }
.page-builder-er__node-head {
  display: grid;
  height: 46px;
  grid-template-columns: 20px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-bottom: 1px solid #393939;
  background: #292929;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.page-builder-er__node-head:active { cursor: grabbing; }
.page-builder-er__node-head > i { color: #bfc7d1; font-size: 12px; }
.page-builder-er__node-head > strong {
  overflow: hidden;
  color: #f8fafc;
  font: 650 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-builder-er__main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a7f3d0;
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}
.page-builder-er__main input { width: 13px; height: 13px; margin: 0; accent-color: #34d399; }
.page-builder-er__remove-table {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #fca5a5;
  background: transparent;
  cursor: pointer;
}
.page-builder-er__remove-table:hover { background: #482527; }
.page-builder-er__remove-table:disabled { color: #555; cursor: not-allowed; background: transparent; }
.page-builder-er__field {
  display: grid;
  width: 100%;
  height: 34px;
  grid-template-columns: 18px minmax(0, 1fr) 64px 82px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid #313131;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.page-builder-er__field > i { color: #aeb6c0; font-size: 9px; text-align: center; }
.page-builder-er__field > i.fa-key { color: #e6b450; }
.page-builder-er__field > span {
  overflow: hidden;
  color: #e2e8f0;
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-builder-er__field > small {
  overflow: hidden;
  color: #969da8;
  font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.page-builder-er__field > em {
  overflow: hidden;
  color: #8fb6f4;
  font: 9px/1.2 var(--ui-font-sans);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.page-builder-er__field-action:hover { background: #2a2f37; }
.page-builder-er__field-action.is-active { box-shadow: inset 3px 0 #60a5fa; background: #26364d; }
.page-builder-er__field-action.is-hidden { opacity: .48; }
.page-builder-er__more {
  display: flex;
  width: 100%;
  height: 24px;
  align-items: center;
  padding: 0 11px;
  border: 0;
  color: #8f98a4;
  background: #242424;
  font: 9px/1 var(--ui-font-sans);
  cursor: pointer;
}
.page-builder-er__more:hover { color: #dbeafe; background: #2b3139; }
.page-builder-er__field-editor,
.page-builder-er__relation-editor {
  position: absolute;
  z-index: 6;
  display: grid;
  width: 288px;
  gap: 10px;
  padding: 12px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #e5e7eb;
  background: #171717;
  box-shadow: 0 16px 38px rgb(0 0 0 / 48%);
}
.page-builder-er__relation-editor { width: 320px; grid-template-columns: 1fr 1fr; }
.page-builder-er__field-editor > header,
.page-builder-er__relation-editor > header {
  display: flex;
  grid-column: 1 / -1;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #30363d;
}
.page-builder-er__field-editor header strong,
.page-builder-er__field-editor header small,
.page-builder-er__relation-editor header strong,
.page-builder-er__relation-editor header small { display: block; }
.page-builder-er__field-editor header strong,
.page-builder-er__relation-editor header strong { color: #f8fafc; font-size: 12px; }
.page-builder-er__field-editor header small,
.page-builder-er__relation-editor header small { margin-top: 3px; color: #8b949e; font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.page-builder-er__field-editor header button,
.page-builder-er__relation-editor header button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  color: #9ca3af;
  background: transparent;
  cursor: pointer;
}
.page-builder-er__field-editor > label,
.page-builder-er__relation-editor > label { display: grid; gap: 5px; min-width: 0; }
.page-builder-er__field-editor label > span,
.page-builder-er__relation-editor label > span { color: #9ca3af; font-size: 9px; font-weight: 650; }
.page-builder-er__field-editor input[type="text"],
.page-builder-er__field-editor textarea,
.page-builder-er__field-editor select,
.page-builder-er__relation-editor select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #f3f4f6;
  background: #242424;
  font-size: 11px;
}
.page-builder-er__field-editor textarea {
  min-height: 88px;
  padding: 8px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.45;
}
.page-builder-er__field-editor textarea.is-invalid { border-color: #ef4444; }
.page-builder-er__options-error { color: #fca5a5; font-size: 9px; line-height: 1.4; }
.page-builder-er__field-editor input:focus,
.page-builder-er__field-editor textarea:focus,
.page-builder-er__field-editor select:focus,
.page-builder-er__relation-editor select:focus { outline: 2px solid #2563eb; border-color: #60a5fa; }
.page-builder-er__field-flags { display: flex; gap: 14px; }
.page-builder-er__field-flags label { display: inline-flex; align-items: center; gap: 5px; color: #d1d5db; font-size: 10px; }
.page-builder-er__field-flags input { width: 14px; height: 14px; margin: 0; accent-color: #2563eb; }
.page-builder-er__relation-action {
  position: absolute;
  z-index: 3;
  min-width: 54px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #64748b;
  border-radius: 13px;
  color: #dbeafe;
  background: #20252c;
  font: 700 9px/1 var(--ui-font-sans);
  cursor: pointer;
}
.page-builder-er__relation-action:hover,
.page-builder-er__relation-action.is-active { color: #fff; border-color: #60a5fa; background: #1d4ed8; }
.page-builder-er__remove-relation {
  display: inline-flex;
  grid-column: 1 / -1;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #7f1d1d;
  border-radius: 4px;
  color: #fecaca;
  background: #3f1d20;
  font-size: 10px;
  cursor: pointer;
}
.page-builder-er__remove-relation:hover { background: #5b2025; }
.page-builder-er__legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 16px 12px;
  padding: 8px 10px;
  color: #64748b;
  font-size: 10px;
}
.page-builder-er__legend span { display: inline-flex; align-items: center; gap: 5px; }
.page-builder-er__legend .fa-key { color: #c58a21; }
.page-builder-er__legend .fa-link { color: #078760; }
.page-builder-model__error { margin: 0 16px 12px; color: #b4232a; font-size: 12px; line-height: 1.5; }
.page-builder-model__footer { justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px 16px; border-top: 1px solid #e2e8f0; }

.page-builder-log {
  overflow: auto;
  max-height: 260px;
  border: 0;
  border-radius: 0;
  background: var(--white);
}
.page-builder-log summary {
  padding: 11px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}
.page-builder-log summary:hover { color: var(--primary-dark); background: var(--bg-light); }
.page-builder-log summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.page-builder-log pre {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--text-secondary);
  font: 12px/1.65 var(--ui-font-sans);
  white-space: pre-wrap;
  word-break: break-word;
}
.page-builder-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font: 500 13px/1 var(--ui-font-sans);
  background: var(--white);
  cursor: pointer;
}
.page-builder-action:hover { background: var(--gray-hover); }
.page-builder-action--primary { color: var(--theme-on-primary, #fff); border-color: var(--primary); background: var(--primary); }
.page-builder-action--primary:hover { background: var(--primary-dark); }

@container (max-width: 640px) {
  .page-builder-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-builder-steps li { border-bottom: 1px solid var(--border-light); }
  .page-builder-steps li:nth-child(2n) { border-right: 0; }
  .page-builder-steps li:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 768px) {
  .page-builder-process-message { margin-bottom: 8px; }
  .page-builder-process__summary { grid-template-columns: 32px minmax(0, 1fr); padding: 12px; }
  .page-builder-process__status { grid-column: 2; justify-self: start; }
  .page-builder-process__summary p { white-space: normal; overflow-wrap: anywhere; }
  .page-builder-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-builder-steps li { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
  .page-builder-steps li:nth-child(2n) { border-right: 0; }
  .page-builder-steps li:nth-last-child(-n + 2) { border-bottom: 0; }
  .page-builder-action { flex: 1 1 auto; justify-content: center; }
  .page-builder-clarification__options { grid-template-columns: 1fr; }
  .page-builder-model { max-height: none; }
  .page-builder-er { margin-right: 10px; margin-left: 10px; }
  .page-builder-er__legend { justify-content: flex-start; margin-right: 10px; margin-left: 10px; }
  .page-builder-model__toolbar { grid-template-columns: 1fr; }
  .page-builder-model__toolbar .page-builder-action { width: 100%; }
}

.input-container,
.system-pages-bar {
  max-width: 800px;
}

.system-page-btn--design.active {
  color: #1d4ed8;
  border-color: #2563eb;
  background: #eff6ff;
}

.mode-select,
#app-select,
.app-selector select {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
}

.message-input-div[data-placeholder]:is(:empty, [data-empty="true"])::before {
  color: #98a2b3 !important;
}
.message-input-div.workflow-agent-locked[data-placeholder]:is(:empty, [data-empty="true"])::before {
  color: var(--text-secondary) !important;
}

.table-result th,
.table-result td,
.knowledge-table th,
.knowledge-table td {
  font-size: var(--ui-data-font-size) !important;
  font-weight: var(--ui-data-font-weight);
  line-height: var(--ui-data-line-height) !important;
  padding: 10px 12px !important;
}

.copy-btn,
.model-tag,
.app-selector select {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

#message-input,
.message-input-div {
  font-size: 14px !important;
  line-height: 1.65 !important;
}

.workflow-agent-form-description {
  font-size: 13px;
  line-height: 1.65;
}

.workflow-agent-field > span {
  font-size: 13px;
  line-height: 1.45;
}

.workflow-agent-field input,
.workflow-agent-field textarea {
  font-size: 14px;
  line-height: 1.55;
}

.workflow-agent-submit {
  font-size: 14px;
  line-height: 1.4;
}

/* Shared browser/WebView press-to-talk state. */
html.voice-session-active .composer-row {
  border-color: color-mix(in srgb, var(--primary) 58%, #d1d5db);
  background: color-mix(in srgb, var(--primary-light) 24%, #fff);
}

html:not(.wx-miniprogram).voice-session-active .voice-session-controls {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 6px;
}

html:not(.wx-miniprogram).voice-session-active .voice-session-control {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  color: #374151;
  font-size: 16px;
}

html:not(.wx-miniprogram).voice-session-active .voice-session-control:hover {
  border-color: var(--primary);
  color: var(--primary);
}

html:not(.wx-miniprogram).voice-session-active .voice-stop-btn {
  color: #dc2626;
}

html[data-voice-state="paused"] .voice-pause-btn {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-light) 40%, #fff);
}

html.wx-miniprogram .voice-session-controls {
  display: none !important;
}

html[data-voice-state="sending"] .voice-hold-btn,
html[data-voice-state="transcribing"] .voice-hold-btn {
  color: #4b5563;
}

html[data-voice-state="speaking"] .voice-hold-btn i {
  color: #16a34a !important;
}

html[data-voice-state="unavailable"] .voice-hold-btn {
  color: #9ca3af !important;
}

html.voice-session-active .message-input-div[contenteditable="false"] {
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  #chat-container {
    padding: 16px 14px;
  }

  .chat-header {
    height: 52px;
    padding: 0 14px;
  }

  .chat-header #current-chat-title {
    font-size: 16px !important;
    max-width: calc(100% - 128px);
  }

  #user-info-display { display: none !important; }

  .chat-header .flex.items-center.space-x-4 {
    right: 14px;
  }

  .chat-messages-wrapper {
    gap: 10px;
  }

  .message-ai,
  .message-ai .markdown-content,
  .markdown-content {
    font-size: 14px !important;
  }

  .expert-stream-container,
  .expert-stream-container.agent-stream-container {
    font-size: 13px !important;
    padding: 12px !important;
  }
}

/* Final cascade for compact smart-answer presentation. */
#chat-container .markdown-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border-light));
  border-radius: 12px;
  background: color-mix(in srgb, var(--white) 97%, var(--primary-light));
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.045);
  font-size: 14px !important;
  line-height: 1.58 !important;
}

#chat-container .markdown-content > :first-child { margin-top: 0 !important; }
#chat-container .markdown-content > :last-child { margin-bottom: 0 !important; }
#chat-container .markdown-content h1,
#chat-container .markdown-content h2,
#chat-container .markdown-content h3 { color: var(--text-primary); letter-spacing: 0; }
#chat-container .markdown-content h1 {
  margin: 0 0 10px !important;
  padding: 0 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light));
  font-size: 20px !important;
  line-height: 1.3 !important;
  font-weight: 700;
}
#chat-container .markdown-content h2 {
  margin: 16px 0 7px !important;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
  font-size: 17px !important;
  line-height: 1.35 !important;
  font-weight: 700;
}
#chat-container .markdown-content h3 {
  margin: 12px 0 6px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  font-weight: 650;
}
#chat-container .markdown-content p { margin: 0 0 8px !important; }
#chat-container .markdown-content ul,
#chat-container .markdown-content ol { margin: 5px 0 9px !important; padding-left: 20px; }
#chat-container .markdown-content li { margin: 2px 0 !important; line-height: 1.52 !important; }
#chat-container .markdown-content strong { color: var(--primary-dark); font-weight: 700 !important; }
#chat-container .markdown-content blockquote {
  margin: 8px 0;
  padding: 7px 10px;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--primary-light) 42%, var(--white));
  color: var(--text-secondary);
}
#chat-container .markdown-content .knowledge-table-wrap {
  width: 100%;
  margin: 8px 0 11px;
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border-light));
  border-radius: 8px;
  background: var(--white);
}
#chat-container .markdown-content .knowledge-table {
  width: 100%;
  min-width: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 12.5px !important;
  line-height: 1.42 !important;
}
#chat-container .markdown-content .knowledge-table th,
#chat-container .markdown-content .knowledge-table td {
  padding: 6px 9px !important;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-light) 78%, transparent);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
}
#chat-container .markdown-content .knowledge-table th {
  background: color-mix(in srgb, var(--primary-light) 44%, var(--bg-light));
  color: var(--text-secondary);
  font-size: var(--ui-label-font-size) !important;
  font-weight: var(--ui-label-font-weight);
}
#chat-container .markdown-content .knowledge-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg-light) 58%, var(--white));
}
#chat-container .markdown-content .knowledge-table tbody tr:last-child td { border-bottom: 0; }
#chat-container .markdown-content .compact-result-table td:first-child {
  width: 34%;
  color: var(--text-secondary);
  font-weight: 650;
}
#chat-container .system-pages-bar { gap: 6px !important; padding: 3px 0 !important; }
#chat-container .system-page-btn {
  min-height: 28px;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--white) 88%, var(--primary-light));
  border-color: color-mix(in srgb, var(--primary) 14%, var(--border-light));
  color: var(--text-secondary);
  font-size: 12px !important;
  line-height: 1.3;
}
#chat-container .system-page-btn:hover,
#chat-container .system-page-btn.active {
  background: var(--primary-light);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-light));
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  #chat-container .markdown-content { padding: 11px 12px; border-radius: 10px; font-size: 13.5px !important; }
  #chat-container .markdown-content h1 { font-size: 18px !important; }
  #chat-container .markdown-content h2 { margin-top: 13px !important; font-size: 16px !important; }
  #chat-container .markdown-content .knowledge-table { font-size: 12px !important; }
  #chat-container .markdown-content .knowledge-table th,
  #chat-container .markdown-content .knowledge-table td { padding: 5px 7px !important; }
}

/* Keep smart-answer preview tools on the active appearance theme. */
/* Align smart-answer results with expert messages in the same chat column. */
#chat-container .message-ai:has(.smart-answer-preview-bar) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#chat-container .smart-answer-preview-bar {
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border-light));
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--primary-light) 28%, var(--white)) !important;
}

#chat-container .smart-answer-preview-icon {
  color: var(--primary) !important;
}

#chat-container .view-data-btn {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--theme-on-primary, #fff) !important;
}

#chat-container .view-data-btn:hover,
#chat-container .view-data-btn:focus-visible {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

/* Expert progress uses the same theme treatment as the answer preview. */
#chat-container .expert-mode-indicator {
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border-light));
  background: color-mix(in srgb, var(--primary-light) 34%, var(--white)) !important;
  color: var(--text-primary) !important;
}

#chat-container .expert-mode-indicator i {
  color: var(--primary) !important;
}

#chat-container .expert-progress-line.step::before {
  background: var(--primary) !important;
}

#chat-container .system-page-btn:hover {
  background: var(--primary-light) !important;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-light)) !important;
}

#chat-container .system-page-btn--design.active {
  color: var(--primary-dark) !important;
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* Avoid a doubled outline when a rendered table already has an inner wrapper. */
#chat-container .table-result {
  border: 0 !important;
  border-radius: 8px;
  margin-top: 8px;
}

#chat-container .table-result > .knowledge-table-wrap {
  margin: 0;
  border: 0 !important;
  border-radius: inherit;
}

#chat-container .table-result > .knowledge-table-wrap .knowledge-table th,
#chat-container .table-result > .knowledge-table-wrap .knowledge-table td {
  border-top: 0 !important;
  border-right: 0 !important;
  border-left: 0 !important;
}

/* Normalize server-rendered result tables that may carry legacy inline colors. */
#chat-container .table-result > table,
#chat-container .table-result > .knowledge-table-wrap > table {
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0;
  background: var(--white) !important;
}

#chat-container .table-result thead th {
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary-dark) 45%, var(--primary)) !important;
  background: var(--primary) !important;
  color: var(--theme-on-primary, #fff) !important;
  font-weight: 650;
}

#chat-container .table-result tbody td {
  border-top: 0 !important;
  border-right: 0 !important;
  border-left: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-light) 82%, transparent) !important;
  background: var(--white) !important;
  color: var(--text-primary) !important;
}

#chat-container .table-result tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--primary-light) 34%, var(--white)) !important;
}

#chat-container .table-result tbody tr:last-child td {
  border-bottom: 0 !important;
}

/* Keep composer controls in sync with the selected appearance theme. */
#system-pages-bar .system-page-btn {
  background: color-mix(in srgb, var(--white) 88%, var(--primary-light)) !important;
  border-color: color-mix(in srgb, var(--primary) 14%, var(--border-light)) !important;
  color: var(--text-secondary) !important;
}

#system-pages-bar .system-page-btn:hover,
#system-pages-bar .system-page-btn:focus-visible {
  background: var(--primary-light) !important;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-light)) !important;
  color: var(--primary-dark) !important;
}

#system-pages-bar .system-page-btn.active,
#system-pages-bar .system-page-btn:active {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary-dark) !important;
}

#system-pages-bar::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 38%, var(--border-light)) !important;
}

#mode-select,
#app-select,
.app-selector select {
  background-color: color-mix(in srgb, var(--white) 90%, var(--primary-light)) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

#mode-select:hover,
#app-select:hover,
.app-selector select:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--input-border)) !important;
}

#mode-select:focus-visible,
#app-select:focus-visible,
.app-selector select:focus-visible {
  border-color: var(--primary) !important;
  outline: 2px solid color-mix(in srgb, var(--primary) 22%, transparent) !important;
  outline-offset: 1px;
}

#voice-input-btn,
#keyboard-mode-btn {
  color: var(--text-secondary) !important;
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

#voice-input-btn:hover,
#keyboard-mode-btn:hover,
#voice-input-btn:focus-visible,
#keyboard-mode-btn:focus-visible {
  background: var(--primary-light) !important;
  color: var(--primary-dark) !important;
}

#voice-input-btn:active,
#keyboard-mode-btn:active {
  background: color-mix(in srgb, var(--primary) 18%, var(--white)) !important;
  color: var(--primary-dark) !important;
}

#send-message:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 36%, transparent) !important;
  outline-offset: 2px;
}

#chat-container .chart-result {
  margin-top: 8px;
}

/* Suggestions and native select menus should use the same theme accent. */
.suggestion-recommendations-title i {
  color: var(--primary) !important;
}

#mode-select,
#app-select,
.app-selector select {
  color-scheme: light;
  accent-color: var(--primary);
}

#mode-select option,
#app-select option,
.app-selector select option {
  background: var(--white) !important;
  color: var(--text-primary) !important;
}

#mode-select option:checked,
#app-select option:checked,
.app-selector select option:checked {
  background: var(--primary) !important;
  color: var(--theme-on-primary, #fff) !important;
}

/* Keep result surfaces quiet and readable in both appearance modes. */
html[data-color-mode="dark"] {
  --bg-light: #111827 !important;
  --white: #1f2937 !important;
  --border-light: #374151 !important;
  --text-primary: #f3f4f6 !important;
  --text-secondary: #cbd5e1 !important;
  --text-muted: #94a3b8 !important;
  --gray-hover: #273244 !important;
  --input-border: #4b5563 !important;
}

html[data-color-mode="dark"] body,
html[data-color-mode="dark"] .main-content,
html[data-color-mode="dark"] #chat-container {
  background-color: var(--bg-light) !important;
  color: var(--text-primary);
}

html[data-color-mode="dark"] .message-ai,
html[data-color-mode="dark"] .right-panel,
html[data-color-mode="dark"] .panel-content,
html[data-color-mode="dark"] .composer-row {
  background-color: var(--white) !important;
  color: var(--text-primary);
  border-color: var(--border-light) !important;
}

html[data-color-mode="dark"] .right-panel > .panel-header,
html[data-color-mode="dark"] .panel-history-menu {
  color: var(--text-primary);
  background: var(--white);
  border-color: var(--border-light);
}

html[data-color-mode="dark"] .right-panel-tab {
  color: var(--text-secondary);
}

html[data-color-mode="dark"] .right-panel-tab::after,
html[data-color-mode="dark"] .panel-history-heading {
  border-color: var(--border-light);
}

html[data-color-mode="dark"] .right-panel-tab.active,
html[data-color-mode="dark"] .right-panel-tab-close:hover,
html[data-color-mode="dark"] .panel-history-item:hover {
  color: var(--text-primary);
  background: transparent;
}

html[data-color-mode="dark"] .panel-history-item,
html[data-color-mode="dark"] .panel-history-heading {
  color: var(--text-primary);
}

html[data-color-mode="dark"] .message-user,
html[data-color-mode="dark"] .smart-answer-preview-bar,
html[data-color-mode="dark"] .business-action,
html[data-color-mode="dark"] .agent-result-action-card {
  background-color: var(--gray-hover) !important;
  color: var(--text-primary);
  border-color: var(--border-light) !important;
}

/* Fixed account entry: identity details live inside the menu, not in the rail. */
:root { --account-icon-color: #000; }
.sidebar-account-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: #fff !important;
  font-size: 17px;
}
.sidebar-account-toggle:hover,
.sidebar-account-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, .12) !important;
}
.sidebar-account-icon {
  width: 28px;
  height: 28px;
  color: currentColor;
}
.sidebar-account-icon path {
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}
.sidebar-account-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary);
  color: var(--theme-on-primary, #fff);
  font-weight: 700;
}

/* The drawer handle belongs to the same visual system as the rail. */
.daily-task-toggle {
  color: var(--theme-sidebar, #6d4bd8) !important;
}
.sidebar-more { position: relative; flex: 0 0 auto; display: grid; place-items: center; }
.sidebar-more-toggle { display: flex; width: 58px; min-height: 54px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; margin: 3px 4px; padding: 5px 0; border: 0; border-radius: 6px; background: transparent; color: var(--theme-on-primary, #fff); cursor: pointer; }
.sidebar-more-toggle > i { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; font-size: 18px; }
.sidebar-more-toggle > span { max-width: 58px; overflow: hidden; font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-more-toggle:hover,
.sidebar-more-toggle[aria-expanded="true"] { background: rgba(255,255,255,.12); }
.narrow-sidebar > .sidebar-primary > .sidebar-menu .menu-item:hover { background: transparent; }
.narrow-sidebar > .sidebar-primary > .sidebar-menu .menu-icon:hover { background: rgba(255,255,255,.12); }
.sidebar-more-menu { position: absolute; left: 58px; bottom: 0; z-index: 220; width: 210px; padding: 7px; border: 1px solid #d8dde5; border-radius: 6px; background: #fff; color: #172033; box-shadow: 0 16px 40px rgba(15,23,42,.24); }
.sidebar-more-menu[hidden] { display: none !important; }
.sidebar-more-menu a { display: flex; min-height: 40px; align-items: center; gap: 10px; padding: 0 10px; border-radius: 5px; color: #334155; font-size: 13px; text-decoration: none; }
.sidebar-more-menu a:hover,
.sidebar-more-menu a:focus-visible { background: #f1f5f9; outline: none; }
.sidebar-more-menu i { width: 20px; color: #64748b; text-align: center; }
.sidebar-tools-popover .menu-icon img {
  filter: brightness(0);
  opacity: .82;
}
.sidebar-tools-action i {
  width: 24px;
  color: #111827;
  background: transparent !important;
  text-align: center;
}
.sidebar-tools-action.logout i { color: #b42318; }
.mobile-account { display: none; position: relative; margin-left: auto; }
.mobile-account-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  color: var(--account-icon-color);
  cursor: pointer;
  overflow: hidden;
}
.mobile-account-toggle img,
.mobile-account-toggle > span { grid-area: 1 / 1; width: 100%; height: 100%; }
.mobile-account-toggle img { object-fit: cover; }
.mobile-account-toggle > span { display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--theme-on-primary, #fff); font-size: 14px; font-weight: 700; }
.mobile-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 500;
  width: min(280px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid #d8dde5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  box-shadow: 0 14px 36px rgba(15,23,42,.22);
}
.mobile-account-menu[hidden] { display: none !important; }
.mobile-account-profile { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center; padding: 4px 5px 10px; border-bottom: 1px solid #e5e7eb; }
.mobile-account-profile-avatar { display: grid; width: 38px; height: 38px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--primary); color: var(--theme-on-primary, #fff); font-weight: 700; }
.mobile-account-profile-avatar img,
.mobile-account-profile-avatar > span { grid-area: 1 / 1; width: 100%; height: 100%; }
.mobile-account-profile-avatar img { object-fit: cover; }
.mobile-account-profile-avatar > span { display: grid; place-items: center; }
.mobile-account-profile strong,
.mobile-account-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-account-profile small { margin-top: 2px; color: #64748b; }
.mobile-account-menu > button { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 10px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: #334155; text-align: left; }
.mobile-account-menu > button:hover { background: #f1f5f9; }
.mobile-account-menu > button.logout { color: #b42318; }
.mobile-more-chevron { margin-left: auto; font-size: 10px; transition: transform .16s ease; }
#mobile-more-toggle[aria-expanded="true"] .mobile-more-chevron { transform: rotate(180deg); }
.mobile-more-links { margin: 2px 0 5px 34px; padding-left: 8px; border-left: 1px solid #e5e7eb; }
.mobile-more-links[hidden] { display: none !important; }
.mobile-more-links a { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 0 8px; border-radius: 5px; color: #475569; font-size: 13px; text-decoration: none; }
.mobile-more-links a:hover,
.mobile-more-links a:focus-visible { background: #f1f5f9; outline: none; }
.mobile-more-links i { width: 18px; color: #64748b; text-align: center; }
@media (max-width: 768px) {
  .mobile-account { display: block; }
}

.web-share-dialog { box-sizing:border-box; width: min(420px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; }
.web-share-dialog::backdrop { background: rgba(15, 23, 42, .46); }
.web-share-dialog .share-modal-header h3 i { margin-right: 7px; }
.web-share-card { display:flex; align-items:center; gap:12px; margin-top:16px; padding:14px; border:1px solid var(--border-light); border-radius:8px; background:var(--white); }
.web-share-card img { width:52px; height:52px; flex:none; object-fit:contain; border-radius:8px; background:#fff; }
.web-share-card > div { min-width:0; }
.web-share-card-title { display:block; color:var(--text-primary); font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.web-share-card p { margin:5px 0 0; color:var(--text-secondary); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.web-share-qr-wrap { display: grid; width: 220px; min-height: 220px; margin: 0 auto 14px; padding: 12px; place-items: center; border: 1px solid var(--border-light); border-radius: 6px; background: #fff; }
.web-share-qr { display: block; width: 194px; height: 194px; object-fit: contain; }
.web-share-qr-status { color: var(--text-muted); font-size: 12px; text-align: center; }
.web-share-url { overflow-wrap: anywhere; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 5px; background: var(--gray-hover); color: var(--text-secondary); font-size: 12px; user-select: text; -webkit-user-select: text; }
.web-share-actions { display: flex; justify-content: flex-end; flex-wrap:wrap; gap: 8px; margin-top: 14px; }
.web-share-actions button, .web-share-actions .web-share-preview { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--border-light); border-radius: 5px; background: var(--white); color: var(--text-primary); cursor: pointer; text-decoration: none; }
.web-share-actions button.primary { border-color: #111827; background: #111827; color: #fff; }

html[data-color-mode="dark"] .chart-result,
html[data-color-mode="dark"] .table-result,
html[data-color-mode="dark"] .chart-result [id^="echarts-"],
html[data-color-mode="dark"] .chart-result [id^="echarts_"] {
  background: var(--white) !important;
  border-color: var(--border-light) !important;
}

/* Give charts a deliberate surface and boundary instead of floating on white. */
#chat-container .chart-result {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light)) !important;
  border-radius: 10px;
  background: color-mix(in srgb, var(--white) 94%, var(--primary-light)) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  overflow: hidden;
}

#chat-container .chart-result [id^="echarts-"],
#chat-container .chart-result [id^="echarts_"] {
  min-height: 360px;
  border-radius: 7px;
}

#chat-container .chart-result canvas { border-radius: 7px; }

/* Mobile retains its compact character; desktop conversations use the title. */
.welcome-character { width: 96px !important; height: 96px !important; }
.chat-header-title {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  min-width: 0;
  max-width: min(640px, calc(100% - 180px));
  transform: translateX(-50%);
}
.chat-header-title #current-chat-title {
  position: static;
  max-width: none;
  overflow: hidden;
  margin: 0 !important;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: none;
}
.chat-header-brand {
  display: none;
  position: absolute;
  top: calc(100% - 28px);
  left: 50%;
  z-index: 2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.chat-header-character {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.chat-header-agent-name {
  margin-top: -2px;
  padding: 2px 12px 3px;
  border-radius: 999px;
  background: var(--white);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
body.has-active-chat .chat-header {
  height: 56px;
  min-height: 56px;
  flex-shrink: 0;
  overflow: visible;
}
body.has-active-chat .chat-header-brand { display: flex; }
body.has-active-chat .chat-header-title #current-chat-title { transform: translateY(-8px); }
@media (max-width: 768px) {
  .chat-header-title { max-width: calc(100% - 106px); gap: 4px; }
  .chat-header-character { width: 42px; height: 42px; }
  body.has-active-chat .chat-header { height: 52px; min-height: 52px; }
}

@media (min-width: 769px) {
  html:not([data-composer-workspace-mode="development"]) #system-pages-bar {
    display: none !important;
  }
  body.has-active-chat .chat-header-brand { display: none !important; }
  body.has-active-chat .chat-header-title #current-chat-title { transform: none; }
}

/* Final typography and workspace color tokens for the compact sidebar. */
.narrow-sidebar .menu-label,
.narrow-sidebar .sidebar-action-label,
.sidebar-more-toggle > span {
  font-size: 12px !important;
  font-weight: 500 !important;
}

.welcome-mode-label {
  display: none !important;
}

.welcome-mode-label--work {
  color: #0878FA !important;
}

.welcome-mode-label--development {
  color: #0751ED !important;
}

.voice-hold-btn,
.voice-hold-btn span,
html.voice-input-mode .voice-hold-btn {
  color: #000000 !important;
  -webkit-text-fill-color: currentColor;
  font-weight: 500 !important;
}

/* Center only the fallback initial, retaining the original profile layout.
   Inline display changes from renderUserAvatar must still hide the initial. */
.sidebar-account-profile > .sidebar-account-avatar {
  display: grid;
  margin-top: 0;
}
.sidebar-account-profile > .sidebar-account-avatar > img,
.sidebar-account-profile > .sidebar-account-avatar > span {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}
.sidebar-account-profile > .sidebar-account-avatar > span {
  display: grid;
  place-items: center;
  margin-top: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}
.sidebar-account-profile > div { min-width: 0; }

/* Center the AUTU character as a compact agent mark on the welcome page. */
.welcome-agent-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 22px;
}
.welcome-agent-name {
  margin-top: -3px;
  padding: 3px 14px 4px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border-light));
  border-radius: 999px;
  background: var(--white);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .04em;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Sent message bubbles and emphasized replies follow the live accent color. */
#chat-container .message-user {
  background: color-mix(in srgb, var(--theme-accent, var(--primary)) 14%, var(--white)) !important;
  border-color: color-mix(in srgb, var(--theme-accent, var(--primary)) 26%, var(--border-light)) !important;
}
#chat-container .markdown-content strong,
#chat-container .markdown-content b {
  color: var(--theme-accent, var(--primary-dark)) !important;
}

/* Match the preview-to-table gap between the following smart-answer sections. */
#chat-container :is(.relative, .message-ai):has(.smart-answer-preview-bar) .markdown-content,
#chat-container :is(.relative, .message-ai):has(.smart-answer-preview-bar) .suggestion-recommendations {
  margin-top: 8px;
}
