/* ========================================
 *  TBP 总经办面板样式
 *  🍞 @COUPLED public/js/chat-director-agent-armory.js (.tool-group-card)
 *  @WHY 2026-07-15: +工具组折叠卡片样式 .tool-group-*
 *  版本: v1.2 | 依赖: tbp-theme.css
 *  涵盖: 仪表盘 / 导师面板 / 任务模式 / 会员 / 侧栏对话 / 群聊广场
 *
 * ─── 🍞 AI面包屑导航 ───────────────────────────────
 * 标签含义: @COUPLED=联动文件 @GOTCHA=陷阱 @BUGFIX=Bug修复 @MAGIC=魔数
 *          @DEPENDS=外部依赖 @ASSUME=假设 @TODO=待办 @WHY=选型理由
 *
 * 面包屑（改这里会影响谁）:
 *   @COUPLED 改仪表盘卡片布局需同步: public/js/chat-director.js (renderDirectorDashboard), public/chat.html, desktop/renderer/chat.html
 *   @COUPLED 改.dmode-card样式需同步: public/js/chat-director.js (dmCard/DASHBOARD_CARDS渲染)
 *   📖 见: 开发文档/04-方案设计/本地AI环境部署与中心/00-总览.md
 *   @FEATURE 2026-07-08: 新增卡片拖拽排序模式样式(.sortable/dragging/drag-over/.dm-drag-handle)
 *   @WHY 2026-07-11: P2-1 font-size:11px→0.6875rem（px→rem无障碍）+ P3 卡片hover动效（tpc/群聊/市场/会员/活动）
 *   @GOTCHA .director-cards-row max-width:750px 刚好容纳4张卡(4×168+3×14=714)，改卡片宽度需同步改max-width
 *   @WHY 2026-07-11: UI翻新阶段② — 侧栏对话/Agent选中态赤金化（conv-item/agent-item .active 改 glass-bg + gold左边框 + hover改glass-bg）
 * ────────────────────────────────────────────────
 * ======================================== */

/* ===== 仪表盘容器 ===== */
.director-dashboard {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 30px 40px; min-height: 0;
}
.director-title {
  font-size: 22px; font-weight: 600;
  color: var(--tbp-text-primary); margin-bottom: 6px;
}
.director-subtitle {
  font-size: 13px; color: var(--tbp-text-muted);
  margin-bottom: 30px;
}

/* ===== 卡片网格 ===== */
.director-cards-row {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; margin-bottom: 14px;
  max-width: 750px;
}

/* ===== 卡片排序模式（拖拽） ===== */
.sort-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px; justify-content: center;
}
.sort-enter-btn, .sort-done-btn {
  padding: 6px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all .15s;
}
.sort-enter-btn {
  background: var(--tbp-bg-primary); color: var(--tbp-text-dim);
  border: 1px solid var(--tbp-border);
}
.sort-enter-btn:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.sort-done-btn {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
}
.sort-done-btn:hover { opacity: .9; transform: translateY(-1px); }

.dmode-card.sortable {
  cursor: grab; position: relative; user-select: none;
}
.dmode-card.sortable:active { cursor: grabbing; }
.dmode-card.sortable.dragging {
  opacity: 0.45; transform: scale(0.95);
}
.dmode-card.sortable.drag-over {
  border-color: var(--tbp-accent) !important;
  box-shadow: 0 0 14px rgba(102,126,234,.35);
  transform: scale(1.05);
}

.dm-drag-handle {
  position: absolute; top: 6px; right: 8px;
  font-size: 14px; color: var(--tbp-text-dim);
  cursor: grab; line-height: 1; user-select: none;
  letter-spacing: -1px;
}
.dm-drag-handle:active { cursor: grabbing; }

