/* 数据管理模块（ssfoundry 融合版）—— 全部规则 scope 在 .dmscope 下，避免与主站样式互染。
   注意：--bg/--card/--line 与主站 :root 变量同名不同值，定义在 .dmscope 上只作用于本模块子树。
   2026-09-05：原「智能体」层迁出为独立页签 Repo Agent（#tab-agent），两个 tab div 均挂 .dmscope 共用本文件样式。 */
.dmscope {
  --ink: #2b2c2c; --char: #464747; --green: #58b750; --green2: #73b36e;
  --bg: #f4f6f4; --card: #fff; --line: #e3e7e3; --mut: #8a918c;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
.dmscope, .dmscope * { box-sizing: border-box; margin: 0; }
/* 盒模型（宽度/居中/两侧内边距）由主站 .wrap 统一提供，与其他三个页签一致 */
.dmscope main { margin: 24px 0 0; display: grid; gap: 18px; }
.dmscope .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
         margin: 0; }  /* 复位主站 .card 渗入的 margin:18px 0（main grid gap 已有间距）；柔光 box-shadow 保留融合 */
.dmscope .card h2 { font-size: 14px; color: var(--char); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dmscope .card h2 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dmscope .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dmscope input[type=text], .dmscope input[type=password] { border: 1px solid var(--line); border-radius: 8px;
    padding: 9px 12px; font-size: 13px; outline: none; }
.dmscope input:focus { border-color: var(--green); }
.dmscope button { cursor: pointer; border: none; border-radius: 8px; font-size: 13px; padding: 8px 16px; }
.dmscope .btn { background: var(--green); color: #fff; }
.dmscope .btn:hover { background: #4aa343; }
.dmscope .btn.ghost { background: #fff; color: var(--char); border: 1px solid var(--line); }
.dmscope .btn:disabled { opacity: .55; cursor: wait; }
.dmscope .models { display: flex; gap: 8px; flex-wrap: wrap; }
.dmscope .chip { font-size: 12px; padding: 4px 12px; border-radius: 20px;
        background: #eef5ec; color: #3c7a37; border: 1px solid #d4e6d2; }
.dmscope .chip b { font-weight: 600; }
.dmscope .chip small { color: var(--mut); }
.dmscope .hint { font-size: 12px; color: var(--mut); }
/* 层级导航：连体分段控件，构造与主站 .seg（渠道选择器）完全同款；
   同时复位主站 nav{炭灰背景/sticky/z-index/阴影} 的元素选择器渗入 */
.dmscope .modnav { display: inline-flex; align-items: center; gap: 2px;
          max-width: none; margin: 6px 0 14px;
          position: static; z-index: auto; border: none; border-bottom: none;
          background: none; box-shadow: none; top: auto; }   /* 后五行均为复位主站 nav{} 元素选择器渗入（炭灰底/sticky/阴影） */
.dmscope .modnav a { display: inline-flex; align-items: center;
            font-size: 13.5px; font-weight: 500; color: #666; text-decoration: none;   /* 与主站二级 .subnav 同款：裸药丸组，仅激活项带浅绿底 */
            padding: 7px 16px; border-radius: 999px; border: none; background: none;
            cursor: pointer; transition: all .15s; }
.dmscope .modnav a:hover { color: #3c7a37; }
.dmscope .modnav a.on { background: #eef8ec; color: #3c7a37; font-weight: 600; }
.dmscope main section.card[data-layer] { display: none; }
.dmscope main section.card[data-layer].on { display: block; }
.dmscope .dropzone { border: 2px dashed #c8d2c8; border-radius: 10px; padding: 24px;
            text-align: center; font-size: 13px; color: var(--mut); cursor: pointer;
            transition: all .15s; }
.dmscope .dropzone:hover, .dmscope .dropzone.drag { border-color: var(--green); background: #eef5ec; color: #3c7a37; }
.dmscope .utable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dmscope .utable th, .dmscope .utable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dmscope .utable th { color: var(--mut); font-weight: 500; font-size: 12px; }
.dmscope .utable .del { color: #b3413e; cursor: pointer; }
.dmscope .result { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
          font-size: 13px; background: #fafbf9; }
.dmscope .result .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--mut); font-size: 12px; margin-bottom: 8px; }
.dmscope .result.ok .meta b { color: #3c7a37; }
.dmscope .result.bad { border-color: #ecc; background: #fdf5f5; }
.dmscope .result .reply { line-height: 1.7; white-space: pre-wrap; }
.dmscope .utable a, .dmscope .result a { color: #3c7a37; text-decoration: none; }
.dmscope .err { color: #b3413e; font-size: 12px; height: 16px; margin: 6px 0; }
.dmscope .spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #d5ddd5;
        border-top-color: var(--green); border-radius: 50%; animation: dmSpin 0.8s linear infinite; }
@keyframes dmSpin { to { transform: rotate(360deg); } }
/* 智能体聊天（#id 优先级高于 layer 的 display:block） */
.dmscope #mod-chat { display: none; flex-direction: column; height: calc(100vh - 190px); min-height: 560px; }
.dmscope #mod-chat.on { display: flex; }
/* Repo Agent 页签无层级子导航，聊天卡可比数据管理内高一截 */
#tab-agent #mod-chat { height: calc(100vh - 148px); }
.dmscope #chatMsgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.dmscope .chathello { margin: auto; text-align: center; max-width: 520px; }
/* display 必须显式写：主站全局 .msg{display:none}（登录/同步提示条）会把融合进来的聊天气泡藏掉 */
.dmscope .msg { display: block; max-width: 84%; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.75; }
.dmscope .msg.user { align-self: flex-end; background: #eef5ec; border: 1px solid #d4e6d2; white-space: pre-wrap; }
.dmscope .msg.bot { align-self: flex-start; background: #fafbf9; border: 1px solid var(--line); }
.dmscope .msg .tblwrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line);
                border-radius: 8px; background: #fff; }
.dmscope .msg .utable { width: 100%; border-collapse: collapse; font-size: 12px; margin: 0; }
.dmscope .msg .utable td { padding: 6px 10px; border-bottom: 1px solid var(--line);
                  vertical-align: top; overflow-wrap: anywhere; text-align: left;
                  white-space: normal; }  /* 主站全局 th,td{white-space:nowrap} 会渗入：长编码列表被压成一行撑爆表格 */
.dmscope .msg .utable tr:last-child td { border-bottom: none; }
.dmscope .msg .utable tr:nth-child(even) td { background: #fafcf9; }
.dmscope .msg .utable td.th { background: #eef4ec; font-weight: 700; color: #3c7a37;
                     white-space: nowrap; position: sticky; top: 0; }
.dmscope .msg .utable td.th:first-child { border-top-left-radius: 7px; }
.dmscope .msg .utable td.th:last-child { border-top-right-radius: 7px; }
.dmscope .msg code { background: #f0f2f0; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.dmscope .msg .mh { font-weight: 700; margin: 10px 0 3px; color: var(--ink); }
.dmscope .msg .mh:first-child { margin-top: 0; }
.dmscope .msg .li { padding-left: 14px; text-indent: -14px; margin: 3px 0; }
.dmscope .msg .msrc { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--line);
             color: var(--mut); font-size: 12px; }
.dmscope .chattl { font-size: 11px; color: var(--mut); margin-bottom: 6px; }
.dmscope .chattl summary { cursor: pointer; user-select: none; }
.dmscope #chatIn { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px;
          font-family: inherit; outline: none; resize: none; }
.dmscope #chatIn:focus { border-color: var(--green); }
/* 图谱全屏浮层（用 .on 类切换，不用 hidden 属性——display:flex 会覆盖它） */
.dmscope #semGFull { display: none; position: fixed; inset: 0; z-index: 40; background: var(--bg);
            flex-direction: column; }
.dmscope #semGFull.on { display: flex; }
.dmscope #semGFullStage .hint { margin: 0 0 6px; }
.dmscope #semGFullStage .models { margin: 0 0 8px; }
.dmscope #semGFullStage canvas { border-radius: 0; border: none; border-bottom: 1px solid var(--line); }

.dmscope #ssCv { width: 100%; }   /* 画布拉满卡片（evPos 按 rect 比例换算，CSS 缩放不影响交互） */
