/* 全局样式 */
:root {
  --primary-color: #1890ff;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --danger-color: #f5222d;
  --text-color: #333;
  --light-bg: #f0f2f5;
  --border-color: #e8e8e8;
}

/* 更改滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--light-bg);
}
.bg-info {
  background-color: var(--primary-color) !important;
}
/* 左侧导航栏 */
.sidebar {
  background-color: #001529;
  color: rgba(255, 255, 255, 0.65);
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 0;
  box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.65);
  padding: 12px 15px;
  margin: 4px 0;
  border-radius: 0;
  transition: all 0.3s;
}
textarea.form-control {
  font-size: 0.85rem;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background-color: #1890ff;
}

.sidebar .nav-link i {
  margin-right: 8px;
}

.sidebar .submenu-indicator {
  transition: transform 0.3s;
  font-size: 12px;
}

.sidebar .nav-link-parent[aria-expanded="true"] .submenu-indicator {
  transform: rotate(180deg);
}

.sidebar .submenu {
  padding-left: 15px;
  margin-bottom: 10px;
}

.sidebar .submenu .nav-link {
  padding: 8px 15px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.sidebar .submenu .nav-link:hover {
  opacity: 1;
  background-color: rgba(24, 144, 255, 0.7);
}

.sidebar .submenu .nav-link i {
  font-size: 0.85rem;
}

/* 主内容区 */
.main-content {
  padding: 10px 20px;
  background-color: var(--light-bg);
  min-height: 100vh;
}

/* 页面主标题样式 */
.main-content h2 {
  font-size: 1.5rem; /* 原本可能是2rem左右，改小为1.5rem */
  font-weight: 500;
  color: #333;
}

/* 卡片样式 */
.card {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
}
.badge .translate-middle {
  transform: translate(50%, -50%) !important;
}
/* Logo 样式 */
.logo-img {
  height: 40px;
  max-width: 100%;
}
.logo-text {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  margin-left: 10px;
  display: inline-block;
}
/* 会话列表 */
.conversation-list {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.conversation-list .list-group-item {
  padding: 10px 15px;
  border-left: none;
  border-right: none;
}

.conversation-list .list-group-item.active {
  background-color: #e6f7ff;
  color: var(--primary-color);
  border-color: var(--border-color);
  border-right: 3px solid var(--primary-color);
}

/* 聊天窗口 */
.chat-window {
  height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 15px;
  background-color: #f5f5f5;
}

.chat-message {
  margin-bottom: 15px;
  display: flex;
}

.chat-message.user {
  justify-content: flex-start;
}

.chat-message.bot {
  justify-content: flex-end;
}

.message-content {
  max-width: 80%;
  border-radius: 8px;
  padding: 10px 12px;
  position: relative;
}

.chat-message.user .message-content .message-time {
  background-color: #e6f7ff;
  color: #333;
  text-align: right;
}
.chat-message.user .message-content {
  background-color: #e6f7ff;
  color: #333;
  text-align: left;
}
.chat-message.bot .message-content {
  background-color: #fff;
  color: #333;
  text-align: left;
}

.message-text {
  word-wrap: break-word;
  margin-bottom: 5px;
}

.message-time {
  font-size: 0.75rem;
  color: #999;
}

.message-type {
  font-size: 0.75rem;
  color: #1890ff;
  margin-top: 2px;
}

/* 快捷回复工具 */
.quick-reply-tools {
  overflow-x: auto;
  white-space: nowrap;
  padding: 5px 0;
}

/* 素材库 */
.image-item {
  cursor: pointer;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  transition: all 0.3s;
}

.image-item:hover {
  border-color: #1890ff;
}

/* 自动回复设置 */
.form-switch .form-check-input {
  width: 36px;
  height: 20px;
}

/* 响应式调整 */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    left: -250px;
    width: 250px !important;
    transition: left 0.3s;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }

  .chat-window {
    height: calc(100vh - 360px);
  }
}

/* 标签页样式 */
.nav-tabs .nav-link {
  color: #666;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  font-weight: 500;
}
.conversation-list .list-group-item {
  font-size: 0.85rem;
}
.conversation-list .list-group-item h6 {
  font-size: 0.9rem;
}
.conversation-list .list-group-item p {
  font-size: 0.8rem;
}
.conversation-list .list-group-item small {
  font-size: 0.75rem;
}
.nav-pills .nav-link.active {
  background-color: var(--primary-color);
}

/* 超时标记 */
.badge.bg-danger {
  animation: pulse 1s infinite;
}
.badge.bg-danger.me-2 {
  animation: none;
}
.badge.rounded-pill.bg-danger {
  animation: none;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
.btn.btn-secondary.btn-sm {
  border-radius: 10px 0 0 0;
}

/* 添加动画效果 */
#notificationHistoryContainer {
  position: fixed;
  bottom: 40px; /* 放在按钮上方 */
  right: 10px;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 10px;
  font-size: 0.875rem; /* 调小字体 */
  z-index: 1055;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px); /* 初始位置稍微向下 */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#notificationHistoryContainer.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* 平滑移动到原位 */
}

/* 统一左中右三块的高度 */
#customer-service .row {
  display: flex;
  align-items: stretch;
}

#customer-service .col-md-3,
#customer-service .col-md-6 {
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#customer-service .card {
  flex: 1;
}
#customerServiceTabs {
  font-size: 0.95rem;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--light-bg);
  border-bottom: 1px solid var(--border-color);
}
#customerServiceTabs li {
  flex-grow: 1;
}
#customerServiceTabs li button {
  text-wrap: nowrap;
  padding: 6px 12px;
}
/* 商品卡片样式 */
.shop-item-card {
  max-width: 300px;
  height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shop-item-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.shop-item-card .card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item-card .card-text.description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
#quickReplyList {
  max-height: 50vh;
  overflow-y: auto;
}
.quickReplyToolBtn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#knowledge-management #left-card {
  height: 37vh;
}
#knowledge-management .col-md-3,
#knowledge-management .col-md-9 {
  height: 100%;
}

.table td[title] {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.table th {
  white-space: nowrap;
}

#bottom-card {
  height: 30vh;
  overflow-y: auto;
  padding: 0 10px;
}
/* 知识库表格列宽限制 */
#right-card .table th:nth-child(1),
#right-card .table td:nth-child(1) {
  width: 22%;
  min-width: 120px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#right-card .table th:nth-child(2),
#right-card .table td:nth-child(2) {
  width: 48%;
  min-width: 160px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#right-card .table th:nth-child(3),
#right-card .table td:nth-child(3) {
  width: 15%;
  min-width: 80px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#right-card .table th:nth-child(4),
#right-card .table td:nth-child(4) {
  width: 15%;
  min-width: 100px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
