  * { box-sizing: border-box; }
  html, body, #app { height: 100%; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f3f4f6;
    color: #111827;
  }
  /* ===== 整体布局 ===== */
  .main-container { height: 100vh; }
  .sidebar {
    background-color: #1f2937;
    color: rgba(255,255,255,0.75);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #111827;
    transition: width 0.25s;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
  .sidebar-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 1px;
    position: sticky; top: 0;
    background: #1f2937;
    z-index: 2;
  }
  .sidebar-logo .logo-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #2563eb; margin-right: 10px;
    box-shadow: 0 0 8px rgba(37,99,235,0.6);
  }
  .menu-wrap { padding: 8px 0; }
  .menu-item {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 46px;
    cursor: pointer;
    color: rgba(255,255,255,0.72);
    transition: background 0.15s, color 0.15s;
    font-size: 14px;
    user-select: none;
    border-left: 3px solid transparent;
  }
  .menu-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .menu-item.active {
    background: rgba(37,99,235,0.25);
    color: #fff;
    border-left-color: #2563eb;
    font-weight: 500;
  }
  .menu-item .el-icon { margin-right: 10px; font-size: 16px; }
  .menu-item .menu-label { flex: 1; }
  .menu-item .arrow { transition: transform 0.2s; font-size: 12px; }
  .menu-item .arrow.open { transform: rotate(90deg); }
  .submenu { background: rgba(0,0,0,0.18); overflow: hidden; }
  .submenu-item {
    display: flex;
    align-items: center;
    padding: 0 20px 0 52px;
    height: 40px;
    cursor: pointer;
    color: #9aa8b8;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    border-left: 3px solid transparent;
  }
  .submenu-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
  .submenu-item.active { color: #93c5fd; background: rgba(37,99,235,0.22); border-left-color: #2563eb; }

  /* ===== 侧边栏缩起状态 ===== */
  .sidebar.collapsed .menu-label { display: none; }
  .sidebar.collapsed .arrow { display: none; }
  .sidebar.collapsed .submenu { display: none !important; }
  .sidebar.collapsed .sidebar-logo span:last-child { display: none; }
  .sidebar.collapsed .menu-item { justify-content: center; padding: 0; }
  .sidebar.collapsed .menu-item .el-icon { margin-right: 0; }

  /* ===== 顶部 ===== */
  .header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .header-left { display: flex; align-items: center; gap: 12px; }
  .breadcrumb { font-size: 15px; color: #4b5563; }
  .breadcrumb .cur { color: #111827; font-weight: 600; }
  .header-user { display: flex; align-items: center; gap: 16px; }
  .user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; }
  .user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #2563eb; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
  }
  .role-tag { font-size: 12px; color: #6b7280; }

  /* ===== 下拉菜单样式修复 ===== */
  .el-dropdown-menu__item {
    color: #4b5563 !important;
    text-decoration: none !important;
  }
  .el-dropdown-menu__item:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
  }
  .el-dropdown-menu__item.is-divided {
    border-top: 1px solid #e5e7eb !important;
  }

  /* ===== 主内容 ===== */
  .main-content {
    background: #f3f4f6;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }
  .page-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
  }
  .page-title {
    font-size: 20px; font-weight: 600; color: #111827; margin: 0 0 4px;
  }
  .page-desc { color: #6b7280; font-size: 13px; margin: 0 0 20px; }

  /* ===== 统计卡片 ===== */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
  .stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 3px solid #2563eb;
    transition: box-shadow 0.2s, transform 0.15s;
  }
  .stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .stat-card .stat-label { color: #6b7280; font-size: 13px; }
  .stat-card .stat-value {
    font-size: 28px; font-weight: 600; color: #111827; margin-top: 6px;
    line-height: 1.2;
  }
  .stat-card .stat-sub { color: #9ca3af; font-size: 12px; margin-top: 4px; }
  .stat-card.green { border-left-color: #059669; }
  .stat-card.orange { border-left-color: #d97706; }
  .stat-card.red { border-left-color: #dc2626; }
  .stat-card.purple { border-left-color: #7c3aed; }

  /* ===== 状态点 ===== */
  .status-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
  }
  .status-dot.green { background: #059669; box-shadow: 0 0 6px rgba(5,150,105,0.5); }
  .status-dot.red { background: #dc2626; box-shadow: 0 0 6px rgba(220,38,38,0.5); }
  .status-dot.yellow { background: #d97706; box-shadow: 0 0 6px rgba(217,119,6,0.5); }
  .status-dot.gray { background: #9ca3af; }

  /* ===== 筛选栏 ===== */
  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
  }
  .filter-bar .search-input { width: 280px; }
  .filter-bar .spacer { flex: 1; }

  /* ===== 表格 ===== */
  .leads-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
  }
  .leads-table-wrap .el-table { font-size: 13px; }
  .leads-table-wrap .el-table .cell { white-space: nowrap; }
  .leads-table-wrap .el-table th.el-table__cell {
    background: #f8fafc; color: #374151; font-weight: 600;
  }
  .icp-tag { font-weight: 600; }
  .icp-tag.hot { color: #dc2626; }
  .icp-tag.warm { color: #d97706; }
  .icp-tag.cool { color: #2563eb; }
  .icp-tag.cold { color: #6b7280; }

  .status-tag-new { color: #2563eb; }
  .status-tag-pending { color: #d97706; font-weight: 600; }
  .status-tag-handoff { color: #7c3aed; }
  .status-tag-closed { color: #059669; }

  /* ===== 分页 ===== */
  .pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .pagination-info { color: #6b7280; font-size: 13px; }

  /* ===== 仪表盘 ===== */
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
  .wa-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
  }
  .wa-account-row:last-child { border-bottom: none; }
  .wa-account-row .wa-name { color: #374151; font-weight: 500; }
  .wa-account-row .wa-meta { color: #9ca3af; font-size: 12px; margin-top: 2px; }

  .audit-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
  }
  .audit-row:last-child { border-bottom: none; }
  .audit-row .audit-time { color: #9ca3af; width: 140px; flex-shrink: 0; font-size: 12px; }
  .audit-row .audit-user { color: #2563eb; width: 100px; flex-shrink: 0; }
  .audit-row .audit-action { color: #374151; flex: 1; }
  .audit-row .audit-result { width: 70px; flex-shrink: 0; text-align: right; }

  /* ===== 加载 ===== */
  .loading-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #6b7280;
  }

  /* ===== 占位页 ===== */
  .placeholder-box {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
  }
  .placeholder-box .el-icon { font-size: 48px; margin-bottom: 16px; color: #d1d5db; }
  .placeholder-box .ph-title { font-size: 16px; color: #6b7280; margin-bottom: 8px; }
  .placeholder-box .ph-desc { font-size: 13px; color: #9ca3af; }

  .section-title {
    font-size: 15px; font-weight: 600; color: #111827;
    margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
  }
  .section-title .el-icon { color: #2563eb; }

  .text-muted { color: #9ca3af; }
  .text-success { color: #059669; }
  .text-danger { color: #dc2626; }
  .text-warning { color: #d97706; }

  /* ===== 仪表盘 - 客服状态栏 ===== */
  .agent-status-bar {
    background: #fff;
    border-radius: 8px;
    padding: 14px 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
    margin-bottom: 16px;
  }
  .agent-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .agent-status-item .agent-name {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
  }
  .agent-status-item .agent-status-text {
    font-size: 12px;
  }
  .agent-status-item .agent-status-text.online { color: #059669; }
  .agent-status-item .agent-status-text.offline { color: #dc2626; }
  .agent-status-item .agent-status-text.warning { color: #d97706; }
  .agent-status-item .agent-times {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
  }

  /* ===== 仪表盘 - 统计卡片分组 ===== */
  .stat-grid-flow { border-left-color: #2563eb; }
  .stat-grid-stock { border-left-color: #7c3aed; }
  .stat-change { font-size: 12px; font-weight: 600; margin-left: 6px; }
  .stat-change.up { color: #059669; }
  .stat-change.down { color: #dc2626; }

  /* ===== 仪表盘 - 趋势图 ===== */
  .trend-section {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 16px;
  }
  .trend-section .section-title { margin-bottom: 12px; }
  .trend-chart-wrap { height: 260px; }

  /* ===== 仪表盘 - AI动态 ===== */
  .ai-activity-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 16px;
  }
  .ai-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .ai-activity-header .section-title { margin-bottom: 0; }
  .ai-view-all { font-size: 12px; color: #2563eb; cursor: pointer; }
  .ai-view-all:hover { color: #1e40af; }
  .ai-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .ai-item {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
  }
  .ai-item:last-child { border-bottom: none; }
  .ai-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    flex-shrink: 0;
  }
  .ai-customer-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
  }
  .ai-status-tag {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
  }
  .ai-status-tag.new { background: #eff6ff; color: #2563eb; }
  .ai-status-tag.contacting { background: #ecfdf5; color: #059669; }
  .ai-status-tag.assigned,
  .ai-status-tag.pending_handoff { background: #f5f3ff; color: #7c3aed; }
  .ai-status-tag.handed_off,
  .ai-status-tag.closed { background: #f3f4f6; color: #6b7280; }
  .ai-status-tag.scheme_stage,
  .ai-status-tag.quoting { background: #fffbeb; color: #d97706; }
  .ai-status-tag.deal_won,
  .ai-status-tag.qualified { background: #ecfdf5; color: #059669; }
  .ai-status-tag.lost { background: #fef2f2; color: #dc2626; }
  .ai-notes-preview {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
    margin-left: 36px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px;
  }
  .ai-notes-preview:hover { color: #2563eb; }
  .ai-time {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
  }
  /* AI动态悬浮浮窗 */
  .ai-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 36px;
    right: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 100;
    font-size: 12px;
    color: #374151;
    line-height: 1.7;
    margin-top: 4px;
    max-height: 160px;
    overflow-y: auto;
  }
  .ai-item:hover .ai-tooltip { display: block; }
  .ai-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    transform: rotate(45deg);
  }

  /* ===== Markdown 渲染 ===== */
  .markdown-body { font-size: 14px; line-height: 1.7; color: #111827; }
  .markdown-body h1 { font-size: 22px; margin: 16px 0 10px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
  .markdown-body h2 { font-size: 18px; margin: 14px 0 8px; }
  .markdown-body h3 { font-size: 16px; margin: 12px 0 6px; }
  .markdown-body h4 { font-size: 14px; margin: 10px 0 4px; }
  .markdown-body p { margin: 8px 0; }
  .markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 8px 0; }
  .markdown-body li { margin: 4px 0; }
  .markdown-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
  .markdown-body th, .markdown-body td { border: 1px solid #d1d5db; padding: 6px 10px; text-align: left; }
  .markdown-body th { background: #f3f4f6; font-weight: 600; }
  .markdown-body code { background: #f3f4f6; padding: 2px 5px; border-radius: 3px; font-family: Consolas, Monaco, monospace; font-size: 13px; }
  .markdown-body pre { background: #1e293b; color: #e5e7eb; padding: 12px; border-radius: 6px; overflow-x: auto; }
  .markdown-body pre code { background: none; padding: 0; color: inherit; }
  .markdown-body blockquote { border-left: 4px solid #d1d5db; padding-left: 12px; color: #6b7280; margin: 8px 0; }
  .markdown-body hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
  .markdown-body strong { font-weight: 600; }
  .markdown-body a { color: #2563eb; text-decoration: none; }
  .markdown-body a:hover { text-decoration: underline; }
  .markdown-body img { max-width: 100%; border-radius: 4px; }

/* ===== 对话页面 ===== */
.conv-page { 
  display: flex !important; 
  flex-direction: row !important; 
  flex-wrap: nowrap !important;
  height: calc(100vh - 120px) !important; 
  margin: -20px;
  background: #fff;
  overflow: hidden;
}
.conv-sidebar { 
  width: 320px !important; 
  min-width: 320px !important; 
  flex-shrink: 0 !important;
  border-right: 1px solid #e5e7eb; 
  display: flex; 
  flex-direction: column; 
  background: #fff; 
  height: 100% !important;
}
.conv-filter { padding: 12px; border-bottom: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 8px; }
.conv-list { flex: 1; overflow-y: auto; }
.conv-empty { padding: 40px 20px; text-align: center; color: #9ca3af; font-size: 13px; }
.conv-item { padding: 12px 16px; border-bottom: 1px solid #f5f5f5; cursor: pointer; transition: background 0.15s; }
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: #eff6ff; border-left: 3px solid #2563eb; }
.conv-item-name { font-size: 14px; font-weight: 500; color: #111827; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item-meta { display: flex; justify-content: space-between; align-items: center; }
.conv-item-time { font-size: 12px; color: #9ca3af; }
.conv-item-tag { font-size: 11px; color: #6b7280; background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }

.conv-main { 
  flex: 1 1 0 !important; 
  min-width: 300px !important;
  display: flex; 
  flex-direction: column; 
  background: #fff; 
  border-right: 1px solid #e5e7eb;
  height: 100% !important;
  position: relative;
}
.conv-header { padding: 12px 20px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.conv-header-name { font-size: 16px; font-weight: 600; color: #111827; }
.conv-messages { flex: 1; overflow-y: auto; padding: 20px; background: #f3f4f6; }
.conv-loading { text-align: center; color: #9ca3af; padding: 20px; }
.conv-load-more { text-align: center; color: #2563eb; cursor: pointer; padding: 8px; font-size: 13px; }
.msg-bubble { max-width: 70%; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; position: relative; }
.msg-left { margin-right: auto; background: #fff; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.msg-right { margin-left: auto; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.msg-content { font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.msg-meta { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; font-size: 11px; opacity: 0.7; align-items: center; }
.msg-failed { color: #dc2626; cursor: pointer; }
.msg-sender { font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 500; opacity: 0.85; color: #fff; }
.msg-sender-bot { background: transparent; }
.msg-sender-human { background: rgba(245, 158, 11, 0.3); }
.conv-input-area { padding: 12px 20px; border-top: 1px solid #e5e7eb; }
.conv-input-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; align-items: center; }
.wt-spacer { flex: 1; }
.wt-lang-select { width: 110px; }

/* ===== 会话翻译：气泡内译文展示 ===== */
.msg-translate-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin: 8px 0 6px;
}
.msg-bubble.msg-right .msg-translate-divider {
  border-top-color: rgba(255, 255, 255, 0.35);
}
.msg-translate-content {
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-bubble.msg-right .msg-translate-content {
  color: rgba(255, 255, 255, 0.92);
}

/* ===== 边写边译：输入框上方翻译结果区 ===== */
.wt-result {
  background: #f0f7ff;
  border: 1px solid #bcd9ff;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
}
.wt-result-text {
  font-size: 13px;
  line-height: 1.5;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}
.wt-result-loading { color: #94a3b8; font-size: 12px; }
.wt-result-actions { display: flex; gap: 6px; margin-top: 5px; }
.conv-input-disabled { padding: 12px 20px; border-top: 1px solid #e5e7eb; text-align: center; color: #9ca3af; font-size: 13px; background: #f9fafb; }
.conv-main-empty { display: flex; align-items: center; justify-content: center; }
.conv-empty-hint { text-align: center; color: #d1d5db; font-size: 15px; }

.conv-profile { 
  width: 320px !important; 
  min-width: 320px !important;
  flex-shrink: 0 !important;
  background: #fff; 
  overflow-y: auto; 
  height: 100% !important;
}
.conv-profile-header { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; color: #111827; }
.conv-profile-empty { padding: 40px 20px; text-align: center; color: #9ca3af; font-size: 13px; }
.conv-profile-body { padding: 8px 0; }
.profile-group { border-bottom: 1px solid #f5f5f5; }
.profile-group-title { padding: 8px 16px; font-size: 13px; font-weight: 600; color: #6b7280; background: #f9fafb; }
.profile-field { display: flex; padding: 6px 16px; font-size: 13px; align-items: flex-start; }
.profile-field-label { color: #9ca3af; width: 90px; flex-shrink: 0; }
.profile-field-value { color: #374151; flex: 1; word-break: break-all; }
.profile-field-value.profile-field-editable { color: #2563eb; cursor: default; }
.profile-field-edit-icon { color: #9ca3af; font-size: 12px; margin-left: 4px; flex-shrink: 0; cursor: pointer; }
.profile-field-edit-icon:hover { color: #2563eb; }
.profile-field-input { flex: 1; min-width: 120px; }
.profile-field-actions { display: flex; gap: 6px; margin-top: 4px; width: 100%; justify-content: flex-start; }
.profile-field-actions .el-button + .el-button { margin-left: 0; }

/* 标签展示 */
.profile-tags-display { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.profile-tags-display .profile-field-edit-icon { margin-left: 4px; cursor: pointer; color: #2563eb; }
.profile-tag-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; line-height: 20px; border: 1px solid; flex-shrink: 0; white-space: nowrap; }
.tag-pill-parent { opacity: 0.65; font-size: 11px; margin-right: 2px; }

.whatsapp-link { color: #2563eb; cursor: pointer; text-decoration: underline; }
.whatsapp-link:hover { color: #1e40af; }

/* ===== 可编辑单元格样式 ===== */
.editable-cell {
  cursor: pointer;
  color: #2563eb;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.editable-cell:hover {
  color: #1e40af;
}
.editable-tag {
  cursor: pointer;
}

/* ==================== 产品知识库页面 ==================== */
.productkb-layout {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  min-height: 500px;
}

.productkb-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.productkb-sidebar .sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.productkb-sidebar .sidebar-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  max-height: 600px;
}

.productkb-sidebar .sidebar-tree .el-tree {
  background: transparent;
}

.productkb-sidebar .sidebar-tree .el-tree-node__content {
  height: 36px;
  padding-left: 12px !important;
  border-radius: 6px;
  margin: 2px 8px;
  transition: background 0.15s;
}

.productkb-sidebar .sidebar-tree .el-tree-node__content:hover {
  background: #f1f5f9;
}

.productkb-sidebar .sidebar-tree .el-tree-node.is-current > .el-tree-node__content {
  background: #eff6ff;
  color: #2563eb;
}

.tree-node-label {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: #4b5563;
  overflow: hidden;
}

.tree-node-label .el-icon {
  color: #d97706;
  flex-shrink: 0;
}

.tree-node-count {
  margin-left: 4px;
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.productkb-main {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
}

.breadcrumb-bar {
  padding: 10px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.breadcrumb-bar .el-breadcrumb__inner a {
  color: #2563eb;
  text-decoration: none;
  transition: opacity 0.15s;
}

.breadcrumb-bar .el-breadcrumb__inner a:hover {
  opacity: 0.75;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.section-title .el-icon {
  color: #2563eb;
}

.subdir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.subdir-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.subdir-card:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.subdir-icon {
  font-size: 32px;
  color: #d97706;
  margin-bottom: 8px;
}

.subdir-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  text-align: center;
  word-break: break-all;
  line-height: 1.4;
}

.subdir-count {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}
.editable-tag:hover {
  opacity: 0.8;
}

/* ==================== 标签配置页面 ==================== */
.tag-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.tag-config-card {
  background: #fff;
  border: 1px solid var(--tag-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.tag-config-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.tag-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--tag-bg, #f3f4f6);
  border-bottom: 1px solid var(--tag-border, #e5e7eb);
}

.tag-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tag-text, #111827);
}

.tag-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tag-accent, #2563eb);
  flex-shrink: 0;
}

.tag-card-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--tag-text, #4b5563);
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

.tag-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.tag-config-card:hover .tag-card-actions {
  opacity: 1;
}

.tag-card-body {
  padding: 12px 16px 14px;
}

.tag-card-empty {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
}

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--tag-bg, #f3f4f6);
  border: 1px solid var(--tag-border, #e5e7eb);
  border-radius: 16px;
  font-size: 13px;
  color: var(--tag-text, #4b5563);
  transition: all 0.15s;
}

.tag-chip:hover {
  background: var(--tag-accent, #2563eb);
  color: #fff;
  border-color: var(--tag-accent, #2563eb);
}

.tag-chip:hover .tag-chip-btn {
  color: rgba(255, 255, 255, 0.85);
}

.tag-chip:hover .tag-chip-del {
  color: #fbbfbf;
}

.tag-chip-text {
  line-height: 1.4;
}

.tag-chip-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.tag-chip:hover .tag-chip-actions {
  opacity: 1;
}

.tag-chip-btn {
  font-size: 12px;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.15s;
}

.tag-chip-btn:hover {
  color: #2563eb;
}

.tag-chip-del:hover {
  color: #dc2626 !important;
}

/* 标签药丸中的父标签名 */
.tag-pill-parent {
  opacity: 0.65;
  font-size: 11px;
  margin-right: 2px;
}

/* ===== 会话页面 - 媒体文件展示 ===== */
.msg-media {
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.msg-media-img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.15s;
}
.msg-media-img:hover {
  transform: scale(1.03);
}
.msg-media-file {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
}
.msg-media-file:hover {
  background: rgba(0,0,0,0.1);
}
/* 外发气泡(蓝底)中的媒体文件名用白色，避免蓝底蓝字看不清 */
.msg-right .msg-media-file {
  color: #fff;
  text-decoration: underline;
}
.msg-media-uploading {
  color: #9ca3af;
  font-style: italic;
}

/* ===== 图片灯箱 ===== */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 16px; right: 24px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}
.lightbox-close:hover {
  color: #d97706;
}

/* ===== 会话列表加载更多 ===== */
.conv-load-more-btn {
  text-align: center;
  padding: 8px;
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
}
.conv-load-more-btn:hover {
  background: rgba(37, 99, 235, 0.05);
}

/* ===== 回到顶部按钮 ===== */
.backtop-btn {
  width: 40px;
  height: 40px;
  cursor: pointer;
  background-image: url('/images/up_grey.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity 0.3s;
}
.backtop-btn:hover {
  background-image: url('/images/up_blue.svg');
}

/* ===== MD 目录栏 ===== */
.md-content-wrapper {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}
.md-content-wrapper.with-toc .md-content-main {
  flex: 1;
  min-width: 0;
  margin-left: 220px;
}
.md-toc-sidebar {
  position: fixed;
  width: 200px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  z-index: 100;
}
.md-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 8px 8px 0 0;
  z-index: 1;
}
.md-toc-list {
  padding: 6px 0;
}
.md-toc-item {
  padding: 6px 12px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 2px solid transparent;
}
.md-toc-item:hover {
  background: #eff6ff;
  color: #2563eb;
}
.md-toc-item.active {
  color: #2563eb;
  background: #eff6ff;
  border-left-color: #2563eb;
  font-weight: 500;
}
.md-toc-level-1 { font-weight: 600; padding-left: 12px; }
.md-toc-level-2 { padding-left: 24px; }
.md-toc-level-3 { padding-left: 36px; font-size: 12px; }
.md-toc-level-1.active,
.md-toc-level-2.active,
.md-toc-level-3.active { font-weight: 600; }

/* ===== 许可证管理页面 ===== */
.license-page {
  padding: 8px 0;
}
.license-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  max-width: 720px;
  margin: 0 auto;
}
.license-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
}
.license-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px;
}
.license-status { padding: 0 0 4px; }

/* ===== 通知铃铛 ===== */
.notification-bell {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s;
  color: #4b5563;
}
.notification-bell:hover {
  background: #f3f4f6;
  color: #2563eb;
}
.notification-bell .bell-badge .el-badge__content {
  font-size: 11px;
}

/* ===== 消息中心 ===== */
.notification-row {
  cursor: pointer;
}
.notification-row:hover td {
  background: #f3f4f6 !important;
}
.notification-content-preview {
  color: #6b7280;
  font-size: 13px;
}
.notification-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
.notification-empty p {
  margin-top: 12px;
  font-size: 14px;
}
.notification-detail {
  padding: 0 4px;
}
.notification-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.notification-detail-time {
  font-size: 13px;
  color: #6b7280;
}
.notification-detail-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px;
  line-height: 1.5;
}
.notification-detail-content {
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 拖拽高亮提示层 ===== */
.drag-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 3px dashed #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}
.drag-overlay-content {
  text-align: center;
  color: #2563eb;
  font-size: 18px;
  font-weight: 600;
}
.drag-overlay-content .el-icon {
  margin-bottom: 12px;
}

/* ===== 文件确认对话框 ===== */
.file-confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.file-confirm-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.file-confirm-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  color: #111827;
}
.file-confirm-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 120px;
}
.file-confirm-thumb {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: contain;
}
.file-confirm-icon {
  color: #6b7280;
}
.file-confirm-info {
  text-align: center;
  margin-bottom: 20px;
}
.file-confirm-name {
  font-size: 14px;
  color: #111827;
  word-break: break-all;
  margin-bottom: 4px;
}
.file-confirm-size {
  font-size: 12px;
  color: #6b7280;
}
.file-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ===== 未读消息角标 ===== */
.conv-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
}

/* ===== 未读消息高亮 ===== */
.msg-unread-highlight {
  animation: unreadHighlight 2s ease-out;
}
@keyframes unreadHighlight {
  0% { background-color: rgba(64, 158, 255, 0.3); }
  100% { background-color: transparent; }
}

/* ===== 未读跳转浮动提示 ===== */
.unread-jump-toast {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #111827;
  z-index: 10;
  cursor: pointer;
}
