/* ===== 根布局 ===== */
.ad-root {
  display: flex;
  height: 100vh;
  background: #f8f9fa;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

/* ===== 左侧导航 ===== */
.ad-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ad-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.ad-logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}

/* 导航菜单 */
.ad-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.ad-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}

.ad-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
}

.ad-nav-active {
  background: rgba(79, 70, 229, 0.25) !important;
  color: white !important;
}

.ad-nav-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ad-sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ===== 主内容区 ===== */
.ad-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* 顶部栏 */
.ad-topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

.ad-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.ad-breadcrumb span:last-child {
  color: #111827;
  font-weight: 600;
}

.ad-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-search-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 14px;
  width: 240px;
}

.ad-search-mini input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #374151;
  width: 100%;
}

.ad-search-mini input::placeholder { color: #9ca3af; }

.ad-icon-btn-top {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.15s;
}
.ad-icon-btn-top:hover { background: #f9fafb; }

.ad-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px 6px 6px;
  border-radius: 8px;
  transition: background 0.15s;
}
.ad-user-menu:hover { background: #f9fafb; }

.ad-user-avatar-top {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-user-menu span {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

/* 内容区 */
.ad-content {
  flex: 1;
  overflow-y: auto;
  background: #f8f9fa;
}

.ad-content-wrap {
  padding: 28px;
  max-width: 1400px;
}

/* ===== 页面头部 ===== */
.ad-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.ad-page-title {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}

.ad-page-sub {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.ad-btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ad-btn-primary:hover { background: #4338ca; }

/* ===== 工具栏 ===== */
.ad-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ad-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 16px;
}

.ad-search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #374151;
  width: 100%;
}

.ad-search-box input::placeholder { color: #9ca3af; }

.ad-filter {
  padding: 10px 14px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  outline: none;
}

.ad-btn-ghost {
  padding: 10px 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}
.ad-btn-ghost:hover { background: #f9fafb; }

/* ===== 表格 ===== */
.ad-table-wrap {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.ad-table {
  width: 100%;
  border-collapse: collapse;
}

.ad-table thead {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.ad-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ad-table td {
  padding: 16px 20px;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.ad-table tbody tr:last-child td {
  border-bottom: none;
}

.ad-table tbody tr:hover {
  background: #f9fafb;
}

/* 用户单元格 */
.ad-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.ad-user-id {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

/* 状态标签 */
.ad-status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.ad-status-active {
  background: #d1fae5;
  color: #065f46;
}

.ad-status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* 操作按钮 */
.ad-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
}
.ad-icon-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* 分页 */
.ad-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  color: #6b7280;
}

.ad-page-btns {
  display: flex;
  gap: 6px;
}

.ad-page-btns button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}

.ad-page-btns button:hover {
  background: #f3f4f6;
  border-color: #4f46e5;
  color: #4f46e5;
}

/* ===== 数据分析页面 ===== */
.ad-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.ad-stat-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ad-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-stat-icon-blue { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.ad-stat-icon-green { background: linear-gradient(135deg, #10b981, #34d399); }
.ad-stat-icon-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.ad-stat-icon-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

.ad-stat-info {
  flex: 1;
}

.ad-stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.ad-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.ad-stat-trend {
  font-size: 12px;
  font-weight: 600;
}

.ad-trend-up { color: #10b981; }
.ad-trend-down { color: #ef4444; }

/* 图表区域 */
.ad-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.ad-chart-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
}

.ad-chart-large {
  grid-column: span 1;
}

.ad-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ad-chart-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.ad-chart-tabs {
  display: flex;
  gap: 4px;
}

.ad-chart-tab {
  padding: 6px 12px;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.ad-chart-tab:hover {
  background: #f9fafb;
}

.ad-chart-tab-active {
  background: #4f46e5 !important;
  color: white !important;
  border-color: #4f46e5 !important;
}

/* 饼图图例 */
.ad-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.ad-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}

.ad-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== 占位符 ===== */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 60px 20px;
}

.ad-placeholder-title {
  font-size: 18px;
  font-weight: 700;
  color: #374151;
  margin-top: 16px;
}

.ad-placeholder-sub {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 8px;
}

/* ===== 聊天信息管理 ===== */
.ad-chat-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  height: calc(100vh - 180px);
}

.ad-chat-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.ad-chat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.ad-chat-list::-webkit-scrollbar {
  width: 6px;
}

.ad-chat-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.ad-chat-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.ad-chat-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.ad-chat-item {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 18px;
  transition: all 0.2s;
}

.ad-chat-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-color: #d1d5db;
}

.ad-chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ad-chat-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-chat-username {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.ad-chat-room {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.ad-risk-tag {
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.ad-risk-low {
  background: #d1fae5;
  color: #065f46;
}

.ad-risk-medium {
  background: #fef3c7;
  color: #92400e;
}

.ad-risk-high {
  background: #fee2e2;
  color: #991b1b;
}

.ad-chat-msg {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 14px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #e5e7eb;
}

.ad-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ad-chat-time {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.ad-chat-actions {
  display: flex;
  gap: 8px;
}

.ad-btn-text {
  padding: 4px 10px;
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.ad-btn-text:hover { background: #eef2ff; }

.ad-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.ad-panel-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
}

.ad-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px;
}

.ad-monitor-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ad-monitor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.ad-monitor-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.ad-monitor-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.ad-text-red { color: #ef4444; }

.ad-ai-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-ai-tip {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.ad-ai-tip-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.ad-ai-tip-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

/* AI分析进度样式 */
.ad-analyze-progress {
  padding: 20px;
}

.ad-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ad-progress-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.ad-progress-status {
  font-size: 13px;
  color: #6b7280;
}

.ad-progress-bar-wrap {
  margin-bottom: 20px;
}

.ad-progress-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ad-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ad-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

.ad-progress-messages {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
}

.ad-progress-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  border-left: 3px solid #e5e7eb;
}

.ad-progress-message.analyzing {
  border-left-color: #3b82f6;
}

.ad-progress-message.normal {
  border-left-color: #10b981;
}

.ad-progress-message.sensitive {
  border-left-color: #ef4444;
}

.ad-progress-message-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.ad-progress-message-content {
  flex: 1;
  color: #374151;
  line-height: 1.5;
}

.ad-progress-message-result {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.ad-progress-message-result.normal {
  background: #d1fae5;
  color: #065f46;
}

.ad-progress-message-result.sensitive {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== 大模型管理 ===== */
.ad-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.ad-model-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  transition: box-shadow 0.15s;
}
.ad-model-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.ad-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ad-model-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-model-status {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.ad-model-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
}

.ad-model-provider {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.ad-model-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
}

.ad-model-stat-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.ad-model-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.ad-model-actions {
  display: flex;
  gap: 8px;
}

/* ===== 工具管理 ===== */
.ad-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.ad-tool-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  transition: box-shadow 0.15s;
}
.ad-tool-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.ad-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ad-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-tool-category {
  padding: 4px 8px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}

.ad-tool-name {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}

.ad-tool-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 16px;
}

.ad-tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.ad-tool-calls {
  font-size: 12px;
  color: #9ca3af;
}

.ad-tool-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ad-status-dot-green { background: #22c55e; }
.ad-status-dot-gray { background: #d1d5db; }

/* ===== 数字员工管理 ===== */
.ad-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.ad-agent-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  transition: box-shadow 0.15s;
}
.ad-agent-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.ad-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ad-agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-agent-status {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.ad-agent-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
}

.ad-agent-role {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.ad-agent-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
}

.ad-agent-info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.ad-agent-info-label {
  color: #9ca3af;
}

.ad-agent-info-value {
  color: #111827;
  font-weight: 600;
}

.ad-agent-actions {
  display: flex;
  gap: 8px;
}

/* 角色标签样式 */
.ad-role-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.ad-role-admin {
  background: #fef3c7;
  color: #92400e;
}

.ad-role-user {
  background: #dbeafe;
  color: #1e40af;
}

/* 图标按钮危险样式 */
.ad-icon-btn-danger {
  color: #ef4444;
}

.ad-icon-btn-danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* 空状态样式 */
.ad-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* 模型网格布局 */
.ad-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 工具网格布局 */
.ad-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* 数字员工网格布局 */
.ad-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 模型卡片样式 */
.ad-model-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.ad-model-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ad-model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ad-model-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ad-model-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}

.ad-model-name {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 12px 0 4px 0;
}

.ad-model-provider {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
  word-break: break-all;
}

.ad-model-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.ad-model-stat-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.ad-model-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.ad-model-actions {
  display: flex;
  gap: 8px;
}

.ad-model-actions .ad-btn-ghost {
  flex: 1;
}

.ad-btn-danger {
  color: #ef4444;
}

.ad-btn-danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

/* 工具卡片样式 */
.ad-tool-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.ad-tool-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ad-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ad-tool-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ad-tool-category {
  font-size: 11px;
  padding: 4px 8px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 6px;
  font-weight: 500;
}

.ad-tool-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 8px 0;
}

.ad-tool-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 40px;
}

.ad-tool-footer {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.ad-tool-footer .ad-btn-ghost {
  flex: 1;
}

.ad-tool-calls {
  font-size: 12px;
  color: #6b7280;
}

.ad-tool-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ad-status-dot-green {
  background: #10b981;
}

.ad-status-dot-gray {
  background: #d1d5db;
}

/* 数字员工卡片样式 */
.ad-agent-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.ad-agent-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ad-agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ad-agent-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ad-agent-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}

.ad-agent-name {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 12px 0 4px 0;
}

.ad-agent-role {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.ad-agent-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 16px;
}

.ad-agent-info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.ad-agent-info-label {
  color: #9ca3af;
}

.ad-agent-info-value {
  color: #111827;
  font-weight: 500;
}

.ad-agent-actions {
  display: flex;
  gap: 8px;
}

.ad-agent-actions .ad-btn-ghost {
  flex: 1;
}

/* 统计卡片网格 */
.ad-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.ad-stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.ad-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-stat-icon-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ad-stat-icon-green {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.ad-stat-icon-orange {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.ad-stat-icon-purple {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.ad-stat-info {
  flex: 1;
}

.ad-stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.ad-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.ad-stat-trend {
  font-size: 12px;
  font-weight: 500;
}

.ad-trend-up {
  color: #10b981;
}

.ad-trend-down {
  color: #ef4444;
}

/* 图表行布局 */
.ad-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.ad-chart-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.ad-chart-large {
  grid-column: span 1;
}

.ad-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ad-chart-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.ad-chart-tabs {
  display: flex;
  gap: 8px;
}

.ad-chart-tab {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.ad-chart-tab:hover {
  background: #f9fafb;
}

.ad-chart-tab-active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

/* 饼图图例 */
.ad-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.ad-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.ad-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .ad-charts-row {
    grid-template-columns: 1fr;
  }
  
  .ad-models-grid,
  .ad-tools-grid,
  .ad-agents-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .ad-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .ad-models-grid,
  .ad-tools-grid,
  .ad-agents-grid {
    grid-template-columns: 1fr;
  }
}

/* 工具徽章 */
.ad-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 12px;
}

.ad-tool-badge svg {
  flex-shrink: 0;
}

/* ===== AI工具生成样式 ===== */
.ad-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.ad-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 工具预览样式 */
.ad-generated-tool-preview {
  max-height: 600px;
  overflow-y: auto;
}

.ad-tool-preview-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.ad-tool-preview-section:last-child {
  border-bottom: none;
}

.ad-tool-preview-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.ad-tool-preview-value {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.6;
}

.ad-tool-preview-code {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #374151;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 滚动条样式 */
.ad-generated-tool-preview::-webkit-scrollbar {
  width: 6px;
}

.ad-generated-tool-preview::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.ad-generated-tool-preview::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.ad-generated-tool-preview::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ===== 工具调用记录样式 ===== */
.ad-tool-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ad-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
}

.ad-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ad-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-stat-content {
  flex: 1;
}

.ad-stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.ad-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

/* 调用记录列表 */
.ad-tool-logs-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.ad-tool-logs-list::-webkit-scrollbar {
  width: 6px;
}

.ad-tool-logs-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.ad-tool-logs-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.ad-tool-logs-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.ad-log-item {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  transition: all 0.2s;
}

.ad-log-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ad-log-item.success {
  border-left: 4px solid #10b981;
}

.ad-log-item.error {
  border-left: 4px solid #ef4444;
}

.ad-log-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.ad-log-time {
  font-size: 13px;
  color: #6b7280;
  font-family: 'Courier New', monospace;
}

.ad-log-status {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.ad-log-status.success {
  background: #d1fae5;
  color: #065f46;
}

.ad-log-status.error {
  background: #fee2e2;
  color: #991b1b;
}

.ad-log-time-cost {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.ad-log-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #374151;
}

.ad-log-info span {
  display: flex;
  align-items: center;
}

.ad-log-params,
.ad-log-result,
.ad-log-error {
  margin-top: 12px;
}

.ad-log-params strong,
.ad-log-result strong,
.ad-log-error strong {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 600;
}

.ad-log-params pre,
.ad-log-result pre,
.ad-log-error pre {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ad-log-result pre {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.ad-log-error pre {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.ad-empty-logs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.ad-empty-logs svg {
  margin-bottom: 16px;
}

.ad-empty-logs p {
  font-size: 14px;
  margin: 0;
}
