
/* ============================================================
   管理后台：左侧导航 + 内容区布局
   ============================================================ */
.adm-shell {
  display: flex;
  height: 100%;
  min-height: calc(100vh - 0px);
  background: var(--bg-layout, #f7f7f8);
}

/* 管理员模式下隐藏对话侧栏，后台占满整屏 */
.app[data-mode="admin"] #sidebar,
.app[data-mode="admin"] #scrim,
.app[data-mode="admin"] #btnExpand,
.app[data-mode="admin"] #btnCollapse,
.app[data-mode="admin"] #chatScroll,
.app[data-mode="admin"] .head-actions {
  display: none !important;
}
.app[data-mode="admin"] #admin {
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
}
.app[data-mode="admin"] .console-inner { display: none; }

/* 左侧导航 */
.adm-nav {
  width: 216px;
  flex: 0 0 216px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border-right: 1px solid var(--border-l1, #e5e5e8);
  background: var(--bg-sidebar, #fbfbfc);
}
.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.adm-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  background: var(--brand, #3964fe);
}
.adm-brand b { display: block; font-size: 14px; line-height: 1.2; }
.adm-brand small { font-size: 11px; color: var(--text-tertiary, #8a8a92); }

.adm-menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.adm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary, #55555c);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.adm-item svg { flex: 0 0 16px; opacity: .78; }
.adm-item:hover { background: var(--bg-hover, #eeeef2); color: var(--text-primary, #1b1b1f); }
.adm-item[aria-selected="true"] {
  background: var(--brand, #3964fe);
  color: #fff;
}
.adm-item[aria-selected="true"] svg { opacity: 1; }
.adm-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.adm-item[aria-selected="true"] .adm-badge { background: rgba(255,255,255,.28); }
.adm-foot { padding-top: 8px; border-top: 1px solid var(--border-l1, #e5e5e8); }

/* 内容区 */
.adm-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.adm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--border-l1, #e5e5e8);
  background: var(--bg-elevated, #fff);
}
.adm-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.adm-head-actions { display: flex; align-items: center; gap: 10px; }

.adm-body {
  flex: 1;
  overflow: auto;
  padding: 20px 28px 40px;
}
.adm-body .panel { display: none; flex-direction: column; gap: 16px; }
.adm-body .panel.is-active { display: flex; }

/* 工具栏 */
.adm-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}
select.input.sm { padding-right: 6px; }

/* 设置表单 */
.adm-form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.adm-form .field { display: flex; flex-direction: column; gap: 6px; }
.adm-form .field label { font-size: 12px; color: var(--text-secondary, #55555c); }
.adm-form-foot { padding-top: 4px; }

/* 数据清理 */
.adm-cleanup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 14px;
}
.adm-cleanup label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.notice.warn {
  border-left: 3px solid #e5a23c;
  background: rgba(229, 162, 60, .09);
}

/* 用户表格内的余额输入 */
.adm-quota-input {
  width: 110px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid var(--border-l2, #d8d8de);
  border-radius: 6px;
  background: var(--bg-elevated, #fff);
  color: var(--text-primary, #1b1b1f);
  font-variant-numeric: tabular-nums;
}
.adm-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 窄屏 */
@media (max-width: 860px) {
  .adm-nav { width: 64px; flex-basis: 64px; padding: 12px 8px; }
  .adm-brand div, .adm-item span.adm-label { display: none; }
  .adm-item { justify-content: center; }
  .adm-body { padding: 16px 14px 32px; }
  .adm-head { padding: 14px 16px; }
}

/* ¼¼Äܰü / MCP */
.adm-skill-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 180px;
  overflow: auto;
}
.adm-doc {
  padding: 4px 9px;
  border: 1px solid var(--border-l2, #d8d8de);
  border-radius: 7px;
  background: var(--bg-elevated, #fff);
  font-size: 11px;
  color: var(--text-secondary, #55555c);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-doc:hover { border-color: var(--brand, #3964fe); color: var(--brand, #3964fe); }
.adm-doc.active { background: var(--brand, #3964fe); color: #fff; border-color: var(--brand, #3964fe); }
.adm-skill-body {
  margin: 0;
  padding: 14px;
  max-height: 460px;
  overflow: auto;
  background: var(--bg-inline-code, #f4f5f7);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.adm-foot { display: flex; flex-direction: column; gap: 6px; }
