/* ============================================================
   绮帅AISaaS · AI 模式公共样式表
   来源：17 个页面内联 <style> 块（16 场景页 + index.html 的 AI 部分）
   说明：仅搬运 AI 相关样式，未改动任何一条规则；常规模式样式见 qs_common.css
   抽取日期：2026-11-20
   ============================================================ */

/* --- 1. AI 知识图谱抽屉（原 110 字符内联块，17 页完全一致）--- */
.ai-kg-drawer{transition:transform .32s ease !important}.ai-kg-drawer.open{transform:translateX(0) !important}

/* --- 2. AI 模型配置中心 / AI 面板（原 9,335 字符内联块，16 页完全一致）--- */
/* ============ AI 模型配置中心（独立页面） ============ */
.mc-page{height:100%;display:flex;flex-direction:column;background:var(--bg,#0b0f19);overflow:hidden}
.mc-head{display:flex;align-items:center;gap:14px;padding:14px 22px;border-bottom:1px solid var(--line,#1e2740);flex-shrink:0}
.mc-head h2{font-size:17px;margin:0;color:var(--text,#e6ecff);flex:1}
.mc-body{display:flex;flex:1;min-height:0}
.mc-side{width:300px;border-right:1px solid var(--line,#1e2740);padding:14px;overflow-y:auto;flex-shrink:0}
.mc-list-head{font-size:12px;color:var(--text-3,#8a94b0);margin-bottom:10px;display:flex;justify-content:space-between;align-items:center}
.mc-item{border:1px solid var(--line,#1e2740);border-radius:10px;padding:10px 12px;margin-bottom:8px;cursor:pointer;background:var(--bg-2,#111827);transition:border-color .15s}
.mc-item:hover{border-color:var(--primary,#0070f3)}
.mc-item.active{border-color:var(--primary,#0070f3);background:var(--primary-weak,rgba(0,112,243,.08))}
.mc-item .mi-row{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.mc-item .mi-name{font-size:13px;color:var(--text,#e6ecff);font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mc-item .mi-p{font-size:11px;color:var(--text-2,#aab4d0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mc-item .mi-op{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.mc-main{flex:1;padding:20px 26px;overflow-y:auto}
.mc-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--text-3,#8a94b0);font-size:13px;gap:8px;text-align:center;line-height:1.8}
.mc-form{max-width:660px}
.mc-form h3{font-size:15px;margin:0 0 4px;color:var(--text,#e6ecff)}
.mc-form .mf-sub{font-size:12px;color:var(--text-3,#8a94b0);margin-bottom:16px;line-height:1.7}
.mc-form .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 14px}
.mc-form .form-field{display:flex;flex-direction:column;gap:5px}
.mc-form .form-field.full{grid-column:1/-1}
.mc-form label{font-size:12px;color:var(--text-2,#aab4d0)}
.mc-form input,.mc-form select,.mc-form textarea{background:var(--bg-2,#111827);border:1px solid var(--line,#1e2740);color:var(--text,#e6ecff);border-radius:8px;padding:8px 10px;font-size:13px;outline:none;width:100%;box-sizing:border-box}
.mc-form input:focus,.mc-form select:focus,.mc-form textarea:focus{border-color:var(--primary,#0070f3)}
.mc-form .pw-wrap{position:relative}
.mc-form .pw-eye{position:absolute;right:8px;top:50%;transform:translateY(-50%);cursor:pointer;color:var(--text-3,#8a94b0);font-size:11px;background:none;border:none;padding:2px}
.mc-form .chip-row{display:flex;flex-wrap:wrap;gap:6px}
.mc-form .chip{font-size:11px;padding:3px 9px;border:1px dashed var(--line,#2a3550);border-radius:20px;color:var(--text-2,#aab4d0);cursor:pointer;background:transparent}
.mc-form .chip:hover{color:var(--primary,#0070f3);border-color:var(--primary,#0070f3)}
.mc-form .mf-actions{display:flex;gap:10px;margin-top:20px;align-items:center}
.mc-test-result{font-size:12px;border-radius:8px;padding:8px 12px;margin-top:12px;line-height:1.6;word-break:break-all}
.mc-test-result.ok{background:rgba(22,199,132,.1);color:#16c784;border:1px solid rgba(22,199,132,.3)}
.mc-test-result.err{background:rgba(242,72,75,.1);color:#f2484b;border:1px solid rgba(242,72,75,.3)}
.mc-tip{font-size:11px;color:var(--text-3,#8a94b0);line-height:1.7;margin-top:16px;padding-top:12px;border-top:1px dashed var(--line,#1e2740)}
.mc-status-dot{width:7px;height:7px;border-radius:50%;display:inline-block;flex-shrink:0}
.mc-status-dot.on{background:#16c784}
.mc-status-dot.off{background:#6b7280}
.mg-count{font-size:11px;color:var(--text-3,#8a94b0)}
/* 模型切换弹层：分组与已配置徽标 */
.model-pop .mp-group{font-size:10.5px;color:var(--text-3);letter-spacing:1px;padding:6px 4px 4px}
.model-pop .mo-tag{font-size:10px;color:var(--primary);border:1px solid var(--primary);border-radius:20px;padding:0 6px;flex-shrink:0;line-height:1.6}
.model-pop .mo-badge{font-size:10px;color:#16c784;flex-shrink:0;margin-left:auto}
/* 右侧面板 Tab 行：7 个 Tab 放不下时横向滚动（隐藏滚动条）；「模型配置」高亮为入口按钮 */
.ai-panel-tabs{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.ai-panel-tabs::-webkit-scrollbar{display:none;height:0}
.ai-panel-tab{flex:0 0 auto;min-width:44px}
.ai-panel-tab[data-panel="model"]{color:#7cb8ff;border-color:var(--primary);background:var(--primary-weak);box-shadow:0 0 8px rgba(0,112,243,.15)}
.ai-panel-tab[data-panel="model"]:hover{color:#fff}

/* ===== 全局强制兜底样式（自动适配浅色/深色模式） ===== */
/* 所有输入框 */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], 
input[type="search"], input[type="tel"], input[type="url"], textarea, select {
  background:var(--qs-panel2) !important;
  color:var(--qs-txt) !important;
  border:1px solid var(--qs-line) !important;
  border-radius:8px !important;
  padding:7px 10px !important;
  outline:none !important;
}
input::placeholder, textarea::placeholder {
  color:var(--qs-txt3) !important;
}

/* 所有按钮 */
button {
  border-radius:8px !important;
  cursor:pointer !important;
}

/* 所有表格 */
table {
  width:100% !important;
  border-collapse:collapse !important;
}
th {
  background:var(--qs-panel2) !important;
  color:var(--qs-txt2) !important;
  font-weight:600 !important;
  padding:10px 12px !important;
  text-align:left !important;
  border-bottom:1px solid var(--qs-line) !important;
}
td {
  padding:10px 12px !important;
  border-bottom:1px solid var(--qs-line) !important;
  color:var(--qs-txt) !important;
}

/* 所有卡片/面板容器 */
.card, .panel, .box, .container {
  background:var(--qs-panel) !important;
  border:1px solid var(--qs-line) !important;
  border-radius:12px !important;
}

/* 所有弹窗遮罩 */
.modal-mask, .dialog-mask, .overlay {
  background:rgba(3,8,18,.7) !important;
}

/* 所有弹窗内容 */
.modal-content, .dialog-content {
  background:var(--qs-panel) !important;
  border:1px solid var(--qs-line) !important;
  border-radius:14px !important;
  color:var(--qs-txt) !important;
}

/* 操作按钮（编辑/删除等小按钮） */
.btn-sm, .action-btn, .link-btn {
  padding:4px 10px !important;
  font-size:12px !important;
  border-radius:6px !important;
  cursor:pointer !important;
}

/* 链接文字 */
a {
  color:var(--primary) !important;
  text-decoration:none !important;
}
a:hover {
  opacity:.8 !important;
}

/* 空状态提示 */
.empty-state, .qs-empty, .no-data {
  color:var(--qs-txt3) !important;
  text-align:center !important;
  padding:40px 20px !important;
  font-size:13px !important;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width:8px !important;
  height:8px !important;
}
::-webkit-scrollbar-track {
  background:transparent !important;
}
::-webkit-scrollbar-thumb {
  background:var(--qs-line) !important;
  border-radius:4px !important;
}
::-webkit-scrollbar-thumb:hover {
  background:var(--qs-txt3) !important;
}

/* 全局悬浮球 */
.float-ball {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0070f3;
  box-shadow: 0 4px 16px rgba(0,112,243,.4);
  cursor: move;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  user-select: none;
  transition: transform .2s;
}

.float-ball:hover {
  transform: scale(1.05);
}

/* AI助理弹窗 */
.ai-popup {
  position: fixed;
  right: 30px;
  bottom: 100px;
  width: 380px;
  height: 500px;
  background: var(--qs-panel);
  border: 1px solid var(--qs-line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-popup.show {
  display: flex;
}

.ai-popup-header {
  padding: 14px 16px;
  background: var(--qs-panel2);
  border-bottom: 1px solid var(--qs-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--qs-txt);
}

.ai-popup-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--qs-txt2);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-popup-close:hover {
  background: var(--qs-line);
}

.ai-popup-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-msg.user {
  align-self: flex-end;
  background: #0070f3;
  color: #fff;
}

.ai-msg.bot {
  align-self: flex-start;
  background: var(--qs-panel2);
  color: var(--qs-txt);
}

.ai-popup-input {
  padding: 12px 16px;
  border-top: 1px solid var(--qs-line);
  display: flex;
  gap: 8px;
}

.ai-popup-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--qs-line);
  border-radius: 8px;
  background: var(--qs-panel2);
  color: var(--qs-txt);
  outline: none;
  font-size: 13px;
}

.ai-popup-input button {
  padding: 8px 16px;
  background: #0070f3;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