/* ===== 通用卡片（仪表盘 + 任务模式） ===== */
.dmode-card {
  width: 168px; padding: 18px 14px;
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border-a1);  /* 🍞 2026-07-26(v5): 实心灰→白透明度 */
  border-radius: 12px; cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.dmode-card:hover {
  border-color: var(--tbp-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}
.dmode-card.disabled {
  opacity: 0.4; cursor: pointer;
}
.dmode-card.disabled:hover {
  border-color: var(--tbp-border);
  transform: none;
  box-shadow: none;
}
.dmode-card .dm-icon {
  font-size: 32px; margin-bottom: 10px;
}
.dmode-card .dm-name {
  font-size: 14px; font-weight: 600;
  color: var(--tbp-text-primary); margin-bottom: 6px;
}
.dmode-card .dm-desc {
  font-size: 0.6875rem; color: var(--tbp-text-dim);
  line-height: 1.5;
}

/* ===== 返回导航 ===== */
.back-nav {
  padding: 12px 20px; border-bottom: 1px solid var(--tbp-border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.back-nav-btn {
  background: none; border: none;
  color: var(--tbp-text-dim); font-size: 13px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all .15s;
}
.back-nav-btn:hover { color: var(--tbp-text-primary); }
.back-nav-title {
  font-size: 14px; font-weight: 600;
  color: var(--tbp-text-primary);
}

/* ===== 通用 ===== */
.panel-container { padding: 16px 0; }
.panel-empty {
  text-align: center; padding: 40px 20px;
  color: var(--tbp-text-dim); font-size: 13px;
}

/* ========================================
 *  导师面板
 * ======================================== */
.teacher-panel {
  padding: 0 20px 20px;
  overflow-y: auto; flex: 1;
}
.teacher-identity-bar {
  padding: 10px 0;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--tbp-text-tertiary);
  border-bottom: 1px solid var(--tbp-border);
  margin-bottom: 12px;
}
.identity-badge {
  background: var(--tbp-info-bg); color: var(--tbp-accent-light);
  padding: 3px 10px; border-radius: 10px; font-size: 12px;
}
.identity-points {
  margin-left: auto; font-size: 12px; color: var(--tbp-gold);
}

/* 搜索 */
.search-row { padding: 8px 0 12px; }
.search-row input {
  width: 100%; padding: 10px 14px;
  background: var(--tbp-bg-input); border: 1px solid var(--tbp-border);
  border-radius: 8px; color: var(--tbp-text-primary);
  font-size: 14px; outline: none; transition: border .2s;
}
.search-row input:focus { border-color: var(--tbp-accent); }

/* 筛选标签 */
.teacher-filter-row {
  display: flex; gap: 8px; padding-bottom: 14px;
  border-bottom: 1px solid var(--tbp-border); margin-bottom: 14px;
}
.tfl-tab {
  padding: 5px 14px; border-radius: 8px;
  border: 1px solid var(--tbp-border);
  background: transparent; color: var(--tbp-text-tertiary);
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.tfl-tab:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.tfl-active {
  background: var(--tbp-accent); color: #fff;
  border-color: var(--tbp-accent);
}

/* 双列布局 */
.teacher-two-col {
  display: flex; gap: 16px; align-items: flex-start;
}
.teacher-column { flex: 1; min-width: 0; }
.teacher-col-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--tbp-border);
}
.tch-icon { font-size: 16px; }
.tch-count { font-size: 12px; color: var(--tbp-text-dim); font-weight: 400; margin-left: auto; }
.teacher-col-divider {
  width: 1px; background: var(--tbp-border);
  align-self: stretch; margin-top: 42px;
}
.teacher-col-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.teacher-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.group-label {
  font-size: 12px; color: var(--tbp-text-dim);
  padding: 8px 0 4px;
}

/* ===== 导师卡片 (tpc) ===== */
.tpc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border); border-radius: 10px;
  cursor: pointer; transition: all .15s; position: relative;
}
.tpc-card:hover { border-color: var(--tbp-accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,.12); }
.tpc-card.tpc-locked {
  opacity: 0.6; cursor: not-allowed;
}
.tpc-avatar {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--tbp-accent), #764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; overflow: hidden;
}
.tpc-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.tpc-avatar-text { font-weight: 700; }
.tpc-body { flex: 1; min-width: 0; }
.tpc-name {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px; display: flex; align-items: center; gap: 6px;
}
.tpc-type-tag {
  display: inline-block; font-size: 0.6875rem; padding: 2px 7px;
  border-radius: 4px; margin-left: auto; flex-shrink: 0; font-weight: 600;
}
.tpc-type-silicon { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.tpc-type-human { background: rgba(102, 126, 234, 0.2); color: #8899ff; }
.tpc-desc {
  font-size: 0.6875rem; color: var(--tbp-text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpc-lock-overlay {
  position: absolute; inset: 0; border-radius: 10px;
  background: rgba(15, 17, 23, 0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 2;
}
.tpc-card:hover .tpc-lock-overlay { opacity: 1; }
.tpc-buy-overlay {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tpc-lock-price {
  font-size: 14px; font-weight: 600; color: var(--tbp-gold);
}
.tpc-buy-btn {
  padding: 5px 16px; background: var(--tbp-accent); color: #fff;
  border: none; border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: all .15s; pointer-events: auto;
}
.tpc-buy-btn:hover { background: var(--tbp-accent-hover); }

/* ========================================
 *  任务模式选择器
 * ======================================== */
.mode-picker {
  padding: 30px 40px; flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
}
.mode-picker h3 {
  font-size: 18px; font-weight: 600; color: var(--tbp-text-primary);
  margin-bottom: 6px;
}
.mode-subtitle {
  font-size: 13px; color: var(--tbp-text-dim); margin-bottom: 24px;
}
.mode-grid {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; max-width: 800px;
}

/* ========================================
 *  会员面板
 * ======================================== */
.member-panel {
  padding: 0 20px 20px; overflow-y: auto; flex: 1;
}
.member-header {
  font-size: 16px; font-weight: 600; color: var(--tbp-text-primary);
  padding: 14px 0; margin-bottom: 12px;
  border-bottom: 1px solid var(--tbp-border);
}
.member-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.member-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border); border-radius: 10px;
  padding: 14px 16px; transition: all .15s;
  display: flex; flex-direction: column;
}
.member-card:hover { border-color: var(--tbp-accent); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.mh {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.mav {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--tbp-accent), #764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; flex-shrink: 0; overflow: hidden;
}
.mav img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mav-init {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-weight: 600;
}
.mn {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
}
.mt {
  font-size: 0.6875rem; color: var(--tbp-text-dim);
  display: flex; gap: 6px; margin-top: 2px;
}
.mt span {
  background: var(--tbp-bg-hover); padding: 1px 6px;
  border-radius: 4px;
}
.md {
  font-size: 12px; color: var(--tbp-text-tertiary);
  line-height: 1.6; margin-bottom: 10px; flex: 1;
}
.ma {
  display: flex; justify-content: flex-end; margin-top: auto;
}
.member-dm-btn {
  padding: 5px 14px; background: transparent;
  border: 1px solid var(--tbp-accent); color: var(--tbp-accent);
  border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.member-dm-btn:hover { background: var(--tbp-accent); color: #fff; }

/* ========================================
 *  侧栏对话列表
 * ======================================== */
.conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
  transition: background .15s; font-size: 13px;
  border-left: 3px solid transparent;
}
.conv-item:hover { background: var(--tbp-glass-bg); }
.conv-item.active {
  background: var(--tbp-glass-bg);
  border-left-color: var(--tbp-gold);
}
.conv-item.active.conv-item-teacher { border-left-color: #4ade80; }
.conv-item.active.conv-item-pm { border-left-color: var(--tbp-accent); }
.conv-item.active.conv-item-group { border-left-color: var(--tbp-accent); }
.conv-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.conv-name {
  flex: 1; min-width: 0;
  color: var(--tbp-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-item.active .conv-name { color: var(--tbp-text-primary); }
.conv-type-label {
  font-size: 0.6875rem; padding: 1px 6px; border-radius: 4px;
  flex-shrink: 0; white-space: nowrap; line-height: 16px;
  font-weight: 500;
}
/* 按类型区分颜色（对齐小程序 conversations.wxss） */
.tag-teacher-silicon { background: rgba(74,222,128,0.15); color: #4ade80; }
.tag-teacher-ai      { background: rgba(102,126,234,0.15); color: #a5b4fc; }
.tag-pm              { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tag-group           { background: rgba(16,185,129,0.15); color: #34d399; }
.tag-task            { background: rgba(201,169,110,0.15); color: #c9a96e; }
/* 对话列表·头衔标签（小气泡） */
.conv-subject {
  font-size: 0.6875rem; padding: 1px 6px; border-radius: 4px;
  flex-shrink: 0; white-space: nowrap; line-height: 16px;
  background: rgba(251,191,36,0.12); color: #fbbf24;
}
.conv-close {
  font-size: 14px; color: var(--tbp-text-muted);
  cursor: pointer; padding: 2px 4px; border-radius: 4px;
  transition: all .15s; flex-shrink: 0;
  line-height: 1; visibility: hidden;
}
.conv-item:hover .conv-close { visibility: visible; }
.conv-close:hover { color: var(--tbp-danger); background: var(--tbp-danger-bg); }

/* ========================================
 *  群聊广场
 * ======================================== */
.group-plaza-tip {
  font-size: 12px; color: var(--tbp-text-dim);
  padding: 12px 0; margin-bottom: 8px;
  text-align: center;
}
.group-plaza-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border);
  border-radius: 10px; padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  transition: all .15s;
}
.group-plaza-card:hover { border-color: var(--tbp-accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,.12); }
.gp-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 8px;
}
.gp-name { font-size: 14px; font-weight: 600; color: var(--tbp-text-primary); }
.gp-meta { font-size: 12px; color: var(--tbp-text-dim); }
.gp-btn {
  border: 1px solid var(--tbp-accent);
  background: none; color: var(--tbp-accent);
  font-size: 12px; font-weight: 600;
  padding: 4px 14px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
}
.gp-btn:hover { background: var(--tbp-accent); color: #fff; }
.gp-btn-enter {
  background: rgba(74, 222, 128, 0.12); border-color: #4ade80; color: #4ade80;
}
.gp-btn-enter:hover { background: #4ade80; color: #111; }
.gp-btn-join {
  background: var(--tbp-accent); color: #fff; border-color: var(--tbp-accent);
}
.gp-btn-join:hover { background: var(--tbp-accent-hover); }
.gp-stats {
  display: flex; gap: 16px;
  font-size: 0.6875rem; color: var(--tbp-text-dim);
}

/* ========================================
 *  活动报名面板
 * ======================================== */
.event-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.ev-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border); border-radius: 10px;
  overflow: hidden; transition: all .15s;
}
.ev-card { cursor: pointer; }
.ev-card:hover { border-color: var(--tbp-accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,.12); }

/* 活动详情 */
.ev-detail-cover { width: 100%; max-height: 360px; object-fit: contain; border-radius: 10px; margin-bottom: 12px; background: #14161d; }
.ev-detail-cover-wrap {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px;
}
.ev-detail-cover-wrap .ev-detail-cover {
  width: 280px; height: 200px; flex-shrink: 0; object-fit: contain; border-radius: 10px; margin-bottom: 0; background: #14161d;
}
.ev-detail-meta { margin-bottom: 14px; }
.ev-detail-time { font-size: 14px; color: var(--tbp-text-secondary); margin-bottom: 4px; }
.ev-detail-loc  { font-size: 13px; color: var(--tbp-text-dim); }
.ev-detail-desc {
  font-size: 13px; color: var(--tbp-text-tertiary); line-height: 1.8;
  padding: 12px 0; border-top: 1px solid var(--tbp-border);
  margin-bottom: 14px; word-break: break-word;
}
.ev-detail-desc img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.ev-detail-price-row {
  display: flex; gap: 10px; margin-bottom: 10px;
}
.ev-detail-price-card {
  flex: 1; padding: 10px; border-radius: 8px;
  border: 1px solid var(--tbp-border); text-align: center;
}
.ev-detail-price-card.active { border-color: var(--tbp-accent); background: var(--tbp-info-bg); }
.edpc-label { font-size: 0.6875rem; color: var(--tbp-text-dim); display: block; margin-bottom: 4px; }
.edpc-val   { font-size: 16px; font-weight: 700; color: var(--tbp-text-primary); }
.ev-detail-actions { text-align: center; padding-bottom: 20px; }
.ev-cover { width: 100%; height: 140px; object-fit: cover; display: block; }
.ev-body { padding: 12px 14px 14px; }
.ev-top-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.ev-title {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
  flex: 1; min-width: 0;
}
.ev-status {
  font-size: 0.6875rem; padding: 2px 8px; border-radius: 3px;
  font-weight: 600; flex-shrink: 0; white-space: nowrap;
}
.evs-open { background: rgba(74,222,128,.15); color: #4ade80; }
.evs-done { background: rgba(102,126,234,.15); color: #8899ff; }
.evs-end  { background: rgba(107,114,128,.15); color: #9ca3af; }
.evs-pay  { background: rgba(201,169,110,.15); color: #c9a96e; }
.evs-up   { background: rgba(147,197,253,.15); color: #93c5fd; }
.evs-ns   { background: rgba(107,114,128,.15); color: #9ca3af; }
.ev-time { font-size: 0.6875rem; color: var(--tbp-text-dim); margin-bottom: 3px; }
.ev-loc  { font-size: 0.6875rem; color: var(--tbp-text-dim); margin-bottom: 3px; }
.ev-price{ font-size: 0.6875rem; color: var(--tbp-text-tertiary); margin-bottom: 3px; }
.ev-count{ font-size: 0.6875rem; color: var(--tbp-text-muted); margin-bottom: 8px; }
.ev-actions { display: flex; justify-content: flex-end; }
.ev-btn {
  padding: 6px 18px; border-radius: 6px; font-size: 12px;
  font-weight: 600; cursor: pointer; border: none; transition: all .15s;
}
.ev-btn-reg  { background: var(--tbp-accent); color: #fff; }
.ev-btn-reg:hover { background: var(--tbp-accent-hover); }
.ev-btn-pay  { background: #c9a96e; color: #111; }
.ev-btn-pay:hover { opacity: .85; }
.ev-btn-done { background: rgba(74,222,128,.12); color: #4ade80; cursor: default; }
.ev-btn-end  { background: rgba(107,114,128,.1); color: #6b7280; cursor: default; }

/* 报名人列表 */
.ev-participants {
  margin-top: 16px; padding: 14px;
  background: var(--tbp-bg-primary); border: 1px solid var(--tbp-border);
  border-radius: 10px;
}
.evp-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--tbp-border);
}
.evp-title {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
}
.evp-list { display: flex; flex-direction: column; gap: 4px; }
.evp-empty {
  text-align: center; color: var(--tbp-text-dim); font-size: 13px;
  padding: 20px 0;
}
.evp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-radius: 8px;
  transition: background .15s;
}
.evp-item:hover { background: var(--tbp-bg-secondary); }
.evp-avatar-wrap {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: linear-gradient(135deg, var(--tbp-accent), #764ba2);
  display: flex; align-items: center; justify-content: center;
}
.evp-avatar { width: 100%; height: 100%; object-fit: cover; }
.evp-avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 600;
}
.evp-info { flex: 1; min-width: 0; }
.evp-name {
  font-size: 13px; color: var(--tbp-text-primary); font-weight: 500;
}
.evp-badges { display: flex; gap: 4px; margin-top: 2px; }
.evp-badge {
  font-size: 0.6875rem; padding: 1px 6px; border-radius: 3px;
  font-weight: 600;
}
.evp-badge-checkin { background: rgba(74,222,128,.15); color: #4ade80; }
.evp-badge-virtual { background: rgba(201,169,110,.15); color: #c9a96e; }
.evp-index {
  font-size: 0.6875rem; color: var(--tbp-text-muted); flex-shrink: 0;
}

/* v6.9.12: 活动详情统一布局 — 信息卡 + 双按钮 + 状态 */
.ev-info-item.my-status { color: #34d399; }
.ev-detail-desc-label { font-size: 14px; font-weight: 600; color: var(--tbp-text-primary); margin-bottom: 10px; }
.ev-detail-title { font-size: 22px; font-weight: 700; color: var(--tbp-text-primary); padding: 8px 0 16px; line-height: 1.4; }
.ev-detail-info { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--tbp-border); margin-bottom: 14px; }
.ev-info-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tbp-text-secondary); background: var(--tbp-bg-secondary); padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.ev-info-item.price { color: #c9a96e; font-weight: 700; }
/* ④ 气泡轮播（聊天面板内） */
.ev-bubble-wrap { margin-bottom: 14px; }
.ev-bubble-title { font-size: 13px; color: var(--tbp-text-dim); margin-bottom: 10px; }
.ev-bubble-box { height: 240px; overflow: hidden; position: relative; background: var(--tbp-bg-secondary); border-radius: 12px; border: 1px solid var(--tbp-border); }
.ev-bubble-list { transition: transform .5s ease; }
.ev-bubble-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; height: 48px; box-sizing: border-box; transition: opacity .4s; }
.ev-bubble-item.spotlight { background: linear-gradient(90deg, rgba(201,169,110,.12), transparent); border-left: 3px solid #c9a96e; }
.ev-bubble-item.fade-out { opacity: .35; }
.ev-bubble-item.fade-in { opacity: .55; }
.ev-bubble-avatar { width: 32px; height: 32px; border-radius: 50%; background: #c9a96e; display: flex; align-items: center; justify-content: center; color: #111; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.ev-bubble-avatar img { width: 32px; height: 32px; border-radius: 50%; }
.ev-bubble-name { font-size: 14px; color: var(--tbp-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-bubble-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--tbp-text-dim); font-size: 13px; }
/* ⑥ 双按钮 */
.ev-detail-dual-btns { display: flex; gap: 10px; margin: 14px 0; }
.ev-dual-btn { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 12px; border: none; cursor: pointer; transition: all .15s; font-family: inherit; }
.ev-dual-btn:hover { filter: brightness(1.1); }
.ev-dual-member { background: linear-gradient(135deg, var(--tbp-accent), #764ba2); color: #fff; }
.ev-dual-nonmember { background: var(--tbp-bg-primary); color: var(--tbp-text-primary); border: 2px solid var(--tbp-border); }
.ev-dual-btn.active { box-shadow: 0 0 0 2px var(--tbp-accent); }
.ev-dual-label { font-size: 12px; opacity: .85; margin-bottom: 2px; }
.ev-dual-action { font-size: 15px; font-weight: 700; }

/* 支付二维码弹窗 */
.ev-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: var(--tbp-z-sticky); display: flex; align-items: center; justify-content: center;
}
.ev-modal {
  background: var(--tbp-bg-secondary); border: 1px solid var(--tbp-border);
  border-radius: 16px; padding: 24px; position: relative;
  max-width: 320px; width: 90%;
}
.ev-modal-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--tbp-text-dim);
  font-size: 18px; cursor: pointer; padding: 2px 6px; line-height: 1;
}
.ev-modal-close:hover { color: var(--tbp-text-primary); }
.ev-modal-body { padding: 8px 0; }

/* ========================================
 *  已购订单面板
 * ======================================== */
.od-list { display: flex; flex-direction: column; gap: 10px; }
.od-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border); border-radius: 10px;
  padding: 14px 16px;
}
.od-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.od-product { font-size: 0.6875rem; color: var(--tbp-text-dim); }
.od-status {
  font-size: 0.6875rem; padding: 2px 8px; border-radius: 3px;
  font-weight: 600; white-space: nowrap;
}
.ods-done    { background: rgba(74,222,128,.12); color: #4ade80; }
.ods-pending { background: rgba(201,169,110,.12); color: #c9a96e; }
.ods-refund  { background: rgba(225,112,85,.12); color: #e17055; }
.ods-cancel  { background: rgba(107,114,128,.12); color: #9ca3af; }
.od-name { font-size: 13px; font-weight: 600; color: var(--tbp-text-primary); margin-bottom: 4px; }
.od-sn   { font-size: 0.6875rem; color: var(--tbp-text-muted); margin-bottom: 6px; }
.od-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.od-amount { font-size: 14px; font-weight: 700; color: var(--tbp-text-primary); }
.od-time   { font-size: 0.6875rem; color: var(--tbp-text-dim); }
.od-btn-pay {
  padding: 5px 16px; border-radius: 6px; font-size: 0.6875rem;
  font-weight: 600; cursor: pointer; border: none;
  background: #c9a96e; color: #111;
}
.od-btn-pay:hover { opacity: .85; }

/* ========================================
 *  商城面板
 * ======================================== */
.sp-panel { padding: 0; }
.sp-nav {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--tbp-border);
  flex-wrap: wrap;
}
.sp-back-btn {
  background: none; border: 1px solid var(--tbp-border);
  color: var(--tbp-text-secondary); padding: 6px 14px;
  border-radius: 8px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.sp-back-btn:hover { background: var(--tbp-bg-hover); color: var(--tbp-text-primary); }
.sp-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.sp-tab {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  color: var(--tbp-text-dim); background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border); cursor: pointer;
  white-space: nowrap;
}
.sp-tab:hover { color: var(--tbp-text-primary); }
.sp-tab-on { color: #c9a96e; background: rgba(201,169,110,.12); border-color: #c9a96e; font-weight: 600; }

.sp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 16px;
}
.sp-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border);
  border-radius: 12px; overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.sp-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.sp-cover { width: 100%; height: 140px; background: #14161d; overflow: hidden; position: relative; }
.sp-cover img { width: 100%; height: 100%; object-fit: cover; }
.sp-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 36px; background: linear-gradient(135deg, #1a1d28, #252840);
  position: absolute; top: 0; left: 0;
}
.sp-body { padding: 10px 12px 14px; }
.sp-type {
  font-size: 0.6875rem; color: #c9a96e; background: rgba(201,169,110,.12);
  display: inline-block; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.sp-name {
  display: block; font-size: 13px; font-weight: 600; color: var(--tbp-text-primary);
  margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-desc {
  display: block; font-size: 0.6875rem; color: var(--tbp-text-dim);
  margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-price-row { display: flex; align-items: baseline; gap: 6px; }
.sp-price { font-size: 15px; font-weight: 700; color: #f0a500; }
.sp-orig { font-size: 0.6875rem; color: var(--tbp-text-muted); text-decoration: line-through; }

.sp-loading { text-align: center; padding: 60px 0; color: var(--tbp-text-dim); }
.sp-empty { text-align: center; padding: 80px 0; color: var(--tbp-text-dim); font-size: 14px; line-height: 2; }

/* ========================================
 *  商品详情页
 * ======================================== */
.sd-panel { display: flex; flex-direction: column; height: 100%; }
.sd-body {
  flex: 1; overflow-y: auto; padding: 0 16px 24px;
}
.sd-cover-wrap {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 16px; -webkit-overflow-scrolling: touch;
}
.sd-cover-wrap::-webkit-scrollbar { height: 4px; }
.sd-cover-wrap::-webkit-scrollbar-thumb { background: var(--tbp-border); border-radius: 2px; }
.sd-cover {
  width: 260px; height: 200px; object-fit: contain; border-radius: 10px;
  flex-shrink: 0; background: #14161d;
}
.sd-cover-single {
  width: 100%; max-height: 400px; object-fit: contain; border-radius: 10px;
  margin-bottom: 16px; background: #14161d;
}
.sd-header {
  padding-bottom: 14px; border-bottom: 1px solid var(--tbp-border);
  margin-bottom: 14px;
}
.sd-type {
  font-size: 0.6875rem; color: #c9a96e; background: rgba(201,169,110,.12);
  display: inline-block; padding: 2px 10px; border-radius: 4px; margin-bottom: 8px;
}
.sd-name {
  display: block; font-size: 20px; font-weight: 700; color: var(--tbp-text-primary);
  margin-bottom: 10px; line-height: 1.4;
}
.sd-price-row { display: flex; align-items: baseline; gap: 10px; }
.sd-price { font-size: 24px; font-weight: 700; color: #f0a500; }
.sd-orig { font-size: 14px; color: var(--tbp-text-muted); text-decoration: line-through; }

.sd-meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px;
}
.sd-meta-item {
  font-size: 13px; color: var(--tbp-text-dim); line-height: 2;
}

.sd-benefits {
  background: var(--tbp-bg-primary); border: 1px solid var(--tbp-border);
  border-radius: 10px; padding: 14px; margin-bottom: 16px;
}
.sd-benefits-title {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary); margin-bottom: 10px;
}
.sd-benefit-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--tbp-text-dim); padding: 4px 0;
}
.sd-benefit-icon {
  color: var(--tbp-success); font-size: 14px; flex-shrink: 0;
}

.sd-desc {
  font-size: 14px; color: var(--tbp-text-dim); line-height: 1.8;
  padding: 14px; background: var(--tbp-bg-primary); border-radius: 10px;
  margin-bottom: 16px; word-break: break-word;
}
.sd-desc img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

.sd-actions {
  padding: 16px 0 8px;
}
.sd-btn-buy {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #f0a500, #e08900);
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.sd-btn-buy:hover { opacity: .9; transform: translateY(-1px); }
.sd-btn-buy:active { transform: scale(.98); }

/* ========================================
 *  导师详情页
 * ======================================== */
.tdt-panel { display: flex; flex-direction: column; height: 100%; }
.tdt-body {
  flex: 1; overflow-y: auto; padding: 0 20px 24px;
}
.tdt-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding-top: 8px;
}
.tdt-avatar-wrap {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #c9a96e, #667eea);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.tdt-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.tdt-avatar-fb {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; font-weight: 700;
}
.tdt-info {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-width: 0; overflow: hidden;
}
.tdt-name {
  font-size: 22px; font-weight: 700; color: var(--tbp-text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tdt-badge {
  display: inline-block; width: fit-content;
  font-size: 0.6875rem; padding: 3px 10px; border-radius: 10px; font-weight: 600;
}
.tdt-badge-gold { background: rgba(201,169,110,.12); color: #c9a96e; border: 1px solid rgba(201,169,110,.2); }
.tdt-badge-purple { background: rgba(102,126,234,.12); color: #667eea; border: 1px solid rgba(102,126,234,.2); }
.tdt-title {
  font-size: 13px; color: var(--tbp-text-dim);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tdt-intro {
  font-size: 14px; color: var(--tbp-text-dim); line-height: 1.8;
  margin-bottom: 16px; padding: 14px;
  background: var(--tbp-bg-primary); border-radius: 10px;
}
.tdt-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.tdt-tag {
  font-size: 12px; color: #c9a96e; padding: 4px 12px;
  border-radius: 12px; background: rgba(201,169,110,.08);
  border: 1px solid rgba(201,169,110,.2);
}
.tdt-disclaimer {
  font-size: 12px; color: var(--tbp-text-muted);
  padding: 12px 16px; border-radius: 10px;
  background: rgba(102,126,234,.06); border: 1px solid rgba(102,126,234,.12);
  margin-bottom: 20px;
}
.tdt-actions { padding: 4px 0 16px; }
.tdt-status {
  padding: 14px 16px; border-radius: 10px; text-align: center;
  font-size: 14px; font-weight: 500;
}
.tdt-status-wait {
  background: rgba(201,169,110,.08); border: 1px solid rgba(201,169,110,.2);
  color: #c9a96e;
}
.tdt-btn-chat {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.tdt-btn-chat:hover { opacity: .9; transform: translateY(-1px); }
.tdt-btn-shop {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #c9a96e, #b8963e);
  color: #0f1117; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.tdt-btn-shop:hover { opacity: .9; transform: translateY(-1px); }

/* ========================================
 *  v6.9.12: 响应式桌面适配
 * ======================================== */

/* 平板（≤1100px）— 面板间距缩小 */
@media (max-width:1100px){
  .director-dashboard{padding:20px 24px}
  .dmode-card{width:148px;padding:14px 10px}
  .mode-picker{padding:20px 24px}
  .teacher-panel{padding:0 14px 14px}
  .member-panel{padding:0 14px 14px}
  .panel-container{padding:12px 0}
  /* 会员网格从3列变2列 */
  .member-grid{grid-template-columns:repeat(2,1fr)}
  /* 活动网格保持2列但间距缩小 */
  .event-grid{gap:10px}
  /* 导师双列间距缩小 */
  .teacher-two-col{gap:12px}
  .tpc-card{padding:10px 12px}
  .tpc-avatar{width:38px;height:38px;font-size:16px}
  /* 商城网格 */
  .sp-list{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;padding:12px}
  /* 导师详情 */
  .tdt-body{padding:0 14px 20px}
  .tdt-avatar-wrap{width:64px;height:64px;font-size:28px}
  .tdt-name{font-size:18px}
  /* 商品详情 */
  .sd-body{padding:0 12px 20px}
  .sd-cover{width:220px;height:170px}
  /* 订单列表 */
  .od-card{padding:12px 14px}
}

/* 小屏（≤768px）— 单列布局 */
@media (max-width:768px){
  .director-dashboard{padding:16px 14px}
  .director-title{font-size:18px}
  .director-subtitle{font-size:12px;margin-bottom:20px}
  .director-cards-row{max-width:100%}
  .dmode-card{width:calc(50% - 7px);padding:12px 8px;min-width:0}
  .dmode-card .dm-icon{font-size:24px;margin-bottom:6px}
  .dmode-card .dm-name{font-size:12px}
  .dmode-card .dm-desc{font-size:0.6875rem}
  /* 任务模式同款 */
  .mode-picker{padding:16px 14px}
  .mode-grid{max-width:100%}
  /* 会员单列 */
  .member-grid{grid-template-columns:1fr}
  .member-panel{padding:0 12px 12px}
  /* 导师单列 */
  .teacher-two-col{flex-direction:column;gap:0}
  .teacher-col-divider{display:none}
  .teacher-column{flex:none;width:100%}
  .teacher-panel{padding:0 12px 12px}
  .tpc-card{gap:10px;padding:10px}
  /* 活动单列 */
  .event-grid{grid-template-columns:1fr}
  .ev-detail-cover{max-height:240px}
  .ev-detail-cover-wrap .ev-detail-cover{width:200px;height:150px}
  .ev-detail-title{font-size:18px}
  .ev-detail-dual-btns{flex-direction:column}
  /* 商城 */
  .sp-list{grid-template-columns:repeat(2,1fr);gap:8px;padding:10px}
  .sp-cover{height:100px}
  .sp-name{font-size:12px}
  .sp-body{padding:8px 10px 12px}
  .sp-nav{padding:10px 12px}
  .sp-tab{font-size:0.6875rem;padding:4px 10px}
  /* 订单 */
  .od-card{padding:10px 12px}
  /* 导师详情 */
  .tdt-body{padding:0 12px 16px}
  .tdt-header{gap:12px}
  .tdt-avatar-wrap{width:56px;height:56px}
  .tdt-name{font-size:16px}
  /* 商品详情 */
  .sd-body{padding:0 10px 16px}
  .sd-cover{width:180px;height:140px}
  .sd-cover-single{max-height:280px}
  .sd-name{font-size:16px}
  .sd-price{font-size:20px}
  /* 气泡轮播 */
  .ev-bubble-box{height:180px}
  .ev-bubble-item{height:36px;padding:8px 12px;gap:8px}
  .ev-bubble-name{font-size:12px}

.env-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.env-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; border: 1px solid transparent;
}
.env-item.env-loading { color: var(--tbp-text-dim); justify-content: center; background: transparent; }
.env-item.env-ok { background: rgba(74,222,128,.06); border-color: rgba(74,222,128,.15); color: #86efac; }
.env-item.env-fail { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.15); color: #fca5a5; }
.env-item.env-warn { background: rgba(251,191,36,.06); border-color: rgba(251,191,36,.15); color: #fcd34d; }
.env-label { font-weight: 600; white-space: nowrap; }
.env-detail { font-size: 12px; color: var(--tbp-text-dim); margin-left: 12px; text-align: right; word-break: break-all; }
.env-missing { color: #fca5a5; }

.env-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.env-btn {
  padding: 10px 24px; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all .15s;
  font-family: inherit;
}
.env-btn:disabled { opacity: .5; cursor: not-allowed; }
.env-btn-recheck { background: var(--tbp-bg-primary); color: var(--tbp-text-secondary); border: 1px solid var(--tbp-border); }
.env-btn-recheck:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.env-btn-install {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
.env-btn-install:hover { opacity: .9; transform: translateY(-1px); }

.env-footer {
  text-align: center; font-size: 14px; font-weight: 600;
  padding: 12px 16px; border-radius: 10px;
}
.env-all-ok { background: rgba(74,222,128,.08); color: #4ade80; }
.env-has-issue { background: rgba(251,191,36,.06); color: #fbbf24; }
  .ev-bubble-avatar{width:28px;height:28px;font-size:0.6875rem}
  .ev-bubble-avatar img{width:28px;height:28px}
  /* 信息卡 */
  .ev-detail-info{gap:6px;padding:10px 0}
  .ev-info-item{font-size:0.6875rem;padding:5px 8px}
}

/* ========================================
 *  环境检测弹窗（标题栏🔧按钮触发）
 * ======================================== */
.env-popup {
  position: fixed; top: 42px; right: 12px; z-index: var(--tbp-z-max);
  width: 320px; max-height: 480px; overflow-y: auto;
  background: var(--tbp-bg-secondary); border: 1px solid var(--tbp-border);
  border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.env-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--tbp-border);
  font-size: 15px; font-weight: 700; color: var(--tbp-text-primary);
}
.env-popup-close {
  background: none; border: none; color: var(--tbp-text-dim);
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.env-popup-close:hover { color: var(--tbp-text-primary); }
.env-popup-body { padding: 16px 18px; }
.env-popup-body .env-items { gap: 8px; margin-bottom: 14px; }
.env-popup-body .env-item { padding: 10px 12px; font-size: 13px; }
.env-popup-body .env-actions { margin-bottom: 10px; }
.env-popup-body .env-btn { padding: 8px 18px; font-size: 13px; }
.env-popup-body .env-footer { font-size: 13px; padding: 10px 12px; }

/* ========================================
 *  环境部署面板（chat-main内视图 V2）
 * ======================================== */
.env-panel { padding: 0 16px 16px; max-width: 1100px; margin: 0 auto; width: 100%; box-sizing: border-box; overflow-y: auto; flex: 1; min-height: 0; }

/* 顶部栏 */
.env-panel-topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 0 14px; border-bottom: 1px solid var(--tbp-border); margin-bottom: 14px;
}
.env-topbar-title { font-size: 14px; color: var(--tbp-text-secondary); font-weight: 600; }
.env-topbar-actions { display: flex; gap: 8px; }
.env-btn-top {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: var(--tbp-bg-primary); color: var(--tbp-text-secondary);
  border: 1px solid var(--tbp-border); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.env-btn-top:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.env-btn-install-all {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none;
}
.env-btn-install-all:hover { opacity: .9; transform: translateY(-1px); }

.env-loading-msg { text-align: center; padding: 40px 0; color: var(--tbp-text-dim); font-size: 14px; }

/* 分组标题 */
.env-group-header {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--tbp-text-dim); letter-spacing: 1px;
  padding: 20px 0 8px 4px;
}
.env-group-header:first-of-type { padding-top: 0; }

/* 卡片网格：每行2-3列自适应 */
.env-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}

/* 单张卡片（紧凑竖排） */
.env-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 14px; border-radius: 10px;
  /* 🍞 2026-07-26(v5): 底 #0f1117≈背景色(镂空)→#1a1d27 抬亮一档；边框实心灰→白透明度 */
  background: var(--tbp-bg-secondary); border: 1px solid var(--tbp-border-a1);
  transition: border-color .15s;
}
.env-card:hover { border-color: rgba(102,126,234,.25); }
.env-card-ok { border-color: rgba(74,222,128,.15); }
.env-card-missing { border-color: rgba(239,68,68,.12); }
.env-card-active { border-color: rgba(251,191,36,.2); }




.env-card-head { display: flex; align-items: center; gap: 8px; }
.env-card-icon { font-size: 18px; flex-shrink: 0; }
.env-card-name { font-size: 13px; font-weight: 700; color: var(--tbp-text-primary); flex: 1; }
.env-badge { font-size: 0.6875rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.env-badge-ok { background: rgba(74,222,128,.12); color: #4ade80; }
.env-badge-missing { background: rgba(239,68,68,.1); color: #fca5a5; }
.env-badge-installing { background: rgba(102,126,234,.12); color: #a5b4fc; }
.env-badge-uninstalling { background: rgba(251,191,36,.1); color: #fbbf24; }
.env-badge-phase2 { background: rgba(156,163,175,.1); color: #9ca3af; }

/* 🍞 2026-07-16: 全局"安装中"浮动徽标——切到任意面板/双入口都能看到后台安装进度 */
.tbp-env-install-badge {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(102,126,234,.92);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  display: none; /* 默认隐藏，有活动安装任务时由 updateEnvInstallBadge() 显示 */
}

.env-card-body { flex: 1; min-width: 0; }
.env-card-desc { font-size: 0.6875rem; color: var(--tbp-text-dim); line-height: 1.4; }
.env-card-detail { font-size: 0.6875rem; color: #fca5a5; margin-top: 2px; word-break: break-all; }

.env-card-actions { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 2px; }
.env-card-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 0.6875rem; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all .15s;
  white-space: nowrap;
}
.env-card-btn:disabled { opacity: .5; cursor: not-allowed; }
.env-card-btn-install { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.env-card-btn-install:hover { opacity: .9; transform: translateY(-1px); }
.env-card-btn-uninstall { background: transparent; color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }
.env-card-btn-uninstall:hover { background: rgba(239,68,68,.08); }
.env-card-btn-cancel { background: transparent; color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.env-card-btn-cancel:hover { background: rgba(251,191,36,.08); }
.env-card-btn-start { background: transparent; color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.env-card-btn-start:hover { background: rgba(74,222,128,.08); }
.env-card-btn-recheck { background: transparent; color: var(--tbp-text-dim); border: 1px solid var(--tbp-border); padding: 4px 7px; }
.env-card-btn-recheck:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }

/* ========================================
 *  Agent 侧栏列表（我的Agent分区）
 * ======================================== */
.agent-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; cursor: pointer;
  transition: background .15s; font-size: 12px;
  border-left: 3px solid transparent;
}
.agent-item:hover { background: var(--tbp-glass-bg); }
.agent-item.active {
  background: var(--tbp-glass-bg) !important;
  border-left-color: #f59e0b;
}
.agent-item-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.agent-item-name {
  flex: 1; min-width: 0;
  color: var(--tbp-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.agent-item-desc {
  font-size: 0.6875rem; color: var(--tbp-text-muted);
  white-space: nowrap; max-width: 60px; overflow: hidden; text-overflow: ellipsis;
}
.agent-item-status {
  font-size: 12px; flex-shrink: 0;
}
.agent-item-run,
.agent-item-edit,
.agent-item-del {
  font-size: 12px; color: var(--tbp-text-muted);
  cursor: pointer; padding: 2px 4px; border-radius: 3px;
  transition: all .15s; flex-shrink: 0; visibility: hidden;
}
.agent-item:hover .agent-item-run,
.agent-item:hover .agent-item-edit,
.agent-item:hover .agent-item-del { visibility: visible; }
.agent-item-run:hover { color: #4ade80; background: rgba(74,222,128,.1); }
.agent-item-edit:hover { color: var(--tbp-accent); background: var(--tbp-info-bg); }
.agent-item-del:hover { color: var(--tbp-danger); background: var(--tbp-danger-bg); }

/* 草稿 Agent 样式：仅图标区分，不做特殊背景/边框 */
.agent-item-draft {
  /* 草稿由 📝 图标标识，无需额外样式 */
}

/* ========================================
 *  技能商店面板
 * ======================================== */
.skill-panel {
  padding: 0 20px 20px;
  overflow-y: auto; flex: 1;
}

/* 搜索 */
.skill-search-row { padding: 12px 0 8px; }
.skill-search-input {
  width: 100%; padding: 10px 14px;
  background: var(--tbp-bg-input); border: 1px solid var(--tbp-border);
  border-radius: 8px; color: var(--tbp-text-primary);
  font-size: 14px; outline: none; transition: border .2s;
  box-sizing: border-box;
}
.skill-search-input:focus { border-color: var(--tbp-accent); }

/* 分类标签 */
.skill-cat-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-bottom: 14px;
}
.skill-cat-tab {
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--tbp-border);
  background: transparent; color: var(--tbp-text-tertiary);
  font-size: 12px; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.skill-cat-tab:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.skill-cat-tab.active {
  background: var(--tbp-accent); color: #fff;
  border-color: var(--tbp-accent);
}

/* 技能网格 */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

/* 技能卡片 */
.skill-card {
  background: var(--tbp-bg-secondary);
  border: 1px solid var(--tbp-border);
  border-radius: 10px; padding: 14px 16px;
  transition: all .15s; display: flex; flex-direction: column;
}
.skill-card:hover { border-color: var(--tbp-accent); transform: translateY(-1px); }
.skill-card.installed { border-color: rgba(74,222,128,.3); }

.sk-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.sk-icon { font-size: 20px; }
.sk-meta { display: flex; align-items: center; gap: 4px; }
.sk-badge-pre {
  font-size: 0.6875rem; padding: 1px 6px; border-radius: 4px;
  background: rgba(102,126,234,.15); color: #8899ff;
}
.sk-ver { font-size: 0.6875rem; color: var(--tbp-text-muted); }

.sk-name {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-primary);
  margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sk-desc {
  font-size: 0.6875rem; color: var(--tbp-text-dim);
  margin-bottom: 8px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* @COUPLED 与 public/js/chat-director-agent-armory.js 的 sk-points 卡片积分消耗行同步 */
.sk-points {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.6875rem; color: var(--tbp-text-dim);
  margin-bottom: 8px;
}
.sk-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 8px;
}
.sk-tag {
  font-size: 0.6875rem; padding: 2px 7px; border-radius: 4px;
  background: var(--tbp-bg-hover); color: var(--tbp-text-dim);
}
.sk-tag-empty { font-size: 0.6875rem; color: var(--tbp-text-muted); }

.sk-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--tbp-border);
}
.sk-count {
  font-size: 0.6875rem; color: var(--tbp-text-dim);
}
.sk-actions { display: flex; gap: 4px; }

/* ========================================
 *  模型市场面板 (Phase 3.5)
 *  🍞 @COUPLED 改样式需同步: public/js/local-model-panel.js (renderMarketplace)
 * ======================================== */

/* 面板容器 */
.local-model-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}

/* 引擎状态栏 */
.local-model-topbar {
  padding: 10px 20px; border-bottom: 1px solid var(--tbp-border);
  background: var(--tbp-bg-secondary);
}
.local-engine-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.local-engine-item {
  display: flex; align-items: center; gap: 8px;
}
.local-engine-name {
  font-size: 13px; font-weight: 600; color: var(--tbp-text-primary);
}
.local-engine-badge {
  font-size: 0.6875rem; padding: 2px 10px; border-radius: 10px; font-weight: 600;
}
.engine-badge-running { background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.2); }
.engine-badge-stopped { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.2); }
.engine-badge-missing { background: rgba(239,68,68,.08); color: #fca5a5; border: 1px solid rgba(239,68,68,.15); }
.local-engine-refresh {
  background: none; border: 1px solid var(--tbp-border);
  color: var(--tbp-text-dim); border-radius: 6px;
  padding: 3px 8px; cursor: pointer; font-size: 13px;
}
.local-engine-refresh:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.local-engine-vram {
  font-size: 12px; padding: 2px 10px; border-radius: 10px;
  background: rgba(74,222,128,.08); color: #4ade80;
  border: 1px solid rgba(74,222,128,.15); font-weight: 600;
  margin-left: auto;
}
.local-engine-vram-unknown {
  background: rgba(255,255,255,.04); color: var(--tbp-text-dim);
  border: 1px solid var(--tbp-border);
}

/* 市场滚动区域 */
.local-model-market {
  flex: 1; overflow-y: auto; padding: 16px 20px 24px;
}
.market-loading {
  text-align: center; padding: 40px 20px; color: var(--tbp-text-dim); font-size: 14px;
}

/* 分组 */
.market-group {
  margin-bottom: 28px;
}
.market-group-title {
  font-size: 13px; font-weight: 700; color: var(--tbp-text-dim);
  padding: 0 0 10px 4px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: space-between;
}

/* 导入按钮（v7.9 手动导入本地模型） */
.market-import-btn {
  font-size: 12px; font-weight: 600; color: var(--tbp-accent, #4f9eff);
  background: transparent; border: 1px solid var(--tbp-accent, #4f9eff);
  border-radius: 6px; padding: 3px 10px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.market-import-btn:hover {
  background: var(--tbp-accent, #4f9eff); color: #fff;
}

/* 卡片网格：参照环境卡片 .env-group-cards */
.market-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

/* 单张卡片：参照 .env-card */
.market-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 16px; border-radius: 10px;
  /* 🍞 2026-07-26(v5): 底 #0f1117≈背景色(镂空)→#1a1d27 抬亮一档；边框实心灰→白透明度 */
  background: var(--tbp-bg-secondary); border: 1px solid var(--tbp-border-a1);
  transition: border-color .15s;
}
.market-card:hover { border-color: rgba(102,126,234,.3); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,.1); }
.market-card-empty, .market-card-placeholder {
  justify-content: center; align-items: center; min-height: 60px;
  color: var(--tbp-text-dim); font-size: 13px; grid-column: 1 / -1;
  background: transparent; border-style: dashed;
}

/* 卡片头部 */
.market-card-head {
  display: flex; align-items: center; justify-content: space-between;
}
.market-card-name {
  font-size: 14px; font-weight: 700; color: var(--tbp-text-primary);
}
.market-card-engine { font-size: 16px; flex-shrink: 0; }

/* 卡片简介 */
.market-card-desc {
  font-size: 0.6875rem; color: var(--tbp-text-dim); line-height: 1.5;
  min-height: 16px;
}

/* 卡片元信息 */
.market-card-meta {
  display: flex; gap: 14px; font-size: 0.6875rem; color: var(--tbp-text-muted);
  align-items: center;
}

/* 🍞 兼容性标记 */
.market-compat-badge {
  font-size: 14px; margin-left: auto; flex-shrink: 0;
}
.market-compat-ok { color: #4ade80; }
.market-compat-tight { color: #fbbf24; }
.market-compat-no { color: #fca5a5; }
.market-compat-unknown { color: var(--tbp-text-dim); }

/* 卡片按钮区 */
.market-card-actions {
  display: flex; gap: 6px; padding-top: 4px;
}
.market-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 0.6875rem; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; transition: all .15s;
  white-space: nowrap;
}
.market-btn:disabled { opacity: .4; cursor: not-allowed; }
.market-btn-install {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
  flex: 1;
}
.market-btn-install:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.market-btn-installed {
  background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.2);
  flex: 1;
}
.market-btn-uninstall {
  background: transparent; color: #fca5a5; border: 1px solid rgba(239,68,68,.2);
}
.market-btn-uninstall:hover:not(:disabled) { background: rgba(239,68,68,.08); }
.market-btn-test {
  background: transparent; color: #4ade80; border: 1px solid rgba(74,222,128,.2);
}
.market-btn-test:hover:not(:disabled) { background: rgba(74,222,128,.08); }
.market-btn-cancel {
  background: rgba(239,68,68,.1); color: #fca5a5; border: 1px solid rgba(239,68,68,.25);
  font-weight: 600;
}
.market-btn-cancel:hover { background: rgba(239,68,68,.2); }

/* 下载进度条（市场卡片内） */
.market-progress-wrap {
  position: relative; flex: 1; height: 28px;
  background: var(--tbp-bg-secondary); border-radius: 6px; overflow: hidden;
}
/* 🍞 暂停状态：高度自适应 + 不裁切，露出继续安装按钮 */
.market-progress-paused-wrap {
  position: relative; flex: 1;
  background: var(--tbp-bg-secondary); border-radius: 6px; overflow: visible;
}
.market-progress-paused-wrap .market-progress-bar {
  height: 28px;
}
.market-progress-paused-wrap .market-progress-text {
  height: 28px;
}
.market-btn-resume {
  display: block; width: 100%; margin-top: 6px;
  padding: 5px 10px; background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border: none; border-radius: 4px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  text-align: center; white-space: nowrap;
}
.market-btn-resume:hover { opacity: .9; }
.market-progress-bar {
  height: 100%; background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 6px; transition: width .3s;
}
.market-progress-text {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 0.6875rem; color: #fff; font-weight: 600;
}
/* 🍞 @BUGFIX 2026-07-10: ollama create 无百分比 → 不确定进度条动画条纹 */
.market-progress-bar.indeterminate,
.model-card-progress-bar.indeterminate {
  background: linear-gradient(90deg, #4a9eff 25%, #1a6dd4 50%, #4a9eff 75%);
  background-size: 200% 100%;
  animation: indeterminate-slide 1.5s infinite linear;
}
@keyframes indeterminate-slide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 🍞 安装路径弹窗 */
.market-install-dialog {
  background: var(--tbp-bg-card); border-radius: 12px;
  padding: 24px; max-width: 480px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}


/* ========================================
 * 🍞 模型市场右侧 Tab 面板（2026-07-09 新增）
 * 对齐 workspace-panel tab 模式：display 切换，创建一次不销毁
 * @COUPLED 改样式需同步: public/js/local-model-panel.js (_renderModelRightPanel)
 * ======================================== */

.model-right-panel {
  flex-shrink: 0;
  transition: width 0.3s ease;
}

/* Tab 按钮栏 */
#modelRightTabs .model-tab-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--tbp-text-dim);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
#modelRightTabs .model-tab-btn:hover {
  color: var(--tbp-text-primary);
  background: rgba(255,255,255,.04);
}
#modelRightTabs .model-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: rgba(59,130,246,.08);
}

/* Tab 面板内容区 */
.model-tab-panel {
  flex-direction: column;
  overflow: hidden;
}

/* 终端行样式覆盖 */
#localModelTermLines .term-progress {
  background: rgba(251,191,36,.06);
}

/* 响应式 */
@media (max-width:768px) {
  .market-cards { grid-template-columns: 1fr; }
  .local-model-market { padding: 12px 12px 20px; }
  .local-model-topbar { padding: 10px 12px; }
}

.sk-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 0.6875rem;
  font-weight: 600; cursor: pointer; border: 1px solid var(--tbp-accent);
  background: none; color: var(--tbp-accent);
  transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.sk-btn:hover { background: var(--tbp-accent); color: #fff; }
.sk-btn-install {
  background: var(--tbp-accent); color: #fff; border-color: var(--tbp-accent);
}
.sk-btn-install:hover { background: var(--tbp-accent-hover); }
.sk-btn-installed {
  color: #4ade80; border-color: rgba(74,222,128,.3); background: rgba(74,222,128,.08);
  font-size: 0.6875rem;
}
.sk-btn-uninstall {
  color: var(--tbp-text-muted); border-color: transparent; padding: 4px 6px;
}
.sk-btn-uninstall:hover { color: var(--tbp-danger); background: var(--tbp-danger-bg); }
/* 🍞 2026-08-01(武装面板只读化): 技能/工具随桌面端打包的灰色占位标（不可点） */
.sk-btn-muted {
  color: var(--tbp-text-muted); border-color: var(--tbp-border); background: none;
  font-size: 0.6875rem; cursor: default;
}

/* Skill 快捷下拉（聊天输入栏） */
.skill-quick-dropdown {
  position: absolute; bottom: 52px; left: 10px;
  background: var(--tbp-bg-secondary); border: 1px solid var(--tbp-border);
  border-radius: 10px; padding: 8px 0; min-width: 200px; max-width: 280px;
  z-index: var(--tbp-z-dropdown); box-shadow: 0 4px 16px rgba(0,0,0,.3);
  display: none;
}
.skill-quick-dropdown.show { display: block; }
.skill-qd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 12px; color: var(--tbp-text-secondary);
  cursor: pointer; transition: background .1s;
}
.skill-qd-item:hover { background: var(--tbp-bg-hover); }
.skill-qd-item .sk-qd-toggle {
  width: 32px; height: 18px; border-radius: 9px; flex-shrink: 0;
  background: #444; position: relative; transition: background .2s;
}
.skill-qd-item .sk-qd-toggle.on { background: #4ade80; }
.skill-qd-item .sk-qd-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: left .2s;
}
.skill-qd-item .sk-qd-toggle.on::after { left: 16px; }
.skill-qd-item .sk-qd-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-qd-divider {
  border-top: 1px solid var(--tbp-border); margin: 4px 0;
}
.skill-qd-link {
  display: block; padding: 8px 14px; font-size: 12px;
  color: var(--tbp-accent); cursor: pointer; text-decoration: none;
}
.skill-qd-link:hover { background: var(--tbp-bg-hover); }
.skill-qd-empty {
  padding: 10px 14px; font-size: 12px; color: var(--tbp-text-dim); text-align: center;
}

/* ===== 🛡️ 武装 Agent 面板（Agent 商店 + 我的 Agent + 装备库） ===== */
.armory-panel {
  width: 100%; max-width: none; margin: 0;
  padding: 12px 16px 48px; display: flex; flex-direction: column; gap: 26px;
  overflow-y: auto; flex: 1; min-height: 0; box-sizing: border-box;
}
.armory-section {
  background: rgba(255,255,255,.03); border: 1px solid var(--tbp-border);
  border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(8px);
}
.armory-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.armory-section-title { font-size: 16px; font-weight: 600; color: var(--tbp-text-primary); letter-spacing: .5px; }
/* 区块中文说明：一句话讲清这个区是干什么的 */
.armory-section-desc {
  font-size: 13px; line-height: 1.6; color: var(--tbp-text-dim);
  background: rgba(34,211,238,.05); border: 1px solid rgba(34,211,238,.15);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
.armory-add-btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--tbp-accent);
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(59,130,246,.15));
  color: #22d3ee; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: inherit;
}
.armory-add-btn:hover { box-shadow: 0 0 12px rgba(34,211,238,.4); transform: translateY(-1px); }

/* Agent 装配区卡片网格 */
.armory-agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.agent-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(160deg, rgba(30,41,59,.7), rgba(15,23,42,.7));
  border: 1px solid var(--tbp-border); border-radius: 12px; padding: 14px; transition: all .18s;
}
.agent-card:hover { border-color: rgba(34,211,238,.5); box-shadow: 0 0 18px rgba(34,211,238,.18); transform: translateY(-2px); }
.agent-card.active { border-color: rgba(34,211,238,.55); box-shadow: 0 0 16px rgba(34,211,238,.2); }
.agent-card-top { display: flex; align-items: center; justify-content: space-between; }
.agent-icon { font-size: 22px; }
.asm-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.asm-dot-on { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.asm-dot-off { background: #64748b; }
.agent-name { font-size: 15px; font-weight: 600; color: var(--tbp-text-primary); }
.agent-type-badge {
  align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3);
}
.agent-desc { font-size: 12px; color: var(--tbp-text-muted); line-height: 1.4; max-height: 34px; overflow: hidden; }
.equip-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.eq-chip {
  font-size: 12px; padding: 3px 8px; border-radius: 8px;
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.25); color: #67e8f9;
}
.agent-actions { display: flex; gap: 6px; margin-top: 4px; }
.asm-btn {
  flex: 1; padding: 6px 4px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--tbp-border); background: var(--tbp-bg-primary); color: var(--tbp-text-secondary);
  transition: all .15s; font-family: inherit;
}
.asm-btn:hover { border-color: var(--tbp-accent); color: var(--tbp-text-primary); }
.asm-btn-primary { background: linear-gradient(135deg, #22d3ee, #3b82f6); color: #fff; border-color: transparent; }
.asm-btn-primary:hover { box-shadow: 0 0 12px rgba(34,211,238,.4); }
.asm-btn-danger:hover { border-color: var(--tbp-danger); color: var(--tbp-danger); }

/* 装备库 Tab */
.arsenal-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--tbp-border); padding-bottom: 10px; }
.arsenal-tab {
  padding: 8px 16px; border-radius: 10px 10px 0 0; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--tbp-text-muted); transition: all .15s; font-family: inherit;
}
.arsenal-tab:hover { color: var(--tbp-text-primary); }
.arsenal-tab.active {
  color: #22d3ee; border-color: var(--tbp-border); border-bottom-color: transparent;
  background: rgba(34,211,238,.08); box-shadow: inset 0 -2px 0 #22d3ee;
}
.arsenal-content { min-height: 340px; }

/* 工具 Tab 双栏：左分类小列表 + 右搜索/卡片（解决"下拉看不到尽头"） */
.tool-layout { display: flex; gap: 14px; align-items: stretch; }
.tool-sidebar {
  width: 150px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px;
  max-height: 480px; overflow-y: auto; padding-right: 4px; box-sizing: border-box;
}
.tool-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  color: var(--tbp-text-muted); border: 1px solid transparent; transition: all .15s;
  user-select: none;
}
.tool-sidebar-item:hover { background: rgba(255,255,255,.04); color: var(--tbp-text-primary); }
.tool-sidebar-item.active {
  background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.35); color: #22d3ee; font-weight: 600;
}
.tsi-icon { font-size: 15px; flex-shrink: 0; }
.tsi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsi-count {
  font-size: 11px; color: var(--tbp-text-dim); flex-shrink: 0;
  background: rgba(255,255,255,.06); border-radius: 20px; padding: 1px 7px;
}
.tool-cards-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; max-height: 480px; }
.tool-search-bar {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin-bottom: 12px; padding: 7px 10px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--tbp-border);
}
.tool-search-icon { font-size: 14px; opacity: .7; }
.tool-search-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--tbp-text-primary); font-size: 13px; font-family: inherit;
}
.tool-search-input::placeholder { color: var(--tbp-text-dim); }
.tool-search-clear {
  flex-shrink: 0; border: none; background: rgba(255,255,255,.06); color: var(--tbp-text-dim);
  border-radius: 6px; width: 22px; height: 22px; cursor: pointer; font-size: 12px; line-height: 1;
}
.tool-search-clear:hover { color: var(--tbp-text-primary); background: rgba(255,255,255,.12); }
.tool-equipped-only {
  flex-shrink: 0; display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--tbp-text-muted); cursor: pointer; white-space: nowrap;
}
.tool-equipped-only input { cursor: pointer; }
.tool-cards { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; box-sizing: border-box; }

/* 窄窗适配：双栏变纵向，左分类改成顶部横向胶囊 */
@media (max-width: 640px) {
  .tool-layout { flex-direction: column; }
  .tool-sidebar { width: auto; flex-direction: row; flex-wrap: wrap; max-height: none; padding-right: 0; }
  .tool-sidebar-item { flex: 0 0 auto; }
  .tool-cards-wrap { max-height: 70vh; }
}

/* 云端模型（装备库第4 Tab）：按 model_category 分组 */
.model-group { margin-bottom: 18px; }
.model-group-title {
  font-size: 14px; font-weight: 600; color: var(--tbp-text-secondary);
  margin-bottom: 10px; padding-left: 2px; border-left: 3px solid #6366f1; padding-left: 8px;
}
.model-group .skill-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* 任务模式选择器：已启用云端模型提示条 */
.cloud-model-hint {
  margin-top: 18px; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; color: #a5b4fc; background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.3); line-height: 1.6;
}

/* 装配抽屉 / 弹窗 */
.asm-drawer-overlay {
  position: fixed; inset: 0; background: rgba(2,6,18,.6); backdrop-filter: blur(3px);
  z-index: 9999; display: none; align-items: stretch; justify-content: flex-end;
}
.asm-drawer-overlay.open { display: flex; animation: asmFade .2s ease; }
@keyframes asmFade { from { opacity: 0; } to { opacity: 1; } }
.asm-drawer {
  width: 420px; max-width: 94vw; height: 100%;
  background: linear-gradient(180deg, #0f172a, #0b1120);
  border-left: 1px solid rgba(34,211,238,.3); box-shadow: -8px 0 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; animation: asmSlide .25s ease;
}
@keyframes asmSlide { from { transform: translateX(40px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.asm-modal { height: auto; max-height: 90vh; margin: auto; border-radius: 14px; width: 380px; border: 1px solid rgba(34,211,238,.3); }
.asm-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--tbp-border); }
.asm-drawer-title { font-size: 16px; font-weight: 600; color: var(--tbp-text-primary); }
.asm-drawer-close { background: none; border: none; color: var(--tbp-text-muted); font-size: 18px; cursor: pointer; }
.asm-drawer-close:hover { color: var(--tbp-text-primary); }
.asm-drawer-preview { padding: 8px 16px; font-size: 13px; color: #67e8f9; background: rgba(34,211,238,.06); border-bottom: 1px solid var(--tbp-border); }
.asm-drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.asm-group-title { font-size: 14px; font-weight: 600; color: var(--tbp-text-secondary); margin-bottom: 8px; }
.asm-group-empty { font-size: 12px; color: var(--tbp-text-dim); padding: 6px 0; }
.asm-check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--tbp-border); margin-bottom: 8px; cursor: pointer;
  background: rgba(255,255,255,.02); transition: all .15s;
}
.asm-check:hover { border-color: rgba(34,211,238,.4); }
.asm-check.checked { border-color: rgba(34,211,238,.55); background: rgba(34,211,238,.08); box-shadow: 0 0 10px rgba(34,211,238,.12); }
.asm-check input { width: 16px; height: 16px; accent-color: #22d3ee; }
.asm-check-name { font-size: 14px; color: var(--tbp-text-primary); }
.asm-drawer-foot { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--tbp-border); }
.asm-drawer-foot .asm-btn { flex: 1; padding: 10px; }
.asm-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.asm-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--tbp-text-secondary); }
.asm-field input, .asm-field select {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--tbp-border);
  background: var(--tbp-bg-primary); color: var(--tbp-text-primary); font-size: 14px; font-family: inherit;
}
.asm-field input:focus, .asm-field select:focus { outline: none; border-color: var(--tbp-accent); }

/* 🛠 工具组卡片（按 group_id 折叠式分组） */
.tool-group-card {
  margin-bottom: 14px; border-radius: 12px;
  border: 1px solid rgba(34,211,238,.15);
  background: linear-gradient(135deg, rgba(15,23,42,.8), rgba(11,17,32,.9));
  overflow: hidden; transition: border-color .2s;
}
.tool-group-card:hover { border-color: rgba(34,211,238,.35); }
.tool-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; cursor: pointer;
  user-select: none; transition: background .15s;
}
.tool-group-header:hover { background: rgba(255,255,255,.03); }
.tool-group-icon { font-size: 20px; }
.tool-group-name { font-size: 15px; font-weight: 600; color: var(--tbp-text-primary); flex: 1; }
.tool-group-badge {
  font-size: 12px; color: var(--tbp-text-dim);
  background: rgba(255,255,255,.06); border-radius: 20px; padding: 2px 10px;
}
.tool-group-arrow {
  font-size: 12px; color: var(--tbp-text-dim);
  transition: transform .25s;
}
.tool-group-card.collapsed .tool-group-arrow { transform: rotate(-90deg); }
.tool-group-body {
  padding: 0 18px 12px;
  transition: max-height .35s ease, opacity .25s;
  overflow: hidden;
}
.tool-group-card.collapsed .tool-group-body {
  max-height: 0 !important; opacity: 0; padding-top: 0; padding-bottom: 0;
}
.tool-group-body .skill-grid { margin-top: 0; }
