/* ===== LGSports 工具箱页面样式 ===== */
/* 适用于 tools.html — "我的专家团" + "专家列表" */

/* ========================================
   1. 页面容器
   ======================================== */

.toolbox-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--dashboard-bg, #f5f7fa);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-height: 0;
}

.toolbox-page::-webkit-scrollbar {
  display: none;
}

/* ========================================
   2. 顶部导航区
   ======================================== */

.toolbox-header {
  display: flex;
  align-items: flex-start;
  padding: 20px 16px 16px;
  background: var(--dashboard-bg, #f5f7fa);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 10px;
}

.tbh-title-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.tbh-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 0;
}

.tbh-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #888);
  line-height: 1.4;
  margin-top: 2px;
}

.tbh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.tbh-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 16px;
  background: linear-gradient(135deg, #667eea, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tbh-add-btn:active {
  opacity: 0.9;
  transform: scale(0.97);
}

/* ========================================
   3. 我的专家团区域
   ======================================== */

.toolbox-team-section {
  background: linear-gradient(135deg, #6B5CE7 0%, #8B5CF6 50%, #A78BFA 100%);
  border-radius: var(--card-radius-lg, 20px);
  margin: 0 16px 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(107, 92, 231, 0.25);
}

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

.tbts-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbts-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.tbts-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  margin-top: 2px;
}

.team-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.tbts-manage-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tbts-manage-link:active {
  opacity: 0.7;
}

/* 专家头像横向滚动区 */
.team-avatar-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.team-avatar-scroll::-webkit-scrollbar {
  display: none;
}

.team-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.team-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

