/* ============= 基础 ============= */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;font-size:14px;color:#1f2937;}
body{background:#f4f6fb;}
[v-cloak]{display:none}
a{color:inherit;text-decoration:none;}
pre,code{font-family:Consolas,"Fira Code",monospace;}

/* ============= 侧边栏 ============= */
.side{
  position:fixed;left:0;top:0;bottom:0;width:210px;
  background:#1f2a40;color:#c7ced8;z-index:100;
  transition:width .2s;display:flex;flex-direction:column;
}
.side.collapsed{width:60px;}
.side-brand{
  display:flex;align-items:center;gap:10px;
  padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);
  font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;flex-shrink:0;
}
.brand-dot{
  width:34px;height:34px;border-radius:8px;flex-shrink:0;
  background:linear-gradient(135deg,#5b7cff,#8a6cff);
  display:flex;align-items:center;justify-content:center;font-size:14px;color:#fff;
}
.side-nav{flex:1;overflow:auto;padding:8px 0;}
.nav-item{
  display:flex;align-items:center;gap:12px;
  padding:0 20px;height:46px;line-height:46px;cursor:pointer;
  white-space:nowrap;transition:.15s;border-left:3px solid transparent;
}
.nav-item:hover{background:rgba(255,255,255,.05);color:#fff;}
.nav-item.active{background:linear-gradient(90deg,rgba(91,124,255,.35),transparent);color:#fff;border-left-color:#5b7cff;}
.nav-icon{font-size:16px;width:20px;text-align:center;flex-shrink:0;}
.nav-text{font-size:14px;}
.side-collapse{
  height:32px;line-height:32px;text-align:center;cursor:pointer;
  background:rgba(255,255,255,.04);color:#8f9bb3;font-size:14px;user-select:none;
}
.side-collapse:hover{background:rgba(255,255,255,.08);color:#fff;}

/* ============= 顶部栏 ============= */
.topbar{
  position:fixed;top:0;left:210px;right:0;height:56px;z-index:50;
  background:#fff;border-bottom:1px solid #eef0f5;
  display:flex;align-items:center;justify-content:space-between;padding:0 22px;
  transition:left .2s;
}
.side.collapsed ~ .topbar{left:60px;}
.topbar-title{font-size:17px;font-weight:600;color:#1f2937;}
.topbar-right{display:flex;align-items:center;gap:14px;}
.topbar-token{font-size:12px;color:#9aa3b2;background:#f3f5fa;border-radius:20px;padding:4px 12px;}

.user-chip{
  display:inline-flex;align-items:center;gap:8px;cursor:pointer;
  padding:4px 12px 4px 4px;border-radius:22px;background:#f3f5fa;transition:.15s;
}
.user-chip:hover{background:#e8ecf5;}
.user-avt{
  width:28px;height:28px;border-radius:50%;
  background:linear-gradient(135deg,#5b7cff,#8a6cff);color:#fff;
  font-weight:600;font-size:13px;display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.user-name{font-weight:500;color:#2a3550;}
.user-role{
  font-size:11px;padding:2px 8px;border-radius:10px;background:#e5e8f0;color:#6b7280;
}
.user-role.is-admin{background:#ffe1e1;color:#d93636;}

/* ============= 主内容 ============= */
.content{
  position:absolute;top:56px;left:210px;right:0;bottom:0;
  overflow:auto;padding:20px;transition:left .2s;
}
.content.content-collapsed{left:60px;}

/* ============= 操作栏 ============= */
.opbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:#fff;border:1px solid #eef0f5;border-radius:10px;
  padding:12px 16px;margin-bottom:14px;flex-wrap:wrap;
}
.opbar-left{display:flex;gap:10px;flex-wrap:wrap;}
.opbar-right{color:#6b7280;font-size:13px;}
.opbar-right b{color:#1f2937;font-size:15px;margin:0 4px;}

/* ============= 面板 ============= */
.panel{
  background:#fff;border:1px solid #eef0f5;border-radius:10px;
  padding:16px 18px;margin-bottom:14px;
}
.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;flex-wrap:wrap;}
.panel-title{font-size:16px;font-weight:600;color:#1f2937;margin-bottom:4px;}
.panel-desc{color:#6b7280;font-size:13px;line-height:1.7;max-width:720px;}

/* ============= 过滤栏 ============= */
.filter-bar{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin-bottom:14px;padding-bottom:12px;border-bottom:1px dashed #eef0f5;
}

/* ============= 统计卡片 ============= */
.cards-title{font-size:14px;font-weight:600;color:#4a5568;margin:4px 0 10px;padding-left:2px;}
.cards-title:not(:first-child){margin-top:20px;}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:14px;}
@media (max-width:1200px){.cards{grid-template-columns:repeat(2,1fr);}}
.stat{background:#fff;border:1px solid #eef0f5;border-radius:10px;padding:16px 20px;}
.stat-label{color:#6b7280;font-size:13px;}
.stat-num{font-size:30px;font-weight:700;color:#2a3550;letter-spacing:-.5px;margin:4px 0 6px;line-height:1.1;}
.stat-sub{color:#9aa3b2;font-size:12px;display:flex;align-items:center;gap:6px;}

.stat-today{background:linear-gradient(135deg,#f6f9ff 0%,#eef4ff 100%);border-color:#dce6ff;}
.stat-today .stat-num{color:#3366cc;}

.delta{color:#9aa3b2;font-weight:500;}
.delta.up{color:#1a8838;font-weight:600;}

/* ============= 表格（纯 HTML 自制） ============= */
.tbl-wrap{
  width:100%;overflow-x:auto;
  border:1px solid #eef0f5;border-radius:8px;background:#fff;
}
.tbl-wrap::-webkit-scrollbar{height:10px;}
.tbl-wrap::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:5px;}
.tbl-wrap::-webkit-scrollbar-track{background:#f1f5f9;}

.tbl{
  width:100%;min-width:max-content;border-collapse:separate;border-spacing:0;
  font-size:13px;
}
.tbl thead th{
  position:sticky;top:0;z-index:1;
  background:#f7f9fc;color:#4a5568;font-weight:600;
  text-align:left;padding:10px 14px;
  border-bottom:1px solid #eef0f5;white-space:nowrap;
}
.tbl tbody td{
  padding:10px 14px;border-bottom:1px solid #f3f5f9;
  color:#2a3550;vertical-align:middle;
}
.tbl tbody tr:hover{background:#f9fbff;}
.tbl tbody tr.selected{background:#eef4ff;}
.tbl tbody tr.selected:hover{background:#e2ecff;}
.tbl tbody tr:last-child td{border-bottom:none;}
.tbl input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:#5b7cff;}
.tbl .tbl-empty{
  text-align:center;color:#9aa3b2;padding:50px 0;font-size:13px;
}
.tbl .mono{font-family:Consolas,monospace;font-size:12.5px;color:#4a5568;white-space:nowrap;}
.tbl .ellipsis{
  max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ============= 状态徽章 ============= */
.pill{
  display:inline-block;font-size:12px;line-height:1;
  padding:4px 9px;border-radius:12px;white-space:nowrap;
  background:#eef2f7;color:#4a5568;
}
.pill.ok{background:#e6f7ea;color:#1a8838;}
.pill.danger{background:#ffe5e5;color:#c33;}
.pill.warn{background:#fff5e0;color:#b77b00;}
.pill.info{background:#e7f0ff;color:#3366cc;}
.pill.dim{background:#f3f5fa;color:#b0b6c2;}

/* ============= 账号表：审核徽章组 & 子表头 ============= */
.audit-pills{display:inline-flex;gap:4px;flex-wrap:nowrap;justify-content:center;}
.audit-pills .pill{padding:3px 7px;font-size:11px;}
.sub-th{display:flex;justify-content:space-around;gap:2px;margin-top:4px;font-weight:400;}
.sub-th-item{
  display:inline-flex;align-items:center;gap:2px;
  font-size:11px;color:#8893a7;cursor:pointer;user-select:none;
  padding:1px 4px;border-radius:4px;transition:.15s;
}
.sub-th-item:hover{background:#eef2ff;color:#5b7cff;}
.sub-th-item.active{background:#eef2ff;color:#5b7cff;font-weight:600;}
.sub-th-item .sort-icon{font-size:10px;color:#c3cad6;}
.sub-th-item.active .sort-icon,
.sub-th-item:hover .sort-icon{color:#5b7cff;}
.pill.dim{background:#f2f4f8;color:#a0a8b8;}

/* ============= 审核分布徽章组（账号列表） ============= */
.audit-pills{display:inline-flex;gap:4px;flex-wrap:nowrap;justify-content:center;}
.audit-pills .pill{padding:3px 7px;font-size:11px;min-width:32px;text-align:center;}

/* ============= 子表头（表头内的细分排序项） ============= */
.sub-th{
  display:flex;justify-content:space-around;gap:4px;margin-top:4px;
  font-weight:400;font-size:11px;color:#8a93a6;
}
.sub-th-item{
  padding:1px 5px;border-radius:4px;cursor:pointer;user-select:none;
}
.sub-th-item:hover{background:#eef2ff;color:#5b7cff;}
.sub-th-item.active{background:#eef2ff;color:#5b7cff;font-weight:600;}
.sub-th-item .sort-icon{font-size:10px;margin-left:2px;color:#c3cad6;}
.sub-th-item.active .sort-icon{color:#5b7cff;}

/* ============= 智能体列 ============= */
.agent-cell{display:flex;align-items:center;gap:10px;}
.agent-logo{width:36px;height:36px;border-radius:6px;object-fit:cover;flex-shrink:0;background:#f3f5fa;}
.agent-name-wrap{min-width:0;}
.agent-name{font-weight:600;color:#2a3550;}
.agent-appid{color:#9aa3b2;font-size:11.5px;font-family:Consolas,monospace;margin-top:2px;}

/* ============= 对话记录 ============= */
.convo-item{border:1px solid #eef0f5;border-radius:8px;padding:12px 14px;margin-bottom:12px;background:#fff;}
.convo-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;flex-wrap:wrap;gap:6px;}
.convo-head .q{font-weight:600;color:#2a3550;}
.convo-head .meta{color:#9aa3b2;font-size:12px;}
.qa{border-top:1px dashed #eef0f5;padding:10px 0;}
.qa:first-child{border-top:none;padding-top:4px;}
.qa .q2{font-weight:500;margin-bottom:6px;color:#24324a;}
.qa .q2 b{color:#5b7cff;margin-right:4px;}
.qa .a{color:#3a465e;background:#f8faff;padding:10px 12px;border-radius:6px;font-size:13px;line-height:1.7;white-space:pre-wrap;word-break:break-word;}
.qa .a a{color:#5b7cff;}
.qa .t{font-size:11px;color:#9aa3b2;margin-top:4px;text-align:right;}

/* ============= 原始数据 ============= */
.raw{
  background:#0f172a;color:#d1e7ff;padding:14px;border-radius:6px;
  max-height:520px;overflow:auto;font-size:12px;
  white-space:pre-wrap;word-break:break-all;margin:0;
}

/* ============= 弹窗 ============= */
.dlg-hint{
  background:#f4f7ff;border-left:3px solid #5b7cff;
  padding:10px 14px;border-radius:4px;line-height:1.7;
  color:#4a5568;font-size:13px;
}
.dlg-hint code{background:#eef2ff;padding:2px 6px;border-radius:4px;color:#5b7cff;}
.dlg-tip{margin-top:6px;color:#9aa3b2;font-size:12px;}
.mono-input .el-textarea__inner{font-family:Consolas,"Fira Code",monospace;font-size:12.5px;}

/* Element Plus 弹窗：限制最大高度，内部滚动 */
.el-dialog{max-height:90vh;display:flex !important;flex-direction:column;margin-top:5vh !important;margin-bottom:5vh !important;}
.el-dialog__header{flex-shrink:0;}
.el-dialog__body{flex:1 1 auto;overflow-y:auto;min-height:0;}
.el-dialog__footer{flex-shrink:0;border-top:1px solid #eef0f5;padding:12px 20px;}

/* ============= Element Plus 细节 ============= */
.el-button+.el-button{margin-left:8px;}
.el-button--small.is-link+.el-button--small.is-link{margin-left:10px;}

/* ============= 分页条 ============= */
.pager-bar{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #eef0f5;background:#fafbfd;}

/* ============= 日期范围选择器 ============= */
.filter-bar .el-date-editor--daterange{width:210px !important;min-width:0;flex:0 0 210px;}
.filter-bar .el-date-editor--daterange .el-range-input{font-size:12px;min-width:0;padding:0 2px;}
.filter-bar .el-date-editor--daterange .el-range__icon{margin:0 2px 0 2px;flex-shrink:0;}
.filter-bar .el-date-editor--daterange .el-range-separator{flex:none;padding:0 2px;line-height:28px;font-size:12px;color:#a8b1c2;}
.filter-bar .el-date-editor--daterange .el-range__close-icon{flex-shrink:0;margin-left:2px;}

/* ============= 可排序表头 ============= */
.tbl th.sortable{cursor:pointer;user-select:none;position:relative;}
.tbl th.sortable:hover{background:#eef2ff;color:#5b7cff;}
.tbl th.sortable.active{background:#eef2ff;color:#5b7cff;}
.tbl th .sort-icon{display:inline-block;margin-left:4px;font-size:10px;color:#c3cad6;transition:.15s;}
.tbl th.sortable:hover .sort-icon,
.tbl th.sortable.active .sort-icon{color:#5b7cff;font-weight:bold;}

/* ============= 进度条弹窗 ============= */
/* ============= 内嵌进度条（百度账号页按钮旁） ============= */
.inline-progress{
  flex:1 1 320px;min-width:320px;max-width:560px;
  background:#f4f7ff;border:1px solid #dbe3f6;border-radius:6px;
  padding:6px 12px;margin-left:8px;
  display:flex;flex-direction:column;gap:4px;
}
.inline-progress .ip-title{
  display:flex;align-items:center;gap:10px;font-size:13px;color:#344563;
}
.inline-progress .ip-title b{color:#1f3b8b;}
.inline-progress .ip-meta{color:#4a5568;font-size:12px;}
.inline-progress .ip-owner{color:#d97706;font-size:12px;margin-left:4px;}
.inline-progress .ip-meta .ok{color:#16a34a;font-weight:600;}
.inline-progress .ip-meta .fail{color:#dc2626;font-weight:600;}
.inline-progress .ip-close{
  margin-left:auto;cursor:pointer;color:#8894a8;font-size:18px;line-height:1;padding:0 4px;
}
.inline-progress .ip-close:hover{color:#dc2626;}
.inline-progress .ip-current{
  font-size:12px;color:#6a7790;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.progress-box{padding:4px 2px;}
.progress-meta{
  display:flex;gap:18px;margin-top:14px;font-size:13px;color:#4a5568;
  align-items:center;
}
.progress-meta .ok{color:#16a34a;font-weight:600;}
.progress-meta .fail{color:#dc2626;font-weight:600;}
.progress-current{
  margin-top:10px;padding:8px 12px;background:#f4f7ff;border-radius:4px;
  color:#3a465e;font-size:13px;min-height:34px;
}
.progress-log{
  margin-top:10px;max-height:220px;overflow-y:auto;
  border:1px solid #eef0f5;border-radius:4px;padding:6px 10px;
  background:#fafbfd;font-size:12.5px;
}
.progress-log-item{padding:4px 0;border-bottom:1px dashed #eef0f5;line-height:1.7;}
.progress-log-item:last-child{border-bottom:none;}
.progress-log-item .dim{color:#8a94a6;margin-left:6px;}

/* 智能体批量删除按钮旁的小提示 */
.ag-del-tip{
  margin-left:8px;color:#909399;font-size:12px;
}

/* ============= 分享链接 / 二维码弹窗 ============= */
.share-box{padding:4px 2px;}
.share-meta{
  background:#f7f9fc;border:1px solid #eef0f5;border-radius:8px;
  padding:10px 14px;margin-bottom:14px;
}
.share-meta-row{display:flex;align-items:center;gap:10px;font-size:13px;line-height:1.9;}
.share-meta-row .lbl{color:#9aa3b2;width:64px;flex-shrink:0;}
.share-meta-row .val{color:#2a3550;font-weight:500;word-break:break-all;}
.share-meta-row .val.mono{font-family:Consolas,monospace;font-size:12.5px;color:#4a5568;font-weight:400;}

.share-link-box{margin-bottom:16px;}
.share-link-label{font-size:13px;color:#4a5568;margin-bottom:6px;font-weight:500;}
.share-link-row{display:flex;gap:8px;align-items:center;}
.share-link-row .el-input{flex:1;}
.share-link-row .el-input__inner,
.share-link-row .el-input__wrapper{font-family:Consolas,monospace;font-size:12.5px;}

.share-qr-box{
  border:1px dashed #dbe3f6;border-radius:8px;
  background:linear-gradient(135deg,#f6f9ff 0%,#eef4ff 100%);
  padding:14px;
}
.share-qr-wrap{
  display:flex;align-items:center;justify-content:center;
  min-height:240px;background:#fff;border-radius:6px;padding:10px;
}
.share-qr-img{
  width:240px;height:240px;display:block;
  image-rendering:pixelated;
}
.share-qr-empty{color:#9aa3b2;font-size:13px;}
.share-qr-actions{
  display:flex;align-items:center;gap:12px;margin-top:10px;
}
.share-qr-tip{color:#9aa3b2;font-size:12px;margin-left:auto;}
