:root {
  --green: #07C160;
  --green-d: #06ad56;
  --text: #1a1a1a;
  --text-2: #646464;
  --line: #e6e6e6;
  --bg: #f2f3f5;
  --card: #ffffff;
  --danger: #fa5151;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b9a52 0%, #07C160 100%);
}
.login-card {
  width: 360px;
  background: #fff;
  border-radius: 14px;
  padding: 36px 30px 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo {
  width: 56px; height: 56px; line-height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--green);
  color: #fff; font-size: 28px; font-weight: 700;
}
.brand h1 { font-size: 20px; margin: 0; }
.brand-sub { color: var(--text-2); margin: 4px 0 0; font-size: 13px; }

.auth-form label {
  display: block;
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 13px;
}
.auth-form input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.auth-form input:focus { border-color: var(--green); }
.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.auth-submit:hover { background: var(--green-d); }
.auth-submit:disabled { opacity: .6; cursor: default; }
.hint { color: #9a9a9a; font-size: 12px; text-align: center; margin: 12px 0 0; }
.error { color: var(--danger); font-size: 12px; min-height: 16px; margin: 8px 0 0; text-align: center; }

/* ---------- 后台布局 ---------- */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-weight: 600; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.dev-name { color: var(--text-2); font-size: 13px; }

.content { max-width: 880px; margin: 0 auto; padding: 22px 20px 60px; }
.content-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.content-head h2 { font-size: 17px; margin: 0; }

/* ---------- 按钮 ---------- */
.btn-primary {
  background: var(--green); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; font-size: 14px;
  cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: var(--green-d); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line); padding: 8px 14px;
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: #d0d0d0; }
.btn-mini {
  background: #f2f3f5; color: var(--green); border: none;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-mini:hover { background: #e6f7ee; }
.btn-danger { color: var(--danger) !important; }
.btn-danger:hover { background: #fdeaea; }
.btn-warn { color: #e6820a !important; }
.btn-warn:hover { background: #fdf3e8; }

/* ---------- 机器人列表 ---------- */
.bot-list { display: flex; flex-direction: column; gap: 12px; }
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.batch-all { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.batch-check { width: 16px; height: 16px; cursor: pointer; flex: 0 0 auto; }
.loading, .empty { color: var(--text-2); text-align: center; padding: 40px 0; }
.bot-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bot-avatar, .avatar-lg {
  width: 48px; height: 48px; border-radius: 12px;
  flex: 0 0 auto;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 20px;
}
.avatar-box { display: flex; }
.bot-main { flex: 1 1 auto; min-width: 0; }
.bot-row1 { display: flex; align-items: center; gap: 8px; }
.bot-name { font-weight: 600; font-size: 15px; }
.bot-desc { color: var(--text-2); font-size: 13px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-ep {
  color: #9a9a9a; font-size: 12px; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bot-code { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.bot-code code, .field code {
  background: #f2f3f5; padding: 1px 6px; border-radius: 5px;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px;
}
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge-on { background: #e6f7ee; color: var(--green); }
.badge-off { background: #f2f3f5; color: #9a9a9a; }
.badge-rec { background: #fff7e6; color: #d46b08; }
.btn-rec-on { color: #d46b08 !important; border-color: #ffd591 !important; background: #fff7e6 !important; }
.bot-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* ---------- 向导步骤 ---------- */
.wizard-steps {
  display: flex; align-items: center; margin-bottom: 20px;
  padding: 0 4px;
}
.wizard-step {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.wizard-step.active { color: var(--green); }
.wizard-step.done { color: #888; }
.wizard-step-num {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.wizard-step.active .wizard-step-num { background: var(--green); color: #fff; border-color: var(--green); }
.wizard-step.done .wizard-step-num { background: #e0e0e0; border-color: #e0e0e0; }
.wizard-step-line { flex: 1; height: 1px; background: var(--line); margin: 0 8px; }
.wizard-conn-hint { font-size: 12px; color: #9a9a9a; margin: 4px 0 8px; line-height: 1.5; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 14px; width: 460px; max-width: 100%;
  max-height: 90vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  border: none; background: transparent; font-size: 22px; line-height: 1;
  color: #9a9a9a; cursor: pointer;
}
.form { padding: 18px 20px 20px; }
.form label { display: block; margin-bottom: 13px; color: var(--text-2); font-size: 13px; }
.form input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.form input:focus { border-color: var(--green); }
.form select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
  background: #fff;
}
.form select:focus { border-color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.invite-body { padding: 20px; text-align: center; }
.avatar-box { justify-content: center; margin-bottom: 8px; }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 16px; font-size: 26px;
}
.invite-body h4 { margin: 4px 0 16px; font-size: 16px; }
.field {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; text-align: left;
}
.field-label { width: 72px; color: var(--text-2); font-size: 13px; flex: 0 0 auto; }
.field code { flex: 1 1 auto; }
.field code.break { word-break: break-all; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100;
}
.toast-error { background: rgba(250, 81, 81, 0.92); }

/* ---------- 二维码 ---------- */
.qr-section {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.qr-title { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.qr {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 180px; min-height: 180px;
  padding: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
}
.qr svg { display: block; }
.qr-fallback { color: #9a9a9a; font-size: 12px; padding: 24px 8px; }
.qr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* ---------- 连通探针 ---------- */
.probe-result {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px; font-size: 12px; color: var(--text-2); min-height: 18px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line);
}
.tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 10px 16px; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.content-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.content-head h2 { font-size: 17px; font-weight: 600; color: var(--text-1); }
.head-meta { font-size: 12px; color: var(--text-3); }

/* ---------- 筛选栏 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select, .filters input {
  height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: 13px; background: var(--card); color: var(--text-1);
}
.filters input { width: 180px; }
.filters select { min-width: 130px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  color: var(--text-1); vertical-align: top;
}
table.tbl th { background: var(--bg-2); color: var(--text-2); font-weight: 600; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--bg-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.nowrap { white-space: nowrap; }
.msg-content { max-width: 360px; word-break: break-word; line-height: 1.5; }

/* ---------- 消息列表增强 ---------- */
.msg-id-cell { white-space: nowrap; }
.msg-id-cell .mono { font-size: 11px; color: var(--text-2); }
.sender-cell { white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sender-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px;
  font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.sender-bot { background: #e8f5fd; color: #1989FA; }
.sender-user { background: #e6f7ee; color: var(--green); }
.sender-name { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-content-cell { max-width: 380px; }
.msg-content-text { white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: 13px; }
.btn-copy-inline {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: #bbb; font-size: 13px; padding: 0 3px; vertical-align: middle;
  border-radius: 4px; transition: color .12s, background .12s;
}
.btn-copy-inline:hover { color: var(--green); background: #f0faf4; }

.role { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: var(--bg-2); color: var(--text-2); }
.role-user { background: rgba(25,137,250,0.12); color: #1989FA; }
.role-bot { background: rgba(7,193,96,0.12); color: #07C160; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.pager-info { font-size: 12px; color: var(--text-3); margin-right: auto; }

.bot-probe { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.probe-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d0d0d0; flex: 0 0 auto;
}
.probe-idle { background: #d0d0d0; }
.probe-ok   { background: var(--green); }
.probe-warn { background: #FF9C19; }
.probe-err  { background: var(--danger); }
.probe-text { color: var(--text-2); font-size: 12px; }

/* ---------- 邀请增强：审核 / 次数限制 / 自定义表单 ---------- */
.badge-warn { background: #fff3e0; color: #d48806; }
.btn-ok { background: var(--green); color: #fff; border: 1px solid var(--green-d); }
.btn-ok:hover { background: var(--green-d); }
.checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--text-2); font-size: 13px; }
.checkbox input { width: auto; margin: 0; }

.form-designer {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; margin: 6px 0 12px; background: #fafafa;
}
.fd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fd-title { font-size: 13px; font-weight: 600; color: var(--text); }
.fd-list { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.fd-empty { color: #9a9a9a; font-size: 12px; padding: 4px 0; }
.fd-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
}
.fd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fd-label { flex: 1 1 160px; margin: 0; min-width: 140px; }
.fd-type { padding: 8px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.fd-req { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.fd-options { width: 100%; margin: 0; }
.fd-del { flex: 0 0 auto; }

.form-data-body { padding: 18px 20px; }
.fd-view-row {
  display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.fd-view-row:last-child { border-bottom: none; }
.fd-view-label { width: 120px; flex: 0 0 120px; color: var(--text-2); }
.fd-view-value { flex: 1; word-break: break-all; }
.fd-archived-title { margin: 14px 0 4px; font-size: 12px; color: var(--text-3, #999); }
.fd-view-archived .fd-view-label { color: var(--text-3, #999); font-style: italic; }
.fd-view-archived .fd-view-value { color: var(--text-2); }

/* ---------- 角色徽标 / 登录切换 ---------- */
.dev-role {
  font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-right: 8px;
  border: 1px solid var(--line);
}
.role-admin { background: #eaf6ff; color: #1677ff; border-color: #b9dcff; }
.role-business { background: #f0f7ec; color: #389e0d; border-color: #cfeebf; }
.switch-line { text-align: center; margin: 10px 0 0; font-size: 13px; }
.switch-line a { color: var(--green-d); text-decoration: none; }
.switch-line a:hover { text-decoration: underline; }
.form-title { font-size: 17px; margin: 0 0 14px; text-align: center; position: relative; padding-bottom: 12px; }
.form-title::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 36px; height: 3px; border-radius: 3px; background: var(--green);
}
.reg-notice {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f0f9f3; border: 1px solid #cdeedd;
  color: #2f7a52; font-size: 12.5px; line-height: 1.5;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 18px;
}
.reg-notice-ico {
  flex: 0 0 auto; width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; font-weight: 700;
  margin-top: 1px;
}
.field-req {
  display: block; margin-top: 5px; color: #9a9a9a; font-size: 12px;
}
.auth-form input:focus + .field-req { color: var(--green-d); }

/* ---------- 账号审核 ---------- */
.sub-title { font-size: 14px; color: var(--text-2); margin: 22px 0 10px; font-weight: 600; }
.acct-list { display: flex; flex-direction: column; gap: 10px; }
.acct-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.acct-main { display: flex; align-items: center; gap: 10px; }
.acct-name { font-weight: 600; font-size: 15px; }
.acct-time { color: var(--text-2); font-size: 12px; }
.acct-actions { display: flex; gap: 8px; }
.btn-remark { font-size: 11px; padding: 1px 6px; vertical-align: middle; }
.remark-text { font-size: 13px; color: var(--text-2); }
.mono.nowrap, .nowrap { white-space: nowrap; }

/* 通用消息色 */
.ok { color: var(--green-d); font-size: 13px; margin: 8px 0 0; }

/* ---------- 媒体文件 ---------- */
.media-thumb {
  width: 48px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: #f2f3f5; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb-ext { font-size: 10px; color: var(--text-2); text-transform: uppercase; }

/* ---------- 批量清理弹窗 ---------- */
.batch-time-row { display: flex; align-items: center; gap: 8px; }
.batch-time-row input { flex: 1; min-width: 0; width: auto; margin-top: 0; }
.batch-time-sep { flex: 0 0 auto; color: var(--text-2); }
.batch-quick { display: flex; align-items: center; gap: 8px; margin: -5px 0 13px; }
.batch-quick-label { font-size: 12px; color: #9a9a9a; flex: 0 0 auto; }
.batch-quick-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 14px; padding: 3px 12px; font-size: 12px; cursor: pointer;
}
.batch-quick-btn:hover { color: var(--green); border-color: var(--green); background: #f0faf4; }
.batch-quick-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- 推荐管理 ---------- */
.rec-layout { display: flex; gap: 24px; align-items: flex-start; }
.rec-panel { flex: 1; min-width: 0; background: #fff; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.rec-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.rec-search { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; width: 160px; }
.rec-list { padding: 8px 0; min-height: 60px; }
.rec-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f5f5f5; }
.rec-item:last-child { border-bottom: none; }
.rec-avatar { width: 36px; height: 36px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; }
.rec-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rec-item-name { font-size: 14px; font-weight: 500; }
.rec-item-desc { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rec-sort-input { width: 56px; height: 26px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; text-align: center; }
.req { color: var(--danger); }
.btn-push { color: #1989fa !important; border-color: #a0cfff !important; }
.btn-push:hover { background: #ecf5ff !important; }
.btn-builtin { color: #722ed1 !important; border-color: #d3adf7 !important; }
.btn-builtin:hover { background: #f9f0ff !important; }

/* ---------- 连通器选择器 ---------- */
.conn-section { margin-bottom: 13px; }
.conn-section-label { color: var(--text-2); font-size: 13px; margin-bottom: 8px; display: block; }
.conn-tabs {
  display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px;
}
.conn-tab {
  flex: 1; appearance: none; border: none; border-right: 1px solid var(--line);
  background: #fff; cursor: pointer; padding: 7px 10px; font-size: 13px; color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}
.conn-tab:last-child { border-right: none; }
.conn-tab:hover { background: var(--bg); color: var(--text); }
.conn-tab.active { background: var(--green); color: #fff; font-weight: 600; }
.conn-panel { padding: 4px 0 2px; }
.endpoint-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.endpoint-row input { flex: 1; min-width: 0; width: auto; margin-top: 0; }
.probe-inline { justify-content: flex-start; margin-top: 6px; min-height: 18px; }

/* ---------- 接入文档 ---------- */
.docs-body { max-width: 720px; }
.docs-hero { margin-bottom: 28px; }
.docs-hero h2 { font-size: 20px; margin: 0 0 6px; }
.docs-lead { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0; }

.docs-section { margin-bottom: 32px; }
.docs-section h3 {
  font-size: 15px; font-weight: 600; margin: 0 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.docs-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}

.cred-grid { display: flex; flex-direction: column; gap: 10px; }
.cred-card {
  background: #f7f9fc; border: 1px solid #e0e7ef; border-radius: 10px;
  padding: 12px 14px;
}
.cred-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.cred-row { display: flex; align-items: center; gap: 8px; }
.cred-val {
  flex: 1; font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; color: #1a1a1a; background: none; border: none;
  outline: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.cred-desc { font-size: 12px; color: #9a9a9a; margin-top: 5px; line-height: 1.5; }

.mode-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mode-table th, .mode-table td {
  padding: 9px 12px; border: 1px solid var(--line); text-align: left;
}
.mode-table th { background: #f7f7f7; font-weight: 600; }
.mode-table td:first-child { font-weight: 500; }
.mode-badge-ws { color: #1989FA; font-weight: 600; }
.mode-badge-wh { color: var(--green); font-weight: 600; }

.docs-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.docs-tab {
  padding: 7px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.12s, border-color 0.12s;
}
.docs-tab:hover { color: var(--text); }
.docs-tab.active { color: var(--green); border-bottom-color: var(--green); }

.code-block-wrap { position: relative; }
.code-block {
  background: #1e1e2e; color: #cdd6f4; font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.65; padding: 16px 18px;
  border-radius: 10px; overflow-x: auto; margin: 0; white-space: pre;
}
.code-copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.12); border: none; color: #cdd6f4;
  border-radius: 5px; padding: 3px 9px; font-size: 11px; cursor: pointer;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.22); }

.docs-bot-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.docs-bot-row label { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.docs-bot-row select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: #fff; outline: none;
}
.docs-bot-row select:focus { border-color: var(--green); }

.docs-notice {
  background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px;
  padding: 10px 14px; font-size: 12.5px; color: #7a5c00; line-height: 1.6;
  margin-bottom: 14px;
}
.faq-list { margin: 0; padding: 0; }
.faq-list dt { font-weight: 600; font-size: 13.5px; color: #222; margin: 14px 0 4px; }
.faq-list dt:first-child { margin-top: 0; }
.faq-list dd { margin: 0 0 0 0; font-size: 13px; color: #555; line-height: 1.7; }
.docs-section-panel { display: none; }
.docs-section-panel.active { display: block; }

/* ---------- AI 上下文文档生成卡片 ---------- */
.ai-doc-card {
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5fd 100%);
  border: 1px solid #c3e6cb;
  border-radius: 12px;
  padding: 20px 22px 18px;
  margin-bottom: 28px;
}
.ai-doc-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ai-doc-card-title { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.ai-doc-card-sub { font-size: 13px; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.ai-doc-card-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-doc-card-row label { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ai-doc-card-row select {
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: #fff; outline: none; flex: 1; min-width: 160px;
}
.ai-doc-card-row select:focus { border-color: var(--green); }
.btn-ai-copy, .btn-ai-dl {
  padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; white-space: nowrap;
}
.btn-ai-copy { background: var(--green); color: #fff; }
.btn-ai-copy:hover { background: var(--green-d); }
.btn-ai-copy:disabled { opacity: .5; cursor: default; }
.btn-ai-dl { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn-ai-dl:hover { background: #f0faf4; }
.btn-ai-dl:disabled { opacity: .5; cursor: default; }

/* ---------- 用户标记 ---------- */
.friend-label-name { color: var(--text); font-weight: 500; }

/* ---------- 通信日志 ---------- */
.log-status-ok    { color: #07c160; font-weight: 500; }
.log-status-fail  { color: var(--danger); font-weight: 500; }
.log-status-warn  { color: #fa8c16; font-weight: 500; }
.log-channel-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.log-channel-webhook { background: #e8f4fd; color: #1989fa; }
.log-channel-ws      { background: #f0faf4; color: #07c160; }
.log-channel-push    { background: #fdf3e8; color: #e6820a; }
.log-detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding: 12px 0 16px; font-size: 13px; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.log-detail-meta span { white-space: nowrap; }
.log-detail-meta b   { color: var(--text); }
.log-detail-section  { margin-top: 14px; }
.log-detail-label    { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.log-json {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 12px; font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow-y: auto;
  margin: 0;
}
.log-json-error { background: #fff5f5; border-color: #ffd6d6; color: var(--danger); }