/* 不同专家的头像颜色 */
.team-avatar-circle.avatar-tactical {
  background: linear-gradient(135deg, #667eea, #8b5cf6);
}

.team-avatar-circle.avatar-data {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.team-avatar-circle.avatar-risk {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.team-avatar-circle.avatar-match {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

.team-avatar-circle.avatar-add {
  background: rgba(255, 255, 255, 0.2);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  color: #fff;
  font-size: 24px;
  box-shadow: none;
}

/* 头像图片样式 */
.team-avatar-circle img,
.expert-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.team-avatar-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   4. 专家列表区域
   ======================================== */

.toolbox-expert-section {
  margin: 0 16px 14px;
}

.tbxs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px 4px;
}

.tbxs-header .tbxs-title {
  margin: 0;
}

.tbxs-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.tbxs-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 14px;
  background: linear-gradient(135deg, #667eea, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tbxs-add-btn:active {
  opacity: 0.9;
  transform: scale(0.97);
}

/* 分类标签栏 */
.expert-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.expert-filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #888);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab-item.active {
  color: var(--primary-blue, #2563eb);
  font-weight: 600;
  border-bottom: 2px solid var(--primary-blue, #2563eb);
  border-radius: 0;
}

.filter-tab-item:active {
  opacity: 0.7;
}

/* 战绩周期切换 */
.expert-period-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.expert-period-switch::-webkit-scrollbar {
  display: none;
}

.period-switch-label {
  font-size: 12px;
  color: var(--text-secondary, #888);
  flex-shrink: 0;
  margin-right: 2px;
}

.period-tab-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #888);
  background: transparent;
  border: 1px solid var(--border-color, #e8e8e8);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.period-tab-item.active {
  color: #fff;
  font-weight: 600;
  background: var(--primary-blue, #2563eb);
  border-color: var(--primary-blue, #2563eb);
}

.period-tab-item:active {
  opacity: 0.7;
}

.filter-tab-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.filter-tab-icon:active {
  background: #f0f0f0;
}

.filter-tab-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary, #888);
}

/* 专家卡片列表 */
.expert-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 单张专家卡片 */
.expert-card {
  background: var(--card-bg, #fff);
  border-radius: var(--card-radius, 16px);
  padding: 16px;
  box-shadow: var(--card-shadow, 0 2px 12px rgba(0, 0, 0, 0.06));
  transition: transform 0.15s;
}

.expert-card:active {
  transform: scale(0.99);
}

/* 卡片头部：头像 + 姓名/领域 + 开关 */
.expert-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.expert-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.expert-avatar.exp-tactical {
  background: linear-gradient(135deg, #667eea, #8b5cf6);
}

.expert-avatar.exp-data {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.expert-avatar.exp-risk {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.expert-avatar.exp-match {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

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

.expert-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.expert-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
}

.expert-level {
  font-size: 12px;
  color: var(--text-secondary, #888);
  font-weight: 500;
}

/* 专家团在线状态徽章 */
.expert-status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.expert-status-badge.online {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.expert-status-badge.offline {
  background: rgba(136, 136, 136, 0.15);
  color: #888;
}

/* 领域标签 */
.expert-domain-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.expert-domain-tag.domain-tactical {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple, #8b5cf6);
}

.expert-domain-tag.domain-data {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-blue, #2563eb);
}

.expert-domain-tag.domain-risk {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-orange, #f59e0b);
}

.expert-domain-tag.domain-match {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green, #10b981);
}

/* 三点菜单按钮 */
.expert-card-menu {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #888);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.expert-card-menu:active {
  opacity: 0.6;
}

.expert-card-menu svg {
  width: 16px;
  height: 16px;
}

/* 三点菜单下拉容器 */
.expert-card-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.expert-card-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 96px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
  padding: 4px;
}

.expert-card-menu-dropdown.show {
  display: block;
}

.expert-card-menu-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary, #333);
  -webkit-tap-highlight-color: transparent;
}

.expert-card-menu-item:hover,
.expert-card-menu-item:active {
  background: rgba(0, 0, 0, 0.05);
}

.expert-card-menu-item.danger {
  color: #ef4444;
}

/* 简介 */
.expert-desc {
  font-size: 13px;
  color: var(--text-secondary, #888);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* 统计数据行 */
.expert-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.expert-stat-item {
  font-size: 12px;
  color: var(--text-secondary, #888);
}

.expert-stat-item .stat-value {
  font-weight: 700;
  color: #1a1a2e;
}

/* 技能标签 */
.expert-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.skill-tag.skill-blue {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-blue, #2563eb);
}

.skill-tag.skill-green {
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-green, #10b981);
}

.skill-tag.skill-orange {
  background: rgba(245, 158, 11, 0.08);
  color: var(--accent-orange, #f59e0b);
}

.skill-tag.skill-purple {
  background: rgba(139, 92, 246, 0.08);
  color: var(--accent-purple, #8b5cf6);
}

.skill-tag.skill-cyan {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan, #06b6d4);
}

.skill-tag.skill-pink {
  background: rgba(236, 72, 153, 0.08);
  color: var(--accent-pink, #ec4899);
}

/* 卡片底部操作区 */
.expert-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

.expert-card-footer.has-meta {
  justify-content: space-between;
}

.expert-intel-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-blue, #2563eb);
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.expert-intel-btn:active {
  opacity: 0.7;
}

/* ========================================
   5. 暗色模式适配
   ======================================== */

body.dark-mode .toolbox-page {
  background: #111827;
}

body.dark-mode .toolbox-header {
  background: #111827;
}

body.dark-mode .tbh-title {
  color: #f3f4f6;
}

body.dark-mode .tbh-subtitle {
  color: #6b7280;
}

body.dark-mode .toolbox-team-section {
  background: linear-gradient(135deg, #4C3FB8 0%, #5B4DD6 50%, #7B6FE6 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .tbts-title {
  color: #fff;
}

body.dark-mode .tbts-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .tbts-manage-link {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .team-avatar-name {
  color: #fff;
}

body.dark-mode .team-avatar-circle.avatar-add {
  background: #374151;
  border-color: #4b5563;
  color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .tbxs-title {
  color: #f3f4f6;
}

body.dark-mode .tbxs-add-btn {
  background: linear-gradient(135deg, #4C3FB8, #5B4DD6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .filter-tab-item {
  color: #6b7280;
}

body.dark-mode .filter-tab-item.active {
  color: #8899ff;
  border-bottom-color: #8899ff;
}

body.dark-mode .period-switch-label {
  color: #6b7280;
}

body.dark-mode .period-tab-item {
  color: #9ca3af;
  border-color: #374151;
}

body.dark-mode .period-tab-item.active {
  color: #fff;
  background: #3b4fc0;
  border-color: #3b4fc0;
}

body.dark-mode .filter-tab-icon {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .filter-tab-icon svg {
  color: #6b7280;
}

body.dark-mode .expert-card {
  background: #1f2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .expert-name {
  color: #f3f4f6;
}

body.dark-mode .expert-level {
  color: #6b7280;
}

body.dark-mode .expert-desc {
  color: #9ca3af;
}

body.dark-mode .expert-stat-item {
  color: #9ca3af;
}

body.dark-mode .expert-stat-item .stat-value {
  color: #e5e7eb;
}

body.dark-mode .expert-card-menu {
  color: #6b7280;
}

body.dark-mode .expert-card-menu-dropdown {
  background: #1e1e1e;
  border-color: #444;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .expert-card-menu-item {
  color: #e0e0e0;
}

body.dark-mode .expert-card-menu-item:hover,
body.dark-mode .expert-card-menu-item:active {
  background: #2d2d2d;
}

body.dark-mode .expert-card-menu-item.danger {
  color: #f87171;
}

body.dark-mode .expert-intel-btn {
  color: #8899ff;
}

/* ========================================
   6. 手机端适配（<=768px）
   ======================================== */

@media (max-width: 768px) {
  .toolbox-page {
    animation: dashboardFadeIn 0.3s ease-out;
  }

  .toolbox-header {
    padding: 12px 12px 8px;
  }

  .tbh-title {
    font-size: 17px;
    line-height: 1.15;
  }

  .tbh-subtitle {
    font-size: 11px;
    margin-top: 1px;
  }

  .tbh-add-btn {
    font-size: 12px;
    height: 36px;
    padding: 0 12px;
    border-radius: 18px;
  }

  .tbh-actions {
    gap: 8px;
  }

  .toolbox-team-section {
    margin: 0 8px 10px;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .tbts-header {
    margin-bottom: 12px;
  }

  .tbts-title {
    font-size: 14px;
  }

  .tbts-subtitle {
    font-size: 11px;
  }

  .team-count-badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  .tbts-manage-link {
    font-size: 12px;
  }

  .team-avatar-scroll {
    gap: 12px;
  }

  .team-avatar-circle {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .team-avatar-name {
    font-size: 10px;
    max-width: 52px;
  }

  .toolbox-expert-section {
    margin: 0 8px 10px;
  }

  .tbxs-title {
    font-size: 14px;
  }

  .tbxs-header {
    margin-bottom: 8px;
  }

  .tbxs-add-btn {
    font-size: 12px;
    height: 28px;
    padding: 0 10px;
  }

  .expert-filter-tabs {
    gap: 6px;
    padding-bottom: 8px;
  }

  .filter-tab-item {
    font-size: 12px;
    padding: 4px 10px;
  }

  .filter-tab-icon {
    width: 28px;
    height: 28px;
  }

  .filter-tab-icon svg {
    width: 14px;
    height: 14px;
  }

  .expert-card-list {
    gap: 10px;
  }

  .expert-card {
    padding: 12px;
    border-radius: 14px;
  }

  .expert-card-header {
    gap: 10px;
    margin-bottom: 8px;
  }

  .expert-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .expert-name {
    font-size: 14px;
  }

  .expert-level {
    font-size: 11px;
  }

  .expert-domain-tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .expert-desc {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .expert-stats {
    gap: 12px;
    margin-bottom: 8px;
  }

  .expert-stat-item {
    font-size: 11px;
  }

  .expert-skill-tags {
    gap: 4px;
  }

  .skill-tag {
    font-size: 10px;
    padding: 2px 8px;
  }

  .expert-card-menu {
    width: 24px;
    height: 24px;
  }

  .expert-card-menu svg {
    width: 14px;
    height: 14px;
  }
}

/* 创建时间（页脚元信息） */
.expert-created-at {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary, #aaa);
}

.expert-created-at svg {
  width: 11px;
  height: 11px;
}

body.dark-mode .expert-created-at {
  color: #6b7280;
}